qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
52,004,676
I am trying to pass an ArrayList to a method in Java. But it gives me the error: ``` incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>" ``` Here is the code: ``` class hello { public static void main() { List<String> iname = new ArrayList<>(); ...
2018/08/24
[ "https://Stackoverflow.com/questions/52004676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10269569/" ]
Your method ``` public String changeName(List<String> iname) ``` has the return type **String** and you are trying to assign that String to a variable of type List when you do ``` iname = obj.changeName(iname); ``` That is not possible.
The problem is that you try to store the return of your `changeName` function (a `String`) in the `iname` variable, which can only hold `List<String>`. This should work: ``` String result = obj.changeName(iname); ``` The alternative would be, to change the `changeName` to return `List<String>`, and change the functi...
52,004,676
I am trying to pass an ArrayList to a method in Java. But it gives me the error: ``` incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>" ``` Here is the code: ``` class hello { public static void main() { List<String> iname = new ArrayList<>(); ...
2018/08/24
[ "https://Stackoverflow.com/questions/52004676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10269569/" ]
Your variable `iname` is of type `List<String>` but you are attempting to return type `String` from your method `changeName(...)`. You need to either update the method to return a type `List<String>`: `public List<String> changeName(List<String> iname){ ... }` Or change the variable the method is returned into like:...
The problem is that you try to store the return of your `changeName` function (a `String`) in the `iname` variable, which can only hold `List<String>`. This should work: ``` String result = obj.changeName(iname); ``` The alternative would be, to change the `changeName` to return `List<String>`, and change the functi...
52,004,676
I am trying to pass an ArrayList to a method in Java. But it gives me the error: ``` incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>" ``` Here is the code: ``` class hello { public static void main() { List<String> iname = new ArrayList<>(); ...
2018/08/24
[ "https://Stackoverflow.com/questions/52004676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10269569/" ]
`iname` is `List<String>`, while the return type of method `changeName` is `String`. If you want to return `List<String>`, you can declare it this way: ``` public List<String> changeName(List<String> iname){ // ... you should return a List<String> in this method } ```
Your method returns String, but you are trying to assign return value to a List variable, so change it to ``` final String someString = obj.changeName(iname); ```
52,004,676
I am trying to pass an ArrayList to a method in Java. But it gives me the error: ``` incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>" ``` Here is the code: ``` class hello { public static void main() { List<String> iname = new ArrayList<>(); ...
2018/08/24
[ "https://Stackoverflow.com/questions/52004676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10269569/" ]
Your method returns a simple String which is about to be assigned to a List. Change changename to `public List<String> changeName(...)` or use a new varible which is of type String and assign the return value.
The problem is that you try to store the return of your `changeName` function (a `String`) in the `iname` variable, which can only hold `List<String>`. This should work: ``` String result = obj.changeName(iname); ``` The alternative would be, to change the `changeName` to return `List<String>`, and change the functi...
52,004,676
I am trying to pass an ArrayList to a method in Java. But it gives me the error: ``` incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>" ``` Here is the code: ``` class hello { public static void main() { List<String> iname = new ArrayList<>(); ...
2018/08/24
[ "https://Stackoverflow.com/questions/52004676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10269569/" ]
Your method returns String, but you are trying to assign return value to a List variable, so change it to ``` final String someString = obj.changeName(iname); ```
Your method `public String changeName(List<String> iname){}` is returning a String instead of a list of Strings. Try `public List<String> changeName(List<String> iname){}` instead. The method changeName is trying to fit an entire list into a single String. If you left your program as it, then you would have to return a...
52,004,676
I am trying to pass an ArrayList to a method in Java. But it gives me the error: ``` incompatible types: java.lang.String cannot be converted to java.util.List<java.lang.String>" ``` Here is the code: ``` class hello { public static void main() { List<String> iname = new ArrayList<>(); ...
2018/08/24
[ "https://Stackoverflow.com/questions/52004676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10269569/" ]
Your method ``` public String changeName(List<String> iname) ``` has the return type **String** and you are trying to assign that String to a variable of type List when you do ``` iname = obj.changeName(iname); ``` That is not possible.
Your method `public String changeName(List<String> iname){}` is returning a String instead of a list of Strings. Try `public List<String> changeName(List<String> iname){}` instead. The method changeName is trying to fit an entire list into a single String. If you left your program as it, then you would have to return a...
57,661,819
i am trying to call every value from the list and appending it to url and generating url every time for the appended value here is mine code ``` myList = ['10026','10067','10093','10117','10132','10133','10464','10524','10654','10657','10658','10701','10809','10966','11153','11173','11327','11453','11470','11478'...
2019/08/26
[ "https://Stackoverflow.com/questions/57661819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
One of the simple variants is to save transitions in a form of `I want to transition from X to Y while applying this function`. Enums make a good fit to enumerate all possible / valid states in a state machine. We need something to hold on to our state transitions - maybe a `Map<StateType, StateType>` ? But we also nee...
If you are using Spring you can consider Spring Statemachine. <https://projects.spring.io/spring-statemachine/>
57,661,819
i am trying to call every value from the list and appending it to url and generating url every time for the appended value here is mine code ``` myList = ['10026','10067','10093','10117','10132','10133','10464','10524','10654','10657','10658','10701','10809','10966','11153','11173','11327','11453','11470','11478'...
2019/08/26
[ "https://Stackoverflow.com/questions/57661819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
One of the simple variants is to save transitions in a form of `I want to transition from X to Y while applying this function`. Enums make a good fit to enumerate all possible / valid states in a state machine. We need something to hold on to our state transitions - maybe a `Map<StateType, StateType>` ? But we also nee...
I have a personal design that I have used extensively that I call the 'pump'. Your state machine class has a function called 'pump' which evaluates the state and updates accordingly. Each state evaluation might require some input from an external source (controllers), like the user or an AI. These objects are required ...
57,661,819
i am trying to call every value from the list and appending it to url and generating url every time for the appended value here is mine code ``` myList = ['10026','10067','10093','10117','10132','10133','10464','10524','10654','10657','10658','10701','10809','10966','11153','11173','11327','11453','11470','11478'...
2019/08/26
[ "https://Stackoverflow.com/questions/57661819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
One of the simple variants is to save transitions in a form of `I want to transition from X to Y while applying this function`. Enums make a good fit to enumerate all possible / valid states in a state machine. We need something to hold on to our state transitions - maybe a `Map<StateType, StateType>` ? But we also nee...
I would also advice you to check two frameworks before you implement your own State Machine. State Machine theory is really complex to develop all by yourself, specially not too much mentioned concepts like Sub / Nested State Machines are a must for complex / successful State Machine designs. One is mentioned above Sp...
57,661,819
i am trying to call every value from the list and appending it to url and generating url every time for the appended value here is mine code ``` myList = ['10026','10067','10093','10117','10132','10133','10464','10524','10654','10657','10658','10701','10809','10966','11153','11173','11327','11453','11470','11478'...
2019/08/26
[ "https://Stackoverflow.com/questions/57661819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you are using Spring you can consider Spring Statemachine. <https://projects.spring.io/spring-statemachine/>
I have a personal design that I have used extensively that I call the 'pump'. Your state machine class has a function called 'pump' which evaluates the state and updates accordingly. Each state evaluation might require some input from an external source (controllers), like the user or an AI. These objects are required ...
57,661,819
i am trying to call every value from the list and appending it to url and generating url every time for the appended value here is mine code ``` myList = ['10026','10067','10093','10117','10132','10133','10464','10524','10654','10657','10658','10701','10809','10966','11153','11173','11327','11453','11470','11478'...
2019/08/26
[ "https://Stackoverflow.com/questions/57661819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you are using Spring you can consider Spring Statemachine. <https://projects.spring.io/spring-statemachine/>
I would also advice you to check two frameworks before you implement your own State Machine. State Machine theory is really complex to develop all by yourself, specially not too much mentioned concepts like Sub / Nested State Machines are a must for complex / successful State Machine designs. One is mentioned above Sp...
71,563,517
I am using the staggered grid view package. How do I make the images within my staggered grid view clickable? I have tried adding in the GestureDetector function but I do not know where exactly I should input it into the code. here is my code ``` import 'package:flutter/material.dart'; import 'package:flutter_stagger...
2022/03/21
[ "https://Stackoverflow.com/questions/71563517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15244204/" ]
The code works in bash, you just need to run it in the right shell, you can do the following: ``` bash ./script.sh g ``` Also type `ps -p $$` (not `echo $SHELL`) to see what shell you are currently in: Examples: ``` # ps -p $$ PID TTY TIME CMD 25583 pts/0 00:00:00 sh # exit # ps -p $$ PID T...
I just reach my goal with this ! ``` #!/bin/bash inputsArr=("ab" "67" "7b7" "g" "67777" "07x7g7" "77777" "7777" "") for input in ${inputsArr[@]}; do [[ "$input" =~ $1 ]]; echo "$?" ; done ``` I would like to say thanks you to every person that give me some tips on this basic BASH script problem. Without you I wou...
12,983,028
Suppose I have a snippet like the following which returns the contents of Context.Cache["someComplexObject"]: ``` public class Something { private static SortedDictionary<Guid, Object> ComplexObjectCache { get { if (Context.Cache["someComplexObject"] == null) { ...
2012/10/19
[ "https://Stackoverflow.com/questions/12983028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/779572/" ]
The cache will never remove anything from memory. It's the garbage collector that removes object from memory, and that can happen only when there are no more references to the object. So, the objects will not be removed from memory, even if they are dropped from the cache, as long as you have a reference to it. (The ...
Cache is free to remove objects whenever it feels so. I.e. it can detect memory pressure and drop items as soon as you add them. You really should not be using Cache to pass objects around. Cache is cache - store objects to speed things up in future, but use other means to pass objects during single request. Also note...
12,983,028
Suppose I have a snippet like the following which returns the contents of Context.Cache["someComplexObject"]: ``` public class Something { private static SortedDictionary<Guid, Object> ComplexObjectCache { get { if (Context.Cache["someComplexObject"] == null) { ...
2012/10/19
[ "https://Stackoverflow.com/questions/12983028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/779572/" ]
Yes it will. If the web server is pressed for memory even code like this will fail to print "foo". ``` Context.Cache.Add( "someComplexObject", "foo", null, DateTime.Now.AddSeconds(seconds), System.Web.Caching.Cache.NoSlidingExpiration, System.Web....
Cache is free to remove objects whenever it feels so. I.e. it can detect memory pressure and drop items as soon as you add them. You really should not be using Cache to pass objects around. Cache is cache - store objects to speed things up in future, but use other means to pass objects during single request. Also note...
12,983,028
Suppose I have a snippet like the following which returns the contents of Context.Cache["someComplexObject"]: ``` public class Something { private static SortedDictionary<Guid, Object> ComplexObjectCache { get { if (Context.Cache["someComplexObject"] == null) { ...
2012/10/19
[ "https://Stackoverflow.com/questions/12983028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/779572/" ]
The cache will never remove anything from memory. It's the garbage collector that removes object from memory, and that can happen only when there are no more references to the object. So, the objects will not be removed from memory, even if they are dropped from the cache, as long as you have a reference to it. (The ...
Yes, your FillCache method is populating the cache, but there is time between that and when you retrieve the contents of the cache. In this time your cache can be invalidated. Try returning from your FillCache method so you always have a solid reference: ``` private SortedDictionary<Guid, Object> ComplexObjectCache() ...
12,983,028
Suppose I have a snippet like the following which returns the contents of Context.Cache["someComplexObject"]: ``` public class Something { private static SortedDictionary<Guid, Object> ComplexObjectCache { get { if (Context.Cache["someComplexObject"] == null) { ...
2012/10/19
[ "https://Stackoverflow.com/questions/12983028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/779572/" ]
Yes it will. If the web server is pressed for memory even code like this will fail to print "foo". ``` Context.Cache.Add( "someComplexObject", "foo", null, DateTime.Now.AddSeconds(seconds), System.Web.Caching.Cache.NoSlidingExpiration, System.Web....
Yes, your FillCache method is populating the cache, but there is time between that and when you retrieve the contents of the cache. In this time your cache can be invalidated. Try returning from your FillCache method so you always have a solid reference: ``` private SortedDictionary<Guid, Object> ComplexObjectCache() ...
12,983,028
Suppose I have a snippet like the following which returns the contents of Context.Cache["someComplexObject"]: ``` public class Something { private static SortedDictionary<Guid, Object> ComplexObjectCache { get { if (Context.Cache["someComplexObject"] == null) { ...
2012/10/19
[ "https://Stackoverflow.com/questions/12983028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/779572/" ]
The cache will never remove anything from memory. It's the garbage collector that removes object from memory, and that can happen only when there are no more references to the object. So, the objects will not be removed from memory, even if they are dropped from the cache, as long as you have a reference to it. (The ...
Yes it will. If the web server is pressed for memory even code like this will fail to print "foo". ``` Context.Cache.Add( "someComplexObject", "foo", null, DateTime.Now.AddSeconds(seconds), System.Web.Caching.Cache.NoSlidingExpiration, System.Web....
13,721,250
I am creating a program that has a double array list of a deck of cards. There are two "hands" that will be dealt from this ONE deck. 5 unique cards must be dealt to "comHand" which is a double array which stores the 5 cards. the first [] stores which iteration of the cards being dealt (1st card, 2nd card, etc) and the...
2012/12/05
[ "https://Stackoverflow.com/questions/13721250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1371110/" ]
``` int comHand [][] = new int [5][2]; ArrayList<Integer> cards = new ArrayList<Integer>(); int totalCards = 52; //Cards in a pack for(int x = 1; x <= totalCards; x++) { cards.add(x); } //Repeat for 5 cards for(int y = 0; y < 5; y++) { int selectCard = (int)(Math.rand...
You cannot be sure by Using a random in getting a unique in consecutive draws. Maintain an array, storing the draws of one transaction, and if you get any draw which is present in the array, continue generating a new Random number
13,721,250
I am creating a program that has a double array list of a deck of cards. There are two "hands" that will be dealt from this ONE deck. 5 unique cards must be dealt to "comHand" which is a double array which stores the 5 cards. the first [] stores which iteration of the cards being dealt (1st card, 2nd card, etc) and the...
2012/12/05
[ "https://Stackoverflow.com/questions/13721250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1371110/" ]
Your while loops seem to have a wrong condition. Try || instead of &&: ``` while (card1 == comHand[0][0] || card2 == comHand[0][1]) { card1 = (int) (Math.random()*1); card2 = (int) (Math.random()*3); } ``` I'd try another approach since "repeat Math.random() until everything works" is not a...
You cannot be sure by Using a random in getting a unique in consecutive draws. Maintain an array, storing the draws of one transaction, and if you get any draw which is present in the array, continue generating a new Random number
94,425
I am using ubuntu Empathy IM client for my Gmail account chatting .Can any one tell me how to clear the previos conversations in the Empathy IM client.I tried right click and clear.But it is clearing temporarily but not permanent.Is there any way to clear that?
2010/01/10
[ "https://superuser.com/questions/94425", "https://superuser.com", "https://superuser.com/users/12572/" ]
The GUI method of clearing previous messages for an account in empathy consists of right clicking a buddy in the contact list, selecting "previous conversations", and subsequently selecting "Edit"->"Clear" in the popup window. Then, select the account you'd like to clear the logs on and confirm deletion of your logs.
Logs for empathy are stored in `/home/<username>/.local/share/Empathy/` Hope this helps :)
185,359
My category structure is as follows: ``` - Top Category ---- Sub Category 1 ------- Sub Sub Category 1.1 ------- Sub Sub Category 1.2 ------- Sub Sub Category 1.3 ---- Sub Category 2 ------- Sub Sub Category 2.1 ------- Sub Sub Category 2.2 ------- Sub Sub Category 2.3 ``` I'm on a post under 1.2 so it would be: ``...
2015/04/25
[ "https://wordpress.stackexchange.com/questions/185359", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/56525/" ]
[`get_ancestors()`](http://codex.wordpress.org/Function_Reference/get_ancestors) returns an array containing the parents of any given object. This example has two categories. The parent with the id of 447 and the child with a id of 448 and returns the a category hierarchy (with IDs): ``` get_ancestors( 448, 'categor...
[get\_ancestors()](https://developer.wordpress.org/reference/functions/get_ancestors/) Is the correct way to get all the parent categories of a specific category in the hierarchical order, so to get the highest level parent you could extract the last item of the array returned like this: ``` // getting all the ancest...
35,063,889
``` compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' ``` to ``` compile 'com.google.android.gms:play-services:8.4.0' compile 'com.android.support:support-v4:23.1.0' compile 'com.android.support:design:23.1.0' ``` Time t...
2016/01/28
[ "https://Stackoverflow.com/questions/35063889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469890/" ]
Instead of: ``` compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' ``` try: ``` playVersion = '8.3.0' supportVersion = 'support-v4:22.2.1' designVersion = '22.2.1' compile "com.google.android.gms:play-services:$playVersion...
**Android Studio doesn't update the dependencies if you specify the version** Example: ``` compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' ``` In this case AS will tell you when there is a newer version **without updati...
35,063,889
``` compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' ``` to ``` compile 'com.google.android.gms:play-services:8.4.0' compile 'com.android.support:support-v4:23.1.0' compile 'com.android.support:design:23.1.0' ``` Time t...
2016/01/28
[ "https://Stackoverflow.com/questions/35063889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469890/" ]
Instead of: ``` compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' ``` try: ``` playVersion = '8.3.0' supportVersion = 'support-v4:22.2.1' designVersion = '22.2.1' compile "com.google.android.gms:play-services:$playVersion...
I just ran into this with another developer who had checked out my project, and then started getting build errors shortly thereafter. When I looked, my support library versions had appeared to have been updated as well. Turns out this was happening after they had added a new Activity via the Android Studio add an acti...
35,063,889
``` compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' ``` to ``` compile 'com.google.android.gms:play-services:8.4.0' compile 'com.android.support:support-v4:23.1.0' compile 'com.android.support:design:23.1.0' ``` Time t...
2016/01/28
[ "https://Stackoverflow.com/questions/35063889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5469890/" ]
**Android Studio doesn't update the dependencies if you specify the version** Example: ``` compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' ``` In this case AS will tell you when there is a newer version **without updati...
I just ran into this with another developer who had checked out my project, and then started getting build errors shortly thereafter. When I looked, my support library versions had appeared to have been updated as well. Turns out this was happening after they had added a new Activity via the Android Studio add an acti...
31,836,420
I have two tables, with the following info: ``` Table1 Table2 -- -- ID#1 Item#1 ID#2 Item#1 Item#2 ``` If an ID# has more than one item, it compares the dates in the created\_date column of Table2 and pick the Item# with the latest created\_date. Can anyone help me on this?
2015/08/05
[ "https://Stackoverflow.com/questions/31836420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2744968/" ]
This question is a bit old, but I still want to point out that adding interactivity to ggmaps output is definitely possible, since it is a ggplot2 object. Shiny has inherent interactive tool functions that record coordinates on the ggplot2 object (click, dblclick, hover, and brush). With a bit of work, these recorded c...
In the example gallery for shiny is a [superzip](http://shiny.rstudio.com/gallery/superzip-example.html) example that includes an interactive map. The shiny source code is available that you could work from. I don't think that it uses ggmap though. The [basic plot interaction demo](http://shiny.rstudio.com/gallery/pl...
31,836,420
I have two tables, with the following info: ``` Table1 Table2 -- -- ID#1 Item#1 ID#2 Item#1 Item#2 ``` If an ID# has more than one item, it compares the dates in the created\_date column of Table2 and pick the Item# with the latest created\_date. Can anyone help me on this?
2015/08/05
[ "https://Stackoverflow.com/questions/31836420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2744968/" ]
With my `googleway` package you can now plot an interactive Google Map ``` library(shiny) library(googleway) ui <- fluidPage( sidebarLayout( sidebarPanel(), mainPanel( google_mapOutput(outputId = "myMap") ) ) ) server <- function(input, output){ # mapKey <- 'your_api_...
In the example gallery for shiny is a [superzip](http://shiny.rstudio.com/gallery/superzip-example.html) example that includes an interactive map. The shiny source code is available that you could work from. I don't think that it uses ggmap though. The [basic plot interaction demo](http://shiny.rstudio.com/gallery/pl...
21,648,761
I am new to J2EE development and its frameworks, so I'm leads to create a J2EE application usign Myeclipse,glassfish ans mysql as SGBD ... I need to create a project EJB3 session I have to use Hibernate3 ORM .. My concern is that I've worked with hibernate but in a web project type and not EJB and I really do not know ...
2014/02/08
[ "https://Stackoverflow.com/questions/21648761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3287621/" ]
Add a line break tag, or a `br` tag: ``` document.getElementById("homepagetabs").innerHTML+="<li onclick='window.open(\""+fauxTab[x][1]+"\",\""+fauxTab[x][2]+"\")'> "+fauxTab[x][0]+"</li><br>" // ^This ``` so your code would look like: ``` var fauxTab = new Array(); fauxTab[0] = new Array("Histo...
just add a brakeline `<br>`: ``` </li><br>"} catch(er) {} ```
21,648,761
I am new to J2EE development and its frameworks, so I'm leads to create a J2EE application usign Myeclipse,glassfish ans mysql as SGBD ... I need to create a project EJB3 session I have to use Hibernate3 ORM .. My concern is that I've worked with hibernate but in a web project type and not EJB and I really do not know ...
2014/02/08
[ "https://Stackoverflow.com/questions/21648761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3287621/" ]
Add a line break tag, or a `br` tag: ``` document.getElementById("homepagetabs").innerHTML+="<li onclick='window.open(\""+fauxTab[x][1]+"\",\""+fauxTab[x][2]+"\")'> "+fauxTab[x][0]+"</li><br>" // ^This ``` so your code would look like: ``` var fauxTab = new Array(); fauxTab[0] = new Array("Histo...
You should use the newline character \n `+="<li onclick='window.open(\""+fauxTab[x][1]+"\",\""+fauxTab[x][2]+"\")'>"+fauxTab[x][0]+"</li>\n"`
34,979,414
I would like to blit hdc to an other hdc, and this hdc will be blit into hdc containing "BeginPaint". But a problem appears, nothing have been drawn. this is the code, thanks, ```c HDC hdcMem3 = CreateCompatibleDC(NULL); SelectObject(hdcMem3, Picture); BITMAP bitmap; GetObject(Picture, sizeof(bitmap), &bitmap); HD...
2016/01/24
[ "https://Stackoverflow.com/questions/34979414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5833737/" ]
This is a problem with `gson` and has nothing to do with `SharedPreferences`, since they will not modify the String you are saving. The error lies within `gson` serializing and deserializing `Integer`. You can see one question about this [here](https://stackoverflow.com/questions/15507997/how-to-prevent-gson-from-expr...
``` for (Registo registosItem : registosItems) { for (int i = 0; i < registosItem.getCommitedViolations().size(); i++) { String str = String.valueOf(registosItem.getCommitedViolations().get(i)); int valueAsInt= Integer.parseInt(str); registosItem.getCo...
53,681,648
I need to insert a code that contain double curly braces (Its a Shopify liquid object) That code i need to insert looks like this { collection.products\_count }}, The purpose of that code is that when you insert it on specific object it return something depend on the code used so it can return the product price.. orde...
2018/12/08
[ "https://Stackoverflow.com/questions/53681648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8622795/" ]
You need to understand the way the Shopify platform works. When you create any Liquid tags and add them to your theme, Shopify renders those first. That means when your theme has code like {{ collection.products\_count }} Shopify evaluates that and turns it into a number. That number is then available for your use. Wha...
This is an old post but came across it as I had to use double curly braces for a third-party project and had the same issue of GTM not accepting custom JS code containing double braces. I got around this by concatenating strings and will provide my solution here in the hope of helping others. Instead of the following ...
17,777,287
Reading about `std::unique_ptr` at <http://en.cppreference.com/w/cpp/memory/unique_ptr>, my naive impression is that a smart enough compiler could replace correct uses of `unique_ptr` with bare pointers and just put in a `delete` when the `unique_ptr`s get destroyed. Is this actually the case? If so, do any of the main...
2013/07/21
[ "https://Stackoverflow.com/questions/17777287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636917/" ]
It would certainly be my expectation from any reasonably competent compiler, since it is just a wrapper around a simple pointer and a destructor that calls `delete`, so the machne code generated by the compiler for: ``` x *p = new X; ... do stuff with p. delete p; ``` and ``` unique_ptr<X> p(new X); ... do stuff ...
Strictly speaking, the answer is no. Recall that `unique_ptr` is a template parametrized *not* only on the type of pointer but also on the type of the deleter. Its declaration is: ``` template <class T, class D = default_delete<T>> class unique_ptr; ``` In addition `unique_ptr<T, D>` contains not only a `T*` but al...
66,625,887
I have my collection like this : ``` { { "productType":"Bike", "company":"yamaha", "model":"y1" }, { "productType":"Bike", "company":"bajaj", "model":"b1" }, { "productType":"Bike", "company":"yamaha", "model":"y1" }, { "productType":"Car...
2021/03/14
[ "https://Stackoverflow.com/questions/66625887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8777941/" ]
* `$group` by `productType`, `company`, and `model`, and count the total * `$group` by `productType` and `company`, construct array using `model` and `count` of models in key-value format * `$group` by `productType`, construct array of company using `company` and `model` object that is converted from array using `$arra...
**SOLUTION #1**: Result as separate documents. ```js db.products.aggregate([ { $group: { _id: { company: "$company", model: "$model" }, productType: { $first: "$productType" }, count: { $sum: 1 } } }, { ...
66,918,701
I have two objects are contained by an array for each. The following code works. However, I am feeling this code I wrote is a bit odd. I am seeking a better or more standard way to improve below code. Thanks ```js const a = [ { apple: '1', banana: '2', }, ]; const b = [ { apples: ...
2021/04/02
[ "https://Stackoverflow.com/questions/66918701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1166137/" ]
You could get an object for each array and assign to the wanted properties. ```js const a = [{ apple: '1', banana: '2' }], b = [{ apples: '1', bananas: '2' }], result = { a: Object.assign({}, ...a), b: Object.assign({}, ...b) }; console.log(result); ```
You can achieve the same result with ```js const a = [{ apple: '1', banana: '2', }]; const b = [{ apples: '1', bananas: '2', }]; console.log({ a: a[0], b: b[0] }) ```
66,918,701
I have two objects are contained by an array for each. The following code works. However, I am feeling this code I wrote is a bit odd. I am seeking a better or more standard way to improve below code. Thanks ```js const a = [ { apple: '1', banana: '2', }, ]; const b = [ { apples: ...
2021/04/02
[ "https://Stackoverflow.com/questions/66918701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1166137/" ]
You could get an object for each array and assign to the wanted properties. ```js const a = [{ apple: '1', banana: '2' }], b = [{ apples: '1', bananas: '2' }], result = { a: Object.assign({}, ...a), b: Object.assign({}, ...b) }; console.log(result); ```
If your current code is giving you the result you want, then you can just do this: ``` const result = {a, b}; ``` Live Example: ```js const a = [ { apple: '1', banana: '2', }, ]; const b = [ { apples: '1', bananas: '2', }, ]; const result = {a, b}; console.log(result);...
9,033,181
I tried a lot of the solutions in stackoverflow but I'm not able to find a valid one. I have a core data model with two entities: Client and Destination. Both are wrapped by `NSManagedObject`subclasses. Client has some properties and a one-to-many relationship called destinations. Destination has a property called def...
2012/01/27
[ "https://Stackoverflow.com/questions/9033181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/231684/" ]
For those interested in. You need to say to your fetch request to prefetch relationships using ```m - (void)setRelationshipKeyPathsForPrefetching:(NSArray *)keys ``` For example: ```m [fetchRequest setRelationshipKeyPathsForPrefetching:[NSArray arrayWithObjects: @"destinations", nil]]; ``` In this manner Core Da...
Here is a different way to retrieve specific values in fetch. Maybe this can help (look up link name in document): [Fetching Specific Values](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdFetching.html#//apple_ref/doc/uid/TP40002484-SW1)
65,991,141
I have a WPF project with a view model and some nested UI elements. Here is the (relevant section of) XAML: ``` <UserControl> // DataContext is MyVM (set programmatically) <TreeView ItemsSource="{Binding Trees}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Subtrees}"...
2021/02/01
[ "https://Stackoverflow.com/questions/65991141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5333340/" ]
I think this is a Scope-Problem. Each Ajax-Event triggers a Request and on each Request you will get a new Bean-Instance. Change the Scope of your UserManager to ViewScoped.
I think the issue is basically one level of indirection too much. Instead of `value="#{userManager.addUser.USERNAME}"`, it's much better to use two levels only, such as `value="#{userManager.username}"`. So one approach is the replicate all the fields of the entity as fields in the bean. Then in the action method of t...
65,991,141
I have a WPF project with a view model and some nested UI elements. Here is the (relevant section of) XAML: ``` <UserControl> // DataContext is MyVM (set programmatically) <TreeView ItemsSource="{Binding Trees}"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Subtrees}"...
2021/02/01
[ "https://Stackoverflow.com/questions/65991141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5333340/" ]
I think this is a Scope-Problem. Each Ajax-Event triggers a Request and on each Request you will get a new Bean-Instance. Change the Scope of your UserManager to ViewScoped.
The problem was solved by adding the primary key to the object before building the preparedstatement. Even if the object was filled befor with every information needed it looses the information after setting/ changing any attribute.
34,279,289
What I'm trying to do: * a class that has several (say 10) instance variables of dictionary type (mutable `var`). * a method that (depending on arguments, etc.) picks a dictionary an updates it. In ObjC, this is fairly easily accomplished using `NSMutableDictionary`. In Swift, this is more tricky, since the dictiona...
2015/12/15
[ "https://Stackoverflow.com/questions/34279289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1800936/" ]
As you may already aware, you can use `inout` to solve the problem ``` func updateDict(inout dict: [String : String]) { dict["OK"] = "KO" } func changeDictAtIndex(index: Int) { if index == 0 { updateDict(&dict1) }else{ updateDict(&dict2) } } ```
***Question: Is there a native way to do this (native meaning without using NSMutableDictionary)?*** I have rewritten your class, note the changes: * Different syntax for empty dictionary * ChangeDictAtIndex function now takes in a dictionary you want to replace. * The instance variables are being set to the passed i...
117,562
please, I have tried to design like this picture [![enter image description here](https://i.stack.imgur.com/vcID3.png)](https://i.stack.imgur.com/vcID3.png) I use CS6 but in my design spaces exit between layers ( squares ) like this [![enter image description here](https://i.stack.imgur.com/an6go.png)](https://i.sta...
2018/11/28
[ "https://graphicdesign.stackexchange.com/questions/117562", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/129989/" ]
It would drive me crazy if I had to alter each corner manually. So... I'd use a more global method.... * Expand Strokes (Object > Expand / Copy *only* outer compound rectangle for later use) * Merge shapes (Pathfinder Panel > Merge) * Apply Effect (Effect > Stylize > Round Corners) * Expand Effect (Object > Expand App...
* Select all * Menu **Object** -> **Expand** * **Shape Builder Tool** [![enter image description here](https://i.stack.imgur.com/knvvO.png)](https://i.stack.imgur.com/knvvO.png) * Choose a fill color and click the holes [![grid](https://i.stack.imgur.com/W4try.gif)](https://i.stack.imgur.com/W4try.gif)
117,562
please, I have tried to design like this picture [![enter image description here](https://i.stack.imgur.com/vcID3.png)](https://i.stack.imgur.com/vcID3.png) I use CS6 but in my design spaces exit between layers ( squares ) like this [![enter image description here](https://i.stack.imgur.com/an6go.png)](https://i.sta...
2018/11/28
[ "https://graphicdesign.stackexchange.com/questions/117562", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/129989/" ]
It would drive me crazy if I had to alter each corner manually. So... I'd use a more global method.... * Expand Strokes (Object > Expand / Copy *only* outer compound rectangle for later use) * Merge shapes (Pathfinder Panel > Merge) * Apply Effect (Effect > Stylize > Round Corners) * Expand Effect (Object > Expand App...
Take Danielillo's excellent answer, then use Pathfinder to union all the black elements together. Once you've done this select all the corners using the direct selection tool, and then use the rounded corner tool to give the fillets you prefer or need for the given manufacturing method. [![Like so](https://i.stack.img...
40,519,026
Okay guys, I am trying to use JavaScript to validate a form, and then display a "Thank you" message after its all been validated with correct information. I've got it working to validate the first name, email address, and a radio selection, however I can't seem to get it to validate the state selection, or display the ...
2016/11/10
[ "https://Stackoverflow.com/questions/40519026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5552540/" ]
Your code only gets the value and increases it, does not assign the value to the input field. Add this line after the increment statement: ``` document.getElementById("rows_count").value = rows_count; ``` Also it's `parseInt()` with lowercase `p` not `ParseInt()`. ```js function add_more_row() { var inputRow = d...
It is because you declare the variable inside the function. So, the variable does not increase. ``` var rows_count=ParseInt(document.getElementById("rows_count").value); function add_more_row() { rows_count += 1; } ```
40,519,026
Okay guys, I am trying to use JavaScript to validate a form, and then display a "Thank you" message after its all been validated with correct information. I've got it working to validate the first name, email address, and a radio selection, however I can't seem to get it to validate the state selection, or display the ...
2016/11/10
[ "https://Stackoverflow.com/questions/40519026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5552540/" ]
```js function add_more_row() { var rows_count = parseInt(document.getElementById("rows_count").value); rows_count += 1; document.getElementById("rows_count").value= rows_count; } ``` ```html <input type="text" value="0" id="rows_count" /> <input onclick="add_more_row();" type="button" value="add row" /> ``...
It is because you declare the variable inside the function. So, the variable does not increase. ``` var rows_count=ParseInt(document.getElementById("rows_count").value); function add_more_row() { rows_count += 1; } ```
40,519,026
Okay guys, I am trying to use JavaScript to validate a form, and then display a "Thank you" message after its all been validated with correct information. I've got it working to validate the first name, email address, and a radio selection, however I can't seem to get it to validate the state selection, or display the ...
2016/11/10
[ "https://Stackoverflow.com/questions/40519026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5552540/" ]
Your code only gets the value and increases it, does not assign the value to the input field. Add this line after the increment statement: ``` document.getElementById("rows_count").value = rows_count; ``` Also it's `parseInt()` with lowercase `p` not `ParseInt()`. ```js function add_more_row() { var inputRow = d...
```js function add_more_row() { var rows_count = parseInt(document.getElementById("rows_count").value); rows_count += 1; document.getElementById("rows_count").value= rows_count; } ``` ```html <input type="text" value="0" id="rows_count" /> <input onclick="add_more_row();" type="button" value="add row" /> ``...
55,112
> > Der Nebel wird so dicht, dass ich das Haus kaum noch sehe. > > > What is the antonym of "dicht" in the sense/meaning used above? Also what about these two below? "thick atmosphere" "thick substance" What is the antonym of thick here? If we want it in German of course...
2019/11/06
[ "https://german.stackexchange.com/questions/55112", "https://german.stackexchange.com", "https://german.stackexchange.com/users/11275/" ]
I would use [*dünn*](https://www.dwds.de/wb/d%C3%BCnn) as an antonym of *dicht* (or *dick*) in the sense desired: > > * Der Nebel ist heute *dünner* als gestern. > * In der *dünnen* Atmosphäre kann man kaum noch atmen. > * Die Mischung ist noch viel zu *dünn*. > > > As mentioned elsewhere, *lichter Nebel* is also...
This depends indeed heavily on context. In this case (fog = Nebel) you would usually say *leichter Nebel* (light fog). *Dünner Nebel* (thin fog) would also be possible, but rather unusual. "Dicht" is also used in the meaning of (air/water-)tight (nothing can leak out), in this case the antonym would simply be *undi...
55,112
> > Der Nebel wird so dicht, dass ich das Haus kaum noch sehe. > > > What is the antonym of "dicht" in the sense/meaning used above? Also what about these two below? "thick atmosphere" "thick substance" What is the antonym of thick here? If we want it in German of course...
2019/11/06
[ "https://german.stackexchange.com/questions/55112", "https://german.stackexchange.com", "https://german.stackexchange.com/users/11275/" ]
I would use [*dünn*](https://www.dwds.de/wb/d%C3%BCnn) as an antonym of *dicht* (or *dick*) in the sense desired: > > * Der Nebel ist heute *dünner* als gestern. > * In der *dünnen* Atmosphäre kann man kaum noch atmen. > * Die Mischung ist noch viel zu *dünn*. > > > As mentioned elsewhere, *lichter Nebel* is also...
Slightly old-fashioned would be: > > lichter Nebel > > > I don't know which meaning of [*licht*](https://www.dwds.de/wb/licht) this usage is based on: *bright* or *sparse*. > > ein lichter Morgen (*bright*) > > > ein lichter Wald, lichtes Haar (*sparse*) > > >
21,817,799
Im using Fullpage.js and trying to make it work with wordpress, and its going forward. However, I'm trying to figure out how to be able to scroll trough a slide with content higher then the active slide. The plugin comes with a scroll overflow function, but that vill make a scrollbar that scrolls trough your content, a...
2014/02/16
[ "https://Stackoverflow.com/questions/21817799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2059370/" ]
I struggled with this myself, then went to read through the documentation again. Here what it states: > > * scrollOverflow: (default false) defines whether or not to create a > scroll for the section in case its content is bigger than the height > of it. In case of setting it to true, it requieres the vendor plugin...
Just to add a little info that mighht help out others, I've been using both plugins (fullpage.js and slimscroll.js) but found issues with slimscroll when using it on mobile devices (momentum and lag issues). It is possible to set scrollOverflow to false and add this next bit to the afterSlideLoad function to get nati...
11,096,042
I have 3 tables: **Customers** ``` ID_CUSTOMER NAME ``` **Products** ``` ID_PRODUCT PRODUCTNAME PRICE ``` **Orders** ``` ID_ORDER CUSTOMER_ID PRODUCT_ID QUANTITY ``` How to select all customers who ordered for $10k or more?
2012/06/19
[ "https://Stackoverflow.com/questions/11096042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192466/" ]
If you'd look at the return value of schedule, either in your IDE or in the [documentation](http://doc.akka.io/api/akka/2.0.2/#akka.actor.Scheduler) you'd see that it returns a Cancellable, so you can cancel the previous and schedule a new one. Hope that helps! Cheers, √
Several steps you need to do: 1 You need to have a global key-value variable. Here I use ConcurrentHashMap, because normal HashMap is not safe in multi-threaded environment. ``` var schedulerIDs = new ConcurrentHashMap[String, Cancellable]().asScala ``` 2 Every time you create a scheduler, you need to store it to ...
21,045,300
I have a class that I want to construct, by deserializing it from a network stream. ``` public Anfrage(byte[] dis) { XmlSerializer deser = new XmlSerializer(typeof(Anfrage)); Stream str = new MemoryStream(); str.Write(dis, 0, dis.Length); this = (Anfrage)deser.Deserialize(str); ...
2014/01/10
[ "https://Stackoverflow.com/questions/21045300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3164870/" ]
You cannot overwrite an object within the class itself by assigning to `this`. You can for example create a method that *returns* a new instance: ``` public static Anfrage Create(byte[] dis) { XmlSerializer deser = new XmlSerializer(typeof(Anfrage)); Stream str = new MemoryStream(); str.Write(dis, 0, dis....
Usually with this problem is dealt with a static non-constructor function returning the Object. ``` public static Anfrage Create(byte[] dis) { XmlSerializer deser = new XmlSerializer(typeof(Anfrage)); Stream str = new MemoryStream(); str.Write(dis, 0, dis.Length); return (Anfrage)deser.Deserialize(str)...
46,903,118
I'm streaming a content of my app to my RTMP server and using RPBroadcastSampleHandler. One of the methods is ``` override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) { switch sampleBufferType { case .video: streamer.appendSampleBuffer(sampleBuf...
2017/10/24
[ "https://Stackoverflow.com/questions/46903118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715075/" ]
From <https://developer.apple.com/documentation/avfoundation/avassetwriter/1390432-finishwritingwithcompletionhandl> `This method returns immediately and causes its work to be performed asynchronously` When `broadcastFinished` returns, your extension is killed. The only way I've been able to get this to work is by b...
You can try this: ``` override func broadcastFinished() { Log(#function) ... // Need to give the end CMTime, if not set, the video cannot be used videoWriter.endSession(atSourceTime: ...) videoWriter.finishWriting { // Callback cannot be executed here } ... // The program has be...
46,903,118
I'm streaming a content of my app to my RTMP server and using RPBroadcastSampleHandler. One of the methods is ``` override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) { switch sampleBufferType { case .video: streamer.appendSampleBuffer(sampleBuf...
2017/10/24
[ "https://Stackoverflow.com/questions/46903118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715075/" ]
@Marty's answer should be accepted because he pointed out the problem and its `DispatchGroup` solution works perfectly. Since he used a `while` loop and didn't describe how to use `DispatchGroup`s, here's the way I implemented it. ``` override func broadcastFinished() { let dispatchGroup = DispatchGroup() d...
You can try this: ``` override func broadcastFinished() { Log(#function) ... // Need to give the end CMTime, if not set, the video cannot be used videoWriter.endSession(atSourceTime: ...) videoWriter.finishWriting { // Callback cannot be executed here } ... // The program has be...
79,239
I assigned the AE-L, AF-L button to activate focusing on my Nikon D5500, but I can still focus using the shutter button. I would like to know if it was possible to use the AE-L/AF-L button to set focus only and the shutter button to take photos only.
2016/06/13
[ "https://photo.stackexchange.com/questions/79239", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/53081/" ]
According to page 267 of the [*D5500 Reference Manual*](http://download.nikonimglib.com/archive2/ghyQp00UIXvI02ubPLg17JWflV37/D5500RM_(En)02.pdf), using custom setting f2 to set the AE-L/AF-L button to *AF-ON* prevents the shutter release button from focusing. [![p. 267](https://i.stack.imgur.com/6l6Tz.png)](https://i...
Did you put the camera in Continuous mode? I understand back button trick will not work if it isn't in Continuous mode.
79,239
I assigned the AE-L, AF-L button to activate focusing on my Nikon D5500, but I can still focus using the shutter button. I would like to know if it was possible to use the AE-L/AF-L button to set focus only and the shutter button to take photos only.
2016/06/13
[ "https://photo.stackexchange.com/questions/79239", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/53081/" ]
According to page 267 of the [*D5500 Reference Manual*](http://download.nikonimglib.com/archive2/ghyQp00UIXvI02ubPLg17JWflV37/D5500RM_(En)02.pdf), using custom setting f2 to set the AE-L/AF-L button to *AF-ON* prevents the shutter release button from focusing. [![p. 267](https://i.stack.imgur.com/6l6Tz.png)](https://i...
I think I know what happens. If you have set ae-l af-l af af-on and press the button to focus it will focus the lens and the focus confirmation dot will light up in the viewfinder.now if you press the shutter button with the lens still in focus( from pressing ae-l af-l) the focus confirmation dot will light up again :i...
79,239
I assigned the AE-L, AF-L button to activate focusing on my Nikon D5500, but I can still focus using the shutter button. I would like to know if it was possible to use the AE-L/AF-L button to set focus only and the shutter button to take photos only.
2016/06/13
[ "https://photo.stackexchange.com/questions/79239", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/53081/" ]
According to page 267 of the [*D5500 Reference Manual*](http://download.nikonimglib.com/archive2/ghyQp00UIXvI02ubPLg17JWflV37/D5500RM_(En)02.pdf), using custom setting f2 to set the AE-L/AF-L button to *AF-ON* prevents the shutter release button from focusing. [![p. 267](https://i.stack.imgur.com/6l6Tz.png)](https://i...
Beside AF-ON button you need to release shutter from autofocus. Check [this manual](https://www.oreilly.com/library/view/nikon-d600-for/9781118530818/ch10-sec013.html) how to do it: > > The setting in question is found on the Timers/AE Lock submenu of the > Custom Setting menu and is called Shutter-Release Button AE...
79,239
I assigned the AE-L, AF-L button to activate focusing on my Nikon D5500, but I can still focus using the shutter button. I would like to know if it was possible to use the AE-L/AF-L button to set focus only and the shutter button to take photos only.
2016/06/13
[ "https://photo.stackexchange.com/questions/79239", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/53081/" ]
According to page 267 of the [*D5500 Reference Manual*](http://download.nikonimglib.com/archive2/ghyQp00UIXvI02ubPLg17JWflV37/D5500RM_(En)02.pdf), using custom setting f2 to set the AE-L/AF-L button to *AF-ON* prevents the shutter release button from focusing. [![p. 267](https://i.stack.imgur.com/6l6Tz.png)](https://i...
I had the same problem you have to disable "AF Activation", It should be at same place where you remap buttons I know this is an old post but hope it helps anyone who get the same problem in the future
55,555,068
I have an issue with a table called "movies". I found the date and the movie title are both in the title column. As shown in the picture: ![Sample](https://i.imgur.com/h0wqh7b.jpg) I don't know how to deal with this kind of issues. So, I tried to play with this code to make it similar to MySQL codes but I didn't work...
2019/04/07
[ "https://Stackoverflow.com/questions/55555068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9676465/" ]
If you are using MySQL 8+, then we can try using `REGEXP_REPLACE`: ``` SELECT REGEXP_REPLACE(title, '^(.*)\\s\\(.*$', '$1') AS title, REGEXP_REPLACE(title, '^.*\\s\\((\\d+)\\)$', '$1') AS date FROM yourTable; ``` [Demo ----](https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=ddf875c09f4e136f60f9c51ee1231794) Here ...
I would simply do: ``` select left(title, length(title) - 7) as title, replace(right(title, 5) ,')', '') as year ``` Regular expressions seem like overkill for this logic. In Hive, you need to use `substr()` for this: ``` select substr(title, 1, length(title) - 7) as title, substr(title, length(title...
55,555,068
I have an issue with a table called "movies". I found the date and the movie title are both in the title column. As shown in the picture: ![Sample](https://i.imgur.com/h0wqh7b.jpg) I don't know how to deal with this kind of issues. So, I tried to play with this code to make it similar to MySQL codes but I didn't work...
2019/04/07
[ "https://Stackoverflow.com/questions/55555068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9676465/" ]
If you are using MySQL 8+, then we can try using `REGEXP_REPLACE`: ``` SELECT REGEXP_REPLACE(title, '^(.*)\\s\\(.*$', '$1') AS title, REGEXP_REPLACE(title, '^.*\\s\\((\\d+)\\)$', '$1') AS date FROM yourTable; ``` [Demo ----](https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=ddf875c09f4e136f60f9c51ee1231794) Here ...
After struggling and searching I was able to build this command which works perfectly. ``` select translate(substr(title,0,length(title) -6) ,'', '') as title, translate(substr(title, -5) ,')', '') as date from movies; ``` Thanks for the people who answered too!
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
i did the following and my problem was solved(MY PROBLEM:when i wanted to run an emulator from the AVD manager,i received the following error "invalid command-line parameter: Files. Hint: use '@foo' to launch a virtual device named 'foo'. please use -help for more information") i think its happens when in the path o...
This trick doesn't work in IntelliJ. To solve it I moved the Android SDK to c:\android-sdk-windows. After that you still have to change the path to Android in IntelliJ of course: - right click on the module -> open module settings - go to: platform settings -> SDKs -> Android Or delete the previous one and create...
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
I've been trying to solve this same problem for two days now, and I just found a solution which works for me: Cut the 'Android' file folder from it's place in the 'Program Files' (or 'Program Files (x86)' if you use Windows 7) folder and paste it directly in the C:\ directory Your SDK file path should look like this:...
Delete your previous Virtual devices. Re create it. launch it. Once the emulator is running, run your application. Other wise, go to your run configuration and select the emulator you would like to run.
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
I had this same exact error when I would try to launch the emulator from Eclipse. I had all my Android files in my documents to begin with, not my program files. I moved these files and still had the problem because of my user name having a space in it. So I took the suggestion of Andrew McGarry and put my Android SD...
I've been trying to solve this same problem,and I just found a solution which works for me: @First i saw a file named adb\_has\_moved.txt.The contents of the file were "The adb tool has moved to platform-tools/ If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and ...
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
Apparently the problem are the spaces in the path, so just from: `C:\Program Files\Android\android-sdk` to: `C:\PROGRA~1\Android\android-sdk` If you have a 64 bit system From: `C:\Program Files (x86)\Android\android-sdk` to: `C:\PROGRA~2\Android\android-sdk` Under Windows->Preferences->Android Change the SDK Loc...
I had this same exact error when I would try to launch the emulator from Eclipse. I had all my Android files in my documents to begin with, not my program files. I moved these files and still had the problem because of my user name having a space in it. So I took the suggestion of Andrew McGarry and put my Android SD...
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
i did the following and my problem was solved(MY PROBLEM:when i wanted to run an emulator from the AVD manager,i received the following error "invalid command-line parameter: Files. Hint: use '@foo' to launch a virtual device named 'foo'. please use -help for more information") i think its happens when in the path o...
Delete your previous Virtual devices. Re create it. launch it. Once the emulator is running, run your application. Other wise, go to your run configuration and select the emulator you would like to run.
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
Apparently the problem are the spaces in the path, so just from: `C:\Program Files\Android\android-sdk` to: `C:\PROGRA~1\Android\android-sdk` If you have a 64 bit system From: `C:\Program Files (x86)\Android\android-sdk` to: `C:\PROGRA~2\Android\android-sdk` Under Windows->Preferences->Android Change the SDK Loc...
I've been trying to solve this same problem for two days now, and I just found a solution which works for me: Cut the 'Android' file folder from it's place in the 'Program Files' (or 'Program Files (x86)' if you use Windows 7) folder and paste it directly in the C:\ directory Your SDK file path should look like this:...
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
I've been trying to solve this same problem,and I just found a solution which works for me: @First i saw a file named adb\_has\_moved.txt.The contents of the file were "The adb tool has moved to platform-tools/ If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and ...
Delete your previous Virtual devices. Re create it. launch it. Once the emulator is running, run your application. Other wise, go to your run configuration and select the emulator you would like to run.
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
Apparently the problem are the spaces in the path, so just from: `C:\Program Files\Android\android-sdk` to: `C:\PROGRA~1\Android\android-sdk` If you have a 64 bit system From: `C:\Program Files (x86)\Android\android-sdk` to: `C:\PROGRA~2\Android\android-sdk` Under Windows->Preferences->Android Change the SDK Loc...
I've been trying to solve this same problem,and I just found a solution which works for me: @First i saw a file named adb\_has\_moved.txt.The contents of the file were "The adb tool has moved to platform-tools/ If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and ...
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
I was facing the same problem with Android when executing the emulator, and I found a solution right now. Please follow these steps: 1. Uninstall the SDK that you have already installed 2. Create a folder in disc C 3. Name it like Android 4. Open it and create inside it a new folder, for me I named it PROGRA~1 5. Exec...
I've been trying to solve this same problem,and I just found a solution which works for me: @First i saw a file named adb\_has\_moved.txt.The contents of the file were "The adb tool has moved to platform-tools/ If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and ...
3,492,676
When I click the 'run as Android application' option, it shows the following error: ``` [2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port. [2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'. [2010-08-16 16:56:35 - Emulator] please use -help for ...
2010/08/16
[ "https://Stackoverflow.com/questions/3492676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421645/" ]
Apparently the problem are the spaces in the path, so just from: `C:\Program Files\Android\android-sdk` to: `C:\PROGRA~1\Android\android-sdk` If you have a 64 bit system From: `C:\Program Files (x86)\Android\android-sdk` to: `C:\PROGRA~2\Android\android-sdk` Under Windows->Preferences->Android Change the SDK Loc...
Delete your previous Virtual devices. Re create it. launch it. Once the emulator is running, run your application. Other wise, go to your run configuration and select the emulator you would like to run.
56,753,215
I'm trying to build a dropdown menu using react. But I couldn't get it to get the onchange working. I tried few methods but still no sucess. Data loads into the dropdown and when I select one, nothing changes. ``` constructor(props) { super(props); this.state = { serviceList: [] }; this.loadD...
2019/06/25
[ "https://Stackoverflow.com/questions/56753215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11697150/" ]
Your `valueChange` should be `handleChange`. ``` <Dropdown selection options={this.fillDropdowncus(this.state.customersList)} onChange={this.handleChange} name="selectCustomer" placeholder='Select Customer' /> ```
Always try to call the functions in an anonymous function first. Try calling onChange={this.handleChange} in your Dropdown class with onChange={() =>this.handleChange}
39,783,188
I want to call a JS Script in Ajax response. What it does is pass the `document.getElementById` script to the Ajax responseText. The current code returns me this error: `Uncaught TypeError: Cannot set property 'innerHTML' of null` This is done with Visual Studio Cordova.. Ajax: ``` $("#loginBtn").click(function() ...
2016/09/30
[ "https://Stackoverflow.com/questions/39783188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6311169/" ]
The documentation shows how to install Docker on Amazon Linux instances not ubuntu. The user youre logged in with doesnt matter, just replace the yum commands with the apt-get equivalents or switch to using an Amazon Linux AMI.
For **Ubuntu**, you can use: **$ sudo apt-get update** you might have been checking the documentation of **RHEL** which needs $ sudo yum update -y If you are working behind a **proxy**, Make sure you configure the proxy for Docker. Hope it helps.. **:)**
39,783,188
I want to call a JS Script in Ajax response. What it does is pass the `document.getElementById` script to the Ajax responseText. The current code returns me this error: `Uncaught TypeError: Cannot set property 'innerHTML' of null` This is done with Visual Studio Cordova.. Ajax: ``` $("#loginBtn").click(function() ...
2016/09/30
[ "https://Stackoverflow.com/questions/39783188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6311169/" ]
The documentation shows how to install Docker on Amazon Linux instances not ubuntu. The user youre logged in with doesnt matter, just replace the yum commands with the apt-get equivalents or switch to using an Amazon Linux AMI.
Follow below commands on ubuntu ec2 : 1. curl -fsSL <https://download.docker.com/linux/ubuntu/gpg> | sudo apt-key add -; 2. sudo add-apt-repository "deb [arch=amd64] <https://download.docker.com/linux/ubuntu> $(lsb\_release -cs) stable"; 3. sudo apt-get update -y; 4. sudo apt-cache policy docker-ce; ( Here select the ...
39,783,188
I want to call a JS Script in Ajax response. What it does is pass the `document.getElementById` script to the Ajax responseText. The current code returns me this error: `Uncaught TypeError: Cannot set property 'innerHTML' of null` This is done with Visual Studio Cordova.. Ajax: ``` $("#loginBtn").click(function() ...
2016/09/30
[ "https://Stackoverflow.com/questions/39783188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6311169/" ]
You use simple curl command to install docker on any Linux machine. **curl -SsL <https://get.docker.com> | bash** Above command will automatically solve all the dependencies and install docker.
For **Ubuntu**, you can use: **$ sudo apt-get update** you might have been checking the documentation of **RHEL** which needs $ sudo yum update -y If you are working behind a **proxy**, Make sure you configure the proxy for Docker. Hope it helps.. **:)**
39,783,188
I want to call a JS Script in Ajax response. What it does is pass the `document.getElementById` script to the Ajax responseText. The current code returns me this error: `Uncaught TypeError: Cannot set property 'innerHTML' of null` This is done with Visual Studio Cordova.. Ajax: ``` $("#loginBtn").click(function() ...
2016/09/30
[ "https://Stackoverflow.com/questions/39783188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6311169/" ]
You use simple curl command to install docker on any Linux machine. **curl -SsL <https://get.docker.com> | bash** Above command will automatically solve all the dependencies and install docker.
Follow below commands on ubuntu ec2 : 1. curl -fsSL <https://download.docker.com/linux/ubuntu/gpg> | sudo apt-key add -; 2. sudo add-apt-repository "deb [arch=amd64] <https://download.docker.com/linux/ubuntu> $(lsb\_release -cs) stable"; 3. sudo apt-get update -y; 4. sudo apt-cache policy docker-ce; ( Here select the ...
4,604
I was trying to talk about films and (marvel) comics the other day, and stumbled upon "**[evil twin](http://tvtropes.org/pmwiki/pmwiki.php/Main/EvilTwin)**". Sure, I can translate it verbatim, but that usually works badly for such fixed expressions. And then when I was trying to explain it, I couldn't think of a good ...
2012/02/08
[ "https://japanese.stackexchange.com/questions/4604", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/84/" ]
The word "trope" didn't originally apply to stock characters/plot elements in the way that it is now used in TV Tropes; this is a relatively new (as in past 50 years) usage of the word. This may be why dictionaries come up short: even some English dictionaries I checked didn't cover this meaning. There is a Japanese w...
Isn't "Doppelgänger" (`ドッペルゲンガー`) commonly used to denote "evil twin"? Well, at least an evil version of someone.
4,604
I was trying to talk about films and (marvel) comics the other day, and stumbled upon "**[evil twin](http://tvtropes.org/pmwiki/pmwiki.php/Main/EvilTwin)**". Sure, I can translate it verbatim, but that usually works badly for such fixed expressions. And then when I was trying to explain it, I couldn't think of a good ...
2012/02/08
[ "https://japanese.stackexchange.com/questions/4604", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/84/" ]
Isn't "Doppelgänger" (`ドッペルゲンガー`) commonly used to denote "evil twin"? Well, at least an evil version of someone.
I just found another one, which is exactly what I was looking for: **べた - hackneyed, cliched [1]** It's marked as "slang", though, and it might be just a version of べたべた. "Sticky" is quite close in connotation. [1]http://jisho.org/words?jap=beta&eng=&dict=edict
4,604
I was trying to talk about films and (marvel) comics the other day, and stumbled upon "**[evil twin](http://tvtropes.org/pmwiki/pmwiki.php/Main/EvilTwin)**". Sure, I can translate it verbatim, but that usually works badly for such fixed expressions. And then when I was trying to explain it, I couldn't think of a good ...
2012/02/08
[ "https://japanese.stackexchange.com/questions/4604", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/84/" ]
The word "trope" didn't originally apply to stock characters/plot elements in the way that it is now used in TV Tropes; this is a relatively new (as in past 50 years) usage of the word. This may be why dictionaries come up short: even some English dictionaries I checked didn't cover this meaning. There is a Japanese w...
I just found another one, which is exactly what I was looking for: **べた - hackneyed, cliched [1]** It's marked as "slang", though, and it might be just a version of べたべた. "Sticky" is quite close in connotation. [1]http://jisho.org/words?jap=beta&eng=&dict=edict
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Instead of having two underlying `DateTime`, I would write a class that contains one `DateTime` for the start and one `TimeSpan` for the difference between the start and end. The setter for the start would only change the `DateTime` and the setter for the end would only change the `TimeSpan` (giving an exception if it ...
OO encapsulation isn't always about pretty implementation, it's often about pretty interfaces that provide consistent "black box" behavior. If writing the code that "looks terrible" provides a smooth interface with behavior consistent with the design, then what's the big deal? I think the solution you have is perfectly...
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Well, you might think about whether it would make sense to have a type which represents a start/end combination. A sort of... [`Interval`](http://nodatime.org/1.3.x/api/html/T_NodaTime_Interval.htm). (Yes, this is a not-so-subtle plug for [Noda Time](http://nodatime.org), which makes date/time handling generally better...
Use a method to set them together: ``` public void SetDates(DateTime start, DateTime end) { if(start >= end) throw new ArgumentException("start must be before end"); this.start = start; this.end = end; } ```
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Instead of having two underlying `DateTime`, I would write a class that contains one `DateTime` for the start and one `TimeSpan` for the difference between the start and end. The setter for the start would only change the `DateTime` and the setter for the end would only change the `TimeSpan` (giving an exception if it ...
Take the validation checks out of the setters and add a validate method. You can then set them in any order without exception and check the final outcome once you think they are ready by calling validate. ``` private DateTime start; private DateTime end; public DateTime Start { get { return start; } } public DateTime...
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
OO encapsulation isn't always about pretty implementation, it's often about pretty interfaces that provide consistent "black box" behavior. If writing the code that "looks terrible" provides a smooth interface with behavior consistent with the design, then what's the big deal? I think the solution you have is perfectly...
Another way which is not listed in answers is to implement `ISupportInitialize` interface. Before modifying dates you call `BeginInit` method and after - `EndInit`. On `EndInit` validate dates. ``` public class SomeClass : ISupportInitialize { private bool initializing; private DateTime start; private Date...
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Wow. Lots of answers. Well, here's my take. Create two public properties for the start and end dates, and then add a SetStartAndEndDates method that does the validation. The public properties should have private setters. Since the `SetStartAndEndDates` method throws an error if invalid dates are set, you'll want to cr...
Use a method as a setter: ``` public void SetDates(DateTime startDate, EndDate endDate) { if (startDate <= endDate) { start = startDate; end = endDate; } else { throw new InvalidDates(); } } ```
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Wow. Lots of answers. Well, here's my take. Create two public properties for the start and end dates, and then add a SetStartAndEndDates method that does the validation. The public properties should have private setters. Since the `SetStartAndEndDates` method throws an error if invalid dates are set, you'll want to cr...
Instead of having two underlying `DateTime`, I would write a class that contains one `DateTime` for the start and one `TimeSpan` for the difference between the start and end. The setter for the start would only change the `DateTime` and the setter for the end would only change the `TimeSpan` (giving an exception if it ...
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Well, you might think about whether it would make sense to have a type which represents a start/end combination. A sort of... [`Interval`](http://nodatime.org/1.3.x/api/html/T_NodaTime_Interval.htm). (Yes, this is a not-so-subtle plug for [Noda Time](http://nodatime.org), which makes date/time handling generally better...
OO encapsulation isn't always about pretty implementation, it's often about pretty interfaces that provide consistent "black box" behavior. If writing the code that "looks terrible" provides a smooth interface with behavior consistent with the design, then what's the big deal? I think the solution you have is perfectly...
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Use a method as a setter: ``` public void SetDates(DateTime startDate, EndDate endDate) { if (startDate <= endDate) { start = startDate; end = endDate; } else { throw new InvalidDates(); } } ```
OO encapsulation isn't always about pretty implementation, it's often about pretty interfaces that provide consistent "black box" behavior. If writing the code that "looks terrible" provides a smooth interface with behavior consistent with the design, then what's the big deal? I think the solution you have is perfectly...
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Use a method to set them together: ``` public void SetDates(DateTime start, DateTime end) { if(start >= end) throw new ArgumentException("start must be before end"); this.start = start; this.end = end; } ```
OO encapsulation isn't always about pretty implementation, it's often about pretty interfaces that provide consistent "black box" behavior. If writing the code that "looks terrible" provides a smooth interface with behavior consistent with the design, then what's the big deal? I think the solution you have is perfectly...
29,131,228
I want to have two simple properties: the start date and the end date. I want to put a constraint that the start date must be before the end date. The problem arises when modifying both values - they may (together!) make a new, correct pair, but at the moment of adding them, there is an error. Simple example: ``` star...
2015/03/18
[ "https://Stackoverflow.com/questions/29131228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4610370/" ]
Wow. Lots of answers. Well, here's my take. Create two public properties for the start and end dates, and then add a SetStartAndEndDates method that does the validation. The public properties should have private setters. Since the `SetStartAndEndDates` method throws an error if invalid dates are set, you'll want to cr...
OO encapsulation isn't always about pretty implementation, it's often about pretty interfaces that provide consistent "black box" behavior. If writing the code that "looks terrible" provides a smooth interface with behavior consistent with the design, then what's the big deal? I think the solution you have is perfectly...
17,165,156
I am getting error when trying to import .mm file to another one. Its build like that : first class `FailedMenuLayer` is .mm and have in its .h : ``` #import "gameScene.h" ``` second class `gameScene` is .mm, and have in its .h : ``` #import "FailedMenuLayer.h" FailedMenuLayer *menuGO; //here i get the error: u...
2013/06/18
[ "https://Stackoverflow.com/questions/17165156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/721925/" ]
It looks like an import cycle. One way to fix it is to move the "gameScene.h" import to the .mm file. It's actually a good practice to keep the imports in the .h file limited only to what you actually need in the header and keep everything else in the .mm file. If you need the import in the header try using @class i...
you are not importing ".mm" file, you are importing it's header. Check your build phases> compile sources for your .mm file to be listed there. That might be your issue
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Most website control panels (assuming you've got cPanel or something similar running) include a crontab application. If you're on shared hosting ask your host about this. If you're on a dedicated server and have installed cron then have a look at the [crontab syntax](http://en.wikipedia.org/wiki/Cron#crontab_syntax). ...
You're conflating a language with a framework. PHP doesn't have a cron scheduling any more than Ruby does. If you're using a PHP framework or cms however, there is likely some utility for cron tasks. Here is a useful link if you have control over the machine. [http://troy.jdmz.net/cron/](http://troy.jdmz.net/cron) I...
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Most website control panels (assuming you've got cPanel or something similar running) include a crontab application. If you're on shared hosting ask your host about this. If you're on a dedicated server and have installed cron then have a look at the [crontab syntax](http://en.wikipedia.org/wiki/Cron#crontab_syntax). ...
There is [PHP-Resque](http://github.com/chrisboulton/php-resque), a PHP port of the queue&background process framework written by GitHub guys.
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Most website control panels (assuming you've got cPanel or something similar running) include a crontab application. If you're on shared hosting ask your host about this. If you're on a dedicated server and have installed cron then have a look at the [crontab syntax](http://en.wikipedia.org/wiki/Cron#crontab_syntax). ...
I recommend <http://www.phpjobscheduler.co.uk/>
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Here's a semi-PHP solution to add to a crontab: ``` $cmd = 'crontab -l > /tmp/crontab.bak'; // preserve current crontab $cmd .= ' && echo "*/5 * * * * /foo/bar" >> /tmp/crontab.bak'; // append new command $cmd .= ' && crontab /tmp/crontab.bak'; // update crontab $cmd .= ' rm /tmp/crontab.bak'; // delete temp file ex...
You're conflating a language with a framework. PHP doesn't have a cron scheduling any more than Ruby does. If you're using a PHP framework or cms however, there is likely some utility for cron tasks. Here is a useful link if you have control over the machine. [http://troy.jdmz.net/cron/](http://troy.jdmz.net/cron) I...
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
There is [PHP-Resque](http://github.com/chrisboulton/php-resque), a PHP port of the queue&background process framework written by GitHub guys.
You're conflating a language with a framework. PHP doesn't have a cron scheduling any more than Ruby does. If you're using a PHP framework or cms however, there is likely some utility for cron tasks. Here is a useful link if you have control over the machine. [http://troy.jdmz.net/cron/](http://troy.jdmz.net/cron) I...
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I recommend <http://www.phpjobscheduler.co.uk/>
You're conflating a language with a framework. PHP doesn't have a cron scheduling any more than Ruby does. If you're using a PHP framework or cms however, there is likely some utility for cron tasks. Here is a useful link if you have control over the machine. [http://troy.jdmz.net/cron/](http://troy.jdmz.net/cron) I...
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Here's a semi-PHP solution to add to a crontab: ``` $cmd = 'crontab -l > /tmp/crontab.bak'; // preserve current crontab $cmd .= ' && echo "*/5 * * * * /foo/bar" >> /tmp/crontab.bak'; // append new command $cmd .= ' && crontab /tmp/crontab.bak'; // update crontab $cmd .= ' rm /tmp/crontab.bak'; // delete temp file ex...
There is [PHP-Resque](http://github.com/chrisboulton/php-resque), a PHP port of the queue&background process framework written by GitHub guys.
448,132
How can I easily and simply schedule a cron job in PHP? Rails has BackgroundRB...
2009/01/15
[ "https://Stackoverflow.com/questions/448132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Here's a semi-PHP solution to add to a crontab: ``` $cmd = 'crontab -l > /tmp/crontab.bak'; // preserve current crontab $cmd .= ' && echo "*/5 * * * * /foo/bar" >> /tmp/crontab.bak'; // append new command $cmd .= ' && crontab /tmp/crontab.bak'; // update crontab $cmd .= ' rm /tmp/crontab.bak'; // delete temp file ex...
I recommend <http://www.phpjobscheduler.co.uk/>
45,866,145
We are implementing a number of SDK's for our suite of hardware sensors. Having successfully got a working C API for one of our sensors, we are now starting the arduous task of testing the SDK to ensure that we haven't introduced any fatal bugs, memory leaks or race conditions. One of our engineers has reported that ...
2017/08/24
[ "https://Stackoverflow.com/questions/45866145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321263/" ]
Unfortunately at this time there's no API for Google Shopping (or for Google Keep, which is fairly similar) [Is there a Google Keep API?](https://stackoverflow.com/questions/19196238/is-there-a-google-keep-api)
(Almost?) All public software products of Google have some sort of API. Thumb rule: You can access the product via app, website or similar? Then there will be an API. You can however create a thread over on googles suggestion site and request an api for the shopping list, if no one has done so. :)
45,866,145
We are implementing a number of SDK's for our suite of hardware sensors. Having successfully got a working C API for one of our sensors, we are now starting the arduous task of testing the SDK to ensure that we haven't introduced any fatal bugs, memory leaks or race conditions. One of our engineers has reported that ...
2017/08/24
[ "https://Stackoverflow.com/questions/45866145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321263/" ]
Unfortunately at this time there's no API for Google Shopping (or for Google Keep, which is fairly similar) [Is there a Google Keep API?](https://stackoverflow.com/questions/19196238/is-there-a-google-keep-api)
Also looking for the same. Have been browsing around with no results. Wrote them feedback but I doubt that they will do anything as the page seems so empty... Although I found that Amazon Alexa has all the needed documentation to access shopping lists and todo lists: <https://developer.amazon.com/docs/custom-skills/ac...
45,866,145
We are implementing a number of SDK's for our suite of hardware sensors. Having successfully got a working C API for one of our sensors, we are now starting the arduous task of testing the SDK to ensure that we haven't introduced any fatal bugs, memory leaks or race conditions. One of our engineers has reported that ...
2017/08/24
[ "https://Stackoverflow.com/questions/45866145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321263/" ]
Unfortunately at this time there's no API for Google Shopping (or for Google Keep, which is fairly similar) [Is there a Google Keep API?](https://stackoverflow.com/questions/19196238/is-there-a-google-keep-api)
You can get the JSON from this endpoint, assuming you're authenticated. You'll have to pass the cookie and maybe a few other headers - not sure. But, it could get the job done... Sign into your account and go to <https://shoppinglist.google.com>. From there, open up your networking tab in your dev console, check the r...
45,866,145
We are implementing a number of SDK's for our suite of hardware sensors. Having successfully got a working C API for one of our sensors, we are now starting the arduous task of testing the SDK to ensure that we haven't introduced any fatal bugs, memory leaks or race conditions. One of our engineers has reported that ...
2017/08/24
[ "https://Stackoverflow.com/questions/45866145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321263/" ]
Unfortunately at this time there's no API for Google Shopping (or for Google Keep, which is fairly similar) [Is there a Google Keep API?](https://stackoverflow.com/questions/19196238/is-there-a-google-keep-api)
You can export shopping lists in a CSV format using <https://takeout.google.com>. A download link can be emailed or a file can be dropped in Drive, Dropbox etc. This can be configured to export every two months for 1 year. The data contains the name of the item, the quantity, if it is checked or not, and any additiona...
45,866,145
We are implementing a number of SDK's for our suite of hardware sensors. Having successfully got a working C API for one of our sensors, we are now starting the arduous task of testing the SDK to ensure that we haven't introduced any fatal bugs, memory leaks or race conditions. One of our engineers has reported that ...
2017/08/24
[ "https://Stackoverflow.com/questions/45866145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321263/" ]
Also looking for the same. Have been browsing around with no results. Wrote them feedback but I doubt that they will do anything as the page seems so empty... Although I found that Amazon Alexa has all the needed documentation to access shopping lists and todo lists: <https://developer.amazon.com/docs/custom-skills/ac...
(Almost?) All public software products of Google have some sort of API. Thumb rule: You can access the product via app, website or similar? Then there will be an API. You can however create a thread over on googles suggestion site and request an api for the shopping list, if no one has done so. :)
45,866,145
We are implementing a number of SDK's for our suite of hardware sensors. Having successfully got a working C API for one of our sensors, we are now starting the arduous task of testing the SDK to ensure that we haven't introduced any fatal bugs, memory leaks or race conditions. One of our engineers has reported that ...
2017/08/24
[ "https://Stackoverflow.com/questions/45866145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321263/" ]
You can get the JSON from this endpoint, assuming you're authenticated. You'll have to pass the cookie and maybe a few other headers - not sure. But, it could get the job done... Sign into your account and go to <https://shoppinglist.google.com>. From there, open up your networking tab in your dev console, check the r...
(Almost?) All public software products of Google have some sort of API. Thumb rule: You can access the product via app, website or similar? Then there will be an API. You can however create a thread over on googles suggestion site and request an api for the shopping list, if no one has done so. :)
45,866,145
We are implementing a number of SDK's for our suite of hardware sensors. Having successfully got a working C API for one of our sensors, we are now starting the arduous task of testing the SDK to ensure that we haven't introduced any fatal bugs, memory leaks or race conditions. One of our engineers has reported that ...
2017/08/24
[ "https://Stackoverflow.com/questions/45866145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321263/" ]
You can export shopping lists in a CSV format using <https://takeout.google.com>. A download link can be emailed or a file can be dropped in Drive, Dropbox etc. This can be configured to export every two months for 1 year. The data contains the name of the item, the quantity, if it is checked or not, and any additiona...
(Almost?) All public software products of Google have some sort of API. Thumb rule: You can access the product via app, website or similar? Then there will be an API. You can however create a thread over on googles suggestion site and request an api for the shopping list, if no one has done so. :)