Id
int64
34.6M
60.5M
Title
stringlengths
15
150
Body
stringlengths
33
36.7k
Tags
stringlengths
3
112
CreationDate
stringdate
2016-01-01 00:21:59
2020-02-29 17:55:56
Y
stringclasses
3 values
35,308,462
Can we run any user defined function before the main function?
<p>I want to run a user defined function before the main function in C. But I don't know how to do that. Is that possible?</p>
<c>
2016-02-10 06:40:03
LQ_CLOSE
35,309,115
Why constexpr is not the default for all function?
<p>After relaxing the rules for the constexpr it seems as these functions can be used everywhere. They can be called on both constant (constexpr) and local (mutable) variables as well. So for me it seem as just a hint for the compiler (like inline). I just keep writing it everywhere and remove it if compiler complains....
<c++><c++14><constexpr>
2016-02-10 07:22:28
HQ
35,309,220
Smart keyboard internalization for IDEA
<p>When I start IntelliJ IDEA, that message comes up, but I couldn't find any information about that feature and how it could help me.</p> <blockquote> <p>Enable smart keyboard internalization for IDEA.: We have found out that you are using a non-english keyboard layout. You can enable smart layout support for Ger...
<intellij-idea>
2016-02-10 07:30:05
HQ
35,310,212
Docker missing layer IDs in output
<p>I just did a fresh install of Docker on Ubuntu using the official guidelines: <a href="https://docs.docker.com/engine/installation/linux/ubuntulinux/" rel="noreferrer">https://docs.docker.com/engine/installation/linux/ubuntulinux/</a></p> <p>When I pull an image using "sudo docker pull ubuntu" and then "sudo docker...
<ubuntu><docker>
2016-02-10 08:36:02
HQ
35,310,604
How to calculate same name as one?
I'm trying to calculate how many lines are there and my code is working but I failed to calculate if there is same name in each line as one for example john 01/2 john 02/3 def number_people(path): x = 0 with open(path) as f: for line in f: if line.str...
<python>
2016-02-10 08:56:44
LQ_EDIT
35,310,695
Convert byte string to bytes or bytearray
<p>I have a string as follows:</p> <pre><code> b'\x00\x00\x00\x00\x07\x80\x00\x03' </code></pre> <p>How can I convert this to an array of bytes? ... and back to a string from the bytes?</p>
<python><byte><bytearray>
2016-02-10 09:01:50
HQ
35,311,052
How to upgrade/refresh the ag-grid after row delete?
<p>I have an ag grid where i am trying to delete a row...I am able to remove the row from data source using "splice" technique,after that i want to refresh the table.But it is showing error.This is the code which i am using to delete a row</p> <pre><code>selectedvalue={} //this holds the selected row value rowData=[];...
<angular><ag-grid>
2016-02-10 09:19:43
HQ
35,311,687
Unable to require directive in AngularJS 1.5 component
<p>I've created a directive which works perfectly fine. Now after bumping <code>angular</code> to <code>1.5.0</code>, I figured this directive is a typical example of what could be written using the new <code>.component()</code> notation.</p> <p>For some reason, the <code>require</code> property no longer seems to wor...
<angularjs><angularjs-1.5>
2016-02-10 09:48:18
HQ
35,311,755
Realm ORM: how to deal with Maps?
<p>I am creating an Android app and I need to persist a <code>Map&lt;String,MyClass&gt;</code>. I've just started to use <a href="https://realm.io" rel="noreferrer">Realm ORM</a>, as it supports one-to-one and one-to-many, enumerations and lists. I also found a workaround for lists of strings (i.e. I have to create a S...
<java><android><realm>
2016-02-10 09:50:52
HQ
35,311,780
How to show different value of input element with ng-model?
<p>In the controller if have a variable that tracks the index (starting at 0) of the page for a pagination table:</p> <pre><code>var page { pageNumber: 0; } </code></pre> <p>Question: how can I show this <code>pageNumber</code> variable in the html, but always incremented by +1? (as the index=0 page is obviously th...
<javascript><angularjs>
2016-02-10 09:52:03
HQ
35,311,922
android selectableItemBackground selection
<p>i want to change background of my view when the state is "activated" and i want to preserve the effects(ripple) of <code>?attr:selectableItemBackground</code>. Is it possible to extend or combine selector of <code>?attr:selectableItemBackground</code>?</p>
<android><android-selector>
2016-02-10 09:58:19
HQ
35,312,274
Jenkins git submodule update fails
<p>I have a git repo which has one submodule. Both belong to a team on BitBucket. My jenkins machine is a AWS windows server with the git plugin. I am using SSH keys for authentication. I have three jenkins jobs. One clones the main repo. This is successful. One clones the second repo on its own (the repo which will be...
<git><jenkins><bitbucket><git-submodules>
2016-02-10 10:12:51
HQ
35,312,410
java.lang.IncompatibleClassChangeError: Implementing class with ScalaCheck and ScalaTest
<p>I'm facing a nasty exception when trying to write a test using ScalaCheck and ScalaTest. Here's my dependencies:</p> <pre><code>libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "2.2.6" % "test", "org.scalacheck" %% "scalacheck" % "1.13.0" % "test" ) </code></pre> <p>Here's my test:</p> <pre><cod...
<scala><scalatest><scalacheck>
2016-02-10 10:19:07
HQ
35,313,012
how extract data from json in php
<p>how to extract from json </p> <pre><code>{"aaData":[["Hitech Institute","0shoaib0@gmail.com","8149587579","2016-02-04 16:55:37","5"],["Hitech Institute","0shoaib0@gmail.com","8149587579","2016-02-04 16:55:38","6"],["Hitech Institute","0shoaib0@gmail.com","8149587579","2016-02-04 16:55:40","9"],["fdsf","fds","654545...
<php><mysql><json>
2016-02-10 10:44:49
LQ_CLOSE
35,313,244
How to filter invisible files in c#?
<p>I want to find all the invisible files in a folder in C#. I can enumerate the files </p> <pre><code>var files = from file in Directory.EnumerateFiles(@"c:\", "*.txt", SearchOption.AllDirectories) select new { File = file }; </code></pre>
<c#>
2016-02-10 10:55:47
LQ_CLOSE
35,313,395
regular expression for a to z in jquery not working on mvc 5
**my code is look like this. help me** $('#form').validate({ errorElement: "span", // contain the error msg in a span tag errorClass: 'help-block', ignore: "", rules: { CountryName: { r...
<jquery><regex>
2016-02-10 11:02:35
LQ_EDIT
35,313,747
Passing data with unwind segue
<p>I created two view controllers. I created a segue from the first to the second to pass data. Now I want to pass data from the second view controller to the first one. I went through many similar questions and I'm not able to implement those as I lack the knowledge on how unwinding works. </p> <p><strong>ViewControl...
<ios><swift><segue><unwind-segue>
2016-02-10 11:19:54
HQ
35,314,138
What is the best approach database structure for teacher, students and address table?
<p>I have the following tables in my database</p> <ul> <li>students</li> <li>teachers </li> <li>address</li> </ul> <p>I Want to store basic information about students and teacher in its own table, but the address and contact information in address table. If I store the <code>student_id</code> or <code>teacher_id</cod...
<php><jquery><mysql><database>
2016-02-10 11:37:11
LQ_CLOSE
35,314,429
hi im new and need a timer in batch
hi im currently working whit batch and made a prank thing (obligates you to close your pc) and an override section for me to get all my coding back so i wanted the person whit the wrong code to have my prank activate in 20 minutes i would like suggestions on how to do it plz :system cls set /p assurance=are you su...
<batch-file>
2016-02-10 11:50:10
LQ_EDIT
35,315,039
How do I write clipboard contents to text file?
<p>I need to write the contents of the clipboard to a text file. I've searched here for an answer but didn't find anything that worked for my situation. Just need a simple example.</p> <p>Thanks in advance...</p>
<.net>
2016-02-10 12:15:52
LQ_CLOSE
35,315,404
Custom init for UIViewController in Swift with interface setup in storyboard
<p>I'm having issue for writing custom init for subclass of UIViewController, basically I want to pass the dependency through the init method for viewController rather than setting property directly like <code>viewControllerB.property = value</code></p> <p>So I made a custom init for my viewController and call super d...
<ios><swift><uiviewcontroller><initialization>
2016-02-10 12:31:34
HQ
35,316,728
Does setting numpy arrays to None free memory?
<p>I have hundreds of really larges matrices, like (600, 800) or (3, 600, 800) shape'd ones.</p> <p>Therefore I want to de-allocate the memory used as soon as I don't really need something anymore.</p> <p>I thought:</p> <pre><code>some_matrix = None </code></pre> <p>Should do the job, or is just the reference set t...
<python><arrays><numpy><memory-management><memory-leaks>
2016-02-10 13:34:28
HQ
35,317,029
How to implement pixel-wise classification for scene labeling in TensorFlow?
<p>I am working on a deep learning model using <strong>Google's TensorFlow</strong>. The model should be used to <strong>segment and label scenes</strong>. </p> <ol> <li>I am using the <strong>SiftFlow dataset</strong> which has <em>33 semantic classes</em> and <em>images with 256x256 pixels</em>. </li> <li>As a resu...
<computer-vision><classification><tensorflow><scene><labeling>
2016-02-10 13:49:53
HQ
35,318,121
Glide Cache does not persist when app is killed
<p>I'm monitoring my web calls with Charles.</p> <p>I have a GlideModule changing cache folder by overriding applyOption(...) like this : </p> <pre><code> @Override public void applyOptions(Context context, GlideBuilder builder) { builder.setDiskCache( new InternalCacheDiskCacheFactory(context, "/m...
<android><caching><android-glide>
2016-02-10 14:38:37
HQ
35,318,416
Android Center Align Images
I have a very simple html here. It's an email header. My problem is, it displays perfectly on iOS but Android center aligns the logo and the button, when I run an actual email test. Browsers displays it well. It's just email clients where it change. The logo is suppose to be left aligned and the orange button, righ...
<android><html><css><html-email>
2016-02-10 14:52:11
LQ_EDIT
35,318,727
Python Questions help. Im lost
Write a program that asks a user how many numbers they wish to process, then ask for that many numbers. Find the total and the maximum of the numbers processed. Example output: Enter the number of values to process: 5 First value: 3 Next value: 9.2 Next value: -2.5 Next value: 0.25 Next value: 6 The total ...
<python>
2016-02-10 15:06:41
LQ_EDIT
35,318,849
How can I get what i'm reading in from a file to an output file
I'm able to pull out the 20 names randomly but how do I store them in a output file rather then displaying them to the screen? I tried filewriter but couldn't get it to work. public class Assignment2 { public static void main(String[] args) throws IOException { // Read in the file into ...
<java>
2016-02-10 15:12:19
LQ_EDIT
35,319,131
Using variables from previous maven phases
<p>I created a mojo intended to just run test cases. In the <code>compile</code> phase of my mojo, the only thing I do is to obtain a list of paths for running dynamic tests with TestNG. However when the test phase is reached, the list has no longer anything inside it.</p> <p>Should I move my mojo's goal execution to ...
<java><maven><testng>
2016-02-10 15:23:24
LQ_CLOSE
35,319,463
Mean as a window-function in dplyr
<p>I want to calculate group means but save them as a vector next to the raw data. Is there an efficient way to do this in <code>dplyr</code>?</p> <p>Original <code>data.frame</code>: </p> <pre><code>dat &lt;- data.frame( group = c("A","A","A","B","B","B"), value = c(4, 5, 6, 7, 8, 9) ) &gt; dat group value ...
<r><dplyr>
2016-02-10 15:38:08
LQ_CLOSE
35,319,476
Any way to test EventEmitter in Angular2?
<p>I have a component that uses an EventEmitter and the EventEmitter is used when someone on the page is clicked. Is there any way that I can observe the EventEmitter during a unit test, and use TestComponentBuilder to click the element that triggers the EventEmitter.next() method and see what was sent?</p>
<unit-testing><angular>
2016-02-10 15:38:37
HQ
35,319,597
How to stop/kill a query in postgresql?
<p>This question is while postmaster is running your query in the background, how to kill or stop it?</p> <p>For example, your shell or any frontend may be disconnected due to network issue, you cannot use ctrl-D to kill it but the background postmaster is still running your query. How to kill it?</p>
<postgresql>
2016-02-10 15:43:21
HQ
35,319,680
how to update item from listview in main form to textbox in second form in wondows form aplication in c#?
I create a program for an accountant. I have buttons for add product, delete product, add quantity of products, sell product and profit(count profit from all products in list) and listview for products with columns product, quantity, purchase price and profit. I have problem with button "add quantity of products" my ...
<c#><visual-studio><windows-forms-designer>
2016-02-10 15:46:59
LQ_EDIT
35,319,842
Why C doesn't allow implicit conversion from char ** to const char *const * (and C++ does)?
<p>I know implicit conversion from <code>char **</code> to <code>const char **</code> cannot be done and why, and that the conversion to <code>char *const *</code> works. See bottom for links to explanation on that.</p> <p>It all makes sense apart from one particular thing. So I have the following code:</p> <pre><c...
<c++><c><gcc><clang><constants>
2016-02-10 15:55:10
HQ
35,320,365
Using a GPU both as video card and GPGPU
<p>Where I work, we do a lot of numerical computations and we are considering buying workstations with NVIDIA video cards because of CUDA (to work with TensorFlow and Theano).</p> <p>My question is: should these computers come with another video card to handle the display and free the NVIDIA for the GPGPU?</p> <p>I w...
<gpu><gpgpu><theano><tensorflow>
2016-02-10 16:16:26
HQ
35,320,438
How to generate pdf report using thymeleaf as template engine?
<p>I want to create pdf report in a spring mvc application. I want to use themeleaf for designing the html report page and then convert into pdf file. I don't want to use xlst for styling the pdf. Is it possible to do that way? </p> <p>Note: It is a client requirement. </p>
<java><spring><pdf><thymeleaf>
2016-02-10 16:19:51
HQ
35,320,568
Mockito - separately verifying multiple invocations on the same method
<pre><code>import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.verify; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; public class MockitoTest { public static class TestMock { public void doIt(String s) { } } public static void main(String[]...
<java><mockito>
2016-02-10 16:25:04
HQ
35,320,925
Split a string in C#
<p>I have a string contains text "<strong>AA55BB10CC1DD10E123</strong>". I have to split the string and place it in List as text / value field like </p> <p>AA | 55</p> <p>BB | 10</p> <p>CC | 1</p> <p>DD | 10</p> <p>E | 123</p> <p>Thanks</p>
<c#><model-view-controller>
2016-02-10 16:39:38
LQ_CLOSE
35,321,004
MongoDB query $in with regex array of element
<p>Ok i am trying to implement a query, which is trying to perform regex search ( which contains an array list ) on a bunch of document</p> <p>Its hard for me to explain...so I am basically coming to direct point.</p> <p>There is query which works with regex array...</p> <pre><code>db.paper.find({"category": {$in: [...
<arrays><regex><mongodb>
2016-02-10 16:43:23
HQ
35,321,334
javascript/HTML mouseover vs. "component-under"
I have some HTML (generated by jsf) that includes images. The user trigger some changes (ajax-calls) when clicking on an image or by pressing a key. To keep track of the latest image-component (client-side), I use javascript and onmouseover, assigning the img-id to a javascript-variable which in turn is used to fill...
<javascript><html><onmouseover>
2016-02-10 16:58:37
LQ_EDIT
35,322,298
Does bash have a way to un-export a variable without unsetting it?
<p>Is it possible to <code>export</code> a variable in Bash, then later un-export it, without unsetting it entirely? I.e. have it still available to the current shell, but not to sub-processes.</p> <p>You can always do this, but it's ugly (and I'm curious):</p> <pre><code>export FOO #... _FOO=$FOO unset FOO FOO=$_F...
<bash><shell><unix><sh><environment>
2016-02-10 17:44:41
HQ
35,322,846
How to read/parse Content from OkNegotiatedContentResult?
<p>In one of my API actions (<code>PostOrder</code>) I <em>may</em> be consuming another action in the API (<code>CancelOrder</code>). Both return a JSON formatted <code>ResultOrderDTO</code> type, set as a <code>ResponseTypeAttribute</code> for both actions, which looks like this:</p> <pre><code>public class ResultOr...
<c#><asp.net><api><asp.net-web-api><asp.net-web-api2>
2016-02-10 18:12:34
HQ
35,323,174
What are the advantages of @ControllerAdvice over @ExceptionHandler or HandlerExceptionResolver for handling exceptions?
<p><strong>Spring 3.2</strong> introduced <code>@ControllerAdvice</code> annotation for handling exceptions in a Spring MVC application. But prior to this version Spring had <code>@ExceptionHandler</code> or <code>HandlerExceptionResolver</code> to handling exceptions in a Spring MVC application. Then why <strong>Sprin...
<java><spring><spring-mvc><exception-handling>
2016-02-10 18:30:54
HQ
35,324,053
Full screen IOS
<p>I just started on Xcode, and i have a little problem I would like to display the application on the entire screen</p> <p><a href="http://i.stack.imgur.com/NyXJ1.jpg" rel="nofollow">enter image description here</a></p>
<ios><iphone><display>
2016-02-10 19:19:27
LQ_CLOSE
35,325,103
Docker error when pulling Java 8 image - "failed to register layer"
<p>I am trying to pull the latest official Java docker image (java:8), but I keep getting a <code>failed to register layer</code> error. The Java 7 and 9 docker images download successfully. I am running OS X El Capitan version 10.11.1.</p> <pre><code>&gt; docker -v Docker version 1.10.0, build 590d5108 &gt; docker-ma...
<java><docker>
2016-02-10 20:20:11
HQ
35,325,195
Should I store function references in Redux store?
<p>I'm trying to build <strong>keyboard shortcut support</strong> into my React/Redux app in an <strong>idiomatic React/Redux way</strong>. The way I am planning to do this is to have the following action creator and associated action:</p> <pre><code>registerShortcut(keyCode, actionCreatorFuncReference) </code></pre> ...
<redux>
2016-02-10 20:24:42
HQ
35,325,444
Try deserialize to object
<p>I have serializaed objects of different types as strings in sql table.</p> <p>Now need to deserialize them without knowing what type is the object. </p> <p>I am looking for sth like TryDeserializeToObject trying with different types.</p> <p>Offcourse I could use try catch, is there any better way ? </p>
<c#>
2016-02-10 20:39:16
LQ_CLOSE
35,325,785
I'm trying to create a program that creates anagrams from a string of words
<p>I'm new to python - so from a list of predetermined words jumble the letters and return the jumbled letters.</p>
<python><anagram>
2016-02-10 20:59:22
LQ_CLOSE
35,326,076
How does the prim's algorithm run when compared with Kruskal's algorithm in terms of efficiency?
<p>I would like to know how Prim's algorithm stand against Kruskal's algorithm in terms of efficiency</p>
<java><c#>
2016-02-10 21:17:29
LQ_CLOSE
35,326,558
How do I search for a pip package by name only?
<p>By default pip searches both package names and descriptions. For some packages this results in a huge number of spurious hits and finding the one I actually want is a pain.</p> <p>How I tell pip I want to search by name only?</p>
<pip>
2016-02-10 21:45:37
HQ
35,327,186
I have to set a heading to the font-family "Cooper Black" but it never actually goes to it.
<p>I'm submitting the gist I have of it with the questions as well. It is specifically question 8 on the full blown assignment. <a href="https://gist.github.com/JStrong0037/67c1a09ccd1943be84f4" rel="nofollow">This</a> is the gist with all my code, but I used the line, font-family: 'Cooper Black', serif; which isn't wo...
<css>
2016-02-10 22:25:10
LQ_CLOSE
35,327,679
Validate or remove for extra fields in laravel
<p>It's posible to validate request with rules for additional fields, or remove that fields from request?</p> <p>Simple example, I have FormRequest object with rules:</p> <pre class="lang-php prettyprint-override"><code>public function rules() { return [ 'id' =&gt; 'required|integer', ...
<php><forms><laravel>
2016-02-10 22:59:18
HQ
35,328,056
React-Redux: Should all component states be kept in Redux Store
<p>Say I have a simple toggle:</p> <p> </p> <p>When I click the button, the Color component changes between red and blue</p> <p>I might achieve this result by doing something like this.</p> <p>index.js</p> <pre><code>Button: onClick={()=&gt;{dispatch(changeColor())}} Color: this.props.color ? blue : red </code></p...
<javascript><reactjs><redux>
2016-02-10 23:30:24
HQ
35,328,468
How to make a GUI in Julia?
<p>I'm new at programming in Julia and I need to create a GUI. I've been looking for information and I can't find anything useful. I tried to search information in the Julia official web page, but it seems to be down. I wonder if any of you guys knows where I can find information about it.</p>
<user-interface><julia>
2016-02-11 00:08:32
HQ
35,329,122
Find duplicates and delete all in notepad++
<p>I have multiple email addresses. I need to find and delete all (including found one). Is this possible in notepad++?</p> <p>example:<code>epshetsky@test.com, rek4@test.com, rajesh1239@test.com, mohanraj@test.com, sam@test.com, nithin@test.com, midhunvintech@test.com, karthickgm27@test.com, rajesh1239@test.com, moha...
<notepad++><text-editor>
2016-02-11 01:15:44
HQ
35,329,166
Creating and using an Elixir helpers module in Phoenix
<p>I have a group of acceptance tests I've created in my faux blog phoenix app. There's some duplicated logic between them I'd like to move to a helpers module to keep things DRY. </p> <p>Here is the directory structure:</p> <pre><code>test/acceptance/post ├── create_test.exs ├── delete_test.exs ├── helpers.exs ├──...
<elixir><phoenix-framework>
2016-02-11 01:20:55
HQ
35,329,532
Hello. I am working at a vending machine software. I cannot get the if statement to work. It just simply ignores it
// Program.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int main() { char number; cout << "Hello. Please choose a drink type ! \n\n1.Coca-Cola \n2.Coca-Cola ZERO \n3.Pepsi\n" ; cin >> number; if (number == 1) co...
<c++>
2016-02-11 02:02:55
LQ_EDIT
35,329,850
Excel VBA, code to count the # of filled cells, then find highest and 2nd highest and subtract the corresponding column #'s
<p>I'm looking to count the # of items in a list from A11 to A90. And if that number is even subtract the max value from the 2nd max and then 3rd max from 4th max, etc.. If it's odd then it would start at the 2nd max minus the 3rd, and 4th to 5th etc.. Until all numbers have been subtracted from their counterpart. The...
<vba><excel>
2016-02-11 02:38:28
LQ_CLOSE
35,329,962
File Upload in Elm
<p>How does one upload a file (image or excel) in Elm? </p> <p>Can't seem to find any examples.</p> <p>The answer is fine even if the native code is used. Have seen <code>Data</code> in <code>Elm-Html</code> but it appears files and blobs are not supported. What is the way around this?</p>
<elm>
2016-02-11 02:52:17
HQ
35,330,015
Error in a selection sort c++
I have this action for order array in sort selection method, but this code dont order my array correctly void selectionsort(int* b,int size) { int i, k,menor,posmenor; for(i=0;i<size-1;i++) { posmenor=i; menor=b[i]; for(k=i+1;k<size;k++) { if(b[k]<menor)...
<c++><arrays><algorithm><sorting>
2016-02-11 02:58:04
LQ_EDIT
35,330,066
django 1.9 createsuperuser bypass the password validation checking
<p>Try to work on the new django 1.9 version, and create a super user by this: </p> <pre><code>python manage.py createsuperuser </code></pre> <p>And I just want to use a simple password for my local development environment, like only one character, django1.9 upgrade to a very strict password validation policy, how ca...
<django><passwords>
2016-02-11 03:03:40
HQ
35,332,464
currentTime() in video js
The following is my code which is not working. Any help would be appreciated. var myPlayer; videojs("example_video_1").ready(function(){ myPlayer = this; if(myPlayer.currentTime()>3) { alert("STARTED"); }); });
<video.js>
2016-02-11 06:40:31
LQ_EDIT
35,332,614
perl code to find sum and average of specific columns
i want to calculate the average over all itemsX (where X is a digit) for each row in perl using windows i have file in format <p>id1 item1 cart1 id2 item2 cart2 id3 item3 cart3</p> <p>0 11 34 1 22 44 2 44 44</p> <p>1 44 44 55 66 34 45 55 33</p> want to find sum of item bl...
<perl>
2016-02-11 06:50:11
LQ_EDIT
35,333,848
how to use array_push()
<p>I want to push new data in array which each value of them.</p> <pre><code>$array = array("menu1" =&gt; "101", "menu2" =&gt; "201"); array_push($array, "menu3" =&gt; "301"); </code></pre> <p>But I got an error syntax.</p> <p>And if I use like this :</p> <pre><code>$array = array("menu1" =&gt; "101", "menu2" =&gt...
<php><arrays>
2016-02-11 08:07:15
LQ_CLOSE
35,337,493
Parse Server: hosting MongoDB on AWS vs hosting on MongoLab
<p>AWS published a <a href="http://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk" rel="nofollow" title="blog post">blog post</a> about migrating from Parse. I wonder why they suggest hosting MongoDB on MongoLab instead of hosting it directly on AWS?</p> <p>What's t...
<mongodb><amazon-web-services><parse-platform><mlab>
2016-02-11 10:59:47
LQ_CLOSE
35,337,524
How can i add inline style in JS code?
Is it possible to style inline the div ".trigger" on the following code and set its display to block ? $('.trigger').toggle(function(){ $('.greendiv').animate({'height': '300px', 'width': '400px'}, 200); }, function(){ $('.greendiv').animate({'height': '200px', 'width': '200px'}, 200); });
<javascript><jquery><css>
2016-02-11 11:01:37
LQ_EDIT
35,337,726
Can anyone give a simple code for houghlines using C#? As i got the transform, i want to detect the lines in images
Heloo all, Can anyone give me a simple code for houghlines in c# since i am new to .net,i didnt know how to do hough transform.Then i found the code for Hough transform but i need to detect the lines in images. for that theta and rho value is needed.
<c#>
2016-02-11 11:10:43
LQ_EDIT
35,338,072
How to create web-services in Zend Framework 2?
<p>How to create web services over HTTP REST protocol using Zend Framework 2 (third party)</p> <p>We use this code in Zend Framework 1 :</p> <pre><code> &lt;?php function methodName($name) { echo "Hello world - $name"; } $server = new Zend_Rest_Server(); $server-&gt;add...
<php><zend-framework2>
2016-02-11 11:27:08
LQ_CLOSE
35,340,179
Scanner in a while loop
<p>I'm a beginner in java but I have worked c++ before in c++ we can code like this :</p> <pre><code>int num; while (cin&gt;&gt;num){ .... } </code></pre> <p>now I wonder how to do that in java.</p>
<java><while-loop><java.util.scanner>
2016-02-11 13:06:11
LQ_CLOSE
35,340,359
Following Java Tutorial - Need hep with errors
I've been following a java tutorials who has began learning via Sam's teach yourself java and although I have copied this to ensure I can run it before I begin to change and make it my own, it will not run and I am not sure why. I would appreciate if one of you guys/girls could help. I've put my java classes in the cor...
<java>
2016-02-11 13:14:31
LQ_EDIT
35,341,943
Executing program gives int cannot be converted into java.lang.string
<p>I am currently using BlueJ (forced to by the module tutor, I hate it) and I'm having an error come up every time I attempt to execute the code.</p> <blockquote> <p>incompatible types: java.lang.String cannot be converted into int</p> </blockquote> <p>My code is as follows:</p> <pre><code>public class middle { ...
<java><oop><bluej>
2016-02-11 14:25:33
LQ_CLOSE
35,343,083
how can we display long length integer values in UILabels in ios
Hi i am very new for Ios and in my app i am integrating services and after getting response from service i am storing that values in Array-list when i load that array list values in tableList showing exception like _Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber leng...
<ios><objective-c>
2016-02-11 15:15:56
LQ_EDIT
35,343,090
how to keep opened developer tools while running a selenium nightwatch.js test?
<p>I am starting to write e2e tests using nightwatch.js and I noticed some errors that I would like to inspect manually in the target browser's console (developer tools). but always when I open the developer console, it is automatically closed by the browser. is this a intended feature of either selenium or nightwatch....
<selenium-webdriver>
2016-02-11 15:16:12
HQ
35,343,525
How do I order fields of my Row objects in Spark (Python)
<p>I'm creating Row objects in Spark. I do not want my fields to be ordered alphabetically. However, if I do the following they are ordered alphabetically.</p> <pre><code>row = Row(foo=1, bar=2) </code></pre> <p>Then it creates an object like the following:</p> <pre><code>Row(bar=2, foo=1) </code></pre> <p>When I t...
<python><apache-spark><pyspark><apache-spark-sql><pyspark-sql>
2016-02-11 15:33:39
HQ
35,343,557
Can anyone explain how this recursion code works exactly and what happens in the programs stack or in memory step by step?
<p>Here is my code:</p> <pre><code>#include &lt;stdio.h&gt; void fun(int n) { if(n &gt; 0) { fun(n-1); printf("%d ", n); fun(n-1); } } int main() { fun(4); return 0; } </code></pre> <p>and the output of this code is <code>1 2 1 3 1 2 1 4 1 2 1 3 1 2 1</code>. But I can't ...
<c><recursion>
2016-02-11 15:35:13
LQ_CLOSE
35,344,981
Posting to a Web API using HttpClient and Web API method [FromBody] parameter ends up being null
<p>I am attempting to POST to a Web API using the HttpClient. When I put a breakpoint in the Save method of the Web API the [FromBody] Product is null. This means that something is wrong with the way I am posting the product over to the Web API. Can someone please take a look at the below code and see where I might be ...
<c#><asp.net><asp.net-web-api><httpclient>
2016-02-11 16:37:57
HQ
35,345,520
Detach ItemTouchHelper from RecyclerView
<p>I have a RecyclerView with a working ItemTouchHelper. Everything works great, but I am wondering if there is a way I can detach the ItemTouchHelper from the RecyclerView without re-creating the list? For fun, this is the code I'm using to attach:</p> <pre><code>ItemTouchHelper.Callback callback = new ItemTouchHelp...
<android>
2016-02-11 17:01:30
HQ
35,345,747
PHP Notice: Undefined variable: str in
<p>My code</p> <pre><code>function rand_string($length) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $size = strlen( $chars ); for( $i = 0; $i &lt; $length; $i++ ) { $str .= $chars[ rand( 0, $size - 1 ) ]; // this line error } return $str; } </code></pre> <p>Error</p> <blockquote> ...
<php>
2016-02-11 17:10:57
LQ_CLOSE
35,345,834
Android Json and AsyncTask Error
<p>i had written an code that sends data from the android application to the database using JSON Form but i am having some errors when it sends.</p> <p>this is the class for registration:</p> <pre><code>package com.subhi.tabhost; import android.app.AlertDialog; import android.content.Context; import android.content....
<android><json><android-asynctask><android-json>
2016-02-11 17:15:12
LQ_CLOSE
35,345,927
Keeping track of changed properties in JPA
<p>Currently, I'm working on a Java EE project with some non-trivial requirements regarding persistence management. Changes to entities by users first need to be applied to some working copy before being validated, after which they are applied to the "live data". Any changes on that live data also need to have some rec...
<jpa><jakarta-ee><properties><javabeans><audit>
2016-02-11 17:20:28
HQ
35,346,088
Draw geom_tile borders inside squares to prevent overlap
<p>I would like to be able to draw borders on <code>geom_tile</code> that do not overlap so that borders can convey their own information without confusing the viewer with disappearing borders.</p> <pre><code>library(ggplot2) state &lt;- data.frame(p=runif(100), x=1:10, y=rep(1:10, each=10), z=rep(1:5, each=20)) ggp...
<r><ggplot2>
2016-02-11 17:28:03
HQ
35,346,433
visual studio 2010 syntax error but compile successfully
I have many many syntax errors but my solution ando proyect compiled fine help me pleasee!!!!! adding doestn appear "clean solution" [enter image description here][1] [1]: http://i.stack.imgur.com/uFxo5.png
<c#><asp.net><visual-studio>
2016-02-11 17:45:10
LQ_EDIT
35,347,818
How to use a two dimensional array in function declaration statement?
<pre><code>void sort(int [],int); </code></pre> <p>This is how I usually use a single dimensional array(i.e: <code>int []</code> ) inside a function declaration statement for programs like sorting and it works fine without any problem</p> <p>But for my matrix addition program when I use a two dimensional array(i.e:<...
<c><arrays><function><multidimensional-array>
2016-02-11 19:01:53
LQ_CLOSE
35,348,154
mongoDB query for count
I have a mongoDB question on count. I want to count the number of fields with the name 'appId' by month day year. I know in SQL you could do this by "SELECT COUNT(appID) FROM stats GROUP BY YEAR(record_date), MONTH(record_date)" How does that translate to mongodb? { $group : { ...
<mongodb><count>
2016-02-11 19:18:21
LQ_EDIT
35,348,288
How can I pass a structure pointer to a function properly?
c++ beginner here. So I have several functions in which I am trying to pass an element of array of pointers (which contains structures (records)). I'm having trouble doing this and I'm pretty stuck and frustrated. I'm very new to pointers and memory so go easy on me. I keep getting errors when I try to pass the specifi...
<c++><pointers><reference>
2016-02-11 19:25:24
LQ_EDIT
35,348,356
How to compress image size using UIImagePNGRepresentation - iOS?
<p>I'm using <code>UIImagePNGRepresentation</code> to save an image. The result image is of size 30+ KB and this is BIG in my case. </p> <p>I tried using <code>UIImageJPEGRepresentation</code> and it allows to compress image, so image saves in &lt; 5KB size, which is great, but saving it in JPEG gives it white backgro...
<ios><objective-c><uiimage><uiimagejpegrepresentation><uiimagepngrepresentation>
2016-02-11 19:28:35
HQ
35,348,632
Android studio activity main
<p>When I make a new project from android studio. New blank activity has title bar and floating icon. How to get rid of it when I'm getting a new blank activity. And how i make a real blank activity.</p>
<android><android-activity><android-studio>
2016-02-11 19:43:28
LQ_CLOSE
35,348,988
How to add more Css properties in this Javascript
Javascript experts can anyone tell me how to add or assign more properties to this given javascript. $('#mydoom').each(function () { if ($(this).css('visibility') == 'hidden') { document.location.href = "http://www.example.com"; } }); you see the above script has only on...
<javascript><jquery><html><css><redirect>
2016-02-11 20:04:10
LQ_EDIT
35,349,136
array of image url to ui collectionview
I am doing a json quarry to get an array of image urls. I want to display the images on a uicollection view. But I am missing something. I think I have to parse thru the array and set nsurl to each item. Then put each item in nsdata. But I am not sure. I dont want to use 3rd party software either. Here is a sam...
<objective-c><uicollectionview><nsarray>
2016-02-11 20:11:48
LQ_EDIT
35,349,174
Make Segue programmatically in Swift
<p>I have two VCs: VC1 and VC2. In VC1, I have a <code>finish button</code> which I programmatically made and a <code>result array</code> I want to pass to VC2.</p> <p>I know how to make Segue in Storyboard, but I cannot do that at this moment since the <code>finish button</code> is programmatically made. </p> <p>If ...
<ios><swift><segue>
2016-02-11 20:14:36
HQ
35,349,305
cant find out why valgrind gives errors in my code which has array of structures
<p>I have the following code is code snippet of large code. I am trying to free an array of structures for which I have allocated memory in this code. Unfortunately I get either a seg fault or no segfault (error free) when I change specific line in the code. I am not able to find the reason why. Can somebody please hav...
<c>
2016-02-11 20:23:02
LQ_CLOSE
35,350,240
October CMS - How to correctly route
<p>I've been reviewing the documentation for October CMS routing (<a href="https://octobercms.com/docs/plugin/registration#routing-initialization" rel="noreferrer">https://octobercms.com/docs/plugin/registration#routing-initialization</a>), but I think that I am missing something. I have a page called 'deals' that rend...
<php><laravel><routing><octobercms>
2016-02-11 21:19:55
HQ
35,350,763
please Help Me (PHP CLASS)
Class RUNcookieDescutes Extends DF_CookiesDescutes { function RUNcookieDescutes($Cookietype) { // parent the faiamal father object parent::$this->EachDescute = array("fsr" => array(0,1), // order by date "prf" => array(0,1,5,10,15),...
<php>
2016-02-11 21:51:01
LQ_EDIT
35,350,780
Offline sync and event sourcing
<p>The CRUD-based part of our application needs:</p> <ol> <li>Offline bidirectional "two-way" syncing</li> <li>Ability to modify data until ready and then "publish".</li> <li>Audit log</li> </ol> <p>Event Sourcing (or the "command pattern") is what I'm looking at to accomplish these items. I feel comfortable with sol...
<synchronization><crud><offline><event-sourcing><command-pattern>
2016-02-11 21:52:19
HQ
35,350,859
Problems with configuring Mtrg
Im trying to configure Mrtg on my Windows machine. im folowing the mrtg guide <b>http://oss.oetiker.ch/mrtg/doc/mrtg-nt-guide.en.html.</b> but i get this http://sv.tinypic.com/r/246w41d/9 ive trying to folow youtube video to, but i get the same fault.
<windows><snmp><mrtg>
2016-02-11 21:56:52
LQ_EDIT
35,350,950
generates all tuples (x, y) in a range
<p>I'd like to know what is the pythonic way to generate all tuples (x, y) where x and y are integers in a certain range. I need it to generate n points and I don't want to take the same point two or more times.</p>
<python><combinations>
2016-02-11 22:03:07
LQ_CLOSE
35,350,973
How can i setup my php code to change my CSS background picture daily
<p>I have a website that has a background, and i want it to change daily.</p> <p>In my directory I have a background. each background has a number at the end.</p> <pre><code>././background1.jpg </code></pre> <p>In this case this file has a 1 tacked to it. So depending on the day the php will rewrite the css such tha...
<php><html><css>
2016-02-11 22:04:38
LQ_CLOSE
35,351,948
How would I write a program that inputs a string that represents a binary number?
<p>Question: How would I write a python program that inputs a string that represents a binary number? I'm stuck on this one in my CIS class.</p> <p>Prompt: The program can only contain only 0s and 1s with no other characters (not even spaces) If it does not, display an error message. If it is a valid binary number, de...
<python><string><input><binary>
2016-02-11 23:13:05
LQ_CLOSE
35,352,889
C++ Derived class constructors
<p>Say i have a class representing the subscribers for a library. I then want to create multiple other derived classes representing different types of subscribers such as students, professors etc.. </p> <ol> <li><p>How do i write the derived class constructor ? In my base class Subscriber I have the constructor which ...
<c++><inheritance><constructor><derived-class>
2016-02-12 00:45:41
LQ_CLOSE
35,353,368
How to have python code and markdown in one cell
<p>Can jupyter notebook support inline python code (arthritic calculations, or plot a figure) in markdown cell, or verse visa. Have both python code and markdown in one cell.</p>
<python><ipython><jupyter-notebook>
2016-02-12 01:36:41
HQ
35,353,771
Invoke pytest from python for current module only
<p>I know that py.test can test a single module if I do:</p> <pre><code>py.test mod1.py </code></pre> <p>Or, I can invoke pytest inside python:</p> <pre><code>import pytest pytest.run(['mod1.py']) </code></pre> <p>Can I do it inside python, and let it to run the current module? I guess I can do:</p> <pre><code>imp...
<python><pytest>
2016-02-12 02:25:15
HQ