xPXXX commited on
Commit
1634593
·
1 Parent(s): b34f274

Upload 10 files

Browse files
oraclechunk31.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 22029302, "AnswerCount": 3, "Tags": "<objective-c><sprite-kit><skspritenode>", "CreationDate": "2014-02-26T00:37:23.617", "AcceptedAnswerId": "22035567", "Title": "Make SKSpriteNode flash white with SKAction colorizeWithColor", "Body": "<p>Ok so I have a sprite thats suppose to flash white when hit by something, I'm using this </p>\n\n<pre><code>SKAction *changeColorAction = \n[SKAction colorizeWithColor:[SKColor whiteColor] colorBlendFactor:1.0 duration:1];\n</code></pre>\n\n<p>What happens is the sprite flashes, but instead of white, it just turns transparent.\nIf I use any other color like redColor, blueColor, ect.. It works perfect.</p>\n\n<p>How can I get it to actually turn white?</p>\n\n<p>Thanx for the help!!! :D </p>\n", "Lable": "No"}
2
+ {"QuestionId": 22036232, "AnswerCount": 1, "Tags": "<java><facebook><facebook-graph-api>", "CreationDate": "2014-02-26T08:55:17.937", "AcceptedAnswerId": null, "Title": "how to get user Access token in facebook using java", "Body": "<p>How to get user AccessToken of fb using <code>REST API</code> programatically in <code>java</code> using emailid and password for multiple user.I am making <code>javaFX</code> Desktop application to post a message in all the user wall. here any other api is available to get Access token at run time. I have also use Facebook4j api but not get any solution to getting User access Token not App Access Taken.</p>\n\n<p>Here I see the code that is using access Token</p>\n\n<pre><code>FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN);\n</code></pre>\n\n<p>But it's not showing how to get User Access Token using desktop Application.\nIt is possible or not?</p>\n", "Lable": "No"}
3
+ {"QuestionId": 22102016, "AnswerCount": 2, "Tags": "<mysql><charts><average><intervals>", "CreationDate": "2014-02-28T17:34:47.997", "AcceptedAnswerId": "22102406", "Title": "MySQL get average grouped by intervals", "Body": "<p>I have a xy chart of a power curve. Power on the <strong>y</strong> axis and wind on <strong>x</strong> axis.</p>\n\n<p>I get the values from a MySQL table. </p>\n\n<p>How can I get the average Power between intervals of 1 in thew wind column. </p>\n\n<p>Exemple:</p>\n\n<pre><code>Wind | Power\n10.2 1245\n10.2 1245\n9.7 1145\n8.7 1001\n11.1 1345\n9.3 1100\n10.6 1284\n8 987\n5.5 352\n...\n</code></pre>\n\n<p>What I need is:</p>\n\n<pre><code>Wind | Avg(Power)\n0-1 ...\n1-2 ... \n2-3 ...\n... \n</code></pre>\n\n<p>Thank you in advance</p>\n\n<p><strong>EDIT:</strong></p>\n\n<p>Thank you all for your answwers!</p>\n\n<p>For my particular case the wind is always between 0 and 25 m/s. \nThe intervals that I need to get the average power from are 0.5.</p>\n\n<p>So:</p>\n\n<pre><code>0 - 0,25\n0,25 - 0,75\n0,75 - 1,25\n1,25 - 1,75\n... - 25\n</code></pre>\n", "Lable": "No"}
4
+ {"QuestionId": 22122800, "AnswerCount": 1, "Tags": "<jquery><css><jquery-mobile>", "CreationDate": "2014-03-02T01:38:40.037", "AcceptedAnswerId": null, "Title": "How to set label colour in JQuery Mobile", "Body": "<p>I have to three labels in my page. I need to need to give a different text colour of different label, but when I override this class it makes all label red.</p>\n\n<pre><code>.ui-body-c label {\n color: red !important;\n}\n</code></pre>\n\n<p><a href=\"http://jsfiddle.net/GZaqz/5/\" rel=\"nofollow\">http://jsfiddle.net/GZaqz/5/</a></p>\n\n<pre><code>&lt;label class=\"labelClass\" id=\"openSubmenu\"&gt;Move to Second Page:&lt;/label&gt;\n\n&lt;label class=\"\" id=\"\"&gt; to Page:&lt;/label&gt;\n</code></pre>\n", "Lable": "No"}
5
+ {"QuestionId": 22182282, "AnswerCount": 1, "Tags": "<memory><cuda><constants><global>", "CreationDate": "2014-03-04T20:27:04.210", "AcceptedAnswerId": "22182697", "Title": "Cuda kernel with global memory vs Cuda kernel with constant memory", "Body": "<p>I have two kernels for doing a matrix multiplication, one uses global memory and the second one uses constant memory. I wanted to use the Cuda profiler to test the speed of both kernels.</p>\n\n<p>I tested both on a 1.3 device and on a 2.0 device. I was expecting the kernel with constant memory to be faster on the 1.3 device and the global memory kernel to be faster on the 2.0 device because of the use of cache for global memory on those devices but I found that in both devices the global memory kernel is faster. Is this due to memory coalescing on global memory? If so is there a way to make the constant kernel faster?</p>\n\n<p>I'm using matrixes of 80x80 and Block size of 16.</p>\n\n<p>Here is the global memory kernel</p>\n\n<pre><code>__global__ void MatMulGlobKernel(const Matriz A, const Matriz B, Matriz C) {\n\nfloat Cvalor = 0;\nint row = blockIdx.y * blockDim.y + threadIdx.y;\nint col = blockIdx.x * blockDim.x + threadIdx.x;\n\nif(fil &gt; A.height || col &gt; B.width) return;\n\nfor (int e = 0; e &lt; A.width; ++e)\nCvalor += A.valores[row * A.width + e] * B.valores[e * B.width + col];\n\nC.valores[row * C.width + col] = Cvalor;\n}\n</code></pre>\n\n<p>A.valores, B.valores and C.valores reside in global memory. </p>\n\n<p>Now here is the constant memory kernel.</p>\n\n<pre><code>__global__ void MatMulConstKernel(const Matriz A, const Matriz B, Matriz C) {\n\nfloat Cvalor = 0;\nint row = blockIdx.y * blockDim.y + threadIdx.y;\nint col = blockIdx.x * blockDim.x + threadIdx.x;\n\nif(fil &gt; A.height || col &gt; B.width) return;\n\nfor (int e = 0; e &lt; A.width; ++e)\nCvalor += A_const_valores[row * A.width + e] * B_const_valores[e * B.width + col];\n\nC.valores[row * C.width + col] = Cvalor;\n}\n</code></pre>\n\n<p>A_const_valores and B_const_valores reside in constant memory while C.valores resides in global memory. </p>\n\n<p>This is the profiler result for the 1.3 device (Tesla M1060)</p>\n\n<p>Const kernel 101.70us</p>\n\n<p>Global kernel 51.424us</p>\n\n<p>and for the 2.0 device (GTX 650)</p>\n\n<p>Const kernel 178.05us</p>\n\n<p>Global kernel 58.144us</p>\n", "Lable": "No"}
6
+ {"QuestionId": 22298389, "AnswerCount": 0, "Tags": "<java><php><android><encryption><cryptography>", "CreationDate": "2014-03-10T11:03:23.193", "AcceptedAnswerId": null, "Title": "AES-Rijndael 128 encryption in Java", "Body": "<p>I have a snippet in PHP that encrypts a plain String using AES 128 encryption.</p>\n\n<p>I have a problem to use this in Java as I do not have any experience on cryptography.</p>\n\n<p>Take a look at the PHP snippet here:</p>\n\n<pre><code>function encrypt_text($decrypted)\n{\n $thePassKey = \"MY_KEY_SOME_GIBBERISH_KEY\";\n\n # Add PKCS7 padding.\n $str = $decrypted;\n // Gets the block size of the specified cipher\n // MODE: CBC\n // CIPHER NAME: RIJNDAEL_128\n $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\n echo \"Encryption: \".MCRYPT_RIJNDAEL_128.\"&lt;br/&gt;\";\n echo \"Mcrypt Mode: \".MCRYPT_MODE_CBC.\"&lt;br/&gt;\";\n echo \"Block: \" . $block.\"&lt;br/&gt;\";\n\n if (($pad = $block - (strlen($str) % $block)) &lt; $block){\n $str .= str_repeat(chr($pad), $pad);\n }\n\n // Returns the size of the IV belonging to a specific cipher/mode combination\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\n $iv = '';\n for($i = 0; $i &lt; $iv_size; $i++){\n $iv .= \"\\0\";\n }\n\n // mcrypt_encrypt: Encrypts plaintext with given parameters\n // base6_encode: Encodes data with MIME base64\n return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $thePassKey, $str, MCRYPT_MODE_CBC, $iv));\n}\n</code></pre>\n\n<p>From the above snippet, I've managed to get the requirement it needs to encrypt a string which are:</p>\n\n<blockquote>\n <p>Encryption mode: rijndael-128</p>\n \n <p>Mcrypt mode: cbc</p>\n \n <p>Block: 16</p>\n</blockquote>\n\n<p>So, how do I do exactly this but with Java? I'm implementing it in an android app, if that helps.</p>\n", "Lable": "No"}
7
+ {"QuestionId": 22370311, "AnswerCount": 1, "Tags": "<jsf><spring-security><session-timeout><icefaces-3><icefaces-1.8>", "CreationDate": "2014-03-13T06:01:56.983", "AcceptedAnswerId": null, "Title": "on session time UI hangs in icefaces 3.3", "Body": "<p>I am facing a issue with <code>iceface 3.3</code> when <code>session timeout</code>: </p>\n\n<p>[1] session timeout<br>\n[2] user do a activity.<br>\n[3] error in firebug - empty respose from server<br>\n[4] UI hangs forever<br>\n[5] user hit F5<br>\n[6] redirect to login page<br>\n[7] user input credential<br>\n[8] redirect to a xml error page </p>\n\n<pre><code>&lt;partial-response&gt;\n &lt;error&gt;\n &lt;error-name&gt;\n class org.icefaces.application.SessionExpiredException\n &lt;/error-name&gt;\n &lt;error-message&gt;\n &lt;![CDATA[ Session has expired ]]&gt;\n &lt;/error-message&gt;\n &lt;/error&gt;\n &lt;changes&gt;\n &lt;extension aceCallbackParam=\"validationFailed\"&gt;{\"validationFailed\":false}&lt;/extension&gt;\n &lt;/changes&gt;\n &lt;/partial-response&gt;\n</code></pre>\n\n<p>[9] user hit refresh ..user redirect to a normal application </p>\n\n<p>This use to work fine in <code>1.8</code>... i am now trying it with <code>3.3</code> \nDuring debugging i figured out one major difference between 1.8 and 3.3 </p>\n\n<p>in <code>1.8</code> when session timeout and user do a activity the response to this request is of the form: </p>\n\n<pre><code>response.status = 200 \nresponse.reponseXML = &lt;sessionTimeOut&gt;&lt;sessionTimeOut/&gt; \n</code></pre>\n\n<p>where as in <code>3.3</code> when session timeout and user do a activity the response is: </p>\n\n<pre><code>reponse.status = 302 with response.header.location = login page \nsince status is 302 browser itself make a request for login page. \n</code></pre>\n\n<p>To <code>icefaces javascript code</code> the response that it got looks like </p>\n\n<pre><code> response.status=200 \n reponse.responseXML=null \nresponse.reponseHTML=&lt;HTML CODE OF LOGIN PAGE&gt; \n</code></pre>\n\n<p>and in <code>jsf.js</code> the response handler just logs a error if <code>reponseXML</code> is null. </p>\n\n<p>So thats why icefaces does not redirect or show popup. </p>\n\n<p>Now does anybody having a fix or a work around for this ?</p>\n\n<p>I am using <code>icefaces 3.3, glassfish 3.1, spring 3.0.1</code> </p>\n", "Lable": "No"}
8
+ {"QuestionId": 22417502, "AnswerCount": 1, "Tags": "<ruby-on-rails><ruby><activerecord><gem>", "CreationDate": "2014-03-14T23:20:51.887", "AcceptedAnswerId": null, "Title": "Rails Gem does not set the setter method", "Body": "<p>I tried to put up a Ruby Gem based on Railscast Episode 033 Making a Plugin. I got the gem created and uploaded to Rubygems.org as <code>stringify-time</code>, but the setter method is not working.</p>\n\n<p><a href=\"https://github.com/the4dpatrick/stringify-time-gem\" rel=\"nofollow\">The GitHub Repo</a></p>\n\n<p>The main part of the gem</p>\n\n<pre><code>module StringifyTime\n def stringify_time(*names)\n names.each do |name|\n define_method \"#{name}_string\" do\n read_attribute(name).to_s(:db) unless read_attribute(name).nil?\n end\n\n define_method \"#{name}_string=\" do |time_str|\n begin\n write_attribute(\"#{name}\", Time.zone.parse(time_str))\n rescue ArgumentError\n instance_variable_set(\"@#{name}_invalid\", true)\n end\n end\n\n define_method \"#{name}_invalid?\" do\n instance_variable_get(\"@#{name}_invalid\")\n end\n end\n end\nend\n\nActiveRecord::Base.send(:extend, StringifyTime)\n</code></pre>\n\n<p>A attribute symbol is passed in and getter and setter methods are created. The getter method works, but when I try to update the attribute through the form, the data is not saved.</p>\n\n<p>using the <code>stringify_time</code> method in the Task model</p>\n\n<pre><code>class Task &lt; ActiveRecord::Base \n validates_presence_of :name \n stringify_time :due_at \n\n # def due_at_string \n # due_at.to_s(:db) \n # end \n\n # def due_at_string=(due_at_str) \n # self.due_at = Time.parse(due_at_str) \n # rescue ArgumentError \n # @due_at_invalid = true \n # end \n\n def validate \n errors.add :due_at, 'is invalid' if due_at_invalid? # @due_at_invalid \n end \nend\n</code></pre>\n\n<p>When I uncomment the setter method I wrote manually, then I can edit the attribute.</p>\n", "Lable": "No"}
9
+ {"QuestionId": 22678863, "AnswerCount": 1, "Tags": "<php><wordpress>", "CreationDate": "2014-03-27T05:18:07.577", "AcceptedAnswerId": "22679032", "Title": "Count wordpress code error", "Body": "<p>Whats wrong with this code?</p>\n\n<p>The count is working ok, but i this code is something wrong, can someone help me?</p>\n\n<p>Thanks</p>\n\n<pre><code>&lt;div &lt;?php if (($count%3)==0) {post_class(\"$term_list one-third column ultimo\")}\nelse {post_class(\"$term_list one-third column\")} ?&gt; &gt;\n</code></pre>\n", "Lable": "No"}
10
+ {"QuestionId": 22732942, "AnswerCount": 0, "Tags": "<ios><xcode>", "CreationDate": "2014-03-29T15:22:12.513", "AcceptedAnswerId": null, "Title": "Xcode build error, sys/_types/_int8_h file not found", "Body": "<p>When I builded my ios project with xcode. I get the following error, how can I fix it:\n<img src=\"https://i.stack.imgur.com/GnGMZ.png\" alt=\"\"></p>\n", "Lable": "No"}
oraclechunk32.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 22829007, "AnswerCount": 1, "Tags": "<android><json><parsing><google-maps-markers>", "CreationDate": "2014-04-03T05:58:14.713", "AcceptedAnswerId": null, "Title": "How to add markers on map by parsed json array", "Body": "<p>I'm working on a project which calls to a remote server for data. Server gives latitude, longitude and some information. I can able to make call to server and get the response. But i'm not getting how to extract data from that response and plot markers on map.</p>\n\n<p>here is my code</p>\n\n<p>public class NearActivity extends Activity implements LocationListener {</p>\n\n<pre><code>GoogleMap gMap;\nprivate LocationManager locationManager;\nprivate String provider;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_near);\n gMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))\n .getMap();\n\n locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n provider = locationManager.getBestProvider(criteria, false);\n Location location = locationManager.getLastKnownLocation(provider);\n\n if (location != null) {\n\n new HttpGetTask().execute();\n\n gMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(\n location.getLatitude(), location.getLongitude()), 14));\n\n gMap.addMarker(new MarkerOptions()\n .position(\n new LatLng(location.getLatitude(), location\n .getLongitude())).title(\"I'm here\"));\n }\n\n}\n\n@Override\nprotected void onPause() {\n // TODO Auto-generated method stub\n super.onPause();\n locationManager.removeUpdates(this);\n}\n\n@Override\nprotected void onResume() {\n // TODO Auto-generated method stub\n super.onResume();\n locationManager.requestLocationUpdates(provider, 400, 1, this);\n}\n\n@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n // Inflate the menu; this adds items to the action bar if it is present.\n getMenuInflater().inflate(R.menu.near, menu);\n return true;\n}\n\n@Override\npublic void onLocationChanged(Location location) {\n // TODO Auto-generated method stub\n\n}\n\n@Override\npublic void onProviderDisabled(String provider) {\n // TODO Auto-generated method stub\n Toast.makeText(this, \"Disabled provider \" + provider,\n Toast.LENGTH_SHORT).show();\n\n}\n\n@Override\npublic void onProviderEnabled(String provider) {\n // TODO Auto-generated method stub\n Toast.makeText(this, \"Enabled new provider \" + provider,\n Toast.LENGTH_SHORT).show();\n\n}\n\n@Override\npublic void onStatusChanged(String provider, int status, Bundle extras) {\n // TODO Auto-generated method stub\n\n}\n\nprivate class HttpGetTask extends AsyncTask&lt;Void, Void, String&gt; {\n\n Double lat = locationManager.getLastKnownLocation(provider)\n .getLatitude();\n Double lng = locationManager.getLastKnownLocation(provider)\n .getLongitude();\n\n String URL = \"http:/?xyz.around_me.json?app_id=test&amp;lat=\"\n + lat + \"&amp;lng=\" + lng;\n\n AndroidHttpClient mClient = AndroidHttpClient.newInstance(\"\");\n\n @Override\n protected String doInBackground(Void... params) {\n\n HttpGet request = new HttpGet(URL);\n ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();\n\n try {\n\n return mClient.execute(request, responseHandler);\n\n } catch (ClientProtocolException exception) {\n exception.printStackTrace();\n } catch (IOException exception) {\n exception.printStackTrace();\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(String result) {\n\n if (null != mClient)\n mClient.close();\n Log.v(\"Response\", result);\n // Toast.makeText(getBaseContext(), result,\n // Toast.LENGTH_SHORT).show();\n\n try {\n\n\n JSONArray json = new JSONArray(result);\n\n for (int i = 0; i &lt; json.length(); i++) {\n JSONObject e = json.getJSONObject(i);\n String point = e.getString(\"point\");\n Log.v(\"POINT\", point);\n\n String[] point2 = point.split(\",\");\n double lat1 = Double.parseDouble(point2[0]);\n double lng1 = Double.parseDouble(point2[1]);\n\n Log.v(\"LLDN\", \"\"+lat1+\"&amp;\"+lng1);\n\n gMap.addMarker(new MarkerOptions().title(e\n .getString(\"name\")).position(new LatLng(lat1, lng1)));\n }\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n }\n}\n</code></pre>\n\n<p>}</p>\n\n<p>here is my json response</p>\n\n<pre><code>[\n{\npoint: \"77.606706,12.967060\",\ndistance: \"1.41\",\nid: 5686,\nph: \"1234\",\nname: \"zxcvb\",\nLS: \" asdfrewrtet\"\n},\n{\npoint: \"77.606706,12.967060\",\ndistance: \"1.41\",\nid: 5686,\nph: \"1234\",\nname: \"zxcvb\",\nLS: \" asdfrewrtet\"\n},\n{\npoint: \"77.606706,12.967060\",\ndistance: \"1.41\",\nid: 5686,\nph: \"1234\",\nname: \"zxcvb\",\nLS: \" asdfrewrtet\"\n},\n]\n</code></pre>\n\n<p>Anybody help me to extract data from this response.?\nIf i extract data i can place marker.</p>\n", "Lable": "No"}
2
+ {"QuestionId": 22928273, "AnswerCount": 1, "Tags": "<javascript><jquery><html><jquery-ui-dialog>", "CreationDate": "2014-04-08T05:30:15.407", "AcceptedAnswerId": "23105376", "Title": "Adding you tube player (iFrame) in jQuery modal dialog", "Body": "<p>I have some images in my <code>HTML</code> and _I need to play embedded you tube video videos on click of each image which should load/play in a <a href=\"http://jqueryui.com/dialog/#default\" rel=\"nofollow noreferrer\">jQuery UI dialog</a>. Basically like a <strong>pop up video player.</strong></p>\n\n<p>So here is what i have done to play/attach video with each image. I have three images and i have added the unique video id in my custom <code>data-attribute</code> which i taken from you tube.</p>\n\n<h3>HTML</h3>\n\n<pre><code>&lt;div id=\"ImageBox\"&gt;\n &lt;img src=\"img1.png\" class=\"playVideo\" alt=\"\" id=\"image1\" data-videoId=\"v6jg8g\"/&gt;\n &lt;img src=\"img2.png\" class=\"playVideo\" alt=\"\" id=\"image2\" data-videoId=\"re84hj\"/&gt;\n &lt;img src=\"img3.png\" class=\"playVideo\" alt=\"\" id=\"image3\" data-videoId=\"dhj3fk\"/&gt;\n&lt;/div&gt;\n\n&lt;!-- HTML for jQuery modal dialog --&gt;\n&lt;div id=\"MyVideoPlayer\"&gt;\n &lt;div&gt;\n &lt;strong id=\"videoTitle\"&gt;title for video&lt;/strong&gt;\n &lt;img src=\"closeButton.png\" id=\"Close\" alt=\"Close\" /&gt;\n &lt;/div&gt;\n &lt;iframe src=\"https://www.youtube.com/embed/MyVideoId?wmode=opaque&amp;autoplay=1&amp;autohide=1&amp;showinfo=0&amp;controls=2&amp;rel=0&amp;enablejsapi=1\" id=\"Player\" width=\"100%\" height=\"100%\"&gt;&lt;/iframe&gt;\n&lt;/div&gt;\n</code></pre>\n\n<blockquote>\n <p>Note: I am using <code>iframe embed</code> method from <a href=\"https://developers.google.com/youtube/player_parameters#Manual_IFrame_Embeds\" rel=\"nofollow noreferrer\"><strong>you tube player\n API</strong></a>\n to embed videos.</p>\n</blockquote>\n\n<p>For JavaScript/jQuery section, I came up with two choices here.</p>\n\n<p><strong>1. Because i am working in a ASP.NET MVC 3 app, i can set the unique video id to <code>@ViewBag</code> in script and assign to <code>iFrame</code> like this...</strong></p>\n\n<pre><code>$('#ImagesBlock .playVideo').click(function(){\n var myId = $(this).attr('data-videoId');\n '@ViewBag.VideoId' = myId;\n $('#MyVideoPlayer').dialog(\n { width: 'auto' },\n { height: 'auto' },\n { draggable: false },\n { resizable: false },\n { closeOnEscape: false },\n { modal: true },\n { show: { effect: \"fade\", duration: 200} }\n }); \n});\n</code></pre>\n\n<p><strong>2. Assign the updated <code>iFrame</code> src with new video id each time dialog\n opens.</strong></p>\n\n<pre><code>$('#imagesBlock .playVideo').click(function(){\n var myId = $(this).attr('data-videoId');\n\n var src = 'https://www.youtube.com/embed/'+ myId +'?wmode=opaque&amp;autoplay=1&amp;autohide=1\n &amp;showinfo=0&amp;controls=2&amp;rel=0&amp;enablejsapi=1';\n\n $('#MyVideoPlayeriframe').attr('src', src); \n $('#MyVideoPlayer').dialog(\n { width: 'auto' },\n { height: 'auto' },\n { draggable: false },\n { resizable: false },\n { closeOnEscape: false },\n { modal: true },\n { show: { effect: \"fade\", duration: 200} }\n }); \n});\n</code></pre>\n\n<p>Which one should I go with. I found some references though,</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/17804992/embedded-jwplayer-into-jquery-dialog\">Embedded jwplayer into jQuery Dialog</a></li>\n<li><a href=\"https://stackoverflow.com/questions/15887106/how-to-get-embedded-video-into-modal-dialog\">https://stackoverflow.com/questions/15887106/how-to-get-embedded-video-into-modal-dialog</a></li>\n<li><a href=\"http://plugins.jquery.com/jquery.mb.YTPlayer/\" rel=\"nofollow noreferrer\">jQuery mb.YTPlayer</a></li>\n</ul>\n\n<p>Is there any way i can make it little more simplified and re-usable in future. Please advise with your wise opinion.</p>\n", "Lable": "No"}
3
+ {"QuestionId": 22941798, "AnswerCount": 0, "Tags": "<php><mysql>", "CreationDate": "2014-04-08T15:42:05.710", "AcceptedAnswerId": null, "Title": "Delete dir and data from mysql", "Body": "<p>I use form which one upload file into folder and info(name, size) into database.So i want to make deleting form which one delete file and data from database. </p>\n\n<pre><code>&lt;?php\ninclude '../dbc.php'; \n$tbl_name=\"image\"; // Table name\n\n$sql=\"SELECT * FROM $tbl_name\";\n$result=mysql_query($sql);\n\n//detect file\n$directory = \"../../Upload/\"; \n$images = scandir($directory);\n$ignore = Array(\".\", \"..\");\n?&gt;\n\n &lt;table width=\"800px\" style=\"background:white;margin:50px auto; font-size:13px;\" border=\"1\" cellpadding=\"3\"&gt;\n &lt;tr&gt;\n &lt;td colspan=\"3\"&gt;&lt;strong&gt;Delete:&lt;/strong&gt; &lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;td width=\"40%\" align=\"center\"&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;\n &lt;td width=\"10%\" align=\"center\"&gt;&lt;strong&gt;Size&lt;/strong&gt;&lt;/td&gt;\n &lt;td width=\"5%\" align=\"center\"&gt;&lt;strong&gt;Delete&lt;/strong&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;?php\n while($rows=mysql_fetch_array($result)){\n ?&gt;\n &lt;tr id='del'&gt;\n &lt;td&gt;&lt;?php echo $rows['name']; ?&gt;&lt;/td&gt;\n &lt;td&gt;&lt;?php echo number_format($rows['imgSize'], 2) ?&gt; MB&lt;/td&gt;\n &lt;td&gt;&lt;a name=\"delete\" href=\"delData1.php?id=&lt;?php echo $rows['imgId']; \n ?&gt;\"&gt;Delete&lt;/a&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;?php\n }\n ?&gt;\n\n &lt;/table&gt;\n &lt;?php\n mysql_close();\n ?&gt;\n</code></pre>\n\n<p>delData1.php</p>\n\n<pre><code>&lt;?php\ninclude '../dbc.php';\n$tbl_name=\"image\"; // Table name\n// get value of id that sent from address bar\n$id=$_GET['id'];\n\n$filename = $_POST['filename'];\n$path = $_POST['directory'];\nif(file_exists($path.\"/\".$filename)) { \n unlink($path.\"/\".$filename); //delete file\n}\n\n// Delete data in mysql from row that has this id\n$sql=\"DELETE FROM $tbl_name WHERE imgId='$id'\";\n$result=mysql_query($sql);\n\n// if successfully deleted\nif($result){\n rmdir('$name');\necho \"Deleted\";\necho \"&lt;BR&gt;\";\nheader(\"Location:Data.php\");\n}\n\nelse {\necho \"ERROR\";\n}\n?&gt;\n</code></pre>\n\n<p>It's delete data from database, but file stay in folder.</p>\n", "Lable": "No"}
4
+ {"QuestionId": 22955744, "AnswerCount": 2, "Tags": "<c++><stl>", "CreationDate": "2014-04-09T07:33:06.100", "AcceptedAnswerId": "22955831", "Title": "Polymorphism between std::unordered_set and std::vector?", "Body": "<p>I have a function in my code which takes in a C++ container object, and reads each element in it using a loop. The function looks a bit like this:</p>\n\n<pre><code>void function(std::unordered_set&lt;unsigned int&gt; container)\n{\n for(auto it = container.begin(); it != container.end(); it++)\n {\n /* Do something */\n }\n}\n</code></pre>\n\n<p>However, I would like this function to also accept containers of type std::vector. As you can see from the code, the body of the function need not be aware of the type of the container (it can just access each element using *it). How can I achieve this without having redundancy in my code?</p>\n", "Lable": "No"}
5
+ {"QuestionId": 22991866, "AnswerCount": 1, "Tags": "<mysql>", "CreationDate": "2014-04-10T15:04:12.130", "AcceptedAnswerId": "23016362", "Title": "get list of active employees at a store", "Body": "<p>I have a table with data of employees and where they worked and how much they sold. These employees tend to move around from store location every couple of months. </p>\n\n<p>Sometimes when a employee moves some of his sales still get credited to the old sales location due to business reasons.</p>\n\n<p>Here is a snapshot of the data:</p>\n\n<pre><code>location_id | employee_id | name | unit_sold | month \n2 | abc | john |12 | 3\n1 | abc | john |1 | 3\n5 | rst | bob |11 | 2\n2 | qwe | tim |12 | 3\n1 | gsd | jim |1 | 3\n1 | uio | joe |11 | 3\n1 | abc | john |50 | 1\n</code></pre>\n\n<p>So notice that John has worked at 2 locations in month 3. On location=1 he sold 1 item and location=2 he sold 12. His actual place of employement is the location that has the higher unit_sold for the latest queried month. Also notice that John sold 50 units in month one at location =1 but that is not his work location in month=3.</p>\n\n<p>Here is what my query needs to do:</p>\n\n<p>Get a list of all current employees that work at location =? during time range x to y. </p>\n\n<p>Current means that they must still be active in the latest month. Also if an employee has worked at more that one location during the latest month of the time range then he should only be included if the location being queried was the place he sold the most units that month. </p>\n\n<p>Here is my try so far.</p>\n\n<pre><code>SELECT \n employee_id,\n NAME \nFROM\n mytable \nWHERE location_id = '1' \n AND month BETWEEN '1' \n AND '3' \n AND (employee_id, `month`, location_id) IN \n (SELECT \n employee_id,\n `month`,\n location_id \n FROM\n mytable \n WHERE month BETWEEN '1' \n AND '3') \nGROUP BY employee_id \n</code></pre>\n\n<p>It returns order employees as well in the response.</p>\n\n<p>Here is the <a href=\"http://sqlfiddle.com/#!2/e8dcd/2\" rel=\"nofollow\">SQLFiddle</a></p>\n", "Lable": "No"}
6
+ {"QuestionId": 23077278, "AnswerCount": 1, "Tags": "<html>", "CreationDate": "2014-04-15T07:33:32.690", "AcceptedAnswerId": "23077846", "Title": "I linked a text to a page but it did not work", "Body": "<p>I linked a text in view page to a function but it did not work I do not know what is the problem. It worked in one page but note in another page I mean it did not work for two Previous pages</p>\n\n<pre><code>&lt;a href=\"acontrol/show_sec\"&gt;back&lt;/a&gt;\n</code></pre>\n", "Lable": "No"}
7
+ {"QuestionId": 23162429, "AnswerCount": 1, "Tags": "<actionscript-3><flash><flashdevelop>", "CreationDate": "2014-04-18T21:13:02.017", "AcceptedAnswerId": "23165739", "Title": "Doing a Tutorial for a AS3 Flash game in FlashDevelop; how do i do the things that mention source.fla", "Body": "<p>Student doing AS3, I use FlashDevelop and I am wanting to follow and use this tutorial to help me create a tower defence game: <a href=\"http://www.flashgametuts.com/tutorials/as3/how-to-create-a-tower-defense-game-in-as3-part-1/\" rel=\"nofollow\">http://www.flashgametuts.com/tutorials/as3/how-to-create-a-tower-defense-game-in-as3-part-1/</a></p>\n\n<p>I have started a new project > ActionScript 3 > ActionScript 3 Project and all I have is the Main.as which contains: </p>\n\n<pre><code>package \n{\nimport flash.display.Sprite;\nimport flash.events.Event;\n\n/**\n * ...\n * @author Duncan John Bunting\n */\npublic class Main extends Sprite \n{\n\n public function Main():void \n {\n if (stage) init();\n else addEventListener(Event.ADDED_TO_STAGE, init);\n }\n\n private function init(e:Event = null):void \n {\n removeEventListener(Event.ADDED_TO_STAGE, init);\n // entry point\n }\n\n}\n}\n</code></pre>\n\n<p>It mentions saving files to the same place the source.fla file is (I do not have this) and just before the 3rd block of code, it says \"Now, we must return back to the main .fla file. Create a new layer to place actions in, and add the following code:\"</p>\n\n<p>How do I do this in FlashDevelop, since I do not have a source.fla? or is it not possible in FlashDevelop? </p>\n\n<p>If it is not possible, can someone please point me in the direction of a tutorial that creates a game in FlashDevelop using ActionScript3.</p>\n\n<p>Thanks.</p>\n", "Lable": "No"}
8
+ {"QuestionId": 23185904, "AnswerCount": 1, "Tags": "<python><django><import><path>", "CreationDate": "2014-04-20T18:07:04.320", "AcceptedAnswerId": "23186419", "Title": "Python 2.7 extremelly persisting error", "Body": "<p>I have this module</p>\n\n<pre><code>import os\nimport sys\n\nsys.path.append(\"C:\\pysec-master\")\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"pysec-master.settings\")\n\nfrom pysec.models import *\n\n\"\"\"get a file from the index. it may or may not be present on our hard disk. if it's not, it will be downloaded\nthe first time we try to access it, or you can call .download() explicitly\"\"\"\nfiling = Index.objects.filter(form='10-K',cik=1090872).order_by('-date')[0]\n\nprint filing.name\n\n\"\"\"initialize XBRL parser and populate an attribute called fields with a dict of 50 common terms\"\"\"\nx = latest.xbrl()\n\nprint x.fields['FiscalYear']\n\nprint x.fields\n\n\"\"\"fetch arbitrary XBRL tags representing eiter an Instant or a Duration in time\"\"\"\nprint 'Tax rate', x.GetFactValue('us-gaap:EffectiveIncomeTaxRateContinuingOperations','Duration')\n\nif x.loadYear(1): \n \"\"\"Most 10-Ks have two or three previous years contained in them for the major values. This call switches the contexts\n to the prior year (set it to 2 or 3 instead of 1 to go back further) and reloads the fundamental concepts.\n Any calls to GetFactValue will use that year's value from that point on.\"\"\"\n\n print x.fields['FiscalYear']\n\n print x.fields\n\n print 'Tax rate', x.GetFactValue('us-gaap:EffectiveIncomeTaxRateContinuingOperations','Duration')\n</code></pre>\n\n<p>I am trying to run it for a week now and whenever i hit <kbd>F5</kbd> to run it i get this error:</p>\n\n<pre><code>Traceback (most recent call last):\n File \"C:\\pysec-master\\pysec\\example.py\", line 8, in &lt;module&gt;\n from pysec.models import *\n File \"C:\\pysec-master\\pysec\\models.py\", line 4, in &lt;module&gt;\n from django.db import models\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\__init__.py\", line 5, in &lt;module&gt;\n from django.db.models.query import Q\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\query.py\", line 17, in &lt;module&gt;\n from django.db.models.deletion import Collector\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\deletion.py\", line 4, in &lt;module&gt;\n from django.db.models import signals, sql\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\sql\\__init__.py\", line 4, in &lt;module&gt;\n from django.db.models.sql.subqueries import *\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\sql\\subqueries.py\", line 12, in &lt;module&gt;\n from django.db.models.sql.query import Query\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\sql\\query.py\", line 22, in &lt;module&gt;\n from django.db.models.sql import aggregates as base_aggregates_module\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\sql\\aggregates.py\", line 9, in &lt;module&gt;\n ordinal_aggregate_field = IntegerField()\n File \"C:\\Python27\\lib\\site-packages\\django\\db\\models\\fields\\__init__.py\", line 116, in __init__\n self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE\n File \"C:\\Python27\\lib\\site-packages\\django\\conf\\__init__.py\", line 54, in __getattr__\n self._setup(name)\n File \"C:\\Python27\\lib\\site-packages\\django\\conf\\__init__.py\", line 49, in _setup\n self._wrapped = Settings(settings_module)\n File \"C:\\Python27\\lib\\site-packages\\django\\conf\\__init__.py\", line 132, in __init__\n % (self.SETTINGS_MODULE, e)\nImportError: Could not import settings 'pysec-master.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named pysec-master.settings\n</code></pre>\n\n<p>If you need any other module from the projects please tell me and i will edit my question and put it in. The original files from the project are <a href=\"https://github.com/lukerosiak/pysec\" rel=\"nofollow\">here</a>.</p>\n\n<p>The project is named <code>pysec-master</code> and it is on this directory: <code>C:\\pysec-master</code></p>\n\n<p>The project is structured like this</p>\n\n<pre><code>C:\\pysec-master(file)\n|__C:\\pysec-master\\local_settings.py\n|__C:\\pysec-master\\manage.py\n|__C:\\pysec-master\\settings.py\n|__C:\\Python27\\pysec(file)\n |__C:\\pysec-master\\pysec\\__init__.py\n |__C:\\pysec-master\\pysec\\example.py\n |__C:\\pysec-master\\pysec\\models.py\n |__C:\\pysec-master\\pysec\\xbrl.py\n |__C:\\pysec-master\\pysec\\xbrl_fundamentals.py\n</code></pre>\n\n<p>My environment variables are:</p>\n\n<p><code>Path</code> --> <code>C:\\Python27;C:\\Python27\\Scripts;C:\\pysec-master</code></p>\n\n<p><code>PYTHONPATH</code> --> <code>C:\\pysec-master;C:\\;</code></p>\n\n<p>When i type <code>sys.path</code> i get</p>\n\n<pre><code>['C:\\\\Python27\\\\Lib\\\\idlelib', 'C:\\\\pysec-master', 'C:\\\\pysec-master\\\\pysec', \n\n'C:\\\\Windows\\\\system32\\\\python27.zip', 'C:\\\\Python27\\\\DLLs', 'C:\\\\Python27\\\\lib', \n\n'C:\\\\Python27\\\\lib\\\\plat-win', 'C:\\\\Python27\\\\lib\\\\lib-tk', 'C:\\\\Python27', \n\n'C:\\\\Python27\\\\lib\\\\site-packages', 'C:\\\\pysec-master']\n</code></pre>\n\n<p>I have checked:</p>\n\n<ul>\n<li>The environmental variables to be in accord</li>\n<li>Set the <code>DJANGO_MODULE_SETTINGS</code></li>\n</ul>\n\n<p>So what is the problem and how can i fix it?</p>\n", "Lable": "No"}
9
+ {"QuestionId": 23249433, "AnswerCount": 1, "Tags": "<matlab>", "CreationDate": "2014-04-23T15:51:36.370", "AcceptedAnswerId": "23249509", "Title": "Matlab: about default value(s) returned by a matlab function with multiple return values?", "Body": "<p>To define a function with multiple return values it should be like </p>\n\n<pre><code>function [x, y] = name_function(a, b, c) \n</code></pre>\n\n<p>So when I call the function, normally I will use</p>\n\n<pre><code>[x, y] = name_function(a, b, c) \n</code></pre>\n\n<p>But what if I used</p>\n\n<pre><code>z = name_function(a, b, c) \n</code></pre>\n\n<p>What would z be?\nI tried and it is x got returned. So I think if I use the grammar like this, it will always get the first return value, am I right? Any reference?</p>\n\n<p>It seems not like that. Because</p>\n\n<pre><code>d = eig(A)\n[V,D] = eig(A)\n</code></pre>\n\n<p>How can I know how to make sure about this when I define a function in Matlab?</p>\n", "Lable": "No"}
10
+ {"QuestionId": 23271209, "AnswerCount": 1, "Tags": "<php><html><forms>", "CreationDate": "2014-04-24T14:03:02.013", "AcceptedAnswerId": null, "Title": "Fetching data off a page, from a form", "Body": "<p>I'm trying to add this (www.dha.gov.za/status/index.php) to my page. I want a form to post to the page and then print the result on my page, with out any redirecting.\nThe form is pretty simple:</p>\n\n<pre><code>&lt;form action=\"http://www.dha.gov.za/status/index.php\" method=\"POST\"&gt;\n&lt;label&gt;ENTER ID Number &lt;/label&gt;&lt;br /&gt;\n&lt;INPUT NAME=\"id\" TYPE=\"text\" MAXLENGTH=13 SIZE=13 style=\"font-size:32px;\" /&gt;\n&lt;INPUT TYPE=submit NAME=\"vstatus\" VALUE=\"ID Application\" &gt;\n&lt;INPUT TYPE=submit NAME=\"vstatus\" VALUE=\"Passport Application\" &gt;\n&lt;INPUT TYPE=submit NAME=\"vstatus\" VALUE=\"Marital\"&gt;\n&lt;INPUT TYPE=submit NAME=\"vstatus\" VALUE=\"Alive or Deceased\"&gt;\n&lt;INPUT TYPE=submit NAME=\"vstatus\" VALUE=\"ID Duplicate\"&gt;\n&lt;INPUT TYPE=submit NAME=\"vstatus\" VALUE=\"Permit Application\"&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>For example if I type in my ID number and click \"Marital\", I get redirected to a page which says \"MARRIAGE STATUS = SINGLE\", I want to stay on the same page as the form, and display this and all the other possible \"Submit\" buttons, Passport application, ID application etc.</p>\n\n<p>I CANNOT see the PHP portion of the file (www.dha.gov.za/status/index.php) or its contents, I can just see the output of POSTing to it. It is this output that I want to display.</p>\n", "Lable": "No"}
11
+ {"QuestionId": 23363399, "AnswerCount": 3, "Tags": "<c><performance><algorithm><math>", "CreationDate": "2014-04-29T11:28:46.300", "AcceptedAnswerId": "23364295", "Title": "Randomly sample an array with a fixed number of zeros", "Body": "<p>I have optimized code to randomly sample an array containing -1s, 0s and 1s with probabilities 1/4,1/2,1/4. It looks like</p>\n\n<pre><code>#define n (12)\nunsigned int x,y=34353,z=57768,w=1564; //PRNG seeds\n/* xorshift PRNG\n * Taken from https://en.wikipedia.org/wiki/Xorshift#Example_implementation\n * Used under CC-By-SA */\nu_int32_myRand() {\n unsigned int t;\n t = x ^ (x &lt;&lt; 11);\n x = y; y = z; z = w;\n return w = w ^ (w &gt;&gt; 19) ^ t ^ (t &gt;&gt; 8);\n}\n\nx=(int)time(NULL); //seed PRNG\nunsigned int k\nint F[n];\nfor(k=0; k&lt;n; k++) {\n F[k]=(1-(myRand()&amp;3))%2; \n }\n</code></pre>\n\n<p>How can I modify this so that it only returns arrays that have exactly n/3 zeros in them and still have it fast?</p>\n", "Lable": "No"}
12
+ {"QuestionId": 23377773, "AnswerCount": 1, "Tags": "<c#><visual-studio-2013><publish-profiles>", "CreationDate": "2014-04-30T00:43:46.620", "AcceptedAnswerId": null, "Title": "Visual Studio 2013 Publish Profiles saving inconsistently", "Body": "<p>When I modify an existing publish profile, Visual Studio 2013 Update 1 does not always save the corresponding pubxml file in the /Properties folder. I'm playing a constant game of modifying files until my changes are registered correctly in the file system.</p>\n\n<p>For example, one publish profile that I edited and \"saved\" using the prompt has its pubxml file marked as delete. I suspect the profiles are cached and Visual Studio 2013 is not reflecting what's in the file system in real time.</p>\n\n<p>The save prompt only shows up when I go to another profile or hit the publish button. It would be nice to have a save button that would force the pubxml files to show the latest.</p>\n\n<p>Does anyone have a clear workaround this? I had a similar experience with web.config transformation in the same project and ended up editing the project file.</p>\n\n<p>I'm certain this is not bound to the specific project I am currently dealing with as I see the same behavior in other projects. I never had this issue in Visual Studio 2010.</p>\n\n<p>You'll not see this issue if you have just created new profiles. I am only seeing this behavior when I modify the existing profiles.</p>\n", "Lable": "No"}
oraclechunk33.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 23605160, "AnswerCount": 1, "Tags": "<c#><.net><properties>", "CreationDate": "2014-05-12T09:14:29.240", "AcceptedAnswerId": "23605228", "Title": "Calling a property setter when changing a (nested) property inside the property object", "Body": "<p>insane title . . I know . . but bear with me . . </p>\n\n<p>consider the following case:</p>\n\n<pre><code>a.ClassProperty.ValueProperty = 4;\n</code></pre>\n\n<p>where:</p>\n\n<pre><code>class A\n{\n [...]\n public PropertyClass ClassProperty\n {\n get { return new PropertyClass(m_someInformation); }\n set { ComplexMultistepSetInformation(m_someInformation); }\n }\n [...]\n}\n</code></pre>\n\n<p>and:</p>\n\n<pre><code>class PropertyClass\n{\n [...]\n public int ValueProperty { get; set; }\n [...]\n}\n</code></pre>\n\n<p>My problem: when executing the first given statement the code will return a PropertyClass object and change the 'ValueProperty' in it, but the information itself for 'a' will remain the same.<br>\nWhat I would like to have is for the setter of 'ClassProperty' being called, after changing the information of the PropertyClass object retrieved via the 'ClassProperty' getter. Meaning, a way to make the first line accomplish the following:</p>\n\n<pre><code>PropertyClass tmp = a.ClassProperty;\ntmp.ValueProperty = 4;\na.ClassProperty = tmp;\n</code></pre>\n\n<p>Is there any way to change the getters and setters around to accomplish it. </p>\n\n<p>(Additional information: having a PropertyClass object in class A would not help. In the real use case PropertyClass is a wrapper around native code, simplifying access to variables and providing several extension methods, while information for a native object gets 'written' by the setter of property 'ClassProperty')</p>\n", "Lable": "No"}
2
+ {"QuestionId": 23667069, "AnswerCount": 1, "Tags": "<c#><asp.net><asp.net-mvc><asp.net-mvc-5>", "CreationDate": "2014-05-14T23:53:38.763", "AcceptedAnswerId": null, "Title": "Different viewmodel in partial view and rest of page?", "Body": "<p>I'm trying to figure out how i can use fully different data on my page compared to what i use in a partial view.</p>\n\n<p>I have a search bar at the top of my website, that top is a partial view that accepts a searchviewmodel and the bottom could be well, anything (search result, a blog, completely unrelated stuff).</p>\n\n<p>Obviously i don't want to \"mix\" viewmodels, each of them should be unaware of the other (i'm not going to create a class to host both the partial &amp; main viewmodel for each different page).</p>\n\n<p>What is an appropriate way to handle this scenario?</p>\n\n<p>Scenario is</p>\n\n<pre><code> User fills search on the top\n =&gt; if model is invalid, redisplay current page with errors (current page could for \n example be today's wether, requiring WeatherViewModel for main content and \n SearchViewModel for partial view)\n =&gt; else display result page (still need SearchViewModel for top banner \n and then SearchResultsViewModel for the page)\n</code></pre>\n\n<p>I'm not finding any help online so far from googling (all i found was scenarios where it made sense to create a class to host both sub classes as they were functionally related, which isn't the case here).</p>\n\n<p>My SearchViewModel looks like this:</p>\n\n<pre><code> public class SearchViewModel\n{\n [Required]\n public string StartCity { get; set; }\n [Required]\n public string EndCity { get; set; }\n [Required]\n public DateTime Date { get; set; }\n [Required]\n public SearchType Type { get; set; }\n [Required]\n public SearchTimeType TimeType { get; set; }\n}\n</code></pre>\n\n<p>It corresponds only to the top search and can be present on ANY page regardless of what viewmodel the REST OF THE PAGE uses.</p>\n", "Lable": "No"}
3
+ {"QuestionId": 23730779, "AnswerCount": 2, "Tags": "<c++><arrays><character><ascii><alphabet>", "CreationDate": "2014-05-19T06:12:47.290", "AcceptedAnswerId": "23731097", "Title": "Count Alphabet Characters from an array?", "Body": "<p>So, in this program we have to</p>\n\n<blockquote>\n <blockquote>\n <p>A. Count the number of each letter of the alphabet found in a character array and store these counts in an integer array</p>\n </blockquote>\n</blockquote>\n\n<p>I understand that part but then it says we have to use the ASCII values which confuses me.</p>\n\n<p>This is the file for reference:</p>\n\n<pre><code> \" A frog walks into a bank and asks the teller, Miss Pattywack\n for a loan. Miss Pattywack tells the frog,\n \"you must have collateral for the loan\".\n The frog pulls out of his pouch his porcelain people collection\n and offers them as collateral.\n Miss Pattywack looks at the figurines and tells the frog that\n the collection is not acceptable.\n The bank manager overhears the conversation and yells to the\n teller - \"It's a nick nack Pattywack, give the frog a loan!\"\n</code></pre>\n\n<blockquote>\n <blockquote>\n <p>Use a for loop to examine each character in the character array</p>\n \n <blockquote>\n <p>i. Use toupper to case the letter, so you are only dealing with capital letters</p>\n \n <p>ii. If the character is a letter of the alphabet, increment the integer array in the position of the ASCII value of the character minus 65</p>\n \n <blockquote>\n <p>1) 65 is the ASCII value of letter, 'A'</p>\n \n <blockquote>\n <p>(1) If the character is A, 65-65 = 0 the position you want to increment for the character A</p>\n \n <blockquote>\n <p>(2) If the character is C, 67-65 = 2 the position you want to increment for the character C</p>\n </blockquote>\n </blockquote>\n </blockquote>\n </blockquote>\n </blockquote>\n</blockquote>\n\n<p>I have this so far:</p>\n\n<pre><code>void CountAlphabetCharacters(char chArray[MAX_CHARACTERS], int lengthOfArray)\n{\n int index;\n\n for(index = 0; index &lt;= lengthOfArray; index++)\n {\n chArray[index] = toupper(chArray[index]);\n\n static_cast&lt;int&gt;(index);\n\n } \n}\n</code></pre>\n\n<p>That's all I have because that's all I understand. I mean, I understand how you get the ASCII value but I am so lost on how to actually make the for loop for this. Like I'm assuming you look at the characters from the file but I don't understand how you get that value you and keep going. I don't know if I make sense but I'm hoping I do and someone can help!! Thanks in advance.</p>\n", "Lable": "No"}
4
+ {"QuestionId": 23735600, "AnswerCount": 2, "Tags": "<sql><sql-server><sql-server-2008>", "CreationDate": "2014-05-19T10:38:29.057", "AcceptedAnswerId": "23739345", "Title": "Alternating rows with different values in SQL", "Body": "<p>Below is a table named <code>Profile</code></p>\n\n<pre><code>AutoId | GroupId | ProfileId | ProfileName\n------------------------------------------------- \n239 | 54 | abcd | name1\n251 | 44 | efgh | name2 \n255 | 54 | ijkl | name3\n256 | 54 | mnop | name4\n237 | 44 | qrst | name5\n</code></pre>\n\n<p>And below is a table named <code>Group</code></p>\n\n<pre><code>GroupId | IsLive \n--------------------\n44 | 1\n54 | 0 \n</code></pre>\n\n<p>I want to show on top those records whose <code>IsLive</code> is one and then the below records will be alternating between a record of <code>IsLive</code> 1 and 0. For eg.</p>\n\n<pre><code>AutoId | GroupId | ProfileId | ProfileName \n--------------------------------------------------\n237 | 44 | qrst | name5\n251 | 44 | efgh | name2 \n255 | 54 | ijkl | name3\n237 | 44 | qrst | name5\n239 | 54 | abcd | name1\n251 | 44 | efgh | name2 \n256 | 54 | mnop | name4\n237 | 44 | qrst | name5\n</code></pre>\n\n<p>The records of <code>IsLive</code> = 1 should get repeated if it is more than <code>IsLive</code> = 0. So far my query has been</p>\n\n<pre><code>select AutoId, GroupId, ProfileId, ProfileName\nfrom Profile\nwhere GroupId in (select GroupId from Group where isnull(IsLive,0) = 1)\nunion all\nselect AutoId, GroupId, ProfileId, ProfileName\nfrom Profile\nwhere GroupId in (select GroupId from Group where isnull(IsLive,0) &lt;&gt; 1)\n</code></pre>\n\n<p>The above query gives me <code>IsLive</code> = 1 on top but I am not able to get the alternating rows. Any help would be appreciated</p>\n", "Lable": "No"}
5
+ {"QuestionId": 23792004, "AnswerCount": 1, "Tags": "<treeview><javafx-2><javafx-8><treeviewitem><treecellrenderer>", "CreationDate": "2014-05-21T19:20:51.710", "AcceptedAnswerId": null, "Title": "TreeItem selection width in a TreeView", "Body": "<p>I'm using JavaFX 8 and I'm currently doing some GUI developments. I have a little problem with my TreeView and I need your help.</p>\n\n<p>Do you know if it is possible, in a TreeView, to select just the label and not the whole width of the TreeCell ?</p>\n\n<p>I mean (Netbeans example) :</p>\n\n<p><img src=\"https://i.stack.imgur.com/g9zzh.png\" alt=\"Good TreeView selection\"></p>\n\n<p>Instead of :</p>\n\n<p><img src=\"https://i.stack.imgur.com/EAo6C.png\" alt=\"Bad TreeView selection\"></p>\n\n<p>Thank you in advance.</p>\n", "Lable": "No"}
6
+ {"QuestionId": 24085621, "AnswerCount": 1, "Tags": "<python><django>", "CreationDate": "2014-06-06T15:33:31.723", "AcceptedAnswerId": null, "Title": "Celery / Django Single Tasks being run multiple times", "Body": "<p>I'm facing an issue where I'm placing a task into the queue and it is being run multiple times.\nFrom the celery logs I can see that the same worker is running the task ... </p>\n\n<pre><code>[2014-06-06 15:12:20,731: INFO/MainProcess] Received task: input.tasks.add_queue\n[2014-06-06 15:12:20,750: INFO/Worker-2] starting runner..\n[2014-06-06 15:12:20,759: INFO/Worker-2] collection started\n[2014-06-06 15:13:32,828: INFO/Worker-2] collection complete\n[2014-06-06 15:13:32,836: INFO/Worker-2] generation of steps complete\n[2014-06-06 15:13:32,836: INFO/Worker-2] update created\n[2014-06-06 15:13:33,655: INFO/Worker-2] email sent\n[2014-06-06 15:13:33,656: INFO/Worker-2] update created\n[2014-06-06 15:13:34,420: INFO/Worker-2] email sent\n[2014-06-06 15:13:34,421: INFO/Worker-2] FINISH - Success\n</code></pre>\n\n<p>However when I view the actual logs of the application it is showing 5-6 log lines for each step (??).</p>\n\n<p>Im using Django 1.6 with RabbitMQ. The method for placing into the queue is via placing a delay on a function.</p>\n\n<p>This function (task decorator is added( then calls a class which is run.</p>\n\n<p>Has anyone any idea on the best way to troubleshoot this ?</p>\n\n<p><strong><em>Edit</em></strong> : As requested heres the code,</p>\n\n<p><strong>views.py</strong></p>\n\n<p>In my view im sending my data to the queue via ...</p>\n\n<pre><code>from input.tasks import add_queue_project\n\nadd_queue_project.delay(data)\n</code></pre>\n\n<p><strong>tasks.py</strong></p>\n\n<pre><code>from celery.decorators import task\n\n@task()\ndef add_queue_project(data):\n \"\"\" run project \"\"\"\n logger = logging_setup(app=\"project\")\n\n logger.info(\"starting project runner..\")\n f = project_runner(data)\n f.main()\n\nclass project_runner():\n \"\"\" main project runner \"\"\"\n\n def __init__(self,data):\n self.data = data\n self.logger = logging_setup(app=\"project\")\n\n def self.main(self):\n .... Code\n</code></pre>\n\n<p><strong>settings.py</strong></p>\n\n<pre><code>THIRD_PARTY_APPS = (\n 'south', # Database migration helpers:\n 'crispy_forms', # Form layouts\n 'rest_framework',\n 'djcelery',\n)\n\nimport djcelery\ndjcelery.setup_loader()\n\nBROKER_HOST = \"127.0.0.1\"\nBROKER_PORT = 5672 # default RabbitMQ listening port\nBROKER_USER = \"test\"\nBROKER_PASSWORD = \"test\"\nBROKER_VHOST = \"test\"\nCELERY_BACKEND = \"amqp\" # telling Celery to report the results back to RabbitMQ\nCELERY_RESULT_DBURI = \"\"\n\nCELERY_IMPORTS = (\"input.tasks\", )\n</code></pre>\n\n<p><strong>celeryd</strong></p>\n\n<p>The line im running is to start celery,</p>\n\n<pre><code>python2.7 manage.py celeryd -l info\n</code></pre>\n\n<p>Thanks,</p>\n", "Lable": "No"}
7
+ {"QuestionId": 24098570, "AnswerCount": 1, "Tags": "<ios><uitextview><uislider>", "CreationDate": "2014-06-07T15:06:31.533", "AcceptedAnswerId": "24098630", "Title": "UITextview shows text Arabic but numbers English", "Body": "<p>I want to show some Arabic text and the number of <code>UISlider</code> Value in a <code>uitextview</code> for example:</p>\n\n<p>\u0645\u0642\u062f\u0627\u0631= \u06f4\u06f0</p>\n\n<p>I am using this code:</p>\n\n<pre><code> self.MyTextView.text= [NSString stringWithFormat:@\"%f\", self.mySlider.value];\n</code></pre>\n\n<p><code>UITextView</code> shows the Arabic text correct but the value is adding with English characters. How can I concatenate the slider value so that <code>uitextview</code> show them with Arabic characters too.</p>\n", "Lable": "No"}
8
+ {"QuestionId": 24165811, "AnswerCount": 4, "Tags": "<sql>", "CreationDate": "2014-06-11T14:39:54.403", "AcceptedAnswerId": "24166097", "Title": "SQL - Must there always be a primary key?", "Body": "<p>There are a couple of similar questions already out there and the consensus seemed to be that a primary key should always be created.</p>\n\n<p>But what if you have a single row table for storing settings (and let's not turn this into a discussion about why it might be good/bad to create a single row table please)?</p>\n\n<p>Surely having a primary key on a single row table becomes completely useless?</p>\n", "Lable": "No"}
9
+ {"QuestionId": 24254874, "AnswerCount": 2, "Tags": "<rust><rust-obsolete>", "CreationDate": "2014-06-17T02:29:25.630", "AcceptedAnswerId": "24262588", "Title": "Getting basic input for ints", "Body": "<p>I'm quite surprised I can't seem to navigate rust's documentation to find <em>any</em> case that describes io, could someone please explain to me how to use basic io to get user input into say, an integer? And maybe where to find the io details in that accursed documentation? Thanks</p>\n", "Lable": "No"}
oraclechunk34.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 24391412, "AnswerCount": 1, "Tags": "<android><android-activity>", "CreationDate": "2014-06-24T16:07:11.783", "AcceptedAnswerId": "24392104", "Title": "Move from an activity to another one in View Class in Android", "Body": "<p>I have an activity that has two classes like these:</p>\n\n<pre><code>public class StartActivity extends Activity {\n .\n .\n .\n}\n\npublic class StartView extends View {\n .\n .\n .\n}\n</code></pre>\n\n<p>I want to go from this Activity to another one with click on one image.Is there any method (such startActivity method in Activity Class) in View Class that I can use it in the Second Class?</p>\n", "Lable": "No"}
2
+ {"QuestionId": 24400162, "AnswerCount": 2, "Tags": "<java><formatting>", "CreationDate": "2014-06-25T04:23:20.090", "AcceptedAnswerId": null, "Title": "How can I format in java?", "Body": "<p>This is what I currently have so far</p>\n\n<pre><code>public String toString() {\n return this.make + \" \" + this.model + \" \" + this.year + \" $\"\n + this.price + \" \" + this.mpg;\n}\n</code></pre>\n\n<p>I need to format it to these specifications</p>\n\n<ol>\n<li>Make: left-justified and will be no more than 10 characters long</li>\n<li>Model: left-justified starting in column 11 and will be no more than 10 characters long</li>\n<li>Year: left-justified and starting in column 21</li>\n<li>Price: will be output according to the following money format $99,999.00</li>\n<li>MPG: will be output according to the following format: 99.0.</li>\n</ol>\n\n<p>Please help, I'm lost.\nThanks</p>\n", "Lable": "No"}
3
+ {"QuestionId": 24450793, "AnswerCount": 1, "Tags": "<android><android-layout>", "CreationDate": "2014-06-27T11:31:25.967", "AcceptedAnswerId": null, "Title": "How to create a custom check box by inflating a layout", "Body": "<p>I want to create a custom check box view, by inflating a layout, I want to manipulate the views in the layout based on the check box status (checked/unchecked), also I want to add custom xml attributes for that view.</p>\n", "Lable": "No"}
4
+ {"QuestionId": 24629730, "AnswerCount": 1, "Tags": "<php><caching><optimization><opcode>", "CreationDate": "2014-07-08T10:41:41.997", "AcceptedAnswerId": null, "Title": "No performance gain after enabling Opcode caching", "Body": "<p>I have a bunch of php services running behind the message queue and my symfony controller are accessing these services to get the data. I am doing some benchmark testing to evaluate the performance of Opcode caching. The problem is that the performance gain I am attaining after enabling any of the Opcode caching (zend opcache or apc) is negligible. I am using 'ab' utility for benchmark testing. </p>\n\n<p>So the total response time (without any opcode caching) is 66 seconds and the same for zend opcode cache is 54 seconds. The total response time in case of APC is 64 seconds. I am making 50000 request with no concurrent request for the benchmarking.</p>\n\n<p>Please any advice what could be preventing the Opcode caching to gain significant performance.</p>\n\n<p><strong>EDIT 1</strong>\nCall to the <code>apc_cache_info()</code> returns the following:</p>\n\n<pre><code>array (size=14)\n 'nslots' =&gt; int 4099\n 'ttl' =&gt; int 0\n 'nhits' =&gt; float 0\n 'nmisses' =&gt; float 0\n 'ninserts' =&gt; float 0\n 'nentries' =&gt; int 0\n 'nexpunges' =&gt; float 0\n 'stime' =&gt; int 1404812585\n 'mem_size' =&gt; float 0\n 'file_upload_progress' =&gt; int 1\n 'memory_type' =&gt; string 'mmap' (length=4)\n 'cache_list' =&gt; \n array (size=0)\n empty\n 'deleted_list' =&gt; \n array (size=0)\n empty\n 'slot_distribution' =&gt; \n array (size=0)\n empty\n</code></pre>\n", "Lable": "No"}
5
+ {"QuestionId": 24801344, "AnswerCount": 1, "Tags": "<asp.net><web-services><iis>", "CreationDate": "2014-07-17T10:40:09.313", "AcceptedAnswerId": "24801825", "Title": "Calling a WebService from an ASP.net application", "Body": "<p>I have a WEB application on multiple servers (Windows 2008). However on a windows 2012 server, I receive the following error</p>\n\n<pre><code> Compilation Error\n\nDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. \n\nCompiler Error Message: BC30002: Type 'myservice.units.AFMService' is not defined.\n\nSource Error:\n\n\n\nLine 8: Dim oService As New myservice.units.AFMService\n</code></pre>\n\n<p>The code is not precompiled, I simply copied the code from one server to another. All other pages/calls work correctly.</p>\n\n<p>The Web.config has the following line</p>\n\n<pre><code>&lt;add key=\"myservice.units.AFM\" value=\"http://xxxxxx/xxxx/x/xxx.asmx\"/\n</code></pre>\n\n<p>Any Ideas on what I could check?</p>\n", "Lable": "No"}
6
+ {"QuestionId": 24842313, "AnswerCount": 3, "Tags": "<bash><stdin><pipeline><rm>", "CreationDate": "2014-07-19T16:08:55.317", "AcceptedAnswerId": "24842347", "Title": "Why won't rm remove files passed in from find or sed?", "Body": "<p>I want to pipeline the below commands but the last cmd \"rm -rf\"is not working i.e. Nothing deleted :</p>\n\n<pre><code>find /home/mba/Desktop/ -type d -name \"logs\" | sed 's/$/\\/\\*/' | rm -rf\n</code></pre>\n\n<p>No error is returned.</p>\n", "Lable": "No"}
7
+ {"QuestionId": 24850489, "AnswerCount": 2, "Tags": "<java><nullpointerexception><jax-rs><jndi>", "CreationDate": "2014-07-20T12:26:58.407", "AcceptedAnswerId": "24918874", "Title": "Root resource from other .jar file cannot be looked up in JAX-RS application", "Body": "<p>I am trying to build an application ear file with the following structure:</p>\n\n<pre><code>app.ear\n--&gt; lib\n -- app-domain.jar\n -- app-api.jar\n -- app-common.jar\n ...\n--&gt; META-INF\n -- application.xml\n -- glassfish-application.xml\n -- MANIFEST.MF\n-- app-ejb.jar\n-- app-rs.war\n</code></pre>\n\n<p>The app-api.jar file contains my remote interfaces like</p>\n\n<pre><code>@Remote\npublic interface LanguageService {\n\n /**\n * @return all languages known to the system\n */\n List&lt;Language&gt; loadLanguages();\n</code></pre>\n\n<p>The implementation is contained in the app-ejb.jar file and looks like this:</p>\n\n<pre><code>@Stateless\n@Remote(LanguageService.class)\n@Path(\"/language\")\npublic class LanguageServiceImpl extends ValidatingService implements LanguageService {\n\n @PersistenceContext(unitName = \"kcalculator\")\n EntityManager em;\n\n @GET\n @Produces(\"application/json\")\n @Override\n public List&lt;Language&gt; loadLanguages() {\n CriteriaQuery&lt;Language&gt; query = createLoadLanguageQuery();\n return em.createQuery(query).getResultList(); \n }\n</code></pre>\n\n<p>And finally I want to provide this as an JAX-RS web service and thus have my implementation of the javax.rs.Application class in the app-rs.war file, which looks like this:</p>\n\n<pre><code>@ApplicationPath(\"/resources\")\npublic class MyApplication extends Application {\n\n @Override\n public Set&lt;Class&lt;?&gt;&gt; getClasses() {\n Set&lt;Class&lt;?&gt;&gt; s = new HashSet&lt;Class&lt;?&gt;&gt;();\n s.add(LanguageServiceImpl.class);\n return s;\n }\n</code></pre>\n\n<p>This deploys without any problem, the application class is also detected. However, when i finally access the web service an internal server error occurs due to a NPE. </p>\n\n<p>The LanguageServiceImpl cannot be looked up, the log contains the following entry:</p>\n\n<pre><code>Caused by: javax.naming.NameNotFoundException: No object bound to name java:module/LanguageServiceImpl!com.kcalculator.ejb.LanguageServiceImpl\n at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:741)\n at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:715)\n at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:167)\n at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:471)\n ... 63 more\n</code></pre>\n\n<p>Hence the file is considered a Pojo, and so the reference to the entity manager is not initialized, which finally results in the Nullpointer exception.</p>\n\n<p>I am kinda stuck, as annotating the bean class and giving it a mapped name is not working. Putting my application class into the ejb.jar file does not solve the problem either.</p>\n\n<p>Can anyone point out what i am missing here?</p>\n\n<p>Additional comment:\nWhat I found out in the meantime: If I add a stateless session bean to my app-rs.war file and register it in MyApplication, it works without any problem. There injecting the LanguageService works, too. So it seems the problem is related to the fact that the service implementing bean class is located in another artifact.</p>\n", "Lable": "No"}
8
+ {"QuestionId": 25009269, "AnswerCount": 1, "Tags": "<android><camera>", "CreationDate": "2014-07-29T06:19:52.503", "AcceptedAnswerId": "25011944", "Title": "Issue at taking images from camera and uploading to server", "Body": "<p>I have an application that is using camera, when I camera capture a photo, my application is crashing. Then I want upload the image...</p>\n\n<pre><code>if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) // TODO camera code\n {\n if (resultCode == RESULT_OK)\n {\n String imageId = convertImageUriToFile(imageUri,CameraActivity);\n new LoadImagesFromSDCard().execute(\"\"+imageId);\n }\n else if (resultCode == RESULT_CANCELED)\n {\n Toast.makeText(this, \"Picture was not taken\", Toast.LENGTH_SHORT).show();\n }\n else \n {\n Toast.makeText(this, \"Picture was not taken\", Toast.LENGTH_SHORT).show();\n }\n }\n\n\npublic class LoadImagesFromSDCard extends AsyncTask&lt;String, Void, Void&gt; {\n\n private ProgressDialog Dialog = new ProgressDialog(NewEntry.this);\n\n Bitmap mBitmap;\n\n protected void onPreExecute() {\n Dialog.setMessage(\"Loading image from Sdcard..\");\n Dialog.show();\n Toast.makeText(getApplicationContext(), \"Loading image from Sdcard\", Toast.LENGTH_SHORT).show();\n }\n\n protected Void doInBackground(String... urls) {\n\n Bitmap bitmap = null;\n Bitmap newBitmap = null;\n Uri uri = null; \n\n try {\n uri = Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, \"\" + urls[0]);\n bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(uri));\n Toast.makeText(getApplicationContext(), \"try block\", Toast.LENGTH_SHORT).show();\n if (bitmap != null) {\n newBitmap = Bitmap.createScaledBitmap(bitmap, 170, 170, true); \n bitmap.recycle();\n Toast.makeText(getApplicationContext(), \"bitmap not null\", Toast.LENGTH_SHORT).show();\n if (newBitmap != null)\n {\n mBitmap = newBitmap;\n Toast.makeText(getApplicationContext(), \"newBitmap not null\", Toast.LENGTH_SHORT).show();\n }\n }\n } catch (IOException e) {\n cancel(true);\n Toast.makeText(getApplicationContext(), \"catch block\", Toast.LENGTH_SHORT).show();\n }\n return null;\n }\n\n protected void onPostExecute(Void unused) \n {\n\n Dialog.dismiss();\n if(mBitmap != null)\n {\n }\n //showImg.setImageBitmap(mBitmap);\n Toast.makeText(getApplicationContext(), \"mBitmap not null\", Toast.LENGTH_SHORT).show();\n }\n }\n</code></pre>\n\n<p>Please help me and suggest me about this issue: when I camera capture a photo, my application is crashing. However afterwards I want to upload the image...\nlog cat</p>\n\n<pre><code>07-29 11:54:59.173: E/AndroidRuntime(4253): FATAL EXCEPTION: main\n07-29 11:54:59.173: E/AndroidRuntime(4253): Process: com.ebiz.eis.realtimedar, PID: 4253\n07-29 11:54:59.173: E/AndroidRuntime(4253): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=null} to activity {com.ebiz.eis.realtimedar/com.ebiz.eis.realtimedar.NewEntry}: java.lang.NullPointerException\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.deliverResults(ActivityThread.java:3432)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3475)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.access$1300(ActivityThread.java:139)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.os.Handler.dispatchMessage(Handler.java:102)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.os.Looper.loop(Looper.java:136)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.main(ActivityThread.java:5086)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at java.lang.reflect.Method.invokeNative(Native Method)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at java.lang.reflect.Method.invoke(Method.java:515)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at dalvik.system.NativeStart.main(Native Method)\n07-29 11:54:59.173: E/AndroidRuntime(4253): Caused by: java.lang.NullPointerException\n07-29 11:54:59.173: E/AndroidRuntime(4253): at com.ebiz.eis.realtimedar.NewEntry.onActivityResult(NewEntry.java:418)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.Activity.dispatchActivityResult(Activity.java:5446)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.deliverResults(ActivityThread.java:3428)\n07-29 11:54:59.173: E/AndroidRuntime(4253): ... 11 more\n</code></pre>\n", "Lable": "No"}
9
+ {"QuestionId": 25013263, "AnswerCount": 1, "Tags": "<wordpress><custom-post-type>", "CreationDate": "2014-07-29T10:34:45.253", "AcceptedAnswerId": "25013775", "Title": "Display the similar posts to a custom post", "Body": "<p>I have a custom post type 'events'. On 'single-events.php ' i want to display the similar posts related to this .\nI am using the following code but the problem is it is also displaying the current post. How do i get rid of current post, please help me out.</p>\n\n<pre><code> &lt;?php\n $args = array( 'post_type'=&gt;'events',\n 'tax_query' =&gt; array(\n\n array(\n 'taxonomy' =&gt; 'Event type',\n 'field' =&gt; 'slug',\n 'terms' =&gt; $type,\n )\n )\n );\n $postslist = get_posts( $args );\n\n\n ?&gt;\n</code></pre>\n", "Lable": "No"}
oraclechunk35.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 25185610, "AnswerCount": 2, "Tags": "<javascript><jquery><python><django><templates>", "CreationDate": "2014-08-07T14:51:07.993", "AcceptedAnswerId": "25185691", "Title": "Pass variable to Javascript file", "Body": "<p>I'm using Django and jqGrids, and I'm trying to automate the grid's contruction process. There is an issue, that I can't figure out the solution.</p>\n\n<p>I've a Javascript file that I include in the header of my html page, <code>grid.locale-en.js</code>, that contains all strings that appear on the jqGrid's boxes. </p>\n\n<pre><code>&lt;script src=\"{% static 'project/grid.locale-en.js' %}\"&gt;&lt;/script&gt;\n</code></pre>\n\n<p>I want to pass to this file one Django variable that has the name of the grid.</p>\n\n<p>This way, I can have has mutch grids as I want, and I only need one grid's code.\nThis will serve to change the following fields.</p>\n\n<pre><code>edit: {\n addCaption: \"Add Product\",\n editCaption: \"Edit Product\",\n</code></pre>\n\n<p>Thanks for the help!</p>\n", "Lable": "No"}
2
+ {"QuestionId": 25191495, "AnswerCount": 2, "Tags": "<php><css><stylesheet>", "CreationDate": "2014-08-07T20:20:58.353", "AcceptedAnswerId": null, "Title": "Changes to style.css not showing up", "Body": "<p>My website, pretendcity.org has a custom theme created by someone else. To edit content I use dreamweaver and go into the server to open up the individual files (ex: if I need to add something to the header, I will edit header.php).</p>\n\n<p>My issue is that when I edit/update the style.css file for the website it doesn't update right away. For example I changed the background color from #353535 to #000000 and there were no changes. So I left the background color as #000000 in style.css for weeks and no changes were found on the website. Then today, WordPress had an automatic update to 3.9.2 and I found the background color suddenly changed to #000000.</p>\n\n<p>Now I'm trying to change it back to #353535 and it will not make any changes.</p>\n\n<p>Here is the style.css for the website:</p>\n\n<pre><code>@charset \"UTF-8\";\n/*\nTheme Name: Pretend City Children's Museum\nTheme URI: http://pretendcity.org\nDescription: Pretend City v2\nAuthor: Slava Popov\nAuthor URI: http://laydbak.com\n*/\n\n/* =================\n0081cd - Blue\n83bc34 - Green\n353535 - Text\ncbcbcb - Borders\n==================*/\n\n/* =========== */\n/* Page Styles */\n/* =========== */\n\nbody {\n background: #f0f0f0;\n color: #353535;\n font: 12px Arial, Helvetica, sans-serif;\n margin: 0;\n padding: 0;\n text-align: center;\n width: 100%;\n }\nimg {border: 0;}\ntable {margin: 0 0 10px 0; padding: 0; line-height: 19px; vertical-align: top !important; border-spacing:0; border-collapse:collapse;}\ntd {vertical-align: top !important;}\np {line-height: 19px; padding-bottom: 10px;}\nh2, h3, h4, h5, h6 {color: #353535; margin-bottom: 10px;}\nh1 {color: #0081cd; font-size: 24px; margin: 0 0 10px 0;}\nh2 {color: #353535; font-size: 18px;}\nh3 {color: #83bc34; font-size: 16px;}\nh3 a {color: #83bc34;}\nh4 {font-size: 14px;}\nh5 {font-size: 14px;}\nh6 {color: red; font-size: 11px;}\nhr {\n border: none 0;\n border-top: 1px dashed #ccc;\n height: 1px;\n margin: 20px 0;\n width: 100%;\n }\na {color: #0081cd; text-decoration: underline;}\na:hover {text-decoration: none;}\nul {\n line-height: 19px;\n list-style-type: disc;\n padding: 0 0 20px 20px;}\n.wrap {\n background: #FFF;\n border-left: #cbcbcb 1px solid;\n border-bottom: #cbcbcb 1px solid;\n border-right: #cbcbcb 1px solid;\n margin: 0 auto;\n position: relative;\n width: 958px;\n }\n</code></pre>\n\n<p>here is the header.php code:</p>\n\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html &lt;?php language_attributes(); ?&gt;&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"&lt;?php bloginfo('html_type'); ?&gt;; charset=&lt;?php bloginfo('charset'); ?&gt;\"/&gt;\n&lt;meta property=\"twitter:pretendcity\" content=\"42741399\" /&gt;\n&lt;title&gt;&lt;?php wp_title('&amp;laquo;', true, 'right'); ?&gt; &lt;?php bloginfo('name'); ?&gt;&lt;/title&gt;\n&lt;link rel=\"shortcut icon\" href=\"&lt;?php bloginfo( 'template_directory' ); ?&gt;/favicon.ico\" /&gt;\n&lt;link href=\"&lt;?php bloginfo( 'template_directory' ); ?&gt;/reset.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" /&gt;\n&lt;link href=\"&lt;?php echo get_stylesheet_uri(); ?&gt;\" rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection\" /&gt;\n&lt;link href=\"&lt;?php bloginfo( 'template_directory' ); ?&gt;/shortcode.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection\" /&gt;\n&lt;link href=\"&lt;?php bloginfo( 'template_directory' ); ?&gt;/print.css\" rel=\"stylesheet\" type=\"text/css\" media=\"print\" /&gt;\n&lt;!--[if IE]&gt;&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"&lt;?php bloginfo( 'template_directory' ); ?&gt;/all-ie-only.css\" /&gt;&lt;![endif]--&gt;\n&lt;?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?&gt;\n&lt;!--[if lt IE 9]&gt;\n&lt;script src=\"&lt;?php echo get_template_directory_uri(); ?&gt;/js/html5.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n&lt;![endif]--&gt;\n&lt;?php wp_head(); ?&gt;\n\n&lt;!-- BEGIN GOOGLE ANALYTICS --&gt;\n &lt;script&gt;\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-38311913-1', 'pretendcity.org');\n ga('send', 'pageview');\n\n&lt;/script&gt;\n&lt;!-- END GOOGLE ANALYTICS --&gt;\n&lt;/head&gt;\n\n&lt;!--[if IE 7]&gt; &lt;body class=\"lt-ie8\"&gt; &lt;![endif]--&gt;\n\n&lt;body &lt;?php body_class(); ?&gt;&gt;\n\n&lt;!-- Top Info Bar --&gt;\n&lt;div id=\"infobar\"&gt;\n &lt;div&gt;\n &lt;span&gt;&lt;strong&gt;Address:&lt;/strong&gt; 29 Hubble, Irvine, CA 92618 (&lt;a href=\"https://www.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=Pretend+City+Children's+Museum,+29+Hubble,+Irvine,+CA&amp;amp;aq=0&amp;amp;oq=Pretend&amp;amp;sll=33.835232,-117.8461&amp;amp;sspn=0.246678,0.528374&amp;amp;vpsrc=0&amp;amp;ie=UTF8&amp;amp;hq=Pretend+City+Children's+Museum,+29+Hubble,+Irvine,+CA&amp;amp;t=m&amp;amp;z=15&amp;amp;iwloc=A&amp;amp;cid=12592966360647214510\" target=\"_blank\" class=\"map\"&gt;Get Directions&lt;/a&gt;)&lt;/span&gt;\n &lt;span&gt;&lt;strong&gt;Phone:&lt;/strong&gt; 949.428.3900&lt;/span&gt;\n &lt;span&gt;&lt;strong&gt;Hours:&lt;/strong&gt; Tues. - Sun.. 10a.m. - 5p.m.&lt;/span&gt;\n &lt;span&gt;Monday 10a.m. - 1p.m.&lt;/span&gt;\n &lt;strong&gt;Ages:&lt;/strong&gt; Infants to 8 years old\n &lt;/div&gt;\n&lt;/div&gt;\n&lt;!-- Header &amp; Logo --&gt;\n&lt;header&gt;\n\n\n &lt;a href=\"/\"&gt;\n &lt;div class=\"logo\" title=\"Pretend City Children's Museum\"&gt;&lt;/div&gt;\n &lt;/a&gt;\n\n &lt;!-- &lt;a href=\"https://tickets.pretendcity.org/public/loader.asp?target=donation.asp?code=0013\" target=\"_blank\"&gt; --&gt;\n &lt;a href=\"https://16116.blackbaudhosting.com/16116/General-Contributions\" target=\"_blank\"&gt;\n &lt;div class=\"donate\" title=\"Donate Today!\"&gt;&lt;/div&gt;\n &lt;/a&gt;\n&lt;!-- Paypal Donate Button --&gt;\n &lt;div class=\"paypalicon\" style=\"margin-top:55px; margin-left: 600px\"&gt;&lt;form title=\"Donate Today!\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\"&gt;&lt;input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" /&gt;\n&lt;input type=\"hidden\" name=\"hosted_button_id\" value=\"228Z5CXX3WVT8\" /&gt;\n&lt;input type=\"image\" alt=\"PayPal - The safer, easier way to pay online!\" name=\"submit\" src=\"http://pretendcity.org/images_home/donate-with-paypal-button-54.png\" /&gt;\n&lt;img alt=\"\" src=\"https://www.paypalobjects.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\" border=\"0\" /&gt;&lt;/form&gt;&lt;/div&gt;\n\n\n\n&lt;/header&gt;\n&lt;!-- Main Body Wrapper --&gt;\n&lt;div class=\"wrap\"&gt;\n &lt;!-- Navigation Start --&gt;\n &lt;nav id=\"menu\"&gt;\n &lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'primary', 'container_class' =&gt; 'main-navigation', 'menu_class' =&gt; 'nav-menu' ) ); ?&gt;\n &lt;/nav&gt;\n</code></pre>\n", "Lable": "No"}
3
+ {"QuestionId": 25234894, "AnswerCount": 1, "Tags": "<c#><error-handling><installation><exe><firebird2.5>", "CreationDate": "2014-08-11T01:58:45.593", "AcceptedAnswerId": null, "Title": "c# express built solution with firebird database has an error when run", "Body": "<p><img src=\"https://i.stack.imgur.com/B7g2S.png\" alt=\"enter image description here\">\nI've been I'm trying to create an exe file of my application in c# express. My problem is when I run the application.exe after I build from release it shows me an error </p>\n\n<pre><code>System.ArgumentException: An invalid connection string argument has been supplied or a required connection string argument has not been supplied.\nat FirebirdSql.Data.FirebirdClient.FbConnectionString.Validate()\nat FirebirdSql.Data.FirebirdClient.FbConnection.set_ConnectionString(String value)\nat FirebirdSql.Data.FirebirdClient.FbConnection..ctor(String connectionString)\nat Mis_Service.Loginfrm.btnLogin_Click(Object sender, EventArgs e) in d:\\c sharp projects\\samples\\Mis-Service\\Mis-Service\\Loginfrm.cs:line 31\nat System.Windows.Forms.Control.OnClick(EventArgs e)\nat System.Windows.Forms.Button.OnClick(EventArgs e)\nat System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\nat System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)\nat System.Windows.Forms.Control.WndProc(Message&amp; m)\nat System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)\nat System.Windows.Forms.Button.WndProc(Message&amp; m)\nat System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)\nat System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)\nat System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\n</code></pre>\n\n<p>I think the error only occurs when I connect to the database firebird. I am using the reference as follows.</p>\n\n<pre><code>using FirebirdSql.Data.FirebirdClient;\n</code></pre>\n\n<p>When I try to run the program using the start button of c# express the code works fine. Is there something that i missed? I want to make the my application in exe so that i can create an installer using 3rd party software</p>\n\n<p>here is my code in app.config </p>\n\n<pre><code>&lt;configuration&gt;\n&lt;startup&gt; \n &lt;supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" /&gt;\n&lt;/startup&gt;\n&lt;appSettings&gt;\n &lt;add key=\"ProviderName\" value=\"MSDASQL.1\"/&gt;\n &lt;add key=\"SecurityInfo\" value=\"False\"/&gt;\n &lt;add key=\"Driver\" value=\"Firebird/InterBase(r) driver\"/&gt;\n &lt;add key=\"UserID\" value=\"sysdba\"/&gt;\n &lt;add key=\"Password\" value=\"masterkey\"/&gt;\n &lt;add key=\"Database\" value=\"D:\\\\database\\\\DB_GENERAL.FDB\"/&gt;\n &lt;add key=\"DataSource\" value=\"localhost\"/&gt;\n &lt;/appSettings&gt; \n&lt;/configuration&gt;\n</code></pre>\n\n<p>in my class</p>\n\n<pre><code>conProvider = ConfigurationManager.AppSettings[\"ProviderName\"]; // sample on how i call app.config to string\nconString = \"Provider=\" + conProvider + \";\" +\n \"Persist Security Info=\" + conSecurityInfo + \";\" +\n \"Driver=\" + conDriver + \";\" +\n \"User ID=\" + conUserID + \";\" +\n \"Password=\" + conPassword + \";\" +\n \"Database=\" + conDatabase + \";\" +\n \"DataSource=\" + conDataSource + \";\" +\n \"Charset=NONE;\";\n</code></pre>\n", "Lable": "No"}
4
+ {"QuestionId": 25268077, "AnswerCount": 2, "Tags": "<android><string><inputstream><android-internet>", "CreationDate": "2014-08-12T15:17:59.883", "AcceptedAnswerId": null, "Title": "need help to pass string value from try catch", "Body": "<p>i am trying to read all texts from url text file to string but i am having these errors:</p>\n\n<pre><code>Description Resource Path Location Type\ncurrentUrl cannot be resolved to a variable MainActivity.java /Copy of ImageDownloadSample/src/com/example/imagedownloadsample line 51 Java Problem\ncurrentUrl cannot be resolved MainActivity.java /Copy of ImageDownloadSample/src/com/example/imagedownloadsample line 62 Java Problem\ncurrentUrl cannot be resolved MainActivity.java /Copy of ImageDownloadSample/src/com/example/imagedownloadsample line 64 Java Problem\ncurrentUrl cannot be resolved MainActivity.java /Copy of ImageDownloadSample/src/com/example/imagedownloadsample line 63 Java Problem\n</code></pre>\n\n<p>this is my code:</p>\n\n<pre><code>package com.example.imagedownloadsample;\n\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\nimport android.graphics.Bitmap;\nimport android.graphics.Bitmap.CompressFormat;\nimport android.graphics.drawable.Drawable;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.support.v7.app.ActionBarActivity;\n\nimport com.squareup.picasso.Picasso;\nimport com.squareup.picasso.Target;\n\npublic class MainActivity extends ActionBarActivity {\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.image_download);\n\n //\n try {\n\n URL url = new URL(\n \"https://www.dropbox.com/s/s70xckuxjh5sbtw/pop.txt\");\n\n // read text returned by server\n BufferedReader in = new BufferedReader(new InputStreamReader(\n url.openStream()));\n\n String currentUrl;\n while ((currentUrl = in.readLine()) != null) {\n System.out.println(currentUrl);\n }\n in.close();\n\n } catch (MalformedURLException e) {\n System.out.println(\"Malformed URL: \" + e.getMessage());\n } catch (IOException e) {\n System.out.println(\"I/O Error: \" + e.getMessage());\n }\n //\n\n Picasso.with(this).load(currentUrl).into(target);\n\n }\n\n private Target target = new Target() {\n @Override\n public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n\n String fileName = currentUrl.substring(\n currentUrl.lastIndexOf('/') + 1,\n currentUrl.length());\n\n String fname = \"/image-\" + fileName + \".jpg\";\n\n File file = new File(Environment\n .getExternalStorageDirectory().getPath() + fname);\n if (file.exists())\n file.delete();\n try {\n file.createNewFile();\n FileOutputStream ostream = new FileOutputStream(file);\n bitmap.compress(CompressFormat.JPEG, 100, ostream);\n ostream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n }).start();\n }\n\n @Override\n public void onBitmapFailed(Drawable errorDrawable) {\n }\n\n @Override\n public void onPrepareLoad(Drawable placeHolderDrawable) {\n if (placeHolderDrawable != null) {\n }\n }\n };\n\n}\n</code></pre>\n\n<p>.....................................................................................................................................................................</p>\n", "Lable": "No"}
5
+ {"QuestionId": 25289775, "AnswerCount": 1, "Tags": "<swift><mkmapview>", "CreationDate": "2014-08-13T15:08:11.353", "AcceptedAnswerId": null, "Title": "How to disallow rotation on MKMapView but show heading?", "Body": "<p>For my project, I would like to put on a MKMapView the heading of the user without rotating the map (with the blue cone).</p>\n\n<p><img src=\"https://i.stack.imgur.com/6DBZY.png\" alt=\"enter image description here\"></p>\n\n<p><a href=\"https://gist.github.com/nicolas-besnard/005d0939f21a9bc243b0\" rel=\"nofollow noreferrer\">Here's a gist</a></p>\n\n<p>Furthermore, with <code>mapView.setUserTrackingMode(MKUserTrackingMode.FollowWithHeading, animated: true)</code> enable, I can't navigate trough my map.</p>\n\n<p>I tried to set the <code>trackingMode</code> on the <code>mapView:didChangeUserTrackingMode</code> but It's not working.</p>\n\n<p>Any idea ? </p>\n", "Lable": "No"}
6
+ {"QuestionId": 25411092, "AnswerCount": 1, "Tags": "<jasper-reports><jasperserver>", "CreationDate": "2014-08-20T17:36:02.487", "AcceptedAnswerId": null, "Title": "default parameter for collection", "Body": "<p>I created a parameter whose type is \"Collection\" and it is a multi select parameter. I want to choose one value as default but I am unable to do so. I have tried all the options mentioned in this forum like</p>\n\n<p>the default values as \" new ArrayList(Arrays.asList(new String[] {\"WhatValueUWant\"})) \"and \" [\" \"] \" but still didn't work. Can any one please help me here ? </p>\n", "Lable": "No"}
7
+ {"QuestionId": 25460870, "AnswerCount": 1, "Tags": "<c#><windows-installer><clickonce><setup-project><auto-update>", "CreationDate": "2014-08-23T10:18:46.100", "AcceptedAnswerId": "25475680", "Title": "is it appropriate to implement auto update for a c# application just by passing download url to msiexec", "Body": "<p>I have a project in c# which requires auto update functionality, since it has quite a lot of dependencies and runs a Windows service, ClickOnce installer is not suitable for this work. So I created a setup project for this application. Now I want to include an auto update feature.</p>\n\n<p>My auto-update strategy is:</p>\n\n<ol>\n<li><p>From the main application, check for updates every morning.</p></li>\n<li><p>If an update is found, get the msi link</p></li>\n<li><p>Application passes control to the msiexec and quits</p></li>\n</ol>\n\n<p>Ex. </p>\n\n<pre><code>msiexec /i http://www.example.com/share/package.msi /L*V \"C:\\log\\example.log\"\n</code></pre>\n\n<p>Since my application is running on administrator account UAC prompt will not occur. </p>\n\n<p>Are there any pitfalls that I haven't seen? Or there any superior way to do auto update gracefully?</p>\n\n<p>Note: The setup project of the application is marked with the property RemoveAllPreviousVersion = True so it will take care of the uninstallation of previous versions.</p>\n", "Lable": "No"}
8
+ {"QuestionId": 25463269, "AnswerCount": 3, "Tags": "<php><mysql><sql>", "CreationDate": "2014-08-23T15:01:41.390", "AcceptedAnswerId": null, "Title": "Running a Complex MySQL QUERY using PHP", "Body": "<p>I have tried to fetch the data from a table named 'gainfinal' using a complex query given below : </p>\n\n<pre><code> SELECT g.countrycode,\n sum(case when `year` = '1995' then g.values else 0 end) AS \"1995\",\n sum(case when `year` = '1996' then g.values else 0 end) AS \"1996\",\n sum(case when `year` = '1997' then g.values else 0 end) AS \"1997\",\n sum(case when `year` = '1998' then g.values else 0 end) AS \"1998\", \n sum(case when `year` = '1999' then g.values else 0 end) AS \"1999\",\n sum(case when `year` = '2000' then g.values else 0 end) AS \"2000\",\n sum(case when `year` = '2001' then g.values else 0 end) AS \"2001\",\n sum(case when `year` = '2002' then g.values else 0 end) AS \"2002\",\n sum(case when `year` = '2003' then g.values else 0 end) AS \"2003\", \n sum(case when `year` = '2004' then g.values else 0 end) AS \"2004\", \n sum(case when `year` = '2005' then g.values else 0 end) AS \"2005\",\n sum(case when `year` = '2006' then g.values else 0 end) AS \"2006\",\n sum(case when `year` = '2007' then g.values else 0 end) AS \"2007\",\n sum(case when `year` = '2008' then g.values else 0 end) AS \"2008\",\n sum(case when `year` = '2009' then g.values else 0 end) AS \"2009\", \n sum(case when `year` = '2010' then g.values else 0 end) AS \"2010\", \n sum(case when `year` = '2011' then g.values else 0 end) AS \"2011\",\n sum(case when `year` = '2012' then g.values else 0 end) AS \"2012\"\n\n\nFROM `gainfinal` g\nWHERE `year` between '1995' and '2012'\nGROUP BY `countrycode`\n</code></pre>\n\n<p>I am sure the Query has been running well because it returned right data while running in Xampp. </p>\n\n<p>My PHP code is like this : </p>\n\n<pre><code> ini_set('display_errors', 1); \n $username = \"root\"; \n $password = \"\"; \n $host = \"localhost\";\n $database=\"climate\";\n //$country = 'NPL';\n // $indices = 'foodfinal';\n // $country=$_GET[\"country\"];\n\n // $indices=$_GET[\"indices\"];\n\n\n $server = mysql_connect($host, $username, $password);\n $connection = mysql_select_db($database, $server);\n\n $myquery = \"SELECT g.countrycode,sum(case when `year` = '1995' then `g.values` else 0 end) AS \"1995\",\n sum(case when `year` = '1996' then g.values else 0 end) AS \"1996\",\n sum(case when `year` = '1997' then g.values else 0 end) AS \"1997\",\n sum(case when `year` = '1998' then g.values else 0 end) AS \"1998\", \n sum(case when `year` = '1999' then g.values else 0 end) AS \"1999\",\n sum(case when `year` = '2000' then g.values else 0 end) AS \"2000\",\n sum(case when `year` = '2001' then g.values else 0 end) AS \"2001\",\n sum(case when `year` = '2002' then g.values else 0 end) AS \"2002\",\n sum(case when `year` = '2003' then g.values else 0 end) AS \"2003\", \n\n sum(case when `year` = '2004' then g.values else 0 end) AS \"2004\", \n sum(case when `year` = '2005' then g.values else 0 end) AS \"2005\",\n sum(case when `year` = '2006' then g.values else 0 end) AS \"2006\",\n sum(case when `year` = '2007' then g.values else 0 end) AS \"2007\",\n sum(case when `year` = '2008' then g.values else 0 end) AS \"2008\",\n sum(case when `year` = '2009' then g.values else 0 end) AS \"2009\", \n sum(case when `year` = '2010' then g.values else 0 end) AS \"2010\", \n sum(case when `year` = '2011' then g.values else 0 end) AS \"2011\",\n sum(case when `year` = '2012' then g.values else 0 end) AS \"2012\"\n\n\nFROM `gainfinal` g\nWHERE `year` between '1995' and '2012'\nGROUP BY `countrycode`\";\n $query = mysql_query($myquery);\n\n if ( ! $query ) {\n echo mysql_error();\n die;\n }\n\n $data = array();\n\n for ($x = 0; $x &lt; mysql_num_rows($query); $x++) {\n $data[] = mysql_fetch_assoc($query);\n }\n\n echo json_encode($data); \n mysql_close($server);\n //header('Location: linegraph.html');\n // include( \"linegraph.html\");\n\n?&gt;\n</code></pre>\n\n<p>This PHP file had been returning right data for other queries. It only didn't work for this query onl. While running the PHP file, it says \n: Parse error: syntax error, unexpected T_LNUMBER in C:\\xampp\\htdocs\\climateapp\\data\\chloroplath\\data.php on line 17. How can I run the Query using PHP. </p>\n", "Lable": "No"}
9
+ {"QuestionId": 25496537, "AnswerCount": 1, "Tags": "<java><future>", "CreationDate": "2014-08-26T01:06:37.027", "AcceptedAnswerId": "25509890", "Title": "Reliability of returned value of Future method cancel(false)", "Body": "<p>Suppose I schedule a task with a ScheduledThreadPoolExecutor and get a Future back.</p>\n\n<p>I later decide I want to cancel that Future, and rely on the returned value of the <strong>cancel</strong> to trigger some cleanup operation. I don't want the task to be interrupted if it's already running (so I pass <strong>false</strong> as argument).</p>\n\n<p>Is the return of the cancel reliable? That is, <strong>is it impossible</strong> that, if cancel returned \"true\", the task is actually being run?</p>\n\n<p>Looking at the code in the OpenJDK 8 it looks like there could be a race condition, whereby the \"cancel\" sets the state of the task to CANCELLED and returns true, but the runner can already have passed the \"check\" to start execution.</p>\n\n<p>As far as I can see, the computation will be performed but the result not set (which is good). However, in my case, the \"computation\" has side effects so I want to know if I cancelled it for real or not.</p>\n", "Lable": "No"}
10
+ {"QuestionId": 25530019, "AnswerCount": 1, "Tags": "<java><android><android-appwidget>", "CreationDate": "2014-08-27T14:34:49.683", "AcceptedAnswerId": "25530196", "Title": "PendingIntent sending the wrong intent / putExtra", "Body": "<p>I am working on an appWidget and I got my first big problem.<br>\nI need to send to my app (CoreActivity) that the user click on image X or image Y (etc).<br>\nAnd what is exactly this image (in this exemple : Restaurant or Taxi).</p>\n\n<p>My problem is : when the user click on an image, it always send the last putExtra (in this exemple Taxi). When I click on logo_1 or image1_1 it always send \"Taxi\" to my CoreActivity.</p>\n\n<p>Do you know why ? Because I can't find anywhere what is wrong here...</p>\n\n<p>Thanks for all the help you can bring me and thanks for the time you took (even for reading this question ^^).<br>\nHave a nice day.</p>\n\n<pre><code>final RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.widget_demo_4l_4c);\n\nIntent logo_1Intent = new Intent(context, CoreActivity.class);\nIntent image1_1Intent = new Intent(context, CoreActivity.class);\nIntent image2_1Intent = new Intent(context, CoreActivity.class);\n\nimage1_1Intent.putExtra(CoreActivity.EXTRA_WIDGET_KEY, \"Restaurant\");\nimage2_1Intent.putExtra(CoreActivity.EXTRA_WIDGET_KEY, \"Taxi\");\n\n\nPendingIntent logo_1PendingIntent = PendingIntent.getActivity(context, 0, logo_1Intent, PendingIntent.FLAG_UPDATE_CURRENT);\nPendingIntent image1_1PendingIntent = PendingIntent.getActivity(context, 0, image1_1Intent, PendingIntent.FLAG_UPDATE_CURRENT);\nPendingIntent image2_1PendingIntent = PendingIntent.getActivity(context, 0, image2_1Intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\nviews.setOnClickPendingIntent(R.id.logo_1, logo_1PendingIntent);\nviews.setOnClickPendingIntent(R.id.image1_1, image1_1PendingIntent);\nviews.setOnClickPendingIntent(R.id.image2_1, image2_1PendingIntent);\n\nappWidgetManager.updateAppWidget(appWidgetId, views);\n</code></pre>\n", "Lable": "No"}
11
+ {"QuestionId": 25541977, "AnswerCount": 1, "Tags": "<jquery><css><asp.net-mvc-4><fancytree>", "CreationDate": "2014-08-28T06:18:25.057", "AcceptedAnswerId": null, "Title": "how to show Loading image on binding dropdownlist data with fancy tree", "Body": "<p>On dropdownlist value change, im calling ajzx action to get the DB values and building DB values as Html (in controller) and onSuccess of Ajax the Html is appended to the an div. Till this the process is speed and i can get the data in few seconds. the appended Div element is converted to fancytree (plugin) which takes long time to load, so the requirement is to show the 'Loading...' icon still the binding completes. I googled a lot and tired many sort but nothing working, the image is not loading during converting the div to fancy Tree. Shown below the code which i tired.</p>\n\n<p>CSS:</p>\n\n<pre><code>#dvLoading {\n background:#000 url(images/animated-overlay.gif) no-repeat center center;\n height: 100px;\n width: 100px;\n position: fixed;\n z-index: 1000;\n left: 50%;\n top: 50%;\n margin: -25px 0 0 -25px;\n}\n</code></pre>\n\n<p>in View :</p>\n\n<pre><code>&lt;div id=\"dvLoading\"&gt;&lt;/div&gt;\n</code></pre>\n\n<p>in JS</p>\n\n<pre><code>drawOrganiTree: function (result) {\n \"use strict\";\n var ns = SocietaEStruttureHome.index;\n var res = \"&lt;div id='divOrgTree' &gt;\" + result + \"&lt;/div&gt;\";\n $(\"#divOrgStructure\").append(res); //append the HTML data \n\n //$(window).load(function () { $(\"#dvLoading\").fadeOut(20000); });\n $(\"#dvLoading\").show(); // Here to show the Loading image\n\n $(\"#divOrgTree\").fancytree();\n\n $(\"#dvLoading\").show(); //Here to hide the Loading image\n //Expand all the node of the tree on load\n $(\"#divOrgTree\").fancytree(\"getRootNode\").visit(function (node) {\n //node.setExpanded(true);\n });\n\n $(\"#btnModify\").show();\n},\n</code></pre>\n\n<p>Am i doing anything wrong here. please help.</p>\n", "Lable": "No"}
12
+ {"QuestionId": 25687323, "AnswerCount": 0, "Tags": "<html><ios><iphone><ipad><youtube>", "CreationDate": "2014-09-05T13:42:54.593", "AcceptedAnswerId": null, "Title": "Links aren't clickable, when they're placed over playing YouTube video embed on iPad", "Body": "<p>I've got menu on tablet resolution with fixed position. Also there is in the content of this page YouTube video embed (iframe).</p>\n\n<p>Now on iPad when you play the YouTube video and than you open a menu item, it shows new element (submenu) which is also position: fixed, but you can't click on any link in this submenu. I've tried to fix it with changing wmode at the begining of url GET parameters like this: </p>\n\n<pre><code>wmode=opaque, wmode=transparent\n</code></pre>\n\n<p>But it didn't work. I've also tried to fixed it with changing the YT iframe to object, but it didn't help either.</p>\n\n<p>Basicly if you have any links over playing YouTube video on iPad, you can't click on them. If the video isn't playing, these links work. Is there any solution to fix it, it works well on all desktop browsers.</p>\n", "Lable": "No"}
oraclechunk36.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 25833537, "AnswerCount": 0, "Tags": "<asp.net-mvc-5><asp.net-identity>", "CreationDate": "2014-09-14T13:02:26.837", "AcceptedAnswerId": null, "Title": "Edit Composed key in AspNetUserRoles Table", "Body": "<p>I am using MCV5 with ASP Identity and made some modification in table AspNetUserRole:</p>\n\n<pre><code>public class AspNetUserRole : IdentityUserRole\n{\n [key]\n public string Id { get; set; }\n}\n</code></pre>\n\n<p>because I need to add Id key column and integrate it to composite key (UserId and RoleId) to become like that (UserId,RoleId and Id)</p>\n\n<p>Code for onModelCreating:</p>\n\n<pre><code>protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)\n{\n modelBuilder.Entity&lt;AspNetUserRole&gt;().HasKey(r =&gt; new { r.Id , r.RoleId, r.UserId});\n base.OnModelCreating(modelBuilder);\n}\n</code></pre>\n\n<p>but I have Id as a normal string column in database without any primary key constrains</p>\n", "Lable": "No"}
2
+ {"QuestionId": 25919847, "AnswerCount": 1, "Tags": "<javascript>", "CreationDate": "2014-09-18T18:28:28.663", "AcceptedAnswerId": "25919956", "Title": "Why does image constructed by createObjectURL have 0 width?", "Body": "<p>This is my code which is supposed to load an image from a <strong>form file input</strong> and resize it if it is too large. The problem is that when I create a new image object and set its src, its width equals to zero. However when I put the image into html it display correctly.</p>\n\n<pre><code>var image = document.createElement('img');\nvar image_url = window.URL.createObjectURL(image_data);\nimage.src = image_url;\nconsole.log('Width: ' + image.width);\n</code></pre>\n\n<p>-> Width: 0</p>\n", "Lable": "No"}
3
+ {"QuestionId": 25995600, "AnswerCount": 0, "Tags": "<javascript><php><html><view><visible>", "CreationDate": "2014-09-23T12:51:48.690", "AcceptedAnswerId": null, "Title": "priorize visible content php html", "Body": "<p>I have a site called www.anetoi.com and I want to prioritize visible content. PageSpeed Insights says:</p>\n\n<blockquote>\n <p>Your page requires additional network round trips to render the above-the-fold content. For best performance, reduce the amount of HTML needed to render above-the-fold content.\n The entire HTML response was not sufficient to render the above-the-fold content. This usually indicates that additional resources, loaded after HTML parsing, were required to render above-the-fold content. Prioritize visible content that is needed for rendering above-the-fold by including it directly in the HTML response.\n Only about 66% of the final above-the-fold content could be rendered with the full HTML response.</p>\n</blockquote>\n\n<p>In my home page I am adding all the HTML in a single variable and I echo this variable in order to print all my HTML at once. I also have slide bars that I added at the end of each HTML in order to show the visible content.</p>\n\n<p>The problem is still there and I can't find what's wrong. I am really stuck with this.</p>\n\n<p>Please help, thanks in advance.</p>\n", "Lable": "No"}
4
+ {"QuestionId": 26110931, "AnswerCount": 2, "Tags": "<java><swing><joptionpane>", "CreationDate": "2014-09-30T00:30:58.523", "AcceptedAnswerId": "26111054", "Title": "JOptionPane in if statements", "Body": "<p>For my assignment I am using JOptionPane to ask the user to enter 3 sides of a triangle. The program is then suppose to use JOptionPane to tell them the type of triangle (equilateral, right, acute, obtuse, and isosceles but isosceles triangles are also either right, obtuse or acute) it is and to calculate the area. </p>\n\n<p>When it is equilateral it comes back telling me that it is equilateral but it also tells me it is isosceles 3 times. Even though I only have the isosceles JOptionPane with the other types of triangles. </p>\n\n<p>My other problem is that when it is right, acute, or obtuse it skips the JOptionPane telling me what type it is and just tells me it is isosceles. </p>\n\n<pre><code>package assignment.ii;\nimport javax.swing.JOptionPane;\nimport java.lang.*;\npublic class AssignmentII\n\n {\n\npublic static void main(String[] args) {\n\n int a = Integer.parseInt(JOptionPane.showInputDialog(null, \"Please enter a side of the triangle \"));\n int b = Integer.parseInt(JOptionPane.showInputDialog(null, \"Please enter a side of the triangle \"));\n int c = Integer.parseInt(JOptionPane.showInputDialog(null, \"Please enter a side of the triangle \"));\n double s = (.5*(a+b+c));\n\n if(a==b){\n if (b==c)\n JOptionPane.showMessageDialog(null, \"The triangle is a equilateral triangle\");\n\n }else if (((a*a)+(b*b)) == (c*c)) { \n JOptionPane.showMessageDialog(null, \"The triangle is a right triangle\");\n if (a==b)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\"); \n if (b==c)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\"); \n if (a==c)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");\n\n }else if (((a*a)+(b*b))&lt;(c*c)){ \n JOptionPane.showMessageDialog(null, \"The triangle is an obtuse triangle\");\n if (a==b)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\"); \n if (b==c)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\"); \n if (a==c)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");\n\n }else if (((a*a)+(b*b))&gt;(c*c)) \n JOptionPane.showMessageDialog(null, \"The triangle is an acute triangle\");\n if (a==b)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\"); \n if (b==c)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\"); \n if (a==c)\n JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");\n double d;\n d = ((s)*(s - a)*(s - b)*(s - c));\n\n JOptionPane.showMessageDialog(null, \"The area of the triangle is: \" + Math.sqrt(d));\n\n\n } \n }\n</code></pre>\n", "Lable": "No"}
5
+ {"QuestionId": 26260848, "AnswerCount": 1, "Tags": "<python><arrays><numpy>", "CreationDate": "2014-10-08T15:34:28.363", "AcceptedAnswerId": null, "Title": "Numpy fast check for complete array equality, like Matlabs isequal", "Body": "<p>In Matlab, the builtin <code>isequal</code> does a check if two arrays are equal. If they are not equal, this might be very fast, as the implementation presumably stops checking as soon as there is a difference:</p>\n\n<pre><code>&gt;&gt; A = zeros(1e9, 1, 'single'); \n&gt;&gt; B = A(:); \n&gt;&gt; B(1) = 1;\n&gt;&gt; tic; isequal(A, B); toc;\nElapsed time is 0.000043 seconds.\n</code></pre>\n\n<p>Is there any equavalent in Python/numpy? <code>all(A==B)</code> or <code>all(equal(A, B))</code> is far slower, because it compares <em>all</em> elements, even if the initial one differs:</p>\n\n<pre><code>In [13]: A = zeros(1e9, dtype='float32') \n\nIn [14]: B = A.copy()\n\nIn [15]: B[0] = 1\n\nIn [16]: %timeit all(A==B)\n1 loops, best of 3: 612 ms per loop\n</code></pre>\n\n<p>Is there any numpy equivalent? It should be very easy to implement in C, but slow to implement in Python because this is a case where we do <em>not</em> want to broadcast, so it would require an explicit loop.</p>\n\n<p><strong>Edit:</strong></p>\n\n<p>It appears <code>array_equal</code> does what I want. However, it is <em>not</em> faster than <code>all(A==B)</code>, because it's not a built-in, but just a short Python function doing <code>A==B</code>. So it does not meet my need for a <em>fast</em> check.</p>\n\n<pre><code>In [12]: %timeit array_equal(A, B)\n1 loops, best of 3: 623 ms per loop\n</code></pre>\n", "Lable": "No"}
6
+ {"QuestionId": 26352325, "AnswerCount": 1, "Tags": "<java><json><jackson>", "CreationDate": "2014-10-14T03:47:47.470", "AcceptedAnswerId": "26352579", "Title": "why doesn't TextNode have update value(set) method?", "Body": "<p>I want to modify the value of a <code>TextNode</code> using jackson.<br>\nBut there is no such method in the API.<br>\nThen I try to use reflection to overcome the limitation: </p>\n\n<pre><code>public class TestModify {\n\n public static void main(final String[] args) throws JsonProcessingException, IOException,\n NoSuchFieldException, SecurityException, IllegalArgumentException,\n IllegalAccessException {\n final String json = \"[{},\\\"123123\\\",\\\"12456\\\"]\";\n final ObjectMapper mapper = new ObjectMapper();\n final JsonNode node = mapper.readTree(json);\n final Iterator&lt;JsonNode&gt; nodes = node.elements();\n while (nodes.hasNext()) {\n final JsonNode n = nodes.next();\n if (n instanceof TextNode) {\n final Field f = TextNode.class.getDeclaredField(\"_value\");\n f.setAccessible(true);\n f.set(n, \"updated\");\n }\n System.out.println(n.getClass());\n }\n System.out.println(node);\n }\n} \n</code></pre>\n\n<p>The code seems to work fine and <code>println</code> shows:</p>\n\n<pre><code>class com.fasterxml.jackson.databind.node.ObjectNode\nclass com.fasterxml.jackson.databind.node.TextNode\nclass com.fasterxml.jackson.databind.node.TextNode\n[{},\"updated\",\"updated\"] \n</code></pre>\n\n<p>So why is there no update method in the original API?</p>\n", "Lable": "No"}
7
+ {"QuestionId": 26380505, "AnswerCount": 1, "Tags": "<amazon-ec2><timeout><libcurl><http-status-code-504>", "CreationDate": "2014-10-15T10:40:45.863", "AcceptedAnswerId": null, "Title": "How can I quickly detect 504 Gateway Timeout error with libcurl?", "Body": "<p>We have some running AWS EC2 servers, our clients use libcurl to send HTTP request (POST) to those server with their public DNS, the servers might be shutdown without notifying clients, then our clients need almost 50 seconds to finish a request and then get 504 error, does anybody know if there is a way to reduce this time to a few seconds?</p>\n", "Lable": "No"}
8
+ {"QuestionId": 26399364, "AnswerCount": 2, "Tags": "<html><css><email><outlook><gmail>", "CreationDate": "2014-10-16T08:14:24.597", "AcceptedAnswerId": "26399439", "Title": "html email not showing as in browser", "Body": "<p>I am trying to create an html email, it shows fine in the browser (uses base64 images as well) but in outlook, it changes the layout as it completely omits certain blocks of text and the images display as grey? And then in gmail it shows as basic un-styled html?</p>\n\n<p>Browser:</p>\n\n<p><img src=\"https://i.stack.imgur.com/kCeoX.png\" alt=\"browser\"></p>\n\n<p>Outlook:</p>\n\n<p><img src=\"https://i.stack.imgur.com/mEhok.png\" alt=\"outlook\"></p>\n\n<p>Gmail:</p>\n\n<p><img src=\"https://i.stack.imgur.com/Ts2CO.png\" alt=\"gmail\"></p>\n\n<p>Any ideas on how I can fix this?</p>\n", "Lable": "No"}
9
+ {"QuestionId": 26427623, "AnswerCount": 2, "Tags": "<matlab><osx-yosemite>", "CreationDate": "2014-10-17T14:49:23.673", "AcceptedAnswerId": "26428076", "Title": "Using MATLAB with OS X 10", "Body": "<p>I just upgraded to OS X 10 Yosemite but cannot launch MATLAB.</p>\n\n<p>I've tried opening it through terminal with:</p>\n\n<pre><code>/Applications/MATLAB_R2014a.app/bin/matlab\n</code></pre>\n\n<p>However this doesn't work either. Any ideas?</p>\n\n<p><strong>EDIT: I have found an answer to my question!</strong></p>\n", "Lable": "No"}
10
+ {"QuestionId": 26492239, "AnswerCount": 0, "Tags": "<java><spring><maven><tomcat><slf4j>", "CreationDate": "2014-10-21T17:02:27.880", "AcceptedAnswerId": null, "Title": "AbstractMethodError from slf4j in Spring Project", "Body": "<p>I have a Spring application with Hibernate as persistency layer. For logging I'am using slf4j with log4j as binding.</p>\n\n<p>My pom.xml looks like this.</p>\n\n<pre><code>&lt;properties&gt;\n &lt;spring.version&gt;3.2.0.RELEASE&lt;/spring.version&gt;\n &lt;hibernate.version&gt;4.1.0.Final&lt;/hibernate.version&gt;\n&lt;/properties&gt;\n\n&lt;dependencies&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework&lt;/groupId&gt;\n &lt;artifactId&gt;spring-core&lt;/artifactId&gt;\n &lt;version&gt;${spring.version}&lt;/version&gt;\n &lt;/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework&lt;/groupId&gt;\n &lt;artifactId&gt;spring-web&lt;/artifactId&gt;\n &lt;version&gt;${spring.version}&lt;/version&gt;\n &lt;/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;javax.servlet&lt;/groupId&gt;\n &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;\n &lt;version&gt;2.5&lt;/version&gt;\n &lt;scope&gt;provided&lt;/scope&gt;\n &lt;/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;\n &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;\n &lt;version&gt;2.1&lt;/version&gt;\n &lt;scope&gt;provided&lt;/scope&gt;\n &lt;/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework&lt;/groupId&gt;\n &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;\n &lt;version&gt;${spring.version}&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework&lt;/groupId&gt;\n &lt;artifactId&gt;spring-test&lt;/artifactId&gt;\n &lt;version&gt;${spring.version}&lt;/version&gt;\n &lt;scope&gt;test&lt;/scope&gt;\n &lt;/dependency&gt;\n\n &lt;!--DEPENDENCYS FOR HIBERNATE--&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework&lt;/groupId&gt;\n &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;\n &lt;version&gt;${spring.version}&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.hibernate&lt;/groupId&gt;\n &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;\n &lt;version&gt;${hibernate.version}&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.hibernate&lt;/groupId&gt;\n &lt;artifactId&gt;hibernate-c3p0&lt;/artifactId&gt;\n &lt;version&gt;${hibernate.version}&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;!--DEPENDENCY FOR BEANVALIDATION--&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.hibernate&lt;/groupId&gt;\n &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;\n &lt;version&gt;${hibernate.version}&lt;/version&gt;\n &lt;exclusions&gt;\n &lt;exclusion&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;\n &lt;/exclusion&gt;\n &lt;/exclusions&gt;\n &lt;/dependency&gt;\n\n &lt;!--DRIVER FOR MYSQL--&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;mysql&lt;/groupId&gt;\n &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;\n &lt;version&gt;5.1.18&lt;/version&gt;\n &lt;/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;junit&lt;/groupId&gt;\n &lt;artifactId&gt;junit&lt;/artifactId&gt;\n &lt;version&gt;4.8.2&lt;/version&gt;\n &lt;scope&gt;test&lt;/scope&gt;\n &lt;/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;jstl&lt;/groupId&gt;\n &lt;artifactId&gt;jstl&lt;/artifactId&gt;\n &lt;version&gt;1.2&lt;/version&gt;\n &lt;/dependency&gt;\n\n &lt;dependency&gt;\n &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;\n &lt;artifactId&gt;tiles-extras&lt;/artifactId&gt;\n &lt;version&gt;2.2.2&lt;/version&gt;\n &lt;exclusions&gt;\n &lt;exclusion&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;\n &lt;/exclusion&gt;\n &lt;/exclusions&gt;\n &lt;/dependency&gt;\n\n &lt;!--REQUIRED FOR FILEUPLOAD--&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;\n &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;\n &lt;version&gt;1.2.1&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;commons-io&lt;/groupId&gt;\n &lt;artifactId&gt;commons-io&lt;/artifactId&gt;\n &lt;version&gt;1.3&lt;/version&gt;\n &lt;/dependency&gt;\n\n &lt;!--LIB FOR JSON CONVERTING--&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;\n &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;\n &lt;version&gt;1.9.12&lt;/version&gt;\n &lt;/dependency&gt;\n\n &lt;!-- Solr --&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;\n &lt;artifactId&gt;spring-data-solr&lt;/artifactId&gt;\n &lt;version&gt;1.0.0.RELEASE&lt;/version&gt;\n &lt;exclusions&gt;\n &lt;exclusion&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;\n &lt;/exclusion&gt;\n &lt;exclusion&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;\n &lt;/exclusion&gt;\n &lt;/exclusions&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.apache.solr&lt;/groupId&gt;\n &lt;artifactId&gt;solr-core&lt;/artifactId&gt;\n &lt;version&gt;4.4.0&lt;/version&gt;\n &lt;exclusions&gt;\n &lt;exclusion&gt;\n &lt;artifactId&gt;slf4j-jdk14&lt;/artifactId&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;/exclusion&gt;\n &lt;exclusion&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;\n &lt;/exclusion&gt;\n &lt;exclusion&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;\n &lt;/exclusion&gt;\n &lt;exclusion&gt;\n &lt;groupId&gt;log4j&lt;/groupId&gt;\n &lt;artifactId&gt;log4j&lt;/artifactId&gt;\n &lt;/exclusion&gt;\n &lt;/exclusions&gt;\n &lt;/dependency&gt;\n\n &lt;!--Logging--&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.slf4j&lt;/groupId&gt;\n &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;\n &lt;version&gt;1.7.7&lt;/version&gt;\n &lt;/dependency&gt;\n</code></pre>\n\n<p>So, when I deploy this application on a tomcat7 on Ubuntu with Java 1.8 everything works fine (My laptop). But when I'm trying to deploy it on the production system (Win 8, Java 7, Tomcat7 and Tomcat8 tried) I get the following error:</p>\n\n<pre><code>21-Oct-2014 17:57:50.016 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath\n21-Oct-2014 17:57:50.079 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext\n21-Oct-2014 17:57:50.079 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener\n java.lang.AbstractMethodError: org.slf4j.impl.JDK14LoggerAdapter.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V\n at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)\n at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:272)\n at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)\n at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)\n at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221)\n at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)\n at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)\n at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)\n at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)\n at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)\n at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1703)\n at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\n at java.util.concurrent.FutureTask.run(Unknown Source)\n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n at java.lang.Thread.run(Unknown Source)\n</code></pre>\n\n<p>The standard error says \"startup failed due to previous errors\"...</p>\n\n<p>Any Ideas what could be the reason?</p>\n\n<hr>\n\n<p><strong>EDIT</strong>\nThe dependency tree from 'mvn dependency:tree' looks like this:</p>\n\n<pre><code>[INFO] +- org.springframework:spring-core:jar:3.2.0.RELEASE:compile\n[INFO] | \\- commons-logging:commons-logging:jar:1.1.1:compile\n[INFO] +- org.springframework:spring-web:jar:3.2.0.RELEASE:compile\n[INFO] | +- org.springframework:spring-context:jar:3.2.0.RELEASE:compile\n[INFO] | +- org.springframework:spring-aop:jar:3.2.0.RELEASE:compile\n[INFO] | +- aopalliance:aopalliance:jar:1.0:compile\n[INFO] | \\- org.springframework:spring-beans:jar:3.2.0.RELEASE:compile\n[INFO] +- javax.servlet:servlet-api:jar:2.5:provided\n[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided (scope not updated to compile)\n[INFO] +- org.springframework:spring-webmvc:jar:3.2.0.RELEASE:compile\n[INFO] | \\- org.springframework:spring-expression:jar:3.2.0.RELEASE:compile\n[INFO] +- org.springframework:spring-test:jar:3.2.0.RELEASE:test\n[INFO] +- org.springframework:spring-orm:jar:3.2.0.RELEASE:compile\n[INFO] | +- org.springframework:spring-jdbc:jar:3.2.0.RELEASE:compile\n[INFO] | \\- org.springframework:spring-tx:jar:3.2.0.RELEASE:compile\n[INFO] +- org.hibernate:hibernate-core:jar:4.1.0.Final:compile\n[INFO] | +- commons-collections:commons-collections:jar:3.2.1:compile\n[INFO] | +- antlr:antlr:jar:2.7.7:compile\n[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile\n[INFO] | +- dom4j:dom4j:jar:1.6.1:compile\n[INFO] | | \\- xml-apis:xml-apis:jar:1.0.b2:compile\n[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile\n[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:compile\n[INFO] | +- org.javassist:javassist:jar:3.15.0-GA:compile\n[INFO] | \\- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile\n[INFO] +- org.hibernate:hibernate-c3p0:jar:4.1.0.Final:compile\n[INFO] | \\- c3p0:c3p0:jar:0.9.1:compile\n[INFO] +- org.hibernate:hibernate-validator:jar:4.1.0.Final:compile\n[INFO] | \\- javax.validation:validation-api:jar:1.0.0.GA:compile\n[INFO] +- mysql:mysql-connector-java:jar:5.1.18:compile\n[INFO] +- junit:junit:jar:4.8.2:test\n[INFO] +- jstl:jstl:jar:1.2:compile\n[INFO] +- org.apache.tiles:tiles-extras:jar:2.2.2:compile\n[INFO] | +- org.apache.tiles:tiles-core:jar:2.2.2:compile\n[INFO] | | +- org.apache.tiles:tiles-api:jar:2.2.2:compile\n[INFO] | | \\- commons-digester:commons-digester:jar:2.0:compile\n[INFO] | | \\- commons-beanutils:commons-beanutils:jar:1.8.0:compile\n[INFO] | +- org.apache.tiles:tiles-servlet-wildcard:jar:2.2.2:compile\n[INFO] | | \\- org.apache.tiles:tiles-servlet:jar:2.2.2:compile\n[INFO] | +- org.apache.tiles:tiles-jsp:jar:2.2.2:compile\n[INFO] | | \\- org.apache.tiles:tiles-template:jar:2.2.2:compile\n[INFO] | +- org.apache.tiles:tiles-freemarker:jar:2.2.2:compile\n[INFO] | | \\- org.freemarker:freemarker:jar:2.3.15:compile\n[INFO] | +- org.apache.tiles:tiles-velocity:jar:2.2.2:compile\n[INFO] | | \\- org.apache.velocity:velocity-tools:jar:2.0:compile\n[INFO] | | +- oro:oro:jar:2.0.8:compile\n[INFO] | | \\- org.apache.velocity:velocity:jar:1.6.2:compile\n[INFO] | +- org.apache.tiles:tiles-el:jar:2.2.2:compile\n[INFO] | +- org.apache.tiles:tiles-mvel:jar:2.2.2:compile\n[INFO] | | \\- org.mvel:mvel2:jar:2.0.11:compile\n[INFO] | +- org.apache.tiles:tiles-ognl:jar:2.2.2:compile\n[INFO] | | \\- ognl:ognl:jar:2.7.3:compile\n[INFO] | | \\- jboss:javassist:jar:3.7.ga:compile\n[INFO] | \\- org.apache.tiles:tiles-compat:jar:2.2.2:compile\n[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile\n[INFO] +- commons-io:commons-io:jar:1.3:compile\n[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.12:compile\n[INFO] | \\- org.codehaus.jackson:jackson-core-asl:jar:1.9.12:compile\n[INFO] +- org.springframework.data:spring-data-solr:jar:1.0.0.RELEASE:compile\n[INFO] | +- org.springframework.data:spring-data-commons:jar:1.6.1.RELEASE:compile\n[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile\n[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.2.2:compile\n[INFO] | | \\- org.apache.httpcomponents:httpcore:jar:4.2.2:compile\n[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.2.2:compile\n[INFO] | +- org.apache.httpcomponents:httpclient-cache:jar:4.2.2:compile\n[INFO] | \\- org.apache.solr:solr-solrj:jar:4.3.1:compile\n[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile\n[INFO] | \\- org.noggit:noggit:jar:0.5:compile\n[INFO] +- org.apache.solr:solr-core:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-core:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-codecs:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-analyzers-common:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-analyzers-kuromoji:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-analyzers-phonetic:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-highlighter:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-memory:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-misc:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-queryparser:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-spatial:jar:4.4.0:compile\n[INFO] | | \\- com.spatial4j:spatial4j:jar:0.3:compile\n[INFO] | +- org.apache.lucene:lucene-suggest:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-grouping:jar:4.4.0:compile\n[INFO] | +- org.apache.lucene:lucene-queries:jar:4.4.0:compile\n[INFO] | +- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2:compile\n[INFO] | +- commons-codec:commons-codec:jar:1.7:compile\n[INFO] | +- commons-cli:commons-cli:jar:1.2:compile\n[INFO] | +- joda-time:joda-time:jar:2.2:compile\n[INFO] | +- org.apache.hadoop:hadoop-annotations:jar:2.0.5-alpha:compile\n[INFO] | | \\- jdk.tools:jdk.tools:jar:1.6:system\n[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.0.5-alpha:compile\n[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.0.5-alpha:compile\n[INFO] | | +- org.mortbay.jetty:jetty:jar:6.1.26:compile\n[INFO] | | +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile\n[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile\n[INFO] | | \\- com.google.protobuf:protobuf-java:jar:2.4.0a:compile\n[INFO] | +- org.apache.hadoop:hadoop-hdfs:jar:2.0.5-alpha:compile\n[INFO] | +- org.restlet.jee:org.restlet:jar:2.1.1:compile\n[INFO] | +- org.restlet.jee:org.restlet.ext.servlet:jar:2.1.1:compile\n[INFO] | +- commons-lang:commons-lang:jar:2.6:compile\n[INFO] | +- com.google.guava:guava:jar:14.0.1:compile\n[INFO] | \\- org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime\n[INFO] \\- org.slf4j:slf4j-log4j12:jar:1.7.7:compile\n[INFO] +- org.slf4j:slf4j-api:jar:1.7.7:compile\n[INFO] \\- log4j:log4j:jar:1.2.17:compile\n</code></pre>\n\n<hr>\n\n<p><strong>EDIT 2</strong>\nso... Now I tried to exclude the <code>commons-logging</code> things from my projects pom.xml. But it was also not very effective. The error message stays exactly the same... But I recognised something very interesting...</p>\n\n<p>When I open the output war (I generate it with <code>mvn clean install</code>) with an archive manager and navigate to the WEB-INF/lib folder i can see all the jar-files, which were in my pom.xml during the past. So, there are the jars of 3 different versions of slf4j, multiple log4j versions and many other libs, which could be in conflict.\nThe strange thing is, that all these jar-files does not appear in the <code>mvn dependency:tree</code>.</p>\n\n<p>Any idea, how I can get rid of those files?</p>\n", "Lable": "No"}
11
+ {"QuestionId": 26513839, "AnswerCount": 0, "Tags": "<python><theano>", "CreationDate": "2014-10-22T17:49:41.763", "AcceptedAnswerId": null, "Title": "Theano import error: cannot import name Shape", "Body": "<p>I am trying to import theano as </p>\n\n<pre><code>import theano\nimport theano.tensor as T\n</code></pre>\n\n<p>But its giving the following error:</p>\n\n<pre><code>---------------------------------------------------------------------------\nImportError Traceback (most recent call last)\n&lt;ipython-input-13-ee4df930a2f4&gt; in &lt;module&gt;()\n----&gt; 1 import theano\n 2 import theano.tensor as T\n\n/Users/pksaha/anaconda/lib/python2.7/site-packages/theano/__init__.py in &lt;module&gt;()\n 53 object2, utils\n 54 \n---&gt; 55 from theano.compile import \\\n 56 SymbolicInput, In, \\\n 57 SymbolicOutput, Out, \\\n\n/Users/pksaha/anaconda/lib/python2.7/site-packages/theano/compile/__init__.py in &lt;module&gt;()\n----&gt; 1 from theano.compile.ops import (\n 2 DeepCopyOp, deep_copy_op, register_deep_copy_op_c_code,\n 3 Shape, shape, register_shape_c_code,\n 4 Shape_i, register_shape_i_c_code,\n 5 ViewOp, view_op, register_view_op_c_code, FromFunctionOp,\n\nImportError: cannot import name Shape\n</code></pre>\n\n<p>I am currently on the bleeding edge version of theano using the following command:</p>\n\n<pre><code>pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git\n</code></pre>\n", "Lable": "D"}
12
+ {"QuestionId": 26573426, "AnswerCount": 3, "Tags": "<java><xml><dom><jaxb>", "CreationDate": "2014-10-26T13:20:17.667", "AcceptedAnswerId": null, "Title": "CRUD on XML using Java", "Body": "<p>I am developing a java application and i am using XML to store the settings and other data in the application.I have read about Java preferences manager API but i felt storing in XML is more convenient in my application.I started usng JAXB first but then i dint find any tutorials to modify the XML once it is created.My application involves storing the Email account details of the users.As the user adds his accounts dynamically , i need to add them to XML as well.So i dint find JAXB convenient(or rather i dint find any tutorials to update or modify the XML ).The only other option i found was DOM parser here <a href=\"http://docs.oracle.com/javase/tutorial/jaxp/dom/readingXML.html\" rel=\"nofollow\">http://docs.oracle.com/javase/tutorial/jaxp/dom/readingXML.html</a> .But i feel it is too complicated for such a simple application.speed , memory etc doesnt matter to me.Are there any other alternatives to do this? </p>\n", "Lable": "No"}
13
+ {"QuestionId": 26583013, "AnswerCount": 1, "Tags": "<upload><progress-bar><typo3>", "CreationDate": "2014-10-27T07:46:24.030", "AcceptedAnswerId": null, "Title": "TYPO3 progress bar while uploading", "Body": "<p>is there any known solution to show a progress bar while uploading big files (5-15 MB) in TYPO3?\nThe plupload-Extension is not working in Version 6.2</p>\n\n<p>Somehow it should be possible in e.g. jQuery but I don't find a realistic way for that.</p>\n\n<p>Greatings, stefan</p>\n", "Lable": "No"}
14
+ {"QuestionId": 26599615, "AnswerCount": 1, "Tags": "<flipclock>", "CreationDate": "2014-10-28T01:41:27.477", "AcceptedAnswerId": null, "Title": "flipclock count up from a particular date", "Body": "<p>For instance, the given start time is 10/28/2014 08:00:00AM (server time). It will count up and show the hours minutes secs lapsed from the given start time? Is this possible with flipclock?</p>\n", "Lable": "No"}
oraclechunk37.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 26611062, "AnswerCount": 1, "Tags": "<mysql><linux><postgresql><ubuntu><database-migration>", "CreationDate": "2014-10-28T14:36:06.510", "AcceptedAnswerId": "26611590", "Title": "PostgreSQL to MySQL conversion of large tables", "Body": "<p>I need to convert a table from PostgreSQL to MySQL. The size of the table is <strong>5.2GB</strong>. I am doing it on workbench, but after some <strong>3minutes</strong> I am getting errors like below.</p>\n\n<p><strong>HY001:14:Out of memory in allocating item buffer.</strong></p>\n\n<p>I have tried changing <strong>innodb_log_file_size, innodb_log_buffer_size, query_cache_size, key_buffer_size</strong> and some other variables, but no go.</p>\n\n<p>Can someone help me in doing this. Is there is any other conversion tools to do this. It will be great if I solve the above error too.</p>\n", "Lable": "No"}
2
+ {"QuestionId": 26681557, "AnswerCount": 1, "Tags": "<ruby-on-rails><validation>", "CreationDate": "2014-10-31T18:52:36.330", "AcceptedAnswerId": "26681739", "Title": "Rails validation - inclusion", "Body": "<p>I am trying to add a validation to prevent the user from entering a url that does not include the word 'mywebsite' in it.</p>\n\n<pre><code>validates :url, inclusion: { in: %w(mywebsite), message: \"Must be a mywebsite.com subdomain\" }\n</code></pre>\n\n<p>The problem with the above code is that it will only accept 'mywebsite' as a valid argument, while I'd like it to accept any argument which includes the word mywebsite in it. Example: mywebsite.com/something</p>\n\n<p>How should I approach this?</p>\n", "Lable": "No"}
3
+ {"QuestionId": 26819262, "AnswerCount": 1, "Tags": "<java><android><webview><android-webview>", "CreationDate": "2014-11-08T16:19:51.487", "AcceptedAnswerId": null, "Title": "WebView falsely shows my \"no connection\"-page", "Body": "<p>I've made a WebView where it checks internet connection and if there is none it will display an error-page.</p>\n\n<p>It worked just fine until it recently when it would just display the error-page even though me having cellular data on, this persists even on WiFi's.</p>\n\n<pre><code>package se.welovecode.tismatapp;\n\nimport android.support.v7.app.ActionBarActivity;\nimport android.annotation.SuppressLint;\nimport android.os.Bundle;\nimport android.view.KeyEvent;\nimport android.view.Window;\nimport android.webkit.WebSettings;\nimport android.webkit.WebView;\nimport android.webkit.WebViewClient;\n\n@SuppressLint(\"SetJavaScriptEnabled\") public class MainActivity extends ActionBarActivity {\n\nWebView myWebView;\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.activity_main);\n final WebView myWebView = (WebView) findViewById(R.id.webview);\n myWebView.loadUrl(\"http://www.welovecode.se/t-matapp\");\n WebSettings webSettings = myWebView.getSettings();\n webSettings.setJavaScriptEnabled(true);\n myWebView.setWebViewClient(new WebViewClient() {\n public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {\n myWebView.loadUrl(\"file:///android_asset/index.html\");\n\n }\n });\n }\n\n@Override\npublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\n if (keyCode == KeyEvent.KEYCODE_BACK) {\n return false;\n }\n\n return super.onKeyDown(keyCode, event);\n}\n};\n</code></pre>\n", "Lable": "No"}
4
+ {"QuestionId": 26895470, "AnswerCount": 1, "Tags": "<crystal-reports>", "CreationDate": "2014-11-12T19:57:57.130", "AcceptedAnswerId": null, "Title": "Crystal Reports: Converting Selected Row Data to Column Data", "Body": "<p>Is it possible to transpose data for a select column in Crystal? Here is my issue... I am using ttx file to get data fields for the Crystal Report...</p>\n\n<p>I want only the tax_type and the tax_rate and tax amount to show up in the same row as the product sold. The tax_rate is stored in a separate table that needs to be pulled in as a column as well. I need to group and sum on product, buy, sell, tax_type, and then net the whole amount to come up with net total which I kinda know how... but I am stuck at transposing a row. Basically I only want to show row as column where tax type, amount, and rate matches transaction number and YN_tax == 1. The tax rate is stored in a totally separate table... Mind you that tax will not be applicable to each transaction... Here are the table Details</p>\n\n<p><strong>Details Table</strong>\n <pre>\n <b>Transaction Sales_Date buy_sell Product location ProductType price amount YN_tax tax_type</b>\n 123456 11/9/2014 Sell DEF Brazil trinkets 5 703.08<br>\n 123457 11/9/2014 Sell ABC Canada widget 10 213.5<br>\n 123458 11/9/2014 Buy DEF Brazil trinkets 2 630<br>\n 123459 11/9/2014 Buy DEF Brazil trinkets 3 34.41<br>\n 123457 11/9/2014 Sell ABC Canada SalesTax 3 688.2 1 SalesTax\n 123458 11/9/2014 Buy DEF Brazil FederalTax 2 132 1 FedTax\n </pre></p>\n\n<p><strong>Tax Rates Table</strong>\n <pre>\n <b>title rate</b>\n SalesTax 8.25\n FedTax 9.75\n </pre></p>\n", "Lable": "No"}
5
+ {"QuestionId": 26951445, "AnswerCount": 3, "Tags": "<python><python-3.x>", "CreationDate": "2014-11-15T22:25:29.787", "AcceptedAnswerId": "26951498", "Title": "Having issues exiting my while loop", "Body": "<p>I have been testing my code for the past few hours and I am stumped. This program takes a text file of names, turns the names into a list, prints the names, sorts the names, prints the sorted names, then allows you to search through the list. Everything seems to be working fine, but the one issue I have is exiting the while loop. If y or Y is selected you can search again, but that also happens if anything else is selected. I added a print statement outside the loop so if anything other than y is selected then the program should end with that last printed string, but it doesn't seem to be working. Does anyone have any ideas about why it isn't working and what I could change to get it to work?</p>\n\n<p>Thank you for your time.</p>\n\n<pre><code>#define the main function\ndef main():\n\n #create a variable to control the loop\n keep_going = 'y'\n\n #setup loop to search for name\n while keep_going == 'y' or keep_going == 'Y': \n\n #call input name function\n names = input_name()\n\n #call print name function\n print_name(names)\n\n #sort the printed list\n names.sort()\n\n #call the print name function\n print_name(names)\n\n #call the output name function\n output_name(names)\n\n #call the search name function\n search_name(names)\n\n #add user input for another search\n search_again = input('Would you like to make another search?(y for yes): ') \n\n #print if anything other than y or Y is selected\n print()\n print('Goodbye!')\n\n#define the input function \ndef input_name():\n\n #open the names.txt file\n infile = open('names.txt', 'r')\n\n #read contents into a list\n names = infile.readlines()\n\n #close the file\n infile.close()\n\n #strip the \\n from each element\n index = 0\n while index &lt; len(names):\n names[index] = names[index].rstrip('\\n')\n index += 1\n\n #return the list back to main function \n return names\n\n#define the print name function\ndef print_name(names):\n\n #print the contents of the list\n for name in names:\n print(name)\n\n#define the output name function\ndef output_name(names):\n\n #open file for writing\n outfile = open('sorted_names.txt', 'w')\n\n #write the list to the file\n for item in names:\n outfile.write(item + '\\n')\n\n #close the file\n outfile.close()\n\n #return to main function\n return\n\n#define the search name function\ndef search_name(names):\n\n #add a user input to search the file\n search = input('Enter a name: ')\n\n #determine whether the name is in the list\n if search in names:\n\n #get the names index\n name_index = names.index(search)\n\n #print the name was found and give the items index\n print(search, \"was found in list. This item's index is\", name_index) \n\n else:\n\n #print the item was not found\n print(search, 'was not found in the list.') \n\nmain() \n</code></pre>\n", "Lable": "No"}
6
+ {"QuestionId": 27096346, "AnswerCount": 1, "Tags": "<php><json>", "CreationDate": "2014-11-24T00:49:23.990", "AcceptedAnswerId": "27097033", "Title": "Getting value with array", "Body": "<p>I am struggling to get the value of an element in a particular array. I would like to get the value of the \"logo\" in this case to return \"Logo Google 2013 Official.svg\" from the code below. \nAny help is greatly appreciated.</p>\n\n<pre><code>&lt;html&gt;\n&lt;head&gt;\n&lt;/head&gt;\n&lt;body&gt;\n\n&lt;html&gt;\n\n&lt;body&gt;\n&lt;h2&gt;Search&lt;/h2&gt;\n&lt;form method=\"post\"&gt;\nSearch: &lt;input type=\"text\" name=\"q\" value=\"google\" /&gt;\n&lt;input type=\"submit\" value=\"Submit\"&gt;\n&lt;/form&gt;\n\n&lt;?php\n\nif (isset($_POST['q'])) {\n$search = $_POST['q'];\n\n\n$url_2 = \n\"http://en.wikipedia.org/w/api.php? \naction=query&amp;prop=revisions&amp;rvprop=content&amp;format=json&amp;titles=$search&amp;rvsection=0&amp;continue=\";\n$res_2 = file_get_contents($url_2);\n$data_2 = json_decode($res_2);\n\n\n?&gt;\n\n&lt;h2&gt;Search results for '&lt;?php echo $search; ?&gt;'&lt;/h2&gt;\n&lt;ol&gt;\n&lt;?php foreach ($data_2-&gt;query-&gt;pages as $r): \n\n?&gt;\n\n&lt;li&gt;\n\n&lt;?php foreach($r-&gt;revisions[0] as $a); \necho $a; ?&gt;\n\n&lt;/li&gt;\n&lt;?php endforeach; ?&gt;\n&lt;/ol&gt;\n\n&lt;?php \n}\n?&gt;\n\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<p>The resulting <code>$url_2</code> is <a href=\"http://en.wikipedia.org/w/api.php?action=query&amp;prop=revisions&amp;rvprop=content&amp;format=json&amp;titles=google&amp;rvsection=0&amp;continue=\" rel=\"nofollow\">http://en.wikipedia.org/w/api.php?action=query&amp;prop=revisions&amp;rvprop=content&amp;format=json&amp;titles=google&amp;rvsection=0&amp;continue=</a></p>\n", "Lable": "No"}
7
+ {"QuestionId": 27156138, "AnswerCount": 1, "Tags": "<java><swing><user-interface><label><logic>", "CreationDate": "2014-11-26T18:12:13.903", "AcceptedAnswerId": null, "Title": "Label will not update with the flow", "Body": "<p>I am working on this RPSGUI; everything works swell as far as logic is conserned, but I moved onto the final stage about a week or so ago and I have been stuck here every since. I cannot get my labels to update. So say the user won, the counter would go from 0 to 1, 2 etc. I have a lot of stuff commented out so you can see I have tried. I actually deleted several portions of what I was commenting out because I was getting confused, but yeah. I would also like for the gui to say what was played and am unsure about where to even begin with that :-/. I'm hoping someone could help me with this. It would mean a lot to me. </p>\n\n<p>Here is the program without the driver class. Nothing is in the driver class aside making it display. </p>\n\n<pre><code>import java.awt.Color;\nimport java.awt.GridLayout;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\nimport javax.swing.JButton;\nimport javax.swing.JLabel;\nimport javax.swing.JOptionPane;\nimport javax.swing.JPanel;\n\n\npublic class GamePanel extends JPanel{\n private JButton rockButton, paperButton, scissorsButton;\n private JLabel userLabel, computerLabel, resultLabel, winLabel, tieLabel, loseLabel;\n private int winInt, tieInt, loseInt = 0;\n private String rockButtonText = \"Rock\";\n private String paperButtonText = \"Paper\";\n private String scissorsButtonText = \"Scissors\";\n private JPanel buttonPanel, labelPanel, resultPanel;\n public int computerInt;\n\n String[] attackArray = {\"Rock\", \"Paper\", \"Scissors\"};\n\n public GamePanel(){\n String[] attackArray = {\"Rock\", \"Paper\", \"Scissors\"};\n\n setLayout(new GridLayout(5,3));\n\n setBackground(Color.white.brighter());\n setForeground(Color.ORANGE.darker());\n\n //make the buttons\n JButton rockButton = new JButton(rockButtonText);\n JButton paperButton = new JButton(paperButtonText);\n JButton scissorsButton = new JButton(scissorsButtonText);\n\n //style the buttons\n rockButton.setBackground(Color.orange);\n rockButton.setForeground(Color.black.darker());\n paperButton.setBackground(Color.orange);\n paperButton.setForeground(Color.black.darker());\n scissorsButton.setBackground(Color.orange);\n scissorsButton.setForeground(Color.black.darker());\n\n //add labels\n JLabel userLabel = new JLabel(\"User:\");\n JLabel computerLabel = new JLabel(\"Computer:\");\n JLabel winLabel = new JLabel(\"Win: \" + winInt);\n JLabel tieLabel = new JLabel(\"Tie: \" + tieInt);\n JLabel loseLabel = new JLabel(\"Lose:\" + loseInt);\n\n //style Labels\n userLabel.setBackground(Color.orange);\n userLabel.setForeground(Color.black.darker());\n computerLabel.setBackground(Color.orange);\n computerLabel.setForeground(Color.black.darker()); \n winLabel.setBackground(Color.orange);\n winLabel.setForeground(Color.black.darker()); \n tieLabel.setBackground(Color.orange);\n tieLabel.setForeground(Color.black.darker()); \n loseLabel.setBackground(Color.orange);\n loseLabel.setForeground(Color.black.darker());\n\n\n //add buttons to panel\n add(rockButton);\n //add(Box.createRigidArea(new Dimension (0,10)));\n add(paperButton);\n //add(Box.createRigidArea(new Dimension (0,10)));\n add(scissorsButton);\n //add(Box.createRigidArea(new Dimension (0,10)));\n\n\n add(userLabel);\n //add(Box.createRigidArea(new Dimension (0,10)));\n add(computerLabel);\n //add(Box.createRigidArea(new Dimension (0,10)));\n\n\n add(winLabel);\n //add(Box.createRigidArea(new Dimension (0,10)));\n add(tieLabel);\n //add(Box.createRigidArea(new Dimension (0,10)));\n add(loseLabel);\n //add(Box.createRigidArea(new Dimension (0,10)));\n\n\n // add action listeners\n rockButton.addActionListener(new ButtonListener());\n paperButton.addActionListener(new ButtonListener());\n scissorsButton.addActionListener(new ButtonListener());\n\n\n }\n private class ButtonListener implements ActionListener {\n public void actionPerformed(ActionEvent ae){\n int computerSourceAI = (int) (Math.random() * 2); //random generator\n\n String oppChoice = attackArray[computerSourceAI]; // the choice of your opponent \n\n String yourChoice = ((JButton) ae.getSource()).getText(); // casts source from object to button and gets the text\n\n\n\n int outcome = determineWinner(yourChoice, oppChoice);\n\n // 0 = tie\n //1 == win\n //2 = lose\n\n if (outcome == 1) \n {\n\n // win message \n //System.out.println(\"You win!\");\n winLabel.setText(\"You Won\" + winInt++);\n }\n\n else if (outcome == 0)\n {\n\n // tie message\n //System.out.println(\"Tie\");\n tieLabel.setText(\"You tied\" + tieInt++);\n\n\n }\n\n else\n {\n loseLabel.setText(\"You lose\" + loseInt++);\n }\n\n\n }\n }\n\n\n\n public int determineWinner(String you, String opponent)\n{\n\n if(you.equals(\"Rock\") &amp;&amp; (opponent.equals(\"Rock\"))){\n //tieInt++;\n tieLabel.setText(\"You tied\" + tieInt++);\n return tieInt++;\n }else if(you.equals(\"Rock\") &amp;&amp; (opponent.equals(\"Rock\"))){\n //tieInt++;\n tieLabel.setText(\"You tied\" + tieInt++);\n return tieInt++;\n }else if(you.equals(\"Scissors\") &amp;&amp; (opponent.equals(\"Scissors\"))){\n //tieInt++;\n tieLabel.setText(\"You tied\" + tieInt++);\n return tieInt++;\n }else if(you.equals(\"Rock\") &amp;&amp; (opponent.equals(\"Scissors\"))){\n //winInt++;\n winLabel.setText(\"You Won\" + winInt++);\n return winInt++; \n }else if(you.equals(\"Paper\") &amp;&amp; (opponent.equals(\"Rock\"))){\n //winInt++;\n //return 1;\n winLabel.setText(\"You Won\" + winInt++);\n return winInt++;\n }else if(you.equals(\"Scissors\") &amp;&amp; (opponent.equals(\"Paper\"))){\n //winInt++;\n //return 1;\n winLabel.setText(\"You Won\" + winInt++);\n return winInt++;\n }else if(you.equals(\"Scissors\") &amp;&amp; (opponent.equals(\"Rock\"))){\n //loseInt++;\n //return -1;\n loseLabel.setText(\"You lose\" + loseInt++);\n return loseInt++;\n }else if(you.equals(\"Rock\") &amp;&amp; (opponent.equals(\"Paper\"))){\n //loseInt++;\n //return -1;\n loseLabel.setText(\"You lose\" + loseInt++);\n return loseInt++;\n }else \n if(you.equals(\"Paper\") &amp;&amp; (opponent.equals(\"Scissors\"))){\n //loseInt++;\n //return -1;\n loseLabel.setText(\"You lose\" + loseInt++);\n return loseInt++;\n }\n return 0;\n\n\n}\n</code></pre>\n", "Lable": "No"}
8
+ {"QuestionId": 27245101, "AnswerCount": 2, "Tags": "<sql><postgresql>", "CreationDate": "2014-12-02T08:38:46.060", "AcceptedAnswerId": "27245234", "Title": "Why should we use rollback in sql explicitly?", "Body": "<p>I'm using PostgreSQL 9.3</p>\n\n<p>I have one misunderstanding about transactions and how they work. Suppose we wrapped some SQL operator within a transaction like the following:</p>\n\n<pre><code>BEGIN;\n insert into tbl (name, val) VALUES('John', 'Doe');\n insert into tbl (name, val) VALUES('John', 'Doee');\nCOMMIT;\n</code></pre>\n\n<p>If something goes wrong the transaction will automatically be rolled back. Taking that into account I can't get when should we use ROLLBACK explicitly? Could you get an example when it's necessary?</p>\n", "Lable": "No"}
9
+ {"QuestionId": 27328787, "AnswerCount": 0, "Tags": "<python><cryptography><memoization><exponentiation><charm-crypto>", "CreationDate": "2014-12-06T05:53:53.360", "AcceptedAnswerId": null, "Title": "Big List Python for Charm-Crypto group element", "Body": "<p>While working with Charm-Crypto package, I need to do lots and lots of group element exponentiation. The group elements come from bi-linear pairing group. The Order of the group element is a 1024 bit integer. So to reduce the average cost of exponentiation, I wanted to use memoization.</p>\n\n<p>But I came to know that List does not support long indices (which I need very much). So I went for dictionary which is taking a lot of time &amp; space.</p>\n\n<p>Could you suggest some other methods/data structure in python to reduce the exponentiation cost. I am using iterative square-multiply technique to do the exponentiation.</p>\n", "Lable": "No"}
10
+ {"QuestionId": 27348862, "AnswerCount": 1, "Tags": "<php><wordpress><loops><woocommerce>", "CreationDate": "2014-12-07T22:55:37.930", "AcceptedAnswerId": "29567016", "Title": "Loop Through product subcategories (WOOCOMMERCE) and return the price of the cheapest product", "Body": "<p>In Woo-commerce the default shop page can be set to show the products by their categories. When doing so it lists their thumbnail/title/link/how many products are available. </p>\n\n<p>It does not however show price.</p>\n\n<p>The goal is to list out the product categories and list the starting price of their products. For example: Category-1 starts at $9.99 (category-1 cheapest products is 9.99) </p>\n\n<p>Tips/tricks/ideas would all be appreciated </p>\n\n<p>Below is the default template that is used for that page:</p>\n\n<pre><code>&lt;?php\n/**\n * The template for displaying product category thumbnails within loops.\n * Override this template by copying it to yourtheme/woocommerce/content-product_cat.php\n */\n\nif ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly\n\nglobal $woocommerce_loop;\n\n// Store loop count we're currently on\nif ( empty( $woocommerce_loop['loop'] ) )\n $woocommerce_loop['loop'] = 0;\n\n// Store column count for displaying the grid\nif ( empty( $woocommerce_loop['columns'] ) )\n $woocommerce_loop['columns'] = apply_filters( 'loop_shop_columns', 4 );\n\n// Increase loop count\n$woocommerce_loop['loop']++;\n?&gt;\n&lt;li class=\"product-category product&lt;?php\n if ( ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] == 0 || $woocommerce_loop['columns'] == 1 )\n echo ' first';\n if ( $woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0 )\n echo ' last';\n ?&gt;\"&gt;\n\n &lt;?php do_action( 'woocommerce_before_subcategory', $category ); ?&gt;\n\n &lt;a href=\"&lt;?php echo get_term_link( $category-&gt;slug, 'product_cat' ); ?&gt;\"&gt;\n\n &lt;?php\n /**\n * woocommerce_before_subcategory_title hook\n *\n * @hooked woocommerce_subcategory_thumbnail - 10\n */\n do_action( 'woocommerce_before_subcategory_title', $category );\n ?&gt;\n\n &lt;h3&gt;\n &lt;?php\n echo $category-&gt;name;\n\n if ( $category-&gt;count &gt; 0 )\n echo apply_filters( 'woocommerce_subcategory_count_html', ' &lt;mark class=\"count\"&gt;(' . $category-&gt;count . ')&lt;/mark&gt;', $category );\n ?&gt;\n &lt;/h3&gt;\n\n &lt;?php\n /**\n * woocommerce_after_subcategory_title hook\n */\n do_action( 'woocommerce_after_subcategory_title', $category );\n ?&gt;\n\n &lt;/a&gt;\n\n &lt;?php do_action( 'woocommerce_after_subcategory', $category ); ?&gt;\n\n&lt;/li&gt;\n</code></pre>\n", "Lable": "No"}
11
+ {"QuestionId": 27364186, "AnswerCount": 1, "Tags": "<javascript><jquery>", "CreationDate": "2014-12-08T18:11:00.623", "AcceptedAnswerId": "29889941", "Title": "Getting decent sized pictures using the rottentomatoes API", "Body": "<p>I am using the rotten tomatoes API, which is fairly straight forward. The following is my basic code:</p>\n\n<pre><code>var apikey = \"xxxxx\";\n\nfunction queryForMovie(query) {\n queryUrl = \"http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=\" + apikey + \"&amp;q=\" + encodeURI(query);\n $.ajax({\n url: queryUrl,\n dataType: \"jsonp\",\n success: queryCallback\n });\n}\n\nfunction queryCallback(data) {\n var el = $('#movie-listings');\n $.each(data.movies, function(index, movie) {\n el.append('img src=\"' + movie.posters.original + '\" alt=\"' + movie.title + '\"');\n })\n};\n\n$(document).on(\"load\", queryForMovie(\"Star Wars\"));\n</code></pre>\n\n<p>However, this gives back a very small image.</p>\n\n<p>What would be a good way to get a larger sized image, while limiting requests where possible? </p>\n", "Lable": "No"}
oraclechunk38.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 27385501, "AnswerCount": 1, "Tags": "<jquery><forms><radio-button>", "CreationDate": "2014-12-09T17:51:33.053", "AcceptedAnswerId": null, "Title": "Display form fields if radio button is selected on page load or on click", "Body": "<p>I am trying to get specific form fields to show if a particular radio button is selected on page load OR if it is clicked on. I've been messing with this for a few hours and this is the closest that I have gotten. Right now it's running the entire showForm function no matter what. I switched out <code>input[type='radio']</code> with <code>$(this)</code> but <code>$(this)</code> means nothing so that obviously didn't work (<a href=\"http://jsfiddle.net/kkyow7a1/16/\" rel=\"nofollow\">here's the JS fiddle for that.</a> The form works with it on click but not the displaying of the form on page load). I also took all of this out of the <code>showForm</code> function and tried to <code>trigger.click()</code>like this</p>\n\n<pre><code>if ($(\"input[type='radio']\").is(':checked')){\n $(this).trigger('click'); \n}\n</code></pre>\n\n<p>but that didn't work either. </p>\n\n<p>Here's the JS:</p>\n\n<pre><code>$(document).ready(function() {\n$(\".currentForm, .address, .trust, .individual\").hide();\n\nif ($(\"input[type='radio']\").is(':checked')){\n showForm(); \n}\n\n $(\"input[type='radio']\").click(showForm); \n\nfunction showForm(){ \n if($(\"input[type='radio']\").attr('name') == 'enterAddress' &amp;&amp; $(this).attr('value') == 'true') {\n $('.address').slideDown( \"slow\", function() {}); \n } \n else{\n $('.address').slideUp( \"slow\", function() {}); \n }\n\n //Individual\n if($(\"input[type='radio']\").attr('id') == 'nameType1') {\n $('.currentForm, .address, .trust, .business').hide(); \n $('.individual, .currentForm').slideDown( \"slow\", function() {}); \n $('#enterAddress1').attr('checked', false);\n $('#enterAddress2').attr('checked', true); \n } \n //Trust\n else if($(\"input[type='radio']\").attr('id') == 'nameType2'){\n $('.currentForm, .address, .individual, .business').hide();\n $('.trust, .currentForm').slideDown( \"slow\", function() {});\n $('#enterAddress1').attr('checked', false);\n $('#enterAddress2').attr('checked', true);\n }\n //Business\n else if($(\"input[type='radio']\").attr('id') == 'nameType3'){\n $('.currentForm, .address, .individual, .trust').hide();\n $('.business, .currentForm').slideDown( \"slow\", function() {});\n $('#enterAddress1').attr('checked', false);\n $('#enterAddress2').attr('checked', true);\n }\n}// end showForm \n});\n</code></pre>\n\n<p><a href=\"http://jsfiddle.net/kkyow7a1/15/\" rel=\"nofollow\">Here is the current jsFiddle</a></p>\n", "Lable": "No"}
2
+ {"QuestionId": 27393472, "AnswerCount": 1, "Tags": "<ios><objective-c><uialertview>", "CreationDate": "2014-12-10T04:41:22.753", "AcceptedAnswerId": null, "Title": "UIAlertView ios8 only showing a line for keyboard", "Body": "<p><strong>Problem:</strong></p>\n\n<p><code>UIAlertView</code> in iOS8 only showing a line for keyboard</p>\n\n<p>Here is my <strong>Code:</strong> </p>\n\n<pre><code>-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{\n\n UITextField *txtName = nil;\n\n if(buttonIndex == 1){ // save project name\n txtName = (UITextField *)[alertView textFieldAtIndex:0];\n\n if(txtName &amp;&amp; txtName.text &amp;&amp; [txtName.text length] &gt; 0 &amp;&amp; ![txtName.text isEqualToString:@\" \"]) {\n\n //SPAppDelegate *appdelegate = (SPAppDelegate*)[[UIApplication sharedApplication] delegate];\n NSString *filePath = nil;\n\n //if(![appdelegate isProjectNameAlreadyExist:txtName.text]){\n if(![SPUtility isProjectNameAlreadyExist:txtName.text]){\n //filePath = [appdelegate getProjectPathWthName:txtName.text];\n filePath = [SPUtility getProjectPathWthName:txtName.text];\n [self loadProjectList];\n }\n else{\n [[[UIAlertView alloc] initWithTitle:@\"Error\" message:@\"Project name already exists.\" delegate:nil cancelButtonTitle:@\"OK\" otherButtonTitles:nil] show];\n }\n }\n else{\n [[[UIAlertView alloc] initWithTitle:@\"Error\" message:@\"Project name is empty.\" delegate:nil cancelButtonTitle:@\"OK\" otherButtonTitles:nil] show];\n }\n }\n}\n</code></pre>\n\n<p>The problem must be happening somewhere here***</p>\n\n<pre><code>-(void) launchProjectNameInputAlert{\n\n /*_alertView = nil;\n\n _alertView = [[UIAlertView alloc] initWithTitle:@\"test\" message:@\"test1\" delegate:nil cancelButtonTitle:@\"OK\" otherButtonTitles:nil];\n\n [_alertView show];*/\n\n _isShowAlert = YES; //boolean variable\n\n //_alertView =[[UIAlertView alloc] initWithTitle:@\"ADD item\" message:@\"Put it blank textfield will cover this\" delegate:self cancelButtonTitle:@\"Cancel\" otherButtonTitles:@\"OK\", nil];\n UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@\" \" message:@\" \" delegate:self cancelButtonTitle:@\"Cancel\" otherButtonTitles:@\"OK\", nil];\n\n alertView.alertViewStyle = UIAlertViewStylePlainTextInput;\n\n UITextField *txtName = [alertView textFieldAtIndex:0];\n txtName.text=@\"\";\n //txtName.tag = 1000;\n //[txtName setBackgroundColor:[UIColor blackColor]];\n [txtName setKeyboardAppearance:UIKeyboardAppearanceAlert];\n [txtName setAutocorrectionType:UITextAutocorrectionTypeNo];\n [txtName setTextAlignment:NSTextAlignmentLeft];\n txtName.placeholder = @\"Project Name\";\n [alertView addSubview:txtName];\n [alertView show];\n\n}\n</code></pre>\n\n<p>Can someone please check it out? </p>\n\n<p>Here is a link of the <strong><a href=\"http://i.stack.imgur.com/kksW5.png\" rel=\"nofollow\">Image</a></strong> for reference.</p>\n", "Lable": "No"}
3
+ {"QuestionId": 27622732, "AnswerCount": 1, "Tags": "<c><valgrind><assertion>", "CreationDate": "2014-12-23T14:52:44.033", "AcceptedAnswerId": null, "Title": "malloc.c:3096: sYSMALLOc: Assertion Error using pointers", "Body": "<p>I'm getting </p>\n\n<pre><code> malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &amp;((av)-&gt;bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) &amp;&amp; old_size == 0) || ((unsigned long) ( old_size) &gt;= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) &amp; ~((2 * (sizeof(size_t))) - 1))) &amp;&amp; ((old_top)-&gt;size &amp; 0x1) &amp;&amp; ((unsigned long)old_end &amp; pagemask) == 0)' failed.\n Aborted\n</code></pre>\n\n<p>Error, I ran valgrind and received </p>\n\n<pre><code> ==8595==\n ==8595== HEAP SUMMARY:\n ==8595== in use at exit: 0 bytes in 0 blocks\n ==8595== total heap usage: 49 allocs, 49 frees, 7,204 bytes allocated\n ==8595==\n ==8595== All heap blocks were freed -- no leaks are possible\n ==8595==\n ==8595== For counts of detected and suppressed errors, rerun with: -v\n ==8595== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 25 from 6)\n</code></pre>\n\n<p>which left me confused. The code I believe is causing the problem is:</p>\n\n<pre><code> int asn1_encoder(char *bufff[]){\n\n char av[20];\n\n\n char boibuff[] = {0x01, 0x00, 0x00, 0x01};\n\n char propbuff[] = {0x01};\n \\\\BACnetConfirmedServiceChoice and BACnetConfirmedServiceRequest types have been ommitted\n long int arb = 0;\n long int arb1 = 0;\n BACnet_Confirmed_Request_PDU_t *bacnetConfirmedPDU;\n int i = 0;\n BACnet_Confirmed_Service_Request_t *service_request;\n BACnetConfirmedServiceChoice_t *service_choice;\n WriteProperty_Request_t *writeProperty;\n BACnetObjectIdentifier_t *objectIdentifier;\n BACnetPropertyIdentifier_t *propertyIdentifier;\n asn_enc_rval_t ec;\n\n sprintf(av,\"test.bin\");\n\n\n\n\n\n bacnetConfirmedPDU = calloc(1, sizeof(BACnet_Confirmed_Request_PDU_t)); //PDU-TYPE deff\n\n bacnetConfirmedPDU -&gt; service_request = calloc(1, sizeof(BACnet_Confirmed_Service_Request_t));\n\n objectIdentifier = calloc(1, sizeof(BACnetObjectIdentifier_t));\n service_choice = calloc(1, sizeof(BACnetConfirmedServiceChoice_t)); //Select Service deff\n\n writeProperty = calloc(1, sizeof(WriteProperty_Request_t)); //Encoded service deff\n\n bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.objectIdentifier.buf = calloc(1, sizeof(BACnetObjectIdentifier_t));\n\n propertyIdentifier = calloc(1, sizeof(BACnetPropertyIdentifier_t));\n\n\n if(!bacnetConfirmedPDU){\n perror(\"calloc() failed\");\n exit(1);\n }\n\n bacnetConfirmedPDU -&gt; pdu_type = 1;\n\n bacnetConfirmedPDU -&gt; service_choice = BACnetConfirmedServiceChoice_writeProperty;\n printf(\"the value in service_choice struct is %d\\n\", bacnetConfirmedPDU-&gt;service_choice);\n\n\n bacnetConfirmedPDU -&gt; service_request -&gt; present = BACnet_Confirmed_Service_Request_PR_writeProperty;\n bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.objectIdentifier.buf = boibuff; // BACnetObjectType_binary_output; //boibuff;\n\n\n bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.objectIdentifier.size = 4;\n printf(\"boi is %02x\\n\",bacnetConfirmedPDU -&gt; service_request -&gt;choice.writeProperty.objectIdentifier.buf[1]);\n\n bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.propertyIdentifier = BACnetPropertyIdentifier_present_value;\n\n printf(\"property ident = %d\\n\", bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.propertyIdentifier);\n //bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.propertyArrayIndex = arb1;\n //printf(\"the value in proper array is %lu\\n\",bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.propertyArrayIndex);\n printf(\"sef fault before propbuff\\n\");\n bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.propertyValue.buf = propbuff;\n\n bacnetConfirmedPDU -&gt; service_request -&gt; choice.writeProperty.propertyValue.size = sizeof(propbuff);\n\n\n\n //define port\n\n\n FILE *fp = fopen(av, \"wb+\");\n if(fp == NULL){\n printf(\"fp is null\\n\");\n }\n\n if(!fp){\n perror(av);\n exit(1);\n }\n\n ec = der_encode(&amp;asn_DEF_BACnet_Confirmed_Request_PDU, bacnetConfirmedPDU, write_out, fp);\n\n if(fp == NULL)\n {\n printf(\"fp null\\n\");\n }\n\n if(!fp){\n perror(av);\n exit(1);\n }\n\n ec = der_encode(&amp;asn_DEF_BACnet_Confirmed_Request_PDU, bacnetConfirmedPDU, write_out, fp);\n\n if(fp == NULL)\n {\n printf(\"fp null\\n\");\n\n }\n\n printf(\"the file is closed\\n\");\n int end = fseek(fp, 0, SEEK_END);\n end = ftell(fp);\n fseek(fp, 0, SEEK_SET);\n printf(\"fseek is happening\\n\");\n //int end = ftell(fp);\n if(fp == NULL)\n {\n printf(\"*******************bufff is null***************************\\n\");\n }\n\n printf(\"end equals %d\\n\", end);\n //printf(\"just before fgetc\\n\");\n //for(i = 0; i&lt;= 35 ; i++)\n for(i = 0; i &lt; end; i++)\n {\n\n if(feof(fp)){\n printf(\"we're a broken family\\n\");\n break;\n }\n if(i&gt; maxlen){\n printf(\" buff is full\\n\");\n break;\n }\n }\n\n }\n\n fclose(fp);\n if(ec.encoded == -1){\n fprintf(stderr, \"could not encode ConfirmedRequest_PDU at (%s)\\n\",\n ec.failed_type ? ec.failed_type -&gt; name : \"unknown\");\n exit(1);\n }else{\n fprintf(stderr, \"Created %s with BER encoded ConfirmedRequestPDU\\n\", av);\n }\n\n xer_fprint(stdout, &amp;asn_DEF_BACnet_Confirmed_Request_PDU, bacnetConfirmedPDU);\n\n free(bacnetConfirmedPDU);\n free(bacnetConfirmedPDU -&gt; service_request);\n return i;\n }\n</code></pre>\n\n<p>I cant identify where the issue is caused, I have tried freeing all the variables that I calloc-ed. however, all those sturctures are members of bacnetConfirmedPDU, so, by this, shouldn't freeing just bacnetConfirmedPDU be enough? also, the line: </p>\n\n<pre><code> free((bacnetConfirmedPDU -&gt; service_request);\n</code></pre>\n\n<p>is a little worry-sum as it could be a double free? My question is, what other options are there for checking for memory leaks and bound violations other than valgrind? also, is there anything glaringly obvious that could cause an assertion error? Any suggestions are greatly appreciated, also, if anyone does have error detection suggestions, an example would also be greatly appreciated. Thanks </p>\n", "Lable": "No"}
4
+ {"QuestionId": 27639522, "AnswerCount": 2, "Tags": "<c#><.net><oauth-2.0><dotnetopenauth>", "CreationDate": "2014-12-24T16:08:48.297", "AcceptedAnswerId": null, "Title": "DotNetOpenAuth OAuth2 Accessing Extra Data", "Body": "<p>I'm using DotNetOpenAuth's OAuth2 library to handle authorization with another third party system. It all works great, except that the third party system is returning the UserId=\"testname\" in the Response with the AccessToken.</p>\n\n<p>I need that UserId because this third party API requires it as part of their API calls (ex: users/{userId}/account).</p>\n\n<p>Using DotNetOpenAuth, I don't have access to the AccessToken response so I can't get the UserId out.</p>\n\n<p>I'm calling: (_client is a WebServerClient)\nvar state = _client.ProcessUserAuthorization(request);</p>\n\n<p>state has my AccessToken, but not the extra data sent down. Based on the DotNetOpenAuth source code the UserId came in inside the library and I don't have any access.</p>\n\n<p>Is there anyway to get that UserId out using DotNetOpenAuth? Or do I need to abandon DotNetOpenAuth and try something else?</p>\n", "Lable": "No"}
5
+ {"QuestionId": 27643654, "AnswerCount": 2, "Tags": "<php><jquery><ajax>", "CreationDate": "2014-12-25T01:55:29.890", "AcceptedAnswerId": "27643666", "Title": "best way to make an ajax call to a PHP script, and have the reponse data opened in a new window.", "Body": "<p>I am trying to implement a feature in my webapp to let user click a button and see a \"status report\" of something. The status report is quite large hence I want to have it on a separate page. I am trying to think of a way to make an Ajax call to a PHP script and have the response data displayed nicely on another window. Is there a way to do that? I am new to web dev and any help would be appreciated. Thanks</p>\n", "Lable": "No"}
6
+ {"QuestionId": 27881802, "AnswerCount": 1, "Tags": "<html><twitter-bootstrap><responsive-design><axure>", "CreationDate": "2015-01-10T22:16:49.323", "AcceptedAnswerId": null, "Title": "generate html in axure. adaptive views without js", "Body": "<p>I created a simple page with Axure in 2 versions (basically 2 adaptive views: base and 768 and below). When I generate the html, it works fine and follows the adaptive views. But this seems to work only with javascript, is there a way to deal with/generate the adaptive views in css? This could help me later on integrating the Axure generated html and css into my responsive design based on bootstrap. Thank you.</p>\n", "Lable": "No"}
7
+ {"QuestionId": 27890274, "AnswerCount": 1, "Tags": "<javascript><html>", "CreationDate": "2015-01-11T18:00:00.217", "AcceptedAnswerId": "27890384", "Title": "Js: create html element that inherits from some js class", "Body": "<p>I have js class (if js supports classes is offtopic for this question):</p>\n\n<pre><code>var MyClass=function(){\n....\n}\n\nMyClass.prototype.someMethod=function(){\n...\n}\n</code></pre>\n\n<p>I want to create html element (for example div) that will inherit MyClass. For example for custom elements I could use the following:</p>\n\n<pre><code> var SimpleTableClass = document.registerElement('simple-table',{prototype: new MyClass()});\n simpleTable=new SimpleTableClass();\n</code></pre>\n\n<p>The only idea I have is:</p>\n\n<pre><code>var newDiv = document.createElement(\"div\");\nnewDiv.prototype=new MyClass();\n</code></pre>\n\n<p>But I don't know if it's safe method, because I will override all html element prototype.</p>\n\n<p>If it's possible I'd like to get not only html element but and its constructor (class) as in example with SimpleTableClass.</p>\n", "Lable": "No"}
8
+ {"QuestionId": 27905269, "AnswerCount": 4, "Tags": "<python><pandas><dataframe>", "CreationDate": "2015-01-12T15:21:25.367", "AcceptedAnswerId": "27919680", "Title": "Pandas rolling sum, variating length", "Body": "<p>I will try and explain the problem I am currently having concerning cumulative sums on DataFrames in Python, and hopefully you'll grasp it!</p>\n\n<p>Given a pandas DataFrame <code>df</code> with a column <code>returns</code> as such:</p>\n\n<pre><code> returns\nDate \n2014-12-10 0.0000\n2014-12-11 0.0200\n2014-12-12 0.0500\n2014-12-15 -0.0200\n2014-12-16 0.0000\n</code></pre>\n\n<p>Applying a cumulative sum on this DataFrame is easy, just using e.g. <code>df.cumsum()</code>. But is it possible to apply a cumulative sum every <code>X</code> days (or data points) say, yielding only the cumulative sum of the last <code>Y</code> days (data points).</p>\n\n<p>Clarification: Given daily data as above, how do I get the accumulated sum of the last <code>Y</code> days, re-evaluated (from zero) every <code>X</code> days?</p>\n\n<p>Hope its clear enough,</p>\n\n<p>Thanks,\nN</p>\n", "Lable": "No"}
9
+ {"QuestionId": 28009257, "AnswerCount": 0, "Tags": "<asp.net-mvc><signalr><ninject><authorize>", "CreationDate": "2015-01-18T11:38:02.113", "AcceptedAnswerId": null, "Title": "Ninject dependency injection in SignalR custom authorize attribute", "Body": "<p>I have an ASP.NET MVC5 application with SignalR and Ninject for dependency injection.\nI have a custom authorize attribute for both the web request and the signalr hub request. </p>\n\n<p>I made the following class for the web:</p>\n\n<pre><code>public class MyWebAuthorizeAttribute : AuthorizeAttribute // (System.Web.Mvc.AuthorizeAttribute)\n{\n [Inject]\n public IMyService MyService { get; set; } \n\n protected override bool AuthorizeCore(HttpContextBase httpContext)\n {\n var id = int.Parse((httpContext.Handler as MvcHandler).RequestContext.RouteData.Values[\"id\"].ToString());\n if (!MyService.Exists(id)) \n return false;\n return base.AuthorizeCore(httpContext);\n }\n}\n</code></pre>\n\n<p>And the following for SignalR:</p>\n\n<pre><code>public class MySignalRAuthorizeAttribute : AuthorizeAttribute // (Microsoft.AspNet.SignalR.AuthorizeAttribute)\n{\n [Inject]\n public IMyService MyService { get; set; } \n\n public override bool AuthorizeHubConnection(HubDescriptor hubDescriptor, IRequest request)\n {\n var id = int.Parse(request.QueryString[\"id\"]);\n if (!MyService.Exists(id))\n return false;\n return base.AuthorizeHubConnection(hubDescriptor, request);\n }\n}\n</code></pre>\n\n<p>Ninject bindings in the Startup class:</p>\n\n<pre><code>var kernel = new StandardKernel();\nvar resolver = new NinjectSignalRDependencyResolver(kernel);\nkernel.Bind&lt;IMyService&gt;().To&lt;MyService&gt;().InSingletonScope();\nvar config = new HubConfiguration();\nconfig.Resolver = resolver;\napp.MapSignalR(config);\n</code></pre>\n\n<p>The problem is that the service is not being injected in MySignalRAuthorizeAttribute, though in MyWebAuthorizeAttribute the service is properly being injected.</p>\n\n<p>Any idea what I am missing to get this working?</p>\n\n<p><strong>Edit:</strong>\nFound a way to get it more or less working.</p>\n\n<p>In the startup class I had to add this:</p>\n\n<pre><code>GlobalHost.DependencyResolver = resolver;\n</code></pre>\n\n<p>And then in MySignalRAuthorizeAttribute I could get the service like this:</p>\n\n<pre><code>MyService = GlobalHost.DependencyResolver.Resolve&lt;IMyService&gt;();\n</code></pre>\n\n<p>This works but I'd still prefer to simply get the service injected with the [Inject] attribute.</p>\n", "Lable": "No"}
10
+ {"QuestionId": 28056273, "AnswerCount": 2, "Tags": "<bash><shell>", "CreationDate": "2015-01-20T22:26:16.593", "AcceptedAnswerId": "28056642", "Title": "shell programming - counting words from multiple files", "Body": "<p>Need some help in shell programming.</p>\n\n<p>I need to write a shell script which accepts multiple text file as arguments and count the word occurrences from all of them.</p>\n\n<p>For Eg file1.txt contains text </p>\n\n<pre><code>mary had a little lamb. His fleece was white as a snow. And everywhere that mary went.\n</code></pre>\n\n<p>and file2.txt contains </p>\n\n<pre><code>Mary had a little lamb. Hello How are you\n</code></pre>\n\n<p>So the script should give the output like</p>\n\n<pre><code>Mary 2\nHad 2\na 2\nwhite 1\n.\n.\n.\n</code></pre>\n\n<p>Thanks in advance</p>\n", "Lable": "No"}
11
+ {"QuestionId": 28121290, "AnswerCount": 1, "Tags": "<c><linux><multithreading><gcc><c11>", "CreationDate": "2015-01-24T01:21:14.627", "AcceptedAnswerId": null, "Title": "Is this behavior (apparently an out of thin air store) forbidden by C11?", "Body": "<p>Is the behavior mentioned the <a href=\"http://lwn.net/Articles/478657/\" rel=\"nofollow\">LWN article \u201cBetrayed by a bitfield\u201d</a> forbidden by C11? Assume that <code>spinlock_t</code> is a type referring to a struct which is accessed only through means of C11 atomic primitives on its members (Actually it uses Linux (the kernel) memory barriers, but assume it doesn't so that it isn't undefined because of using an implementation-specific interface). In addition to the question in the title, is it an example of an \u201cout of thin air store\u201d?.</p>\n\n<p>Thanks in advance.</p>\n", "Lable": "No"}
oraclechunk39.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 28195751, "AnswerCount": 2, "Tags": "<python><iteration>", "CreationDate": "2015-01-28T15:15:16.637", "AcceptedAnswerId": "28197758", "Title": "Path-finding efficiency in Python", "Body": "<p>I have written some code that finds all the paths upstream of a given reach in a dendritic stream network. As an example, if I represent the following network:</p>\n\n<pre><code> 4 -- 5 -- 8\n / \n 2 --- 6 - 9 -- 10\n / \\ \n 1 -- 11\n \\\n 3 ----7\n</code></pre>\n\n<p>as a set of parent-child pairs:</p>\n\n<pre><code>{(11, 9), (10, 9), (9, 6), (6, 2), (8, 5), (5, 4), (4, 2), (2, 1), (3, 1), (7, 3)}\n</code></pre>\n\n<p>it will return all of the paths upstream of a node, for instance:</p>\n\n<pre><code>get_paths(h, 1) # edited, had 11 instead of 1 in before\n[[Reach(2), Reach(6), Reach(9), Reach(11)], [Reach(2), Reach(6), Reach(9), Reach(10)], [Reach(2), Reach(4), Reach(5), Reach(8)], [Reach(3), Reach(7)]]\n</code></pre>\n\n<p>The code is included below.</p>\n\n<p>My question is: I am applying this to every reach in a very large (e.g., New England) region for which any given reach may have millions of paths. There's probably no way to avoid this being a very long operation, but is there a pythonic way to perform this operation such that brand new paths aren't generated with each run? </p>\n\n<p>For example, if I run get_paths(h, 2) and all paths upstream from 2 are found, can I later run get_paths(h, 1) without retracing all of the paths in 2?</p>\n\n<pre><code>import collections\n\n# Object representing a stream reach. Used to construct a hierarchy for accumulation function\nclass Reach(object):\n def __init__(self):\n self.name = None\n self.ds = None\n self.us = set()\n\n def __repr__(self):\n return \"Reach({})\".format(self.name)\n\n\ndef build_hierarchy(flows):\n hierarchy = collections.defaultdict(lambda: Reach())\n for reach_id, parent in flows:\n if reach_id:\n hierarchy[reach_id].name = reach_id\n hierarchy[parent].name = parent\n hierarchy[reach_id].ds = hierarchy[parent]\n hierarchy[parent].us.add(hierarchy[reach_id])\n return hierarchy\n\ndef get_paths(h, start_node):\n def go_up(n):\n if not h[n].us:\n paths.append(current_path[:])\n for us in h[n].us:\n current_path.append(us)\n go_up(us.name)\n if current_path:\n current_path.pop()\n paths = []\n current_path = []\n go_up(start_node)\n return paths\n\ntest_tree = {(11, 9), (10, 9), (9, 6), (6, 2), (8, 5), (5, 4), (4, 2), (2, 1), (3, 1), (7, 3)}\nh = build_hierarchy(test_tree)\np = get_paths(h, 1)\n</code></pre>\n\n<p>EDIT:\nA few weeks ago I asked a similar question about finding \"ALL\" upstream reaches in a network and received an excellent answer that was very fast:</p>\n\n<pre><code>class Node(object):\n\n def __init__(self):\n self.name = None\n self.parent = None\n self.children = set()\n self._upstream = set()\n\n def __repr__(self):\n return \"Node({})\".format(self.name)\n\n @property\n def upstream(self):\n if self._upstream:\n return self._upstream\n else:\n for child in self.children:\n self._upstream.add(child)\n self._upstream |= child.upstream\n return self._upstream\n\nimport collections\n\nedges = {(11, 9), (10, 9), (9, 6), (6, 2), (8, 5), (5, 4), (4, 2), (2, 1), (3, 1), (7, 3)}\nnodes = collections.defaultdict(lambda: Node())\n\nfor node, parent in edges:\n nodes[node].name = node\n nodes[parent].name = parent\n nodes[node].parent = nodes[parent]\n nodes[parent].children.add(nodes[node])\n</code></pre>\n\n<p>I noticed that the <strong><em>def upstream():</em></strong> part of this code adds upstream nodes in sequential order, but because it's an iterative function I can't find a good way to append them to a single list. Perhaps there is a way to modify this code that preserves the order.</p>\n", "Lable": "No"}
2
+ {"QuestionId": 28226018, "AnswerCount": 1, "Tags": "<ruby-on-rails><rspec><wkhtmltopdf><wicked-pdf>", "CreationDate": "2015-01-29T22:38:58.963", "AcceptedAnswerId": "28910092", "Title": "Prevent OSX Download Notification When Testing PDF Download", "Body": "<p>We're using <a href=\"https://github.com/mileszs/wicked_pdf\" rel=\"nofollow\">wicked_pdf</a> to render a PDF in our Rails app. I'm trying to write tests for it.</p>\n\n<p>controller:</p>\n\n<pre><code>def index\n format.pdf render pdf: \"index.pdf\", template: \"foos/index\"\nend\n</code></pre>\n\n<p>controller spec:</p>\n\n<pre><code>it \"should render a pdf\" do\n get :index, format: :pdf\nend\n</code></pre>\n\n<p>feature spec:</p>\n\n<pre><code>scenario \"User clicks PDF link\" do\n click_link \"PDF\"\nend\n</code></pre>\n\n<p>When I run either spec, it triggers a file download in OSX's Finder. I can't reasonably check this in and annoy my fellow dev's. Is there a way to prevent that?</p>\n\n<p>A little more digging, and it's the <code>wkhtmltopdf</code> utility that causes a little program opening notification on the OSX dock.</p>\n\n<p><a href=\"https://github.com/mileszs/wicked_pdf/issues/360\" rel=\"nofollow\">https://github.com/mileszs/wicked_pdf/issues/360</a></p>\n", "Lable": "No"}
3
+ {"QuestionId": 28258473, "AnswerCount": 1, "Tags": "<html><linux><bash><shell><scripting>", "CreationDate": "2015-02-01T01:24:19.853", "AcceptedAnswerId": "28258557", "Title": "How to add text dynamically to .html from BASH script?", "Body": "<p>I have a bash script that runs every 5 minutes via cron:</p>\n\n<pre><code>#!/bin/bash\necho \"`users | wc -w`\" users logged on @\" `date`\" &gt;&gt; /var/www/users.html\n</code></pre>\n\n<p>I need the output text to display in a html page in a single column. I have been using the following HTML code but don't know how to get the output from the script to display properly between the tags dynamically. The script will run and add the output after the HTML code:</p>\n\n<pre><code>&lt;table&gt;\n&lt;tr&gt;\n&lt;td&gt;2 users logged on @ Fri Jan 16 16:59:01 EST 2015&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr&gt;\n&lt;td&gt;2 users logged on @ Fri Jan 16 16:59:01 EST 2015&lt;/td&gt;\n&lt;/td&gt;\n&lt;tr&gt;\n&lt;td&gt;2 users logged on @ Fri Jan 16 16:59:01 EST 2015&lt;/td&gt;\n&lt;/tr&gt;\n&lt;/table&gt;\n2 users logged on @ Fri Jan 16 19:11:02 EST 2015\n2 users logged on @ Fri Jan 16 19:12:01 EST 2015\n2 users logged on @ Fri Jan 16 19:13:01 EST 2015\n2 users logged on @ Fri Jan 16 19:14:01 EST 2015\n</code></pre>\n\n<p>Any help is appreciated thank you.</p>\n", "Lable": "No"}
4
+ {"QuestionId": 28300370, "AnswerCount": 1, "Tags": "<android><xmpp><smack>", "CreationDate": "2015-02-03T13:41:33.927", "AcceptedAnswerId": null, "Title": "How to get all the groups from a user in xmpp (using smack)", "Body": "<p>I want to get from my contacts the groups they belongs to.I mean, I'll will have a list of contacts, and when I click on each contact, I'll show new list with their groups:</p>\n\n<p>Example what I want:</p>\n\n<p><em>Contacts</em></p>\n\n<ul>\n<li>UserA (onClick)</li>\n<li>UserB</li>\n<li>UserC</li>\n<li>UserD</li>\n</ul>\n\n<p><em>UserA Groups</em></p>\n\n<ul>\n<li>Group1</li>\n<li>Group2</li>\n<li>Grpup3</li>\n</ul>\n\n<p>It is possible to get all the user groups and not only the \"shared\"?</p>\n\n<p>The project uses Smack library, and for obtaing my list of contacts I'm doing:(testing the results before implement the Adapter...etc..)</p>\n\n<pre><code>StringBuilder builder = new StringBuilder();\nfor(RosterEntry entry : entries)\n{\n\n builder.append(entry);\n builder.append(\"\\n\");\n Collection&lt;RosterGroup&gt; rGroup = entry.getGroups();\n builder.append(\"\\t\"+rGroup.toString());\n builder.append(\"\\n\");\n\n}\nLog.d(\"TEST\", builder.toString());\n</code></pre>\n\n<p>And obtaining:</p>\n\n<pre><code> 02-03 14:31:28.421: D/TEST(22476): Luis : luis@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Christopher : christopher@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Diego : diegom@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Fabio : fabio@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): testopen: testopen@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Diana: dianap@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Prova Prova: prova@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Jordi : jordic@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Rub\u00e9n : rubenr@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): Mikel : mikel@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n02-03 14:31:28.421: D/TEST(22476): melissak@domain.com: melissak@domain.com [GROUPA]\n02-03 14:31:28.421: D/TEST(22476): [org.jivesoftware.smack.RosterGroup@36a55f6]\n</code></pre>\n\n<p>I know that most of the user are in more than 1 group, but I only can see <code>[GROUPA]</code> But I don't kwow how to obtain the others groups.</p>\n\n<p>I tried to see what contains [org.jivesoftware.smack.RosterGroup@36a55f6], but the only thing I achive is get again the same names, and not the groups of a contact</p>\n\n<p>It's is possible to get it? How?</p>\n\n<p>Thanks in advance</p>\n", "Lable": "No"}
5
+ {"QuestionId": 28318219, "AnswerCount": 4, "Tags": "<linux><bash><awk><sed><grep>", "CreationDate": "2015-02-04T09:48:15.887", "AcceptedAnswerId": null, "Title": "Matching third field in a CSV with pattern file in GNU Linux (AWK/SED/GREP)", "Body": "<p>I need to print all the lines in a CSV file when 3rd field matches a pattern in a pattern file.</p>\n\n<p>I have tried grep with no luck because it matches with any field not only the third.</p>\n\n<pre><code>grep -f FILE2 FILE1 &gt; OUTPUT\n</code></pre>\n\n<p>FILE1</p>\n\n<pre><code>dasdas,0,00567,1,lkjiou,85249\nsadsad,1,52874,0,lkjiou,00567\nasdasd,0,85249,1,lkjiou,52874\ndasdas,1,48555,0,gfdkjh,06793\nsadsad,0,98745,1,gfdkjh,45346\nasdasd,1,56321,0,gfdkjh,47832\n</code></pre>\n\n<p>FILE2</p>\n\n<pre><code>00567\n98745\n45486\n54543\n48349\n96349\n56485\n19615\n56496\n39493\n</code></pre>\n\n<p>RIGHT OUTPUT</p>\n\n<pre><code>dasdas,0,00567,1,lkjiou,85249\nsadsad,0,98745,1,gfdkjh,45346\n</code></pre>\n\n<p>WRONG OUTPUT</p>\n\n<pre><code>dasdas,0,00567,1,lkjiou,85249\nsadsad,1,52874,0,lkjiou,00567 &lt;---- I don't want this to appear\nsadsad,0,98745,1,gfdkjh,45346\n</code></pre>\n\n<p>I have already searched everywhere and tried different formulas.</p>\n\n<p>EDIT: thanks to Wintermute, I managed to write something like this:</p>\n\n<pre><code>csvquote file1.csv &gt; file1.csv\nawk -F '\"' 'FNR == NR { patterns[$0] = 1; next } patterns[$6]' file2.csv file1.csv | csvquote -u &gt; result.csv\n</code></pre>\n\n<p>Csvquote helps parsing CSV files with AWK.</p>\n\n<p>Thank you very much everybody, great community!</p>\n", "Lable": "No"}
6
+ {"QuestionId": 28332152, "AnswerCount": 2, "Tags": "<javascript><jquery><arrays>", "CreationDate": "2015-02-04T21:50:05.860", "AcceptedAnswerId": "28332306", "Title": "Trouble looping through array, avoid adding ids", "Body": "<h1>Looking to:</h1>\n\n<p>Have the data for each of the 56 people show up in a popup window/ \"tooltip\" when you click on the image of their face (see <code>index.html</code>) without having to use ids. For example, clicking on Allan's image should give you her data stored in <code>var MLA</code> tried using a for loop to little success, maybe .each()</p>\n\n<p>There are two MLAs here in the example, <code>scripts.js</code>, but there are actually a total of 56 items that I'm trying to iterate over. Right, now I'm getting the last person in the array.</p>\n\n<h2>scripts.js (Data, attempted for loop)</h2>\n\n<pre><code> // MLAs\n var MLAs = [\n {\n \"Name\": \"Nancy Allan\",\n \"Age\": 62,\n \"Constuency\": \"St. Vital\",\n \"Party\": \"NDP\",\n \"Gender\": \"Female\",\n \"Ethnicity\": \"White\"\n },\n {\n \"Name\": \"James Allum\",\n \"Age\": null,\n \"Constuency\": \"Fort Garry-Riverview\",\n \"Party\": \"NDP\",\n \"Gender\": \"Male\",\n \"Ethnicity\": \"White\"\n }]\n\n // Shows a popup with MLA information\n $(\".headshot\").click(function(){\n $(\".tooltip\").css(\"display\", \"block\");\n for (i = 0; i &lt; 56; i++) {\n $(\".tooltipName\").html(MLAs[i].Name);\n $(\".tooltipParty\").html(MLAs[i].Party);\n $(\".tooltipConstuency\").html(MLAs[i].Constuency);\n $(\".tooltipEthnicity\").html(MLAs[i].Ethnicity) + \",\";\n $(\".tooltipAge\").html(MLAs[i].Age);\n }\n });\n});\n</code></pre>\n\n<h2>Using #ids</h2>\n\n<p>Doesn't really solve the problem, is there a better solution?</p>\n\n<h3>index.html</h3>\n\n<pre><code>&lt;img src=\"assets/img/headshots/allan.jpg\" id=\"0\" alt=\"\" class=\"headshot NDP Female White\"&gt;\n&lt;img src=\"assets/img/headshots/allum.jpg\" id=\"1\" alt=\"\" class=\"headshot NDP Male White\"&gt;\n&lt;img src=\"assets/img/headshots/altemeyer.jpg\" id=\"2\" alt=\"\" class=\"headshot NDP Male White\"&gt;\n</code></pre>\n\n<h3>scripts.js</h3>\n\n<pre><code>$(\".headshot\").click(function(){\n index = this.id;\n\n $(\".tooltip\").css(\"display\", \"block\");\n $(\".tooltipName\").html(MLAs[index].Name);\n $(\".tooltipParty\").html(MLAs[index].Party);\n $(\".tooltipConstuency\").html(MLAs[index].Constuency);\n $(\".tooltipEthnicity\").html(MLAs[index].Ethnicity); + \",\"\n $(\".tooltipAge\").html(MLAs[index].Age);\n });\n});\n</code></pre>\n", "Lable": "No"}
7
+ {"QuestionId": 28385825, "AnswerCount": 1, "Tags": "<android><eclipse><windows-7><adt>", "CreationDate": "2015-02-07T18:32:39.593", "AcceptedAnswerId": null, "Title": "Exception in import ADT Plugin in windows 7 32bit", "Body": "<p>When I try to import the ADT plugin in my eclipse for android, I am getting following exception</p>\n\n<blockquote>\n <p>An Error Occurred while downloading\n <a href=\"https://dl-ssl.google.com/android/eclipse/content.jar\" rel=\"nofollow\">https://dl-ssl.google.com/android/eclipse/content.jar</a> The cache file\n C:\\Program\n Files\\eclipse\\p2\\org.eclipse.equinox.p2.repository\\cache\\downloading\\content472334498.jar\n could not be renamed to C:\\Program\n Files\\eclipse\\p2\\org.eclipse.equinox.p2.repository\\cache\\downloading\\content472334498.jar.</p>\n \n <p>org.eclipse.equinox.p2.core.ProviionException</p>\n</blockquote>\n\n<p>OS is window7 32bit </p>\n\n<p>Thanks</p>\n\n<p>M. Prabhu</p>\n", "Lable": "No"}
8
+ {"QuestionId": 28437672, "AnswerCount": 2, "Tags": "<javascript><arrays><function><object>", "CreationDate": "2015-02-10T17:11:11.597", "AcceptedAnswerId": "28437733", "Title": "Javascript calling object function from array", "Body": "<p>Main:</p>\n\n<pre><code>var array = [];\narray.push(new npc(mapname, maps));\narray.push(new npc(mapname, maps));\nconsole.log(\"first id: \" + array[0].getID());\nconsole.log(\"second id: \" + array[1].getID());\n</code></pre>\n\n<p>Npc.js:</p>\n\n<pre><code>var id;\nfunction npc(mapname, maps) {\n id = maps[mapname].npcs.length + 1;\n console.log(\"ID set to: \" + id);\n maps[mapname].npcs.push(this);\n}\nNpc.prototype.getID = function() {\n return id;\n};\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>ID set to: 1\nID set to: 2\nfirst id: 2\nsecond id: 2\n</code></pre>\n\n<p>I can't get my head around why the output is 2,2 rather than 1,2. No matter which way I set it up I get the same results.</p>\n\n<p>Is it something to do with only one occurrence of <code>var id</code> be accessed by two instances of the same class or do I have to push a copy to the array?</p>\n\n<p>Either way I don't know why it happens or how to resolve this issue. </p>\n", "Lable": "No"}
9
+ {"QuestionId": 28471082, "AnswerCount": 2, "Tags": "<python>", "CreationDate": "2015-02-12T06:50:01.187", "AcceptedAnswerId": "28471190", "Title": "Which method is better for combining multiple lists without duplicates?", "Body": "<p>Given a social network, I'm returning a list of friends of friends connections. For example, if A -> B and B -> [C, D] , then fxn(A) = [C, D]</p>\n\n<p>Given I already collected a list ([B,...,n]) of friends of user A using a function called \"get_connections\" (literally just returns a list of friends of a given user). The original method I utilized to conduct this procedure uses two For loops:</p>\n\n<pre><code>return_list = []\n\nfor friend in friends_list:\n second_friends_list = get_connections(network, friend)\n\n # Go through each friend's friend list\n for friends in second_friends_list:\n # Check for duplicates\n if friends not in return_list:\n return_list.append(friends)\n\nreturn return_list\n</code></pre>\n\n<p>The second method I identified through Stackoverflow is the following:</p>\n\n<pre><code>for friends in friends_list:\n return_list = list(set(return_list) | set(get_connections(network, friends)))\n</code></pre>\n\n<p>Is there a significant difference between these two methods? My knowledge of algorithm is very limited, and I understand that the for loop method is O^2, but I do not know how set works exactly to better assess its advantage.</p>\n", "Lable": "No"}
10
+ {"QuestionId": 28547412, "AnswerCount": 2, "Tags": "<css><wordpress><twitter-bootstrap>", "CreationDate": "2015-02-16T17:52:08.697", "AcceptedAnswerId": "28548828", "Title": "Different column width in 2 rows with bootstrap and custom post types", "Body": "<p>I'm using a custom post type on my WP website and also using bootstrap.</p>\n\n<p>I want to list 5 custom post type entries on my home page, and I want the first 3 to have class col-md-4 in one row and in the next row 2 cpt entries to have the class col-md-6</p>\n\n<p>At the moment I have a class col-md-4 and 2 items in the 2nd row are not centered nicely.</p>\n\n<p>This is my current code:</p>\n\n<pre><code>&lt;div class=\"container-fluid gray-section\"&gt;\n &lt;div class=\"container\"&gt;\n &lt;div class=\"row\"&gt;\n &lt;?php \n $projects = get_posts(array('post_type'=&gt;'project','posts_per_page'=&gt;5, 'order'=&gt;'ASC'));\n if ($projects) { ?&gt;\n &lt;ul class=\"list-unstyled\"&gt;\n &lt;?php foreach ($projects as $post) { setup_postdata( $post ) ?&gt;\n &lt;li class=\"col-md-4 col-sm-6 col-xs-12 col-xxs-12 text-center \"&gt;\n &lt;a class=\"highlights-item\" href=\"&lt;?php echo get_permalink(); ?&gt;\"&gt;\n &lt;div class=\"highlights-container\"&gt;\n &lt;?php the_post_thumbnail(); ?&gt;\n &lt;span class=\"highlights-title\"&gt;\n &lt;?php the_excerpt(); ?&gt;\n &lt;/span&gt;\n &lt;/div&gt;\n &lt;/a&gt;\n &lt;/li&gt;\n &lt;?php } wp_reset_postdata(); ?&gt;\n &lt;/ul&gt;\n &lt;?php }\n ?&gt; \n\n &lt;/div&gt; &lt;!-- end row --&gt;\n &lt;/div&gt; &lt;!-- end container --&gt;\n &lt;/div&gt; &lt;!-- end container fluid --&gt; \n</code></pre>\n\n<p>Any suggestions how to fix this?</p>\n", "Lable": "No"}
11
+ {"QuestionId": 28569155, "AnswerCount": 1, "Tags": "<python><bash><terminal>", "CreationDate": "2015-02-17T19:04:37.003", "AcceptedAnswerId": "28569359", "Title": "Python: Changing terminal current directory and calling script", "Body": "<p>Once i check a particular file is there in a folder, i want to call bash script titled <code>nii-sdcme</code> from python. But before calling this script in terminal, i want to cd to particular directory. Can this be done in python? </p>\n\n<p>So steps to run this script in terminal looks like this:</p>\n\n<pre><code>cd DICOM/ \nnii_sdcme N\n</code></pre>\n\n<p>Where N is some folderNumber. eg: 92</p>\n\n<pre><code>cd DICOM/ \nnii_sdcme 92\n</code></pre>\n\n<p>Can some one please direct me how this can be implemented in python script?</p>\n\n<p>Many Thanks!</p>\n", "Lable": "No"}
12
+ {"QuestionId": 28572730, "AnswerCount": 4, "Tags": "<java>", "CreationDate": "2015-02-17T22:53:34.250", "AcceptedAnswerId": null, "Title": "how to convert a string value to integer without using Integer.parseInt()?", "Body": "<p>I have this input like </p>\n\n<pre><code>String s = \"6\" , ss=\"99 , sss = \"99999\";\n</code></pre>\n\n<p>i need to store these values in an int reference variable ,\nwithout using Integer.parseInt</p>\n\n<p>any suggestion ? , no full code , just the hints ??</p>\n", "Lable": "No"}
13
+ {"QuestionId": 28741579, "AnswerCount": 1, "Tags": "<c++><qt>", "CreationDate": "2015-02-26T11:44:24.337", "AcceptedAnswerId": "28742017", "Title": "Deconstruct object gives QCoreApplication::sendEvent: \"Cannot send events to objects owned by a different thread", "Body": "<p>My code is too long to post, here is the related part:</p>\n\n<pre><code>videoClass::videoClass()\n{ \n ...\n QThread* workerThread = new QThread(this);\n camwrk = new cameraWorker(workerThread);\n camwrk-&gt;moveToThread(workerThread);\n // There are many cross thread signal slot connections happening between this and the camwrk\n}\n\nvideoClass::~videoClass()\n{ \n ...\n\n delete camwrk;\n ...\n}\n\ncameraWorker::cameraWorker(QThread* workerThread)\n{\n _belongingThread = workerThread;\n ...\n}\n\ncameraWorker::cameraWorker(QThread* workerThread)\n{\n _belongingThread = workerThread;\n ...\n}\n\ncameraWorker::~cameraWorker()\n{\n _belongingThread-&gt;quit();\n _belongingThread-&gt;wait();\n}\n</code></pre>\n\n<p>Everytime when the _belongingThread->wait(); is finished, I got the message:</p>\n\n<pre><code>QCoreApplication::sendEvent: \"Cannot send events to objects owned by a different thread\n</code></pre>\n\n<p>What is happening here? I thought this is the correct way to use a QThread and finish it?</p>\n", "Lable": "No"}
14
+ {"QuestionId": 28772822, "AnswerCount": 1, "Tags": "<javascript><angularjs>", "CreationDate": "2015-02-27T19:28:32.273", "AcceptedAnswerId": "28774036", "Title": "Angular $compile in a loop", "Body": "<p>The angular app receives data in an array. With that data, $compile is being used to create a angular directive. Example...</p>\n\n<pre><code>for(i = 0; i &lt; trueTest.length; i++) {\n var test = trueTest[i];\n $scope.directiveData = {\n blockId: test.blockId,\n dataType: test.dataType,\n type: test.type,\n directiveType: test.directiveType\n };\n\n $compile(\"&lt;my-directive block-id='{[{ directiveData.blockId }]}' block-data-type='{[{ directiveData.dataType }]}' block-type='{[{ directiveData.type }]}' block-directive-type='{[{ directiveData.directiveType }]}'&gt;&lt;/my-directive&gt;\")($scope.$new());\n elem.find('.SomeElement').append(el);\n}\n</code></pre>\n\n<p>Custom directive <code>my-directive</code> has an isolated scope with values <code>blockId</code>, <code>blockDataType</code> etc... </p>\n\n<p>Most imprtant value is <code>blockId</code> inside <code>my-directive</code>. It determines what kind of data is going to be displayed in that directive. The problem is that it seems that <code>$compile</code> creates elements after the loop finishes so in every directive that <code>$compile</code> creates, isolated scope property is always that last one created in the loop.</p>\n\n<p>My guess is that $compile creates elements (directives) asynchronously so by the time the loop finishes, the directives are only then created with the current values of <code>$scope.directiveData</code>. Or, directives are created as plain DOM elements but the scope is created afterwards, thus creating scopes of all directives with the last value of <code>directiveData</code> object.</p>\n\n<p>Could anyone explain what is actually going on here?</p>\n\n<p>EDIT</p>\n\n<p>Here is a jsFiddle link of the problem. It doesn't run beacuse the code is quite large and i can't recreate the problem in fiddle but I tried to comment it as much as possible.</p>\n\n<p><a href=\"https://jsfiddle.net/j795tmht/2/\" rel=\"nofollow\">Problem</a></p>\n\n<p>SECOND EDIT.</p>\n\n<p>So i did some console.log(). I putted a console.log() right after <code>elem.find('.SomeElement').append(el);</code> and one <code>console.log('just print this')</code> inside the directives controller. It seems that elements are created in the DOM before the controller is of the directive is called. That would mean that all the DOM elements are created before the scopes are assigned. </p>\n\n<p>Am i wrong?</p>\n", "Lable": "No"}
15
+ {"QuestionId": 28782555, "AnswerCount": 3, "Tags": "<asp.net-mvc><angularjs><angularjs-scope>", "CreationDate": "2015-02-28T13:59:36.303", "AcceptedAnswerId": "28931924", "Title": "Binding AngularJS to MVC ViewModel properties", "Body": "<p>I'm starting to learn AngularJS and I'm trying to use it in a MVC application. I have an MVC ViewModel with properties which I've populated from the database and I have a view which is bound to this ViewModel. So in a normal MVC view I can do something like <code>@Model.UserBaseViewModel.FirstName</code>. What I'm trying to do is have my data come come from the ViewModel and also be saved through the ViewModel but I want AngularJS to do things like Editing and displaying the data like this:</p>\n\n<p><strong>CODE</strong></p>\n\n<pre><code>app.controller('ConsultantPersonalInformationController', function($scope, $filter, $http) {\n $scope.user = {\n id: 1,\n firstName: @Model.UserBaseViewModel.FirstName,\n lastName: @Model.UserBaseViewModel.LastName\n };\n\n //other code is here\n});\n</code></pre>\n\n<p>I'm not sure if there's a way to do do this. Does AngularJS need to get and save the data being displayed or can I use MVC ViewModel properties instead. </p>\n", "Lable": "No"}
oraclechunk40.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"QuestionId": 28966162, "AnswerCount": 1, "Tags": "<javascript><css3><less>", "CreationDate": "2015-03-10T14:19:14.230", "AcceptedAnswerId": null, "Title": "Loading icon while less modifyVars is compiling", "Body": "<p>I am using <strong>window.less.modifyVars(modified_variables);</strong> on the front-end to reflect the changes. And i want to show <strong>loading icon</strong> while less is compiling. Is there any way to check that less has started compilation and completed.</p>\n", "Lable": "No"}
2
+ {"QuestionId": 29080680, "AnswerCount": 1, "Tags": "<javascript>", "CreationDate": "2015-03-16T15:28:00.217", "AcceptedAnswerId": null, "Title": "how to detect if webpage has changed?", "Body": "<p>Assuming I have users on a page of my site.</p>\n\n<p>I update this page on my server but users will not notice the difference until reloading the page.</p>\n\n<p>How can a JavaScript function detect the difference and start reloading the page ?</p>\n\n<p>A solution could be using a timer which reloads the page every second but this causes a lot of traffic?</p>\n", "Lable": "No"}
3
+ {"QuestionId": 29102165, "AnswerCount": 2, "Tags": "<neural-network><theano><deep-learning><lstm>", "CreationDate": "2015-03-17T14:45:29.613", "AcceptedAnswerId": null, "Title": "How to perform multi-label learning with LSTM using theano?", "Body": "<p>I have some text data with multiple labels for each document. I want to train a LSTM network using Theano for this dataset. I came across <a href=\"http://deeplearning.net/tutorial/lstm.html\" rel=\"noreferrer\">http://deeplearning.net/tutorial/lstm.html</a> but it only facilitates a binary classification task. If anyone has any suggestions on which method to proceed with, that will be great. I just need an initial feasible direction, I can work on.</p>\n\n<p>thanks,\nAmit</p>\n", "Lable": "D"}
4
+ {"QuestionId": 29174518, "AnswerCount": 1, "Tags": "<html><css>", "CreationDate": "2015-03-20T19:35:09.677", "AcceptedAnswerId": "29175386", "Title": "CSS Clipping Text in Dynamic Header", "Body": "<p>I've been trying to get a dynamic header to clip text using the text-overflow:ellipsis, but I can't seem to get everything working that I need.</p>\n\n<p>Have a look at what we've originally implemented here <a href=\"https://dl.orangedox.com/selZdE\" rel=\"nofollow\">https://dl.orangedox.com/selZdE</a> Notice that the file name extends over the controls, this is what we're trying to fix by using something like the text-overflow css property.</p>\n\n<p>This is what I've tried</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\r\n<div class=\"snippet-code\">\r\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.toolbar {\r\n width: 100%;\r\n height: 45px;\r\n background-color: #fff;\r\n border-bottom: 1px solid #d5d5d5;\r\n }\r\n \r\n .middle {\r\n text-align: center;\r\n }\r\n \r\n .left {\r\n text-align:left;\r\n }\r\n \r\n .right {\r\n text-align:right;\r\n }\r\n \r\n .border {\r\n border:thin solid silver;\r\n }\r\n \r\n .clip {\r\n overflow: hidden;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n }\r\n \r\n #float &gt; div {\r\n width:32%;\r\n height:100%;\r\n }\r\n \r\n #inline &gt; div {\r\n\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 0;\r\n overflow: visible;\r\n margin-top: 3px;\r\n\r\n }\r\n \r\n .hide {\r\n display:none;\r\n }\r\n \r\n .float-right {\r\n float:right;\r\n }\r\n \r\n .float-left {\r\n float:left;\r\n }</code></pre>\r\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code> &lt;div id='inline' class=\"toolbar\"&gt;\r\n &lt;div class=\"inline left clip\"&gt;\r\n Some really really really really really really really really really really really really really long line of text.\r\n &lt;/div&gt;\r\n &lt;div class=\"inline middle\"&gt;Middle Stuff&lt;/div&gt;\r\n &lt;div class=\"inline right\"&gt;Right Stuff&lt;/div&gt;\r\n &lt;/div&gt;\r\n \r\n &lt;br&gt;\r\n &lt;hr&gt;\r\n &lt;h3&gt;Second Attempt&lt;/h3&gt;\r\n &lt;br&gt;\r\n \r\n &lt;div id='float' class=\"toolbar\"&gt;\r\n &lt;div class=\"border left float-left clip\"&gt;\r\n Some really really really really really really really really really really really really really long line of text.\r\n &lt;/div&gt;\r\n &lt;div class=\"border middle float-left\"&gt;Middle Stuff&lt;/div&gt;\r\n &lt;div class=\"border right float-right\"&gt;Right Stuff&lt;/div&gt;\r\n &lt;/div&gt;\r\n\r\n &lt;br&gt;\r\n &lt;hr&gt;\r\n &lt;strong&gt;without the middle&lt;/strong&gt;\r\n &lt;br&gt;\r\n \r\n &lt;div id='float' class=\"toolbar\"&gt;\r\n &lt;div class=\"border left float-left clip\"&gt;\r\n Some really really really really really really really really really really really really really long line of text.\r\n &lt;/div&gt;\r\n &lt;div class=\"border middle float-left hide\"&gt;Middle Stuff&lt;/div&gt;\r\n &lt;div class=\"border right float-right\"&gt;Right Stuff&lt;/div&gt;\r\n &lt;/div&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<p>Having a look at the attempts I've tried above</p>\n\n<ol>\n<li>Positioning is correct and removing the middle or the right section allows for the left section to \"grow\" HOWEVER the text overflows in the middle area\n(what we've already implemented</li>\n<li>Left box is now bounded to 33% of the screen allowing for the text overflow to be controlled BUT</li>\n<li>if the middle box isn't present then the left box doesn't automatically resize to over this available space (since it's explicitly set at 33%)</li>\n</ol>\n\n<p>Any ideas on how to better structure this header with overflowing text &amp; controls like this?</p>\n", "Lable": "No"}
5
+ {"QuestionId": 29225200, "AnswerCount": 1, "Tags": "<ocaml><opam>", "CreationDate": "2015-03-24T04:46:45.023", "AcceptedAnswerId": null, "Title": "OCaml: Unbound module Core with ~/.ocamlinit setup", "Body": "<p>I have installed a few packages using opam, such as Core and Batteries. The ocamlinit file is as follows:</p>\n\n<pre><code>(* Added by OPAM. *)\n\n#use \"topfind\"\n#thread\n#camlp4o\n#require \"core.top\"\n#require \"core.syntax\"\n#require \"batteries\"\n\nlet () =\n try Topdirs.dir_directory (Sys.getenv \"OCAML_TOPLEVEL_PATH\")\n with Not_found -&gt; ()\n;;\n</code></pre>\n\n<p>When I run this with utop I can see the modules for Batteries but I cannot see any of the modules for Core. When I try to do <code>open Core</code> or <code>open Core.Std</code> I get an unbound module error. I also tried adding in <code>#require \"core\"</code> and the error persisted.</p>\n\n<p>I'm not sure what the error is since I followed the installation instructions from the book \"Real World OCaml\". </p>\n\n<p>I also see two messages when I start off utop:</p>\n\n<pre><code>No such package: oUnit\" - required by `pa_ounit'\"\nNo such package: pa_pipebang\" - required by `core.syntax'\"\n</code></pre>\n\n<p>I'm not sure if these are related to the problem but when I do <code>opam list ounit</code> and <code>opam list pipebang</code> it shows them as installed.</p>\n", "Lable": "No"}
6
+ {"QuestionId": 29247810, "AnswerCount": 3, "Tags": "<c#><asp.net-mvc>", "CreationDate": "2015-03-25T05:01:08.610", "AcceptedAnswerId": "29247935", "Title": "How to display C# code as simple text in the MVC view?", "Body": "<p>I have MVC website, and I would like to show some code snippets as text on my website. Something like this:</p>\n\n<pre><code>List&lt;ImageInfoModel&gt; imgList = new List&lt;ImageInfoModel&gt;();\nstring imgPath = @\"~/Content/Images/ImageGallery/\";\nstring tmbPath = @\"~/Content/Images/ImageGallery/thumbnails/\";\n\nstring imgFullPath = Server.MapPath(imgPath);\nstring tmbFullPath = Server.MapPath(tmbPath);\n</code></pre>\n\n<p>If I simply copy and paste this into my view with <p> code text <p> it messes things up because of @ symbol.</p>\n\n<p>So my question is: How can I display C# code inside my view?</p>\n\n<p>Thanks in advance. </p>\n", "Lable": "No"}
7
+ {"QuestionId": 29274208, "AnswerCount": 2, "Tags": "<oracle><replace><plsql><newline>", "CreationDate": "2015-03-26T08:47:24.037", "AcceptedAnswerId": "29274702", "Title": "Oracle Replace char with newline", "Body": "<p>I am trying to replace a char in my Select with an newline. But it doenst work.</p>\n\n<p>Here is the code:</p>\n\n<pre><code>vMsg := to_char(rec.CREATED,'HH24:MI') || ' - ' || replace(rec.FILELIST, '|', chr(13) || chr(10)) || chr(13) || chr(10) || chr(13) || chr(10) || 'Test'\n</code></pre>\n\n<p>But this does not work, it seems like Oracle replaces '|' with ' '</p>\n\n<p>Example input:</p>\n\n<blockquote>\n <p>Audio.hx|Camera.hx|Circle.hx|Color.hx|Component.hx|Core.hx|Debug.hx|Draw.hx|Emitter.hx|Entity.hx|Events.hx|Game.hx|Input.hx|IO.hx|Log.hx|</p>\n</blockquote>\n\n<p>Example output:</p>\n\n<blockquote>\n <p>Audio.hx Camera.hx Circle.hx Color.hx Component.hx Core.hx Debug.hx\n Draw.hx Emitter.hx Entity.hx Events.hx Game.hx Input.hx IO.hx Log.hx</p>\n</blockquote>\n\n<p>What i expected:</p>\n\n<blockquote>\n <p>Audio.hx</p>\n \n <p>Camera.hx</p>\n \n <p>Circle.hx</p>\n \n <p>Color.hx</p>\n \n <p>...</p>\n</blockquote>\n", "Lable": "No"}
8
+ {"QuestionId": 29276295, "AnswerCount": 3, "Tags": "<conditional><pug><indentation>", "CreationDate": "2015-03-26T10:35:30.653", "AcceptedAnswerId": "29712619", "Title": "Conditional with parent and child div in JADE", "Body": "<p>Here my actual code :</p>\n\n<pre><code>each val, index in array\n if (index%3 == 0)\n .parent\n .child\n</code></pre>\n\n<p>or this one :</p>\n\n<pre><code>each val, index in array\n if (index%3 == 0)\n .parent\n .child\n else\n .child\n</code></pre>\n\n<p>What i want is, accpeting the condition is true, add the block parent .row, when the condition is not true add the child inside the parent. The final goal is to have this code :</p>\n\n<pre><code> &lt;div class='row'&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;/div&gt;\n &lt;div class='row'&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;/div&gt;\n</code></pre>\n\n<p>But the code i have for the moment with my actual code is :</p>\n\n<pre><code> &lt;div class='row'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='row'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n &lt;div class='child'&gt;&lt;/div&gt;\n</code></pre>\n\n<p>I tried many differents indentations but nothing works, everytime I write the parent in a conditon the block is automaticaly close, I don't know how to keep it open, or re-open it to put the content in it.</p>\n", "Lable": "No"}
9
+ {"QuestionId": 29351820, "AnswerCount": 0, "Tags": "<eclipse-rcp>", "CreationDate": "2015-03-30T16:49:27.290", "AcceptedAnswerId": null, "Title": "add Command programmatically to toolbar menu", "Body": "<p>I am programmatically creating new commands via <a href=\"http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2Fcommands%2FICommandService.html\" rel=\"nofollow\">ICommandService</a>#getCommand(String commandId) and am in need of adding these <code>Commands</code> to a <code>MenuManager</code>, but the <code>MenuManager</code> seems to accept only <code>IContributionItem</code> or <code>IAction</code> for its overloaded <code>add()</code> method</p>\n\n<p>Seemingly the <a href=\"http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2Fmenus%2FCommandContributionItemParameter.html\" rel=\"nofollow\">CommandContributionItemParameter</a> can be constructed with the newly made <code>commandId</code>, and from it a <code>CommandContributionItem</code> can be made, and then added to the <code>MenuManager</code></p>\n\n<p>Is this the way to add programmatically created commands to a programmatically created <code>Toolbar</code>? </p>\n\n<p>Any experience with this would be golden, thanks.</p>\n", "Lable": "No"}
10
+ {"QuestionId": 29426756, "AnswerCount": 2, "Tags": "<javascript><arrays>", "CreationDate": "2015-04-03T05:34:26.090", "AcceptedAnswerId": "29427108", "Title": "How to build 2 dimensional array from a string of options for a select tag in Javascript?", "Body": "<p>In Javascript, I have a string of options for a select tag. This is my string:</p>\n\n<pre><code>var myOptionsString = '&lt;option id=\"\"&gt;&lt;/option&gt;&lt;option id=\"1\"&gt;Self Service&lt;/option&gt;&lt;option id=\"2\"&gt;Administrator&lt;/option&gt;';\n</code></pre>\n\n<p>In Javascript, I want to convert it to a 2-dimensional Array where 1st dimension will store the id and 2nd dimension will store the text of an option.</p>\n\n<p>How can I do that? I am looking for Javascript solution; I am open to 3rd party solutions also like jQuery.</p>\n", "Lable": "No"}
11
+ {"QuestionId": 29483297, "AnswerCount": 3, "Tags": "<javascript><function><call><apply><invocation>", "CreationDate": "2015-04-07T03:35:38.427", "AcceptedAnswerId": "29483373", "Title": "Apply/Call method in Javascript: What is the first arguments \"this\"?", "Body": "<p>I am confused about using apply or call method correctly.\nI know that apply is passing an array to the function and call is passing strings to a function.\nFor example the code below, what does \"this\"really have to do with the code? if it has nothing to do with this code, then can anyone give me an example when \"this\" is implementing appropriately?</p>\n\n<pre class=\"lang-js prettyprint-override\"><code>function myFunction(a, b) {\n return a * b;\n}\nmyArray = [10,2];\nmyFunction.apply(this, myArray);\n</code></pre>\n\n\n", "Lable": "No"}
12
+ {"QuestionId": 29484147, "AnswerCount": 2, "Tags": "<ios><watchkit><apple-watch><xcode-6.2><wkinterfaceimage>", "CreationDate": "2015-04-07T05:06:03.257", "AcceptedAnswerId": "29485957", "Title": "How to run a animated Gif directly by assigning it to Wkinterfaceimage using watchkit in Xcode?", "Body": "<p><em>Here is my doubt !!!</em></p>\n\n<p><strong>How to run a animated gif image directly by getting dynamically from url / NSdata and assigning it to Wkinterfaceimage ???</strong></p>\n\n<p>i am working on the applewatch app development from past few days it's so great.Currently i'm working on the GIf Images assigning to the imageview. I successfuly done by adding the series of images statically in xcode and running it by assigning to Wkinterfaceimage.</p>\n", "Lable": "No"}
13
+ {"QuestionId": 29509933, "AnswerCount": 1, "Tags": "<php><laravel>", "CreationDate": "2015-04-08T08:45:22.447", "AcceptedAnswerId": "29510541", "Title": "Larvel5 Global $config var - fetched form db?", "Body": "<p>I have a config table which holds lots of configuration values,\nHow can I create a static helper/class that will be available globally on laravel?</p>\n\n<p>for example, I have a view with the an input:</p>\n\n<p><code>&lt;input type=\"text\" value=\"&lt;?= SettingsHelper::getValue('my-settings-key'); ?&gt;\" /&gt;</code></p>\n\n<p>And off course i don't want to query each time for it, just one query that gets all the configuration values.</p>\n\n<p>Any ideas?</p>\n", "Lable": "No"}
14
+ {"QuestionId": 29514460, "AnswerCount": 1, "Tags": "<python><subprocess><i2c>", "CreationDate": "2015-04-08T12:20:41.130", "AcceptedAnswerId": "29515689", "Title": "i2c address is out of range", "Body": "<p>I have been trying to use the MCP23017 along with my beaglebone.. I have however not received my devices yet, but I have started to get my program ready...\nI am programming the GPIO pins now.. Here I have tried to read and write the pins using i2c commands as follows:\nfor write-- </p>\n\n<pre><code>a=('i2cset', '-y', '0', '0x20', '0x14', '0x01')\nsubprocess.call(a, shell=True)\n</code></pre>\n\n<p>similarly using i2cget for reading.. However when I try to run it , it give me a notification on my screen saying </p>\n\n<pre><code>Usage: i2cset [-f] [-y I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\nI2CBUS is an integer or an I2C bus name\nADDRESS is an integer (0x03- 0x77)\n</code></pre>\n\n<p>Do I get this notification only because I don't have my device connected yet? Or is it a problem because of using the subprocess module?</p>\n\n<p>Any help is appreciated,</p>\n\n<p>Namita.</p>\n", "Lable": "No"}
15
+ {"QuestionId": 29526560, "AnswerCount": 1, "Tags": "<ruby-on-rails><amazon-ec2><cron><whenever>", "CreationDate": "2015-04-08T22:38:39.927", "AcceptedAnswerId": "29532803", "Title": "Executing Rails 'whenever' gem when EC2 Instance Moves", "Body": "<p>I use the 'whenever' gem for my rails cron file in EC2 and it works great. \"Whenever -w\" writes it and I never have to worry about it again. The problem is when my instance has a planned reboot. The rails app get passed to a new instance and the whole process is seamless with no downtime, but the new instance does not have my cron file.</p>\n\n<p>How can I make sure that the cron file gets written when I move to a new instance? Is there a way to run it on app start or something like that? Thanks.</p>\n", "Lable": "No"}
16
+ {"QuestionId": 29618653, "AnswerCount": 2, "Tags": "<java><multithreading><performance><concurrency><parallel-processing>", "CreationDate": "2015-04-14T03:27:29.090", "AcceptedAnswerId": "29623035", "Title": "When does performing tasks in parallel is an overkill?", "Body": "<p>I've a piece of java code which constructs an object from xml and takes some nanoseconds to a millisecond depending on object size. Sometimes I've to call that method 1-2 times, sometimes 70-80 times in loop to construct a list of objects.</p>\n\n<p>I tried constructing the objects in parallel, but sometimes it's taking double time than sequential and half the other times. Now my question is are there any guidelines or performance comparison metrics to guide when should multitasking be used and when it's just an overkill?</p>\n\n<p>Sample code that I'm using is:</p>\n\n<pre><code> List&lt;Callable&lt;Integer&gt;&gt; tasks = new ArrayList&lt;Callable&lt;Integer&gt;&gt;();\n for (final Integer object : list) {\n Callable&lt;Integer&gt; c = new Callable&lt;Integer&gt;() {\n @Override\n public Integer call() throws Exception {\n return test.m1(object);\n }\n };\n tasks.add(c);\n }\n List&lt;Future&lt;Integer&gt;&gt; results = EXEC.invokeAll(tasks);\n\n for (Future&lt;Integer&gt; fr : results) {\n fr.get();\n }\n</code></pre>\n", "Lable": "No"}
17
+ {"QuestionId": 29627660, "AnswerCount": 8, "Tags": "<javascript><jquery><html>", "CreationDate": "2015-04-14T12:43:59.680", "AcceptedAnswerId": "29648522", "Title": "How to get which element was clicked?", "Body": "<p>I have a simple <strong>div</strong> in my <strong>html</strong> as follows:</p>\n\n<pre><code>&lt;div id=\"myDiv\"&gt;\n....\n\n&lt;/div&gt;\n</code></pre>\n\n<p>Also I have set the <strong>onlick</strong> event on the <code>window.click</code> as follows:</p>\n\n<pre><code>window.onclick = function()\n{\n // do something\n } \n</code></pre>\n\n<p>So if I click, anywhere in the <strong>div</strong>, how can I find that this click was made inside <strong>\"myDiv\"</strong></p>\n\n<p><strong>Note : I cannot add the click event on my div, it is generated randomly from jqgrid</strong></p>\n", "Lable": "No"}
18
+ {"QuestionId": 29642020, "AnswerCount": 1, "Tags": "<codeigniter>", "CreationDate": "2015-04-15T05:10:27.763", "AcceptedAnswerId": null, "Title": "Connect one controller and one model with other database using codeigneiter", "Body": "<p>By using codeigneiter, I want to connect one controller and one model with another database.</p>\n\n<p>Is it possible?</p>\n\n<p>I am following this post <a href=\"https://stackoverflow.com/questions/312511/codeigniter-i-am-looking-to-use-connect-to-a-different-database-for-one-of-my\">Codeigniter - I am looking to use/connect to a different database for one of my controllers and one model</a>, but I'm not getting any result.</p>\n", "Lable": "No"}
19
+ {"QuestionId": 29660988, "AnswerCount": 0, "Tags": "<algorithm><cpu><alu>", "CreationDate": "2015-04-15T21:11:09.807", "AcceptedAnswerId": null, "Title": "What is the appropriate name for this hardware multiplier? Also, where can I find documentation on it to understand what is going on?", "Body": "<p>We're doing some work on a CPU in logism in class. We're going over the ALU, and need now need to know different ways multiplication can take place. Our professor gave us two examples, one called the \"Five Add Time\" and the \"31 Add Time\" (although I do not believe these are the official names of the algorithm), shown here:</p>\n\n<p><img src=\"https://i.stack.imgur.com/W3zjd.png\" alt=\"enter image description here\"></p>\n\n<p>And Here</p>\n\n<p><img src=\"https://i.stack.imgur.com/uC8mn.png\" alt=\"enter image description here\"></p>\n\n<p>What are the proper names for both these algorithms, and is there any documentation that would allow me to better understand what's going on here? I'd google it, but I am really not sure on the specific term I should look up.</p>\n\n<p>Thanks</p>\n", "Lable": "No"}