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
51,286
I put a bounty on a question ([here](https://stackoverflow.com/questions/2625524/crash-when-linking-swc-with-alchemy)) which has gotten no answers. The bounty has since expired. I sort of expected to get my reputation back since nobody 'won' it. Is this really how the system works?
2010/05/26
[ "https://meta.stackexchange.com/questions/51286", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/137929/" ]
Jon Skeet. See [this SE Data Explorer query](https://data.stackexchange.com/stackoverflow/query/946/rising-stars-top-50-users-ordered-on-rep-per-day) (not by me).
I imagine that user would be Jon Skeet, the answer to life, the universe, and everything. (hope I got the quote right)
51,286
I put a bounty on a question ([here](https://stackoverflow.com/questions/2625524/crash-when-linking-swc-with-alchemy)) which has gotten no answers. The bounty has since expired. I sort of expected to get my reputation back since nobody 'won' it. Is this really how the system works?
2010/05/26
[ "https://meta.stackexchange.com/questions/51286", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/137929/" ]
Jon Skeet. See [this SE Data Explorer query](https://data.stackexchange.com/stackoverflow/query/946/rising-stars-top-50-users-ordered-on-rep-per-day) (not by me).
I would say Jon Skeet because a while ago he made a Twitter update saying "Wow today is the first day in months I didn't hit the reputation cap on Stack Overflow".
9,276,261
I want to append an html element to a div and have jquery return me the wrapped set that contains the element I just appended and not the wrapped set containing the div So my html:- ``` ... <div id="somediv">Some other elements...</div> ... ``` javascript:- ``` var jqueryObj = $('#somediv').append('<p>Hello, Wor...
2012/02/14
[ "https://Stackoverflow.com/questions/9276261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196970/" ]
Use [`.appendTo()`](http://api.jquery.com/appendTo/) instead of [`.append()`](http://api.jquery.com/append/). ``` var jqueryObj = $('<p>Hello, World!</p>').appendTo('#somediv'); alert(jqueryObj.html()); // '<p>Hello, World!</p>' ```
``` var jqueryObj = $('#somediv').append('<p>Hello, World!</p>'); alert(jqueryObj.find("p").html()); ```
9,276,261
I want to append an html element to a div and have jquery return me the wrapped set that contains the element I just appended and not the wrapped set containing the div So my html:- ``` ... <div id="somediv">Some other elements...</div> ... ``` javascript:- ``` var jqueryObj = $('#somediv').append('<p>Hello, Wor...
2012/02/14
[ "https://Stackoverflow.com/questions/9276261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196970/" ]
Use [`.appendTo()`](http://api.jquery.com/appendTo/) instead of [`.append()`](http://api.jquery.com/append/). ``` var jqueryObj = $('<p>Hello, World!</p>').appendTo('#somediv'); alert(jqueryObj.html()); // '<p>Hello, World!</p>' ```
Switch them around, and use the [`.appendTo()`](http://api.jquery.com/appendTo/) function. Like so: ``` var jqueryObj = $('<p>Hello, World!</p>').appendTo('#somediv'); ``` [**Working DEMO**](http://jsfiddle.net/9wse7/)
9,276,261
I want to append an html element to a div and have jquery return me the wrapped set that contains the element I just appended and not the wrapped set containing the div So my html:- ``` ... <div id="somediv">Some other elements...</div> ... ``` javascript:- ``` var jqueryObj = $('#somediv').append('<p>Hello, Wor...
2012/02/14
[ "https://Stackoverflow.com/questions/9276261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196970/" ]
Use [`.appendTo()`](http://api.jquery.com/appendTo/) instead of [`.append()`](http://api.jquery.com/append/). ``` var jqueryObj = $('<p>Hello, World!</p>').appendTo('#somediv'); alert(jqueryObj.html()); // '<p>Hello, World!</p>' ```
Try this: ``` var jqueryObj= $('<p>Hello, world!</p>'); $('#somediv').append(jqueryObj); alert(jqueryObj.html()); ``` What you want is the variable to actually hold the newly created object, not the div into which you added it.
9,276,261
I want to append an html element to a div and have jquery return me the wrapped set that contains the element I just appended and not the wrapped set containing the div So my html:- ``` ... <div id="somediv">Some other elements...</div> ... ``` javascript:- ``` var jqueryObj = $('#somediv').append('<p>Hello, Wor...
2012/02/14
[ "https://Stackoverflow.com/questions/9276261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196970/" ]
Switch them around, and use the [`.appendTo()`](http://api.jquery.com/appendTo/) function. Like so: ``` var jqueryObj = $('<p>Hello, World!</p>').appendTo('#somediv'); ``` [**Working DEMO**](http://jsfiddle.net/9wse7/)
``` var jqueryObj = $('#somediv').append('<p>Hello, World!</p>'); alert(jqueryObj.find("p").html()); ```
9,276,261
I want to append an html element to a div and have jquery return me the wrapped set that contains the element I just appended and not the wrapped set containing the div So my html:- ``` ... <div id="somediv">Some other elements...</div> ... ``` javascript:- ``` var jqueryObj = $('#somediv').append('<p>Hello, Wor...
2012/02/14
[ "https://Stackoverflow.com/questions/9276261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196970/" ]
Switch them around, and use the [`.appendTo()`](http://api.jquery.com/appendTo/) function. Like so: ``` var jqueryObj = $('<p>Hello, World!</p>').appendTo('#somediv'); ``` [**Working DEMO**](http://jsfiddle.net/9wse7/)
Try this: ``` var jqueryObj= $('<p>Hello, world!</p>'); $('#somediv').append(jqueryObj); alert(jqueryObj.html()); ``` What you want is the variable to actually hold the newly created object, not the div into which you added it.
115,930
Since the update I've attempted to play the new mode but am not doing so well. I have an assassin specialized mainly into the Cunning tree and partially into the Bloodshed side. With my current build I can't even get passed the W4R-DEN with leads me to believe co-op is almost a necessary requirement to beat this mode. ...
2013/05/02
[ "https://gaming.stackexchange.com/questions/115930", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/37612/" ]
The most standard way of playing melee Zer0 is to go all the way down the `Bloodshed` tree for `Many Must Fall`. Definitely skip `Grim` because it ruins how you will be playing and `Resurgence` is useless with the weapons you will be using. See this [post](http://forums.gearboxsoftware.com/showthread.php?t=254652) for ...
I am currently doing solo UVHM as Hybrid Zero, and it's been a breeze. Slag -> correct elemental weapon—even badasses and super badasses go down in few hits. (I don't really buy that "getting killed in 1-2 hits. My Zer0 has 400k health and is perfectly capable of soaking damage.) Although I do confess that the consta...
115,930
Since the update I've attempted to play the new mode but am not doing so well. I have an assassin specialized mainly into the Cunning tree and partially into the Bloodshed side. With my current build I can't even get passed the W4R-DEN with leads me to believe co-op is almost a necessary requirement to beat this mode. ...
2013/05/02
[ "https://gaming.stackexchange.com/questions/115930", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/37612/" ]
This is an Assassin equipment guide (with some skill pointers) for Ultimate Vault Hunter Mode. It's not the only right solution, nor do I claim this to be the *best* possible, but it is something that worked for me, making the UVHM easy to solo. NOTE: This guide does not include any Legendary or E-tech weapons, mods o...
The most standard way of playing melee Zer0 is to go all the way down the `Bloodshed` tree for `Many Must Fall`. Definitely skip `Grim` because it ruins how you will be playing and `Resurgence` is useless with the weapons you will be using. See this [post](http://forums.gearboxsoftware.com/showthread.php?t=254652) for ...
115,930
Since the update I've attempted to play the new mode but am not doing so well. I have an assassin specialized mainly into the Cunning tree and partially into the Bloodshed side. With my current build I can't even get passed the W4R-DEN with leads me to believe co-op is almost a necessary requirement to beat this mode. ...
2013/05/02
[ "https://gaming.stackexchange.com/questions/115930", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/37612/" ]
The most standard way of playing melee Zer0 is to go all the way down the `Bloodshed` tree for `Many Must Fall`. Definitely skip `Grim` because it ruins how you will be playing and `Resurgence` is useless with the weapons you will be using. See this [post](http://forums.gearboxsoftware.com/showthread.php?t=254652) for ...
If you have Tiny Tina's Dragon Keep DLC, then go find a Magic Missle grenade mod dropped by a wizard. Regardless of what level you find one at, they all do the same thing. 1) they regenerate your grenade ammo 2) they fire 2 homing nades that home in on opponents 3) the homing nades have an almost 100% chance to slag o...
115,930
Since the update I've attempted to play the new mode but am not doing so well. I have an assassin specialized mainly into the Cunning tree and partially into the Bloodshed side. With my current build I can't even get passed the W4R-DEN with leads me to believe co-op is almost a necessary requirement to beat this mode. ...
2013/05/02
[ "https://gaming.stackexchange.com/questions/115930", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/37612/" ]
This is an Assassin equipment guide (with some skill pointers) for Ultimate Vault Hunter Mode. It's not the only right solution, nor do I claim this to be the *best* possible, but it is something that worked for me, making the UVHM easy to solo. NOTE: This guide does not include any Legendary or E-tech weapons, mods o...
I am currently doing solo UVHM as Hybrid Zero, and it's been a breeze. Slag -> correct elemental weapon—even badasses and super badasses go down in few hits. (I don't really buy that "getting killed in 1-2 hits. My Zer0 has 400k health and is perfectly capable of soaking damage.) Although I do confess that the consta...
115,930
Since the update I've attempted to play the new mode but am not doing so well. I have an assassin specialized mainly into the Cunning tree and partially into the Bloodshed side. With my current build I can't even get passed the W4R-DEN with leads me to believe co-op is almost a necessary requirement to beat this mode. ...
2013/05/02
[ "https://gaming.stackexchange.com/questions/115930", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/37612/" ]
This is an Assassin equipment guide (with some skill pointers) for Ultimate Vault Hunter Mode. It's not the only right solution, nor do I claim this to be the *best* possible, but it is something that worked for me, making the UVHM easy to solo. NOTE: This guide does not include any Legendary or E-tech weapons, mods o...
If you have Tiny Tina's Dragon Keep DLC, then go find a Magic Missle grenade mod dropped by a wizard. Regardless of what level you find one at, they all do the same thing. 1) they regenerate your grenade ammo 2) they fire 2 homing nades that home in on opponents 3) the homing nades have an almost 100% chance to slag o...
112,428
``` {<|"date" -> "2016-04-12", "key" -> 1, "1st" -> 0.9652777777777778`, "2nd" -> 0.8867924528301887`, "3rd" -> 0.49074074074074076`|>, <|"date" -> "2016-04-12", "key" -> 2, "2nd" -> 0.14619883040935672`, "3rd" -> 0.15212981744421908`|>, <|"date" -> "2016-04-13" , "key" -> 1, "2nd" -> 0.14619883040935672`, "3rd...
2016/04/12
[ "https://mathematica.stackexchange.com/questions/112428", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/6648/" ]
`Dataset` excels at representing hierarchical data. If you look at your problem as creating a hierarchy of records with levels `"key"` and `"date"` then a `Dataset` solution quickly presents itself. To make querying easier I first ensure all records contain all keys with `KeyUnion`. Then create the `Dataset`. ``` dat...
Not sure if this can be done using `JoinAcross`. ``` associations = { <|"date" -> "2016-04-12", "key" -> 1, "1st" -> 0.9652777777777778`, "2nd" -> 0.8867924528301887`, "3rd" -> 0.49074074074074076`|>, <|"date" -> "2016-04-12", "key" -> 2, "2nd" -> 0.14619883040935672`, "3rd" -> 0.15212981744421908`|>, ...
71,981,738
Hi I would like to ask for the aes mapping, if I want to have the mean of wages based on age group but I do not want to adjust the data table, is there a function I can call in the ggplot to have the mean wages based on their age group? ``` ab_final <- ab %>% group_by(agegroup,haveKids,educationLevel) %>% summari...
2022/04/23
[ "https://Stackoverflow.com/questions/71981738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18156605/" ]
There are a number of issues with your code, first, and the cause of the error message you posted, is that it should be `AUTO_INCREMENT` and not `AUTOINCREMENT`. Second you need to specify the column you insert values into, i.e. `query = 'INSERT INTO data (content) VALUES (%s)'` Third you should insert the list using `...
The error you show means that you want to insert your data in the table `file` which doesn't exist. You've created a table `data`. When you initialize `query`, do `query = 'INSERT INTO data VALUES (%s)'` instead.
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
Check if ***sycophant(ic)*** fits. Though it does not *explicitly* mean "*someone who is generally good*", it does mean someone who "*might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful*". Also, the definition of ***sycophant*** does *not* explicitly exclude "*someone who is ge...
Maybe... > > [**traitor**](http://www.merriam-webster.com/dictionary/traitor) - person who is not loyal to his or her own country, friends, etc. : a person who betrays a country or group of people by helping or supporting an enemy > > > [**treachery**](http://www.oxforddictionaries.com/us/definition/american_englis...
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
As a single-word-request, there might not be a perfect word that specifies "giving in to an authority". More general words include If the connotation is that the person doesn't want to do it but is doing it out of fear of reprecussions: * *Impressionable* * *Meek* * *Weak-willed* If the connotation is that the pers...
Maybe... > > [**traitor**](http://www.merriam-webster.com/dictionary/traitor) - person who is not loyal to his or her own country, friends, etc. : a person who betrays a country or group of people by helping or supporting an enemy > > > [**treachery**](http://www.oxforddictionaries.com/us/definition/american_englis...
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
The behaviour of indulging the wrongdoing of authority is actually so common, that it is a person displaying the opposite behaviour who is called by a specific term: *whistleblower*. Historically the failure to report a criminal offence was itself a criminal offence called *misprision*, but the term is now as archaic ...
Maybe... > > [**traitor**](http://www.merriam-webster.com/dictionary/traitor) - person who is not loyal to his or her own country, friends, etc. : a person who betrays a country or group of people by helping or supporting an enemy > > > [**treachery**](http://www.oxforddictionaries.com/us/definition/american_englis...
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
Check if ***sycophant(ic)*** fits. Though it does not *explicitly* mean "*someone who is generally good*", it does mean someone who "*might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful*". Also, the definition of ***sycophant*** does *not* explicitly exclude "*someone who is ge...
[myrmidon](http://www.merriam-webster.com/dictionary/myrmidon) - a person who executes without scruples his master's commands, like the teacher the chairman of our department kept reappointing to the personnel committee.
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
As a single-word-request, there might not be a perfect word that specifies "giving in to an authority". More general words include If the connotation is that the person doesn't want to do it but is doing it out of fear of reprecussions: * *Impressionable* * *Meek* * *Weak-willed* If the connotation is that the pers...
[myrmidon](http://www.merriam-webster.com/dictionary/myrmidon) - a person who executes without scruples his master's commands, like the teacher the chairman of our department kept reappointing to the personnel committee.
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
The behaviour of indulging the wrongdoing of authority is actually so common, that it is a person displaying the opposite behaviour who is called by a specific term: *whistleblower*. Historically the failure to report a criminal offence was itself a criminal offence called *misprision*, but the term is now as archaic ...
[myrmidon](http://www.merriam-webster.com/dictionary/myrmidon) - a person who executes without scruples his master's commands, like the teacher the chairman of our department kept reappointing to the personnel committee.
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
Check if ***sycophant(ic)*** fits. Though it does not *explicitly* mean "*someone who is generally good*", it does mean someone who "*might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful*". Also, the definition of ***sycophant*** does *not* explicitly exclude "*someone who is ge...
That person can be considered *meek* > > quiet, gentle, and easily imposed on; submissive. > > > The action itself may be performed out of *cowardice* > > lack of bravery. > > >
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
As a single-word-request, there might not be a perfect word that specifies "giving in to an authority". More general words include If the connotation is that the person doesn't want to do it but is doing it out of fear of reprecussions: * *Impressionable* * *Meek* * *Weak-willed* If the connotation is that the pers...
That person can be considered *meek* > > quiet, gentle, and easily imposed on; submissive. > > > The action itself may be performed out of *cowardice* > > lack of bravery. > > >
342,393
What's a word for someone who is generally good but might perform without a blink of an eye a sin of sorts, if it is for someone who is powerful, out of awe and admiration for that person and their name in society. So for example a social worker who knows a family is treating their children badly but despite the fact ...
2016/08/12
[ "https://english.stackexchange.com/questions/342393", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190902/" ]
The behaviour of indulging the wrongdoing of authority is actually so common, that it is a person displaying the opposite behaviour who is called by a specific term: *whistleblower*. Historically the failure to report a criminal offence was itself a criminal offence called *misprision*, but the term is now as archaic ...
That person can be considered *meek* > > quiet, gentle, and easily imposed on; submissive. > > > The action itself may be performed out of *cowardice* > > lack of bravery. > > >
12,178,769
At the moment I have a form with a tChart control called tChart:.. ``` Private Sub txtChart1_Click(sender As System.Object, e As System.EventArgs) Handles txtChart1.Click TChart1.Series.Clear() Dim series1 As New Steema.TeeChart.Chart Dim FirstLabel = New Label() FirstLabel.Name = "FirstLabel.Name" FirstLabel.Text ...
2012/08/29
[ "https://Stackoverflow.com/questions/12178769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1271898/" ]
It supports parallel running by specifying an property. Parameters of Ant-contrib's `<for>` task: > > parallel > > If true, all iterations of the nested will execute in parallel. Defaults to false, which forces sequential execution of the iterations. It is up to the caller to ensure that parallel execution is sa...
Here is the sample piece of code: ``` <for list="some_list" param="list_param" delimiter="any_delimiter" parallel="true"> <sequential> ... </sequential> </for> ```
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
here: ``` void dec2bin(int c) { int i = 0; for(i = 31; i >= 0; i--){ if((c & (1 << i)) != 0){ printf("1"); }else{ printf("0"); } } } ``` But this only prints the value of an integer in binary format. All data is represented in binary format internally anyway.
the function should go like this: ``` int dec2bin(int n){ static int bin,osn=1,c; if(n==0) return 0; else { c=n%2; bin += c*osn; osn*=10; dec2bin(n/2); } return bin; } ```
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
You did not define what is a decimal number for you. I am guessing it is character representation (e.g. in ASCII) of that number. Notice that numbers are just numbers. Binary or decimal numbers do not exist, but a given number may have a binary, and a decimal, representation. Numbers are not made of digits! Then you ...
Here is a version that explicitly uses a string buffer: ``` #include <string.h> const char *str2bin(int num, char buffer[], const int BUFLEN) { (void) memset(buffer, '\0', BUFLEN ); int i = BUFLEN - 1; /* Index into buffer, running backwards. */ int r = 0; /* Remainder....
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
here: ``` void dec2bin(int c) { int i = 0; for(i = 31; i >= 0; i--){ if((c & (1 << i)) != 0){ printf("1"); }else{ printf("0"); } } } ``` But this only prints the value of an integer in binary format. All data is represented in binary format internally anyway.
If it helps you can convert any decimal to binary using bitset library, for example: ``` #include <iostream> #include <bits/stdc++.h> using namespace std; int main(){ int decimal = 20; bitset<5> binary20(decimal); cout << binary20 << endl; return 0; } ``` So, you have an output like **10100**. Bitsets...
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
You did not define what is a decimal number for you. I am guessing it is character representation (e.g. in ASCII) of that number. Notice that numbers are just numbers. Binary or decimal numbers do not exist, but a given number may have a binary, and a decimal, representation. Numbers are not made of digits! Then you ...
There is no such function in C standard library. Anyway, you can write your own: ``` void get_bin(int *dst, intmax_t x); ``` Where `dst` is the resulting array (with `1`s and `0`s), and `x` is the decimal number. For example: C89 version: ``` #include <limits.h> void get_bin(int *dst, int x) { int i; fo...
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
You did not define what is a decimal number for you. I am guessing it is character representation (e.g. in ASCII) of that number. Notice that numbers are just numbers. Binary or decimal numbers do not exist, but a given number may have a binary, and a decimal, representation. Numbers are not made of digits! Then you ...
As far as i know there is no such function in any C library. But here's a recursive function that returns a binary representation of a decimal number as int: ``` int dec2bin(int n) { if(n == 0) return 0; return n % 2 + 10 * dec2bin(n / 2); } ``` The max number that it can represent is 1023 (1111111111 in bin...
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
There is no such function in C standard library. Anyway, you can write your own: ``` void get_bin(int *dst, intmax_t x); ``` Where `dst` is the resulting array (with `1`s and `0`s), and `x` is the decimal number. For example: C89 version: ``` #include <limits.h> void get_bin(int *dst, int x) { int i; fo...
As far as i know there is no such function in any C library. But here's a recursive function that returns a binary representation of a decimal number as int: ``` int dec2bin(int n) { if(n == 0) return 0; return n % 2 + 10 * dec2bin(n / 2); } ``` The max number that it can represent is 1023 (1111111111 in bin...
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
here: ``` void dec2bin(int c) { int i = 0; for(i = 31; i >= 0; i--){ if((c & (1 << i)) != 0){ printf("1"); }else{ printf("0"); } } } ``` But this only prints the value of an integer in binary format. All data is represented in binary format internally anyway.
Use `char * itoa ( int value, char * str, int base );` Find more [here](http://www.cplusplus.com/reference/cstdlib/itoa/) ...
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
You did not define what is a decimal number for you. I am guessing it is character representation (e.g. in ASCII) of that number. Notice that numbers are just numbers. Binary or decimal numbers do not exist, but a given number may have a binary, and a decimal, representation. Numbers are not made of digits! Then you ...
If it helps you can convert any decimal to binary using bitset library, for example: ``` #include <iostream> #include <bits/stdc++.h> using namespace std; int main(){ int decimal = 20; bitset<5> binary20(decimal); cout << binary20 << endl; return 0; } ``` So, you have an output like **10100**. Bitsets...
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
here: ``` void dec2bin(int c) { int i = 0; for(i = 31; i >= 0; i--){ if((c & (1 << i)) != 0){ printf("1"); }else{ printf("0"); } } } ``` But this only prints the value of an integer in binary format. All data is represented in binary format internally anyway.
Here is a version that explicitly uses a string buffer: ``` #include <string.h> const char *str2bin(int num, char buffer[], const int BUFLEN) { (void) memset(buffer, '\0', BUFLEN ); int i = BUFLEN - 1; /* Index into buffer, running backwards. */ int r = 0; /* Remainder....
13,099,252
I want to know if there is a function in C library that convert a decimal to binary number and save number by number in a position on an array. For example: 2 -> 10 -> array [0] = 0 array[1] = 1. Thanks.
2012/10/27
[ "https://Stackoverflow.com/questions/13099252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1777068/" ]
You did not define what is a decimal number for you. I am guessing it is character representation (e.g. in ASCII) of that number. Notice that numbers are just numbers. Binary or decimal numbers do not exist, but a given number may have a binary, and a decimal, representation. Numbers are not made of digits! Then you ...
the function should go like this: ``` int dec2bin(int n){ static int bin,osn=1,c; if(n==0) return 0; else { c=n%2; bin += c*osn; osn*=10; dec2bin(n/2); } return bin; } ```
11,780,337
I created a few PHP files for users of a popular hardware site to use to "Metro" their news posts. It works fairly well, you add the title of the article, links etc. and then it spits it out in Metro tile format. Take a look: <http://briandempsey.org.uk/Newstool/index.php> When the user submits, it uses the informati...
2012/08/02
[ "https://Stackoverflow.com/questions/11780337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1571793/" ]
``` header('Content-Type: text/plain'); ```
Since you're passing your form data using the method GET, you could instead pass it to a page that creates a url to pull the html from... **index.php** will have the form as you've shown above and will post to urlCreator.php. **form.php** can be deleted as it is not needed anymore, the magic will happen in the urlCre...
50,409,414
Hello so i am trying to read lines from a txt file. My code is the following: ``` import sys accFiletypes = '.txt' f = None filnavn = None correctFiletype = False while (correctFiletype == False): filnavn = input("Filename (Type exit to leave):") if (filnavn.endswith(accFiletypes) == True): try: ...
2018/05/18
[ "https://Stackoverflow.com/questions/50409414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8670650/" ]
This worked for me: Include this in your imports: ``` from sqlalchemy import func ``` then: ``` total_passed = db.session.query(func.sum(ReportRecord.count)).scalar() ``` This returns **930** instead of **[(Decimal('930'),)]** Read more about [.scalar()](https://docs.sqlalchemy.org/en/latest/orm/query.html#sqlal...
How about converting the decimal while querying it? Try `int(func.sum(ReportRecord.count).label('total_passed'))` try enforcing your db to cast values into integer should solve your problem I cannot check but there is a cast function which might be useful as well ``` from sqlalchemy.sql.expression import cast cast(...
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
If I understand correctly, you want the number of distinct *combinations* of `parameter`s per `id` represented in your table, possibly with the number of entities exhibiting each of those distinct combinations. I can't speak for SQL Server, but under MySQL you could do something like this: ``` SELECT parameter_set,...
You can use a `having` clause to filter for two unique parameters: ``` select count(*) from YourTable group by id having count(distinct parameter) > 1 ```
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
Okay, here's my attempt. It might be possible to implement this logic in a way that doesn't require 5 accesses to the same table, but I can't think of it right now. The logic here is to first eliminate duplicate objects, then count the remaining IDs. The `NOT IN` subquery represents objects that have a matching object...
You can use a `having` clause to filter for two unique parameters: ``` select count(*) from YourTable group by id having count(distinct parameter) > 1 ```
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
There is no foolproof way to do this in SQL Server 2000, with the conditions specified, but the following will work for most situations and it will warn you if it won't work. Given table, "**tbl**": ``` ID Parameter 1 A 1 B 2 A 3 A 3 B 4 A 4 NULL 5 C 5 D 6 ...
You can use a `having` clause to filter for two unique parameters: ``` select count(*) from YourTable group by id having count(distinct parameter) > 1 ```
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
I resolved the problem with the link Cheran S provided (as Microsoft SQL Server still does not have a GROUP\_CONCAT() function) <http://dataeducation.com/rowset-string-concatenation-which-method-is-best/>
You can use a `having` clause to filter for two unique parameters: ``` select count(*) from YourTable group by id having count(distinct parameter) > 1 ```
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
If I understand correctly, you want the number of distinct *combinations* of `parameter`s per `id` represented in your table, possibly with the number of entities exhibiting each of those distinct combinations. I can't speak for SQL Server, but under MySQL you could do something like this: ``` SELECT parameter_set,...
There is no foolproof way to do this in SQL Server 2000, with the conditions specified, but the following will work for most situations and it will warn you if it won't work. Given table, "**tbl**": ``` ID Parameter 1 A 1 B 2 A 3 A 3 B 4 A 4 NULL 5 C 5 D 6 ...
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
If I understand correctly, you want the number of distinct *combinations* of `parameter`s per `id` represented in your table, possibly with the number of entities exhibiting each of those distinct combinations. I can't speak for SQL Server, but under MySQL you could do something like this: ``` SELECT parameter_set,...
I resolved the problem with the link Cheran S provided (as Microsoft SQL Server still does not have a GROUP\_CONCAT() function) <http://dataeducation.com/rowset-string-concatenation-which-method-is-best/>
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
Okay, here's my attempt. It might be possible to implement this logic in a way that doesn't require 5 accesses to the same table, but I can't think of it right now. The logic here is to first eliminate duplicate objects, then count the remaining IDs. The `NOT IN` subquery represents objects that have a matching object...
There is no foolproof way to do this in SQL Server 2000, with the conditions specified, but the following will work for most situations and it will warn you if it won't work. Given table, "**tbl**": ``` ID Parameter 1 A 1 B 2 A 3 A 3 B 4 A 4 NULL 5 C 5 D 6 ...
3,026,977
I have a table with: ``` id | parameter 1 | A 1 | B 2 | A 3 | A 3 | B ``` That represent objects defined with the values as: ``` 1 -> A,B 2 -> A 3 -> A,B ``` I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the ...
2010/06/12
[ "https://Stackoverflow.com/questions/3026977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/229414/" ]
Okay, here's my attempt. It might be possible to implement this logic in a way that doesn't require 5 accesses to the same table, but I can't think of it right now. The logic here is to first eliminate duplicate objects, then count the remaining IDs. The `NOT IN` subquery represents objects that have a matching object...
I resolved the problem with the link Cheran S provided (as Microsoft SQL Server still does not have a GROUP\_CONCAT() function) <http://dataeducation.com/rowset-string-concatenation-which-method-is-best/>
57,826,232
I'd like to get the index and column name of the minimum value in a pandas DataFrame across all rows and all columns. I've tried .idxmin but this seems to only work when applied on a column. Ideally the function is a one-liner that doesn't require loops. It seems like a very common problem, but I haven't found a solut...
2019/09/06
[ "https://Stackoverflow.com/questions/57826232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8326436/" ]
Try this: ``` df.stack().idxmin() Out[108]: ('index0', 'col0') ```
### Numpy and `divmod` ``` i, j = divmod(np.argmin(np.ravel(df)), df.shape[1]) (df.index[i], df.columns[j]) ('index0', 'col0') ```
2,650,955
I have the following second-order linear differential equation that I am unable to solve: $y''+4y'+4y=t$. The method for solving homogeneous linear second-order differential equations obviously doesn't work, but I am unsure how to apply the technique to solve non-homogenous linear second-order differential equations be...
2018/02/14
[ "https://math.stackexchange.com/questions/2650955", "https://math.stackexchange.com", "https://math.stackexchange.com/users/295059/" ]
A particular solution is obviously a degree $1$ polynomial: $y\_0=at+b$. Since $y\_0'=a$ and $y\_0''=0$, the relation yields $4a+at+b=t$, that is, $a=1$ and $b=-4$. For the general solution the general method *does* work! When the characteristic polynomial has a root $\lambda$ of multiplicity $m$, you get linearly ind...
one solution is given by $$C\_1e^{-2t}$$ and you must for the second one $$C\_2te^{-2t}$$ since both solutions must be independend
95,456
How can I get all list items created or changed by the currently logged in user with [this function](http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/)? What's the correct query? ``` // Getting list items based on ODATA Query function getListItems(url, listname, query, complete,...
2014/04/07
[ "https://sharepoint.stackexchange.com/questions/95456", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/13373/" ]
Use the [$filter](http://www.odata.org/developers/protocols/uri-conventions#FilterSystemQueryOption) query option with `Author` property to filter items by `Modified` field: ``` $filter=AuthorId eq <UserId> ``` How to retrieve current user via SharePoint REST API ----------------------------------------------------...
``` //Display items created by user id 1 var currentUserId = 1; var url = SPAppWebUrl + "/_api/SP.AppContextSite(@target)" + "/web/lists/getbytitle('" + listName + "')/items?$orderby=OfficeLocation,Department,FirstName&$filter=AuthorId eq " + currentUserId + "&" + "@target='" + SPHostUrl + "'"; $.ajax( ...
95,456
How can I get all list items created or changed by the currently logged in user with [this function](http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/)? What's the correct query? ``` // Getting list items based on ODATA Query function getListItems(url, listname, query, complete,...
2014/04/07
[ "https://sharepoint.stackexchange.com/questions/95456", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/13373/" ]
Use the [$filter](http://www.odata.org/developers/protocols/uri-conventions#FilterSystemQueryOption) query option with `Author` property to filter items by `Modified` field: ``` $filter=AuthorId eq <UserId> ``` How to retrieve current user via SharePoint REST API ----------------------------------------------------...
I don't believe there is much you can do since the list only stores the User Id. Rather than querying the UserInformationList for the Id, you can grab it from **\_spPageContextInfo** if you are doing this from the client side. ``` <script type="text/javascript"> $(document).ready( function(){ var userId = _spPa...
95,456
How can I get all list items created or changed by the currently logged in user with [this function](http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/)? What's the correct query? ``` // Getting list items based on ODATA Query function getListItems(url, listname, query, complete,...
2014/04/07
[ "https://sharepoint.stackexchange.com/questions/95456", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/13373/" ]
I don't believe there is much you can do since the list only stores the User Id. Rather than querying the UserInformationList for the Id, you can grab it from **\_spPageContextInfo** if you are doing this from the client side. ``` <script type="text/javascript"> $(document).ready( function(){ var userId = _spPa...
``` //Display items created by user id 1 var currentUserId = 1; var url = SPAppWebUrl + "/_api/SP.AppContextSite(@target)" + "/web/lists/getbytitle('" + listName + "')/items?$orderby=OfficeLocation,Department,FirstName&$filter=AuthorId eq " + currentUserId + "&" + "@target='" + SPHostUrl + "'"; $.ajax( ...
108,798
Original question: [How do I create an in-memory handle in Haskell?](https://stackoverflow.com/questions/60569/how-do-i-create-an-in-memory-handle-in-haskell) This was asked two years ago; at the time, the answer was "not possible due to library limitations". However, since then the limitations have been fixed, and I ...
2011/10/09
[ "https://meta.stackexchange.com/questions/108798", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/170495/" ]
No, you shouldn't ever do this. I know that answer *might* be wrong but it shouldn't be edited from ``` You can't ``` to ``` You can ``` Just give OP some time to reaccept other answer (he was last seen 2 days ago).
Normally, I'd say "yes". And I'd still say *someone* should edit the answer, if it is indeed now incorrect and the asker doesn't respond by changing the accepted answer. But you should probably avoid editing in a link to your own project, simply to avoid the appearance of impropriety. Leave a comment if you're concern...
557,678
I have a web server running CentOS. I didn't pay attention when I installed it, but now the system running out disk space. I have to check it everyday to delete some unimportant stuffs to make enough space to the system to work. But I think that the server has two hard drives by running the command: fdisk -l , with out...
2013/11/26
[ "https://serverfault.com/questions/557678", "https://serverfault.com", "https://serverfault.com/users/200658/" ]
> > Does the system has 2 HDs? > > > Yes you appear to have a 160GB drive and a 250GB drive > > and which one is being used and which one is not? > > > Both are being used. the 160GB has a small boot partition(sda1), and a small swap partition(sda2) and a huge amount of free space. The 250GB drive has the r...
I think you are looking for LVM. Take a look here: <http://ostechnix.wordpress.com/2013/02/03/linux-basics-lvm-logical-volume-manager-tutorial/> At the moment, partition 1 on your first hard disk /dev/sda seems to be used for the /boot partition while partition 1 on your second hard disk /dev/sdb is used for /.
557,678
I have a web server running CentOS. I didn't pay attention when I installed it, but now the system running out disk space. I have to check it everyday to delete some unimportant stuffs to make enough space to the system to work. But I think that the server has two hard drives by running the command: fdisk -l , with out...
2013/11/26
[ "https://serverfault.com/questions/557678", "https://serverfault.com", "https://serverfault.com/users/200658/" ]
> > Does the system has 2 HDs? > > > Yes you appear to have a 160GB drive and a 250GB drive > > and which one is being used and which one is not? > > > Both are being used. the 160GB has a small boot partition(sda1), and a small swap partition(sda2) and a huge amount of free space. The 250GB drive has the r...
You currently only have 1 Drive and 2 partitions. For future expansion, consider using LVM or RAID based setups like X-RAID, RAID0,5,6,10 JBOD, ect... which allows you to clump a bunch of disks as one.
26,948
At risk of sounding like the over-pushy head mistress from Daddy Daycare.... My wife and I are both monolingual Brits, living Britain, with a four-month old daughter. It seems a shame to waste this early stage (or perhaps the near future stage) when children are able to absorb language skills so quickly. Is there a ge...
2016/08/27
[ "https://parenting.stackexchange.com/questions/26948", "https://parenting.stackexchange.com", "https://parenting.stackexchange.com/users/20399/" ]
I'd recommend the foreign babysitter option. You'll want her to come on a regular basis, several hours a week at least, and you'll want her to speak to the child exclusively or almost exclusively in her own language. Make it clear that you want her just to speak the language, and not to attempt to teach it to the child...
Congratulation, you will give a precious gift to your child. Children of that age learn by listening, **only by listening**. Before reaching 7 years old their acoustic filters are not fixed by one particular language yet. The *gentle way*, in your situation, is a **foreign nanny**, **movies or tv programs** plus **lis...
26,948
At risk of sounding like the over-pushy head mistress from Daddy Daycare.... My wife and I are both monolingual Brits, living Britain, with a four-month old daughter. It seems a shame to waste this early stage (or perhaps the near future stage) when children are able to absorb language skills so quickly. Is there a ge...
2016/08/27
[ "https://parenting.stackexchange.com/questions/26948", "https://parenting.stackexchange.com", "https://parenting.stackexchange.com/users/20399/" ]
Congratulation, you will give a precious gift to your child. Children of that age learn by listening, **only by listening**. Before reaching 7 years old their acoustic filters are not fixed by one particular language yet. The *gentle way*, in your situation, is a **foreign nanny**, **movies or tv programs** plus **lis...
My boss at a previous employer was Japanese, his wife was American, they lived in Germany, and so their 3 sons were already fluent in English and German and had a good grasp of Japanese. My boss decided to send them to a French-speaking school. According to my boss, they picked up French pretty quickly and didn't have ...
26,948
At risk of sounding like the over-pushy head mistress from Daddy Daycare.... My wife and I are both monolingual Brits, living Britain, with a four-month old daughter. It seems a shame to waste this early stage (or perhaps the near future stage) when children are able to absorb language skills so quickly. Is there a ge...
2016/08/27
[ "https://parenting.stackexchange.com/questions/26948", "https://parenting.stackexchange.com", "https://parenting.stackexchange.com/users/20399/" ]
I'd recommend the foreign babysitter option. You'll want her to come on a regular basis, several hours a week at least, and you'll want her to speak to the child exclusively or almost exclusively in her own language. Make it clear that you want her just to speak the language, and not to attempt to teach it to the child...
I've recently came across a [TED talk](https://www.ted.com/talks/patricia_kuhl_the_linguistic_genius_of_babies?language=en) about this subject which probably answers some of your questions. I suggest you watching the whole talk, but here are the key things: * Children are generally brilliant at learning languages unti...
26,948
At risk of sounding like the over-pushy head mistress from Daddy Daycare.... My wife and I are both monolingual Brits, living Britain, with a four-month old daughter. It seems a shame to waste this early stage (or perhaps the near future stage) when children are able to absorb language skills so quickly. Is there a ge...
2016/08/27
[ "https://parenting.stackexchange.com/questions/26948", "https://parenting.stackexchange.com", "https://parenting.stackexchange.com/users/20399/" ]
I'd recommend the foreign babysitter option. You'll want her to come on a regular basis, several hours a week at least, and you'll want her to speak to the child exclusively or almost exclusively in her own language. Make it clear that you want her just to speak the language, and not to attempt to teach it to the child...
My boss at a previous employer was Japanese, his wife was American, they lived in Germany, and so their 3 sons were already fluent in English and German and had a good grasp of Japanese. My boss decided to send them to a French-speaking school. According to my boss, they picked up French pretty quickly and didn't have ...
26,948
At risk of sounding like the over-pushy head mistress from Daddy Daycare.... My wife and I are both monolingual Brits, living Britain, with a four-month old daughter. It seems a shame to waste this early stage (or perhaps the near future stage) when children are able to absorb language skills so quickly. Is there a ge...
2016/08/27
[ "https://parenting.stackexchange.com/questions/26948", "https://parenting.stackexchange.com", "https://parenting.stackexchange.com/users/20399/" ]
I've recently came across a [TED talk](https://www.ted.com/talks/patricia_kuhl_the_linguistic_genius_of_babies?language=en) about this subject which probably answers some of your questions. I suggest you watching the whole talk, but here are the key things: * Children are generally brilliant at learning languages unti...
My boss at a previous employer was Japanese, his wife was American, they lived in Germany, and so their 3 sons were already fluent in English and German and had a good grasp of Japanese. My boss decided to send them to a French-speaking school. According to my boss, they picked up French pretty quickly and didn't have ...
5,167,025
> > **Possible Duplicate:** > > [In SQL server is there any way to get the 'use database' command to accept a variable](https://stackoverflow.com/questions/969046/in-sql-server-is-there-any-way-to-get-the-use-database-command-to-accept-a-var) > > > We can change the database by their name is no problem as belo...
2011/03/02
[ "https://Stackoverflow.com/questions/5167025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/248616/" ]
Apparently the problem is with using GO within a dynamic sql statement, because execute sql doesn't support multiple batches. Please see this link for the solution. [Change Database with Dynamic SQL](http://ask.sqlservercentral.com/questions/3974/database-use-issues-with-dynamic-sql)
Perhaps there's a valid reason for this, but if possible I would recommend naming the DB by name in your script where required. for example databasename.table.owner.field
54,591,724
In my karate tests i need to write response id's to txt files (or any other file format such as JSON), was wondering if it has any capability to do this, I haven't seen otherwise in the documentation. In the case of no, is there a simple JavaScript function to do so?
2019/02/08
[ "https://Stackoverflow.com/questions/54591724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7261723/" ]
Try the [`karate.write(value, filename)`](https://github.com/karatelabs/karate#karate-write) API but we don't encourage it. Also the file will be written only to the current "build" directory which will be `target` for Maven projects / stand-alone JAR. `value` can be any data-type, and Karate will write the bytes (or ...
My justification for writing to a file is a different one. I am using karate explicitly to implement a mock. I want to expose an endpoint wherein the upstream system will send some basic data through json payload using POST/PUT method and karate will construct the subsequent payload file and stores it the specific fold...
42,038
I'm new to cryptography. While reading about symmetric key encryption, it was mentioned that it requires secret key exchange so that 2 parties can decrypt the ciphertext. Now, using some encryption software like GPG, we can use symmetric encryption by `gpg --symmetric abc.txt` It asks for password there. Is the key g...
2013/09/08
[ "https://security.stackexchange.com/questions/42038", "https://security.stackexchange.com", "https://security.stackexchange.com/users/30534/" ]
> > Is the key generated using the password? > > > Yes. In this sort of scenario, the password is run through a key derivation function ([KDF](http://en.wikipedia.org/wiki/Key_derivation_function)) such as [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) to generate the key. > > Can I actually see the secret key i...
1) Yes, --symmetric does derive a 128bit key from the password and a salt prepended to the encrypted output. It uses a function called Password Based Key Derivation Function 2 (PBKDF2) to do this. Infact, this is also how gpg encrypts the private key so that only your passphrase can use the file. 2) Well, you could ru...
66,680,836
I want to obtain the value that is under the header count (2500) but the line number of the file can change I tried with this ``` value=$(awk 'NR==6' $log_file) echo $value ``` Also ``` value=$(awk 'NR==1' | awk '/^[0-9]+/ { print }' $log_file) echo $value ``` log\_file ``` PC220 - Production on Feb 13 Connecte...
2021/03/17
[ "https://Stackoverflow.com/questions/66680836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14242596/" ]
This `awk` should work for you: ```sh awk '$0 == "count" {n = NR+2} NR == n {print; exit}' file 2500 ``` Just save line number when we get `count` record and print the value when we get 2nd records afterwards.
You can find a line that is equal to `count` and then get the first field of the second line below with ``` awk '$0 == "count"{getline;getline;print $1;exit}' $log_file ``` See the [online demo](https://ideone.com/CDep2z): ```sh #!/bin/bash s='PC220 - Production on Feb 13 Connected ... CONNECT to DB count ---------...
66,680,836
I want to obtain the value that is under the header count (2500) but the line number of the file can change I tried with this ``` value=$(awk 'NR==6' $log_file) echo $value ``` Also ``` value=$(awk 'NR==1' | awk '/^[0-9]+/ { print }' $log_file) echo $value ``` log\_file ``` PC220 - Production on Feb 13 Connecte...
2021/03/17
[ "https://Stackoverflow.com/questions/66680836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14242596/" ]
shorter with `sed` ``` $ value=$(sed -n '/^count$/{n;n;p;q}' file) ``` find the header, next line, next line, print, quit.
You can find a line that is equal to `count` and then get the first field of the second line below with ``` awk '$0 == "count"{getline;getline;print $1;exit}' $log_file ``` See the [online demo](https://ideone.com/CDep2z): ```sh #!/bin/bash s='PC220 - Production on Feb 13 Connected ... CONNECT to DB count ---------...
56,675,794
I would like the output to look like this: ``` stephen peter ben ``` but with the 'e' characters having a background colour. Is this possible using the below code and some javascript? ``` <!DOCTYPE html> <html> <head> </head> <body> <div> stephen <p id="demo">peter</p> ben </div> <script> </script> </body> </h...
2019/06/19
[ "https://Stackoverflow.com/questions/56675794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9445711/" ]
Get the names, split them into letters, pass each letter through a comparison function and add a span with the highlight class if it is an e. ```js var names = document.querySelectorAll('p'); names.forEach(function(name){ var letters = name.innerText.split(''); var newName = ''; letters.forEach(function(l...
And my solution ```js const elementDiv = document.querySelector('div'); const elementText = elementDiv.textContent.trim().split(/\s+/); elementDiv.innerHTML = ''; elementText.forEach(element => { elementDiv.innerHTML += `<br>${element.replace(/e/gi, '<span style="color: red;">e</span>')}`; }); ``` ```html <d...
6,975,378
There is Campaign Entity and for that, I have CampaignRepository which have this functions 1. public IList FindAll(); 2. public Campaign FindByCampaignNumber(string number); But now i want this criterias -: 1. Find campaigns that are created today. 2. Find campaigns that are created in this month 3. Find top 5 lates...
2011/08/07
[ "https://Stackoverflow.com/questions/6975378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535531/" ]
Have you considered implementing [Specification](http://en.wikipedia.org/wiki/Specification_pattern) pattern in your application? Maybe it looks like an overkill, but it may prove useful if your app will have some complex user filter options. ``` class CampaignSpecification { public CampaignSpecification Number(st...
I would go with creating two Specifications: TopCampaignSpec and CampaingCreatedSpec. ``` var spec = CampaignCreatedSpec.ThisYear(); var campaigns = CampaignsRepository.FindSatisfying(spec); ``` CampaingCreatedSpec can also be replaced with more generic DateRange class if you need this functionality elsewhere: ``` ...
6,975,378
There is Campaign Entity and for that, I have CampaignRepository which have this functions 1. public IList FindAll(); 2. public Campaign FindByCampaignNumber(string number); But now i want this criterias -: 1. Find campaigns that are created today. 2. Find campaigns that are created in this month 3. Find top 5 lates...
2011/08/07
[ "https://Stackoverflow.com/questions/6975378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535531/" ]
Have you considered implementing [Specification](http://en.wikipedia.org/wiki/Specification_pattern) pattern in your application? Maybe it looks like an overkill, but it may prove useful if your app will have some complex user filter options. ``` class CampaignSpecification { public CampaignSpecification Number(st...
You should be able to do all of the above with the following repository method: ``` List<Campaign> findCampaigns(Date fromCreationDate, Date toCreationDate, int offset, Integer limit) { if (fromCreationDate != null) add criteria... if (toCreationDate != null) add criteria... if (limit != null) add limit... }...
6,975,378
There is Campaign Entity and for that, I have CampaignRepository which have this functions 1. public IList FindAll(); 2. public Campaign FindByCampaignNumber(string number); But now i want this criterias -: 1. Find campaigns that are created today. 2. Find campaigns that are created in this month 3. Find top 5 lates...
2011/08/07
[ "https://Stackoverflow.com/questions/6975378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535531/" ]
Have you considered implementing [Specification](http://en.wikipedia.org/wiki/Specification_pattern) pattern in your application? Maybe it looks like an overkill, but it may prove useful if your app will have some complex user filter options. ``` class CampaignSpecification { public CampaignSpecification Number(st...
Here is how I would do this: ``` class Campaigns{ IEnumerable<Campaign> All(){...} IEnumerable<Campaign> ByNumber(int number){...} IEnumerable<Campaign> CreatedToday(){...} IEnumerable<Campaign> CreatedThisMonth(){...} IEnumerable<Campaign> CreatedThisYear(){...} IEnumerable<Campaign> Latest5(){...} pri...
6,975,378
There is Campaign Entity and for that, I have CampaignRepository which have this functions 1. public IList FindAll(); 2. public Campaign FindByCampaignNumber(string number); But now i want this criterias -: 1. Find campaigns that are created today. 2. Find campaigns that are created in this month 3. Find top 5 lates...
2011/08/07
[ "https://Stackoverflow.com/questions/6975378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535531/" ]
I would go with creating two Specifications: TopCampaignSpec and CampaingCreatedSpec. ``` var spec = CampaignCreatedSpec.ThisYear(); var campaigns = CampaignsRepository.FindSatisfying(spec); ``` CampaingCreatedSpec can also be replaced with more generic DateRange class if you need this functionality elsewhere: ``` ...
You should be able to do all of the above with the following repository method: ``` List<Campaign> findCampaigns(Date fromCreationDate, Date toCreationDate, int offset, Integer limit) { if (fromCreationDate != null) add criteria... if (toCreationDate != null) add criteria... if (limit != null) add limit... }...
6,975,378
There is Campaign Entity and for that, I have CampaignRepository which have this functions 1. public IList FindAll(); 2. public Campaign FindByCampaignNumber(string number); But now i want this criterias -: 1. Find campaigns that are created today. 2. Find campaigns that are created in this month 3. Find top 5 lates...
2011/08/07
[ "https://Stackoverflow.com/questions/6975378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535531/" ]
Here is how I would do this: ``` class Campaigns{ IEnumerable<Campaign> All(){...} IEnumerable<Campaign> ByNumber(int number){...} IEnumerable<Campaign> CreatedToday(){...} IEnumerable<Campaign> CreatedThisMonth(){...} IEnumerable<Campaign> CreatedThisYear(){...} IEnumerable<Campaign> Latest5(){...} pri...
You should be able to do all of the above with the following repository method: ``` List<Campaign> findCampaigns(Date fromCreationDate, Date toCreationDate, int offset, Integer limit) { if (fromCreationDate != null) add criteria... if (toCreationDate != null) add criteria... if (limit != null) add limit... }...
61,912,299
I'm designing an app for the company I work for that uses a basic y=mx+c (or y=mx+b if you're from the US) to take 2 calibrated values and 2 input values to output scale and offset values. The app takes a users input from a total of 4 text fields, and then uses a few formulas to output into a text view. My problem is t...
2020/05/20
[ "https://Stackoverflow.com/questions/61912299", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4177171/" ]
You can use `flatMap` here: ``` let input1 = input2Field.text.flatMap(Double.init) let input2 = input2Field.text.flatMap(Double.init) let cal1 = cal2Field.text.flatMap(Double.init) let cal2 = cal2Field.text.flatMap(Double.init) ``` If you want to avoid the code duplication, you can add an extension over `UITextField...
You can use this extension ``` extension String { var convertItToDouble: Double? { return Double(self) } } ``` then in your method ``` @IBAction func CalibrateTapped(_ sender: Any) { var Divisor = 0.0, m_FinalScale = 0.0, m_FinalOffset = 0.0 // this is what the formulas are if let do...
9,550
'An entry which increases an asset account is called a debit.' So if my bank account is my asset account, when I debit money, money actually goes out so it is a 'decrease'. But the above statement has it the other way round. Kindly help me understand this.
2011/07/11
[ "https://money.stackexchange.com/questions/9550", "https://money.stackexchange.com", "https://money.stackexchange.com/users/2991/" ]
There are two basic issues here. First, there is the difference between accounting terms and their dictionary definitions. Second, once you dig into it there are dichotomies similar to put vs call options, long sales vs short sales, bond yield vs interest rate. (That is, while they are relatively simple ideas and oppos...
In this context, we're talking about terms of art in accounting, specifically double-entry book-keeping. In accounting lingo, an "asset" account represents an actual asset and it's value. So if you buy a car with a loan for $10,000, you apply a $10,000 debit to the asset account and a $10,000 credit to the loan. Debi...
9,550
'An entry which increases an asset account is called a debit.' So if my bank account is my asset account, when I debit money, money actually goes out so it is a 'decrease'. But the above statement has it the other way round. Kindly help me understand this.
2011/07/11
[ "https://money.stackexchange.com/questions/9550", "https://money.stackexchange.com", "https://money.stackexchange.com/users/2991/" ]
There are two basic issues here. First, there is the difference between accounting terms and their dictionary definitions. Second, once you dig into it there are dichotomies similar to put vs call options, long sales vs short sales, bond yield vs interest rate. (That is, while they are relatively simple ideas and oppos...
"Debits'" and "Credits" are terms used in double-entry bookkeeping. Each transaction is entered in two different places to be able to double-check accuracy. The total debits and total credits being equal is what makes the balance sheet balance. For explaining debits and credits, wikiversity has a good example using eg...
9,550
'An entry which increases an asset account is called a debit.' So if my bank account is my asset account, when I debit money, money actually goes out so it is a 'decrease'. But the above statement has it the other way round. Kindly help me understand this.
2011/07/11
[ "https://money.stackexchange.com/questions/9550", "https://money.stackexchange.com", "https://money.stackexchange.com/users/2991/" ]
There are two basic issues here. First, there is the difference between accounting terms and their dictionary definitions. Second, once you dig into it there are dichotomies similar to put vs call options, long sales vs short sales, bond yield vs interest rate. (That is, while they are relatively simple ideas and oppos...
Don't be confused by the terminology that your bank uses on *the bank's statement* of your account. When you deposit money into your bank account, you are increasing that asset so you should **debit** that **asset account**. Your bank looks at that same transaction from a different perspective, however. When your ban...
9,550
'An entry which increases an asset account is called a debit.' So if my bank account is my asset account, when I debit money, money actually goes out so it is a 'decrease'. But the above statement has it the other way round. Kindly help me understand this.
2011/07/11
[ "https://money.stackexchange.com/questions/9550", "https://money.stackexchange.com", "https://money.stackexchange.com/users/2991/" ]
"Debits'" and "Credits" are terms used in double-entry bookkeeping. Each transaction is entered in two different places to be able to double-check accuracy. The total debits and total credits being equal is what makes the balance sheet balance. For explaining debits and credits, wikiversity has a good example using eg...
In this context, we're talking about terms of art in accounting, specifically double-entry book-keeping. In accounting lingo, an "asset" account represents an actual asset and it's value. So if you buy a car with a loan for $10,000, you apply a $10,000 debit to the asset account and a $10,000 credit to the loan. Debi...
9,550
'An entry which increases an asset account is called a debit.' So if my bank account is my asset account, when I debit money, money actually goes out so it is a 'decrease'. But the above statement has it the other way round. Kindly help me understand this.
2011/07/11
[ "https://money.stackexchange.com/questions/9550", "https://money.stackexchange.com", "https://money.stackexchange.com/users/2991/" ]
"Debits'" and "Credits" are terms used in double-entry bookkeeping. Each transaction is entered in two different places to be able to double-check accuracy. The total debits and total credits being equal is what makes the balance sheet balance. For explaining debits and credits, wikiversity has a good example using eg...
Don't be confused by the terminology that your bank uses on *the bank's statement* of your account. When you deposit money into your bank account, you are increasing that asset so you should **debit** that **asset account**. Your bank looks at that same transaction from a different perspective, however. When your ban...
3,919
You are a railroad entrepreneur in the 19th-century United States when trains become popular because they are the most efficient means of transporting large volumes of materials by land. There is a national need for railroad tracks from the east coast through some recently colonized lands in the west. To accommodate t...
2011/11/15
[ "https://codegolf.stackexchange.com/questions/3919", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/788/" ]
Python, 307 chars ----------------- ``` import os I=os.read(0,99) n=I.find('\n')+1 I='\0'*n+I+'\0'*n def P(p): S=[] for d in(-n,-1,1,n): y=p[-1]+d if'E'==I[y]:S+=[(sum((int(I[v])-1)/3*75-15*int(I[v])+15for v in p[1:]),p)] if'0'<I[y]<':'and y not in p:S+=P(p+[y]) return S for i in max(P([I.find('S')]))[1][1:]:...
### Ruby, 233 characters ``` R=->s{o=s=~/S/m s=~/E/m?(q=[-1,1,-N,N].map{|t|s[f=o+t]>'0'?(n=s*1 n[o]='#' n[f]='S' a=R[n] a&&[a[0]-(e=s[f].to_i-1)/3*5+e,a[1]]):nil}-[nil] q.sort!&&q[0]):[0,(n=s*1;n[o]='E' n[$_=~/S/m]='S' n)]} N=1+(gets(nil)=~/$/) $><<R[$_+$/*N][1] ``` A Ruby brute-force approach which runs well inside...
3,919
You are a railroad entrepreneur in the 19th-century United States when trains become popular because they are the most efficient means of transporting large volumes of materials by land. There is a national need for railroad tracks from the east coast through some recently colonized lands in the west. To accommodate t...
2011/11/15
[ "https://codegolf.stackexchange.com/questions/3919", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/788/" ]
Python, 307 chars ----------------- ``` import os I=os.read(0,99) n=I.find('\n')+1 I='\0'*n+I+'\0'*n def P(p): S=[] for d in(-n,-1,1,n): y=p[-1]+d if'E'==I[y]:S+=[(sum((int(I[v])-1)/3*75-15*int(I[v])+15for v in p[1:]),p)] if'0'<I[y]<':'and y not in p:S+=P(p+[y]) return S for i in max(P([I.find('S')]))[1][1:]:...
Python: 529 482 460 bytes ------------------------- My solution will not win any prizes. However, since there are only two solutions posted and I found the problem interesting, I decided to post my answer anyway. **Edit:** Thanks to Howard for his recommendations. I've managed to shave a lot of my score! ``` import ...
1,891,175
Does java's [`javax.comm`](http://java.sun.com/products/javacomm/reference/api/index.html) library support "9-bit" serial communication? (use of parity bit or "address bit" as an out-of-band signaling mechanism for framing information) Does the win32 communications API support it? I'm guessing the answer is no on bot...
2009/12/11
[ "https://Stackoverflow.com/questions/1891175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44330/" ]
The win32 comm API does not support this as far as I can tell. However, you can simulate it using the various parity modes. Setting `MARKPARITY` will set the 9th bit to `1` Setting `SPACEPARITY` will set the 9th bit to `0` I can't say about the java version of the library, but I'm sure it supports setting parity m...
Yout should follow this [Seeking FOSS serial port component which can handle 9 data bits](https://stackoverflow.com/q/9188015/463115). Your main problem will be to handle 9-bit at all, as when the windows api can't handle it, how should java solve this? Bt there exists professional cards/driver to solve this (see t...
1,891,175
Does java's [`javax.comm`](http://java.sun.com/products/javacomm/reference/api/index.html) library support "9-bit" serial communication? (use of parity bit or "address bit" as an out-of-band signaling mechanism for framing information) Does the win32 communications API support it? I'm guessing the answer is no on bot...
2009/12/11
[ "https://Stackoverflow.com/questions/1891175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44330/" ]
The win32 comm API does not support this as far as I can tell. However, you can simulate it using the various parity modes. Setting `MARKPARITY` will set the 9th bit to `1` Setting `SPACEPARITY` will set the 9th bit to `0` I can't say about the java version of the library, but I'm sure it supports setting parity m...
I'd like to comment on **karoberts** answer, but I lack reputation. So I have to "answer". **karoberts** proposes a good way if *we need a software solution to our problem* (JCS citation, almost, isn't it? )) But there may arouse a situation I faced today with Python (2.7) trying to do exactly the same thing: my PC r...
93,894
What is the topology of $\mathbb{P}\_2 (\mathbb{C}) \setminus \mathbb{P}\_2 (\mathbb{R})$? For example what is the homology of this manifold with coefficients in $\mathbb{Z}$. I know that this is known but I can't find a good reference for it. Can anyone give me a reference?
2012/04/12
[ "https://mathoverflow.net/questions/93894", "https://mathoverflow.net", "https://mathoverflow.net/users/13559/" ]
$H\_i (CP^2 \setminus RP^2)\cong H^{4-i}(CP^2, RP^2)$ by Poincare-Alexander-Lefschetz duality (Bredon, Topology and Geometry, Theorem 8.3 on p. 351). The latter can be computed using the long exact sequence. $H^4 = Z$, $H^0=H^1=0$ is immediate. The piece $$0 \to H^2 (CP^2,RP^2) \to H^2 (CP^2) \to H^2 (RP^2) \to H^3 (...
There is [a beautiful (and elementary) paper by V. I. Arnold,](http://dl.dropbox.com/u/5188175/arnoldquadric.pdf) which discusses this and generalizations.
54,014,931
[enter image description here](https://i.stack.imgur.com/0SLf1.png)I have a menu that has multiple frame ranges for different objects being animated. I need that menu to save that frame range everytime its closed and reopened. Is it possible to save out data to an external file.
2019/01/03
[ "https://Stackoverflow.com/questions/54014931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10598486/" ]
I can't imagine why this would ever be done in practice explicitly with loops, but it is actually quite straightforward. iterate through columns and rows, replacing values as you go. ``` import numpy as np import pandas as pd def painful_fillna(df, fillvalue=0): df = df.copy() for col in df.columns: f...
Here is a similar question with several answers: [Iterating over rows and columns in Pandas](https://stackoverflow.com/questions/53996433/iterating-over-rows-and-columns-in-pandas/53998299?noredirect=1#comment94840712_53998299) p.s. You can search this site first with different terms and try to find an answer.
33,896,729
Just trying to convert an integer to a string. ``` vars.put("test", i); ``` I'd like to put the value in the variable "test", but it does not working and I think I must convert the int to a string. But I have no idea how to do that. I just found a out how to parsing string to integer in BeanShellSampler.
2015/11/24
[ "https://Stackoverflow.com/questions/33896729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5133750/" ]
Use [String.valueOf()](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#valueOf(int)) method ``` vars.put("test", String.valueOf(i)); ``` Additional information on Beanshell scripting in JMeter - [How to Use BeanShell: JMeter's Favorite Built-in Component](https://blazemeter.com/blog/queen-jmeters-bui...
BeanShell is a Java scripting language, so anything that works in Java should work in BeanShell, too. I tend to use `vars.put("test", new Integer(i).toString());` If `i` is already an `Integer`, you only need to do `vars.put("test", i.toString());`
33,896,729
Just trying to convert an integer to a string. ``` vars.put("test", i); ``` I'd like to put the value in the variable "test", but it does not working and I think I must convert the int to a string. But I have no idea how to do that. I just found a out how to parsing string to integer in BeanShellSampler.
2015/11/24
[ "https://Stackoverflow.com/questions/33896729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5133750/" ]
There is yet a shortcut way, how to cast an `int i` to `String s`: > > `String s = ""+i;` .. just that simple! > > > So the asked example: > > `vars.put("test", ""+i);` > > > ..Seriously, nobody gave that answer yet? See i.e. [4105331](https://stackoverflow.com/questions/4105331/how-do-i-convert-from-int-to...
BeanShell is a Java scripting language, so anything that works in Java should work in BeanShell, too. I tend to use `vars.put("test", new Integer(i).toString());` If `i` is already an `Integer`, you only need to do `vars.put("test", i.toString());`
33,896,729
Just trying to convert an integer to a string. ``` vars.put("test", i); ``` I'd like to put the value in the variable "test", but it does not working and I think I must convert the int to a string. But I have no idea how to do that. I just found a out how to parsing string to integer in BeanShellSampler.
2015/11/24
[ "https://Stackoverflow.com/questions/33896729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5133750/" ]
Use [String.valueOf()](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#valueOf(int)) method ``` vars.put("test", String.valueOf(i)); ``` Additional information on Beanshell scripting in JMeter - [How to Use BeanShell: JMeter's Favorite Built-in Component](https://blazemeter.com/blog/queen-jmeters-bui...
There is yet a shortcut way, how to cast an `int i` to `String s`: > > `String s = ""+i;` .. just that simple! > > > So the asked example: > > `vars.put("test", ""+i);` > > > ..Seriously, nobody gave that answer yet? See i.e. [4105331](https://stackoverflow.com/questions/4105331/how-do-i-convert-from-int-to...
68,016,297
noticed PhpStorm doesn't format code properly. I'm using standard `Ctrl + Shift + L` shortcut and it works because it pops out info that content is properly formatted. [![PhpStorm](https://i.stack.imgur.com/kmLaF.png)](https://i.stack.imgur.com/kmLaF.png) What's wrong? I'm using Material UI Theme. I've already tried ...
2021/06/17
[ "https://Stackoverflow.com/questions/68016297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13824389/" ]
Open **File | Settings | Languages & Frameworks | Template Data Languages** & remove any customizations from there. That's a PhpStorm bug: <https://youtrack.jetbrains.com/issue/WI-42822> & <https://youtrack.jetbrains.com/issue/WI-42135>.
Goto Settings > Editor > File types. For PHP files (as an example), look for PHP in the left column (under Recognize File Types), verify you have \*.php under the File name patterns column/box That fixed it for me.
199,384
I have a 500 Gig external USB drive formatted as exFAT. I can not create an image from my 12.04 install to this drive with ReDo backup (I found out it lacks support for exFAT) . Note the image will be over 5 GIG so FAT32 is not an option for the external drive. Is there another free program I can use to make an image?...
2012/10/12
[ "https://askubuntu.com/questions/199384", "https://askubuntu.com", "https://askubuntu.com/users/73761/" ]
Simple way to find the version of C++ standard library is ``` gcc --version ``` Hope this helps
Fire up synaptic and search for libstdc++ and see which version is installed, or run `apt-cache search -n libstdc++` to see what versions are known, then you can check which one(s) are installed with `apt-cache policy libstdc++-XXXX`
278,756
Other than `tx` and `rx` being the transmit and recieve, can anyone explain what the fields mean in `ethtool -c`'s (Coalescing output) and what effect they have on how coalescing works? ``` Coalesce parameters for eth0: Adaptive RX: off TX: off stats-block-usecs: 999936 sample-interval: 0 pkt-rate-low: 0 pkt-rate-hig...
2011/06/09
[ "https://serverfault.com/questions/278756", "https://serverfault.com", "https://serverfault.com/users/2561/" ]
the delay between the tx and rx events and the generation of interrupts for those events. rx-frames[-irq] rx-usecs[-irq] tx-frames[-irq] tx-usecs[-irq] The frames parameters specify how many packets are received/transmitted before generating an interrupt. The usecs parameters specify how many microseconds after at le...
Usable interrupt coalescing parameters for the Tigeon 3 Network cards [Image](https://i.stack.imgur.com/bYNGs.png) From: <https://monarch.qucosa.de/api/qucosa%3A19496/attachment/ATT-0/>
13,142,415
one of the things we're building right now is a search functionality to look for people. When starting simple, we've used Linq to entities to search, like this: `Entities.People.Where(z=>z.Birthdate < birthdate).ToList()` Then, when new searchcriteria were added, the linq statement grew and grew, and now we have to r...
2012/10/30
[ "https://Stackoverflow.com/questions/13142415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/103089/" ]
In WinForms: Select the PictureBox -> properties -> BackColor -> web -> Transparent
What's the image type? If it's a Bitmap object, you probably have a 24 bit bgr image. To get it to be transparent, you would need to make it a 32 bit bgra image and change every pixel which has the background color to have 0 in the a channel. If it's an 8-bit color-mapped image, you would change the palette entry for t...
350,130
[![No.1](https://i.stack.imgur.com/TEQPv.jpg)](https://i.stack.imgur.com/TEQPv.jpg) [![No.2](https://i.stack.imgur.com/NnxuT.jpg)](https://i.stack.imgur.com/NnxuT.jpg) [![enter image description here](https://i.stack.imgur.com/nN2e4.jpg)](https://i.stack.imgur.com/nN2e4.jpg) Hi, I am an amateur who is making a histori...
2020/02/10
[ "https://gis.stackexchange.com/questions/350130", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/157873/" ]
I finally got the answer! I set the opacity of the color of the layer. But the opacity of the layer rendering was 100%. When I lowered the opacity of layer rendering, not a single symbol, the qgis2web worked successfully. People who are struggling with this, I hope it helps!
Open the HTML file in notepad and scroll down the code until you get to the layer you want the transparency to change. it should look something like: function style\_20YearFlood\_2\_0() { ``` return { pane: 'pane_20YearFlood_2', opacity: 1, color: 'rgba(35,35,35,1.0)', ...
19,763,955
I am using following config for timezone in **config.php** ``` 'timeZone' => 'UTC', ``` It is working fine and all dates are stored in database according to **UTC**. Now each user has its own timezone in his/her profile like **UTC+5**, **UTC-5**, **UTC+0**, etc. Now how can I show dates in reports according to user...
2013/11/04
[ "https://Stackoverflow.com/questions/19763955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/300118/" ]
You can set Timezone in Yii by adding below value in main.php file of config ``` return array( 'timeZone' => 'Asia/Kolkata', ) ``` For time zone list in PHP : <http://php.net/manual/en/timezones.php>
After loading user data try: > > > ``` > Yii:app()->timeZone = $userTimezone; > > ``` > > where $userTimezone - is loaded user timezone from db. It's for using in Yii OR you can set timezone in mysql ones by: > > > ``` > Yii::app()->db->createCommand('SET time_zone = <timezonename>')->execute() > > ``` > >...
19,763,955
I am using following config for timezone in **config.php** ``` 'timeZone' => 'UTC', ``` It is working fine and all dates are stored in database according to **UTC**. Now each user has its own timezone in his/her profile like **UTC+5**, **UTC-5**, **UTC+0**, etc. Now how can I show dates in reports according to user...
2013/11/04
[ "https://Stackoverflow.com/questions/19763955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/300118/" ]
You can set Timezone in Yii by adding below value in main.php file of config ``` return array( 'timeZone' => 'Asia/Kolkata', ) ``` For time zone list in PHP : <http://php.net/manual/en/timezones.php>
You can use afterFind to change the time accordingly ``` public function afterFind() { //apply your logic here $zone = Yii:app()->timeZone; // I don't know code to change time zone, so I assume there is a function named "functionToChangeTimeZone" $this->time = functionToChangeTimeZone($this->time , $z...
20,290,224
I'm trying to make a function with an array in PHP. Using a library called simple\_html\_dom.php to extract data from a site. I've made a piece of code that work exactly how It's suppose to but its to repetitive. So I wanted to create a function with an array. **Here the code I'm trying to make into a function this ...
2013/11/29
[ "https://Stackoverflow.com/questions/20290224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2802187/" ]
The problem is that $html is out of scope. You need to pass $html into the getcoleachrow function, e.g.: ``` function getcoleachrow($col = array(), $value, $html){ for($value=$value;$value<220;$value+=11){ array_push($col, $html->find('td', $value)->plaintext); } for($rows = 0;$rows<=19;$rows++){ ...
You need to add `global $html;` inside the function... ``` function getcoleachrow($col = array(), $value){ global $html; for($value=$value;$value<220;$value+=11){ array_push($col, $html->find('td', $value)->plaintext); } for($rows = 0;$rows<=19;$rows++){ echo $col[$rows]."<br>"; } } ```
45,886,682
How can one store a variadic template to enable reuse in later instances? Code Example: ``` template <typename T, typename ...initArgs> Collection_class { std::vector<T> storage; initArgs ...constructorArguments; Collection_class<T, initArgs>(initArgs... args) { constuctorArguments = args; } ...
2017/08/25
[ "https://Stackoverflow.com/questions/45886682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8137872/" ]
You can acheive this by storing the arguments in a tuple: ``` #include <vector> #include <tuple> template<typename T, int index, typename ...initArgs> struct VectorInit { static void append(std::vector<T> & dst, std::tuple<initArgs...> const& args) { VectorInit<T, index-1, initArgs...>::ap...
Why don't you simply let the `std::vector` handle that: ``` template <typename T> Collection_class { std::vector<T> storage; public: Collection_class<T>(std::initializer_list<T> initargs) : storage(initargs) { } } ``` Note the deferred `CreateInstance()` won't be necessary anymore. --- The `initArgs` va...
51,908,039
I have messages screen and implement custom `tableviewcell` for the display message. A message should be `text` or `image` and some case I need to display boxes with information(see image sender and receiver). it's working fine but some time messages view cut off(see image messages). I have used many `stackViews` to hi...
2018/08/18
[ "https://Stackoverflow.com/questions/51908039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2910061/" ]
I noticed that it was just some variables that didn't reset and after making a reset() function that resets those variables it worked!
Try to call `recreate()`. This works for me.
211,243
I have code looking something like this: ``` $data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_query($query); `...
2008/10/17
[ "https://Stackoverflow.com/questions/211243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
Have you benchmarked the output buffering trick? ``` ob_start(); echo 'INSERT INTO some_table SET BlobData = \'', mysql_real_escape_string( $data ), '\', BlobHash = \'', $hash, '\''; mysql_query( ob_get_clean() ); ``` Another thing you could do is convert to mysqli or MDB2, which support bound parameters. That would...
Well if memory usage is your problem, you can read the large file in chunks and insert these chunks with CONCAT into the database field. Sample code (not tested): ``` $id = 1337; $h = fopen("path/to/file.ext", "r"); while (!feof($h)) { $buffer = fread($h, 4096); $sql = "UPDATE table SET my_field = CO...
211,243
I have code looking something like this: ``` $data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_query($query); `...
2008/10/17
[ "https://Stackoverflow.com/questions/211243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
If you are using PDO, and prepared statments you can use the PDO::PARAM\_LOB type. See example #2 on the LOB page showing how to insert an image to a database using the file pointer. <http://us2.php.net/manual/en/pdo.lobs.php>
Have you benchmarked the output buffering trick? ``` ob_start(); echo 'INSERT INTO some_table SET BlobData = \'', mysql_real_escape_string( $data ), '\', BlobHash = \'', $hash, '\''; mysql_query( ob_get_clean() ); ``` Another thing you could do is convert to mysqli or MDB2, which support bound parameters. That would...
211,243
I have code looking something like this: ``` $data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_query($query); `...
2008/10/17
[ "https://Stackoverflow.com/questions/211243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
You have two issues here: #1, there are several different ways you can compute the MD5 hash: * Do as you do and load into PHP as a string and use PHP's `md5()` * Use PHP's `md5_file()` * As of PHP 5.1+ you can use PHP's streams API with either of `md5` or `md5_file` to avoid loading entirely into memory * Use `exec()...
Have you benchmarked the output buffering trick? ``` ob_start(); echo 'INSERT INTO some_table SET BlobData = \'', mysql_real_escape_string( $data ), '\', BlobHash = \'', $hash, '\''; mysql_query( ob_get_clean() ); ``` Another thing you could do is convert to mysqli or MDB2, which support bound parameters. That would...
211,243
I have code looking something like this: ``` $data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_query($query); `...
2008/10/17
[ "https://Stackoverflow.com/questions/211243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
If you are using PDO, and prepared statments you can use the PDO::PARAM\_LOB type. See example #2 on the LOB page showing how to insert an image to a database using the file pointer. <http://us2.php.net/manual/en/pdo.lobs.php>
Well if memory usage is your problem, you can read the large file in chunks and insert these chunks with CONCAT into the database field. Sample code (not tested): ``` $id = 1337; $h = fopen("path/to/file.ext", "r"); while (!feof($h)) { $buffer = fread($h, 4096); $sql = "UPDATE table SET my_field = CO...
211,243
I have code looking something like this: ``` $data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_query($query); `...
2008/10/17
[ "https://Stackoverflow.com/questions/211243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
Would it make any difference if you didn't put the query into another variable, but instead passed it directly into the MySQL command. I've never tried this, but it may make a difference as the whole string isn't stored in another variable.
Well if memory usage is your problem, you can read the large file in chunks and insert these chunks with CONCAT into the database field. Sample code (not tested): ``` $id = 1337; $h = fopen("path/to/file.ext", "r"); while (!feof($h)) { $buffer = fread($h, 4096); $sql = "UPDATE table SET my_field = CO...
211,243
I have code looking something like this: ``` $data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_query($query); `...
2008/10/17
[ "https://Stackoverflow.com/questions/211243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
You have two issues here: #1, there are several different ways you can compute the MD5 hash: * Do as you do and load into PHP as a string and use PHP's `md5()` * Use PHP's `md5_file()` * As of PHP 5.1+ you can use PHP's streams API with either of `md5` or `md5_file` to avoid loading entirely into memory * Use `exec()...
Well if memory usage is your problem, you can read the large file in chunks and insert these chunks with CONCAT into the database field. Sample code (not tested): ``` $id = 1337; $h = fopen("path/to/file.ext", "r"); while (!feof($h)) { $buffer = fread($h, 4096); $sql = "UPDATE table SET my_field = CO...
211,243
I have code looking something like this: ``` $data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory $hash = md5($data); $query = "INSERT INTO some_table SET BlobData = '" . mysql_real_escape_string($data) . "', BlobHash = '$hash' "; mysql_query($query); `...
2008/10/17
[ "https://Stackoverflow.com/questions/211243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28835/" ]
If you are using PDO, and prepared statments you can use the PDO::PARAM\_LOB type. See example #2 on the LOB page showing how to insert an image to a database using the file pointer. <http://us2.php.net/manual/en/pdo.lobs.php>
Would it make any difference if you didn't put the query into another variable, but instead passed it directly into the MySQL command. I've never tried this, but it may make a difference as the whole string isn't stored in another variable.