compare_oracle / oraclechunk45.json
xPXXX's picture
Upload 10 files
26d7090
Raw
History Blame Contribute Delete
55.7 kB
Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
{"QuestionId": 32758536, "AnswerCount": 1, "Tags": "<python><logging>", "CreationDate": "2015-09-24T10:01:34.930", "AcceptedAnswerId": null, "Title": "Creat a Log window in Python", "Body": "<p>I want a script in python which opens a logger window when the test is running and the output I want to see will be pushed to the logger window. I found baisc GUI script using wxpython but I dont know how to push my output to the gui being opened. Can anyone help me? </p>\n\n<p>My Code:</p>\n\n<pre><code>import wx\nimport thread\nimport threading\n\nclass ExamplePanel(wx.Panel): \n def __init__(self, parent):\n wx.Panel.__init__(self, parent)\n self.quote = wx.StaticText(self, label=\"Your Log :\", pos=(10, 10))\n\n self.logger = wx.TextCtrl(self, pos=(0,40), size=(1100,1100), style=wx.TE_MULTILINE | wx.TE_READONLY)\n def append_txt(self,txt):\n self.logger.AppendText(txt)\n\n\n\n\ndef sample_Window():\n app = wx.App(False)\n frame = wx.Frame(None)\n panel = ExamplePanel(frame)\n frame.Show()\n panel.append_txt(\"Log Starts Here\\n First line of code \\n Second line of code \")\n app.MainLoop()\n\nsample_Window()\n</code></pre>\n\n<p>Once I give the app.Mainloop I am not able give further input to the appendtext method. I got suggestions to use threading to run the append_txt as a separate thread to pass the argument but i am not sure how to do it. My goal is call a method and pass on the text as argument which will show the text in logger window.</p>\n", "Lable": "No"}
{"QuestionId": 32760390, "AnswerCount": 1, "Tags": "<ios><xcode><swift><uiview><uisegmentedcontrol>", "CreationDate": "2015-09-24T11:39:56.397", "AcceptedAnswerId": "32762123", "Title": "Use segmented control to switch *and refresh* subviews", "Body": "<p>I'm using a segmented control to supplement a tab controller and add extra options within that section. </p>\n\n<p><a href=\"https://i.stack.imgur.com/4pmIG.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/4pmIG.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>The segmented control switches between three containers, each of which has an embedded tableviewcontainer and i flip between them by showing / hiding as necessary: </p>\n\n<pre><code>@IBOutlet var listPicker: UISegmentedControl! \n@IBOutlet var dueView: UIView!\n@IBOutlet var nextView: UIView!\n@IBOutlet var doneView: UIView!\n\nswitch sender.selectedSegmentIndex{\n case 0: \n dueView.hidden = false\n nextView.hidden = true\n doneView.hidden = true\n ...\n }\n</code></pre>\n\n<p>Each view is linked to a UITableViewController in the storyboard:</p>\n\n<p><a href=\"https://i.stack.imgur.com/hHgfp.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hHgfp.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>Rather than just showing (unhiding) the view (which is working), is there a way to refresh its' content too in the same way as the tab bar controller does?</p>\n", "Lable": "No"}
{"QuestionId": 32808855, "AnswerCount": 1, "Tags": "<computer-vision><neural-network><deep-learning><caffe>", "CreationDate": "2015-09-27T14:16:01.007", "AcceptedAnswerId": "32810143", "Title": "Data Layer Prefetch Queue Empty followed by loss 0", "Body": "<p>I'm fine-tuning caffenet on my own dataset.\nI've successfully done it on flickr style dataset,\nso I've modified solver and train_val prototxt files to point to my dataset, with new output dimension (=100 classes).</p>\n\n<p>The size of my dataset is 1.88M images for training, and .48M images for testing.</p>\n\n<p>When I started training, it paused for a while showing</p>\n\n<pre><code>... blocking_queue.cpp:50] Data layer prefetch queue empty\n</code></pre>\n\n<p>and then it proceeded as following:</p>\n\n<pre><code>... solver.cpp:414] Test net output #0: accuracy = 0.0002\n... solver.cpp:414] Test net output #1: loss = 5.6139 (* 1 = 5.6139 loss)\n... solver.cpp:242] Iteration 0, loss = 7.23329\n... solver.cpp:258] Train net output #0: loss = 7.23329 (* 1 = 7.23329 loss)\n... solver.cpp:571] Iteration 0, lr = 0.001\n... solver.cpp:242] Iteration 20, loss = 0\n... solver.cpp:258] Train net output #0: loss = 0 (* 1 = 0 loss)\n... solver.cpp:571] Iteration 20, lr = 0.001\n... solver.cpp:242] Iteration 40, loss = 0\n... solver.cpp:258] Train net output #0: loss = 0 (* 1 = 0 loss)\n... solver.cpp:571] Iteration 40, lr = 0.001\n</code></pre>\n\n<p>and so on.\nSo apparently, no loss is being calculated at all. Weirdly, the initial loss at iteration 0 seems fair enough though.</p>\n\n<p>So apparently, data were not loaded properly. I'm using text files to list the file paths and their labels. </p>\n\n<p>I'm using softmax loss.</p>\n\n<p>I've tried reducing initial learning rate to 1/10 but no change.</p>\n\n<p>**edit: I've tried initial learning rate of 1/1000. Initially it seemed to work. After about 300 iterations, its loss quickly declined again and accuracy reached 100%, signifying that something might've gone wrong again. The symptoms appeared with both caffenet and VGG.</p>\n\n<p>Any idea what might have possibly gone wrong?</p>\n", "Lable": "D"}
{"QuestionId": 32964592, "AnswerCount": 1, "Tags": "<google-cloud-datastore>", "CreationDate": "2015-10-06T07:56:18.430", "AcceptedAnswerId": "32977260", "Title": "Is it possible to run an ' HAS ANCESTOR' filter/query on a property that contains a list(Value) of keys", "Body": "<p>I have a kind <code>client</code> that consists of entities with a property <code>psets</code> containing a list of <code>Key</code></p>\n\n<p>Using the JSON api <code>psets</code> this would expressed as :</p>\n\n<pre><code>psets = { listValue: [ {keyValue: { path: [...]} },{keyValue: { path: [...]} },... ]}\n</code></pre>\n\n<p>The KeyValues are made of <code>path = [{ kind: 'project', name: 'projectn' }]</code></p>\n\n<p>I am trying to run an 'ancestor' query on 'client' using</p>\n\n<pre><code>SELECT * from client where psets HAS ANCESTOR KEY( project, 'project1')\n</code></pre>\n\n<p>This query returns an error: <code>unsupported property</code></p>\n\n<p>What is unsupported ?</p>\n\n<p>How can I run an 'HAS ANCESTOR' filter on a list of Keys ?</p>\n\n<p>Please note that according the the <a href=\"https://cloud.google.com/datastore/docs/apis/gql/gql_reference\" rel=\"nofollow\">DataStore Documentation</a> (Operators and comparisons)</p>\n\n<blockquote>\n <p>A condition can also test whether one entity has another entity as an ancestor, using the HAS ANCESTOR or HAS DESCENDANT operators. These operators test ancestor relationships between keys. They can operate on __key__, but <strong>they can also operate on a key-valued property</strong>. For HAS ANCESTOR, the right operand cannot be a property</p>\n</blockquote>\n\n<p>(emphasis mine)</p>\n", "Lable": "No"}
{"QuestionId": 33006819, "AnswerCount": 1, "Tags": "<python><mongodb><python-3.x>", "CreationDate": "2015-10-08T04:45:03.337", "AcceptedAnswerId": "33009341", "Title": "Python db Not equal Mongo Code not Working?", "Body": "<p>The following works when typed directly in the mongodb shell\u2014I receive the correct output:</p>\n\n<pre><code>db.serial_key.find({key: {$ne : \"5SNT0V\"}})\n</code></pre>\n\n<p>However, in Python 3, it's not working. Every time, only the if block runs. It does not matter if I use <code>str</code> or not in the query.</p>\n\n<pre><code> for x in keys:\n i +=1;\n print('key %d = ' %i , keys[i-1]) #out put: key 1 = 3ZOHSH\n\n # place values in dictionary\n keyrecord_record = {'key':keys[i-1],'b_p_code':x1}\n\n\n if(db.serial_key.find({'key':{ '$ne':str(keys[i-1])}})):\n db.insert(keyrecord_record)\n else:\n print('Record in DB')\n</code></pre>\n\n<p>Please, I expect some expert help. I'm trying to do this within one day. I only want to write values that are not already in the database.</p>\n\n<p>I found this question: \n<a href=\"https://stackoverflow.com/questions/23326687/mongo-db-not-equal-to-query-not-working\">Mongo db not equal to query not working</a></p>\n\n<p>...but it does not answer my question.</p>\n\n<p>===================full main class code==========================</p>\n\n<pre><code>from pymongo import MongoClient\nfrom algo import algo\n\n\n#take in put data\nx1 = int(input(\"Enter a number(Brand_name+Pack_size) : \"))\ny1 = int(input(\"Enter a number: key Quntity \"))\n\n#create connection\nclient = MongoClient()\n\n#create emty list\nalist = []\n\n#make database_table\ndb = client.product.serial_key\nkeyrecord_record = {}\n\n#find table existing entry that code\nf_cursor = db.find({\"b_p_code\": x1})\n\nfor document in f_cursor:\n alist.append(document['key'])\n #print(document['key']) //print expected result\n\n\n\nif(x1 == \"\" or y1==\"\"):\n print(\"please enter valid no\")\nelse:\n x = algo(x1,y1,alist)\n\n keys =x.id_generator()\n keys.sort(reverse=True)\n print('\\n')\n i=0;\n for x in keys:\n i +=1;\n print('key %d = ' %i , keys[i-1])\n\n # place values in dictionary\n keyrecord_record = {'key':keys[i-1],'b_p_code':x1}\n\n\n #not recived expected result. if key in database again print key\n if(db.serial_key.find({'key':{ '$ne':str(keys[i-1])}})):\n db.insert(keyrecord_record)\n else:\n print('Record in DB')\n\n\n print(\"\\n\")\n print(\"Batch No: come from db \")\n print('Generate Key beetween %d00000 - %d00000' % (x1 ,(x1+1)) )\n print(\"Startin Serial : \" , keys[0])\n print(\"Ending Serial : \" , keys[len(keys)-1])\n\n\n\nprint('\\n Database Details \\n')\n#print details\ncursor = db.find()\n\nfor document in cursor:\n print(document['key'])\n #print(document) \n</code></pre>\n\n<p>Image showing console out put.</p>\n\n<p><a href=\"https://i.stack.imgur.com/RUGVC.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/RUGVC.png\" alt=\"enter image description here\"></a></p>\n", "Lable": "No"}
{"QuestionId": 33011370, "AnswerCount": 1, "Tags": "<scripting><rpm><rpmbuild>", "CreationDate": "2015-10-08T09:09:46.217", "AcceptedAnswerId": null, "Title": "Define many macros for rpmbuild at once?", "Body": "<p>I would like to pass many macros into <code>rpmuild</code> without having to type out each macro manually, or even have a long makefile with <code>-D 'foo bar' -D 'foo bar' -D 'foo bar'</code> many times. I want to pass these macros into rpmbuild \"all at once\".</p>\n\n<p>Let me describe my use case - I have a script called <code>buildid</code> that reports information about a build;</p>\n\n<pre><code>user@host: buildid -k tag\n1.8.0-1444293343\n\nuser@host: buildid -k buildhost.platform\nLinux-4.0.7-300.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two\n\nuser@host: buildid -k version.formatted.gnu\n1.8.0\n</code></pre>\n\n<p>I use these values in a RPM .spec file like this;</p>\n\n<pre><code>rpmbuild -ba foo.spec -D \"tag `buildid -k tag`\" -D \"buildhost_platform `buildid -k buildhost.platform`\" -D \"version `buildid -k version.formatted.gnu`\"\n</code></pre>\n\n<p>This is the sucky part - a long command line, with lots of typing. Even if I use a Makefile, it's still ugly. </p>\n\n<p>My buildid script is pretty flexible though, and can save these buildid values to a file (.buildid_rpmmacros) or whatever, but better, can just print them out in a nice format like this; </p>\n\n<pre><code>user@host: buildid -f rpmmacros\n%buildhost.hostname myhost.example.com\n%buildhost.platform Linux-4.0.7-300.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two\n%buildhost.release 4.0.7-300.fc22.x86_64\n%buildhost.system Linux\n%buildhost.version #1 SMP Mon Jun 29 22:15:06 UTC 2015\n%git.branch master\n%git.revision 48a30d610cf1ab57dcc6947b2366b6a5e9a1fcc6\n%git.revision.short 48a30d6\n%tag 1.8.0-1444293343\n%timestamp 1444293343\n%version.formatted.gnu 1.8.0\n%version.formatted.short 1.8.0\n%version.formatted.win 1.8.0.0\n%version.major 1\n%version.minor 8\n%version.release \n%version.revision 0\n</code></pre>\n\n<p>If I could do something like this, it would be ideal;</p>\n\n<pre><code>rpmbuild -ba foo.spec --macros-stdin &lt; `buildid -f rpmmacros`\n</code></pre>\n\n<p>Finally, the macros are project/RPM specific, not global. This means storing them in <code>~/.rpmmacros</code> would not be a viable solution. I can save to a file easily (<code>buildid -nF rpmmacros</code>), but I'm already persisting them to a file in <code>ini</code> format, and just want to output them temporarily in RPM macro format (<code>buildid -f rpmmacro</code>)</p>\n\n<hr>\n\n<p>Shameless plug - if you're interested in the <code>buildid</code> tool; <a href=\"https://github.com/jamesread/buildid\" rel=\"nofollow\">https://github.com/jamesread/buildid</a></p>\n", "Lable": "No"}
{"QuestionId": 33048409, "AnswerCount": 1, "Tags": "<android><orientation><android-linearlayout><android-view><onconfigurationchanged>", "CreationDate": "2015-10-09T23:10:12.673", "AcceptedAnswerId": "33051080", "Title": "Null object reference if configuration changes", "Body": "<p>I get null object reference if configuration changes for only <code>LinearLayout</code> objects.</p>\n\n<p><strong>landscape</strong> mode I have to <code>setVisiblity = View.GONE</code> for all views except one view </p>\n\n<p><strong>portrait</strong> mode I have to <code>setVisibility = View.VISIBLE</code> for all views: </p>\n\n<pre><code>if (Activity started in portrait mode then turned into landscape) \n{it work fine}\nelse {it get null object reference only for linearLayout objects}\n</code></pre>\n\n<p>objects return this error are called <code>chart</code> , <code>progress_layout</code> .</p>\n\n<p><strong>edited</strong></p>\n\n<p><strong>most of class \"related code snippet\" cause full class 1000 line cannot post it</strong></p>\n\n<pre><code>public class Cardio extends ActionBarActivity implements InsertDialogue.Insert, saveDialogue.Save, HistoryDialogue.History, AdapterView.OnItemSelectedListener {\n float Float;\n int Day = 0;\n Database database;\n int i;\n int num;\n static Spinner spinner;\n static int pos;\n Progress p;\n SubActionButton goalSubButton;\n boolean gool = false;\n YAxis leftAxis ;\n LineChart Running_LineChart ;\n int intent ;\n FloatingActionMenu x ;\n FloatingActionButton actionButton ;\n String orientation ;\n LinearLayout historyText ;\n ArrayList&lt;Entry&gt; Running_ArrayEntry ;\n int First_entries ;\n LinearLayout chart ;\n LinearLayout progress_layout ;\n boolean HistoryTextAfterRotation ;\n\n\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n historyText = (LinearLayout) findViewById(R.id.historyLayoutText);\n chart = (LinearLayout) findViewById(R.id.chartid);\n progress_layout = (LinearLayout) findViewById(R.id.group);\n Running_LineChart = (LineChart) findViewById(R.id.chart);\n Log.e(\"oncreate\",\"oncreate\");\n getWindow().getDecorView().setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n database = new Database(this);\n Bundle extras = getIntent().getExtras();\n intent = extras.getInt(\"activity\");\n p = new Progress();\n orientation = getRotation();\n if( savedInstanceState == null) {\n getSupportFragmentManager().beginTransaction()\n .add(R.id.group, p)\n .commit();\n }\n else\n {\n String ftagment = savedInstanceState.getString(\"frag\");\n getSupportFragmentManager().beginTransaction()\n .add(p,ftagment)\n .commit();\n }\n addPlus();\n switch (orientation) {\n case \"l\":\n actionButton.setVisibility(View.GONE);\n break;\n case \"p\" :\n actionButton.setVisibility(View.VISIBLE);\n break;\n }\n }\n\n @Override\n public void onConfigurationChanged(Configuration newConfig) {\n orientation = getRotation() ;\n setGoalSubButton_Visiblity();\n if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {\n if(actionButton!=null&amp;&amp;actionButton.getVisibility()!=View.GONE) {\n actionButton.setVisibility(View.GONE);\n }\n if(spinner!=null&amp;&amp;spinner.getVisibility()!=View.GONE) {\n spinner.setVisibility(View.GONE);\n }\n // p.setUserVisibleHint(false);\n\n\n if(progress_layout!=null&amp;&amp;progress_layout.getVisibility()!=View.GONE) {\n progress_layout.setVisibility(View.GONE);\n }\n\n if(chart!=null&amp;&amp;chart.getVisibility()!=View.GONE) {\n chart.getLayoutParams().height = LinearLayout.LayoutParams.MATCH_PARENT;\n }\n if(historyText!=null&amp;&amp;historyText.getVisibility()!=View.GONE) {\n historyText.setVisibility(View.GONE);\n }\n if(Running_LineChart!=null&amp;&amp;Running_LineChart.getVisibility()!=View.GONE) {\n Running_LineChart.animateY(1300);\n }\n // Changes the height and width to the specified *pixels*\n // chart = (LinearLayout) findViewById(R.id.chartid);\n // chart.getLayoutParams().height = LayoutParams.MATCH_PARENT;\n // setContentView(R.layout.activity_main_land);\n // Toast.makeText(this,\"chnge orientation\",Toast.LENGTH_SHORT).show();\n }\n else if(newConfig.orientation ==Configuration.ORIENTATION_PORTRAIT) {\n actionButton.setVisibility(View.VISIBLE);\n spinner.setVisibility(View.VISIBLE);\n p.setUserVisibleHint(false);\n Log.e(\"BEFORE LOG\",\"BEFOR PROGRESS LAYOUT \");\n progress_layout.setVisibility(View.VISIBLE);\n chart.getLayoutParams().height =0;\n if(HistoryTextAfterRotation&amp;&amp;historyText.getVisibility()!=View.VISIBLE) {\n historyText.setVisibility(View.VISIBLE);}\n Running_LineChart.animateY(1300);\n x.close(true);\n }\n super.onConfigurationChanged(newConfig);\n\n\n }\n public String getRotation(){\n final int rotation = ((WindowManager) this.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getOrientation();\n switch (rotation) {\n case Surface.ROTATION_0:\n return \"p\";\n case Surface.ROTATION_90:\n return \"l\";\n case Surface.ROTATION_180:\n return \"p\";\n default:\n return \"l\";\n }\n\n }\n\n\n\n public void setGoalSubButton_Visiblity() {\n orientation = getRotation() ;\n switch (orientation) {\n case \"p\": {\n if (getIdsFromGoalLimitsTables()) {\n x.close(true);\n actionButton.removeAllViews();\n actionButton.detach();\n Log.e(\"mohab\", \"gool must be visible \");\n addPlus();\n p.setGoal_unset();\n } else {\n x.close(true);\n actionButton.removeAllViews();\n actionButton.detach();\n Log.e(\"mohab\", \"gool must be invisible\");\n addPlus();\n p.setGoal(getgoalFromDatabase());\n }\n }\n }\n updateProgress();\n addEntries(0, 0, true,false,0);\n\n }\n\n\n\n @Override\n protected void onSaveInstanceState(Bundle savedInstanceState) {\n if (p != null) {\n savedInstanceState.putString(\"frag\",\n p.getTag());\n }\n super.onSaveInstanceState(savedInstanceState);\n }\n\n\n\n @Override\n protected void onResume() {\n super.onResume();\n setSpinner();\n setGoalSubButton_Visiblity();\n // addEntries(0, 0, true, false, 0); // cause its added in setGoal event\n }\n</code></pre>\n\n<p><strong>manifest</strong></p>\n\n<pre><code> &lt;activity\n android:name=\".Cardio.Cardio\"\n android:configChanges=\"orientation|screenSize\"\n &gt;\n &lt;/activity&gt;\n</code></pre>\n\n<p><strong>Logcat</strong></p>\n\n<pre><code> 10-10 07:05:42.721: E/AndroidRuntime(4115): FATAL EXCEPTION: main\n10-10 07:05:42.721: E/AndroidRuntime(4115): Process: developer.mohab.gymee, PID: 4115\n10-10 07:05:42.721: E/AndroidRuntime(4115): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.LinearLayout.setVisibility(int)' on a null object reference\n10-10 07:05:42.721: E/AndroidRuntime(4115): at developer.mohab.gymee.Cardio.Cardio.onConfigurationChanged(Cardio.java:154)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at android.app.ActivityThread.performConfigurationChanged(ActivityThread.java:4150)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:4225)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1461)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at android.os.Handler.dispatchMessage(Handler.java:102)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at android.os.Looper.loop(Looper.java:211)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at android.app.ActivityThread.main(ActivityThread.java:5389)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at java.lang.reflect.Method.invoke(Native Method)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at java.lang.reflect.Method.invoke(Method.java:372)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)\n10-10 07:05:42.721: E/AndroidRuntime(4115): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)\n</code></pre>\n\n<p><strong>xml file</strong></p>\n\n<pre><code> &lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:weightSum=\"5\"\n android:orientation=\"vertical\"\n tools:context=\".MainActivity\"\n android:id=\"@+id/layout\"\n android:background=\"@android:color/white\"&gt;\n\n\n\n\n &lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"0dp\"\n android:layout_weight=\"3\"\n android:orientation=\"vertical\"\n android:id=\"@+id/chartid\"\n android:background=\"@color/gridBack\"&gt;\n &lt;com.github.mikephil.charting.charts.LineChart\n android:id=\"@+id/chart\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:layout_marginTop=\"25dp\"\n /&gt;\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:gravity=\"center\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:id=\"@+id/historyLayoutText\"&gt;\n &lt;TextView\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:gravity=\"center\"\n android:textColor=\"@color/start\"\n android:textSize=\"23dp\"\n android:layout_marginTop=\"5dp\"\n android:text=\"History\" /&gt;\n &lt;/LinearLayout&gt;\n\n\n\n &lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"0dp\"\n android:id=\"@+id/linearLayout2\"\n android:layout_weight=\"2\"\n android:gravity=\"right\"\n android:orientation=\"horizontal\"\n\n &gt;\n &lt;LinearLayout\n android:id=\"@+id/group\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:layout_weight=\"1\"\n &gt;\n &lt;/LinearLayout&gt;\n\n &lt;Spinner\n android:layout_width=\"130dp\"\n android:layout_height=\"50dp\"\n android:layout_marginTop=\"10dp\"\n android:id=\"@+id/spinner\"\n\n /&gt;\n\n\n &lt;/LinearLayout&gt;\n\n\n\n\n&lt;/LinearLayout&gt;\n</code></pre>\n\n<p>thanx in advance!</p>\n", "Lable": "No"}
{"QuestionId": 33069918, "AnswerCount": 2, "Tags": "<bit-manipulation>", "CreationDate": "2015-10-11T20:41:13.913", "AcceptedAnswerId": "33070107", "Title": "Getting shorts from an integer", "Body": "<p>I'm supposed to pack some shorts into a 32 bit integer. It's a homework assignment that will lead into a larger idea of compression/decompression. </p>\n\n<p>I don't have any problems understanding how to pack the shorts into an integer, but I am struggling to understand how to get each short value stored within the integer.</p>\n\n<p>So, for example, I store the values 2, 4, 6, 8 into the integer. That means I want to print them in the same order I input them.</p>\n\n<p>How do you go about getting these values out from the integer? </p>\n\n<p>EDIT: Shorts in this context refers to an unsigned two-byte integer. </p>\n", "Lable": "No"}
{"QuestionId": 33077211, "AnswerCount": 0, "Tags": "<java><jpa><wildfly>", "CreationDate": "2015-10-12T09:05:51.463", "AcceptedAnswerId": null, "Title": "jpa subgraph and MappedSuperclass throws Unknown entity", "Body": "<p>I have a silly problem with subgraphs. It's my firsttime with EntityGraphs.</p>\n\n<p>I have following classes im my common lib:</p>\n\n<pre><code>import java.util.Set;\n\nimport javax.persistence.CascadeType;\nimport javax.persistence.ManyToMany;\nimport javax.persistence.MappedSuperclass;\n\n@MappedSuperclass\npublic abstract class NamedDomainObjectWithFiles extends NamedDomainObject {\n\n/**\n * \n */\nprivate static final long serialVersionUID = 1L;\n\n@ManyToMany(cascade = CascadeType.ALL)\nprivate Set&lt;File&gt; files;\n\npublic Set&lt;File&gt; getFiles() {\n return files;\n}\n\npublic void setFiles(Set&lt;File&gt; files) {\n this.files = files;\n}\n\n}\n</code></pre>\n\n<p>and</p>\n\n<pre><code>import java.util.Date;\nimport java.util.Set;\n\nimport javax.persistence.Entity;\nimport javax.persistence.ManyToMany;\nimport javax.persistence.NamedAttributeNode;\nimport javax.persistence.NamedEntityGraph;\nimport javax.persistence.NamedEntityGraphs;\nimport javax.persistence.NamedQueries;\nimport javax.persistence.NamedQuery;\nimport javax.validation.constraints.NotNull;\nimport javax.validation.constraints.Size;\n\n@NamedQueries({ @NamedQuery(name = File.findAll, query = \"SELECT f FROM File f ORDER BY f.createdOn\"),\n@NamedQuery(name = File.findByName, query = \"SELECT f FROM File f WHERE f.name = :name\") })\n\n@NamedEntityGraphs({ \n@NamedEntityGraph(name = File.EG_LoadRoles, attributeNodes = { @NamedAttributeNode(\"roles\") }),\n@NamedEntityGraph(name = File.EG_LoadALL, includeAllAttributes=true)\n})\n@Entity\npublic class File extends NamedDomainObject{\n\n/**\n * \n */\nprivate static final long serialVersionUID = 3696244073145217983L;\n\npublic static final String findByName = \"File.findByName\";\npublic static final String findAll = \"File.findAll\";\npublic static final String EG_LoadRoles = \"File.EG_LoadRoles\";\npublic static final String EG_LoadALL = \"File.EG_LoadALL\";\n\n@ManyToMany\nprivate Set&lt;Role&gt; roles;\n\n@ManyToMany\nprivate Set&lt;FileCategory&gt; fileCategories;\n\npublic Set&lt;Role&gt; getRoles() {\n return roles;\n}\n\npublic void setRoles(Set&lt;Role&gt; roles) {\n this.roles = roles;\n}\n\npublic Set&lt;FileCategory&gt; getFileCategories() {\n return fileCategories;\n}\n\npublic void setFileCategories(Set&lt;FileCategory&gt; fileCategories) {\n this.fileCategories = fileCategories;\n}\n\n}\n</code></pre>\n\n<p>and the class Kunde in my war</p>\n\n<pre><code>import java.util.Date;\nimport java.util.List;\n\nimport javax.persistence.CascadeType;\nimport javax.persistence.Embedded;\nimport javax.persistence.Entity;\nimport javax.persistence.ManyToOne;\nimport javax.persistence.NamedAttributeNode;\nimport javax.persistence.NamedEntityGraph;\nimport javax.persistence.NamedEntityGraphs;\nimport javax.persistence.NamedQueries;\nimport javax.persistence.NamedQuery;\nimport javax.persistence.NamedSubgraph;\nimport javax.persistence.OneToMany;\nimport javax.persistence.Temporal;\nimport javax.persistence.TemporalType;\n\nimport de.xxx.common.domain.Address;\nimport de.xxx.common.domain.NamedDomainObjectWithFiles;\n\n@NamedQueries({ @NamedQuery(name = Kunde.findAll, query = \"SELECT b FROM Kunde b where b.activ=1 ORDER BY b.name\"),\n @NamedQuery(name = Kunde.findByName, query = \"SELECT b FROM Kunde b WHERE b.name = :name\") })\n@NamedEntityGraphs({ \n@NamedEntityGraph(name = Kunde.EG_loadAll, \n attributeNodes = {\n @NamedAttributeNode(value = \"files\", subgraph = Kunde.SG_filesLoadAll)\n }, \n subgraphs = {\n @NamedSubgraph(name = Kunde.SG_filesLoadAll, \n attributeNodes = { \n @NamedAttributeNode(\"roles\"),\n @NamedAttributeNode(\"fileCategories\") \n }\n ) \n }\n) \n})\n\n@Entity\npublic class Kunde extends NamedDomainObjectWithFiles {\n\n/**\n * \n */\nprivate static final long serialVersionUID = -7339308550470317787L;\n\npublic static final String findByName = \"Kunde.findByName\";\npublic static final String findAll = \"Kunde.findAll\";\npublic static final String EG_loadAll = \"Kunde.EG_loadAll\";\n\npublic static final String SG_filesLoadAll = \"Kunde.SG_filesLoadAll\";\n\n@OneToMany(cascade = CascadeType.ALL, mappedBy = \"kunde\", orphanRemoval = true)\nprivate List&lt;Objekt&gt; objekte;\n\npublic Kunde() {\n}\n\npublic List&lt;Objekt&gt; getObjekte() {\n return objekte;\n}\n\npublic void setObjekte(List&lt;Objekt&gt; objekte) {\n this.objekte = objekte;\n}\n\n}\n</code></pre>\n\n<p>Everything works fine until i try to activate the subgraph 'Kunde.SG_filesLoadAll' in my class Kunde. During startup i get following exception:</p>\n\n<pre><code>org.hibernate.MappingException: Unknown entity: de.xxx.common.domain.NamedDomainObjectWithFiles\n</code></pre>\n\n<p>If i only set </p>\n\n<pre><code>@NamedEntityGraph(name = Kunde.EG_loadAll, \n attributeNodes = {\n @NamedAttributeNode(value = \"files\")\n }\n</code></pre>\n\n<p>no exception is thrown during startup.</p>\n\n<p>I hope you can help me.</p>\n\n<p>I tested this code with the same result on wildfly 8.1 and 9.0.1.</p>\n\n<p>Michael</p>\n\n<p>@Edit:</p>\n\n<p>Here is my persistence.xml</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;persistence version=\"2.0\"\n xmlns=\"http://java.sun.com/xml/ns/persistence\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"\n http://java.sun.com/xml/ns/persistence\n http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd\"&gt;\n &lt;persistence-unit name=\"primary\"&gt;\n &lt;jta-data-source&gt;java:jboss/datasources/ObjektmanagementDS&lt;/jta-data-source&gt;\n &lt;jar-file&gt;lib/common-0.0.1.jar&lt;/jar-file&gt;\n &lt;properties&gt;\n &lt;property name=\"hibernate.dialect\" value=\"org.hibernate.dialect.MySQLDialect\" /&gt;\n &lt;property name=\"hibernate.show_sql\" value=\"true\" /&gt;\n &lt;property name=\"hibernate.connection.driver_class\" value=\"com.mysql.jdbc.Driver\" /&gt;\n &lt;property name=\"hibernate.connection.url\"\n value=\"jdbc:mysql://localhost:3306/objektmanagement?UseUnicode=true&amp;amp;characterEncoding=utf8\" /&gt;\n &lt;property name=\"hibernate.connection.username\" value=\"root\" /&gt;\n &lt;property name=\"hibernate.hbm2ddl.auto\" value=\"update\" /&gt;\n &lt;property name=\"hibernate.format_sql\" value=\"true\" /&gt;\n &lt;/properties&gt;\n &lt;/persistence-unit&gt;\n&lt;/persistence&gt;\n</code></pre>\n", "Lable": "No"}
{"QuestionId": 33169666, "AnswerCount": 1, "Tags": "<ios><swift2><ios9><eventkit>", "CreationDate": "2015-10-16T11:43:10.780", "AcceptedAnswerId": "33170580", "Title": "How to requestAccessToEntityType method in Swift 2.0 iOS 9?", "Body": "<p>I am trying to set reminder and need to access request to entity type method in Swift 2.0 for iOS9. However, it gives me the error: </p>\n\n<blockquote>\n <p>Use of unresolved identifier</p>\n</blockquote>\n\n<pre><code>@IBAction func setReminder(sender: AnyObject) {\n\n appDelegate = UIApplication.sharedApplication().delegate\n as? AppDelegate\n\n if appDelegate!.eventStore == nil {\n appDelegate!.eventStore = EKEventStore()\n appDelegate!.eventStore!.requestAccessToEntityType(EKEntityTypeReminder, completion: {(granted, error) in //use of unresolved identifier EKEntityTypeReminder\n if !granted {\n println(\"Access to store not granted\")\n println(error.localizedDescription)\n } else {\n println(\"Access granted\")\n }\n })\n }\n\n if (appDelegate!.eventStore != nil) {\n self.createReminder()\n }\n}\n</code></pre>\n\n<p>This code works for Swift, but not Swift 2. Did anybody have this type of issue? </p>\n", "Lable": "No"}
{"QuestionId": 33172682, "AnswerCount": 5, "Tags": "<sql><grouping>", "CreationDate": "2015-10-16T14:15:43.130", "AcceptedAnswerId": "33172846", "Title": "SQL: How to group data into bands", "Body": "<p>I've created a query that shows the number of times an individual client appears in a list of transactions....</p>\n\n<pre><code>select Client_Ref, count(*)\nfrom Transactions\nwhere Start_Date &gt;= '2015-01-01'\ngroup by Client_Ref\norder by Client_Ref\n</code></pre>\n\n<p>...this returns data like this...</p>\n\n<pre><code>Client1 1\nClient2 4\nClient3 1\nClient4 3\n</code></pre>\n\n<p>..What I need to do is summarize this into bands of frequency so that I get something like this...</p>\n\n<pre><code>No. of Clients with 1 transaction 53\nNo. of Clients with 2 transaction 157\nNo. of Clients with 3 transaction 25\nNo. of Clients with &gt;3 transactions 259\n</code></pre>\n\n<p>I can't think how to so this in SQL, I could probably figure it out in Excel but I'd rather it was done at server level.</p>\n", "Lable": "No"}
{"QuestionId": 33175873, "AnswerCount": 2, "Tags": "<arrays><powershell><powershell-2.0><powershell-3.0>", "CreationDate": "2015-10-16T17:05:08.157", "AcceptedAnswerId": null, "Title": "Assign all child paths in the parent directory to an array", "Body": "<p>I am trying to assign all child paths of files in a directory to an array but not assigning the directories.</p>\n\n<p>I am using the following command:</p>\n\n<pre><code> $a = Get-ChildItem -path \"C:\\test\\\" -recurse | ?{!$_.PSIsContainer } | % { Write-Host $_.FullName }\n</code></pre>\n\n<p>The output is printed to the console and not saved in the variable.\nAny idea way? </p>\n", "Lable": "No"}
{"QuestionId": 33208282, "AnswerCount": 2, "Tags": "<computer-vision><neural-network><caffe>", "CreationDate": "2015-10-19T06:51:52.443", "AcceptedAnswerId": "33216247", "Title": "Extracting Features from VGG", "Body": "<p>I want to extract features from images in MS COCO dataset using a fine-tuned VGG-19 network.</p>\n\n<p>However, it takes about 6~7 seconds per image, roughly 2 hours per 1k images. (even longer for other fine-tuned models)</p>\n\n<p>There are 120k images in MS COCO dataset, so it'll take at least 10 days.</p>\n\n<p>Is there any way that I can speed up the feature extraction process?</p>\n", "Lable": "D"}
{"QuestionId": 33218841, "AnswerCount": 0, "Tags": "<python><google-app-engine>", "CreationDate": "2015-10-19T15:54:24.280", "AcceptedAnswerId": null, "Title": "GAE python google sign in screen beautification", "Body": "<p>I am using the classic way to get user's email </p>\n\n<pre><code>class HomePage(BaseHandler):\n def get(self):\n user = users.get_current_user()\n</code></pre>\n\n<p>My needs are no more than this, except, the google sign in page is rather \"ugly\". Is there a way to \"beautify\", for e.g., similar to as in what I have read, OAuth2.0 Google Consent Screen. (Without using it of course)?</p>\n\n<p>For some reasons, I couldn't get Google Consent Screen working (I created client id/secret in developer console, along with consent screen. But I don't know what more need to be done for following code to work:- NotAllowedError)</p>\n\n<pre><code>from google.appengine.api import oauth\nclass HomePage(BaseHandler):\n def get(self):\n user = oauth.get_current_user(\"https://www.googleapis.com/auth/userinfo.email\")\n</code></pre>\n", "Lable": "No"}
{"QuestionId": 33227747, "AnswerCount": 1, "Tags": "<python-2.7><neural-network><artificial-intelligence><theano><lstm>", "CreationDate": "2015-10-20T03:59:35.713", "AcceptedAnswerId": "33228279", "Title": "cPickle.load() doesnt accept non-.gz files, what can I use for .pkl files?", "Body": "<p>I am trying to run an example of a LSTM recurrent neural network that is presented in this git: <a href=\"https://github.com/mesnilgr/is13\" rel=\"nofollow\">https://github.com/mesnilgr/is13</a>. </p>\n\n<p>I've installed theano and everything and when I got to the point of running the code, I've noticed the data was not being downloaded, so I've opened an issue on the github (<a href=\"https://github.com/mesnilgr/is13/issues/12\" rel=\"nofollow\">https://github.com/mesnilgr/is13/issues/12</a>) and this guy came up with a solution that consisted in:</p>\n\n<p>1-get the data from the dropbox link he provides.\n2- change the code of the 'load.py' file to download, and read the data properly.</p>\n\n<p>The only issue is that the data in the dropbox folder(<a href=\"https://www.dropbox.com/s/3lxl9jsbw0j7h8a/atis.pkl?dl=0\" rel=\"nofollow\">https://www.dropbox.com/s/3lxl9jsbw0j7h8a/atis.pkl?dl=0</a>) is not a compacted .gz file as, I suppose, was the data from the original repository. So I dont have enough skill to change the code in order to do with the uncompressed data exaclty what it would do with the compressed one. Can someone help me? </p>\n\n<p>The modification suggested and the changes I've done are described on the issue I've opened on the git(<a href=\"https://github.com/mesnilgr/is13/issues/12\" rel=\"nofollow\">https://github.com/mesnilgr/is13/issues/12</a>).</p>\n", "Lable": "D"}
{"QuestionId": 33247381, "AnswerCount": 1, "Tags": "<python><flask><werkzeug>", "CreationDate": "2015-10-20T21:46:55.953", "AcceptedAnswerId": null, "Title": "Parse raw HTTP request with Werkzeug", "Body": "<p>I'm writing a fuzzer for a Flask application. I have example requests stored as text files, like this get.txt:</p>\n\n<pre><code>GET /docs/index.html HTTP/1.1\nHost: www.w3.org\n</code></pre>\n\n<p>Ideally, I'd parse this to a <code>werkzeug.wrappers.Request</code> object, something like this (psuedo-code):</p>\n\n<pre><code>from werkzeug.wrappers import Request\n\nreq = Request()\n\nwith open('get.txt') as f:\n req.parse_raw(f.read())\n</code></pre>\n\n<p>However, it looks like the raw HTTP parsing isn't happening in Werkzeug. Instead, Werkzeug takes a WSGI environ from <a href=\"https://docs.python.org/2/library/basehttpserver.html#BaseHTTPServer.BaseHTTPRequestHandler\" rel=\"nofollow\">BaseHTTPServer.BaseHTTPRequestHandler</a>, and that requires a <a href=\"https://docs.python.org/2/library/basehttpserver.html#BaseHTTPServer.HTTPServer\" rel=\"nofollow\">BaseHTTPServer.HTTPServer</a> instance to parse the request. That seems like overkill for something this simple.</p>\n\n<p>I also came across <a href=\"https://github.com/benoitc/http-parser\" rel=\"nofollow\">http-parser</a>, which is closer to what I want, but it duplicates most of Werkzeug's data structures with incompatible types. I'd have to transform the data from one to another.</p>\n\n<p>Is there a simpler way to go from raw HTTP request to WSGI environ in Werkzeug (or using BaseHTTPRequestHandler without an HTTP server)?</p>\n", "Lable": "No"}
{"QuestionId": 33271706, "AnswerCount": 1, "Tags": "<r><loops><for-loop>", "CreationDate": "2015-10-22T00:51:59.490", "AcceptedAnswerId": null, "Title": "Understanding different kind of loops in R (for, repeated, while)", "Body": "<p>I would like to understand loops in R by finding the average of a vector x &lt;- 1:10</p>\n\n<p>There are 3 different kinds of loops and I have the code to solve this problem, but I need a breakdown of each one to understand what each line does.</p>\n\n<p>The first one is a for loop.</p>\n\n<pre><code>x &lt;- 1:10\ntotal &lt;- length(x)\nx_sum &lt;- 0\nfor (i in seq_along(x)) {\n x_sum &lt;- x_sum + x[i]\n}\nx_sum / total\n## [1] 5.5\n</code></pre>\n\n<p>I don't understand why <code>x_sum &lt;- 0</code> in the initial part, and why <code>x_sum &lt;- x_sum + x[i]</code>. Is i the seq of 1,2,...,10? </p>\n\n<p>The second one is a repeat loop.</p>\n\n<pre><code>x &lt;- 1:10\ntotal &lt;- length(x)\nx_sum &lt;- 0\ni &lt;- 1\nrepeat {\n x_sum &lt;- x_sum + x[i]\n if (i == total) break\n i &lt;- i + 1\n}\nx_sum / total\n## [1] 5.5\n</code></pre>\n\n<p>I don't really understand this one either and a thorough explanation line by line would be great. The variable i is really throwing me off.</p>\n", "Lable": "No"}
{"QuestionId": 33383326, "AnswerCount": 0, "Tags": "<cordova><phonegap-build>", "CreationDate": "2015-10-28T05:10:36.583", "AcceptedAnswerId": null, "Title": "Phonegap Build Error failed", "Body": "<p>Oh geez. Your build failed. Sorry, but a problem occurred on the build server. Having this issue from last 2 days. is any way to build app i am using phongap cli 5.2.0. my ios &amp; android app is not gone be build whats problem must going on. i didn't understand. if any one have other way to Build app please provide me. \nby uploading zip and its provide us build like that.my config file is below mention.</p>\n\n<pre><code>&lt;widget xmlns=\"http://www.w3.org/ns/widgets\" xmlns:gap=\"http://phonegap.com/ns/1.0\" id=\"com.abc.mobileapp\" version=\"1.0.0\" versionCode = \"10\"&gt;\n &lt;name&gt;abc&lt;/name&gt;\n &lt;description&gt;&lt;/description&gt;\n &lt;author email=\"admin@abc.com\"&gt;abc&lt;/author&gt;\n &lt;content src=\"abc.html\"/&gt;\n &lt;preference name='phonegap-version' value=\"cli-5.2.0\"/&gt;\n &lt;preference name=\"permissions\" value=\"none\"/&gt;\n &lt;preference name=\"orientation\" value=\"default\"/&gt;\n &lt;preference name=\"target-device\" value=\"universal\"/&gt;\n &lt;preference name=\"fullscreen\" value=\"false\"/&gt;\n &lt;preference name=\"webviewbounce\" value=\"true\"/&gt;\n &lt;preference name=\"prerendered-icon\" value=\"true\"/&gt;\n &lt;preference name=\"stay-in-webview\" value=\"false\"/&gt;\n &lt;preference name=\"ios-statusbarstyle\" value=\"black-opaque\"/&gt;\n &lt;preference name=\"detect-data-types\" value=\"true\"/&gt;\n &lt;preference name=\"exit-on-suspend\" value=\"false\"/&gt;\n &lt;preference name=\"show-splash-screen-spinner\" value=\"true\"/&gt;\n &lt;preference name=\"auto-hide-splash-screen\" value=\"true\"/&gt;\n &lt;preference name=\"disable-cursor\" value=\"false\"/&gt;\n &lt;preference name=\"android-minSdkVersion\" value=\"14\"/&gt;\n &lt;preference name=\"android-installLocation\" value=\"auto\"/&gt;\n &lt;!--&lt;preference name=\"SplashScreen\" value=\"screen\" /&gt;--&gt;\n &lt;preference name=\"SplashScreenDelay\" value=\"5000\" /&gt;\n &lt;!--&lt;preference name=\"splash-screen-duration\" value=\"6000\" /&gt;--&gt;\n\n &lt;!--&lt;gap:plugin name=\"org.apache.cordova.battery-status\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.camera\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.media-capture\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.console\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.contacts\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.device\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.device-motion\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.device-orientation\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.dialogs\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.file\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.file-transfer\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.geolocation\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.globalization\"/&gt;--&gt;\n &lt;gap:plugin name=\"org.apache.cordova.device\" source=\"npm\"/&gt;\n &lt;gap:plugin name=\"cordova-plugin-inappbrowser\" source=\"npm\" /&gt;\n &lt;gap:plugin name=\"nl.x-services.plugins.socialsharing\" source=\"plugins.cordova.io\" /&gt;\n\n &lt;gap:plugin name=\"org.apache.cordova.network-information\" version=\"0.2.12\" source=\"npm\"/&gt;\n &lt;gap:plugin name=\"org.apache.cordova.splashscreen\" version=\"0.3.4\" source=\"npm\" /&gt;\n &lt;gap:plugin name=\"org.apache.cordova.vibration\" version=\"0.3.11\" source=\"npm\"/&gt;\n &lt;gap:plugin name=\"cordova-plugin-facebookconnect-orlando\" source=\"npm\" version=\"0.11.0\"&gt;\n &lt;param name=\"APP_ID\" value=\"0000000000000000\" /&gt;\n &lt;param name=\"APP_NAME\" value=\"abc\" /&gt;\n &lt;/gap:plugin&gt;\n\n &lt;!-- Third party plugins --&gt;\n &lt;!-- A list of available plugins are available at https://build.phonegap.com/plugins --&gt;\n &lt;!--&lt;gap:plugin name=\"com.phonegap.plugins.barcodescanner\" /&gt;--&gt;\n\n &lt;!--https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin/blob/2fdfde7/README.md\n &lt;gap:plugin name=\"nl.x-services.plugins.toast\" version=\"2.0.2\" /&gt;--&gt;\n\n &lt;icon src=\"icon.png\"/&gt;\n &lt;icon src=\"res/icon/android/icon-36-ldpi.png\" gap:platform=\"android\" gap:qualifier=\"ldpi\"/&gt;\n &lt;icon src=\"res/icon/android/icon-48-mdpi.png\" gap:platform=\"android\" gap:qualifier=\"mdpi\"/&gt;\n &lt;icon src=\"res/icon/android/icon-72-hdpi.png\" gap:platform=\"android\" gap:qualifier=\"hdpi\"/&gt;\n &lt;icon src=\"res/icon/android/icon-96-xhdpi.png\" gap:platform=\"android\" gap:qualifier=\"xhdpi\"/&gt;\n &lt;icon src=\"res/icon/blackberry/icon-80.png\" gap:platform=\"blackberry\"/&gt;\n &lt;icon src=\"res/icon/blackberry/icon-80.png\" gap:platform=\"blackberry\" gap:state=\"hover\"/&gt;\n &lt;icon src=\"res/icon/ios/icon-57.png\" gap:platform=\"ios\" width=\"57\" height=\"57\"/&gt;\n &lt;icon src=\"res/icon/ios/icon-72.png\" gap:platform=\"ios\" width=\"72\" height=\"72\"/&gt;\n &lt;icon src=\"res/icon/ios/icon-57-2x.png\" gap:platform=\"ios\" width=\"114\" height=\"114\"/&gt;\n &lt;icon src=\"res/icon/ios/icon-72-2x.png\" gap:platform=\"ios\" width=\"144\" height=\"144\"/&gt;\n &lt;icon src=\"res/icon/webos/icon-64.png\" gap:platform=\"webos\"/&gt;\n &lt;icon src=\"res/icon/windows-phone/icon-48.png\" gap:platform=\"winphone\"/&gt;\n &lt;icon src=\"res/icon/windows-phone/icon-173-tile.png\" gap:platform=\"winphone\" gap:role=\"background\"/&gt;\n\n &lt;gap:splash src=\"res/screen/default.png\" /&gt;\n &lt;gap:splash src=\"res/screen/android/screen-ldpi-portrait.png\" gap:platform=\"android\" gap:qualifier=\"port-ldpi\"/&gt;\n &lt;gap:splash src=\"res/screen/android/screen-mdpi-portrait.png\" gap:platform=\"android\" gap:qualifier=\"port-mdpi\"/&gt;\n &lt;gap:splash src=\"res/screen/android/screen-hdpi-portrait.png\" gap:platform=\"android\" gap:qualifier=\"port-hdpi\"/&gt;\n &lt;gap:splash src=\"res/screen/android/screen-xhdpi-portrait.png\" gap:platform=\"android\" gap:qualifier=\"port-xhdpi\"/&gt;\n &lt;gap:splash src=\"res/screen/blackberry/screen-225.png\" gap:platform=\"blackberry\"/&gt;\n &lt;gap:splash src=\"res/screen/ios/screen-iphone-portrait.png\" gap:platform=\"ios\" width=\"320\" height=\"480\"/&gt;\n &lt;gap:splash src=\"res/screen/ios/screen-iphone-portrait-2x.png\" gap:platform=\"ios\" width=\"640\" height=\"960\"/&gt;\n &lt;gap:splash src=\"res/screen/ios/screen-iphone-portrait-568h-2x.png\" gap:platform=\"ios\" width=\"640\" height=\"1136\"/&gt;\n &lt;gap:splash src=\"res/screen/ios/screen-ipad-portrait.png\" gap:platform=\"ios\" width=\"768\" height=\"1024\"/&gt;\n &lt;gap:splash src=\"res/screen/ios/screen-ipad-landscape.png\" gap:platform=\"ios\" width=\"1024\" height=\"768\"/&gt;\n &lt;gap:splash src=\"res/screen/windows-phone/screen-portrait.jpg\" gap:platform=\"winphone\"/&gt;\n &lt;access origin=\"*\"/&gt;\n &lt;!--&lt;access origin=\"*xitstage-001-site3.mysitepanel.net\"/&gt;--&gt;\n &lt;gap:plugin name=\"cordova-plugin-whitelist\" version=\"1\" source=\"npm\"/&gt;\n &lt;allow-intent href=\"http://*/*\"/&gt;\n &lt;allow-intent href=\"https://*/*\"/&gt;\n &lt;allow-intent href=\"tel:*\"/&gt;\n &lt;allow-intent href=\"sms:*\"/&gt;\n &lt;allow-intent href=\"mailto:*\"/&gt;\n &lt;allow-intent href=\"geo:*\"/&gt;\n &lt;platform name=\"android\"&gt;\n &lt;allow-intent href=\"market:*\"/&gt;\n &lt;/platform&gt;\n &lt;platform name=\"ios\"&gt;\n &lt;allow-intent href=\"itms:*\"/&gt;\n &lt;allow-intent href=\"itms-apps:*\"/&gt;\n &lt;/platform&gt;\n&lt;/widget&gt;\n</code></pre>\n", "Lable": "No"}
{"QuestionId": 33395858, "AnswerCount": 1, "Tags": "<c#><list>", "CreationDate": "2015-10-28T15:59:31.453", "AcceptedAnswerId": null, "Title": "Assign Item from One List to Another by ID", "Body": "<p>I need some help in being able to get a value from one list and assign it to another list. I have created a simplified version of what I am doing at the moment.</p>\n\n<p>Given the following:</p>\n\n<pre><code>namespace ConsoleApplication1\n{\n class Car\n {\n public Car(string maker)\n {\n this.maker = maker;\n this.counter = 0;\n }\n\n public string maker { get; set; }\n public int counter { get; set; }\n }\n\n class CarModel\n {\n public CarModel(string maker, string model)\n {\n this.maker = maker;\n this.model = model;\n }\n\n public string maker { get; set; }\n public string model { get; set; }\n }\n\n class Program\n {\n static void Main(string[] args)\n {\n List&lt;Car&gt; carList = new List&lt;Car&gt;();\n carList.Add(new Car(\"Honda\"));\n carList.Add(new Car(\"Toyota\"));\n carList.Add(new Car(\"Nissan\"));\n carList.Add(new Car(\"Ford\"));\n carList.Add(new Car(\"Dodge\"));\n\n List&lt;CarModel&gt; modelList = new List&lt;CarModel&gt;();\n modelList.Add(new CarModel(\"Honda\", \"Accord\"));\n modelList.Add(new CarModel(\"Honda\", \"Civic\"));\n modelList.Add(new CarModel(\"Honda\", \"Pilot\"));\n modelList.Add(new CarModel(\"Ford\", \"F150\"));\n modelList.Add(new CarModel(\"Ford\", \"F250\"));\n modelList.Add(new CarModel(\"Ford\", \"Edge\"));\n modelList.Add(new CarModel(\"Ford\", \"Fusion\"));\n modelList.Add(new CarModel(\"Nissan\", \"GT-R\"));\n modelList.Add(new CarModel(\"Nissan\", \"Versa\"));\n modelList.Add(new CarModel(\"Dodge\", \"Ram\"));\n\n var grouped = modelList.GroupBy(s =&gt; s.maker, (key, values) =&gt; new { Maker = key, Count = values.Count() });\n\n foreach (var i in grouped)\n {\n foreach (Car car in carList)\n {\n if (i.Maker == car.maker)\n {\n car.counter = i.Count;\n }\n }\n }\n\n foreach (Car car in carList)\n {\n Console.WriteLine(car.maker + \" | \" + car.counter.ToString());\n }\n }\n }\n}\n</code></pre>\n\n<p>I am obtaining the Count value from the grouped variable and assigning it to the Car object via the equality in the maker field.</p>\n\n<p>The ForEach loop I am using handles the assignment pretty well, but I know that when the number of items increases for each list, then the loop will take longer to execute.</p>\n\n<p>The result I am getting is as below (which is what I require)</p>\n\n<pre><code>Honda | 3\nToyota | 0\nNissan | 2\nFord | 4\nDodge | 1\n</code></pre>\n\n<p>I believe there would be a better way to do this. I looked at the Intersect method, but doing that would still require me to loop through the list to assign the values.</p>\n\n<p>I have tried doing an Outer join on the list, like:</p>\n\n<pre><code>var combined = from a in carList\n from b in grouped\n .Where(bOuter =&gt; bOuter.Maker == a.maker)\n .DefaultIfEmpty()\n select new\n {\n maker = a.maker,\n count = b.Count\n };\n\n foreach (var i in combined)\n {\n Console.WriteLine(i.maker + \" - \" + i.count);\n }\n</code></pre>\n\n<p>But I am getting a Null Exception error.</p>\n\n<p>Appreciate any inputs / suggestions.</p>\n", "Lable": "No"}
{"QuestionId": 33425115, "AnswerCount": 1, "Tags": "<c#><.net><wpf><prism>", "CreationDate": "2015-10-29T21:40:59.013", "AcceptedAnswerId": "33425244", "Title": "How to register regions inside user controls or control templates in RegionManager?", "Body": "<p>I am using <code>IRegionManager</code> to load and navigate to views, I have no problem loading content to my main region in my main view which is loaded with my bootstrapper class but I cant load content to regions inside my loaded views, the region manager does not seem to be registering these regions.</p>\n\n<p>my bootstrapper class:</p>\n\n<pre><code>protected override DependencyObject CreateShell()\n{\n return this.Container.Resolve&lt;MainWindowView&gt;();\n}\n\nprotected override void InitializeShell()\n{\n Application.Current.MainWindow.Show();\n}\n\nprotected override void ConfigureContainer()\n{\n base.ConfigureContainer();\n\n this.Container.RegisterTypeForNavigation&lt;DocumentView&gt;();\n this.Container.RegisterTypeForNavigation&lt;EmailView&gt;();\n this.Container.RegisterTypeForNavigation&lt;WorkTypeSelectionView&gt;();\n}\n</code></pre>\n\n<p>the <code>DocumentView</code> is user control with another region the method that runs when the command is triggered is this:</p>\n\n<pre><code>private void ViewEmailAction()\n{\n NavigationParameters parameters;\n parameters = new NavigationParameters();\n parameters.Add(nameof(this.CurrentEmail), this.CurrentEmail);\n this.regionManager.Regions[this.EmailRegion].RequestNavigate(nameof(EmailView), parameters);\n}\n</code></pre>\n\n<p>This throws and exception with the message <code>\"The region manager does not contain the EmailRegion region.\"</code></p>\n\n<p>Thanks in advance!</p>\n", "Lable": "No"}