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
42,469,945
I have two input boxes on my form. One is a dropdown select and the other is the textbox. I need to update the textbox value depending on what is chosen on the select box. For example, if I choose "1" on select box, the textbox value should have "299.00" and if I choose "2", the textbox value should be "399.0" Can yo...
2017/02/26
[ "https://Stackoverflow.com/questions/42469945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7415564/" ]
The \* tells scanf to read in but ignore the input. Take a look at <http://www.cplusplus.com/reference/cstdio/scanf/> . why it always prints 67 you might need to step through a debugger to see what the int is initialized with and how that changes.
Use correct format specifiers for their respective data types ``` float %f double %lf int %d or %i unsigned int %u char %c char * %s long int %ld long long int %lld ```
42,469,945
I have two input boxes on my form. One is a dropdown select and the other is the textbox. I need to update the textbox value depending on what is chosen on the select box. For example, if I choose "1" on select box, the textbox value should have "299.00" and if I choose "2", the textbox value should be "399.0" Can yo...
2017/02/26
[ "https://Stackoverflow.com/questions/42469945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7415564/" ]
In the above program, the `scanf()` reads but does not assign the value due to the `*` format specifier. As a result, whatever is the value of a (which is not initialized) is produced as output by `printf()`. In this case, 67 is the garbage value.
Use correct format specifiers for their respective data types ``` float %f double %lf int %d or %i unsigned int %u char %c char * %s long int %ld long long int %lld ```
73,859,557
I'm trying to do this: I have an array of objects with the detail of a sale, with this format: ``` [ { product:Banana, quantity:34, ...(other fields) }, { product:Apple, quantity:11, ...(other fields) }, { product:Banana, quantity:15, ...(other fields) }, { product:Apple, quantity:...
2022/09/26
[ "https://Stackoverflow.com/questions/73859557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13365958/" ]
This means that you are using an older version of PHP. Prior to PHP 8.0 locale setting affected the [conversion of floats to strings](https://wiki.php.net/rfc/locale_independent_float_to_string). This means that if you had a float and you used something like `echo` to output it out, the conversion to string would repla...
When you use the prepared statement, you're also using the MySQL Native Driver (MYSQLND). When it fetches MySQL `FLOAT` columns, by default it returns them as PHP floats rather than strings. So PHP's locale is used when formatting them. This is controlled by the option `MYSQLI_OPT_INT_AND_FLOAT_NATIVE`. You can unset ...
56,368,620
I have a flexbox, and elements in it are "p" elements. I'm trying to align it right, but it's still not working and everything is still aligned center. ```css .box1{ display: flex; flex-direction: column; text-align: right; justify-content: space-between; font-family: 'Merriweather', sans-serif; ...
2019/05/29
[ "https://Stackoverflow.com/questions/56368620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9547590/" ]
`align-items: flex-end;` will align the `<p>` elements to the right side of the container, but only if the container's width is greater than the children's width. ```css div { width: 200px; display: flex; flex-direction: column; align-items: flex-end; box-sizing: border-box; border: solid red 3px; }...
Apply the text-align to the paragraphs: ``` .box1 p { text-align: right; } ```
140,046
I am running many tasks on a Linux cluster. Each task creates many output files. When all tasks are finished, I run something like `tar cf foo.tar output_files/`to create a `tar` archive. This is a very slow process since there are many thousands of files and directories. Is there any way to do this in parallel as the...
2014/06/30
[ "https://unix.stackexchange.com/questions/140046", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
You can't have multiple processes adding to the same tar archive (or any other usual archive format, compressed or not). Each file is stored contiguously, and there is no way to insert data in a file, only to append or overwrite, so continuing to write to a file that isn't the last one would overwrite subsequent files....
You can start the creation of the final `tar` file before all output files are created: Maybe that achieves the speed up you want. You can call tar this way: ``` tar -cf foo.tar -T file-list ``` `file-list` would be a FIFO. You need a script which detects 1. new files in the source directory (`inotifywatch`) 2. wh...
140,046
I am running many tasks on a Linux cluster. Each task creates many output files. When all tasks are finished, I run something like `tar cf foo.tar output_files/`to create a `tar` archive. This is a very slow process since there are many thousands of files and directories. Is there any way to do this in parallel as the...
2014/06/30
[ "https://unix.stackexchange.com/questions/140046", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
You can't have multiple processes adding to the same tar archive (or any other usual archive format, compressed or not). Each file is stored contiguously, and there is no way to insert data in a file, only to append or overwrite, so continuing to write to a file that isn't the last one would overwrite subsequent files....
GNU tar has --append: ``` tar -f foo.tar --append newfiles ``` Unfortunately it reads the full tar file.
140,046
I am running many tasks on a Linux cluster. Each task creates many output files. When all tasks are finished, I run something like `tar cf foo.tar output_files/`to create a `tar` archive. This is a very slow process since there are many thousands of files and directories. Is there any way to do this in parallel as the...
2014/06/30
[ "https://unix.stackexchange.com/questions/140046", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
You can start the creation of the final `tar` file before all output files are created: Maybe that achieves the speed up you want. You can call tar this way: ``` tar -cf foo.tar -T file-list ``` `file-list` would be a FIFO. You need a script which detects 1. new files in the source directory (`inotifywatch`) 2. wh...
GNU tar has --append: ``` tar -f foo.tar --append newfiles ``` Unfortunately it reads the full tar file.
47,923,668
I am using `Laravel Framework 5.5.26` and I am querying my db with the following call: ``` $symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->get(array( 'symbol', )); ``` If I `var_dump...
2017/12/21
[ "https://Stackoverflow.com/questions/47923668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2847689/" ]
It's a collection of objects, not arrays. So you need to use this syntax to get property of an object in a collection: ``` $symbolsArray[$key]->symbol ``` If you need to get just symbols, use `pluck()` instead of `get()`: ``` ->pluck('symbol')->toArray() ```
**Simple convert given output as an array like shown below** ``` $symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->get(array( 'symbol', ))->toArray(); // get data as array not object ```
47,923,668
I am using `Laravel Framework 5.5.26` and I am querying my db with the following call: ``` $symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->get(array( 'symbol', )); ``` If I `var_dump...
2017/12/21
[ "https://Stackoverflow.com/questions/47923668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2847689/" ]
It's a collection of objects, not arrays. So you need to use this syntax to get property of an object in a collection: ``` $symbolsArray[$key]->symbol ``` If you need to get just symbols, use `pluck()` instead of `get()`: ``` ->pluck('symbol')->toArray() ```
The result of DB::table()->get() is always a [Collection](https://laravel.com/docs/5.5/eloquent-collections), whose attributes you access like variables within a PHP class with `->`. In your example, your `$symbolsArray` is not actually an array, you access the content with `$symbolsArray[$key]->symbol`. Assuming tha...
47,923,668
I am using `Laravel Framework 5.5.26` and I am querying my db with the following call: ``` $symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->get(array( 'symbol', )); ``` If I `var_dump...
2017/12/21
[ "https://Stackoverflow.com/questions/47923668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2847689/" ]
It's a collection of objects, not arrays. So you need to use this syntax to get property of an object in a collection: ``` $symbolsArray[$key]->symbol ``` If you need to get just symbols, use `pluck()` instead of `get()`: ``` ->pluck('symbol')->toArray() ```
$symbolsArray is a collection and not an array. The get an array, you could pluck symbol from the collection `$symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->pluck('symbol')->all();` or you could actually convert your collection t...
47,923,668
I am using `Laravel Framework 5.5.26` and I am querying my db with the following call: ``` $symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->get(array( 'symbol', )); ``` If I `var_dump...
2017/12/21
[ "https://Stackoverflow.com/questions/47923668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2847689/" ]
**Simple convert given output as an array like shown below** ``` $symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->get(array( 'symbol', ))->toArray(); // get data as array not object ```
$symbolsArray is a collection and not an array. The get an array, you could pluck symbol from the collection `$symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->pluck('symbol')->all();` or you could actually convert your collection t...
47,923,668
I am using `Laravel Framework 5.5.26` and I am querying my db with the following call: ``` $symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->get(array( 'symbol', )); ``` If I `var_dump...
2017/12/21
[ "https://Stackoverflow.com/questions/47923668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2847689/" ]
The result of DB::table()->get() is always a [Collection](https://laravel.com/docs/5.5/eloquent-collections), whose attributes you access like variables within a PHP class with `->`. In your example, your `$symbolsArray` is not actually an array, you access the content with `$symbolsArray[$key]->symbol`. Assuming tha...
$symbolsArray is a collection and not an array. The get an array, you could pluck symbol from the collection `$symbolsArray = DB::table('exchanges') ->join('markets', 'exchanges.id', '=', 'markets.exchanges_id') ->where('name', $exchangeName) ->pluck('symbol')->all();` or you could actually convert your collection t...
48,485,117
I want to use some of the icons from font awesome rather than google's material icons, however the font awesome icons do not line up correctly in a link collection. ``` <div class="col s12 m4 l3 xl2"> <div class="collection with-header white"> <h6 class="collection-header"><i class=" material-icons left">insert_...
2018/01/28
[ "https://Stackoverflow.com/questions/48485117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6126468/" ]
Try to give some width to the icons. And as I see you don't need to use `.left` class to the icons. Simply use `display:inline-block` and `vertical-align:middle;` ***Stack Snippet*** ```css .collection i { width: 40px; vertical-align: middle; display: inline-block; } ``` ```html <link href="https://fonts....
Adding CSS fixed the issue by putting a margin next to the font-awesome icons ``` .fa-2x { margin-right: 15px; } ```
18,483,443
I'm using `meteor.js` and I just went to change some of the HTML output in the .html file only and it started giving me the error: > > Error: database names cannot contain the character '.' > > > I haven't changed anything, the only thing I recall doing inbetween is starting a new project which I created using me...
2013/08/28
[ "https://Stackoverflow.com/questions/18483443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/849843/" ]
Have a look at your collection in `.meteor/local/db` to see if any files were added in. If it really still continues you could use `meteor reset` but it would clear your database. The issue arises from mongodb, because `.` notation lets you peak inside objects in javascript the character is reserved and can't be used...
when I use expressjs with mongoose, above error was occured.It resolve by doing 1.create a database.js file make a exportble database configuration inside it as follows ``` module.exports = {database : "mongodb://myUsername:myPassword@ds161039.mlab.com:61039/accounttest"}; ``` 2.Require it to your current JS fil...
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
That saddle is unlikely to adjust to you. Man-made materials generally don't budge. You may want to try a Brooks or other leather saddle. If you do, apply the saddle dressing that should come with it, and don't do long rides on it for a few weeks. I've found that two or three weeks of commuting (25 km round-trip) usual...
Having your saddle straight ahead is not always best either. Every body is different - I'd urge you to set up your bike to fit your actual body, not some aesthetic ideal of "supposed to be\_***\_***. "
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
[This question](https://bicycles.stackexchange.com/questions/5906/adjusting-saddle-angle-on-a-road-bike-drop-bars/5922#5922) was answered by a suggestion to slide the saddle forwards on the seat post. You could give that a try. I doubt you'll get used to an existing, uncomfortable saddle position. I don't think that p...
It's vital to adjust your bike to fit your body from the start if you want to keep appropriate alignment and avoid physical difficulties. This will also help you stay comfortable during your bike ride. Setting your [bike seat](https://www.bikeshepherd.org/how-to-make-my-bike-seat-more-comfortable/) to the same height a...
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
Take it back and get a different one. A decent bike shop will let you do this. I went through 3 saddles the last time. The goal is that the "saddle fits you", and not, "you fit the saddle". > > It really doesn't take weeks. > > > to determine whether a saddle is right or not! A long ride will do. *An anecdota...
[This question](https://bicycles.stackexchange.com/questions/5906/adjusting-saddle-angle-on-a-road-bike-drop-bars/5922#5922) was answered by a suggestion to slide the saddle forwards on the seat post. You could give that a try. I doubt you'll get used to an existing, uncomfortable saddle position. I don't think that p...
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
[This question](https://bicycles.stackexchange.com/questions/5906/adjusting-saddle-angle-on-a-road-bike-drop-bars/5922#5922) was answered by a suggestion to slide the saddle forwards on the seat post. You could give that a try. I doubt you'll get used to an existing, uncomfortable saddle position. I don't think that p...
I dont't know that saddle model but, as always, the answer is really subjective. It could also be *forever*. My suggestion is to try a saddle before buying and buy always the better shorts you can afford.
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
That saddle is unlikely to adjust to you. Man-made materials generally don't budge. You may want to try a Brooks or other leather saddle. If you do, apply the saddle dressing that should come with it, and don't do long rides on it for a few weeks. I've found that two or three weeks of commuting (25 km round-trip) usual...
I dont't know that saddle model but, as always, the answer is really subjective. It could also be *forever*. My suggestion is to try a saddle before buying and buy always the better shorts you can afford.
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
Take it back and get a different one. A decent bike shop will let you do this. I went through 3 saddles the last time. The goal is that the "saddle fits you", and not, "you fit the saddle". > > It really doesn't take weeks. > > > to determine whether a saddle is right or not! A long ride will do. *An anecdota...
It's vital to adjust your bike to fit your body from the start if you want to keep appropriate alignment and avoid physical difficulties. This will also help you stay comfortable during your bike ride. Setting your [bike seat](https://www.bikeshepherd.org/how-to-make-my-bike-seat-more-comfortable/) to the same height a...
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
Take it back and get a different one. A decent bike shop will let you do this. I went through 3 saddles the last time. The goal is that the "saddle fits you", and not, "you fit the saddle". > > It really doesn't take weeks. > > > to determine whether a saddle is right or not! A long ride will do. *An anecdota...
Having your saddle straight ahead is not always best either. Every body is different - I'd urge you to set up your bike to fit your actual body, not some aesthetic ideal of "supposed to be\_***\_***. "
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
Take it back and get a different one. A decent bike shop will let you do this. I went through 3 saddles the last time. The goal is that the "saddle fits you", and not, "you fit the saddle". > > It really doesn't take weeks. > > > to determine whether a saddle is right or not! A long ride will do. *An anecdota...
It can take a few weeks to get used to a new saddle, or other components, but if adjusted properly they should be 'uncomfortable', not 'freaking hurts' painful. When it comes to saddles, even after a professional fit you may need to make adjustments at home. Using a grease pencil or other means of marking the position...
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
Take it back and get a different one. A decent bike shop will let you do this. I went through 3 saddles the last time. The goal is that the "saddle fits you", and not, "you fit the saddle". > > It really doesn't take weeks. > > > to determine whether a saddle is right or not! A long ride will do. *An anecdota...
I dont't know that saddle model but, as always, the answer is really subjective. It could also be *forever*. My suggestion is to try a saddle before buying and buy always the better shorts you can afford.
6,323
I recently "upgraded" to a [Romin Comp Gel](http://www.specialized.com/us/en/bc/SBCEqProduct.jsp?spid=53997) saddle from a soft racing saddle because my old one, while extremely comfortable on long road rides, wasn't working for the TT position I'm now practicing for an upcoming Ironman. I've been professionally fit w...
2011/09/30
[ "https://bicycles.stackexchange.com/questions/6323", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/1044/" ]
That saddle is unlikely to adjust to you. Man-made materials generally don't budge. You may want to try a Brooks or other leather saddle. If you do, apply the saddle dressing that should come with it, and don't do long rides on it for a few weeks. I've found that two or three weeks of commuting (25 km round-trip) usual...
It's vital to adjust your bike to fit your body from the start if you want to keep appropriate alignment and avoid physical difficulties. This will also help you stay comfortable during your bike ride. Setting your [bike seat](https://www.bikeshepherd.org/how-to-make-my-bike-seat-more-comfortable/) to the same height a...
8,985,061
I try to put some strings to `CharBuffer` with `CharBuffer.put()` function but the buffer is left blank. my code: ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int i = 0; i < 10; i++) { String text = "testing" + i + "\n"; charBuf.put(text); } System.out.println(charBuf); ``` I tried to use with...
2012/01/24
[ "https://Stackoverflow.com/questions/8985061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927045/" ]
You must rewind it after you put in the objects, try this ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int i = 0; i < 10; i++) { String text = "testing" + i + "\n"; charBuf.put(text); } charBuf.rewind(); System.out.println(charBuf); ```
Add a call to [`rewind()`](http://docs.oracle.com/javase/1.5.0/docs/api/java/nio/Buffer.html#rewind%28%29) right **after** the loop.
8,985,061
I try to put some strings to `CharBuffer` with `CharBuffer.put()` function but the buffer is left blank. my code: ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int i = 0; i < 10; i++) { String text = "testing" + i + "\n"; charBuf.put(text); } System.out.println(charBuf); ``` I tried to use with...
2012/01/24
[ "https://Stackoverflow.com/questions/8985061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927045/" ]
You must rewind it after you put in the objects, try this ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int i = 0; i < 10; i++) { String text = "testing" + i + "\n"; charBuf.put(text); } charBuf.rewind(); System.out.println(charBuf); ```
Try this: ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int i = 0; i < 10; i++) { String text = "testing" + i + "\n"; charBuf.put(text); } charBuf.rewind(); System.out.println(charBuf); ``` The detail you're missing is that writing moves the current pointer to the end of the written data, so when...
8,985,061
I try to put some strings to `CharBuffer` with `CharBuffer.put()` function but the buffer is left blank. my code: ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int i = 0; i < 10; i++) { String text = "testing" + i + "\n"; charBuf.put(text); } System.out.println(charBuf); ``` I tried to use with...
2012/01/24
[ "https://Stackoverflow.com/questions/8985061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927045/" ]
You must rewind it after you put in the objects, try this ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int i = 0; i < 10; i++) { String text = "testing" + i + "\n"; charBuf.put(text); } charBuf.rewind(); System.out.println(charBuf); ```
You will need to `flip()` the buffer before you can read from the buffer. The `flip()` method needs to be called before reading the data from the buffer. When the `flip()` method is called the limit is set to the current position, and the position to 0. e.g. ``` CharBuffer charBuf = CharBuffer.allocate(1000); for (int...
18,856,607
I have used the below code in app code `session.cs` file. It has been loaded initially in httpmodule.cs, whenever every page hit in browser. I found the `httpcontext.current.session` value is `null`. ``` if (HttpContext.Current != null && HttpContext.Current.Session != null) { try { ...
2013/09/17
[ "https://Stackoverflow.com/questions/18856607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2739544/" ]
You don't mention if you have an endpoint configured for your Azure VM. If not, make sure you create an endpoint with a private port of 8172. EDIT: [Here is a troubleshooting guide](http://www.iis.net/learn/publish/troubleshooting-web-deploy/troubleshooting-common-problems-with-web-deploy) for web deploy that includ...
Helpful but in the end in our case it was TLS mismatch. Check both machines can do TLS 1.2 if you are forcing it. Have put more detail here <https://fuseit.zendesk.com/hc/en-us/articles/360000328595>. Cheers
18,856,607
I have used the below code in app code `session.cs` file. It has been loaded initially in httpmodule.cs, whenever every page hit in browser. I found the `httpcontext.current.session` value is `null`. ``` if (HttpContext.Current != null && HttpContext.Current.Session != null) { try { ...
2013/09/17
[ "https://Stackoverflow.com/questions/18856607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2739544/" ]
After dealing with this for about an hour now, I figured out how to fix this on my Azure Virtual Machine. First the obvious * Check that port 8172 (if you're using default settings) is open in your firewall * Check that the processes MsDepSvc and WMSVC are running. * Check that the site name is correct. **Management...
Helpful but in the end in our case it was TLS mismatch. Check both machines can do TLS 1.2 if you are forcing it. Have put more detail here <https://fuseit.zendesk.com/hc/en-us/articles/360000328595>. Cheers
61,808
It is good practice to use walk commands rather than holding direction buttons as much as possible lest you accidentally run into a monster you can't handle and die as a result, a mistake I've made more than once. However, walking in Nethack is... not awesome. This is my situation right now: ``` ...
2012/04/09
[ "https://gaming.stackexchange.com/questions/61808", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/23/" ]
Press "g" and then the direction to stop at intersections. Not SHIFT-direction. More generally, use the "?" command to read the documentation for various nethack commands, including the differences between SHIFT, "g", "G"/CTRL, and "m" as movement modifiers. See also <http://strategywiki.org/wiki/NetHack/Controls#Adv...
I strongly disagree with the first sentence, but the answer is to use `_` to run to where you want to go.
73,646,111
I created a hook to be able to set a timeout. Every callback that will be added in that hook will be delayed with a certain amount of time: ``` import "./styles.css"; import React, { useRef, useCallback, useState, useEffect } from "react"; const useTimer = () => { const timer = useRef(); const fn = useCallback((ca...
2022/09/08
[ "https://Stackoverflow.com/questions/73646111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12540500/" ]
All you need is to add `clearTimeout()` to your `useTimer()` function. Here's your working code: ```js import "./styles.css"; import React, { useRef, useCallback, useState, useEffect } from "react"; const useTimer = () => { const timer = useRef(); const fn = useCallback((callback, timeout = 0) => { // Add thi...
You are passing the ref directly to clearTimeout ```js const clearTimeoutHandler = () => { console.log("clear"); return clearTimeout(timer); // should be timer.current }; ```
73,646,111
I created a hook to be able to set a timeout. Every callback that will be added in that hook will be delayed with a certain amount of time: ``` import "./styles.css"; import React, { useRef, useCallback, useState, useEffect } from "react"; const useTimer = () => { const timer = useRef(); const fn = useCallback((ca...
2022/09/08
[ "https://Stackoverflow.com/questions/73646111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12540500/" ]
All you need is to add `clearTimeout()` to your `useTimer()` function. Here's your working code: ```js import "./styles.css"; import React, { useRef, useCallback, useState, useEffect } from "react"; const useTimer = () => { const timer = useRef(); const fn = useCallback((callback, timeout = 0) => { // Add thi...
I think you should clear previous timer in `fn` function, and assign null to `timer.current` after callback function is invoke. this is my code below: <https://codesandbox.io/s/exciting-fire-jgujww?file=/src/App.js:0-977>
52,473,687
I have one string ``` var inp = "ABCABCABC"; ``` To get second occurrence of "A" am doing below ``` int index = inp.indexOf("A", inp.indexOf("A")+1); ``` But if I need third occurrence of "A", Why I cant do like this ? ``` int index = inp.indexOf("A", inp.indexOf("A")+2); ---Not Working WHY....? ``` But this...
2018/09/24
[ "https://Stackoverflow.com/questions/52473687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9748223/" ]
In this case, `+1` just adds `1`, nothing more. It doesn't skip `n` occurrences. What I suggest you do is use a loop. ``` public static int findNth(String text, String find, int nth) { int last = -1; for (int i = 0; i < nth; i++) { last = text.indexOf(find, last + 1); if (last == -1) return -1...
This only works because ``` int index = inp.indexOf("A"); ``` returns the index of the first occurrence of A, beginning with the 0th character (inclusive). ([See the documentation here](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(int,%20int)).) If you set a second argument ``` int index ...
72,406,938
I have been wrestling with Boost.Spirit for a week. Forgive me for my ignorance about C++'s template metaprogramming, but I can't help to ask: How do you know what can you do with a variable if you don't know its god damn type? For example: ```cpp namespace qi = boost::spirit::qi; qi::on_error<qi::fail>(rule, [](au...
2022/05/27
[ "https://Stackoverflow.com/questions/72406938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13784274/" ]
The simplest way: ``` qi::on_error<qi::fail>(rule, [](auto& args, auto& context, auto& r) { std::cerr << __PRETTY_FUNCTION__ << std::endl; } ); ``` On e.g. GCC this prints the full signature including deduced type arguments. Is the documentation wrong? --------------------------- Note that it **DOES** e...
It will generate a compile time error, but if you have a class template declaration like ``` template <typename T> struct get_type; ``` Then trying to create a `get_type` object with a provided type will generate an error and in the error message it will tell you what the type provide to `get_type` is. For example u...
63,917,490
First want to filter by class and then change class name : ``` <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col...
2020/09/16
[ "https://Stackoverflow.com/questions/63917490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5287215/" ]
Is this what you mean? ``` myFilterData.each(function(index) { if (! (index % 2)) $(this) .addClass("newClass") // .removeClass("catB") // Not sure if you also want this ; }); ```
Use data id in each div and get data id ``` <div class="root"> <div class="col-8 filter" data-id="catA"></div> <div class="col-4 filter" data-id="catB"></div> <div class="col-8 filter" data-id="catA"></div> <div class="col-4 filter" data-id="catB"></div> <div class="col-...
63,917,490
First want to filter by class and then change class name : ``` <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col...
2020/09/16
[ "https://Stackoverflow.com/questions/63917490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5287215/" ]
Please check below solution.You can add or remove the class according to your condition. ``` var myFilterData = $('.filter').filter('.catB'); if (yourcondition == true) { myFilterData.addClass("newClass"); // myFilterData.removeClass("catB") For removing the class } ```
Use data id in each div and get data id ``` <div class="root"> <div class="col-8 filter" data-id="catA"></div> <div class="col-4 filter" data-id="catB"></div> <div class="col-8 filter" data-id="catA"></div> <div class="col-4 filter" data-id="catB"></div> <div class="col-...
63,917,490
First want to filter by class and then change class name : ``` <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col...
2020/09/16
[ "https://Stackoverflow.com/questions/63917490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5287215/" ]
Is this what you mean? ``` myFilterData.each(function(index) { if (! (index % 2)) $(this) .addClass("newClass") // .removeClass("catB") // Not sure if you also want this ; }); ```
I think you need to filter all the divs with catB class evenly and change the class accordingly. Try this in your click handler $('.filter.catB:even').removeClass('col-4').addClass('col-8');
63,917,490
First want to filter by class and then change class name : ``` <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col...
2020/09/16
[ "https://Stackoverflow.com/questions/63917490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5287215/" ]
Please check below solution.You can add or remove the class according to your condition. ``` var myFilterData = $('.filter').filter('.catB'); if (yourcondition == true) { myFilterData.addClass("newClass"); // myFilterData.removeClass("catB") For removing the class } ```
I think you need to filter all the divs with catB class evenly and change the class accordingly. Try this in your click handler $('.filter.catB:even').removeClass('col-4').addClass('col-8');
63,917,490
First want to filter by class and then change class name : ``` <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col...
2020/09/16
[ "https://Stackoverflow.com/questions/63917490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5287215/" ]
Is this what you mean? ``` myFilterData.each(function(index) { if (! (index % 2)) $(this) .addClass("newClass") // .removeClass("catB") // Not sure if you also want this ; }); ```
Please check it, this way you can update classes ```html <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA ...
63,917,490
First want to filter by class and then change class name : ``` <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col...
2020/09/16
[ "https://Stackoverflow.com/questions/63917490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5287215/" ]
Please check below solution.You can add or remove the class according to your condition. ``` var myFilterData = $('.filter').filter('.catB'); if (yourcondition == true) { myFilterData.addClass("newClass"); // myFilterData.removeClass("catB") For removing the class } ```
Please check it, this way you can update classes ```html <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA ...
63,917,490
First want to filter by class and then change class name : ``` <div class="root"> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col-8 catA filter"></div> <div class="col-4 catB filter"></div> <div class="col...
2020/09/16
[ "https://Stackoverflow.com/questions/63917490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5287215/" ]
Is this what you mean? ``` myFilterData.each(function(index) { if (! (index % 2)) $(this) .addClass("newClass") // .removeClass("catB") // Not sure if you also want this ; }); ```
Please check below solution.You can add or remove the class according to your condition. ``` var myFilterData = $('.filter').filter('.catB'); if (yourcondition == true) { myFilterData.addClass("newClass"); // myFilterData.removeClass("catB") For removing the class } ```
662,967
$(2^n+n^2)$ is $O(2^n)$ and $(n^3+3^n)$ is $O(3^n)$, therefore I conclude that $(2^n+n^2)(n^3+3^n)$ is $O(2^n\*3^n)=O(6^n)$
2014/02/04
[ "https://math.stackexchange.com/questions/662967", "https://math.stackexchange.com", "https://math.stackexchange.com/users/86425/" ]
Your answer is correct, yet if you were not 100% sure you can always check using the definition of "big O": $$\limsup\_{n\rightarrow\infty}\frac{(2^n+n^2)(n^3+3^n)}{6^n}=\limsup\_{n\rightarrow\infty}\frac{n^5+n^32^n+n^23^n+6^n}{6^n}=\limsup\_{n\rightarrow\infty}(n^5(1/6)^n+n^3(1/3)^n+n^2(1/2)^n+1)=1$$ $$\Rightarrow (2...
Yes ${}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}$
5,353,311
`npm uninstall express` successfully uninstalls express, and when I `ls $NODE_PATH`, it isn't there anymore. However, if I run `node` and `require('express')`, I get ``` { version: '1.0.0rc2', Server: { [Function: Server] super_: { [Function: Server] super_: [Object] } }, createServer: [Function] } ``` Why does...
2011/03/18
[ "https://Stackoverflow.com/questions/5353311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137100/" ]
Output the require paths `console.log(require.paths)` Those are the paths nodejs is using to resolve the `require('express')`
I currently use latest node, Express@1.0.8, Connect@0.5.10. I've been having some issues with upgrading to the latest connect/express, so I vowed to finish building my app first and then perform a massive upgrade. This combo works well for me though.
5,353,311
`npm uninstall express` successfully uninstalls express, and when I `ls $NODE_PATH`, it isn't there anymore. However, if I run `node` and `require('express')`, I get ``` { version: '1.0.0rc2', Server: { [Function: Server] super_: { [Function: Server] super_: [Object] } }, createServer: [Function] } ``` Why does...
2011/03/18
[ "https://Stackoverflow.com/questions/5353311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137100/" ]
Output the require paths `console.log(require.paths)` Those are the paths nodejs is using to resolve the `require('express')`
Try `npm config get root`—that shows you where npm is installing things. If it's pointing somewhere that doesn't make sense, use `npm config set root [new path]` to change it to something that's in Node's `require.paths`. (Of course, now you'll have to reinstall all of your npm packages.)
5,353,311
`npm uninstall express` successfully uninstalls express, and when I `ls $NODE_PATH`, it isn't there anymore. However, if I run `node` and `require('express')`, I get ``` { version: '1.0.0rc2', Server: { [Function: Server] super_: { [Function: Server] super_: [Object] } }, createServer: [Function] } ``` Why does...
2011/03/18
[ "https://Stackoverflow.com/questions/5353311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137100/" ]
Try `npm config get root`—that shows you where npm is installing things. If it's pointing somewhere that doesn't make sense, use `npm config set root [new path]` to change it to something that's in Node's `require.paths`. (Of course, now you'll have to reinstall all of your npm packages.)
I currently use latest node, Express@1.0.8, Connect@0.5.10. I've been having some issues with upgrading to the latest connect/express, so I vowed to finish building my app first and then perform a massive upgrade. This combo works well for me though.
209,739
I am trying to display something when click on a link from admin menu. So i created a simple module and when i click from the admin menu it redirect to mydomain/secure-manage/helloworld/index/index/key/... with **status 200** but the **page is blank**. In devtool i can see the css and js are loaded but nothing inside ...
2018/01/17
[ "https://magento.stackexchange.com/questions/209739", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/60575/" ]
I am giving you the exact code and path please copy and paste the below file. **app/code/Inchoo/Helloworld/registration.php** ``` <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Inchoo_Helloworld', __DIR__ ); ...
First correct your folder structure name, Like ``` Inchoo Helloworld -Block -Adminhtml Helloworld.php -Controller -Adminhtml -Index -Index.php -etc -module.xml -adminhtml -menu...
209,739
I am trying to display something when click on a link from admin menu. So i created a simple module and when i click from the admin menu it redirect to mydomain/secure-manage/helloworld/index/index/key/... with **status 200** but the **page is blank**. In devtool i can see the css and js are loaded but nothing inside ...
2018/01/17
[ "https://magento.stackexchange.com/questions/209739", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/60575/" ]
I am giving you the exact code and path please copy and paste the below file. **app/code/Inchoo/Helloworld/registration.php** ``` <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Inchoo_Helloworld', __DIR__ ); ...
i was also facing the same issue Magento 2.3 CE. I gave the proper permissions for var and pub directories and ran the following commands- * provided file permission for var/ and pub/ * setup:upgrade * setup:static-content:deploy -f * cache:flush and it started to work.
2,191,015
I got this question on my homework and completed it, however, I would just like to check if my answer is correct or not. I need to convert it to units of cubic meters. Density = 0.81 g/mL 1 gram = 0.001 kilograms 1 milliliter = 1e-6 cubic meters [![enter image description here](https://i.stack.imgur.com/ZxXSq.png)](h...
2017/03/17
[ "https://math.stackexchange.com/questions/2191015", "https://math.stackexchange.com", "https://math.stackexchange.com/users/406344/" ]
Let $$N:=\left\{\left[\begin{matrix}1 & a & b\\0&1&0\\0&0&1\end{matrix}\right]: a,b\in\mathbb{F}\_p\right\}\simeq\mathbb{Z}\_p\times\mathbb{Z}\_p, $$ and let $$H:=\left\{\left[\begin{matrix}1 & 0 & 0\\0&1&c\\0&0&1\end{matrix}\right]: c\in\mathbb{F}\_p\right\}\simeq\mathbb{Z}\_p;$$ then $N$ is normal and $G$ is the spli...
This group is the Heisenberg group over $\mathbb{F}\_p$ of order $p^3$. Now *every* non-abelian group of order $p^3$ with a prime $p>2$ is a semidirect product. To see this, we prove it for the case that we have at least two different elements $a,b$ of order $p$. This is the case for the Heisenberg group, for which *al...
17,277,048
**Edit:** I changed GLTextureUnitID from a uint to an int, and it caused the error to stop appearing, but instead of the texture, a black square renders. When I comment out the call to SetTexture it still renders fine even though I never set that uniform before that line. **Edit2:** It appears GLTextureUnitID has a va...
2013/06/24
[ "https://Stackoverflow.com/questions/17277048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1273560/" ]
This is what works with Symfony 2.7: ``` $builder->add('license', 'entity', [ 'class' => 'CmfcmfMediaModule:License\LicenseEntity', 'preferred_choices' => function (LicenseEntity $license) { return !$license->isOutdated(); }, // ... ]) ``` `preferred_choices` needs an anonymous function which...
I believe you need to pass into your form an `EntityRepository` (or similar) and actually provide a collection of entities to `preferred_choices`. From memory, in previous versions of Symfony it would permit an array of entity IDs, but not now. Probably `preferred_choices` should also be a callback, like `query_builde...
17,277,048
**Edit:** I changed GLTextureUnitID from a uint to an int, and it caused the error to stop appearing, but instead of the texture, a black square renders. When I comment out the call to SetTexture it still renders fine even though I never set that uniform before that line. **Edit2:** It appears GLTextureUnitID has a va...
2013/06/24
[ "https://Stackoverflow.com/questions/17277048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1273560/" ]
I believe you need to pass into your form an `EntityRepository` (or similar) and actually provide a collection of entities to `preferred_choices`. From memory, in previous versions of Symfony it would permit an array of entity IDs, but not now. Probably `preferred_choices` should also be a callback, like `query_builde...
From your example, where you want to get the first result as the prefered choice, you have to return the entity with the first rank and not its index. To do so, you can retrive it in the controller then pass it as a parameter in `$options`: ``` public function buildForm(FormBuilderInterface $builder, array $options) ...
17,277,048
**Edit:** I changed GLTextureUnitID from a uint to an int, and it caused the error to stop appearing, but instead of the texture, a black square renders. When I comment out the call to SetTexture it still renders fine even though I never set that uniform before that line. **Edit2:** It appears GLTextureUnitID has a va...
2013/06/24
[ "https://Stackoverflow.com/questions/17277048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1273560/" ]
I believe you need to pass into your form an `EntityRepository` (or similar) and actually provide a collection of entities to `preferred_choices`. From memory, in previous versions of Symfony it would permit an array of entity IDs, but not now. Probably `preferred_choices` should also be a callback, like `query_builde...
In Symfony3 the following works for me: ``` 'preferred_choices' => function($entity) { $preferred = [1, 2]; $choices = []; if(in_array($entity->getId(), $preferred)) { $choices[] = $entity; } return $choices; ...
17,277,048
**Edit:** I changed GLTextureUnitID from a uint to an int, and it caused the error to stop appearing, but instead of the texture, a black square renders. When I comment out the call to SetTexture it still renders fine even though I never set that uniform before that line. **Edit2:** It appears GLTextureUnitID has a va...
2013/06/24
[ "https://Stackoverflow.com/questions/17277048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1273560/" ]
This is what works with Symfony 2.7: ``` $builder->add('license', 'entity', [ 'class' => 'CmfcmfMediaModule:License\LicenseEntity', 'preferred_choices' => function (LicenseEntity $license) { return !$license->isOutdated(); }, // ... ]) ``` `preferred_choices` needs an anonymous function which...
From your example, where you want to get the first result as the prefered choice, you have to return the entity with the first rank and not its index. To do so, you can retrive it in the controller then pass it as a parameter in `$options`: ``` public function buildForm(FormBuilderInterface $builder, array $options) ...
17,277,048
**Edit:** I changed GLTextureUnitID from a uint to an int, and it caused the error to stop appearing, but instead of the texture, a black square renders. When I comment out the call to SetTexture it still renders fine even though I never set that uniform before that line. **Edit2:** It appears GLTextureUnitID has a va...
2013/06/24
[ "https://Stackoverflow.com/questions/17277048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1273560/" ]
This is what works with Symfony 2.7: ``` $builder->add('license', 'entity', [ 'class' => 'CmfcmfMediaModule:License\LicenseEntity', 'preferred_choices' => function (LicenseEntity $license) { return !$license->isOutdated(); }, // ... ]) ``` `preferred_choices` needs an anonymous function which...
In Symfony3 the following works for me: ``` 'preferred_choices' => function($entity) { $preferred = [1, 2]; $choices = []; if(in_array($entity->getId(), $preferred)) { $choices[] = $entity; } return $choices; ...
17,277,048
**Edit:** I changed GLTextureUnitID from a uint to an int, and it caused the error to stop appearing, but instead of the texture, a black square renders. When I comment out the call to SetTexture it still renders fine even though I never set that uniform before that line. **Edit2:** It appears GLTextureUnitID has a va...
2013/06/24
[ "https://Stackoverflow.com/questions/17277048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1273560/" ]
From your example, where you want to get the first result as the prefered choice, you have to return the entity with the first rank and not its index. To do so, you can retrive it in the controller then pass it as a parameter in `$options`: ``` public function buildForm(FormBuilderInterface $builder, array $options) ...
In Symfony3 the following works for me: ``` 'preferred_choices' => function($entity) { $preferred = [1, 2]; $choices = []; if(in_array($entity->getId(), $preferred)) { $choices[] = $entity; } return $choices; ...
13,894,196
I am trying to draw colored text in my `UIView` subclass. Right now I am using the Single View app template (for testing). There are no modifications except the `drawRect:` method. The text is drawn but it is always black no matter what I set the color to. ``` - (void)drawRect:(CGRect)rect { UIFont* font = [UIFo...
2012/12/15
[ "https://Stackoverflow.com/questions/13894196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1419236/" ]
Instead of `UITextAttributeTextColor` you should use `NSForegroundColorAttributeName`. Hope this helps!
You can try with following methods. It will help you to draw text in UIView at the bottom right corner with the help of following attributes. * NSFontAttributeName - Font name with size * NSStrokeWidthAttributeName - Stroke Width * NSStrokeColorAttributeName - Text Color **Objective-C** - Draw text in the UIView and ...
72,688,814
I'm currently developing a React Native app with Typescript. I have a massive data download from server and a function for saving all data in it's corresponding table. ``` static insertVariousTable = (table: TypeTables) => { switch (table) { case 'clase': return Clase.insertVarious; case 'esta...
2022/06/20
[ "https://Stackoverflow.com/questions/72688814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19375821/" ]
If by "simplify", you mean "shorten", then this is as good as it gets: ``` public get isUsersLimitReached(): boolean { return !this.isAdmin && usersCount >= this.max_users; } ``` Other than that, there's really not much to work with here.
A user limit is reached only if the user is not admin and count exceeds. ``` public get isUsersLimitReached(): boolean { return !this.isAdmin && usersCount >= this.max_users; } ```
35,453
As the title, how can you determine how much damage a conjured weapon is doing? Is there anyway to view this stat?
2011/11/12
[ "https://gaming.stackexchange.com/questions/35453", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/14095/" ]
With the conjured weapon equipped, go into the item menu and select the weapons tab. (Note: you can only see this tab if you actually have some real weapon in your inventory.) On the bottom of the screen it will show you the damage of your conjured weapon. It's kind of a roundabout way, but I haven't found another me...
Uh on my character, with 100 conjuring, and 100 archery, and with all the damage boosting perks for bound wepons, my bound bow only does *slightly* better than an un-upgraded daedric bow. Bound weapons do the same damage as their daedric counterparts (with the necessary perks) except for the war axe (for whatever reaso...
44,737,141
i'm trying to make a blog using angular 1.6, all works fine except when i created a service and inject into config file. Test directive works fine, only breaks when inject myService service/factory. app.coffee ``` app = angular.module 'dts',['ngRoute'] app.service 'myService', -> this.asd = "" app.directive 'n...
2017/06/24
[ "https://Stackoverflow.com/questions/44737141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6484286/" ]
you have to inject `myServiceProvider` in config , you cannot inject service in config function
From the Docs: > > Module Loading & Dependencies > ============================= > > > * **Configuration blocks** - get executed during the provider registrations and configuration phase. **Only providers and constants can be injected into configuration blocks.** This is to prevent accidental instantiation of servi...
7,081,098
I am trying to pull data from table using this select statement.. ``` SELECT ID_NO FROM EMPLOYEE WHERE trim(SYN_NO) ='21IT'; ``` SYN\_NO column hold data in this format ``` 21IT / 00065421 ``` I want to get just first four characters and drop rest of it.. i tried trim, rtrim but it didnt work. Is there a way to d...
2011/08/16
[ "https://Stackoverflow.com/questions/7081098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/839381/" ]
What you are trying to do is generally not possible with regular expressions. To do what you want, you have to be able to count things, which is something regular expressions can't do. Making the matching greedy will eventually lead to matching too much, especially when you are supporting multiple line input. To repl...
Here is an example which is not really robust, but it would match the case in your question. ``` (parent::)([^\(]*)\(([^\(]*)\(([^()]*)\) ``` Here is a live regex test to experiment around: <http://rubular.com/r/WwRsRTf7E6> (Note: rubular.com is targeted at ruby, but should be similar enough for php). The matched e...
7,081,098
I am trying to pull data from table using this select statement.. ``` SELECT ID_NO FROM EMPLOYEE WHERE trim(SYN_NO) ='21IT'; ``` SYN\_NO column hold data in this format ``` 21IT / 00065421 ``` I want to get just first four characters and drop rest of it.. i tried trim, rtrim but it didnt work. Is there a way to d...
2011/08/16
[ "https://Stackoverflow.com/questions/7081098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/839381/" ]
What you are trying to do is generally not possible with regular expressions. To do what you want, you have to be able to count things, which is something regular expressions can't do. Making the matching greedy will eventually lead to matching too much, especially when you are supporting multiple line input. To repl...
Using regexes to parse code is a REALLY bad idea. Take a look at [PHP's Tokenizer](http://php.net/manual/en/book.tokenizer.php), which you can use to parse PHP code into an array of tokens. You can than use that array to find the information you need. You can also look at [PHP-Token-Reflection's source code](https://g...
7,081,098
I am trying to pull data from table using this select statement.. ``` SELECT ID_NO FROM EMPLOYEE WHERE trim(SYN_NO) ='21IT'; ``` SYN\_NO column hold data in this format ``` 21IT / 00065421 ``` I want to get just first four characters and drop rest of it.. i tried trim, rtrim but it didnt work. Is there a way to d...
2011/08/16
[ "https://Stackoverflow.com/questions/7081098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/839381/" ]
What you are trying to do is generally not possible with regular expressions. To do what you want, you have to be able to count things, which is something regular expressions can't do. Making the matching greedy will eventually lead to matching too much, especially when you are supporting multiple line input. To repl...
If you are only interested in the function and whatever is inside the round brackets, and most parent:: calls are in a single line only. This may work for you. ``` parent::(.*?)\((.*)\); ``` The first capture should stop after the first encountered `(` as this is not greedy. The second capture will not stop u...
7,081,098
I am trying to pull data from table using this select statement.. ``` SELECT ID_NO FROM EMPLOYEE WHERE trim(SYN_NO) ='21IT'; ``` SYN\_NO column hold data in this format ``` 21IT / 00065421 ``` I want to get just first four characters and drop rest of it.. i tried trim, rtrim but it didnt work. Is there a way to d...
2011/08/16
[ "https://Stackoverflow.com/questions/7081098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/839381/" ]
Using regexes to parse code is a REALLY bad idea. Take a look at [PHP's Tokenizer](http://php.net/manual/en/book.tokenizer.php), which you can use to parse PHP code into an array of tokens. You can than use that array to find the information you need. You can also look at [PHP-Token-Reflection's source code](https://g...
Here is an example which is not really robust, but it would match the case in your question. ``` (parent::)([^\(]*)\(([^\(]*)\(([^()]*)\) ``` Here is a live regex test to experiment around: <http://rubular.com/r/WwRsRTf7E6> (Note: rubular.com is targeted at ruby, but should be similar enough for php). The matched e...
7,081,098
I am trying to pull data from table using this select statement.. ``` SELECT ID_NO FROM EMPLOYEE WHERE trim(SYN_NO) ='21IT'; ``` SYN\_NO column hold data in this format ``` 21IT / 00065421 ``` I want to get just first four characters and drop rest of it.. i tried trim, rtrim but it didnt work. Is there a way to d...
2011/08/16
[ "https://Stackoverflow.com/questions/7081098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/839381/" ]
Using regexes to parse code is a REALLY bad idea. Take a look at [PHP's Tokenizer](http://php.net/manual/en/book.tokenizer.php), which you can use to parse PHP code into an array of tokens. You can than use that array to find the information you need. You can also look at [PHP-Token-Reflection's source code](https://g...
If you are only interested in the function and whatever is inside the round brackets, and most parent:: calls are in a single line only. This may work for you. ``` parent::(.*?)\((.*)\); ``` The first capture should stop after the first encountered `(` as this is not greedy. The second capture will not stop u...
2,534,192
I'm new to Spring MVC and trying out a simple project.It will contain a simple adding, viewing, updating and deleting user work flows. It will have login page and once authenticated the user will be taken to a welcome screen which will have links to add, view, update and delete users. Clicking on any of the links will ...
2010/03/28
[ "https://Stackoverflow.com/questions/2534192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177971/" ]
It's not really an answer to your question, as it's not working in Emacs, but PHP can raise notices, when you are trying to read from a variable that's not been initialized. For more informations, see: * [`error_reporting`](http://fr2.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting), which should in...
Decent IDE's will give you the names of the variables in the current scope when you are typing them via Intellisense. This should severely cut down on the number of times you misspell a variable name. It also allows your variable names to be more descriptive than `$foo` --- Furthermore, you should always pay attenti...
2,534,192
I'm new to Spring MVC and trying out a simple project.It will contain a simple adding, viewing, updating and deleting user work flows. It will have login page and once authenticated the user will be taken to a welcome screen which will have links to add, view, update and delete users. Clicking on any of the links will ...
2010/03/28
[ "https://Stackoverflow.com/questions/2534192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177971/" ]
Since Flymake uses the `php` binary's syntax check option (`-l`) for highlighting parse errors, there is no obvious way to catch notices and other errors without running or lexical parsing the code. If it's not a problem to not only lint but execute your script, then you can do the following. Unfortunately, `flymake-p...
Decent IDE's will give you the names of the variables in the current scope when you are typing them via Intellisense. This should severely cut down on the number of times you misspell a variable name. It also allows your variable names to be more descriptive than `$foo` --- Furthermore, you should always pay attenti...
44,382,000
I have issue in Android Studio 2.3.2 when trying to use Kotlin 1.1.2-4 and Data Binding. Here is my gradle files: ``` buildscript { ext.kotlin_version = '1.1.2-4' repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' classpath "org.jetbrains...
2017/06/06
[ "https://Stackoverflow.com/questions/44382000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3278271/" ]
Unfortunately this is a known bug, <https://youtrack.jetbrains.com/issue/KT-18279> <https://issuetracker.google.com/issues/62324689> the work around, as you found out, is to downgrade to kotlin 1.1.2-3
It is a bug, but you can download Android Studio 3.0 Canary 3 and update your Android Gradle Plugin to `3.0.0-alpha3` and it's fixed.
44,382,000
I have issue in Android Studio 2.3.2 when trying to use Kotlin 1.1.2-4 and Data Binding. Here is my gradle files: ``` buildscript { ext.kotlin_version = '1.1.2-4' repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' classpath "org.jetbrains...
2017/06/06
[ "https://Stackoverflow.com/questions/44382000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3278271/" ]
Unfortunately this is a known bug, <https://youtrack.jetbrains.com/issue/KT-18279> <https://issuetracker.google.com/issues/62324689> the work around, as you found out, is to downgrade to kotlin 1.1.2-3
Finally fixed in version 1.1.2-5 Thanks to JetBrains!
44,382,000
I have issue in Android Studio 2.3.2 when trying to use Kotlin 1.1.2-4 and Data Binding. Here is my gradle files: ``` buildscript { ext.kotlin_version = '1.1.2-4' repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' classpath "org.jetbrains...
2017/06/06
[ "https://Stackoverflow.com/questions/44382000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3278271/" ]
Finally fixed in version 1.1.2-5 Thanks to JetBrains!
It is a bug, but you can download Android Studio 3.0 Canary 3 and update your Android Gradle Plugin to `3.0.0-alpha3` and it's fixed.
77,287
My sudo file has two commands in it right now that are allowed to run without logging in as root. It looks like this: ``` user ALL=(root) NOPASSWD: /home/user/prog1.py user ALL=(root) NOPASSWD: /home/user/prog2.py ``` The `prog1.py` file runs fine without password needed. The `prog2.py` file fails on permissions de...
2013/05/27
[ "https://unix.stackexchange.com/questions/77287", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/28470/" ]
As indicated in a clarifying comment, you are attempting to run `python2 /home/user/backdrop.py`. But you have granted yourself permission to run a different command -- viz. `/home/user/backdrop.py` without the `python2` -- which you are not allowed to do. `sudo` is very particular about what it allows; either run exac...
If you are sure that 1. the error is caused within the script 2. the sudo call is correct then the problem is most probably not sudo. There are several cases in which root is not allowed to remove a file: 1. The file is on a volume which is mounted read-only (see `cat /proc/mounts`). 2. The file is protected by file...
12,352,048
How can I create a view that merges different columns with a different table? I have three tables for example: users, items and gifts (in this example it's a system that a user can give a gift to another user) `users` table has information about users, `items` table has information about items and `gifts` table shows ...
2012/09/10
[ "https://Stackoverflow.com/questions/12352048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1168524/" ]
You must join the three tables first. Example ``` CREATE VIEW GiftsList AS SELECT b.name user_from, c.name user_to, d.name gift_name, d.price gift_price FROM gift a INNER JOIN users b ON a.user_from = b.id INNER JOIN users c ON a.user_from = c.id ...
You can create a view with two tables like: ``` CREATE VIEW giftList AS SELECT users.user_from,users.user_to,gifts.gift_name,gifts.gift_price FROM users,gifts WHERE users.user_id = gifts.user_id; ``` The where clause is to make sure the output does not repeat.
12,352,048
How can I create a view that merges different columns with a different table? I have three tables for example: users, items and gifts (in this example it's a system that a user can give a gift to another user) `users` table has information about users, `items` table has information about items and `gifts` table shows ...
2012/09/10
[ "https://Stackoverflow.com/questions/12352048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1168524/" ]
You must join the three tables first. Example ``` CREATE VIEW GiftsList AS SELECT b.name user_from, c.name user_to, d.name gift_name, d.price gift_price FROM gift a INNER JOIN users b ON a.user_from = b.id INNER JOIN users c ON a.user_from = c.id ...
I believe were looking for [data blending](https://support.google.com/datastudio/answer/9061420?hl=en). So basically having google data studio do a JOIN statement on ids from 2 data sets
12,352,048
How can I create a view that merges different columns with a different table? I have three tables for example: users, items and gifts (in this example it's a system that a user can give a gift to another user) `users` table has information about users, `items` table has information about items and `gifts` table shows ...
2012/09/10
[ "https://Stackoverflow.com/questions/12352048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1168524/" ]
You can create a view with two tables like: ``` CREATE VIEW giftList AS SELECT users.user_from,users.user_to,gifts.gift_name,gifts.gift_price FROM users,gifts WHERE users.user_id = gifts.user_id; ``` The where clause is to make sure the output does not repeat.
I believe were looking for [data blending](https://support.google.com/datastudio/answer/9061420?hl=en). So basically having google data studio do a JOIN statement on ids from 2 data sets
2,823,880
> > I have a question regarding this specific 2-dimensional DE: $$\dot r=-r\log r\\\dot\varphi=2r\sin^2\left(\frac{\varphi}{2}\right)$$ where $r> 0$ and $\varphi\in [0,\infty)$ (yes, $2\pi$ would do it as well). > > > Now, I want to see how the stationary point $(1,0)$ is attractive. It is easy to see that $\dot\...
2018/06/18
[ "https://math.stackexchange.com/questions/2823880", "https://math.stackexchange.com", "https://math.stackexchange.com/users/465097/" ]
According to [wikipedia](https://en.wikipedia.org/wiki/Arithmetic_progression): > > In mathematics, an arithmetic progression (AP) or arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms is constant. For instance, the sequence 5, 7, 9, 11, 13, 15, . . . is an arithmetic ...
Any two numbers are technically in an trivial AP because there is only one difference of numbers to consider. However, when there are three or more numbers, there are two or more differences that need to be held constant. This means that some actual pattern is being upheld.
19,732,194
I need to download a datastore from my appengine application. The application itself is written in JAVA and I've already activated remote API according to [this instruction](https://developers.google.com/appengine/docs/java/tools/remoteapi?hl=pl&csw=1). Then I run `appcfg.py` and it asks me for log in details and I get...
2013/11/01
[ "https://Stackoverflow.com/questions/19732194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/401499/" ]
Alfresco has [REST API](http://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference), so you can use it in your Spring + Vaadin application. Spring has [RestTemplate](http://spring.io/blog/2009/03/27/rest-in-spring-3-resttemplate/) based on Jackson who will help you with REST client implementation.
There are several ways to integrate with alfresco. My two favorite ways to integrate with Alfresco are: 1. Using the CMIS api <http://wiki.alfresco.com/wiki/CMIS> 2. Using your own custom webscripts or java back end webscripts. These allow you to quickly develop your own rest api with alfresco. <http://docs.alfresco...
11,462,980
In JFrame i want to draw a canvas on a canvas and on requirement basis i want to keep either canvas1 set visible or canvas2 set visible. Can i do that?
2012/07/13
[ "https://Stackoverflow.com/questions/11462980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1519904/" ]
Don't mix Swing (JFrame) with AWT (Canvas) components unless you have a compelling reason to do so, otherwise you're just asking for unusual hard to debug trouble. Instead draw on a JPanel in its paintComponent method as has been described on this site many times, and swap JPanels via [CardLayout](http://docs.oracle.co...
Since Canvas is just a subclass of Component (and sometimes of JPanel), then you can simply create two canvas boxes with absolute positioning where one is larger and behind the other. The you can use the .setVisibile(Boolean) to show/hind any one of the two. see this link for java absolute layout <http://docs.oracle.c...
11,462,980
In JFrame i want to draw a canvas on a canvas and on requirement basis i want to keep either canvas1 set visible or canvas2 set visible. Can i do that?
2012/07/13
[ "https://Stackoverflow.com/questions/11462980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1519904/" ]
[`OverlayLayout`](http://docs.oracle.com/javase/7/docs/api/javax/swing/OverlayLayout.html), shown [here](http://www.java2s.com/Tutorial/Java/0240__Swing/1401__OverlayLayout.htm), may meet your needs.
Since Canvas is just a subclass of Component (and sometimes of JPanel), then you can simply create two canvas boxes with absolute positioning where one is larger and behind the other. The you can use the .setVisibile(Boolean) to show/hind any one of the two. see this link for java absolute layout <http://docs.oracle.c...
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
La traduction rend très bien le sens mais on perd l'effet de style mettant en parallèle *why* et *how*. Voici ce que je peux proposer : > > **Qu'importe le comment à qui sait le pourquoi de sa vie.** > > >
J'aime bien sous forme d'adage comme on a formulé dans une [autre réponse](https://french.stackexchange.com/a/50810). En complément, ça semble provenir de Nietzsche dans le *Crépuscule des idoles*, 1888 ([texte](https://books.google.com/books?id=LhLlcQ-6dIEC&newbks=1&newbks_redir=0&dq=%E2%80%9CGo%CC%88tzen-Da%CC%88mmer...
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
La traduction rend très bien le sens mais on perd l'effet de style mettant en parallèle *why* et *how*. Voici ce que je peux proposer : > > **Qu'importe le comment à qui sait le pourquoi de sa vie.** > > >
C'est une tentative qui serait selon mon point de vue presque le dernier mot sur la question de la traduction de cet adage ; je ne conteste qu'un terme, « endurer ». Il me semble que « how » ne soulève pas particulièrement la question de ce qui est douloureux ou pénible dans la vie, mais au lieu de cela ce qui représen...
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
La traduction rend très bien le sens mais on perd l'effet de style mettant en parallèle *why* et *how*. Voici ce que je peux proposer : > > **Qu'importe le comment à qui sait le pourquoi de sa vie.** > > >
Celui qui a un « pourquoi » dans la vie, trouve toujours un « comment ».
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
La traduction rend très bien le sens mais on perd l'effet de style mettant en parallèle *why* et *how*. Voici ce que je peux proposer : > > **Qu'importe le comment à qui sait le pourquoi de sa vie.** > > >
He who has a why to live can bear almost any how. Avec un but, on vit, par tous les moyens.
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
J'aime bien sous forme d'adage comme on a formulé dans une [autre réponse](https://french.stackexchange.com/a/50810). En complément, ça semble provenir de Nietzsche dans le *Crépuscule des idoles*, 1888 ([texte](https://books.google.com/books?id=LhLlcQ-6dIEC&newbks=1&newbks_redir=0&dq=%E2%80%9CGo%CC%88tzen-Da%CC%88mmer...
C'est une tentative qui serait selon mon point de vue presque le dernier mot sur la question de la traduction de cet adage ; je ne conteste qu'un terme, « endurer ». Il me semble que « how » ne soulève pas particulièrement la question de ce qui est douloureux ou pénible dans la vie, mais au lieu de cela ce qui représen...
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
J'aime bien sous forme d'adage comme on a formulé dans une [autre réponse](https://french.stackexchange.com/a/50810). En complément, ça semble provenir de Nietzsche dans le *Crépuscule des idoles*, 1888 ([texte](https://books.google.com/books?id=LhLlcQ-6dIEC&newbks=1&newbks_redir=0&dq=%E2%80%9CGo%CC%88tzen-Da%CC%88mmer...
Celui qui a un « pourquoi » dans la vie, trouve toujours un « comment ».
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
J'aime bien sous forme d'adage comme on a formulé dans une [autre réponse](https://french.stackexchange.com/a/50810). En complément, ça semble provenir de Nietzsche dans le *Crépuscule des idoles*, 1888 ([texte](https://books.google.com/books?id=LhLlcQ-6dIEC&newbks=1&newbks_redir=0&dq=%E2%80%9CGo%CC%88tzen-Da%CC%88mmer...
He who has a why to live can bear almost any how. Avec un but, on vit, par tous les moyens.
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
He who has a why to live can bear almost any how. Avec un but, on vit, par tous les moyens.
C'est une tentative qui serait selon mon point de vue presque le dernier mot sur la question de la traduction de cet adage ; je ne conteste qu'un terme, « endurer ». Il me semble que « how » ne soulève pas particulièrement la question de ce qui est douloureux ou pénible dans la vie, mais au lieu de cela ce qui représen...
50,809
J'ai précédemment lu Man's Search for Meaning de Viktor E. Frankl et cette question m'est restée en tête assez longtemps avant que je la pose. Comment traduiriez-vous en français : "He who has a why to live can bear almost any how" Ma tentative est : « Celui qui a une raison de vivre peut presque tout endurer ». Qu'e...
2022/07/16
[ "https://french.stackexchange.com/questions/50809", "https://french.stackexchange.com", "https://french.stackexchange.com/users/17415/" ]
He who has a why to live can bear almost any how. Avec un but, on vit, par tous les moyens.
Celui qui a un « pourquoi » dans la vie, trouve toujours un « comment ».
20,649,532
So, I'm localizing an app from japanese to english. In japanese, there is no distinction between (say) "Mr." and "Ms."(/"Mrs."), so I need to do something like this: ``` /* Salutation format for user (male) */ "%@様" = "Mr. %@"; /* Salutation format for user (female) */ "%@様" = "Ms. %@"; ``` As you can see, the Jap...
2013/12/18
[ "https://Stackoverflow.com/questions/20649532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433373/" ]
Well, actually “left side” of the `NSLocalizedString` is a key. So you could do something like: ``` NSLocalizedString(@"SalutForUserMale", @"Salutation format for user (male)"); NSLocalizedString(@"SalutForUserFemale", @"Salutation format for user (female)"); ``` Then in your base `*.strings` file (Japanese I presum...
The Localizable.strings files are nothing more than key value lists. You are using the Japanese phrases as keys which is unusual but I guess it works. I assume this is because the original app was developed in Japanese(?). I usually use English phrases keys, but whatever. The point is that **if you want two different ...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
`y` does not affect the final result of the code - removed: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; //y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k); //if (i > j){ // y = y + 8...
int foobar(int N) //To avoid unuse passing argument { ``` int i, j, x=0; //Remove unuseful variable, operation so save stack and Machine cycle for (i = N; i--; ) //Don't check unnecessary comparison condition for (j = N+1; --j>i; ) x += (((i<<1)+j)*(i+512)<<2); //Save Machine cycle ,Use s...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
Initially: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k); if (i > j){ y = y + 8*(i-j); }else{ y = y + 8*(j-i); } } } ``` Removing `y` calculations: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) ...
This function is equivalent with the following formula, which contains only **4 integer multiplications**, and **1 integer division**: ``` x = N * (N + 1) * (N * (7 * N + 8187) - 2050) / 6; ``` To get this, I simply typed the sum calculated by your nested loops into [Wolfram Alpha](http://www.wolframalpha.com): ```...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
Initially: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k); if (i > j){ y = y + 8*(i-j); }else{ y = y + 8*(j-i); } } } ``` Removing `y` calculations: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) ...
int foobar(int N) //To avoid unuse passing argument { ``` int i, j, x=0; //Remove unuseful variable, operation so save stack and Machine cycle for (i = N; i--; ) //Don't check unnecessary comparison condition for (j = N+1; --j>i; ) x += (((i<<1)+j)*(i+512)<<2); //Save Machine cycle ,Use s...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
OK... so here is my solution, along with inline comments to explain what I did and how. ``` int foobar(int N) { // We eliminate unused arguments int x = 0, i = 0, i2 = 0, j, k, z; // We only iterate up to N on the outer loop, since the // last iteration doesn't do anything useful. Also we keep // tr...
int foobar(int N) //To avoid unuse passing argument { ``` int i, j, x=0; //Remove unuseful variable, operation so save stack and Machine cycle for (i = N; i--; ) //Don't check unnecessary comparison condition for (j = N+1; --j>i; ) x += (((i<<1)+j)*(i+512)<<2); //Save Machine cycle ,Use s...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
Briefly scanning the first routine, the first thing you notice is that expressions involving "y" are completely unused and can be eliminated (as you did). This further permits eliminating the if/else (as you did). What remains is the two `for` loops and the messy expression. Factoring out the pieces of that expression...
A few other things I can see. You don't need `y`, so you can remove its declaration and initialisation. Also, the values passed in for `a` and `b` aren't actually used, so you could use these as local variables instead of `x` and `t`. Also, rather than adding `i` to 512 each time through you can note that `t` starts ...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
This function is equivalent with the following formula, which contains only **4 integer multiplications**, and **1 integer division**: ``` x = N * (N + 1) * (N * (7 * N + 8187) - 2050) / 6; ``` To get this, I simply typed the sum calculated by your nested loops into [Wolfram Alpha](http://www.wolframalpha.com): ```...
Briefly scanning the first routine, the first thing you notice is that expressions involving "y" are completely unused and can be eliminated (as you did). This further permits eliminating the if/else (as you did). What remains is the two `for` loops and the messy expression. Factoring out the pieces of that expression...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
Initially: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k); if (i > j){ y = y + 8*(i-j); }else{ y = y + 8*(j-i); } } } ``` Removing `y` calculations: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) ...
A few other things I can see. You don't need `y`, so you can remove its declaration and initialisation. Also, the values passed in for `a` and `b` aren't actually used, so you could use these as local variables instead of `x` and `t`. Also, rather than adding `i` to 512 each time through you can note that `t` starts ...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
Initially: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k); if (i > j){ y = y + 8*(i-j); }else{ y = y + 8*(j-i); } } } ``` Removing `y` calculations: ``` for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) ...
`y` does not affect the final result of the code - removed: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; //y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k); //if (i > j){ // y = y + 8...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
Briefly scanning the first routine, the first thing you notice is that expressions involving "y" are completely unused and can be eliminated (as you did). This further permits eliminating the if/else (as you did). What remains is the two `for` loops and the messy expression. Factoring out the pieces of that expression...
OK... so here is my solution, along with inline comments to explain what I did and how. ``` int foobar(int N) { // We eliminate unused arguments int x = 0, i = 0, i2 = 0, j, k, z; // We only iterate up to N on the outer loop, since the // last iteration doesn't do anything useful. Also we keep // tr...
13,555,856
For an assignment of a course called High Performance Computing, I required to optimize the following code fragment: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k...
2012/11/25
[ "https://Stackoverflow.com/questions/13555856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59468/" ]
`y` does not affect the final result of the code - removed: ``` int foobar(int a, int b, int N) { int i, j, k, x, y; x = 0; //y = 0; k = 256; for (i = 0; i <= N; i++) { for (j = i + 1; j <= N; j++) { x = x + 4*(2*i+j)*(i+2*k); //if (i > j){ // y = y + 8...
OK... so here is my solution, along with inline comments to explain what I did and how. ``` int foobar(int N) { // We eliminate unused arguments int x = 0, i = 0, i2 = 0, j, k, z; // We only iterate up to N on the outer loop, since the // last iteration doesn't do anything useful. Also we keep // tr...
34,134
1. Came across an article on the web on "evaluation of training effectiveness". The author suggests that the "t-value" obtained from a "Paired t-test" conducted using pre-test and post test scores can be used to quantify the effectiveness of training. 2. The t-value was termed as the "Index of Learning" and the author ...
2012/08/11
[ "https://stats.stackexchange.com/questions/34134", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/13226/" ]
The difficulty here appears to stem from terminology and convention. First let's just define terms in terms of statistical theory. We observe a **data** $X\_1 ... X\_n$, each a random variable. We define a **statistic** as a function of that data, $S(X\_1...X\_n)$. As a function of random variables, the statistic is ...
I don't think this is an issue of estimation versus inference. I think the author of the article is being a little oversimplistic. He is trying to put meaning to specific values of a t statistic as those it is a fixed measure rather than a random qusntity. If the idea is to identify what is a high value versus an inter...
45,205,278
I am developing an list app with FirebaseListAdapter. I'm having problem with the getKey() value. I want to access the data under the listitem that is been clicked and display it in the textview from another activity. But ican't figure out what to do ? Here's what my code looks like now ``` myList.setAdapter(myAd...
2017/07/20
[ "https://Stackoverflow.com/questions/45205278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6040573/" ]
In my case the problem was with repositry name e.g I mistakenly added one extra `.` to the end of repositry name while creating repositry. The name was like CRUD-With-GraphQL..git. So the `.` before `.git` was the actual issue. I renamed my repositry, removed the extra `.` and the problem was resolved.
As a workaround, try, in a regular `CMD` with [git in your `%PATH%`](https://stackoverflow.com/a/44878018/6309): ``` cd H:\GIT\astranauta\5etools git clone -v --recurse-submodules --progress https://github.com/astranauta/5etools.git ``` No need for double-quotes around git. If you were in a git bash, I would have t...
45,205,278
I am developing an list app with FirebaseListAdapter. I'm having problem with the getKey() value. I want to access the data under the listitem that is been clicked and display it in the textview from another activity. But ican't figure out what to do ? Here's what my code looks like now ``` myList.setAdapter(myAd...
2017/07/20
[ "https://Stackoverflow.com/questions/45205278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6040573/" ]
In my case the problem was with repositry name e.g I mistakenly added one extra `.` to the end of repositry name while creating repositry. The name was like CRUD-With-GraphQL..git. So the `.` before `.git` was the actual issue. I renamed my repositry, removed the extra `.` and the problem was resolved.
I think that the problem come from an optional component of GitExtensions called "Conemu". It perhaps will fail at other moments... Could you try to disable it using this documentation : <https://git-extensions-documentation.readthedocs.io/en/latest/settings.html#advanced-general-use-console-emulator-for-console-out...
13,478,784
I'm trying to copy an existing mongo database "test" on a remote server to the same remote server but it should get a different name "test2". Mongodb is password protected on this server. Is there any easy way to do this? ( I want to create a shell script out of this) What I tried is to connect to mongo by using `...
2012/11/20
[ "https://Stackoverflow.com/questions/13478784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1312315/" ]
You may want to look into PECL extension. It may do what you need, docs on PHP.NET. runkit\_function\_redefine (PECL runkit >= 0.7.0)
I don't know this plugin very well but probably this is what you Need [Theming with Jigoshop](http://forum.jigoshop.com/kb/customize-jigoshop/theming-with-jigoshop) Override some functions in php(also in common..) is never a good idea. If the plugin doesn't provide a way to hook into it's functionality is sometimes be...