text:
Q: php setter and getter not working My php getters and setter dont seem to be working properly. Here is my code. The file test.php contains the following...
class test{
    private static $instance;
    private $name=null;

    public static function getInstance(){
            if(!isset(test::$instance) ) {
                test::$instance = new test();
            }
           return test::$instance;
         }

    public function setName($n){
        $this->name=$n;
    }

    public function getName(){
        return $this->name;
    }

test2.php has a form which asks the user to enter their own name. When they click submit, I have code that looks like this to set the name they entered to the variable name in test.
$test=test::getInstance();
$test->setName("My PHP Test");
print "The name is " . $test->getName() . "
;

The name is My PHP Test is printed successfully.
However, once they submit a form on on test2.php which takes the user to test3.php and I try the same code to return the name, the value returned is null.
$test=test::getInstance();
print "The name is " . $test->getName() . "
;

The name is is printed.
I have added include('test.php'); to each file but this doesn't help.
Is there an error in my code? And also is this the correct approach in general? If not what is?
Any feedback is appreciated. Thanks.

A: Objects aren't persisted automatically, you need to store the data in test2.php and retrieve it in test3.php, either using a database, a form or cookies.

I have added include('test.php'); to each file but this doesn't help.

Probably because you are creating a new instance of test that overwrites the one in test.php


text:
Q: c++ structure containing object I want to create a struct let's say Mystruct,which contains an integer and a myObj object whose constructor takes 2 parameters(one of string and the other is int).I mean I want :
struct Mystruct{
   myObj obj();
   int a;
};

Now,after some operations, I want to create a Mystruct variable and initiliaze obj and a. To do that I write:
struct Mystruct* foo;
foo->a=5;
foo->obj=myObj("test",3);

Is it a good way to do that ?

A: Your struct doesn't contain an object, but rather, a function that returns one:
struct Mystruct{
   myObj obj();  // this is a function declaration
   int a;
};

It sounds like you meant
struct Mystruct{
   myObj obj;
   int a;
};

Then you can say
Mystruct foo; // default constructs obj: myObj must be default constructable
foo.a = 5;
foo.obj = myObj("test",3);

or
Mystruct foo = {myObj("test",3), 5};

Note the absence of pointers and dynamic allocation: you should only use those if you really need to, and if you know what you are doing.
For completeness, your attempt at pointers fails, because when you declare this pointer:
struct Mystruct* foo;

it doesn't point to anything useful (actually, it holds a memory address which you can consider to be random and points to somewhere you shouldn't be writing). So you cannot do this:
foo->a = 42; // Ooops, foo doesn't point to a MyStruct object yet.

You need to make foo point to a MyStruct object before using it in this way.

A: First of all your code snippet is invalid because you did not allocate memory for the structure instance.
Also you can not do that way. You should define a constructor in your structure that will call the constructor of obj  in the mem-initializer list  provided that obj has no default constructor.
Something as
struct Mystruct{

   Mystruct( syting s, int i ) : obj( s, i ) {}
   myObj obj;
   int a;
};

A: Assuming myObj has no default constructor (without an arguments) you can't just create Mystruct with myObj uninitialized. The proper way is to pass myObj value (or, better, reference to value) through the Mystruct constructor:
struct Mystruct{
    myObj obj;
    int a;
    Mystruct(int a, const myObj& obj) : a(a), obj(obj) {}
};

Here : a(a), obj(obj) is so called initialization list. a(foo) means initialize a with foo on construction of Mystruct object. In the example above a member of Mystruct is being initialized with a value from the constructor arguments. Looks a little bit strange, but let to avoid cumbersome parameter names like _a and so on.
And then initialize it like this:
Mystruct foo(5, myObj("test", 3));

A: caesar said that MyObj have two parameters as constructor. So, MyObj is similar to below code.
struct MyObj
{
        MyObj(string name, int number)
            : name_(name), number_(number) {}
        string  name_;
        int     number_;
};

And then, MyStruct have a MyObj as a member variable, so it has to have user-define constructor as like below, because MyObj has not default constructor, so MyStruct cannot have default constructor as well.
struct MyStruct{
    MyStruct(MyObj obj, int a)
       : my_obj_(obj), a_(a) {}
    MyObj my_obj_;
    int a_;
 };

 int main()
 {
     MyObj my_obj("tester", 1001);
     MyStruct my_struct(my_obj, 1);
     getchar();

     return 0;
 }

redpajama_set_name: RedPajamaStackExchange


text:
Q: Use masterpage CSS and JavaScript in ASP form child-page I have a master page which containing few CSS links and java scripts.
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script src="Scripts/slides.min.jquery.js" type="text/javascript"></script>

<asp:ContentPlaceHolder id="head" runat="server">
       <script  language="javascript" type="text/javascript">
           $(document).ready(
            function () {
                $("#pikame").PikaChoose();

            });
       </script>
</asp:ContentPlaceHolder>

`
I want to use this JavaScript and css style files ,in child ASP form page which has inherited from above master page.
<%@ Page Title="" Language="C#" asterPageFile="~/MasterPage.master"AutoEventWireup="true" CodeFile="LeadInformation.aspx.cs" Inherits="LeadInformation" %>
<%@ MasterType TypeName="MasterPage" %>
Seems this way not working. Please anyone help me to use masterpage CSS and JavaScript in child-page to me. Tx in advanced.

A: Put your script outside the ContentPlaceHolder tag. Just put it in the head section normally.
The ContentPlaceHolder tag should be empty in the Master Page - its contents will be replaced by the asp:Content tags in the Pages.
You can check if it's being rendered properly by browsing to the page and right-click -> View Source.

A: <asp:ContentPlaceHolder id="head" runat="server">

is used to provide script,css that are specific to only that child page
so if you want the scripts/css to be applied to the child pages just place it normally in the master page head section and outside head ContentPlaceHolder in master page..
Hope this helps....

A: First, child pages are not inherited from master pages. It's the same page.
Second, you don't need MasterType directive to access javascript.
So just consider masterpage and child page to be one as it will be one page when it renders to Browser and javascript runs on browser. So you can place your javascript/CSS anywhere in the head section of master page and access it from any of the child page in a same manner as they are on the same page.


text:
Q: Quantifying the uncertainty of aggregated model predictions Say I have a binary response variable, Y, that I model using a logistic model with four predictors, A, B, C and D. To make matters concrete, imagine that Y = 1 designates a respondent registering support for something, and 0 an absence of support.
Having estimated the relevant parameters on some sample, S, I then want to see what proportion of 1s (i.e., support) I likely would have seen, had all observations in S taken on a particular value on A. Assume conditions for causal inference are satisfied for A, so that changing its value can be thought of as a (hypothetical) intervention.
So I create a "new" sample, S*, identical, to S, save for each observation taking on the desired value on A. I then use the fitted model to "predict" the probability of Y = 1 for each observation in that sample. Taking the mean of those predictions I get an estimated proportion of support under the relevant intervention.
My question is: how should I quantify the uncertainty of that estimate? I can think of three ways, but am not sure which one (if any) makes sense:

*

*Resample from the predicted probabilities of the model and bootstrap a confidence interval for the relevant mean that way.

*Calculate a confidence interval for the prediction made on each observation (the probability that respondent 1 registers support, etc.) like here, and then create a confidence interval for mean support by taking the means of the upr and lwr values of the individual predictions.

*Resample from S* to fit a large number of models, generate predictions on each model, and then bootstrap a confidence interval for the relevant mean from these predictions.

Any advice here would be greatly appreciated.

A: If I am understanding you correctly, you want to create a confidence interval around the proportion of observations that would have resulted in $Y = 1$ given $A = a$. Your logistic regression already provides us with $P(Y = 1 | A = a, B = b, C = c, D = d)$. You are justified in taking the mean as a point estimate of $P(Y = 1|A = a)$ by the law of total probability. Because the proportion of observations where $Y = 1$ is logically equivalent to the probability that an observation will yield $Y = 1$ you could use the normal approximation computed on the predicted probabilities themselves to create a confidence interval.
Here is some R code that would do the trick
# fake data for demonstration
# 20 samples drawn from a uniform distribution between 0 and 1
predicted_probs <- runif(n = 50, min = 0, max = 1)

# estimate of the average probability
global_prob_est <- mean(predicted_probs)

# standard error of the estimate
global_prob_se <- sd(predicted_probs)/length(predicted_probs)

# 90% CI using the 5th and 95th percentiles of a normal distribution.
qnorm(p = (0.05, 0.95), mean = global_prob_est, sd = global_prob_se)


text:
Q: Passing id in form_for action I have a form to update an attribute of a model - I don't want it to go to the standard update action I want it to go to a different action.
<% for car in @cars %>
 <%= form_for car, :url => { :action => "custom_action/#{car.id}" } do |f| -%>

This is giving the following error -
No route matches {:action=>"custom_action/1", :controller=>"cars"}

However if I visit the url - custom_action/1 - I don't get the routing error.
Any idea why I can't do this?

A: In addition to what Frederick Cheung said about GET vs POST vs PUT, I think your code might be wrong in general.
To do exactly what you want, try:
form_for car, :url => {:action => "custom_action", :id => car, :controller => "cars"} do |f|

I don't think this is a good idea, and will probably cause you pain. I suggest taking a look at the Ruby on Rails Routing Guide, to understand how to do this properly. (Routing is a topic where I always have to consult the manual.)
With correct routes your code should look something like this:
form_for car, custom_action_car_path(car) do |f|

Which will be easier to change in the future if/when you refactor your app.

A: If you go to the url by typing it into the url bar, you're making a GET request, whereas forms emit POST requests by default, and in this case would probably emit a PUT request (since you're acting on an existing record).
It sounds like your route is only routing GET requests. Given that you say your custom action does update the record, it sounds like you should update your routes to accept PUT requests instead.


text:
Q: Ambiguous use of a subscript when accessing a 2-dimensional array bridged from Obj-C This code which ran perfectly in Xcode 7.0 now complains with a error : Ambiguous use of a subscript in Xcode 7.3.1 on the second line.
    let ar = sender.draggingPasteboard().propertyListForType("ABLinkedPeopleUIDsPboardType") as! NSArray?

    let uniqueID = ar![0][0] as! String

I understand that the NSArray on its own is now considered bad practice, but what do I need to do to get this to compile and run?

A: NSArray is a single-dimensioned array, but you're trying to use it as a two-dimensional array. I can't see how this would ever compile.
You need to translate into Swift types immediately so you can continue programming in Swift, not go adrift in a sea of force-unwrapped Optionals.
How about:
if let ar = sender.draggingPasteboard().propertyListForType("ABLinkedPeopleUIDsPboardType") as? [[String]] {
    // I'm assuming you're expecting to get back a two-dimensional array of Strings, or in the Obj-C realm, an NSArray of NSArrays of NSStrings
    let uniqueID = ar[0][0]
}
else {
    print("Property List for ABLinkedetc. is not a 2D String Array!")
}

Hayden's link is the correct general discussion but if you're new to bridging Obj C to Swift it may be difficult to apply in your particular case.


text:
Q: How exactly are AVX-512 instructions executed on ALU? I have trouble understanding how 512 bit registers can be utilized on ALU on a single clock cycle. Are there multiple ALUs that divide the data or is there specialised ALU that can work with this?

A: Yes, SIMD 512-bit ALUs replicate 16x 32-bit FMA units for example, that's the whole idea of CPU SIMD: provide wide EUs so more work can go through the pipeline in the same number of instructions.
e.g. note the "256-bit FMA" execution units in Haswell. (See David Kanter's deep-dive which compares against Sandybridge.)  Also note how Haswell widened the load/store path from/to L1d cache from 128 to 256-bit.  (With Sandybridge doing address-generation once per 256-bit AVX load or store, but spending 2 cycles in the EU on the data.)
Multiple microarchitectures have worked by splitting SIMD instructions into two half-width uops, like Intel Pentium-M for SSE and AMD Zen 1 for AVX, with only 64-bit or 128-bit SIMD execution units, respectively.  But no existing x86 CPU has supported a SIMD instruction-set more than twice as wide as its vector ALUs.  IDK about other ISAs.
See https://agner.org/optimize/ and https://uops.info/ for details on those.
And yes, this can take significant die area; that was one of the major arguments against AVX-512, that spending that area on more cores would be better for most programs.  (And that it's a "power virus" to quote Linus Torvalds; as a kernel dev he's probably less inclined to see the benefit of wider SIMD, although I think he understands that user-space uses SIMD all over the place even for memcpy.)
The area cost is why Intel CPUs often only have a half-width SIMD divide/sqrt unit, so the widest SIMD division the CPU supports has to split.


text:
Q: Microsoft Graph Exception: New password credentials must be generated using service actions How do I use the Microsoft Graph Client SDK to add a client secret when creating an Application?
Defining an Application like below fails with a New password credentials must be generated using service actions. exception:
var application new Application
{
    DisplayName = "My app name",
    PasswordCredentials = new List<PasswordCredential>
    {
        new PasswordCredential
        {
            SecretText = secretKey,
            DisplayName = "Default Secret",
            EndDateTime = DateTimeOffset.MaxValue,
            KeyId = Guid.NewGuid(),
            StartDateTime = DateTimeOffset.Now,
            CustomKeyIdentifier = null,
            Hint = secretKey.Substring(4)
        }
    }
};

await graphClient.Applications.Request().AddAsync(application);

I've found information on how to do this using HTTP POST, but not when using the Microsoft Graph client SDK.

A: Found it, just had to look harder in the documentation.
var createdApplication = await graphClient.Applications.Request().AddAsync(application);

var passwordCredential = new PasswordCredential
{
    DisplayName = "Password friendly name",
    EndDateTime = DateTimeOffset.Parse("31/12/2299"), // Max allowed as far as I can tell
    KeyId = Guid.NewGuid(),
    StartDateTime = DateTimeOffset.Now,
    CustomKeyIdentifier = null,
};

var passwordCredential = await graphClient.Applications[createdApplication.Id]
    .AddPassword(passwordCredential)
    .Request()
    .PostAsync();

The return value passwordCredential holds the secret text.

A: You can not add the passwordCredentials: []directectly to the application creation POST call. You'll get the error similar to this: New password credentials must be generated using service actions. You have to first create the application and then making a POST call to update the application's passwordCredentials field. With this change you cannot generate your own secret text anymore. You can only set the start date, end date, and displayname.
Reference: https://learn.microsoft.com/en-us/graph/api/application-addpassword?view=graph-rest-beta


text:
Q: JQuery- Animation Pop Up I have a thumbnail images page and want to create animation popup windows.  When I click on a thumbnail, I would like to have a small window show up right on that thumbnail and then get larger while running to the center of the page to show more details about that thumbnail.
I searched and found one solution here, but when I downloaded the code and tested, popup windows showed, but no animation!  I wonder why?
Do you have any other ways to create animation popup windows?  Please give me a hand.
Thanks!

A: You can use this library.
Click here
See example -
example


text:
Q: How can I console.log the name property of the objects in the shoppingCart array using a for loop var shoppingCart = [{
  id: 0,
  name: 'Mens Shirt',
  price: 20,
  size: 'Large'
}, {
  id: 1,
  name: 'kids shirt',
  price: 15,
  size: 'small'
}]

A: You can simply use Array.prototype.forEach like this:

var shoppingCart = [{
  id: 0,
  name: 'Mens Shirt',
  price: 20,
  size: 'Large'
}, {
  id: 1,
  name: 'kids shirt',
  price: 15,
  size: 'small'
}]

shoppingCart.forEach(item => console.log(item.name));


text: Q: error 401: "message": "Error : Service Id / Credentials authentication failed" for proofpoint I am trying to test threat API but couldn't find any trial versions or dummy keys. Could someone provide me with dummy service credentials?


text:
Q: Could not find matching constructor for: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.VersionInfo(java.lang.String) I'm working on an Android Studio project and today when i opened it up all of a sudden this started happening.
Could not find matching constructor for: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.VersionInfo(java.lang.String)
I've already tried to change the gradle versions around but nothing works. Also, I've tried the classic "clean project", "rebuild project" and "invalidate caches and restart"
gradle.properties
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.or   g/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m
# When configured, Gradle will  run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

app level gradle
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.4'
    }

}
plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.7.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'

android {
    dataBinding {
        enabled = false
    }
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "com.virtualflight.VirtualHub"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 58
        versionName "4.0.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        android {

            vectorDrawables.useSupportLibrary = true
            defaultConfig.applicationId="com.virtualflight.VirtualHub"
            defaultConfig {

                manifestPlaceholders = [onesignal_app_id: "977e8aef-4b31-4d36-91e4-2555572b9efe",
                                        // Project number pulled from dashboard, local value is ignored.
                                        onesignal_google_project_number: "REMOTE"]
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        customDebugType {
            debuggable true
        }

    }
    productFlavors {
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1-alpha01', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //Google dependencies bellow
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.intuit.sdp:sdp-android:1.0.6'
    implementation 'com.sothree.slidinguppanel:library:3.4.0'

    testImplementation 'junit:junit:4.12'
    //Mapbox dependencies bellow
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-java-core:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-java-services:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-java-services-rx:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:3.5.7'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-ui:2.1.0'

    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    implementation files('libs/volley.jar')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.github.barteksc:android-pdf-viewer:3.1.0-beta.1'
    implementation 'com.karumi:dexter:5.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.1.0-alpha04'
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'

    implementation 'com.github.AppIntro:AppIntro:v5.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
}

project level gradle

buildscript {
    ext.kotlin_version = '1.2.51'
    repositories {
        jcenter()

        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        maven { url "https://jitpack.io" }
        jcenter()
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

A: I realised that OneSignal was causing the issue. I have "solved" this by removing OneSignal as a whole as I wasn't using that anymore.

A: Downgrade your gradle version below to 4.9


text:
Q: Why does CIDER's REPL some times start as "shadow.user>" and in others it starts as "cljs.user>"? I am using Clojure, ClojureScript, shadow-cljs, Emacs, Cider, and Lein to develop a web app project.
This is the usual workflow: inside a project and for ClojureScript projects, execute cider-jack-in-cljs, choose shadow-cljs, then shadow for REPL type, and app for build option.
Sometimes, I start a project and see as the top-level in the REPL:
shadow.user>

In other times, I see:
cljs.user>

I believe the names indicate the namespace been used.
But, why are different start-ups happening? What do the different names imply (beyond the namespace)?
My expectation was that I would have the same namespace on every startup of the REPL.

A: shadow.user> is generated after executing cider-jack-in-clj. And cljs.user> is generated after executing cider-jack-in-cljs.
The s at the end of the command's name is subtle but crucial. I can't say much about the implications.
Since the commands are similar, I believe that I accidentally executed cider-jack-in-clj instead of cider-jack-in-cljs. This generated different namespaces for the REPL and a wrong impression that the REPL namespace would vary under same conditions. It only varies if the command changes!


text:
Q: Sync Calendar Events to google account The users of my app are able to create events for native calendar app on their phone through my app. i have done this with the following code :
    long startMillis = 0;
    long endMillis = 0;
    Calendar beginTime = Calendar.getInstance();
    beginTime.set(2014, 1, 14, 17, 00);
    startMillis = beginTime.getTimeInMillis();
    Calendar endTime = Calendar.getInstance();
    endTime.set(2014, 1, 14, 17, 30);
    endMillis = endTime.getTimeInMillis();

    ContentValues eventValues = new ContentValues();
    eventValues.put(Events.DTSTART, startMillis);
    eventValues.put(Events.DTEND, endMillis);
    eventValues.put(Events.EVENT_TIMEZONE, TimeZone.getDefault()
            .getDisplayName());
    eventValues.put(Events.CALENDAR_ID, 7);
    eventValues.put(Events.TITLE, title);
    eventValues.put(Events.DESCRIPTION, description);
    eventValues.put(Events.HAS_ALARM, true);
    eventValues.put(Events.ACCESS_LEVEL, Events.ACCESS_DEFAULT);
            Uri uri = cr.insert(Events.CONTENT_URI, eventValues);
    long eventID = Long.parseLong(uri.getLastPathSegment());

With the above code i was able to successfully add an event in the native calendar app on the phone/tablet. But that event was not reflecting in the calendar app of his gmail account even though i have manually synced the corresponding account in phone's settings. Whereas if i add an event using the native calendar app on the phone/tablet, that corresponding event is being reflected in the calendar app of his gmail account.
i have tried to read the source code for calendar app from here https://android.googlesource.com/platform/packages/apps/Calendar.git
but as far as i could understand, they have also done it the same way in the calendar app at least. i have read similar questions on the same topic, but no one gave an correct answer or even mentioned alternative methods (other than android api's)
So, Can anyone please tell me on how to sync the calendar events that are created through my app to their corresponding gmail account. is there any way to get it done atleast by using google calendar apis  for android ??? is there such an api ???


text:
Q: ADMIN SDK not accessing group AdminDirectory fail to access my group
I have turned ON Admin Directory API in advanced google services under the project.
I have enabled Admin SDK under ADMIN console security settings
var NewMail = "john.doe@gmail.com";
var NewMember =
    {
     email: NewMail,
     role: 'MEMBER'
    };
var MemberExist = false;
var pageToken, page;
var groupEmail = 'israelmotorcycleclub@googlegroups.com';
var groupDomainName = 'googlegroups.com';
AdminDirectory.Members.insert(NewMember, groupEmail);

As in the past, I expected on first run, to get a message directing me to the API key authorization, but Im not getting it.


text:
Q: How to reply to an email using the EWS Managed API? I have created an application that uses the EWS Managed API 2.2.
This application uses pull notifications to get new emails and saves a copy of the email in a database.
Then in the application I want to get the email from database and reply to it.
In order to reply to the message, I need to retrieve it from EWS using the ItemId I have stored in my database.
Of course I can create a new EmailMessage and send it but then the new email will have a different ConversationId which is not acceptable for the application scenario.
So, in order to achieve this I use the the following line of code
EmailMessage.Bind(service, itemId);
For this method to work I have to instantiate the ItemId from my database but the ItemId constructor takes as parameter only the UniqueId, and creates it with null ChangeKey.
If I use this ItemId (with null ChangeKey) I get the following error:
Microsoft.Exchange.WebServices.Data.ServiceResponseException: The specified object was not found in the store.
I think that this is because of the null ChangeKey. Am I correct?
Is there a workaround about this?

A: Instead of identifying a message by ItemId, use EntryID. Using EntryID, you can bind to the same email without needing ChangeKey.
Here is the definition of such property:
ExtendedPropertyDefinition EntryIDProperty = new ExtendedPropertyDefinition(0x0FFF, MapiPropertyType.Binary);

When you do your search for messages, make sure you instruct EWS to include such property in the list of retrieved items.
Here is an example to obtain EntryIDs when you invoke FindItems:
ExtendedPropertyDefinition EntryIDProperty = new ExtendedPropertyDefinition(0x0FFF, MapiPropertyType.Binary);

ItemView item_view = new ItemView(10) { PropertySet = new PropertySet(ItemSchema.Id, EntryIDProperty) };

var result = service.FindItems(WellKnownFolderName.Inbox, item_view);

foreach (var item in result.Items)
{
    byte[] entry_id = (byte[])item.ExtendedProperties.Single(x => x.PropertyDefinition == EntryIDProperty).Value;

    string entry_id_hex = ByteArrayToHexString(entry_id); //This is the entry ID that you should store
}

Use the following method to convert a EntryID to ItemID if you want to use EmailMessage.Bind:
This method accepts string EntryID.
mailbox_address is the SMTP address of the mailbox (e.g. test@domain.com)
'service' is the ExchangeService object.
private ItemId ConvertEntryIdToItemId(string entryid, string mailbox_address, ExchangeService service)
{
    AlternateId id = new AlternateId(IdFormat.HexEntryId, entryid, mailbox_address);

    AlternateId new_id = (AlternateId)service.ConvertId(id, IdFormat.EwsId);

    ItemId item_id = new_id.UniqueId;

    return item_id;
}

Now you can use the returned ItemId to bind your EmailMessages.

A:

The specified object was not found in the store.

That error generally means that you don't have rights to the Mailbox your trying to access or the Item your trying to access no longer exists in the store. Eg in a pull notification application that can mean the Item that you being notified about has already been deleted or moved to another folder (in each of these case the Item will be assigned a new Id). If you also listing to Move event you should be able to see the corresponding move event which will have the OldItemId that correlates the newMailEvent notification.
The Change Key only matters when your updating an Item so in the case the error you getting on Bind means that Item your trying doesn't exist (or has been moved) or you don't have rights to access it binding with just the UniqueId is perfectly okay see also https://msdn.microsoft.com/en-us/library/office/dn605828(v=exchg.150).aspx
Cheers
Glen


text:
Q: Extension and restriction of scalars and their relation to the identity functor Let $R$ and $S$ be rings with $R \subseteq S$, and let $_S M$ be a left $S$-module. If we restrict our scalars to $R$, we naturally have a left $R$-module structure on $M$, $_R M$, given by restricting the $S$-module structure. Now we may extend by scalars back to $S$, and define $_S\hat M = S \otimes_R (_R M)$.

Are there any conditions under which $_S\hat M \cong {_S M}$ in the category of $S$-modules?

Discussion:
Let $\mathcal R: {_S\text{Mod}} \to {_R\text{Mod}}$ be the functor given by restricting scalars, and $\mathcal E = S \otimes_R \square : {_R\text{Mod}} \to {_S\text{Mod}}$ be the extension by scalars. The way that $\mathcal E$ is defined, it seems that $\mathcal{RE} = 1_{{_R\text{Mod}}}$ (object-wise this is fine, though I haven't checked what happens to Hom-sets, so maybe this is wrong?). However, it seems very unlikely that the other direction ($\mathcal{ER} = 1_{{_S\text{Mod}}}$) should hold, since otherwise this would define an isomorphism of categories.
Also, if anyone has an example of the above situation succeeding or failing (especially failing) that would be great; that is, I would really love to see an example of an $S$-module $M$ wherein restricting to a subring $R$ and then extending by scalars gives a different $S$-module.

A: Adding to Jack Schmidt's answer, note that
$$S\otimes_R M= S \otimes_R (S\otimes_S M)=(S\otimes_R S)\otimes_S M.$$
It follows that if $S\otimes_R S\cong S$, then the functors are invertible to each other. For example, if $R$ is an integral domain and $S$ is a localization of $R$ in some multiplicative set (without zero), then this holds (in particular this is true for the field of fractions of $R$). If this is not true, then taking $M=S$ you get a counter example. For example, if $L/F$ is any nontrivial field extension, then $L\otimes_F L \not \cong L$ (if the extension is finite this follows since the modules have different dimensions over $F$). For $\mathbb{C}/\mathbb{R}$ we have that $\mathbb{C}\otimes_\mathbb{R} \mathbb{C} \cong \mathbb{C}\oplus \mathbb{C} \not \cong \mathbb{C}$.
Also, note that $\mathcal{RE}$ is not the identity. For example taking $R=\mathbb{Z}$, $S=\mathbb{Q}$ and $M=\mathbb{Z}$, you have that $\mathbb{Q}\otimes_{\mathbb{Z}}\mathbb{Z}\cong \mathbb{Q}$ which is not isomorphic to $\mathbb{Z}$ (the module) over $\mathbb{Z}$ (the ring).


text:
Q: Add property in Django many to many relation I have the following Django models:
class Lesson(models.Model):
    title = models.TextField()

class Course(models.Model):
    lessons = models.ManyToManyField(Lesson)

class User(AbstractUser):
    favorites = models.ManyToManyField(Lesson)

I have a route /courses/course_id that returns a course details including an array of lessons (using Django Rest Framework)
How can i return in the lessons object an additional attribute favorite based on my users favorites.
I attempted the following:
course = self.get_object(course_id)
favorites = request.user.favorites

for lesson in course.lessons.all():
    if lesson in favorites.all():
        lesson.favorite = True

serializer = CourseDetailSerializer(course, context=serializer_context)
return Response(serializer.data)

But when returning it doesn't work:

(django.core.exceptions.ImproperlyConfigured: Field name favorite is
  not valid for model Lesson.

My serializers:
class CourseDetailSerializer(serializers.HyperlinkedModelSerializer):
    lessons = LessonListSerializer(many=True, read_only=True)

    class Meta:
        model = Course
        fields = ('id', 'lessons', 'name', 'title')

class LessonSerializer(serializers.ModelSerializer):
    class Meta:
        model = Lesson
        fields = ('id', 'title', 'duration', 'favorite')

A: You cannot add properties to objects if they are not defined, like here:
lesson.favorite = True

When you create m2m relation:
favorites = models.ManyToManyField(Lesson)

... django creates virtual model that simply stores pairs of primary keys from both models. This relation could look like this in database:
  id  | user_id       | lesson_id
------+---------------+----------
  151 |            11 |     3225
  741 |            21 |     4137

What I think you want to achieve is to add extra information about this relation.
Therefore you need to create intermediary model with that extra field, i.e:
class User(AbstractUser):
     favorites = models.ManyToManyField(Lesson, through='UserLessons')

class UserLessons(models.Model):
     user = models.ForeignKey(User)
     lesson =  models.ForeignKey(Lesson)
     favorite = models.BooleanField(default=False)

A: Your lessonmodel doesn't include a favourite boolean, so it isn't able to set it when you call lesson.favorite = True
If you want to get rid of the error, try:
class Lesson(models.Model):
    title = models.TextField()
    favorite = models.BooleanField(initial=False)

Although it appears that the lessons aren't user-specific. So this solution might not be what you are looking for, because it will set a Lesson's "favourite" field to be true for all users if only one user sets it as a favorite.


text:
Q: Download pdf from downloadlink to my uploads folder PHP I'm trying to download invoices(loop) to my uploads folder so clients can download. I don't want to redirect.
I've tried file get and put contents. Got empty pdfs. then  tried curl:
$ch = curl_init($pdfurl);
    $fp = fopen('../uploads/'. $invoice. '', 'wb');
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_exec($ch);
    curl_close($ch);
    fclose($fp);

Doesnt seem to work.. the pdfurl is a download link, it doesnt show pdf, it prompts u to download.. that might be the problem?
header('Content-type: application/pdf');

            // It will be called downloaded.pdf
            header('Content-Disposition: attachment; filename="$invoice.pdf"');

            // The PDF source is in original.pdf
            readfile($pdfurl);

This works. but I want to move the pdfs from loop to upload folder.

A: ...problem solved.. was on development server.. thats why i couldnt open the pdfs..
file_put_contents("../uploads/".$factuurnummer. ".pdf", fopen($pdfurl, 'r'));


text:
Q: Do two equivalent quadratic forms necessarily have the same solutions Do two equivalent quadratic forms necessarily have the same solutions? Suppose that I have $Q(x,y)= x^{2}- xy+ 8y^{2}$ and $R(x,y)= 2x^{2}+ 3xy+ 5y^{2}$ and the value of $Q(2,1)$ and $R(2,1$) are different. Does that mean they are not equivalent quadratic forms?

A: Let us take the example of quadratic forms
$$Q_1(x,y)=x^2-y^2 \ \ \ \text{and} \ \ \ Q_2(x,y)=2xy$$
They are equivalent, due to matrix identity : $A_1 = P^TA_2P$, for a certain matrix $P$, more precisely, with $a:=\frac{1}{\sqrt{2}}$ :
$$\begin{pmatrix}1&0\\0&-1\end{pmatrix}=\begin{pmatrix}a&a\\a&-a\end{pmatrix}
\begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}a&a\\a&-a\end{pmatrix},$$
but the zero sets $x^2-y^2=0$ and $2xy=0$ are not at all the same (the two  axes' bissectors in the first case and the two axes in the second one).

A: The quadratic forms $P(x,y)=2x^2+y^2$ and $Q(x,y)=6x^2+16xy+12y^2$ are equivalent. However, $P(2,1)\neq Q(2,1)$.


text:
Q: Why do I still have to enter password after I entered ssh-agent and ssh-add? I'm learning Ansible, in a setup document : http://docs.ansible.com/intro_getting_started.html
It says if I don't want to enter password every time, I can do :
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa

I did it, but how come I still have to enter password every time ?
Then it says "you may wish to use Ansible's --private-key option", but I can't find any document on that. Whay's that for and how to do it ?

A: I'm not sure about Ansible, but I know a bit about how ssh keys work
When you generate a new SSH key with the ssh-keygen command (which by default goes to the ~/.ssh/id_rsa file), it asks you to put in a passphrase(password)
Whenever you use that key, it will ask you for that passphrase.
If you create a new key with
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): /home/YOUR_USERNAME/.ssh/id_rsa_nopass
Enter passphrase (empty for no passphrase): [just press enter, don't type anything]
Enter same passphrase again: [just press enter again]

This will create both an id_rsa_nopass private key file, and an id_rsa_nopass.pub public key file in the directory you chose (/home/user/.ssh)
You should then be able to use the following command, assuming ansible is set up to use your ssh keys correctly
$ ssh-add ~/.ssh/id_rsa_nopass

NOTE: Using an ssh key without a passphrase can be dangerous, as anybody can access your device and connect without knowing your password. If you don't mind this, then a no-passphrase ssh key is a good way to avoid typing a password everyone
edit: Just looked into Ansible a bit, it's basic setup is just to run a command on an ssh server, right?
In which case, you may need to add your public key to whichever server you are connecting to, this can usually be done via the command
ssh-copy-id -i /path/to/your/public/key/file yourname@yourserver.com -p your_server's_ssh_port

For example, to authorize the id_rsa_nopass key from earlier to the account foobar on the server example.org, with ssh port 10022 you would do
ssh-copy-id -i ~/.ssh/id_rsa_nopass.pub foobar@example.org -p 10022

This will prompt you for the password to foobar@example.org, upon filling in the password it will authorize that public key to connect to that server, and since id_rsa_nopass has no passphrase, you should now be able to connect without any password prompt


text:
Q: How to get address of C++ interface VMT Context:
I'm trying to use a few COM Interface (Direct2D 1.1) from a Delphi application. For that purpose, I have to port the interfaces to Delphi. I have done that but I have a problem with one of the interfaces: the method I call is not the correct one. I verified that by writing the exact same piece of code in C++ and in Delphi. Running both under the debugger, I see that the code called by Delphi is not the same as the code called by C++. So I made a mistake in porting that interface.
To find out where my error is, I have the idea to dump all method pointers to compare the address shown by C++ and by Delphi. They should be the same as the point to the same DLL.
I don't know how to get hand on the VMT!
I have read this but it is not applicable in my case: the .h file do not contain the C equivalent.
I'm looking for something similar to offsetof() and sizeof() that I use to check structures. And something to get the address of a given interface method.
Any help appreciated.
PS: I hope that my English is understandable.

A: I found the solution, so I will answer my own question:
Below is the code required to load the VMT of interface whose pointer is variable "Screen" into array of pointers VMT. The code assume there are 93 methods (That is actually the case). I have yet to know how to get the count of methods in a given interface to fully automate the process.
UINT_PTR* Ptr1 = reinterpret_cast<UINT_PTR*>(Screen);
UINT_PTR* Ptr2 = reinterpret_cast<UINT_PTR*>(*Ptr1);
UINT_PTR* VMT[92];
for (UINT I = 0; I < ARRAYSIZE(VMT); I++) {
    VMT[I] = reinterpret_cast<UINT_PTR*>(*Ptr2);
    Ptr2++;
}

I verifyed that this code is OK by using the debugger and loading Windows symbols. This gives the following result in VMT:
+       [0] 0x6dd34e90 {d2d1.dll!ComObjectImpl<class RefCountedObject<class D2DDeviceContext,struct LockingRequired,struct LockFactoryOnReferenceReachedZero>,class type_list<struct ID2D1DeviceContext6,class type_list<struct ID2D1DeviceContext5,class type_list<struct ID2D1DeviceContext4,class type_list<struct ID2D1DeviceContext3,class type_list<struct ID2D1DeviceContext2,class type_list<struct ID2D1DeviceContext1,class type_list<struct ID2D1DeviceContext,class type_list<class IRenderTargetInternal,class type_list<struct ID2D1GdiInteropRenderTarget,class type_list<struct ID2D1ImagingDeviceContext,class type_list<struct ID2D1PrivateCompositorDeviceContext,class type_list<struct ID2D1PrivatePencilDeviceContext,class type_list<struct ID2D1PrivateTestDeviceContext,class type_list<struct ID2D1PrivateInkingDeviceContext,class type_list<struct CompoundCast<struct ID2D1RenderTarget,struct ID2D1DeviceContext6>,class type_list<struct CompoundCast<struct ID2D1Resource,struct ID2D1DeviceContext6>,class null_type> > > > > > > > > > > > > > > > >::QueryInterface(struct _GUID const &,void * *)} {...}    unsigned int *
+       [1] 0x6dd208e0 {d2d1.dll!RefCountedObject<class D2DDeviceContext,struct LockingRequired,struct LockFactoryOnReferenceReachedZero>::AddRef(void)} {...}  unsigned int *
+       [2] 0x6dcfc150 {d2d1.dll!RefCountedObject<class D2DDeviceContext,struct LockingRequired,struct LockFactoryOnReferenceReachedZero>::Release(void)} {...} unsigned int *
+       [3] 0x6dda0aa0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetFactory(struct ID2D1Factory * *)const } {...}   unsigned int *
+       [4] 0x6dd99f40 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateBitmap(struct D2D_SIZE_U,void const *,unsigned int,struct D2D1_BITMAP_PROPERTIES const *,struct ID2D1Bitmap * *)} {...}  unsigned int *
+       [5] 0x6dd29d40 {d2d1.dll!D2DDeviceContextBase<...>::CreateBitmapFromWicBitmap(void)} {2337640550}   unsigned int *
+       [6] 0x6dd9cce0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateSharedBitmap(struct _GUID const &,void *,struct D2D1_BITMAP_PROPERTIES const *,struct ID2D1Bitmap * *)} {...}    unsigned int *
+       [7] 0x6dc75440 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateBitmapBrush(struct ID2D1Bitmap *,struct D2D1_BITMAP_BRUSH_PROPERTIES const *,struct D2D1_BRUSH_PROPERTIES const *,struct ID2D1BitmapBrush * *)} {...}    unsigned int *
+       [8] 0x6dcfe940 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateSolidColorBrush(struct _D3DCOLORVALUE const *,struct D2D1_BRUSH_PROPERTIES const *,struct ID2D1SolidColorBrush * *)} {...}   unsigned int *
+       [9] 0x6dd9b7a0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateGradientStopCollection(struct D2D1_GRADIENT_STOP const *,unsigned int,enum D2D1_GAMMA,enum D2D1_EXTEND_MODE,struct ID2D1GradientStopCollection * *)} {...}   unsigned int *
+       [10]    0x6dd9c490 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateLinearGradientBrush(struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES const *,struct D2D1_BRUSH_PROPERTIES const *,struct ID2D1GradientStopCollection *,struct ID2D1LinearGradientBrush * *)} {...}   unsigned int *
+       [11]    0x6dd9ca10 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateRadialGradientBrush(struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES const *,struct D2D1_BRUSH_PROPERTIES const *,struct ID2D1GradientStopCollection *,struct ID2D1RadialGradientBrush * *)} {...}   unsigned int *
+       [12]    0x6dd9aec0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateCompatibleRenderTarget(struct D2D_SIZE_F const *,struct D2D_SIZE_U const *,struct D2D1_PIXEL_FORMAT const *,enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS,struct ID2D1BitmapRenderTarget * *)} {...}    unsigned int *
+       [13]    0x6dd9c330 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateLayer(struct D2D_SIZE_F const *,struct ID2D1Layer * *)} {...}    unsigned int *
+       [14]    0x6dd9c6c0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::CreateMesh(struct ID2D1Mesh * *)} {...}    unsigned int *
+       [15]    0x6dd9e5e0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::DrawLine(struct D2D_POINT_2F,struct D2D_POINT_2F,struct ID2D1Brush *,float,struct ID2D1StrokeStyle *)} {...}   unsigned int *
+       [16]    0x6dd158b0 {d2d1.dll!D2DDeviceContextBase<...>::DrawRectangle(void)} {2337640550}   unsigned int *
+       [17]    0x6dd12700 {d2d1.dll!D2DDeviceContextBase<...>::FillRectangle(void)} {2337640550}   unsigned int *
+       [18]    0x6dd9e920 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::DrawRoundedRectangle(struct D2D1_ROUNDED_RECT const *,struct ID2D1Brush *,float,struct ID2D1StrokeStyle *)} {...}  unsigned int *
+       [19]    0x6dd9fa50 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::FillRoundedRectangle(struct D2D1_ROUNDED_RECT const *,struct ID2D1Brush *)} {...}  unsigned int *
+       [20]    0x6dd9db00 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::DrawEllipse(struct D2D1_ELLIPSE const *,struct ID2D1Brush *,float,struct ID2D1StrokeStyle *)} {...}    unsigned int *
+       [21]    0x6dd9f3d0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::FillEllipse(struct D2D1_ELLIPSE const *,struct ID2D1Brush *)} {...}    unsigned int *
+       [22]    0x6dcd8c00 {d2d1.dll!D2DDeviceContextBase<...>::DrawGeometry(void)} {2337640550}    unsigned int *
+       [23]    0x6dcd1660 {d2d1.dll!D2DDeviceContextBase<...>::FillGeometry(void)} {2337640550}    unsigned int *
+       [24]    0x6dd9f5f0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::FillMesh(struct ID2D1Mesh *,struct ID2D1Brush *)} {...}    unsigned int *
+       [25]    0x6dd9f800 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::FillOpacityMask(struct ID2D1Bitmap *,struct ID2D1Brush *,enum D2D1_OPACITY_MASK_CONTENT,struct D2D_RECT_F const *,struct D2D_RECT_F const *)} {...}    unsigned int *
+       [26]    0x6dd12080 {d2d1.dll!D2DDeviceContextBase<...>::DrawBitmap(void)} {2337640550}  unsigned int *
+       [27]    0x6dcfafb0 {d2d1.dll!D2DDeviceContextBase<...>::DrawTextW(void)} {2337640550}   unsigned int *
+       [28]    0x6dd9ef40 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::DrawTextLayout(struct D2D_POINT_2F,struct IDWriteTextLayout *,struct ID2D1Brush *,enum D2D1_DRAW_TEXT_OPTIONS)} {...}  unsigned int *
+       [29]    0x6dc807c0 {d2d1.dll!D2DDeviceContextBase<...>::DrawGlyphRun(void)} {2337640550}    unsigned int *
+       [30]    0x6dc7f650 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::SetTransform(struct D2D_MATRIX_3X2_F const *)} {...}   unsigned int *
+       [31]    0x6dcfbe30 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetTransform(struct D2D_MATRIX_3X2_F *)const } {...}   unsigned int *
+       [32]    0x6dcfcbb0 {d2d1.dll!D2DDeviceContextBase<...>::SetAntialiasMode(void)} {2337640550}    unsigned int *
+       [33]    0x6dcfcd70 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetAntialiasMode(void)const } {...}    unsigned int *
+       [34]    0x6dda3cf0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::SetTextAntialiasMode(enum D2D1_TEXT_ANTIALIAS_MODE)} {...} unsigned int *
+       [35]    0x6dcfcf00 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetTextAntialiasMode(void)const } {...}    unsigned int *
+       [36]    0x6dcfd870 {d2d1.dll!D2DDeviceContextBase<...>::SetTextRenderingParams(void)} {2337640550}  unsigned int *
+       [37]    0x6dda1b40 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetTextRenderingParams(struct IDWriteRenderingParams * *)const } {...} unsigned int *
+       [38]    0x6dda3a90 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::SetTags(unsigned __int64,unsigned __int64)} {...}  unsigned int *
+       [39]    0x6dda1a40 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetTags(unsigned __int64 *,unsigned __int64 *)const } {...}    unsigned int *
+       [40]    0x6dda2ac0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::PushLayer(struct D2D1_LAYER_PARAMETERS const *,struct ID2D1Layer *)} {...} unsigned int *
+       [41]    0x6dd15c30 {d2d1.dll!D2DDeviceContextBase<...>::PopLayer(void)} {2337640550}    unsigned int *
+       [42]    0x6dd13570 {d2d1.dll!D2DDeviceContextBase<...>::Flush(void)} {2337640550}   unsigned int *
+       [43]    0x6dd189f0 {d2d1.dll!D2DDeviceContextBase<...>::SaveDrawingState(void)} {2337640550}    unsigned int *
+       [44]    0x6dcfc180 {d2d1.dll!D2DDeviceContextBase<...>::RestoreDrawingState(void)} {2337640550} unsigned int *
+       [45]    0x6dcf49d0 {d2d1.dll!D2DDeviceContextBase<...>::PushAxisAlignedClip(void)} {2337640550} unsigned int *
+       [46]    0x6dd13340 {d2d1.dll!D2DDeviceContextBase<...>::PopAxisAlignedClip(void)} {2337640550}  unsigned int *
+       [47]    0x6dcdb410 {d2d1.dll!D2DDeviceContextBase<...>::Clear(void)} {2337640550}   unsigned int *
+       [48]    0x6dcd8720 {d2d1.dll!D2DDeviceContextBase<...>::BeginDraw(void)} {2337640550}   unsigned int *
+       [49]    0x6dcd8900 {d2d1.dll!D2DDeviceContextBase<...>::EndDraw(void)} {2337640550} unsigned int *
+       [50]    0x6dcd2b80 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::GetPixelFormat(void)} {...}   unsigned int *
+       [51]    0x6dc81160 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::SetDpi(float,float)} {...} unsigned int *
+       [52]    0x6dcfbd00 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetDpi(float *,float *)const } {...}   unsigned int *
+       [53]    0x6dda1710 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetSize(void)const } {...} unsigned int *
+       [54]    0x6dcd2230 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::GetPixelSize(void)} {...} unsigned int *
+       [55]    0x6dda12d0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::GetMaximumBitmapSize(void)const } {...}    unsigned int *
+       [56]    0x6dda1f40 {d2d1.dll!D2DDeviceContextBase<struct ID2D1BitmapRenderTarget,struct ID2D1BitmapRenderTarget,struct ID2D1DeviceContext6>::IsSupported(struct D2D1_RENDER_TARGET_PROPERTIES const *)const } {...} unsigned int *
+       [57]    0x6dc89b50 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::CreateBitmap(void)} {...} unsigned int *
+       [58]    0x6dcfe7f0 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::CreateBitmapFromWicBitmap(void)} {...}    unsigned int *
+       [59]    0x6dda59d0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::CreateColorContext(enum D2D1_COLOR_SPACE,unsigned char const *,unsigned int,struct ID2D1ColorContext * *)} {...}  unsigned int *
+       [60]    0x6dc835c0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::CreateColorContextFromFilename(unsigned short const *,struct ID2D1ColorContext * *)} {...}    unsigned int *
+       [61]    0x6dda5ce0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::CreateColorContextFromWicColorContext(struct IWICColorContext *,struct ID2D1ColorContext * *)} {...}  unsigned int *
+       [62]    0x6dcad780 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::CreateBitmapFromDxgiSurface(void)} {...}  unsigned int *
+       [63]    0x6dcdce60 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::CreateEffect(void)} {...} unsigned int *
+       [64]    0x6dda6230 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::CreateGradientStopCollection(struct D2D1_GRADIENT_STOP const *,unsigned int,enum D2D1_COLOR_SPACE,enum D2D1_COLOR_SPACE,enum D2D1_BUFFER_PRECISION,enum D2D1_EXTEND_MODE,enum D2D1_COLOR_INTERPOLATION_MODE,struct ID2D1GradientStopCollection1 * *)} {...}   unsigned int *
+       [65]    0x6dc7d8b0 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::CreateImageBrush(void)} {...} unsigned int *
+       [66]    0x6dc75640 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::CreateBitmapBrush(struct ID2D1Bitmap *,struct D2D1_BITMAP_BRUSH_PROPERTIES1 const *,struct D2D1_BRUSH_PROPERTIES const *,struct ID2D1BitmapBrush1 * *)} {...} unsigned int *
+       [67]    0x6dc7d410 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::CreateCommandList(struct ID2D1CommandList * *)} {...} unsigned int *
+       [68]    0x6dc7a100 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::IsDxgiFormatSupported(enum DXGI_FORMAT)const } {...}  unsigned int *
+       [69]    0x6dc80620 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::IsBufferPrecisionSupported(enum D2D1_BUFFER_PRECISION)const } {...}   unsigned int *
+       [70]    0x6dc6d0b0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetImageLocalBounds(struct ID2D1Image *,struct D2D_RECT_F *)const } {...} unsigned int *
+       [71]    0x6dda8a10 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetImageWorldBounds(struct ID2D1Image *,struct D2D_RECT_F *)const } {...} unsigned int *
+       [72]    0x6dcaad10 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetGlyphRunWorldBounds(struct D2D_POINT_2F,struct DWRITE_GLYPH_RUN const *,enum DWRITE_MEASURING_MODE,struct D2D_RECT_F *)const } {...}   unsigned int *
+       [73]    0x6dc7e2a0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetDevice(struct ID2D1Device * *)const } {...}    unsigned int *
+       [74]    0x6dcdc240 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::SetTarget(void)} {...}    unsigned int *
+       [75]    0x6dc84990 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetTarget(struct ID2D1Image * *)const } {...} unsigned int *
+       [76]    0x6dc804a0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::SetRenderingControls(struct D2D1_RENDERING_CONTROLS const *)} {...}   unsigned int *
+       [77]    0x6dc832e0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetRenderingControls(struct D2D1_RENDERING_CONTROLS *)const } {...}   unsigned int *
+       [78]    0x6dcfc740 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::SetPrimitiveBlend(void)} {...}    unsigned int *
+       [79]    0x6dc7cd70 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetPrimitiveBlend(void)const } {...}  unsigned int *
+       [80]    0x6dcfc810 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::SetUnitMode(void)} {...}  unsigned int *
+       [81]    0x6dcfbda0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetUnitMode(void)const } {...}    unsigned int *
+       [82]    0x6dcaaf30 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::DrawGlyphRun(struct D2D_POINT_2F,struct DWRITE_GLYPH_RUN const *,struct DWRITE_GLYPH_RUN_DESCRIPTION const *,struct ID2D1Brush *,enum DWRITE_MEASURING_MODE)} {...}   unsigned int *
+       [83]    0x6dcda160 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::DrawImage(void)} {...}    unsigned int *
+       [84]    0x6dda78d0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::DrawGdiMetafile(struct ID2D1GdiMetafile *,struct D2D_POINT_2F const *)} {...} unsigned int *
+       [85]    0x6dda76a0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::DrawBitmap(struct ID2D1Bitmap *,struct D2D_RECT_F const *,float,enum D2D1_INTERPOLATION_MODE,struct D2D_RECT_F const *,struct D2D_MATRIX_4X4_F const *)} {...}    unsigned int *
+       [86]    0x6dd0fac0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::PushLayer(struct D2D1_LAYER_PARAMETERS1 const *,struct ID2D1Layer *)} {...}   unsigned int *
+       [87]    0x6dc66a30 {d2d1.dll!D2DDeviceContextBase<ID2D1DeviceContext6,ID2D1DeviceContext6,null_type>::InvalidateEffectInputRectangle(void)} {...}   unsigned int *
+       [88]    0x6dc63180 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetEffectInvalidRectangleCount(struct ID2D1Effect *,unsigned int *)} {...}    unsigned int *
+       [89]    0x6dc634d0 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetEffectInvalidRectangles(struct ID2D1Effect *,struct D2D_RECT_F *,unsigned int)} {...}  unsigned int *
+       [90]    0x6dc62b50 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::GetEffectRequiredInputRectangles(struct ID2D1Effect *,struct D2D_RECT_F const *,struct D2D1_EFFECT_INPUT_DESCRIPTION const *,struct D2D_RECT_F *,unsigned int)} {...} unsigned int *
+       [91]    0x6dda8420 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::FillOpacityMask(struct ID2D1Bitmap *,struct ID2D1Brush *,struct D2D_RECT_F const *,struct D2D_RECT_F const *)} {...}  unsigned int *
+       [92]    0x6dda5f90 {d2d1.dll!D2DDeviceContextBase<struct ID2D1DeviceContext6,struct ID2D1DeviceContext6,class null_type>::CreateFilledGeometryRealization(struct ID2D1Geometry *,float,struct ID2D1GeometryRealization * *)} {...}  unsigned int *

You can see that the 3 first entries are QueryInterface, AddRef and Release method which is what all interfaces have in their VMT.


text:
Q: How do I vertically center a circle on a line? I'm trying to center a circle vertically in the middle of a horizontal line, but using a negative margin doesn't seem to work. How should I approach this?

#line {
  width: 100%;
  /* 2 */
  height: 5px;
  background: gray;
}

#circle {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  background: blue;
  margin-left: 50%;
  text-align: center;
  color: white;
  font-weight: 700;
  line-height: 50px;
  font-size: 14px;
}

0.33

    2

A: This should work:
margin-left: calc(50% - 25px);

You can read about css calc here:
https://developer.mozilla.org/en-US/docs/Web/CSS/calc

A: Use absolute positioning and a transform.

#line {
  width: 100%;
  height: 5px;
  background: gray;
  position: relative;
}

#circle {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  background: blue;
  text-align: center;
  color: white;
  font-weight: 700;
  line-height: 50px;
  font-size: 14px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

0.33

    2

A: Please check whether you are looking for this?

#line {
  width: 100%;
  /* 2 */
  height: 5px;
  background: gray;
  position: relative;
}

#circle {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  background: blue;
  margin-left: -25px;
  text-align: center;
  color: white;
  font-weight: 700;
  line-height: 50px;
  font-size: 14px;
  position: absolute;
  left: 50%;
  bottom: 0;
}

0.33

    2

If you want to move the circle to the top of the line, adjust bottom: 0;

A: Using position:absolute and change margin-left:calc(50% - 25px) and margin-top:-22.5px for center vertically and horizontally of line (hardcoded width and height circle)

#line {
  width: 100%;
  /* 2 */
  height: 5px;
  background: gray;
  position:relative;
}

#circle {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  background: blue;
  margin-left: calc(50% - 25px);
  text-align: center;
  color: white;
  font-weight: 700;
  line-height: 50px;
  font-size: 14px;
  position:absolute;
  margin-top:-22.5px;
}

0.33

    2


text:
Q: gnu gcc How to suppress warning: 'typedef' was ignored in this declaration [enabled by default] I am using GNU gcc 4.6.2 on Fedora 16. I am writing an application using a 3rd party API, after compilation, I got a lot warnings.
warning: 'typedef' was ignored in this declaration [enabled by default]

Just wondering how can I suppress this? I compile my program with -Wall flag.
In this doc, http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html, it mentioned something like -Wunused-local-typedefs.
I have tried -Wno-unused-local-typedefs, but doesn't work.
Thanks.

A: gcc allows you to specify that certain library include paths should be treated as system libraries with the -isystem switch which allows those headers special treatment with respect to the flags you use on the rest of your code.  So for example if you have unused local typedefs from using certain Boost libraries in test.cpp (I ran into this using including the Boost signals2 library recently)
g++ -o test{,.cpp} -Wall -Wextra -Werror -I /usr/local/boost-1.55.0/include -L /usr/local/boost-1.55.0/lib

and the above does not build cleanly try the following
g++ -o test{,.cpp} -Wall -Wextra -Werror -isystem /usr/local/boost-1.55.0/include -L /usr/local/boost-1.55.0/lib

which will (provided the warnings coming from the Boost libraries you are including in test.cpp are your only problem of course).

A: According to the gcc-source-code(gcc/cp/decl.c:4108):
warning (0, "%<typedef%> was ignored in this declaration");

There is no command line flag(that is what the 0 stands for) to suppress this warning in gcc 4.6.2.

A: -Wno-unused-local-typedefs works in GCC 4.8.

A: As -Wunused-local-typedefs is part of -Wall, make sure you don't have -Wall after -Wno-unused-local-typedefs. If you do, -Wall just turns the option back on again.

A: In C++17, you should use [[maybe_unused]].
For an overview of all attributes, please see http://en.cppreference.com/w/cpp/language/attributes.
Proposal: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0212r0.pdf
(sorry, I could't post an example, as it's considered as badly indented by stackoverflow)

A: This GCC warning means that your typedef maybe duplicated and you should remove typedef keyword instead. For example:
typedef enum class Something {
  THING1,
  THING2,
} Something;

This code above is type duplicate, because enum class is defined as type already. So you must remove typedef keyword as well as Something at the end too!


text:
Q: progress bar in nokia Qt? I'm using progress bar in my app. when i navigating first widget to second widget and in-between i'm using progress bar in another widget.
 //code:
    progressform *pgm = new progressform(); // calling progress bar widget
    pgm->adjustSize();
    pgm->show();
    for(int i=24;i<=100;i++) //initial setvalue is 24
    {
        pgm->ui->progressBar->setValue(i);
     }
    detailWidget *dwt = new  detailWidget(); // calling detail widget

    dwt->show();

Before going to detailwidget i called progressform(widget) and after that the progressbar setvalue reach 100 it moves to detailwidget. the problem is i cant resize the progress widget in to center of the screen like popup screen and I want to sleep time because i want to see the progress value increased one by one?
Thanks in advance

A: I can recommend using QProgressDialog instead which pops up centered automatically.

A: You'll have to center your progress bar manually. Popup screens do so automatically, but progress bars normally are used as part of a dialog. Therefore they are positioned by the dialog layout.
As for the sleeping, that's probably a design error. If your task is so fast you'd need a sleep just to see the progress bar, you shouldn't have a progress bar in the first place.


text:
Q: Somehow my super admin username or password has updated by mistake in WSO2IS. How to reset it to admin and admin Somehow my super admin username or password has updated by mistake in WSO2IS. How to reset it to username=admin and password=admin. Now i can not login from my admin account.

A: You can try changing the username and password using the deployment.toml file located in <IS_HOME>/repository/conf directory. You can find the below configuration there. Change this according to your need.
[super_admin]
username = "admin"
password = "admin"


text:
Q: Choice of the limits for multivariable integral
Let $A \subseteq \mathbb{R}^2$ a limited set bordered through $x=0, x=1, y=-1+x, y=1-x^2$. Rotate A around the y-axis and define this set with $B$. Calculate the integral $$\int_B y\,\mathrm{d}x\mathrm{d}y\mathrm{d}z$$

In the script the integral was substitute with cylindrical coordinates, that's clearly but I'm struggling to find the limits:
$$\int_B y \,\mathrm{d}x\mathrm{d}y\mathrm{d}z = \int\limits_{0}^{1} \int\limits_{0}^{2\pi} \int\limits_{0}^{\sqrt{1-y}} r\cdot y\, \mathrm{d}r\mathrm{d}\varphi\mathrm{d}y + \int\limits_{-1}^{0} \int\limits_{0}^{2\pi}\int\limits_{0}^{y+1} y\cdot r\,\mathrm{d}r\mathrm{d}\varphi\mathrm{d}y$$
For substitution there used: $\begin{pmatrix} y\\ r\cdot \cos(\varphi) \\ r\cdot \sin(\varphi)\end{pmatrix}$
In every task we did before we substitute with $\begin{pmatrix} x\\ r\cdot \cos(\varphi) \\ r\cdot \sin(\varphi)\end{pmatrix}$. Why there is a different cylindrical coordinates substitution? I think they "turn" the point of view from the x-axis to the y-axis.
Do you have any recommendations how I set the right limits if I substitute with cylindrical coordinates (or polar coordinates)?

A: First, one comment: the change of variables formula tells you that the differential $dx \, dy \, dz$ will become $r \, dr \, d\varphi \, dy$ (it is $r$, not $r^2$).
To address your question "Why a different cylindrical coordinate substitution?":
Since $y$ is the axis of rotation, consider that the "up" direction, and so the coordinate change is $x = r \cos(\varphi)$ and $z = r\sin(\varphi)$. In other words, do the polar coordinate substitution in the "left" and "right" directions, whatever variables they may be.
Looks like you split the integral in two, for the regions above and below the $x,z$ plane. For the lower one, the bounds should all be constants since the region is a cylinder (and we are in "cylindrical" coordinates). In other words, you should not have $y+1$ in the bounds for the integral. This integral should be:
$$\int_{-1}^0 \int_0^{2\pi} \int_0^1 yr \, dr \, d\varphi \, dy $$
For the upper integral, I would choose a different order of integration. Integrate out $y$ first to get
$$ \int_0^{2\pi} \int_0^1 \int_0^{1-r^2} ry \, dy \, dr \, d\varphi $$
This is natural since the upper boundary of the region is given as the graph of $y=1-r^2$.


text:
Q: How to Create 2 new Different Dimensions from 1 Dimension? I have data like this :

employee_id
start_date
end_date
status

1
9/1/2022
10/31/2022
INACTIVE

2
9/1/2022

ACTIVE

3
9/1/2022

ACTIVE

or you can access on here : sheet_1
I want to make 2 different metrices in 1 line chart but using 1 dimension that can count active and inactive employee.
I have created 2 new dimensions using "status" dimension like this

*

*To count Active employee

*To count Inactive employee

I have tried that and use the dimensions for metrices in line chart like this :

But the line chart is showing us same result like this :

I also tried using filter, but the result of active and inactive are still same, because we can only use 1 filter.
I want to make different metrices that count active and inactive employee in line chart
Any solution?? You can access the dashboard here


text:
Q: Can't build XCode 4 Project from Textmate I've opened a newly created XCode 4 project in TextMate (by dropping the project folder on the TextMate icon like the manual suggests) and have attempted to build it using the Command-B shortcut and selecting 2 for an XCode build.  I get the following error
xcodebuild: error: invalid option '-activebuildstyle'
Usage: xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -workspace <workspacename> -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
       xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]]
       xcodebuild -showsdks
Options:
    -usage                print full usage
    -verbose              provide additional status output
    -project NAME         build the project NAME
.
.
.
.

Any idea where I can modify the command being run that  is specifying the '-activebuildstyle' option?
the command seems to be in TextMate.app/Contents/SharedSupport/Bundles/Xcode.tmbundle/Support/run_xcodebuild.sh
line 57/60 has "-activebuildstyle" (the STYLEARGNAME variable being set on line 36).
of course, this may just be one error in a series of xcode 4/textmate compatibility issues.

A: you want to modify /Applications/TextMate.app/Contents/SharedSupport/Bundles/Xcode.tmbundle/Support/bin/xcode_version.rb to detect xcode 4, replace this line
@@xcode2dot1_or_later = (version_match != nil && ...

with this:
xcode4 = /Xcode 4\./.match(version_str)
@@xcode2dot1_or_later = xcode4 || (version_match != nil && ...

you also want to modify /Applications/TextMate.app/Contents/SharedSupport/Bundles/Xcode.tmbundle/Support/bin/run_xcodebuild.sh
( the lines that I commented-out are the originals )
if [[ -n $TM_BUILDSTYLE ]]; then
    # If we have an Xcode project, and it doesn't contain the build style we're looking for,
    # accept the active build style in the project.
    if [[ -d $PROJECT_FILE ]] && xcodebuild -project "$PROJECT_FILE" -list | awk 'display == "yes" { sub(/^[ \t]+/, ""); print }; /Build (styles|Configurations)/ { display = "yes" }' |    grep -F "${BUILD_STYLE}" &>/dev/null; then
        BUILD_STYLE="-$STYLEARGNAME $BUILD_STYLE";
    else
        # BUILD_STYLE="-active$STYLEARGNAME"
        BUILD_STYLE=""
    fi
else
    # BUILD_STYLE="-active$STYLEARGNAME"
    BUILD_STYLE=""
fi


text:
Q: Grow heap (frag case) during file reading with Scanner I'm trying to read a 140kbytes text file with java.util.Scanner class and I got a this message in DDMS
I/dalvikvm-heap﹕ Grow heap (frag case) to 10.202MB for 524304-byte allocation

Here the snippet code that I'm using:

Scanner read = new Scanner(mContext.getResources().openRawResource(R.raw.questions_file));
        read.useDelimiter(";");
        String q=null;
        String a1=null;
        String a2=null;
        String a3=null;
        String a4=null;
        int qno=0;
        try {
            while (read.hasNext()) {

                q = read.next();
                a1 = read.next();
                a2 = read.next();
                a3 = read.next();
                a4 = read.next();
//                mLog(q, a1, a2, a3, a4);
                qno++;

            }

            read.close();

            mLog("There are ", String.valueOf(qno), " questions");
        }catch (Exception e){mLog(e.getMessage());}


text:
Q: Using jquery.slideToggle() with Knockout JS So basically I am looking to create a custom binding so that when the user clicks on a hide/show button I want to toggle the display of the list element underneath it.
At the moment I can get it to partially work, basically if I start with the elements hidden (this.showGalaxys set to false) then click on the hide/show they appear. But the opposite does not occur, that is I cannot hide the now visible list elements.
Ignore the elements after the galaxys section as they will use the same implementation as the galaxy section.
Also keep in mind that I am binding data to these objects earlier in the HTML, that is all working correctly, the only issue is my logic for toggling display of elements.
Here is the relevant section of my HTML Markup:
DEMO: jsFiddle

Results

    Universe:

        Galaxys<button data-bind="click: toggleGalaxys">Show/Hide</button>

                    Star System<button data-bind="fadeVisible: showStarSystems">Show/Hide</button>

                                Planets

Here is the Javascript code being used:
    function UniverseViewModel() {

    var self = this;
    self.universes = ko.observableArray();

    self.addUniverse = function() {
        self.universes.push(new Universe(""));
    };
}

function Universe(name) {

    this.name = ko.observable(name);
    this.galaxys = ko.observableArray();

    this.addGalaxy = function() {
        this.galaxys.push(new Galaxy(""));
    };

    this.displayGalaxys = ko.observable(false);

    this.toggleGalaxys = function () {
        this.displayGalaxys = !this.displayGalaxys;
    };
}

function Galaxy(name) {

    this.name = ko.observable(name);
    this.starSystems = ko.observableArray();

    this.addStarSystem = function() {
        this.starSystems.push(new StarSystem(""));
    };

    this.showStarSystems = ko.observable(false);

}

function StarSystem(name) {

    this.name = ko.observable(name);
    this.planets = ko.observableArray();

    this.addPlanet = function() {
        this.planets.push(new Planet(""));
    };

    this.removePlanet = function(planet) {
        this.planets.remove(planet);
    };

    this.showPlanets = ko.observable(false);
}

function Planet(name) {

    this.name = ko.observable(name);
}

ko.bindingHandlers.fadeVisible = {

    init: function (element, valueAccessor) {

        var value = valueAccessor();
        $(element).toggle(ko.utils.unwrapObservable(value));
    },

    update: function(element, valueAccessor) {

        var value = valueAccessor();
        ko.utils.unwrapObservable(value) ? $(element).fadeIn() : $(element).fadeOut();
    }
};

ko.applyBindings(new UniverseViewModel());

A: The key to solving this can be found here, which describes that

data-bind="fadeVisible: variable": requires the variable to be an observable that is true or false.  You then on your button click change the variable to the opposite...

Enjoy the below solution:
DEMO: jsFiddle
HTML:

Input

    <button data-bind="click: addUniverse">Add New Universe</button>

        <input data-bind="value: name" />

        <button data-bind="click: addGalaxy">Add Galaxies</button>

            <input data-bind="value: name" />

            <button data-bind="click: addStarSystem">Add Star System</button>

                <input data-bind="value: name" />

                <button data-bind="click: addPlanet">Add Planet</button>

                    <input data-bind="value: name" />

Results

 Universe:

 Galaxys

            <button data-bind="click: toggleGalaxys">Show/Hide</button>

 Star System

                        <button data-bind="click: toggleStarSystems">Show/Hide</button>

 Planets

                                    <button data-bind="click: toggleShowPlanets">Show/Hide</button>

JS:
function UniverseViewModel() {

    var self = this;
    self.universes = ko.observableArray();

    self.addUniverse = function () {
        self.universes.push(new Universe(""));
    };
}

function Universe(name) {

    this.name = ko.observable(name);
    this.galaxys = ko.observableArray();

    this.addGalaxy = function () {
        this.galaxys.push(new Galaxy(""));
    };

    this.displayGalaxys = ko.observable(false);

    this.toggleGalaxys = function () {
        this.displayGalaxys(!this.displayGalaxys());
    };
}

function Galaxy(name) {

    this.name = ko.observable(name);
    this.starSystems = ko.observableArray();

    this.addStarSystem = function () {
        this.starSystems.push(new StarSystem(""));
    };

    this.showStarSystems = ko.observable(false);

    this.toggleStarSystems = function () {
        this.showStarSystems(!this.showStarSystems());
    };
}

function StarSystem(name) {

    this.name = ko.observable(name);
    this.planets = ko.observableArray();

    this.addPlanet = function () {
        this.planets.push(new Planet(""));
    };

    this.removePlanet = function (planet) {
        this.planets.remove(planet);
    };

    this.showPlanets = ko.observable(false);

    this.toggleShowPlanets = function () {
        this.showPlanets(!this.showPlanets());
    };
}

function Planet(name) {

    this.name = ko.observable(name);
}

ko.bindingHandlers.fadeVisible = {

    init: function (element, valueAccessor) {

        var value = valueAccessor();
        $(element).toggle(ko.utils.unwrapObservable(value));
    },

    update: function (element, valueAccessor) {

        var value = valueAccessor();
        ko.utils.unwrapObservable(value) ? $(element).fadeIn() : $(element).fadeOut();
    }
};

ko.applyBindings(new UniverseViewModel());

CSS:
html {
    background-color: #e2e2e2;
    margin: 0;
    padding: 0;
}
body {
    background-color: #fff;
    border-top: solid 10px #000;
    color: #333;
    font-size: .85em;
    font-family:"Segoe UI", Verdana, Helvetica, Sans-Serif;
    margin: 0;
    padding: 0;
}
a {
    color: #333;
    outline: none;
    padding-left: 3px;
    padding-right: 3px;
    text-decoration: underline;
}
a:link, a:visited, a:active, a:hover {
    color: #333;
}
a:hover {
    background-color: #c7d1d6;
}
header, footer, hgroup, nav, section {
    display: block;
}
mark {
    background-color: #a6dbed;
    padding-left: 5px;
    padding-right: 5px;
}
.float-left {
    float: left;
}
.float-right {
    float: right;
}
.clear-fix:after {
    content:".";
    clear: both;
    display: block;
    height: 0;
    visibility: hidden;
}
h1, h2, h3, h4, h5, h6 {
    color: #000;
    margin-bottom: 0;
    padding-bottom: 0;
}
h1 {
    font-size: 2em;
}
h2 {
    font-size: 1.75em;
}
h3 {
    font-size: 1.2em;
}
h4 {
    font-size: 1.1em;
}
h5, h6 {
    font-size: 1em;
}
h5 a:link, h5 a:visited, h5 a:active {
    padding: 0;
    text-decoration: none;
}
/* main layout
----------------------------------------------------------*/
 .content-wrapper {
    margin: 0 auto;
    max-width: 960px;
}
#body {
    background-color: #efeeef;
    clear: both;
    padding-bottom: 35px;
}
.main-content {
    background: url("../Images/accent.png") no-repeat;
    padding-left: 10px;
    padding-top: 30px;
}
.featured + .main-content {
    background: url("../Images/heroAccent.png") no-repeat;
}
header .content-wrapper {
    padding-top: 20px;
}
footer {
    clear: both;
    background-color: #e2e2e2;
    font-size: .8em;
    height: 100px;
}
/* site title
----------------------------------------------------------*/
 .site-title {
    color: #c8c8c8;
    font-family: Rockwell, Consolas, "Courier New", Courier, monospace;
    font-size: 2.3em;
    margin: 0;
}
.site-title a, .site-title a:hover, .site-title a:active {
    background: none;
    color: #c8c8c8;
    outline: none;
    text-decoration: none;
}
/* login
----------------------------------------------------------*/
 #login {
    display: block;
    font-size: .85em;
    margin: 0 0 10px;
    text-align: right;
}
#login a {
    background-color: #d3dce0;
    margin-left: 10px;
    margin-right: 3px;
    padding: 2px 3px;
    text-decoration: none;
}
#login a.username {
    background: none;
    margin-left: 0px;
    text-decoration: underline;
}
#login ul {
    margin: 0;
}
#login li {
    display: inline;
    list-style: none;
}
/* menu
----------------------------------------------------------*/
 ul#menu {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0 0 5px;
    padding: 0;
    text-align: right;
}
ul#menu li {
    display: inline;
    list-style: none;
    padding-left: 15px;
}
ul#menu li a {
    background: none;
    color: #999;
    text-decoration: none;
}
ul#menu li a:hover {
    color: #333;
    text-decoration: none;
}
/* page elements
----------------------------------------------------------*/

/* featured */
 .featured {
    background-color: #fff;
}
.featured .content-wrapper {
    background-color: #7ac0da;
    background-image: -ms-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
    background-image: -o-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
    background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7ac0da), color-stop(1, #a4d4e6));
    background-image: -webkit-linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
    background-image: linear-gradient(left, #7ac0da 0%, #a4d4e6 100%);
    color: #3e5667;
    padding: 20px 40px 30px 40px;
}
.featured hgroup.title h1, .featured hgroup.title h2 {
    color: #fff;
}
.featured p {
    font-size: 1.1em;
}
/* page titles */
 hgroup.title {
    margin-bottom: 10px;
}
hgroup.title h1, hgroup.title h2 {
    display: inline;
}
hgroup.title h2 {
    font-weight: normal;
    margin-left: 3px;
}
/* features */
 section.feature {
    width: 300px;
    float: left;
    padding: 10px;
}
/* ordered list */
 ol.round {
    list-style-type: none;
    padding-left: 0;
}
ol.round li {
    margin: 25px 0;
    padding-left: 45px;
}
ol.round li.zero {
    background: url("../Images/orderedList0.png") no-repeat;
}
ol.round li.one {
    background: url("../Images/orderedList1.png") no-repeat;
}
ol.round li.two {
    background: url("../Images/orderedList2.png") no-repeat;
}
ol.round li.three {
    background: url("../Images/orderedList3.png") no-repeat;
}
ol.round li.four {
    background: url("../Images/orderedList4.png") no-repeat;
}
ol.round li.five {
    background: url("../Images/orderedList5.png") no-repeat;
}
ol.round li.six {
    background: url("../Images/orderedList6.png") no-repeat;
}
ol.round li.seven {
    background: url("../Images/orderedList7.png") no-repeat;
}
ol.round li.eight {
    background: url("../Images/orderedList8.png") no-repeat;
}
ol.round li.nine {
    background: url("../Images/orderedList9.png") no-repeat;
}
/* content */
 article {
    float: left;
    width: 70%;
}
aside {
    float: right;
    width: 25%;
}
aside ul {
    list-style: none;
    padding: 0;
}
aside ul li {
    background: url("../Images/bullet.png") no-repeat 0 50%;
    padding: 2px 0 2px 20px;
}
.label {
    font-weight: 700;
}
/* login page */
 #loginForm {
    border-right: solid 2px #c8c8c8;
    float: left;
    width: 55%;
}
#loginForm .validation-error {
    display: block;
    margin-left: 15px;
}
#socialLoginForm {
    margin-left: 40px;
    float: left;
    width: 40%;
}
#socialLoginForm h2 {
    margin-bottom: 5px;
}
fieldset.open-auth-providers {
    margin-top: 15px;
}
fieldset.open-auth-providers button {
    margin-bottom: 12px;
}
/* contact */
 .contact h3 {
    font-size: 1.2em;
}
.contact p {
    margin: 5px 0 0 10px;
}
.contact iframe {
    border: 1px solid #333;
    margin: 5px 0 0 10px;
}
/* forms */
 fieldset {
    border: none;
    margin: 0;
    padding: 0;
}
fieldset legend {
    display: none;
}
fieldset ol {
    padding: 0;
    list-style: none;
}
fieldset ol li {
    padding-bottom: 5px;
}
label {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
}
label.checkbox {
    display: inline;
}
input, textarea {
    border: 1px solid #e2e2e2;
    background: #fff;
    color: #333;
    font-size: 1.2em;
    margin: 5px 0 6px 0;
    padding: 5px;
    width: 300px;
}
textarea {
    font-family: inherit;
    width: 500px;
}
input:focus, textarea:focus {
    border: 1px solid #7ac0da;
}
input[type="checkbox"] {
    background: transparent;
    border: inherit;
    width: auto;
}
input[type="submit"], input[type="button"], button {
    background-color: #d3dce0;
    border: 1px solid #787878;
    cursor: pointer;
    font-size: 1.0em;
    font-weight: 600;
    padding: 7px;
    margin-right: 8px;
    width: auto;
}
td input[type="submit"], td input[type="button"], td button {
    font-size: 1em;
    padding: 4px;
    margin-right: 4px;
}
/* info and errors */
 .message-info {
    border: 1px solid;
    clear: both;
    padding: 10px 20px;
}
.message-error {
    clear: both;
    color: #e80c4d;
    font-size: 1.1em;
    font-weight: bold;
    margin: 20px 0 10px 0;
}
.message-success {
    color: #7ac0da;
    font-size: 1.3em;
    font-weight: bold;
    margin: 20px 0 10px 0;
}
.error {
    color: #e80c4d;
}
/* styles for validation helpers */
 .field-validation-error {
    color: #e80c4d;
    font-weight: bold;
}
.field-validation-valid {
    display: none;
}
input.input-validation-error {
    border: 1px solid #e80c4d;
}
input[type="checkbox"].input-validation-error {
    border: 0 none;
}
.validation-summary-errors {
    color: #e80c4d;
    font-weight: bold;
    font-size: 1.1em;
}
.validation-summary-valid {
    display: none;
}
/* tables
----------------------------------------------------------*/
 table {
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 0.75em;
    border: 0 none;
}
th {
    font-size: 1.2em;
    text-align: left;
    border: none 0px;
    padding-left: 0;
}
th a {
    display: block;
    position: relative;
}
th a:link, th a:visited, th a:active, th a:hover {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    padding: 0;
}
th a:hover {
    color: #000;
}
th.asc a, th.desc a {
    margin-right: .75em;
}
th.asc a:after, th.desc a:after {
    display: block;
    position: absolute;
    right: 0em;
    top: 0;
    font-size: 0.75em;
}
th.asc a:after {
    content:'▲';
}
th.desc a:after {
    content:'▼';
}
td {
    padding: 0.25em 2em 0.25em 0em;
    border: 0 none;
}
tr.pager td {
    padding: 0 0.25em 0 0;
}
/********************
*   Mobile Styles   *
********************/
 @media only screen and (max-width: 850px) {
    /* header
    ----------------------------------------------------------*/
    header .float-left, header .float-right {
        float: none;
    }
    /* logo */
    header .site-title {
        margin: 10px;
        text-align: center;
    }
    /* login */
    #login {
        font-size: .85em;
        margin: 0 0 12px;
        text-align: center;
    }
    #login ul {
        margin: 5px 0;
        padding: 0;
    }
    #login li {
        display: inline;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    #login a {
        background: none;
        color: #999;
        font-weight: 600;
        margin: 2px;
        padding: 0;
    }
    #login a:hover {
        color: #333;
    }
    /* menu */
    nav {
        margin-bottom: 5px;
    }
    ul#menu {
        margin: 0;
        padding: 0;
        text-align: center;
    }
    ul#menu li {
        margin: 0;
        padding: 0;
    }
    /* main layout
    ----------------------------------------------------------*/
    .main-content, .featured + .main-content {
        background-position: 10px 0;
    }
    .content-wrapper {
        padding-right: 10px;
        padding-left: 10px;
    }
    .featured .content-wrapper {
        padding: 10px;
    }
    /* page content */
    article, aside {
        float: none;
        width: 100%;
    }
    /* ordered list */
    ol.round {
        list-style-type: none;
        padding-left: 0;
    }
    ol.round li {
        padding-left: 10px;
        margin: 25px 0;
    }
    ol.round li.zero, ol.round li.one, ol.round li.two, ol.round li.three, ol.round li.four, ol.round li.five, ol.round li.six, ol.round li.seven, ol.round li.eight, ol.round li.nine {
        background: none;
    }
    /* features */
    section.feature {
        float: none;
        padding: 10px;
        width: auto;
    }
    section.feature img {
        color: #999;
        content: attr(alt);
        font-size: 1.5em;
        font-weight: 600;
    }
    /* forms */
    input {
        width: 90%;
    }
    /* login page */
    #loginForm {
        border-right: none;
        float: none;
        width: auto;
    }
    #loginForm .validation-error {
        display: block;
        margin-left: 15px;
    }
    #socialLoginForm {
        margin-left: 0;
        float: none;
        width: auto;
    }
    /* footer
    ----------------------------------------------------------*/
    footer .float-left, footer .float-right {
        float: none;
    }
    footer {
        text-align: center;
        height: auto;
        padding: 10px 0;
    }
    footer p {
        margin: 0;
    }
}
/* END: Mobile Styles */


text:
Q: Deploy a Qt project on linux This may be a noob question, but I have been stuck trying to work out how to statically build my qt project on linux. I tried doing what it said on http://doc.qt.io/qt-5/linux-deployment.html , but I do not understand the 1st step. When I cd to the location of my qt project and run
    cd /path/to/Qt
./configure -static -prefix /path/to/Qt <otherparameters>
make
 it says no such file or directory. Am I misunderstanding what paths I need to use? I want to make my qt project a stand alone executable which doesnt require the computer it is on to have qt. I have read about dynamically linking the libraries, but I dont really know what to do with that either. The deploy option is greyed out in qtcreator, is there a way to use this?
Thanks

A: /path/to/Qt should be the path to Qt's sources, not your project's. That section of the documentation is about building Qt statically, which you must do before trying to statically link your application to Qt. For example, if you downloaded/cloned the sources to /home/jxb458/qt5, then you'd replace /path/to/Qt with that:
cd /home/jxb458/qt5
./configure -static -prefix /home/jxb458/qt5/qtbase
make

A: Static linking is great when it works, but it can be an effort - I have found especially when using GUI. As Mitch said you need to actually re-build the Qt source code
I made some notes back when I was building statically quite a bit here: Notes on static building (derived from many sources) they should at least point you in the right direction - you can probably ignore the part about installing Ubuntu - the notes assume a new install.
However I have more recently returned to the dynamic linking deployment since I feel this is a better way to deploy now. You don't need to install Qt on the target machine you just need to collect the qt dlls and copy them with your application (using ldd executable-name which produces a list of dlls you need - but just take the Qt ones not the system/generic ones). For plugins you need to do a bit more (but its fairly simple). I even wrote a bash script to do this automatically (i'll send it to you if you need it), in windows there is a qt script called windeployqt (not sure why there is not a linux variant).
If I where to start again looking into deployment I would go for dynamic linking. Maybe try with a simple project to start with (like a hello world proj).