qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
49,106
I have a Hamilton Beach 6 qt Set 'N Forget Programmable slow cooker, and I keep having the same problem-- when I try to make beef stew, the beef comes out almost inedibly tough, and the veggies don't soften. I can't for the life of me figure out what's wrong! My cooking method: > > Put in 1.5ish lbs stew beef-- the ...
2014/10/20
[ "https://cooking.stackexchange.com/questions/49106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/28794/" ]
I always leave my crocpot on low, not warm. The meat and potatoes are always tender.
Beef is generally a pretty hard meat to break down compared to other meats. Takes longer to chew, longer to digest, and requires more heat to make it tender during the cooking process. So while a crock pot is fine for most of the operation, you'll meet with the desired success if you'll instead braise your cut of beef ...
49,106
I have a Hamilton Beach 6 qt Set 'N Forget Programmable slow cooker, and I keep having the same problem-- when I try to make beef stew, the beef comes out almost inedibly tough, and the veggies don't soften. I can't for the life of me figure out what's wrong! My cooking method: > > Put in 1.5ish lbs stew beef-- the ...
2014/10/20
[ "https://cooking.stackexchange.com/questions/49106", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/28794/" ]
Start the pot on HIGH until it is all hot and bubbly to get it started, around 15 to 30 minutes while you are cleaning up the kitchen. Then turn to LOW to cook. The WARM setting it just to hold the meal until you are ready to serve the meal. WARM setting is designed to NOT COOK the meal.
Beef is generally a pretty hard meat to break down compared to other meats. Takes longer to chew, longer to digest, and requires more heat to make it tender during the cooking process. So while a crock pot is fine for most of the operation, you'll meet with the desired success if you'll instead braise your cut of beef ...
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
The right usage is: ``` .nav li { display: inline; } ```
You should put display: inline-block;
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
You should put display: inline-block;
in orther to display betther ur nav thing u shuld not use .nav ul li `display:inline` i know i say that was for answer ur question but this thing i will tell you will be betther .nav ul li`float:left` this will do the items in the li will float left and will do the same as the inline but isbetther to use that rather t...
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
If you want `background(image)` you need to have it in the `container` as soon you give it `width` and `height` because `body` is the **"Base"** you can give it `margin: 0; padding: 0;` to reset it only and you can add `background` to it **but not** `height` and `width`. Inside `container`you have created you can play ...
You should put display: inline-block;
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
The right usage is: ``` .nav li { display: inline; } ```
Man try to put .nav ul lit to refer to the li but I will not use that let me tell you now one sec ``` .nav ul li`display:inline` ```
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
Man try to put .nav ul lit to refer to the li but I will not use that let me tell you now one sec ``` .nav ul li`display:inline` ```
in orther to display betther ur nav thing u shuld not use .nav ul li `display:inline` i know i say that was for answer ur question but this thing i will tell you will be betther .nav ul li`float:left` this will do the items in the li will float left and will do the same as the inline but isbetther to use that rather t...
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
If you want `background(image)` you need to have it in the `container` as soon you give it `width` and `height` because `body` is the **"Base"** you can give it `margin: 0; padding: 0;` to reset it only and you can add `background` to it **but not** `height` and `width`. Inside `container`you have created you can play ...
Man try to put .nav ul lit to refer to the li but I will not use that let me tell you now one sec ``` .nav ul li`display:inline` ```
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
The right usage is: ``` .nav li { display: inline; } ```
in orther to display betther ur nav thing u shuld not use .nav ul li `display:inline` i know i say that was for answer ur question but this thing i will tell you will be betther .nav ul li`float:left` this will do the items in the li will float left and will do the same as the inline but isbetther to use that rather t...
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
If you want `background(image)` you need to have it in the `container` as soon you give it `width` and `height` because `body` is the **"Base"** you can give it `margin: 0; padding: 0;` to reset it only and you can add `background` to it **but not** `height` and `width`. Inside `container`you have created you can play ...
The right usage is: ``` .nav li { display: inline; } ```
30,946,625
Im learning html & css and after few tutorials I decided to write webpage from nothing. But I've got a problem. When I add *"display: inline"* in CSS **.nav**, it ignores all .**nav** css properties, including *"display: inline"*. Here's code: **HTML** ``` <!DOCTYPE html> <html> <head> <link href="main....
2015/06/19
[ "https://Stackoverflow.com/questions/30946625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5029670/" ]
If you want `background(image)` you need to have it in the `container` as soon you give it `width` and `height` because `body` is the **"Base"** you can give it `margin: 0; padding: 0;` to reset it only and you can add `background` to it **but not** `height` and `width`. Inside `container`you have created you can play ...
in orther to display betther ur nav thing u shuld not use .nav ul li `display:inline` i know i say that was for answer ur question but this thing i will tell you will be betther .nav ul li`float:left` this will do the items in the li will float left and will do the same as the inline but isbetther to use that rather t...
61,593,505
I know this goes against all DB normalization principals but I cannot change the design at this point. I have a column that has values stored like this (SQL Server database): ``` 5;26;31;49 ``` There's another table that has translation for this values which looks like this: ``` Code Value ------------------- 5...
2020/05/04
[ "https://Stackoverflow.com/questions/61593505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1392848/" ]
this is the syntax.. use it as appropriate in you code: ``` mTextInputLayout.getEditText().setText("ur text"); ``` and ``` mTextInputLayout.getEditText().getText() ```
Example: ``` TextInputEditText inpedit_txt; inpedit_txt = (TextInputEditText)findViewById(R.id.id_of_input_edit_text); inpedit_txt.setText(String.valueOf("you Text")) ```
3,428,966
is there any shortcut key to do this?
2010/08/07
[ "https://Stackoverflow.com/questions/3428966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4653/" ]
`Ctrl` + `Shift` + `.` to zoom in and `Ctrl` + `Shift` + `,` to zoom out. You can get download the shortcut posters [here](http://www.microsoft.com/downloads/details.aspx?FamilyID=92CED922-D505-457A-8C9C-84036160639F&displaylang=en)
In my install, I find that I have to head in through Tools -> Options -> Environment -> Keyboard and map "View.ZoomIn" and "View.ZoomOut" to get this working. This could be because ReSharper has modified my keyboard shortcuts, however.
54,224,669
I'm trying to extend the property decorator to my own needs, but I don't know how to access the attributes and methods in the extended property ``` class myproperty(property): def __init__(self, tooltip, cls_name, fget=None, fset=None, fdel=None, doc=None, **kwargs ): super().__init__(fget=fge...
2019/01/16
[ "https://Stackoverflow.com/questions/54224669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7725690/" ]
You need a mask: ``` # Set a default value data['rwasted'] = data['republican'] - data['votestowin'] # Find where it is different mask = data['democrat'] >= data['republican'] # Set those rows to another value data['rwasted'][mask] = data['republican'] ``` No if-else statement needed, *no* for loop needed either. Yo...
`.all()` is a function that applies to an entire `Series`, not a single `row`. You are mixing concepts here. To do a row-by-row comparison (as you want to do): ``` myseries = [] for idx, row in data.iterrows(): if row['democrat'] >= row['republican']: myseries.append(row['republican']) else: my...
34,336,122
I am creating a regex for controlling the attacks to my website.I am using regex to compare the parameters that it should not contain the word 'script' in it and also should not have special character curly braces `{ and }`. So using the java pattern matcher adding the regex I am not able to reject this param value ...
2015/12/17
[ "https://Stackoverflow.com/questions/34336122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1729522/" ]
Alternatively, you can think of the problem the other way. Instead of focusing on ***what you don't want***, focus ***on what you want***. ### What are the valid values for the param? * Find the response to this question * Build a regex pattern that will match the valid values only. Thus, any invalid value will b...
Instead of trying to prevent the input of harmful parameters, you should try to make sure that their output doesn't happen in an unpredictable way. Since you can use URL encoding and other tricks to get `<script>` to the server, you should be making sure that everywhere you're displaying data that has been input by th...
17,717,623
The content of `a.txt` : `ba.txt` When I type `cat a.txt | xargs vi`, vi open the `ba.txt` and everything seems to be OK... But when I exit the vi, I find my bash is abnormal..I can't see the instructions I type in. I typed `ls`. I can't see it, but when I press the enter, the result is displayed(in a strange way..)....
2013/07/18
[ "https://Stackoverflow.com/questions/17717623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1291716/" ]
Your `bash` shell is not destroyed. It is just that your terminal is in some bad state -because you sent strange bytes to it- (a terminal has some state -and the terminal emulator and the kernel manage that state, which persists after the process having wrongly changed it. See e.g. the [stty(1)](http://man7.org/linux/m...
If vi/vim is invoked from inside the pipeline, the `stdin` is connected to the previous pipeline's output, not the terminal. vi/vim is an interactive command, that needs to receive its input from the terminal (tty). **Bottomline:** You can't pipe to xargs vim, since vim expects input to come from an **interactive term...
17,717,623
The content of `a.txt` : `ba.txt` When I type `cat a.txt | xargs vi`, vi open the `ba.txt` and everything seems to be OK... But when I exit the vi, I find my bash is abnormal..I can't see the instructions I type in. I typed `ls`. I can't see it, but when I press the enter, the result is displayed(in a strange way..)....
2013/07/18
[ "https://Stackoverflow.com/questions/17717623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1291716/" ]
Your `bash` shell is not destroyed. It is just that your terminal is in some bad state -because you sent strange bytes to it- (a terminal has some state -and the terminal emulator and the kernel manage that state, which persists after the process having wrongly changed it. See e.g. the [stty(1)](http://man7.org/linux/m...
I think Basile's answer explained well for the reason of why your terminal gets screwed up. also he gave a solution `stty sane`. When I want to open files as result of `find, grep -l ...(in your case, the cat too)` I do: ``` vim $(find . ...) ``` you could try: ``` vim $(cat a.txt) ``` Zhu Ni Hao Yun. :)
17,717,623
The content of `a.txt` : `ba.txt` When I type `cat a.txt | xargs vi`, vi open the `ba.txt` and everything seems to be OK... But when I exit the vi, I find my bash is abnormal..I can't see the instructions I type in. I typed `ls`. I can't see it, but when I press the enter, the result is displayed(in a strange way..)....
2013/07/18
[ "https://Stackoverflow.com/questions/17717623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1291716/" ]
If vi/vim is invoked from inside the pipeline, the `stdin` is connected to the previous pipeline's output, not the terminal. vi/vim is an interactive command, that needs to receive its input from the terminal (tty). **Bottomline:** You can't pipe to xargs vim, since vim expects input to come from an **interactive term...
I think Basile's answer explained well for the reason of why your terminal gets screwed up. also he gave a solution `stty sane`. When I want to open files as result of `find, grep -l ...(in your case, the cat too)` I do: ``` vim $(find . ...) ``` you could try: ``` vim $(cat a.txt) ``` Zhu Ni Hao Yun. :)
270,383
I have my KVM guests on a standard br0 bridge setup: ``` auto br0 iface br0 inet static address 192.168.1.117 netmask 255.255.255.0 network 192.168.1.1 broadcast 192.168.1.225 gateway 192.168.1.1 bridge_ports eth0 bridge_stp off bridge_fd 0 auto eth1 iface eth1 inet static address 10.0.0.117 n...
2011/05/17
[ "https://serverfault.com/questions/270383", "https://serverfault.com", "https://serverfault.com/users/46688/" ]
I tried to make a template for the simple set of iptables rules for your problem, try this out: ``` iptables -t filter -A FORWARD -m physdev --physdev-in $LINK_FOR_THE_VM --physdev-is-bridged -j ${VMID}-out iptables -t filter -A ${VMID}-out -m mac ! --mac-source $MAC_ADDR_FOR_THE_VIRTUAL_NIC -j DROP iptables -t filter...
As far as I can see you just can't do some of the things you need to do with iptables. You need filtering at the bridge level. You should probably take a look at [ebtables](http://ebtables.sourceforge.net/) - it's like iptables for bridges. Manual: <http://ebtables.sourceforge.net/misc/ebtables-man.html>
51,605,831
I'm trying to save my data where I get the data from JSON and I want to save it for login activity. In login activity I want it to check if the data exist so it no need to login anymore. So I using `SharedPreferences` to save the data but I don't know it saved or not because I can't track it if the app terminated. But ...
2018/07/31
[ "https://Stackoverflow.com/questions/51605831", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9823690/" ]
``` token2 = sharedPreferences.getString("token", ""); ``` it will get default value `""` so it not be null for that you have to try this ``` if(TextUtils.isEmpty(token2)){ // your code } ```
**Write to shared preferences** To write to a shared preferences file, create a SharedPreferences.Editor by calling edit() on your SharedPreferences. Pass the keys and values you want to write with methods such as `putInt()` and putString(). Then call `apply()` or `commit()` to save the changes. For example: ``` Sha...
7,043,761
We have a Grails (1.3.7) application deployed to 2 web servers that are sitting behind a load balancer. The problem we're seeing is that when we modify the RequestMaps the springSecurityService.clearCachedRequestmaps() only gets called on whatever server the user has a session to at that time. So that cache isn't getti...
2011/08/12
[ "https://Stackoverflow.com/questions/7043761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261159/" ]
Fundamentally, you want a `CompositeEditor` to handle cases where objects are dynamically added or removed from the Editor hierarchy. The `ListEditor` and `OptionalFieldEditor` adaptors implement `CompositeEditor`. If the information required for the different types of questions is fundamentally orthogonal, then multi...
Regarding your question why subtype specific data isn't displayed or flushed: My scenario is a little bit different but I made the following observation: GWT editor databinding does not work as one would expect with abstract editors in the editor hierarchy. The subEditor declared in your QuestionDataEditor is of type...
7,043,761
We have a Grails (1.3.7) application deployed to 2 web servers that are sitting behind a load balancer. The problem we're seeing is that when we modify the RequestMaps the springSecurityService.clearCachedRequestmaps() only gets called on whatever server the user has a session to at that time. So that cache isn't getti...
2011/08/12
[ "https://Stackoverflow.com/questions/7043761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261159/" ]
Fundamentally, you want a `CompositeEditor` to handle cases where objects are dynamically added or removed from the Editor hierarchy. The `ListEditor` and `OptionalFieldEditor` adaptors implement `CompositeEditor`. If the information required for the different types of questions is fundamentally orthogonal, then multi...
We implemented similar approach (see accepted answer) and it works for us like this. Since driver is initially unaware of simple editor paths that might be used by sub-editors, every sub-editor has own driver: ``` public interface CreatesEditorDriver<T> { RequestFactoryEditorDriver<T, ? extends Editor<T>> createD...
7,043,761
We have a Grails (1.3.7) application deployed to 2 web servers that are sitting behind a load balancer. The problem we're seeing is that when we modify the RequestMaps the springSecurityService.clearCachedRequestmaps() only gets called on whatever server the user has a session to at that time. So that cache isn't getti...
2011/08/12
[ "https://Stackoverflow.com/questions/7043761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261159/" ]
Fundamentally, you want a `CompositeEditor` to handle cases where objects are dynamically added or removed from the Editor hierarchy. The `ListEditor` and `OptionalFieldEditor` adaptors implement `CompositeEditor`. If the information required for the different types of questions is fundamentally orthogonal, then multi...
Isn't the fundamental problem that the binding happens at compile time so will only bind to QuestionDataProxy so won't have sub-type specific bindings? The CompositeEditor javadoc says "An interface that indicates that a given Editor is composed of an unknown number of sub-Editors all of the same type" so that rules th...
7,043,761
We have a Grails (1.3.7) application deployed to 2 web servers that are sitting behind a load balancer. The problem we're seeing is that when we modify the RequestMaps the springSecurityService.clearCachedRequestmaps() only gets called on whatever server the user has a session to at that time. So that cache isn't getti...
2011/08/12
[ "https://Stackoverflow.com/questions/7043761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261159/" ]
We implemented similar approach (see accepted answer) and it works for us like this. Since driver is initially unaware of simple editor paths that might be used by sub-editors, every sub-editor has own driver: ``` public interface CreatesEditorDriver<T> { RequestFactoryEditorDriver<T, ? extends Editor<T>> createD...
Regarding your question why subtype specific data isn't displayed or flushed: My scenario is a little bit different but I made the following observation: GWT editor databinding does not work as one would expect with abstract editors in the editor hierarchy. The subEditor declared in your QuestionDataEditor is of type...
7,043,761
We have a Grails (1.3.7) application deployed to 2 web servers that are sitting behind a load balancer. The problem we're seeing is that when we modify the RequestMaps the springSecurityService.clearCachedRequestmaps() only gets called on whatever server the user has a session to at that time. So that cache isn't getti...
2011/08/12
[ "https://Stackoverflow.com/questions/7043761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261159/" ]
Regarding your question why subtype specific data isn't displayed or flushed: My scenario is a little bit different but I made the following observation: GWT editor databinding does not work as one would expect with abstract editors in the editor hierarchy. The subEditor declared in your QuestionDataEditor is of type...
Isn't the fundamental problem that the binding happens at compile time so will only bind to QuestionDataProxy so won't have sub-type specific bindings? The CompositeEditor javadoc says "An interface that indicates that a given Editor is composed of an unknown number of sub-Editors all of the same type" so that rules th...
7,043,761
We have a Grails (1.3.7) application deployed to 2 web servers that are sitting behind a load balancer. The problem we're seeing is that when we modify the RequestMaps the springSecurityService.clearCachedRequestmaps() only gets called on whatever server the user has a session to at that time. So that cache isn't getti...
2011/08/12
[ "https://Stackoverflow.com/questions/7043761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261159/" ]
We implemented similar approach (see accepted answer) and it works for us like this. Since driver is initially unaware of simple editor paths that might be used by sub-editors, every sub-editor has own driver: ``` public interface CreatesEditorDriver<T> { RequestFactoryEditorDriver<T, ? extends Editor<T>> createD...
Isn't the fundamental problem that the binding happens at compile time so will only bind to QuestionDataProxy so won't have sub-type specific bindings? The CompositeEditor javadoc says "An interface that indicates that a given Editor is composed of an unknown number of sub-Editors all of the same type" so that rules th...
59,680,369
credit table and validtransaction table have million record data from year 2008 onwards. We are doing a migration. So I need to find out the credittypeids which are no longer in use after 2017 (periodseq=1055), so that these need not be migrated. This is the query and the >= part is resulting in huge cost. Please su...
2020/01/10
[ "https://Stackoverflow.com/questions/59680369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11352888/" ]
I'm thinking aggregation: ``` SELECT C.CREDITTYPEID FROM CREDIT C GROUP BY C.CREDITTYPEID HAVING MAX(C.PERIODSEQ) < 1055; ``` This assumes that the credit type is used in at least one credit record. Otherwise, for your version of the query, you specifically want an index on `CREDIT(CREDITTYPEID, PERIODSEQ)`. The or...
The following index on the `CREDIT` table should help: ``` CREATE INDEX idx ON CREDIT (PERIODSEQ, CREDITTYPEID); ``` This should allow the `EXISTS` clause lookup to evaluate more quickly. You could also try the following variant index, which reverses the order of the columns: ``` CREATE INDEX idx ON CREDIT (CREDITT...
59,680,369
credit table and validtransaction table have million record data from year 2008 onwards. We are doing a migration. So I need to find out the credittypeids which are no longer in use after 2017 (periodseq=1055), so that these need not be migrated. This is the query and the >= part is resulting in huge cost. Please su...
2020/01/10
[ "https://Stackoverflow.com/questions/59680369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11352888/" ]
This should return your (distinct!) list of `CREDITTYPEID` that were used in the past, but are not used curretnly (after PERIODSEQ 1055) ``` SELECT CREDITTYPEID /* used before 1055 */ FROM CREDITTYPE ct WHERE PERIODSEQ < 1055 MINUS SELECT CREDITTYPEID /* used after 1055 */ FROM CREDITTYPE ct WHERE PERIODSEQ>=1055; `...
The following index on the `CREDIT` table should help: ``` CREATE INDEX idx ON CREDIT (PERIODSEQ, CREDITTYPEID); ``` This should allow the `EXISTS` clause lookup to evaluate more quickly. You could also try the following variant index, which reverses the order of the columns: ``` CREATE INDEX idx ON CREDIT (CREDITT...
20,183,599
I'm trying to sort the integers of an array, but I keep getting errors with what I try. I've tried sort(array); array.sort(); Arrays.sort(array); and Arrays.sort(); but nothing works. Help would be appreciated. The error I get for this Arrays.sort(array) is Cannot find symbol, symbol variable Arrays location: class Mai...
2013/11/25
[ "https://Stackoverflow.com/questions/20183599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2802854/" ]
Your code does work. (It does sort the array.) I believe your confusion might be because the unsorted and sorted output of `printArray` appear together on the same line and it is very hard to see. Put a line break at the end of the `printArray` method, and it will be clear that the result is sorted: ``` System.out.pri...
Actually, the code you used is working. You can make some change in main method to make the array printed in console more cleraly. like ``` System.out.println("Before sorting..."); printArray(array); array = sortArray(array); System.out.println("\nAfter sorting..."); printArray(array); ``` **An...
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
Finally is ALWAYS called, regardless of exceptions and even return statements. I recommend checking the [Documentation](http://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html) on it.
The `finally` block is always executed. It is designed so that you can perform important operations regardless of any exceptions being thrown, for example close streams.
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
Finally is ALWAYS called, regardless of exceptions and even return statements. I recommend checking the [Documentation](http://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html) on it.
finally block is called in each cases.
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
`finally` is always called(even if you call `return;`), unless you call ``` System.exit(); ``` in `try` or `catch` block.
finally block is called in each cases.
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
Finally is ALWAYS called, regardless of exceptions and even return statements. I recommend checking the [Documentation](http://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html) on it.
`finally` is always called(even if you call `return;`), unless you call ``` System.exit(); ``` in `try` or `catch` block.
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
Finally is ALWAYS called, regardless of exceptions and even return statements. I recommend checking the [Documentation](http://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html) on it.
It will **always** be called in the event of an exception. For that matter, it will always be called, period. That's what it's for.
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
It will **always** be called in the event of an exception. For that matter, it will always be called, period. That's what it's for.
finally block is called in each cases.
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
It will **always** be called in the event of an exception. For that matter, it will always be called, period. That's what it's for.
The `finally` block is always executed. It is designed so that you can perform important operations regardless of any exceptions being thrown, for example close streams.
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
`finally` is always called(even if you call `return;`), unless you call ``` System.exit(); ``` in `try` or `catch` block.
Yes, `finally` is ALWAYS executed, no matter what happens, short of the JVM dying before your code is reached. It will even get called in this case: ``` public boolean doSomething() throws Exception{ boolean iDidIt = true; try{ //attempt to do it return iDidIt; catch(Exception e){ i...
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
Finally is ALWAYS called, regardless of exceptions and even return statements. I recommend checking the [Documentation](http://docs.oracle.com/javase/tutorial/essential/exceptions/finally.html) on it.
Yes, `finally` is ALWAYS executed, no matter what happens, short of the JVM dying before your code is reached. It will even get called in this case: ``` public boolean doSomething() throws Exception{ boolean iDidIt = true; try{ //attempt to do it return iDidIt; catch(Exception e){ i...
19,710,323
If I have the following code ``` try { //some stuff here catch (Exception e) { throw new CustomException(); } finally { finalize(); } ``` where `CustomException` is a checked exception, Will the `finally` block be called in the event of an `Exception`? EDIT: Perhaps "finalize()" was a poor choice of wo...
2013/10/31
[ "https://Stackoverflow.com/questions/19710323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085316/" ]
`finally` is always called(even if you call `return;`), unless you call ``` System.exit(); ``` in `try` or `catch` block.
The `finally` block is always executed. It is designed so that you can perform important operations regardless of any exceptions being thrown, for example close streams.
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
Reinterpretations of symbols are a common occurence: 1. The letter *x* given the meaning "hazard": [![enter image description here](https://i.stack.imgur.com/m4OpI.png)](https://i.stack.imgur.com/m4OpI.png) 2. The hazard symbol given the meaning "intoxication" or "death": [![enter image description here](https://i.s...
If it is a well known symbol, I sincerely doubt it; unless you are writing a farce or comedy. The issue is I don't think the reader can divorce themselves from the symbol triggering the well-known meaning. As an example, for an American, "FBI" means one thing, it is a symbol. No matter what you do in your book or movi...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
Reinterpretations of symbols are a common occurence: 1. The letter *x* given the meaning "hazard": [![enter image description here](https://i.stack.imgur.com/m4OpI.png)](https://i.stack.imgur.com/m4OpI.png) 2. The hazard symbol given the meaning "intoxication" or "death": [![enter image description here](https://i.s...
What are you trying to accomplish here? If a symbol is well known, getting that meaning out of reader's heads is very hard. Like if you decided that in your story the dollar sign, $, will be a symbol for, I don't know, a new political party, I think readers would be asking, So what does this party have to do with mone...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
If it is a well known symbol, I sincerely doubt it; unless you are writing a farce or comedy. The issue is I don't think the reader can divorce themselves from the symbol triggering the well-known meaning. As an example, for an American, "FBI" means one thing, it is a symbol. No matter what you do in your book or movi...
Short Answer **It Depends on your world.** Long Answer: If your world supposedly is a battle between Real and Mirror world, then you can formulate the meaning of the existing symbols of real world to work exactly opposite in Mirror world. If your world is on different planet, you can set up your own meanings for th...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
Reinterpretations of symbols are a common occurence: 1. The letter *x* given the meaning "hazard": [![enter image description here](https://i.stack.imgur.com/m4OpI.png)](https://i.stack.imgur.com/m4OpI.png) 2. The hazard symbol given the meaning "intoxication" or "death": [![enter image description here](https://i.s...
Can you completely replace the meaning in the reader's mind? Probably not - it's pretty similar to trying to change the definition of a word. What might be easier is the change the symbol's meaning *for your PoV characters*. Try showing the change from their perspectives. Add some event that makes the question their i...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
Can you completely replace the meaning in the reader's mind? Probably not - it's pretty similar to trying to change the definition of a word. What might be easier is the change the symbol's meaning *for your PoV characters*. Try showing the change from their perspectives. Add some event that makes the question their i...
Short Answer **It Depends on your world.** Long Answer: If your world supposedly is a battle between Real and Mirror world, then you can formulate the meaning of the existing symbols of real world to work exactly opposite in Mirror world. If your world is on different planet, you can set up your own meanings for th...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
To both create the new meaning and repudiate the old might be nearly impossible. We are a symbolic creature at heart, always seeking pattern and meaning and seeing things that might never have been intended. Meanings abide. Laurels are still a symbol of victory and success though millennia have passed since they wer...
Short Answer **It Depends on your world.** Long Answer: If your world supposedly is a battle between Real and Mirror world, then you can formulate the meaning of the existing symbols of real world to work exactly opposite in Mirror world. If your world is on different planet, you can set up your own meanings for th...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
If it is a well known symbol, I sincerely doubt it; unless you are writing a farce or comedy. The issue is I don't think the reader can divorce themselves from the symbol triggering the well-known meaning. As an example, for an American, "FBI" means one thing, it is a symbol. No matter what you do in your book or movi...
What are you trying to accomplish here? If a symbol is well known, getting that meaning out of reader's heads is very hard. Like if you decided that in your story the dollar sign, $, will be a symbol for, I don't know, a new political party, I think readers would be asking, So what does this party have to do with mone...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
Reinterpretations of symbols are a common occurence: 1. The letter *x* given the meaning "hazard": [![enter image description here](https://i.stack.imgur.com/m4OpI.png)](https://i.stack.imgur.com/m4OpI.png) 2. The hazard symbol given the meaning "intoxication" or "death": [![enter image description here](https://i.s...
To both create the new meaning and repudiate the old might be nearly impossible. We are a symbolic creature at heart, always seeking pattern and meaning and seeing things that might never have been intended. Meanings abide. Laurels are still a symbol of victory and success though millennia have passed since they wer...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
To both create the new meaning and repudiate the old might be nearly impossible. We are a symbolic creature at heart, always seeking pattern and meaning and seeing things that might never have been intended. Meanings abide. Laurels are still a symbol of victory and success though millennia have passed since they wer...
What are you trying to accomplish here? If a symbol is well known, getting that meaning out of reader's heads is very hard. Like if you decided that in your story the dollar sign, $, will be a symbol for, I don't know, a new political party, I think readers would be asking, So what does this party have to do with mone...
44,200
Can we change the meaning of a well established symbol and use the newly defined symbol in our writing? If so how do we go about doing so? It am not talking about using a symbol in the context of its antithesis. That still relies on the original meaning. In such cases playing symbols in juxtaposition to their opposite...
2019/03/30
[ "https://writers.stackexchange.com/questions/44200", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/30375/" ]
Can you completely replace the meaning in the reader's mind? Probably not - it's pretty similar to trying to change the definition of a word. What might be easier is the change the symbol's meaning *for your PoV characters*. Try showing the change from their perspectives. Add some event that makes the question their i...
What are you trying to accomplish here? If a symbol is well known, getting that meaning out of reader's heads is very hard. Like if you decided that in your story the dollar sign, $, will be a symbol for, I don't know, a new political party, I think readers would be asking, So what does this party have to do with mone...
385,688
I am trying to find a unified authentication scheme for linux servers to authenticate against Active Directory. Mainly these are Ubuntu and CentOS servers. What I need: * Free, stable solution * Unified UID/GID such that permissions on a folder is the same, regardless of what server it's mounted from * Support for re...
2012/05/03
[ "https://serverfault.com/questions/385688", "https://serverfault.com", "https://serverfault.com/users/74300/" ]
Winbind is likely your best issue (it's what we have running in our infastructure). The UID/GID's wouldn't necessarily be the same from server to server but you should be able to manage the access to any folders/resources you need through Samba and have it use the domain accounts. In terms of the login and sudo permi...
Have you researched if [FreeIPA](http://freeipa.org/docs/1.2/Installation_Deployment_Guide/en-US/html/chap-Installation_and_Deployment_Guide-Setting_up_Synchronization_Between_IPA_and_Active_Directory.html) meets your needs? Also check this [link](https://serverfault.com/questions/50925/what-would-it-take-to-get-an-act...
64,320
I've been reading this: <http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html> But there are some things I don't understand, for example the article says to use something like this for pathfinding with diagonal movement: ``` function heuristic(node) = dx = abs(node.x - goal.x) dy = abs(node.y - g...
2013/11/01
[ "https://gamedev.stackexchange.com/questions/64320", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/18564/" ]
A\* gives you the shortest path in the graph. When using a grid as your graph there are often *multiple* shortest paths. In your first diagram, that *is* one of the shortest paths. It puts all the axial movements first and all the diagonal movements afterwards. But that's the same length path as if you put all the diag...
The A\* algorithm allows you to assign different costs to path edges. You can also assign costs depending on circumstances. This is your main tool to shape A\* paths into looking the way you want them to look. When you want to discourage long diagonals, you can penalize them. Add a tiny bit of cost for each time the p...
64,320
I've been reading this: <http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html> But there are some things I don't understand, for example the article says to use something like this for pathfinding with diagonal movement: ``` function heuristic(node) = dx = abs(node.x - goal.x) dy = abs(node.y - g...
2013/11/01
[ "https://gamedev.stackexchange.com/questions/64320", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/18564/" ]
The A\* algorithm allows you to assign different costs to path edges. You can also assign costs depending on circumstances. This is your main tool to shape A\* paths into looking the way you want them to look. When you want to discourage long diagonals, you can penalize them. Add a tiny bit of cost for each time the p...
Adapting A\* ------------ As Philipp said, you should add costs when the direction doesn't change for long time. But, the function by Philipp may quickly lead to summing up additional costs, that are higher than the cost for traversing an additional tile. But his key idea is correct! It seems easy to adapt A\* to cal...
64,320
I've been reading this: <http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html> But there are some things I don't understand, for example the article says to use something like this for pathfinding with diagonal movement: ``` function heuristic(node) = dx = abs(node.x - goal.x) dy = abs(node.y - g...
2013/11/01
[ "https://gamedev.stackexchange.com/questions/64320", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/18564/" ]
A\* gives you the shortest path in the graph. When using a grid as your graph there are often *multiple* shortest paths. In your first diagram, that *is* one of the shortest paths. It puts all the axial movements first and all the diagonal movements afterwards. But that's the same length path as if you put all the diag...
Adapting A\* ------------ As Philipp said, you should add costs when the direction doesn't change for long time. But, the function by Philipp may quickly lead to summing up additional costs, that are higher than the cost for traversing an additional tile. But his key idea is correct! It seems easy to adapt A\* to cal...
586,201
**What I want to do:** Have a Ubuntu development VM on Windows 8.1. **Setup:** I have a new SSD that I just installed Windows onto. I have an old SSD (60GB) that has Ubuntu on it. **Problem:** I am a developer and have projects on the old SSD and don't want to screw anything up. I think what I should do is take the ...
2015/02/16
[ "https://askubuntu.com/questions/586201", "https://askubuntu.com", "https://askubuntu.com/users/278035/" ]
As it is possible to also [attach a physical disk to a virtual machine](https://askubuntu.com/questions/192254/access-secondary-hard-disk-from-virtual-machine) this procedure may lead to data loss on write access to this disk. If your data matter I would therefore not recommend you take the risk. A much easier way to ...
While there are ways to create virtual environments right from a hard drive (if you were to boot back to your Ubuntu system) I would be worried about something going wrong and losing the data. Your own suggestion of moving the files and doing a data dump of the database is the route I take when I move from one developm...
34,827,159
I have a class called `Car`, this class has attributes such as: id, name, price, color and size. When I am creating an object, for color and size I want a list to select the attribute value from. I don't want the user to write "black" or "small", i want to find them somewhere in the app. ``` Car c1 = new Car(1, "Super...
2016/01/16
[ "https://Stackoverflow.com/questions/34827159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798422/" ]
How about this: ``` #include <iostream> #include <string> using namespace std; int main() { std::string str1, str2; int i; getline(cin, str1); getline(cin, str2); if(str1 != str2) { bool restart = true; while(restart) { restart = false; const int str1Len = str1.size(); ...
Writing modern C++ code always produces smaller, and compact code, as compared to writing C code with random bits of C++ thrown in: ``` #include <iostream> #include <string> int main() { std::string str1, str2; std::getline(std::cin, str1); std::getline(std::cin, str2); size_t i; for (i=0; i<st...
34,827,159
I have a class called `Car`, this class has attributes such as: id, name, price, color and size. When I am creating an object, for color and size I want a list to select the attribute value from. I don't want the user to write "black" or "small", i want to find them somewhere in the app. ``` Car c1 = new Car(1, "Super...
2016/01/16
[ "https://Stackoverflow.com/questions/34827159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798422/" ]
If you may not change the strings themselves then you can use an approach with `std::set` container. For example ``` #include <iostream> #include <string> #include <set> #include <algorithm> #include <iterator> int main() { std::string s1( "abd" ); std::string s2( "ace" ); std::set<char> set1( s1.begin()...
Writing modern C++ code always produces smaller, and compact code, as compared to writing C code with random bits of C++ thrown in: ``` #include <iostream> #include <string> int main() { std::string str1, str2; std::getline(std::cin, str1); std::getline(std::cin, str2); size_t i; for (i=0; i<st...
34,827,159
I have a class called `Car`, this class has attributes such as: id, name, price, color and size. When I am creating an object, for color and size I want a list to select the attribute value from. I don't want the user to write "black" or "small", i want to find them somewhere in the app. ``` Car c1 = new Car(1, "Super...
2016/01/16
[ "https://Stackoverflow.com/questions/34827159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798422/" ]
If you may not change the strings themselves then you can use an approach with `std::set` container. For example ``` #include <iostream> #include <string> #include <set> #include <algorithm> #include <iterator> int main() { std::string s1( "abd" ); std::string s2( "ace" ); std::set<char> set1( s1.begin()...
How about this: ``` #include <iostream> #include <string> using namespace std; int main() { std::string str1, str2; int i; getline(cin, str1); getline(cin, str2); if(str1 != str2) { bool restart = true; while(restart) { restart = false; const int str1Len = str1.size(); ...
34,827,159
I have a class called `Car`, this class has attributes such as: id, name, price, color and size. When I am creating an object, for color and size I want a list to select the attribute value from. I don't want the user to write "black" or "small", i want to find them somewhere in the app. ``` Car c1 = new Car(1, "Super...
2016/01/16
[ "https://Stackoverflow.com/questions/34827159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798422/" ]
How about this: ``` #include <iostream> #include <string> using namespace std; int main() { std::string str1, str2; int i; getline(cin, str1); getline(cin, str2); if(str1 != str2) { bool restart = true; while(restart) { restart = false; const int str1Len = str1.size(); ...
its weird, I was going to edit your question but i realized it was the answer. You’re missing a end bracket for that first if statement, I put that in. you're comparing an int to a unsinged int with strlen(), I left it in the conext of 100 character limit, its fine. int i =0; is not the Same int as in your for loop, a...
34,827,159
I have a class called `Car`, this class has attributes such as: id, name, price, color and size. When I am creating an object, for color and size I want a list to select the attribute value from. I don't want the user to write "black" or "small", i want to find them somewhere in the app. ``` Car c1 = new Car(1, "Super...
2016/01/16
[ "https://Stackoverflow.com/questions/34827159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798422/" ]
If you may not change the strings themselves then you can use an approach with `std::set` container. For example ``` #include <iostream> #include <string> #include <set> #include <algorithm> #include <iterator> int main() { std::string s1( "abd" ); std::string s2( "ace" ); std::set<char> set1( s1.begin()...
its weird, I was going to edit your question but i realized it was the answer. You’re missing a end bracket for that first if statement, I put that in. you're comparing an int to a unsinged int with strlen(), I left it in the conext of 100 character limit, its fine. int i =0; is not the Same int as in your for loop, a...
28,536,111
I am using facebook api for PHP. i can get only basic information like username,fullname,link,id. i cannot get country,email,place..etc ``` <?php session_start(); // added in v4.0.0 require_once 'autoload.php'; require_once( 'src/Facebook/FacebookSession.php'); require_once( 'src/Facebook/FacebookRequest.php' ); requ...
2015/02/16
[ "https://Stackoverflow.com/questions/28536111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2975952/" ]
From my understanding of your Views stack in your `viewController`, you simply need to move the transparent view to the front of the stack (it is currently at the back of your `superView`). You can do this by calling. ``` [self.view bringSubViewToFront:<your transparent view>]; ``` And in the `storyboard` just set ...
``` tableView.backgroundColor = [UIColor clearColor]; tableView.backgroundView.backgroundColor = [UIColor clearColor]; - (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section{ if ([view isKindOfClass:[UITableViewHeaderFooterView class]]) { UITableViewHeaderFoot...
258,955
Recently Foxit Reader started popping up the UAC dialog on each start asking if I want to run it as administrator, and allow it to make changes to my computer. How could I make that stop? Disabling UAC is not an option.
2011/03/18
[ "https://superuser.com/questions/258955", "https://superuser.com", "https://superuser.com/users/12652/" ]
Find a foxit shortcut, right click, properties, compatibility, change for all users, and uncheck run this program as administrator.
There's a problem with the plugin loader of build 1126. It's not about elevated permissions on the shortcut it makes. <http://forums.foxitsoftware.com/forum/portable-document-format-pdf-tools/foxit-reader/42009-why-is-there-a-uac-prompt-win7-with-the-latest-version>
219,138
I need to run a Linux CLI command and get its stdout output from C. I can use pipe() to create a pipe, then fork/exec, redirecting child's stdout descriptor into the pipe before calling exec(), and reading from the pipe in parent. Plus I'll need to wait on the child. Is there a simple call to do fork + redirect + exe...
2008/10/20
[ "https://Stackoverflow.com/questions/219138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23420/" ]
Is this it? ``` NAME popen, pclose - process I/O SYNOPSIS #include <stdio.h> FILE *popen(const char *command, const char *type); int pclose(FILE *stream); DESCRIPTION The popen() function opens a process by creating a pipe, forking, and invoking the shell. Since a pipe is ...
Use `popen()` and `pclose()`. --- `popen()` does not actually wait, of course, but reads on the pipe will block until there is data available. `pclose()` waits, but calling it prematurely could cut off some output from the forked process. You'll want to determine from the stream when the child is done... --- Possi...
219,138
I need to run a Linux CLI command and get its stdout output from C. I can use pipe() to create a pipe, then fork/exec, redirecting child's stdout descriptor into the pipe before calling exec(), and reading from the pipe in parent. Plus I'll need to wait on the child. Is there a simple call to do fork + redirect + exe...
2008/10/20
[ "https://Stackoverflow.com/questions/219138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23420/" ]
GLib has a nice function for this -- `g_spawn_sync()`: <http://library.gnome.org/devel/glib/stable/glib-Spawning-Processes.html#g-spawn-sync> For example, to run a command and get its exit status and output: ``` const char *argv[] = { "your_command", NULL }; char *output = NULL; // will contain command output GError ...
Use `popen()` and `pclose()`. --- `popen()` does not actually wait, of course, but reads on the pipe will block until there is data available. `pclose()` waits, but calling it prematurely could cut off some output from the forked process. You'll want to determine from the stream when the child is done... --- Possi...
219,138
I need to run a Linux CLI command and get its stdout output from C. I can use pipe() to create a pipe, then fork/exec, redirecting child's stdout descriptor into the pipe before calling exec(), and reading from the pipe in parent. Plus I'll need to wait on the child. Is there a simple call to do fork + redirect + exe...
2008/10/20
[ "https://Stackoverflow.com/questions/219138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23420/" ]
Is this it? ``` NAME popen, pclose - process I/O SYNOPSIS #include <stdio.h> FILE *popen(const char *command, const char *type); int pclose(FILE *stream); DESCRIPTION The popen() function opens a process by creating a pipe, forking, and invoking the shell. Since a pipe is ...
Here is what I use: ``` /* simply invoke a app, pipe output*/ pipe = popen(buf, "r" ); if (pipe == NULL ) { printf("invoking %s failed: %s\n", buf, strerror(errno)); return 1; } waitfor(10); while(!feof(pipe) ) { if( fgets( buf, 128, pipe ) != NULL ) { print...
219,138
I need to run a Linux CLI command and get its stdout output from C. I can use pipe() to create a pipe, then fork/exec, redirecting child's stdout descriptor into the pipe before calling exec(), and reading from the pipe in parent. Plus I'll need to wait on the child. Is there a simple call to do fork + redirect + exe...
2008/10/20
[ "https://Stackoverflow.com/questions/219138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23420/" ]
Is this it? ``` NAME popen, pclose - process I/O SYNOPSIS #include <stdio.h> FILE *popen(const char *command, const char *type); int pclose(FILE *stream); DESCRIPTION The popen() function opens a process by creating a pipe, forking, and invoking the shell. Since a pipe is ...
GLib has a nice function for this -- `g_spawn_sync()`: <http://library.gnome.org/devel/glib/stable/glib-Spawning-Processes.html#g-spawn-sync> For example, to run a command and get its exit status and output: ``` const char *argv[] = { "your_command", NULL }; char *output = NULL; // will contain command output GError ...
219,138
I need to run a Linux CLI command and get its stdout output from C. I can use pipe() to create a pipe, then fork/exec, redirecting child's stdout descriptor into the pipe before calling exec(), and reading from the pipe in parent. Plus I'll need to wait on the child. Is there a simple call to do fork + redirect + exe...
2008/10/20
[ "https://Stackoverflow.com/questions/219138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23420/" ]
GLib has a nice function for this -- `g_spawn_sync()`: <http://library.gnome.org/devel/glib/stable/glib-Spawning-Processes.html#g-spawn-sync> For example, to run a command and get its exit status and output: ``` const char *argv[] = { "your_command", NULL }; char *output = NULL; // will contain command output GError ...
Here is what I use: ``` /* simply invoke a app, pipe output*/ pipe = popen(buf, "r" ); if (pipe == NULL ) { printf("invoking %s failed: %s\n", buf, strerror(errno)); return 1; } waitfor(10); while(!feof(pipe) ) { if( fgets( buf, 128, pipe ) != NULL ) { print...
11,025,436
For some reason I can't detect I can't set a z index for any triangle. The triangle will display, at the same depth, from 1 to -1 (inclusive), but after that it dissapers. I am not applying any MVP matrix (trying to figure out this first) and I would expect to be able to see my triangle get smaller as I decrease the z ...
2012/06/14
[ "https://Stackoverflow.com/questions/11025436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/467427/" ]
Bamboo could possibly do this, giving you a dashboard to kick of the job of installing the third party software on the machines, however Bamboo is more of the orchestration of the implementing script or install executable. Your problem really sounds like you would use [Puppet](http://puppetlabs.com/) for or some equi...
Are you talking about the automatic deployment on the dev environment? That can be done pretty easy with bamboo.
11,025,436
For some reason I can't detect I can't set a z index for any triangle. The triangle will display, at the same depth, from 1 to -1 (inclusive), but after that it dissapers. I am not applying any MVP matrix (trying to figure out this first) and I would expect to be able to see my triangle get smaller as I decrease the z ...
2012/06/14
[ "https://Stackoverflow.com/questions/11025436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/467427/" ]
Bamboo could possibly do this, giving you a dashboard to kick of the job of installing the third party software on the machines, however Bamboo is more of the orchestration of the implementing script or install executable. Your problem really sounds like you would use [Puppet](http://puppetlabs.com/) for or some equi...
As other people have stated Bamboo can do this but have you looked at Attunity Replicate? [Attunity Replicate](http://www.attunity.com/products/attunity-replicate)
875,904
Let $O$ be an open subset of $\mathbb R^2$ and suppose the function $f:O\to\mathbb R$ is continuous at the point $(x\_0,y\_0)$ in $O$. Define tangent plane as $\phi(x,y)=a+b(x-x\_0)+c(y-y\_0)$ where $a,b,c$ are real numbers, which has the property that $$\lim\_{(x,y)\to(x\_0,y\_0)}\frac{f(x,y)-\phi(x,y)}{\sqrt{(x-x...
2014/07/23
[ "https://math.stackexchange.com/questions/875904", "https://math.stackexchange.com", "https://math.stackexchange.com/users/71563/" ]
Hint: The better way to solve this problems to use [cylindrical coordinates](https://en.wikipedia.org/wiki/Cylindrical_coordinate_system). The sphere of center $(0,0,0)$ and radius $2$ has equation: $r^2+z^2=4$ and, without loss of generality, we can assume that cylinder has the axis parallel to the $z$ axis , and ce...
The equation for the ball is $$ x^2 + y^2 + z^2 = 2^2 $$ and we have a cylinder inside this ball with radius 1, this would give the limits: $$ 0 \le r \le 1\\ 0 \le \theta \le 2\pi $$ since the radius is 1 and a cylinder has a circular bottom which is a "full lap" around the unit circle hence the $2\pi$ The height of t...
8,207,398
I have installed rvm after installing Mac OS Lion. The problem which I am facing is whenever I try to run a new Rails application, it gives me following error. The problem gets resolved once choose a particular rvm. `$ rvm gemset use global` I know about using .rvmrc file per project. But I don't want to keep on usin...
2011/11/21
[ "https://Stackoverflow.com/questions/8207398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917158/" ]
You can specify a "default" gemset for a given ruby interpreter, by doing: ``` rvm use ruby-1.9.2-p0@gemsetname --default ``` See: <http://beginrescueend.com/gemsets/using/> and <http://beginrescueend.com/gemsets/basics/> it's probably a better idea to use a specific gemset for each of your projects, together with ...
You can make default gemset by using following command ``` rvm --default gemset use <gemsetname> ``` or ``` rvm gemset use <gemsetname> --default ``` For example, if you have rails4 gemset then you can make it default by ``` rvm --default gemset use rails4 ``` or ``` rvm gemset use rails4 --default ```
18,832,148
I am trying to create a SQL Job that sits on what I like to call a Maintenance Server where details about all the other server databases sit. So I have a stored procedure to gather all the required data I have and this stored procedure is now in MaintenanceServer.MaintenanceDB.pr\_MyProcedure. Now what i'd like to do ...
2013/09/16
[ "https://Stackoverflow.com/questions/18832148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/387906/" ]
The nice way to do it is run the SP on the target server, as that's nicely modular. If you want to query the remote server, it's going to be more painful. I'm not sure whether the undocumented sp\_foreachdb deals with linked databases, if not you are down to dynamic sql. As in build a string and call it with Exec(@so...
EXEC [RemoteServer] .DatabaseName.DatabaseOwner.StoredProcedureName ‘Params’ Example: EXEC [RemoteServer] .DatabaseName.DatabaseOwner.StoredProcedureName ’PramValue’
17,743,638
![enter image description here](https://i.stack.imgur.com/yYffp.png) Hi im trying to line up my button horizontally like an "inline" but it wont let me. I know about btn-group but then I cant have space in between the buttons like I want because they're attached to one another. so im trying to align them horizontally ...
2013/07/19
[ "https://Stackoverflow.com/questions/17743638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279089/" ]
In Bootsrap, the grid system (span, row, container) will make all span's appear underneath eachother as soon as you get to the 'phone' size (which I guess is the case here, due to the visible-phone class you added to the footer). You won't be able to rely just on the grid system for this... There is however a .inline ...
I would recommend makeing the Row div a UL and the other elements in the list LI tags. Then you should be able to modify your css code: ``` display: list-item; ``` or ``` display: block; ``` UPDATE #: ``` <div class="icon-user icon-white"></div> ``` Replace with ``` <i class="icon-user icon-white"></div> ```
2,308,435
When I run the code the click event works the first time. When I click it more then one time it seems that the click even has unbounded. How do I keep the click event bounded? ``` var Categories = function() { $("select[id^='CategoryListBox-']").click( function() { SelectedItem = $(this).va...
2010/02/22
[ "https://Stackoverflow.com/questions/2308435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184773/" ]
You are overwriting the click handler by replacing the dom inside of it's parent element. You can use `live` instead to always keep the binding. Line 2 would be: `$("select[id^='CategoryListBox-']").live('click',` And that should do it
Are you possibly creating/re-creating the object and then failing to re-bind the event? I have one site where we do a fair amount of AJAX updating (using the jQuery taconite plugin), and the last thing we do is explicitly bind the click events on the newly created DOM objects.
2,308,435
When I run the code the click event works the first time. When I click it more then one time it seems that the click even has unbounded. How do I keep the click event bounded? ``` var Categories = function() { $("select[id^='CategoryListBox-']").click( function() { SelectedItem = $(this).va...
2010/02/22
[ "https://Stackoverflow.com/questions/2308435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184773/" ]
You are overwriting the click handler by replacing the dom inside of it's parent element. You can use `live` instead to always keep the binding. Line 2 would be: `$("select[id^='CategoryListBox-']").live('click',` And that should do it
I think that when you load() into parent(), you're replacing the original CategoryListBox-\* element with a new one. The new one has nothing bound to it. You can either re-bind the function to the new element, which would be ugly and possibly get you into a nasty recursion situation, or you can use the .live() function...
2,308,435
When I run the code the click event works the first time. When I click it more then one time it seems that the click even has unbounded. How do I keep the click event bounded? ``` var Categories = function() { $("select[id^='CategoryListBox-']").click( function() { SelectedItem = $(this).va...
2010/02/22
[ "https://Stackoverflow.com/questions/2308435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184773/" ]
It looks like you are using AJAX to load new HTML from the server and you're overwriting the existing select box with a new one. This will remove event listeners. One solution is to use `live()`: ``` $("select[id^='CategoryListBox-']").live("click", function() { SelectedItem = $(this).val(); $(this).parent().load(...
Are you possibly creating/re-creating the object and then failing to re-bind the event? I have one site where we do a fair amount of AJAX updating (using the jQuery taconite plugin), and the last thing we do is explicitly bind the click events on the newly created DOM objects.
2,308,435
When I run the code the click event works the first time. When I click it more then one time it seems that the click even has unbounded. How do I keep the click event bounded? ``` var Categories = function() { $("select[id^='CategoryListBox-']").click( function() { SelectedItem = $(this).va...
2010/02/22
[ "https://Stackoverflow.com/questions/2308435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184773/" ]
It looks like you are using AJAX to load new HTML from the server and you're overwriting the existing select box with a new one. This will remove event listeners. One solution is to use `live()`: ``` $("select[id^='CategoryListBox-']").live("click", function() { SelectedItem = $(this).val(); $(this).parent().load(...
I think that when you load() into parent(), you're replacing the original CategoryListBox-\* element with a new one. The new one has nothing bound to it. You can either re-bind the function to the new element, which would be ugly and possibly get you into a nasty recursion situation, or you can use the .live() function...
26,269,985
I'm trying to convert factor values in R into numeric. I tried various methods but no matter what I do, I get the error "NAs introduced by coercion". Here is a sample code I run and the error I get: ``` > demand <- read.csv("file.csv" ) > demand[3,3] [1] 5,185 25 Levels: 2/Jan/2011 3,370 4,339 4,465 4,549 4,676 4,767...
2014/10/09
[ "https://Stackoverflow.com/questions/26269985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2683407/" ]
You should replace ``` as.numeric(as.character(a)) ``` in your code with ``` as.numeric( gsub("[,]", "", as.character(a) ) ) ```
I got 2 comments here: 1. You are using probably files from East Europe Excel float notation (',' instead of '.'). To make it working well, use `read.csv2()` function. 2. The firs observation is probably the header? I guess the observations below are somehow connected via this date (2/Jan/2011). I will suggest to us...
276,256
> > Find the smallest positive integer $k$, such that product of $420$ and $k$ is a perfect square. > > > Please help me in this question.
2013/01/12
[ "https://math.stackexchange.com/questions/276256", "https://math.stackexchange.com", "https://math.stackexchange.com/users/57004/" ]
What you *really* need is not an answer to the specific question but an understanding of the general principle you need to be deploying here. So let's think about the general problem: Given $n$ find the smallest $k$ such that $m = n \cdot k$ is a perfect square. What to do? Good hint for questions such as this: *think...
$420=2^2\cdot3\cdot5\cdot7$ Observe that the power of $3,5$ and $7$ in $420$ is $1$ So, to make the power of $3$ even, we need to multiply $420$ by $3^{2a+1}$ where $a$ is a non-negative integer. So, the general value of $k$ is $3^{2a+1}\cdot5^{2b+1}\cdot7^{2c+1}$ where $a,b,c$ are non-negative integers. So, the sm...
15,257,513
Hi I am just starting to learn how to program and have a function that I need to write in Python, this is the idea behind it: It returns `True` if `word` is in the `wordList` and is entirely composed of letters in the hand. Otherwise, returns `False`. Does not mutate hand or wordList. There is a function to call that...
2013/03/06
[ "https://Stackoverflow.com/questions/15257513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2141635/" ]
Without your code, let me see if I understand what you want: you're trying to see if the given word can be spelled using the letters in `hand` as if the user had a Scrabble tile for each letter in `hand`, yes? Personally I'd just copy the `hand` dictionary and then allow changes to the copy. Something like this: ``` ...
How about something like this: ``` def isValidWord(hand, word, word_list): if word not in word_list: return False for c in word: if c not in hand: return False return True ``` As strings are iterable you can check character by character. Good luck
15,257,513
Hi I am just starting to learn how to program and have a function that I need to write in Python, this is the idea behind it: It returns `True` if `word` is in the `wordList` and is entirely composed of letters in the hand. Otherwise, returns `False`. Does not mutate hand or wordList. There is a function to call that...
2013/03/06
[ "https://Stackoverflow.com/questions/15257513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2141635/" ]
How about something like this: ``` def isValidWord(hand, word, word_list): if word not in word_list: return False for c in word: if c not in hand: return False return True ``` As strings are iterable you can check character by character. Good luck
The python `Counter` class is your friend. You can do this in [python 2.7 and later](http://docs.python.org/2/library/collections.html#collections.Counter): ``` from collections import Counter def is_valid_word(hand, word, word_list): letter_leftover = Counter(hand) letter_leftover.subtract(Counter(word)) ...
15,257,513
Hi I am just starting to learn how to program and have a function that I need to write in Python, this is the idea behind it: It returns `True` if `word` is in the `wordList` and is entirely composed of letters in the hand. Otherwise, returns `False`. Does not mutate hand or wordList. There is a function to call that...
2013/03/06
[ "https://Stackoverflow.com/questions/15257513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2141635/" ]
How about something like this: ``` def isValidWord(hand, word, word_list): if word not in word_list: return False for c in word: if c not in hand: return False return True ``` As strings are iterable you can check character by character. Good luck
here is mine ``` def isValidWord(word, hand, wordList): """ Returns True if word is in the wordList and is entirely composed of letters in the hand. Otherwise, returns False. Does not mutate hand or wordList. word: string hand: dictionary (string -> int) wordList: list of lowercase string...
15,257,513
Hi I am just starting to learn how to program and have a function that I need to write in Python, this is the idea behind it: It returns `True` if `word` is in the `wordList` and is entirely composed of letters in the hand. Otherwise, returns `False`. Does not mutate hand or wordList. There is a function to call that...
2013/03/06
[ "https://Stackoverflow.com/questions/15257513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2141635/" ]
Without your code, let me see if I understand what you want: you're trying to see if the given word can be spelled using the letters in `hand` as if the user had a Scrabble tile for each letter in `hand`, yes? Personally I'd just copy the `hand` dictionary and then allow changes to the copy. Something like this: ``` ...
The python `Counter` class is your friend. You can do this in [python 2.7 and later](http://docs.python.org/2/library/collections.html#collections.Counter): ``` from collections import Counter def is_valid_word(hand, word, word_list): letter_leftover = Counter(hand) letter_leftover.subtract(Counter(word)) ...
15,257,513
Hi I am just starting to learn how to program and have a function that I need to write in Python, this is the idea behind it: It returns `True` if `word` is in the `wordList` and is entirely composed of letters in the hand. Otherwise, returns `False`. Does not mutate hand or wordList. There is a function to call that...
2013/03/06
[ "https://Stackoverflow.com/questions/15257513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2141635/" ]
Without your code, let me see if I understand what you want: you're trying to see if the given word can be spelled using the letters in `hand` as if the user had a Scrabble tile for each letter in `hand`, yes? Personally I'd just copy the `hand` dictionary and then allow changes to the copy. Something like this: ``` ...
here is mine ``` def isValidWord(word, hand, wordList): """ Returns True if word is in the wordList and is entirely composed of letters in the hand. Otherwise, returns False. Does not mutate hand or wordList. word: string hand: dictionary (string -> int) wordList: list of lowercase string...
25,359,380
``` #include <stdio.h> #include <math.h> #include <string.h> long fctl(int n){ int a=1,i; for(i=n;i>1;--i) a*=i; return a; } long ch(int n, int r){ return fctl(n) / (fctl(n-r)*fctl(r)); } int main(){ char *hands[] = {"onepair", "twopair", "triple", "straight", "flush", "fullhouse", "fourofakind", "stra...
2014/08/18
[ "https://Stackoverflow.com/questions/25359380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2380150/" ]
You need another API key to use while testing. its different from the API key you generated from keystore file. From eclipse-->windows-->Preferences-->Android-->Build. Use this SHA1 fingerprint and get another API key from Google API console and use it for testing. Don't forget to change it to the production one befo...
Try the below code . this worked for me... ``` <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" android:name="com.google.android.gms.maps.MapFragment" android:id="@+id/thapar_map" android:layout_width="fill_parent" andro...
25,359,380
``` #include <stdio.h> #include <math.h> #include <string.h> long fctl(int n){ int a=1,i; for(i=n;i>1;--i) a*=i; return a; } long ch(int n, int r){ return fctl(n) / (fctl(n-r)*fctl(r)); } int main(){ char *hands[] = {"onepair", "twopair", "triple", "straight", "flush", "fullhouse", "fourofakind", "stra...
2014/08/18
[ "https://Stackoverflow.com/questions/25359380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2380150/" ]
You need another API key to use while testing. its different from the API key you generated from keystore file. From eclipse-->windows-->Preferences-->Android-->Build. Use this SHA1 fingerprint and get another API key from Google API console and use it for testing. Don't forget to change it to the production one befo...
as per my understanding this issue is happening because of three reason **Reasons** 1) first is lack of internet connectivity 2) second is your google api key is missmatching 3) third if key is ok then your provided package name during key generation is not exact same as your project package name **Solutions** for ...
21,519
--- I have an expression. I want to change all the Integers to a new form. The rule is, x\_Integer->x.\_f. But we should consider some special cases. For example, ``` input = 22 + 4/5 x1 x1 x1 + (2 x2^4 + 343 Pi^4)/ Sqrt[67 - x1 x1 x3 x3 + x2^(5/4)] + (4 x1 - x2)^(-3/2 q) + Exp[-x1 x1 + 4 x2 x2 - 3 x1]; ``...
2013/03/17
[ "https://mathematica.stackexchange.com/questions/21519", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/5824/" ]
One simple way would be to do: ``` Unprotect[Integer]; Integer /: Format[r_Integer, FortranForm] := (SequenceForm[r // N, "_f"]); Protect[Integer]; Unprotect[Rational]; Rational /: Format[r_Rational, FortranForm] := (SequenceForm[Numerator[r] // N, "_f", "/", Denominator[r] // N, "_f"]); Protect[Ra...
Simplifications/reordering that will separate the numbers from the `_f` pattern in a way that you seem to not want will take place on your given output expression if it is evaluated. Therefore you will need some kind of hold function here. I will use `HoldForm`. ``` input = 22 + 4/5 x1 x1 x1 + (2 x2^4 + 343 Pi^4)...
106,278
I've been wanting to know how to do 3d projections.[![enter image description here](https://i.stack.imgur.com/or349.png)](https://i.stack.imgur.com/or349.png) Can someone explain how i can use this to find the position for x and y on the 2d plane that is 600 \* 600 pixels.
2015/08/25
[ "https://gamedev.stackexchange.com/questions/106278", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/69577/" ]
Assuming that you want to compute the position that an arbitrary 3D vertex (x,y,z,1) has on the view plane after the projection: You can use the given parameters to compute a projection matrix: [![Matrix](https://i.stack.imgur.com/GdMJL.png)](https://i.stack.imgur.com/GdMJL.png) where `f = cotangent(fovy * 0.5)` Thi...
Generally, you have to use a bunch of matrices. With the traditional OpenGL pipeline, you'd have to mutiply these matrices: ``` finalMatrix = modelMatrix * viewMatrix * projectionMatrix * viewport.windowMatrix; ``` To find the position of the vertex on your viewport, just multiply the vertex by the mat...
13,283,843
I have a rails application where I get the following response when I use jQuery `get` function. I have to get all div elements with `id='users_belonging_to_project'`. As you can see there are multiple divs with same id. I want to get the whole html() for those ids. As it is returned from response, I used `$(data).fin...
2012/11/08
[ "https://Stackoverflow.com/questions/13283843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755162/" ]
I'll answer my own question: onInterceptTouchEvent only get called if the parent has a child view which returns "true" from onTouchEvent. Once the child returns true, the parent now has a chance to intercept that event. ![enter image description here](https://i.stack.imgur.com/V1tru.png)
I get the same problem. I had read many posts about it: [onInterceptTouchEvent only gets ACTION\_DOWN](https://stackoverflow.com/questions/13283827/onintercepttouchevent-only-gets-action-down) [onInterceptTouchEvent's ACTION\_UP and ACTION\_MOVE never gets called](https://stackoverflow.com/questions/21288081/onin...
13,283,843
I have a rails application where I get the following response when I use jQuery `get` function. I have to get all div elements with `id='users_belonging_to_project'`. As you can see there are multiple divs with same id. I want to get the whole html() for those ids. As it is returned from response, I used `$(data).fin...
2012/11/08
[ "https://Stackoverflow.com/questions/13283843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755162/" ]
I'll answer my own question: onInterceptTouchEvent only get called if the parent has a child view which returns "true" from onTouchEvent. Once the child returns true, the parent now has a chance to intercept that event. ![enter image description here](https://i.stack.imgur.com/V1tru.png)
**dispatchTouchEvent, onInterceptTouchEvent, requestDisallowInterceptTouchEvent** [[Touch event flow]](https://stackoverflow.com/a/57222691/4770877) The official [doc](https://developer.android.com/guide/topics/ui/ui-events) > > `Activity.dispatchTouchEvent(MotionEvent)` - This allows your Activity to intercept all...
13,283,843
I have a rails application where I get the following response when I use jQuery `get` function. I have to get all div elements with `id='users_belonging_to_project'`. As you can see there are multiple divs with same id. I want to get the whole html() for those ids. As it is returned from response, I used `$(data).fin...
2012/11/08
[ "https://Stackoverflow.com/questions/13283843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/755162/" ]
I get the same problem. I had read many posts about it: [onInterceptTouchEvent only gets ACTION\_DOWN](https://stackoverflow.com/questions/13283827/onintercepttouchevent-only-gets-action-down) [onInterceptTouchEvent's ACTION\_UP and ACTION\_MOVE never gets called](https://stackoverflow.com/questions/21288081/onin...
**dispatchTouchEvent, onInterceptTouchEvent, requestDisallowInterceptTouchEvent** [[Touch event flow]](https://stackoverflow.com/a/57222691/4770877) The official [doc](https://developer.android.com/guide/topics/ui/ui-events) > > `Activity.dispatchTouchEvent(MotionEvent)` - This allows your Activity to intercept all...
19,283,190
I would like to know if there is any way of checking if a string exists inside another string (ie contains function). I have been taken a look to <http://forge.puppetlabs.com/puppetlabs/stdlib> but I haven't found this specific function. Maybe this is possible through a regexp, but I am not really sure how to do it. Ca...
2013/10/09
[ "https://Stackoverflow.com/questions/19283190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2209390/" ]
This is quite easy to do, check out the docs here: <http://docs.puppetlabs.com/puppet/2.7/reference/lang_conditional.html> A simple example: ``` if $hostname =~ /^www(\d+)\./ { notice("Welcome to web server number $1") } ```
There is an ["in" operator in Puppet](https://puppet.com/docs/puppet/6.3/lang_expressions.html#in): ``` # Right operand is a string: 'eat' in 'eaten' # resolves to true 'Eat' in 'eaten' # resolves to true # Right operand is an array: 'eat' in ['eat', 'ate', 'eating'] # resolves to true 'Eat' in ['eat', 'ate', 'eating...
32,741,811
Please tell me how can I get all prints that I see when I run ./manage.py runserver locally. I dont want to use logger. Ideally I would like to connect to my manage.py and see what is server is printing for me now. I tried [django print information on production server](https://stackoverflow.com/questions/5653566/djang...
2015/09/23
[ "https://Stackoverflow.com/questions/32741811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2443062/" ]
If you run your application in production setup, i.e. APACHE server your can find prints in file located in destination, which you configured in your apache config. For example: 'ErrorLog /var/log/httpd-error.log'
Django can be run as multi-threaded server without master, so there is no simple way to join all std output together. Logging is simplest and best solution here, you can define many log handlers, even send all logs into some socket, where some simple logging server will reside that will catch all logs and print them in...
10,150,513
Can anyone tell me how I can implement a default template/layout for my whole project in codeigniter? One way I found is [Templating with Code Igniter (CI Forums)](http://codeigniter.com/forums/viewthread/88664/) Is there any other way? Can anyone post complete example code?
2012/04/14
[ "https://Stackoverflow.com/questions/10150513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884995/" ]
There are a few ways I know of one of them is to create a header and footer view for your site / project. ``` application/views/template/header.php application/views/template/footer.php ``` Then you have your other pages arranged how you would like. ``` application/views/users/login.php ``` In your controller you...
You can always load a view withing other view and implement what you want. Other better way is to use a template engine which supports template inheritance like * [Twig](http://twig.sensiolabs.org/doc/templates.html#template-inheritance) * [Smarty](http://www.smarty.net/inheritance) * [Dwoo](http://wiki.dwoo.org/inde...
10,150,513
Can anyone tell me how I can implement a default template/layout for my whole project in codeigniter? One way I found is [Templating with Code Igniter (CI Forums)](http://codeigniter.com/forums/viewthread/88664/) Is there any other way? Can anyone post complete example code?
2012/04/14
[ "https://Stackoverflow.com/questions/10150513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884995/" ]
Make one layout view. Some thing like this: ``` <html> <head> <title>My awesome site</title> </head> <body> <?= $this->load->view('shared/header') ?> <?= $this->load->view($partial) ?> <?= $this->load->view('shared/footer') ?> </body> </html> ``` Then in your controller do this: ``` $this->d...
You can always load a view withing other view and implement what you want. Other better way is to use a template engine which supports template inheritance like * [Twig](http://twig.sensiolabs.org/doc/templates.html#template-inheritance) * [Smarty](http://www.smarty.net/inheritance) * [Dwoo](http://wiki.dwoo.org/inde...
10,150,513
Can anyone tell me how I can implement a default template/layout for my whole project in codeigniter? One way I found is [Templating with Code Igniter (CI Forums)](http://codeigniter.com/forums/viewthread/88664/) Is there any other way? Can anyone post complete example code?
2012/04/14
[ "https://Stackoverflow.com/questions/10150513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884995/" ]
Make one layout view. Some thing like this: ``` <html> <head> <title>My awesome site</title> </head> <body> <?= $this->load->view('shared/header') ?> <?= $this->load->view($partial) ?> <?= $this->load->view('shared/footer') ?> </body> </html> ``` Then in your controller do this: ``` $this->d...
There are a few ways I know of one of them is to create a header and footer view for your site / project. ``` application/views/template/header.php application/views/template/footer.php ``` Then you have your other pages arranged how you would like. ``` application/views/users/login.php ``` In your controller you...
51,385,015
I am trying to convert the integers contained into a string like `"15m"` into an `integer`. With the code below I can achieve what I want. But I am wondering if there is a better solution for this, or a function I'm not aware of which already implements this. ``` s = "15m" s_result = "" for char in s: try: ...
2018/07/17
[ "https://Stackoverflow.com/questions/51385015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5399268/" ]
I found a good solution using regex. ``` import re result = int(re.sub('[^0-9]','', s)) print result ``` Which results in: ``` >>> 15 ```
You could also match one or more digits from the start of the line `^\d+` ``` import re regex = r"^\d+" test_str = "15m" match = re.search(regex, test_str) if match: print (int(match.group())) ```
955,056
Recently, I found a new job which uses O365 in a hybrid environment. Just to explain a bit, the new environment has On-premises Active Directory plus an instance of On-premises Exchange Server (which actually has no user mailboxes inside). The On-premises Active Directory is synced to an Azure AD in the cloud and all u...
2019/02/21
[ "https://serverfault.com/questions/955056", "https://serverfault.com", "https://serverfault.com/users/510279/" ]
Without knowing exactly what your manager means we can't answer this question. That being said, I suspect he either doesn't understand how directory synchronization works or he's about to break something. With directory synchronization (through Azure AD Connect) the source of authority for object attributes is the on ...
If the objects are synced from on-premise to online, then the objects could only be managed on-premise. If you would like to manage the objects online, then it should be the online-only object (not synced).
589,767
This question referes to a definition in Eugene M. Luks paper "Isomorphism of Graphs of Bounded Valence Can Be Tested in Polynomial Time" (1981), page 48, available at <http://ix.cs.uoregon.edu/~luks/iso.pdf>‎. Let $X$ be a (simple, undirected) trivalent graph (that is, a graph with max node degree 3) and let $e$ be a...
2013/12/02
[ "https://math.stackexchange.com/questions/589767", "https://math.stackexchange.com", "https://math.stackexchange.com/users/112918/" ]
No, not necessarily. For a proof to be sound, then indeed, we need for $p\land q$ to be true. But validity depends only on the *form* of an argument, not the semantic content of the argument. An argument or proof is valid provided the conclusion is logically implied by the premises. Indeed, we can have valid argument ...
It is wrong. What you are describing in your last line, is the *modus ponens*, where from $A \to B$ and $A$ one deduces $B$. But the truth of $A$ has nothing to do with the truth of the implication $A \to B$, in fact this is completely true: > > If $1$ is $0$, then $1$ is $1$ > > >
53,559,587
I have a short bit of code that needs to run for a long long time. I am wondering if the length of the variable's names that I use can alter the speed at which the program executes. Here is a very simple example written in Python. Program A ``` x = 1 while not x == 0: print('message') ``` Program ...
2018/11/30
[ "https://Stackoverflow.com/questions/53559587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8896653/" ]
No, the names themselves have no effect on how quickly the resulting code runs. Variable names are just used to distinguish in the Python source two variables that are represented by integer indices into a lookup table: ``` >>> dis.dis('x=1') 1 0 LOAD_CONST 0 (1) 2 STORE_NAME ...
The difference is very small and we cant conclude that is because of name of variable. ``` import timeit x=1 xyz=1 start_time = timeit.default_timer() for i in range(1,1000000): if x==1: print("message") elapsed = timeit.default_timer() - start_time start_time2 = timeit.default_timer() for i in range(1,1...
53,559,587
I have a short bit of code that needs to run for a long long time. I am wondering if the length of the variable's names that I use can alter the speed at which the program executes. Here is a very simple example written in Python. Program A ``` x = 1 while not x == 0: print('message') ``` Program ...
2018/11/30
[ "https://Stackoverflow.com/questions/53559587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8896653/" ]
No, the names themselves have no effect on how quickly the resulting code runs. Variable names are just used to distinguish in the Python source two variables that are represented by integer indices into a lookup table: ``` >>> dis.dis('x=1') 1 0 LOAD_CONST 0 (1) 2 STORE_NAME ...
The results that @chepner mentioned are correct, Python can take longer to run the code in the console, but once the code is compiled the results are the same. To make sure that this is correct, I created the following code also inspired by the answer from @knifer: ``` from time import time from numpy import average,...