qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
32,749,837
I am referencing this: <https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/examples/products/product.rb> Here is the code: ``` # List products @products = Bigcommerce::Product.all puts @products # Get a product @product = @products[0] puts Bigcommerce::Product.find(@product.id) ``` I understand the #l...
2015/09/23
[ "https://Stackoverflow.com/questions/32749837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3838700/" ]
It's simple! ``` ZREM key data; ZADD key score newdata; ``` You simply cannot UPDATE an element in SET structure. It's not possible by definition! Like I cannot EAT a cup of water, I can only DRINK it ^\_^ Reply if you have any further problems. By the way, I don't know your application need, but I have a strong f...
One does not update a set's (sorted or not) members. You'll have to remove the old member and add the new (updated JSON) in its place with the relevant score. You could wrap this in Lua or a WATCH/MULTI/EXEC block for atomicity.
32,749,837
I am referencing this: <https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/examples/products/product.rb> Here is the code: ``` # List products @products = Bigcommerce::Product.all puts @products # Get a product @product = @products[0] puts Bigcommerce::Product.find(@product.id) ``` I understand the #l...
2015/09/23
[ "https://Stackoverflow.com/questions/32749837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3838700/" ]
One does not update a set's (sorted or not) members. You'll have to remove the old member and add the new (updated JSON) in its place with the relevant score. You could wrap this in Lua or a WATCH/MULTI/EXEC block for atomicity.
You could remove first by score if you're using the list as a key (score) => value store. ``` ZREMRANGEBYSCORE key score score ZADD key score data ```
32,749,837
I am referencing this: <https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/examples/products/product.rb> Here is the code: ``` # List products @products = Bigcommerce::Product.all puts @products # Get a product @product = @products[0] puts Bigcommerce::Product.find(@product.id) ``` I understand the #l...
2015/09/23
[ "https://Stackoverflow.com/questions/32749837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3838700/" ]
It's simple! ``` ZREM key data; ZADD key score newdata; ``` You simply cannot UPDATE an element in SET structure. It's not possible by definition! Like I cannot EAT a cup of water, I can only DRINK it ^\_^ Reply if you have any further problems. By the way, I don't know your application need, but I have a strong f...
You could remove first by score if you're using the list as a key (score) => value store. ``` ZREMRANGEBYSCORE key score score ZADD key score data ```
17,056,343
I have been applying or changing the style for a CSS class in the javascript script, having a dojo f/w, like this, ``` this.sidePanel = query(".sidePanel", document.body())[0]; domStyle.set(this.sidePanel, { height: "25%", top: "334px" }); ``` This has worked fine but now I am having multiple nodes with simi...
2013/06/12
[ "https://Stackoverflow.com/questions/17056343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1261434/" ]
The `dojo/query` function returns a nodelist which you can operate on. If you also require the module `dojo/NodeList-dom` which extends `dojo/query`, you can do something like: ``` require(['dojo/query','dojo/NodeList-dom','dojo/domReady!'],function(query){ query('.red').style('background-color','black'); }); ``...
Yes there seems to be a way, but you don't need to use dojo. Check out this other post: [Changing CSS Values with Javascript](https://stackoverflow.com/questions/566203/changing-css-values-with-javascript)
17,056,343
I have been applying or changing the style for a CSS class in the javascript script, having a dojo f/w, like this, ``` this.sidePanel = query(".sidePanel", document.body())[0]; domStyle.set(this.sidePanel, { height: "25%", top: "334px" }); ``` This has worked fine but now I am having multiple nodes with simi...
2013/06/12
[ "https://Stackoverflow.com/questions/17056343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1261434/" ]
And if you don't want to include the dojo/NodeList-dom module, you can still do this : ``` query(".sidePanel").forEach(function(node){ domStyle.set(node, { height: "25%", top: "334px" })}); ``` ...but yeah, dojo/NodeList-dom is more concise :-)
Yes there seems to be a way, but you don't need to use dojo. Check out this other post: [Changing CSS Values with Javascript](https://stackoverflow.com/questions/566203/changing-css-values-with-javascript)
17,056,343
I have been applying or changing the style for a CSS class in the javascript script, having a dojo f/w, like this, ``` this.sidePanel = query(".sidePanel", document.body())[0]; domStyle.set(this.sidePanel, { height: "25%", top: "334px" }); ``` This has worked fine but now I am having multiple nodes with simi...
2013/06/12
[ "https://Stackoverflow.com/questions/17056343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1261434/" ]
The `dojo/query` function returns a nodelist which you can operate on. If you also require the module `dojo/NodeList-dom` which extends `dojo/query`, you can do something like: ``` require(['dojo/query','dojo/NodeList-dom','dojo/domReady!'],function(query){ query('.red').style('background-color','black'); }); ``...
And if you don't want to include the dojo/NodeList-dom module, you can still do this : ``` query(".sidePanel").forEach(function(node){ domStyle.set(node, { height: "25%", top: "334px" })}); ``` ...but yeah, dojo/NodeList-dom is more concise :-)
12,452,018
I am trying to use the following C code to print out an array that I have passed in. It should output the text in hexadecimal format one on each line and I have no problems opening the file. When I first wrote it, I had no problems with it working I opened the output file and my array was there. I changed the `fileOutN...
2012/09/17
[ "https://Stackoverflow.com/questions/12452018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676423/" ]
Always clean up after yourself. You're missing an `fclose(pOutfile)`.
> > It should output the text in hexadecimal format one on each line ... > > > This line ``` fprintf( pOutfile, "0x%0.4X\n", 5 ); ``` always formats the same number - `5`. It probably should be ``` fprintf( pOutfile, "0x%0.4X\n", output[i] ); ```
12,452,018
I am trying to use the following C code to print out an array that I have passed in. It should output the text in hexadecimal format one on each line and I have no problems opening the file. When I first wrote it, I had no problems with it working I opened the output file and my array was there. I changed the `fileOutN...
2012/09/17
[ "https://Stackoverflow.com/questions/12452018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676423/" ]
> > It should output the text in hexadecimal format one on each line ... > > > This line ``` fprintf( pOutfile, "0x%0.4X\n", 5 ); ``` always formats the same number - `5`. It probably should be ``` fprintf( pOutfile, "0x%0.4X\n", output[i] ); ```
You're counting on the element beyond the bounds of the array to be 0, which may not be the case unless you're explicitly setting it. If you are, that's okay. Usually, pass arrays along with their size; this is safer, easier to read, and more portable. ``` printoutput(int output[], int size, char * fileOutName){ i...
12,452,018
I am trying to use the following C code to print out an array that I have passed in. It should output the text in hexadecimal format one on each line and I have no problems opening the file. When I first wrote it, I had no problems with it working I opened the output file and my array was there. I changed the `fileOutN...
2012/09/17
[ "https://Stackoverflow.com/questions/12452018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1676423/" ]
Always clean up after yourself. You're missing an `fclose(pOutfile)`.
You're counting on the element beyond the bounds of the array to be 0, which may not be the case unless you're explicitly setting it. If you are, that's okay. Usually, pass arrays along with their size; this is safer, easier to read, and more portable. ``` printoutput(int output[], int size, char * fileOutName){ i...
351
Now that we have our fantastic Community Bulletin, we can advertise our chat better and work in order to make this site more populated. So I was thinking: why not organize chat events? These ones would be on: * Discussing site problems and strategies (e.g. promotion); * Welcoming new users and helping them using the s...
2012/05/08
[ "https://linguistics.meta.stackexchange.com/questions/351", "https://linguistics.meta.stackexchange.com", "https://linguistics.meta.stackexchange.com/users/111/" ]
1. **Duration**: 1 hour (I think 1 hour is the least to achieve something.) 2. **Structure**: * First 15 minutes: welcoming new users or new "entries" in the regulars; * 35 minutes: we talk about the decided topics; * Last 10 minutes: recap and last-minute news. 3. **Some rules**: During these chat events, it'd be...
User - Time Zone ---------------- > > ***Note**: this is not a register form. It's here as a reminder for the time zones of those who want to participate.* > > > * Alenanno: +1 * Otavio: -3 * Danger: 0 * Tdhsmith: -6 * blunders: any timezone works
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
Maybe this can come from apache limitations on POST size: <http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody> It seems this limitation on 2Gb can be greater on 64bits installations, maybe. And i'm not sure setting 0 in this directove does not reach the compilation limit. see for examples that thread...
We've had the same problem: uploads stopped at 2GB. Under SLES (SUSE Linux Enterprise Server) 11 SP 2, php53 was the problem. Then we added a new repository that has php54: <http://download.opensuse.org/repositories/server:/php/SLE_11_SP2/> and upgraded to that, we now can upload 5GB :-)
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
I figure out how to use http and php to upload a 10G file. php.ini: ``` post_max_size = 0 upload_max_filesize = 0 ``` It works in php 5.3.10. if you do not load that file all into memory , memory\_limit is unrelated.
We've had the same problem: uploads stopped at 2GB. Under SLES (SUSE Linux Enterprise Server) 11 SP 2, php53 was the problem. Then we added a new repository that has php54: <http://download.opensuse.org/repositories/server:/php/SLE_11_SP2/> and upgraded to that, we now can upload 5GB :-)
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
I had a similar problem, but my config was: ``` post_max_size = 1.8G upload_max_filesize = 1.8G ``` and yet I could not upload a 1.2GB file. The error was very same: ``` PHP Warning: POST Content-Length of 1347484420 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0 ``` I spent a day wondering whe...
As phliKtid mentioned, this is a limitation with the PHP framework. Save for editing the source code as mentioned in the [bug report](https://bugs.php.net/bug.php?id=44522) phliKtid linked, there is a workaround that involves setting the `upload_max_filesize` to 0 in the php.ini file. ``` ; Maximum allowed size for up...
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
I don't know about in 5.3.x, but in 5.2.x there are some int/long issues in the PHP code. even if you're on a 64-bit system and have a version of PHP compiled with 64-bit, there are several problems. First, the code that converts post\_max\_size and others from ascii to integer stores the value in an int, so it conver...
We've had the same problem: uploads stopped at 2GB. Under SLES (SUSE Linux Enterprise Server) 11 SP 2, php53 was the problem. Then we added a new repository that has php54: <http://download.opensuse.org/repositories/server:/php/SLE_11_SP2/> and upgraded to that, we now can upload 5GB :-)
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
Maybe this can come from apache limitations on POST size: <http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody> It seems this limitation on 2Gb can be greater on 64bits installations, maybe. And i'm not sure setting 0 in this directove does not reach the compilation limit. see for examples that thread...
I don't know about in 5.3.x, but in 5.2.x there are some int/long issues in the PHP code. even if you're on a 64-bit system and have a version of PHP compiled with 64-bit, there are several problems. First, the code that converts post\_max\_size and others from ascii to integer stores the value in an int, so it conver...
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
Maybe this can come from apache limitations on POST size: <http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody> It seems this limitation on 2Gb can be greater on 64bits installations, maybe. And i'm not sure setting 0 in this directove does not reach the compilation limit. see for examples that thread...
As phliKtid mentioned, this is a limitation with the PHP framework. Save for editing the source code as mentioned in the [bug report](https://bugs.php.net/bug.php?id=44522) phliKtid linked, there is a workaround that involves setting the `upload_max_filesize` to 0 in the php.ini file. ``` ; Maximum allowed size for up...
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
I had a similar problem, but my config was: ``` post_max_size = 1.8G upload_max_filesize = 1.8G ``` and yet I could not upload a 1.2GB file. The error was very same: ``` PHP Warning: POST Content-Length of 1347484420 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0 ``` I spent a day wondering whe...
Maybe this can come from apache limitations on POST size: <http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody> It seems this limitation on 2Gb can be greater on 64bits installations, maybe. And i'm not sure setting 0 in this directove does not reach the compilation limit. see for examples that thread...
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
I had a similar problem, but my config was: ``` post_max_size = 1.8G upload_max_filesize = 1.8G ``` and yet I could not upload a 1.2GB file. The error was very same: ``` PHP Warning: POST Content-Length of 1347484420 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0 ``` I spent a day wondering whe...
We've had the same problem: uploads stopped at 2GB. Under SLES (SUSE Linux Enterprise Server) 11 SP 2, php53 was the problem. Then we added a new repository that has php54: <http://download.opensuse.org/repositories/server:/php/SLE_11_SP2/> and upgraded to that, we now can upload 5GB :-)
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
As phliKtid mentioned, this is a limitation with the PHP framework. Save for editing the source code as mentioned in the [bug report](https://bugs.php.net/bug.php?id=44522) phliKtid linked, there is a workaround that involves setting the `upload_max_filesize` to 0 in the php.ini file. ``` ; Maximum allowed size for up...
We've had the same problem: uploads stopped at 2GB. Under SLES (SUSE Linux Enterprise Server) 11 SP 2, php53 was the problem. Then we added a new repository that has php54: <http://download.opensuse.org/repositories/server:/php/SLE_11_SP2/> and upgraded to that, we now can upload 5GB :-)
4,614,147
I'm trying to upload a file larger than 2GB to a local PHP 5.3.4 server. I've set the following server variables: ```none memory_limit = -1 post_max_size = 9G upload_max_filesize = 5G ``` However, in the error\_log I found: > > PHP Warning: POST Content-Length of 2120909412 bytes exceeds the limit of 1073741824 by...
2011/01/06
[ "https://Stackoverflow.com/questions/4614147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312031/" ]
I had a similar problem, but my config was: ``` post_max_size = 1.8G upload_max_filesize = 1.8G ``` and yet I could not upload a 1.2GB file. The error was very same: ``` PHP Warning: POST Content-Length of 1347484420 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0 ``` I spent a day wondering whe...
I don't know about in 5.3.x, but in 5.2.x there are some int/long issues in the PHP code. even if you're on a 64-bit system and have a version of PHP compiled with 64-bit, there are several problems. First, the code that converts post\_max\_size and others from ascii to integer stores the value in an int, so it conver...
28,432,411
In many occasions, after grouping a data frame by some variables, I want to apply a function that uses data from another data frame that is grouped by the same variables. The best solution I found is to use *semi\_join* inside the function as follow: ``` d1 <- data.frame(model = c(1,1,2,2), x = runif(4) ) d2 <- data.f...
2015/02/10
[ "https://Stackoverflow.com/questions/28432411", "https://Stackoverflow.com", "https://Stackoverflow.com/users/509132/" ]
If all you want to do is stop the 'Joining by: ' statement, you just need to specify what column you are joining on with the `by` argument. For example: ``` semi_join(d2, d1, by="model") ``` EDIT - As an alternative to using `semi_join` you can use a `base` solution. As the `group_by` function is passing the data b...
I adapted the solution of @cdeterman. It is a bit redundant though. ``` d1 <- data.frame(model = c(1,1,2,2), x = runif(4) ) d2 <- data.frame(model=c(1,1,1,2,2,2), y = runif(6) ) myfun <- function(df1, df2, gv) { subsetdf2 <- semi_join(df2, df1, by = gv) data.frame(z = sum(d1$x) - sum(subsetdf2$y)) # trivial mani...
3,112,818
While this may look like homework, I assure you it's not. It stems from some homework assignment I did, though. Let's call an undirected graph without self-edges "cubic" if every vertex has degree exactly three. Given a positive integer N I'd like to generate a random cubic graph on N vertices. I'd like for it to have...
2010/06/24
[ "https://Stackoverflow.com/questions/3112818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/374865/" ]
Assume N is even. (Otherwise there cannot be a cubic graph on N vertices). You can do the following: Take 3N points and divide them into N groups of 3 points each. Now pair up these 3N points randomly (note: 3N is even). i.e. Marry two points off randomly and form 3N/2 marriages). If there is a pairing between grou...
Warning: I make a lot of intuitive-but-maybe-wrong claims in this answer. You should definitely prove them if you intend to use this idea. **Enumerating Cubic Graphs** When dealing with a random choice, a good starting point is to figure out how to enumerate over all of your possible elements. This might reveal some ...
3,112,818
While this may look like homework, I assure you it's not. It stems from some homework assignment I did, though. Let's call an undirected graph without self-edges "cubic" if every vertex has degree exactly three. Given a positive integer N I'd like to generate a random cubic graph on N vertices. I'd like for it to have...
2010/06/24
[ "https://Stackoverflow.com/questions/3112818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/374865/" ]
Assume N is even. (Otherwise there cannot be a cubic graph on N vertices). You can do the following: Take 3N points and divide them into N groups of 3 points each. Now pair up these 3N points randomly (note: 3N is even). i.e. Marry two points off randomly and form 3N/2 marriages). If there is a pairing between grou...
Another term for *[cubic graph](http://mathworld.wolfram.com/CubicGraph.html)* is *3-[regular graph](http://en.wikipedia.org/wiki/Regular_graph)* or *trivalent graph*. Your problem needs a little more clarification because "the number of cubic graphs" could mean the number of cubic graphs on 2*n* nodes that are non-is...
3,112,818
While this may look like homework, I assure you it's not. It stems from some homework assignment I did, though. Let's call an undirected graph without self-edges "cubic" if every vertex has degree exactly three. Given a positive integer N I'd like to generate a random cubic graph on N vertices. I'd like for it to have...
2010/06/24
[ "https://Stackoverflow.com/questions/3112818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/374865/" ]
Warning: I make a lot of intuitive-but-maybe-wrong claims in this answer. You should definitely prove them if you intend to use this idea. **Enumerating Cubic Graphs** When dealing with a random choice, a good starting point is to figure out how to enumerate over all of your possible elements. This might reveal some ...
Another term for *[cubic graph](http://mathworld.wolfram.com/CubicGraph.html)* is *3-[regular graph](http://en.wikipedia.org/wiki/Regular_graph)* or *trivalent graph*. Your problem needs a little more clarification because "the number of cubic graphs" could mean the number of cubic graphs on 2*n* nodes that are non-is...
123,043
Following query returns 10 rows of recipe id's i wants to pass first query's output which is of 10 rows to the second query and display the output of both the queries inside a procedure. **Query 1:** ``` SELECT p.ID as recipe_ID, p.post_title as recipe_title, p.post_date as modified_date, p.post_name...
2015/12/07
[ "https://dba.stackexchange.com/questions/123043", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/82100/" ]
If you need to loop over the output of one query to another you can use [cursors](http://dev.mysql.com/doc/refman/5.7/en/cursors.html). For eg, in this stored routine to [find in all tables databases](http://kedar.nitty-witty.com/blog/search-through-all-databases-tables-columns-in-mysql) we have looped over: ``` DECL...
I have tried with CURSOR inside single procedure: **First Procedure:** Display recipe details BEGIN SELECT p.ID as recipe\_ID, p.post\_title as recipe\_title, p.post\_date as modified\_date, p.post\_name as recipe\_url, CASE WHEN s.total\_count THEN s.total\_count ELSE 0 END as total\_like\_count, CASE WHEN c....
17,860,142
I have a folder which has several files with .txt extension. I need to delete them but before that I need to take backup of it. For example, assume I have a folder with the following contents: ``` name1.txt name2.txt name3.txt name4.txt ``` After I delete, the contents of my folder should be: ``` nam...
2013/07/25
[ "https://Stackoverflow.com/questions/17860142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2431117/" ]
Just rename .txt-files to .txt.bkup, i.e.: ``` rename *.txt *.txt.bkup ``` --- If you *insist* on creating backups before deleting (for example, a configurable batch file, where creating backups may be switched off), then you can copy files before deleting: ``` copy *.txt *.txt.bkup del *.txt ```
try this: ``` copy *.txt *.txt.bkup del *.txt ```
17,860,142
I have a folder which has several files with .txt extension. I need to delete them but before that I need to take backup of it. For example, assume I have a folder with the following contents: ``` name1.txt name2.txt name3.txt name4.txt ``` After I delete, the contents of my folder should be: ``` nam...
2013/07/25
[ "https://Stackoverflow.com/questions/17860142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2431117/" ]
Just rename .txt-files to .txt.bkup, i.e.: ``` rename *.txt *.txt.bkup ``` --- If you *insist* on creating backups before deleting (for example, a configurable batch file, where creating backups may be switched off), then you can copy files before deleting: ``` copy *.txt *.txt.bkup del *.txt ```
try this: ``` for /r "C:\**" %%i in (*.txt) do rename %%i %%i.bkup del *.txt ```
17,860,142
I have a folder which has several files with .txt extension. I need to delete them but before that I need to take backup of it. For example, assume I have a folder with the following contents: ``` name1.txt name2.txt name3.txt name4.txt ``` After I delete, the contents of my folder should be: ``` nam...
2013/07/25
[ "https://Stackoverflow.com/questions/17860142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2431117/" ]
try this: ``` copy *.txt *.txt.bkup del *.txt ```
try this: ``` for /r "C:\**" %%i in (*.txt) do rename %%i %%i.bkup del *.txt ```
83,987
I have a Canon 700d with 2 kit lenses, both having auto-focus feature. I read a book "Canon EOS Rebel T5i/700D For Dummies", which warns against switching auto-focus on/off while the camera is on. According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. ...
2016/10/25
[ "https://photo.stackexchange.com/questions/83987", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/50553/" ]
> > According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. > > > That seems pretty ridiculous. Perhaps the authors are serious about their target audience being dummies. > > I am confused if this might harm my camera or lens in any way? > > > ...
The warning you read applies to Live View shooting. If you look at the T5I manual it states on page 156 under the Continuous AF section , "...During Continuous AF, turn off the power before you set the len's focus mode switch to MF". I usually only use Continuous AF on my T4I so if I do switch to manual I don't usually...
83,987
I have a Canon 700d with 2 kit lenses, both having auto-focus feature. I read a book "Canon EOS Rebel T5i/700D For Dummies", which warns against switching auto-focus on/off while the camera is on. According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. ...
2016/10/25
[ "https://photo.stackexchange.com/questions/83987", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/50553/" ]
> > According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. > > > That seems pretty ridiculous. Perhaps the authors are serious about their target audience being dummies. > > I am confused if this might harm my camera or lens in any way? > > > ...
In some situations, it's convenient to autofocus then switch to manual focus so the focus doesn't change (timelapse, prefocussing for a remote-triggered shot etc.). This wouldn't make sense if you had to turn the camera off in between.
83,987
I have a Canon 700d with 2 kit lenses, both having auto-focus feature. I read a book "Canon EOS Rebel T5i/700D For Dummies", which warns against switching auto-focus on/off while the camera is on. According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. ...
2016/10/25
[ "https://photo.stackexchange.com/questions/83987", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/50553/" ]
> > According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. > > > That seems pretty ridiculous. Perhaps the authors are serious about their target audience being dummies. > > I am confused if this might harm my camera or lens in any way? > > > ...
The risky AF switching may be: * Interferrence between in-body motor and in-lens rings. it is simillar to changing gears in car without clutch pressed. All EF lenses have electronic interface only, so this is not your case. * Switching off the motor under load. When switching the switch, peak currents may be delivered...
83,987
I have a Canon 700d with 2 kit lenses, both having auto-focus feature. I read a book "Canon EOS Rebel T5i/700D For Dummies", which warns against switching auto-focus on/off while the camera is on. According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. ...
2016/10/25
[ "https://photo.stackexchange.com/questions/83987", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/50553/" ]
The warning you read applies to Live View shooting. If you look at the T5I manual it states on page 156 under the Continuous AF section , "...During Continuous AF, turn off the power before you set the len's focus mode switch to MF". I usually only use Continuous AF on my T4I so if I do switch to manual I don't usually...
In some situations, it's convenient to autofocus then switch to manual focus so the focus doesn't change (timelapse, prefocussing for a remote-triggered shot etc.). This wouldn't make sense if you had to turn the camera off in between.
83,987
I have a Canon 700d with 2 kit lenses, both having auto-focus feature. I read a book "Canon EOS Rebel T5i/700D For Dummies", which warns against switching auto-focus on/off while the camera is on. According to it, we should first turn off the camera before turning auto-focus on/off. That's quite cumbersome obviously. ...
2016/10/25
[ "https://photo.stackexchange.com/questions/83987", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/50553/" ]
The warning you read applies to Live View shooting. If you look at the T5I manual it states on page 156 under the Continuous AF section , "...During Continuous AF, turn off the power before you set the len's focus mode switch to MF". I usually only use Continuous AF on my T4I so if I do switch to manual I don't usually...
The risky AF switching may be: * Interferrence between in-body motor and in-lens rings. it is simillar to changing gears in car without clutch pressed. All EF lenses have electronic interface only, so this is not your case. * Switching off the motor under load. When switching the switch, peak currents may be delivered...
31,758,639
I found this answer [here](https://stackoverflow.com/a/18117679/839049) that tells how to get the IP of another minions inside a template but i can't get `host.fqdn` or `host.ip`. When I use `host` I get the full domain name and not the IP. When I ran it on console it gets the ips, but inside the template it does retur...
2015/08/01
[ "https://Stackoverflow.com/questions/31758639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/839049/" ]
Found the solution: Inside a minion config add this piece of code: ``` mine_interval: 2 mine_functions: network.ip_addrs: - eth1 # or any other eth-n you might want ``` To match all backends and not the load\_balancers we need a compound matcher ``` G@roles:backend and not G@roles:load_balancer ``` After t...
`network.ip_addrs` doesn't give you the fqdn. It only gives you a list of ip address. ``` [boucha@elsapo ~]$ sudo salt dasalt network.ip_addrs --out json { "dasalt": [ "10.0.3.1", "10.4.156.81", "172.17.42.1" ] } ```
11,351,739
As is in the title, my question is, Is is possible to tell if the open and send methods from XMLhttpRequest actually worked? Is there any indicator? example code: ``` cli = new XMLHttpRequest(); cli.open('GET', 'http://example.org/products'); cli.send(); ``` I'm trying to code in fault handling to this, but I need ...
2012/07/05
[ "https://Stackoverflow.com/questions/11351739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1428876/" ]
This is an an asynchronous operation. Your script continues its execution while the request is being sent. You detect the state changes using a callback : ``` var cli = new XMLHttpRequest(); cli.onreadystatechange = function() { if (cli.readyState === 4) { if (cli.status === 200) { ...
``` req = new XMLHttpRequest; req.onreadystatechange = dataLoaded; req.open("GET","newJson2.json",true); req.send(); function dataLoaded() { if(this.readyState==4 && this.status==200) { // success } else { // io error } } ```
5,791,111
I have several revision numbers I need to create folders from. So, lets say `{4, 12, 534}`. From this, I need to create folders that can be sorted accordingly; ``` \004\.. \012\.. \534\.. ``` So, what I need to is to get the highest number and then see, how many filling zeros I need for every foldername so they are ...
2011/04/26
[ "https://Stackoverflow.com/questions/5791111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/204693/" ]
Easiest to precompute the max then loop again and pad; ``` Dim nums() As String: nums = Split("4,12,534,9999", ",") Dim i As Long Dim max As Long For i = 0 To UBound(nums) If (Len(nums(i)) > max) Then max = Len(nums(i)) Next For i = 0 To UBound(nums) nums(i) = String(max - Len(nums(i)), "0") & nums(i) De...
I'm not sure why a simple string operation won't work out. ``` Select Case Len(folderstring) Case 1 folderstring = "00" & folderstring Case 2 folderstring = "0" & folderstring Case Else ' Do nothing here End Case ``` OR ``` Dim zeroarray(1 To 3) As Variant zeroarray = Array("00","0","") folderstr...
5,791,111
I have several revision numbers I need to create folders from. So, lets say `{4, 12, 534}`. From this, I need to create folders that can be sorted accordingly; ``` \004\.. \012\.. \534\.. ``` So, what I need to is to get the highest number and then see, how many filling zeros I need for every foldername so they are ...
2011/04/26
[ "https://Stackoverflow.com/questions/5791111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/204693/" ]
The simplest way is with `Format` (or `Format$`): ``` dim s As String s = Format$(revNum, "000") ``` Using `"000"` as the "format string" tells the function to pad with leading zeros, whereas `"###"` tells it not to pad. The difference between the function versions is the return type: `Format` returns a Variant...
I'm not sure why a simple string operation won't work out. ``` Select Case Len(folderstring) Case 1 folderstring = "00" & folderstring Case 2 folderstring = "0" & folderstring Case Else ' Do nothing here End Case ``` OR ``` Dim zeroarray(1 To 3) As Variant zeroarray = Array("00","0","") folderstr...
5,791,111
I have several revision numbers I need to create folders from. So, lets say `{4, 12, 534}`. From this, I need to create folders that can be sorted accordingly; ``` \004\.. \012\.. \534\.. ``` So, what I need to is to get the highest number and then see, how many filling zeros I need for every foldername so they are ...
2011/04/26
[ "https://Stackoverflow.com/questions/5791111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/204693/" ]
The simplest way is with `Format` (or `Format$`): ``` dim s As String s = Format$(revNum, "000") ``` Using `"000"` as the "format string" tells the function to pad with leading zeros, whereas `"###"` tells it not to pad. The difference between the function versions is the return type: `Format` returns a Variant...
Easiest to precompute the max then loop again and pad; ``` Dim nums() As String: nums = Split("4,12,534,9999", ",") Dim i As Long Dim max As Long For i = 0 To UBound(nums) If (Len(nums(i)) > max) Then max = Len(nums(i)) Next For i = 0 To UBound(nums) nums(i) = String(max - Len(nums(i)), "0") & nums(i) De...
54,791,998
How to differentiate git pull request commit and direct checkin commit to a branch using git api or command line ? Why i need this? I need to findout how to get all direct checkins which bypassed pull request mechanism...
2019/02/20
[ "https://Stackoverflow.com/questions/54791998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5532829/" ]
Pure Git as a version control system is not aware of any pull request functionality. There is no reference to something like this in the [official documentation](https://www.git-scm.com/). The pull request feature is provided by services such as [github.com](https://github.com/) and [bitbucket.org](https://bitbucket.or...
From git's point of view, there's no difference between a revision that came from a PR and another that was just committed and pushed. That might be information you *could* get from your provider if you are using bitbucket or github (and I say *could* in the sense that I have **no idea** if they make it available someh...
8,758,445
There is this code: ``` #include <iostream> class KlasaNiePOD{ public: int a; ~KlasaNiePOD(){} }; int main() { KlasaNiePOD obiekt1; // first case std::cout << obiekt1.a << std::endl; // -1075234152 KlasaNiePOD obiekt2 = KlasaNiePOD(); // second case std::cout << obiekt2.a << std::endl; // 0 ...
2012/01/06
[ "https://Stackoverflow.com/questions/8758445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/738811/" ]
``` KlasaNiePOD obiekt1; // first case ``` This is *default-initialised*; since it doesn't have a default constructor, members with a fundamental type (which includes numeric types) are left uninitialised. ``` KlasaNiePOD obiekt2 = KlasaNiePOD(); // second case ``` The temporary `KlasaNiePOD()` is *value-initialis...
The standard defines several different types of initialization, depending on context. Zero-initialization sets all of the members to 0 (converted to the appropriate type, so pointers will be set to a null pointer value, even if the null pointer isn't all zero bits); no constructor is called. Default-initialization call...
8,758,445
There is this code: ``` #include <iostream> class KlasaNiePOD{ public: int a; ~KlasaNiePOD(){} }; int main() { KlasaNiePOD obiekt1; // first case std::cout << obiekt1.a << std::endl; // -1075234152 KlasaNiePOD obiekt2 = KlasaNiePOD(); // second case std::cout << obiekt2.a << std::endl; // 0 ...
2012/01/06
[ "https://Stackoverflow.com/questions/8758445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/738811/" ]
``` KlasaNiePOD obiekt1; // first case ``` This is *default-initialised*; since it doesn't have a default constructor, members with a fundamental type (which includes numeric types) are left uninitialised. ``` KlasaNiePOD obiekt2 = KlasaNiePOD(); // second case ``` The temporary `KlasaNiePOD()` is *value-initialis...
ISO 14882:2011(e) 8.5.1 : > > An aggregate is an array or a class (Clause 9) with no user-provided > constructors (12.1), no brace-or-equalinitializers for non-static data > members (9.2), no private or protected non-static data members (Clause > 11), no base classes (Clause 10), and no virtual functions (10.3). >...
8,758,445
There is this code: ``` #include <iostream> class KlasaNiePOD{ public: int a; ~KlasaNiePOD(){} }; int main() { KlasaNiePOD obiekt1; // first case std::cout << obiekt1.a << std::endl; // -1075234152 KlasaNiePOD obiekt2 = KlasaNiePOD(); // second case std::cout << obiekt2.a << std::endl; // 0 ...
2012/01/06
[ "https://Stackoverflow.com/questions/8758445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/738811/" ]
The standard defines several different types of initialization, depending on context. Zero-initialization sets all of the members to 0 (converted to the appropriate type, so pointers will be set to a null pointer value, even if the null pointer isn't all zero bits); no constructor is called. Default-initialization call...
ISO 14882:2011(e) 8.5.1 : > > An aggregate is an array or a class (Clause 9) with no user-provided > constructors (12.1), no brace-or-equalinitializers for non-static data > members (9.2), no private or protected non-static data members (Clause > 11), no base classes (Clause 10), and no virtual functions (10.3). >...
10,433,508
I'm looking for a more efficient way to build a semicolon delimited list of multiple database columns. The code I'm using right now looks like this (and it works): ``` //Process List of things var things = DB.DbColumn_1.HasValue ? DB.DbColumn_1.Value.Equals(true) ? "thing 1;" : "" : ""); things += DB.DbColumn_2.HasVal...
2012/05/03
[ "https://Stackoverflow.com/questions/10433508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641365/" ]
`DB.DbColumn_1.HasValue && DB.DbColumn_1.Value.Equals(true)` is a very difficult way of writing `DB.DbColumn_1.GetValueOrDefault()`, but they are functionally equivalent. See more info on the `Nullable<T>` struct (`bool?` is equivalent to `Nullable<bool>`, which is the type of your DB column) at <http://msdn.microsoft....
You could extend your linq-to-sql model a little bit to return the value you expect, so you got that part out of the way: ``` public partial class Entity { public string DbColumn_1_Display { return (DbColumn_1 ?? false) ? "thing_1" : ""; } /*for each property*/ } ``` and then for selecting it you...
10,433,508
I'm looking for a more efficient way to build a semicolon delimited list of multiple database columns. The code I'm using right now looks like this (and it works): ``` //Process List of things var things = DB.DbColumn_1.HasValue ? DB.DbColumn_1.Value.Equals(true) ? "thing 1;" : "" : ""); things += DB.DbColumn_2.HasVal...
2012/05/03
[ "https://Stackoverflow.com/questions/10433508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641365/" ]
`DB.DbColumn_1.HasValue && DB.DbColumn_1.Value.Equals(true)` is a very difficult way of writing `DB.DbColumn_1.GetValueOrDefault()`, but they are functionally equivalent. See more info on the `Nullable<T>` struct (`bool?` is equivalent to `Nullable<bool>`, which is the type of your DB column) at <http://msdn.microsoft....
Well to start with nullable types override the `Equals` method and so instead of this ``` DB.DbColumn_1.HasValue ? DB.DbColumn_1.Value.Equals(true) ? "thing 1;" : "" : "" ``` You can just write this ``` DB.DbColumn_1.Equals(true) ? "thing1;" : "" ``` Also using [`string.Join`](http://msdn.microsoft.com/en-us/libr...
15,712,679
I have a type of grocery list where I want to able to add items from different stores. Currently I have a form where I post the article number and quantity and then press submit to add the item to the grocery list (the table below). ``` <form action="<?php echo $current_file.$id; ?>" method="POST"> Store: <sele...
2013/03/29
[ "https://Stackoverflow.com/questions/15712679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'd suggest: ``` var colors = ["green", "red", "black"]; function setColor(el) { el.colorIdx = el.colorIdx || 0; el.style.color = colors[el.colorIdx++ % colors.length]; document.getElementById('box1').checked = el.style.color == 'green'; document.getElementById('box2').checked = el.style.color == 'red...
Do it like this: ``` var index = el.colorIdx++ % colors.length; if( index == 2 ) //2 is the index of color black { document.getElementById("box1").checked = false; document.getElementById("box2").checked = false; } else if( index == 0 ) { document.getElementById("box1").checked = true; } else { docume...
5,412,233
Should you or should you not test single-line functions?
2011/03/23
[ "https://Stackoverflow.com/questions/5412233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/673942/" ]
Today it's one line, next week it's twenty lines. Putting tests in place now warns you if you mistakenly break the behavior down the road. Use your best judgment as to whether it's something that has any chance of changing in the future.
If they are part of your public interface then you should test them.
5,412,233
Should you or should you not test single-line functions?
2011/03/23
[ "https://Stackoverflow.com/questions/5412233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/673942/" ]
If they are part of your public interface then you should test them.
Some one-liners can be quite elegant/long. I tend to not test "trivial" functions extensively, though there may be some tests (usually by inspection and one/two test cases) done just to make sure I've matched the documentation/specifications correctly (particularly if others may ever look at the doc and/or function). ...
5,412,233
Should you or should you not test single-line functions?
2011/03/23
[ "https://Stackoverflow.com/questions/5412233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/673942/" ]
Today it's one line, next week it's twenty lines. Putting tests in place now warns you if you mistakenly break the behavior down the road. Use your best judgment as to whether it's something that has any chance of changing in the future.
Some one-liners can be quite elegant/long. I tend to not test "trivial" functions extensively, though there may be some tests (usually by inspection and one/two test cases) done just to make sure I've matched the documentation/specifications correctly (particularly if others may ever look at the doc and/or function). ...
36,707,089
I'm working on a dynamic calendar that allows user to click on individual days to change whether they're available or unavailable. It works as it's supposed to up until I select another month or year. Once that happens the "click" event on individual cells/days doesn't work. ``` // Changes cell background of the cale...
2016/04/19
[ "https://Stackoverflow.com/questions/36707089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752858/" ]
I believe all you need to do is create an array of images like you are with the title and subtitle. When you add another picture, add the image name to the array and append the tableView. What I see in your code is a name and position. It looks like you need to add "image" and set it to the name of the image. For exa...
You need to create your own personal category. For example sorting your players based on positions they play. Using a class that stores your images into an array. For example: ``` let goalkeeper = [UIImage(named:"ivanlucic"), UIImage(named:"manuelneuer")] let rightBack = [UIImage(named:"danialves"), UIImage(named:"ser...
36,707,089
I'm working on a dynamic calendar that allows user to click on individual days to change whether they're available or unavailable. It works as it's supposed to up until I select another month or year. Once that happens the "click" event on individual cells/days doesn't work. ``` // Changes cell background of the cale...
2016/04/19
[ "https://Stackoverflow.com/questions/36707089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4752858/" ]
I believe all you need to do is create an array of images like you are with the title and subtitle. When you add another picture, add the image name to the array and append the tableView. What I see in your code is a name and position. It looks like you need to add "image" and set it to the name of the image. For exa...
Didn't get how you are setting the code in the tableview but you can add image name with names like Where image key contains the image name you have stored in the XCAssets ``` var things: [MyWhatsit] = [ MyWhatsit(name: "Ivan Lucic", position: "Goalkeeper","image":"ivan"), MyWhatsit(name: "Manuel Neuer", pos...
6,867,095
I need a **css3** selector to target an element when the :target equals the id of the element (easy) or when the `:target` is empty (impossible?). It’s hard to explain, so let me give you a simple example. ``` div { background: blue; } div:target, div:no-target { background: red; } ``` But of course the `:no-tar...
2011/07/28
[ "https://Stackoverflow.com/questions/6867095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/868479/" ]
There is a great answer for this over at [default-target-with-css](https://stackoverflow.com/questions/3354279/default-target-with-css) It revolves around [this trick](http://jsfiddle.net/rED4c/) that seems to have problems in iOS. It's been fixed in Safari, so maybe it'll be in iOS 5?
All I can think of is that you have some javascript that checks to see if the hash is empty. If so, it adds a class to the body tag called "noHash". Then, you can use the fact that there is the noHash class available in your CSS rules. ``` if (window.location.hash.length <= 1) { document.body.className += " noHas...
6,867,095
I need a **css3** selector to target an element when the :target equals the id of the element (easy) or when the `:target` is empty (impossible?). It’s hard to explain, so let me give you a simple example. ``` div { background: blue; } div:target, div:no-target { background: red; } ``` But of course the `:no-tar...
2011/07/28
[ "https://Stackoverflow.com/questions/6867095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/868479/" ]
Sigh. I feel like I'm resurrecting a dead topic, but it needs a real answer. It's possible to do this with CSS alone, just by using `:last-child` and a [general sibling combinator](http://www.w3.org/TR/css3-selectors/#general-sibling-combinators), in the form of `:target ~ :last-child`: ``` .pages > .page:target ~ .p...
All I can think of is that you have some javascript that checks to see if the hash is empty. If so, it adds a class to the body tag called "noHash". Then, you can use the fact that there is the noHash class available in your CSS rules. ``` if (window.location.hash.length <= 1) { document.body.className += " noHas...
6,867,095
I need a **css3** selector to target an element when the :target equals the id of the element (easy) or when the `:target` is empty (impossible?). It’s hard to explain, so let me give you a simple example. ``` div { background: blue; } div:target, div:no-target { background: red; } ``` But of course the `:no-tar...
2011/07/28
[ "https://Stackoverflow.com/questions/6867095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/868479/" ]
There is a great answer for this over at [default-target-with-css](https://stackoverflow.com/questions/3354279/default-target-with-css) It revolves around [this trick](http://jsfiddle.net/rED4c/) that seems to have problems in iOS. It's been fixed in Safari, so maybe it'll be in iOS 5?
Why don't you use [`div:not(:target)`](http://www.w3.org/Style/Examples/007/target) or [`div:target:empty`](http://www.w3.org/TR/css3-selectors/#empty-pseudo)?
6,867,095
I need a **css3** selector to target an element when the :target equals the id of the element (easy) or when the `:target` is empty (impossible?). It’s hard to explain, so let me give you a simple example. ``` div { background: blue; } div:target, div:no-target { background: red; } ``` But of course the `:no-tar...
2011/07/28
[ "https://Stackoverflow.com/questions/6867095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/868479/" ]
Sigh. I feel like I'm resurrecting a dead topic, but it needs a real answer. It's possible to do this with CSS alone, just by using `:last-child` and a [general sibling combinator](http://www.w3.org/TR/css3-selectors/#general-sibling-combinators), in the form of `:target ~ :last-child`: ``` .pages > .page:target ~ .p...
Why don't you use [`div:not(:target)`](http://www.w3.org/Style/Examples/007/target) or [`div:target:empty`](http://www.w3.org/TR/css3-selectors/#empty-pseudo)?
6,867,095
I need a **css3** selector to target an element when the :target equals the id of the element (easy) or when the `:target` is empty (impossible?). It’s hard to explain, so let me give you a simple example. ``` div { background: blue; } div:target, div:no-target { background: red; } ``` But of course the `:no-tar...
2011/07/28
[ "https://Stackoverflow.com/questions/6867095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/868479/" ]
Sigh. I feel like I'm resurrecting a dead topic, but it needs a real answer. It's possible to do this with CSS alone, just by using `:last-child` and a [general sibling combinator](http://www.w3.org/TR/css3-selectors/#general-sibling-combinators), in the form of `:target ~ :last-child`: ``` .pages > .page:target ~ .p...
There is a great answer for this over at [default-target-with-css](https://stackoverflow.com/questions/3354279/default-target-with-css) It revolves around [this trick](http://jsfiddle.net/rED4c/) that seems to have problems in iOS. It's been fixed in Safari, so maybe it'll be in iOS 5?
42,145,427
(Perhaps answered by [How does a serial dispatch queue guarantee resource protection?](https://stackoverflow.com/q/19010732/1449799) but I don't understand how) **Question** How does gcd know when an asynchronous task (e.g. network task) is finished? Should I be using `dispatch_retain` and `dispatch_release` for this...
2017/02/09
[ "https://Stackoverflow.com/questions/42145427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1449799/" ]
The serialisation of work on a serial dispatch queue is at the unit of work that is directly submitted to the queue. Once execution reaches the end of the submitted closure (or it returns) then the next unit of work on the queue can be executed. Importantly, any other asynchronous tasks that may have been started by ...
The answer to the question in your questions body: > > I am trying to ensure that each call to the underlying library finishes before the next begins > > > A serial queue *does* guarantee that the tasks are progressed in the order you add them to the queue. --- I do not really understand the question in the ti...
42,145,427
(Perhaps answered by [How does a serial dispatch queue guarantee resource protection?](https://stackoverflow.com/q/19010732/1449799) but I don't understand how) **Question** How does gcd know when an asynchronous task (e.g. network task) is finished? Should I be using `dispatch_retain` and `dispatch_release` for this...
2017/02/09
[ "https://Stackoverflow.com/questions/42145427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1449799/" ]
As mentioned before, `DispatchGroup` is a very good mechanism for that. You can use it for synchronous tasks: ``` let group = DispatchGroup() DispatchQueue.global().async(group: group) { syncTask() } group.notify(queue: .main) { // done } ``` It is better to use `notify` than `wait`, as `wait` does block th...
The answer to the question in your questions body: > > I am trying to ensure that each call to the underlying library finishes before the next begins > > > A serial queue *does* guarantee that the tasks are progressed in the order you add them to the queue. --- I do not really understand the question in the ti...
42,145,427
(Perhaps answered by [How does a serial dispatch queue guarantee resource protection?](https://stackoverflow.com/q/19010732/1449799) but I don't understand how) **Question** How does gcd know when an asynchronous task (e.g. network task) is finished? Should I be using `dispatch_retain` and `dispatch_release` for this...
2017/02/09
[ "https://Stackoverflow.com/questions/42145427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1449799/" ]
The serialisation of work on a serial dispatch queue is at the unit of work that is directly submitted to the queue. Once execution reaches the end of the submitted closure (or it returns) then the next unit of work on the queue can be executed. Importantly, any other asynchronous tasks that may have been started by ...
As mentioned before, `DispatchGroup` is a very good mechanism for that. You can use it for synchronous tasks: ``` let group = DispatchGroup() DispatchQueue.global().async(group: group) { syncTask() } group.notify(queue: .main) { // done } ``` It is better to use `notify` than `wait`, as `wait` does block th...
41,215,072
I have a simple `async` function. It just sends a request and returns the data: ``` export const updatePanorama = async ({ commit }, payload) => { const urlEnd = '/v1/pano/update' const type = 'post' const resp = await api.asyncRequest(urlEnd, type, payload) commit('SET_PANORAMA', resp.data) return resp } `...
2016/12/19
[ "https://Stackoverflow.com/questions/41215072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5815147/" ]
I would suggest just using the tagname for `<label>` and if there are attributes in selector keep those also ``` $('label[name="role.label"]').show(); ``` beyond that you don't seem to have any other issues and can follow the documented pseudo selectors in the [selectors api](http://api.jquery.com/category/selectors...
I have encountered the same issue. Based on research, I went and remove label tag.
27,357,658
I'm currently just messing around with mysql. I'm not able to delete all the rows from the table "amount" with this code `mysqli_query($conn, "DELETE FORM amount");` . With that code, I'm not even able to access my page. ``` $conn = new mysqli(localhost, $username, $password, $database); // Check connection if ($conn...
2014/12/08
[ "https://Stackoverflow.com/questions/27357658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4310761/" ]
Change ``` mysqli_query($conn, "DELETE FORM amount"); ``` Into ``` mysqli_query($conn, "DELETE FROM amount"); ``` (misspelled `FROM`) I also think you dont want to delete all records from the table `amount`, but just the found record in the table `freetexts`... So that would mean you need to alter the query. To ...
The BD probably has a protection denying the command to delete all rows without a condition clause. Try this: TRUNCATE [table\_name]
27,357,658
I'm currently just messing around with mysql. I'm not able to delete all the rows from the table "amount" with this code `mysqli_query($conn, "DELETE FORM amount");` . With that code, I'm not even able to access my page. ``` $conn = new mysqli(localhost, $username, $password, $database); // Check connection if ($conn...
2014/12/08
[ "https://Stackoverflow.com/questions/27357658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4310761/" ]
`$column = freetexts;` You need to change `mysqli_query($conn, "DELETE FROM amount");` to ``` mysqli_query($conn, "DELETE FROM `$column` WHERE 1"); ```
Change ``` mysqli_query($conn, "DELETE FORM amount"); ``` Into ``` mysqli_query($conn, "DELETE FROM amount"); ``` (misspelled `FROM`) I also think you dont want to delete all records from the table `amount`, but just the found record in the table `freetexts`... So that would mean you need to alter the query. To ...
27,357,658
I'm currently just messing around with mysql. I'm not able to delete all the rows from the table "amount" with this code `mysqli_query($conn, "DELETE FORM amount");` . With that code, I'm not even able to access my page. ``` $conn = new mysqli(localhost, $username, $password, $database); // Check connection if ($conn...
2014/12/08
[ "https://Stackoverflow.com/questions/27357658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4310761/" ]
`$column = freetexts;` You need to change `mysqli_query($conn, "DELETE FROM amount");` to ``` mysqli_query($conn, "DELETE FROM `$column` WHERE 1"); ```
The BD probably has a protection denying the command to delete all rows without a condition clause. Try this: TRUNCATE [table\_name]
16,428,812
I updated to the latest version of Laravel 4 using composer update. Now I'm having a problem with the error handling library it uses - Whoops. When I have an error in my code, for instance an syntax error the following happens: 1. I reload the page 2. The actual exception ('Unexpected xxxx at ...') appears for less th...
2013/05/07
[ "https://Stackoverflow.com/questions/16428812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/770183/" ]
I'm the author of `closure_tree`. If you use the `append_sibling` or `prepend_sibling` methods that are added to your model class if the order column is numeric, your `position` value will be reordered from `0..siblings.count`. No need to use another gem—I had to rely on specific ordering rules to make the majority o...
After playing with the gem, I realized that it doesn't directly alter the order `position`, so it requires us to use our own functionality to set that column. Basically: to represent a list, use the `acts_as_list` gem or another option. To use an ordered list in conjunction with the nodes of a tree, use both gems. (th...
6,574,215
I have just implemented a `WeakEventDelegate` class in .NET. I had seen other articles to the effect of implementing such a thing in <http://code.logos.com/blog/2008/08/event_subscription_using_weak_references.html> and <http://blogs.msdn.com/b/greg_schechter/archive/2004/05/27/143605.aspx> However, the implementatio...
2011/07/04
[ "https://Stackoverflow.com/questions/6574215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/113158/" ]
The main issue here is that anything subscribing to your delegate (`handlerReference.Target`) is going to keep `handlerReference` alive. Wrapping this up provides you with the means to call your delegate without holding a reference to it, but does nothing to prevent the subscriber from keeping the reference alive. Th...
I have found a critical problem with that implementation - it only works if I keep a reference to the delegate (the handler passed in the constructor) somewhere else. Otherwise that delegate object is collected and the event never fires again.
6,574,215
I have just implemented a `WeakEventDelegate` class in .NET. I had seen other articles to the effect of implementing such a thing in <http://code.logos.com/blog/2008/08/event_subscription_using_weak_references.html> and <http://blogs.msdn.com/b/greg_schechter/archive/2004/05/27/143605.aspx> However, the implementatio...
2011/07/04
[ "https://Stackoverflow.com/questions/6574215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/113158/" ]
The main issue here is that anything subscribing to your delegate (`handlerReference.Target`) is going to keep `handlerReference` alive. Wrapping this up provides you with the means to call your delegate without holding a reference to it, but does nothing to prevent the subscriber from keeping the reference alive. Th...
Thoughts -------- I like the idea of implementing a weak delegate on the side of the class which handles the event because of the fact that i don't want to have weak references only in some cases. For my personal ui framework i react to events sometimes without holding a reference to the original object: ``` void Han...
6,574,215
I have just implemented a `WeakEventDelegate` class in .NET. I had seen other articles to the effect of implementing such a thing in <http://code.logos.com/blog/2008/08/event_subscription_using_weak_references.html> and <http://blogs.msdn.com/b/greg_schechter/archive/2004/05/27/143605.aspx> However, the implementatio...
2011/07/04
[ "https://Stackoverflow.com/questions/6574215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/113158/" ]
The main issue here is that anything subscribing to your delegate (`handlerReference.Target`) is going to keep `handlerReference` alive. Wrapping this up provides you with the means to call your delegate without holding a reference to it, but does nothing to prevent the subscriber from keeping the reference alive. Th...
A major problem with weak events is that if the subscription list holds the only reference to a subscriber, there's no way the event publisher can know whether or not anything cares about the event. Fundamentally, the event should remain live as long as any references exists to anything which will be modified by the ev...
6,574,215
I have just implemented a `WeakEventDelegate` class in .NET. I had seen other articles to the effect of implementing such a thing in <http://code.logos.com/blog/2008/08/event_subscription_using_weak_references.html> and <http://blogs.msdn.com/b/greg_schechter/archive/2004/05/27/143605.aspx> However, the implementatio...
2011/07/04
[ "https://Stackoverflow.com/questions/6574215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/113158/" ]
I have found a critical problem with that implementation - it only works if I keep a reference to the delegate (the handler passed in the constructor) somewhere else. Otherwise that delegate object is collected and the event never fires again.
Thoughts -------- I like the idea of implementing a weak delegate on the side of the class which handles the event because of the fact that i don't want to have weak references only in some cases. For my personal ui framework i react to events sometimes without holding a reference to the original object: ``` void Han...
6,574,215
I have just implemented a `WeakEventDelegate` class in .NET. I had seen other articles to the effect of implementing such a thing in <http://code.logos.com/blog/2008/08/event_subscription_using_weak_references.html> and <http://blogs.msdn.com/b/greg_schechter/archive/2004/05/27/143605.aspx> However, the implementatio...
2011/07/04
[ "https://Stackoverflow.com/questions/6574215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/113158/" ]
I have found a critical problem with that implementation - it only works if I keep a reference to the delegate (the handler passed in the constructor) somewhere else. Otherwise that delegate object is collected and the event never fires again.
A major problem with weak events is that if the subscription list holds the only reference to a subscriber, there's no way the event publisher can know whether or not anything cares about the event. Fundamentally, the event should remain live as long as any references exists to anything which will be modified by the ev...
3,875,036
I'm working on a robotic problem. The situation is something like this: 1. There are N number of robots (generally N>100) initially all at rest. 2. Each robot attracts all other robots which are with in its radius `r`. 3. I've set of equations with which I can compute acceleration, velocity & hence the position of the...
2010/10/06
[ "https://Stackoverflow.com/questions/3875036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193653/" ]
*Note*: Python's `threads` still run on the same processor. If you want to use the full range of processors of your machine you should use `multiprocessing` (python2.6+). Using MPI will only bring you clear benefits if the computation is going to be spread over multiple computers. There are two approaches to your pro...
My solution too I similar to Unode but I prefer using `apply_async` method in `multiprocessing` as it's asynchronous. ``` from multiprocessing import Pool def main(): po = Pool(100) #subprocesses po.apply_async(function_to_execute, (function_params,), callback=after_processing) po.close() ...
3,875,036
I'm working on a robotic problem. The situation is something like this: 1. There are N number of robots (generally N>100) initially all at rest. 2. Each robot attracts all other robots which are with in its radius `r`. 3. I've set of equations with which I can compute acceleration, velocity & hence the position of the...
2010/10/06
[ "https://Stackoverflow.com/questions/3875036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193653/" ]
So the trick here is that at each step, all of the robots have to see the data at some point from all the other robots. This makes efficient parallelizations hard! One simple approach is to have each process chuging away on its own robots, calculating the self-interactions first, then getting one by one the data from ...
My solution too I similar to Unode but I prefer using `apply_async` method in `multiprocessing` as it's asynchronous. ``` from multiprocessing import Pool def main(): po = Pool(100) #subprocesses po.apply_async(function_to_execute, (function_params,), callback=after_processing) po.close() ...
148,125
I'm a student in the US, about to graduate with a BS in zoology. I've just been invited to join [Phi Beta Kappa](https://www.pbk.org/) and am trying to find some more up-to-date discussions of whether or not it's worth it and I see a lot of conflicting opinions/information. It costs $99 for me to join, which some hav...
2020/04/23
[ "https://academia.stackexchange.com/questions/148125", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/123158/" ]
I am looking at this from a European perspective. Also I focus on the perception and not whether this is accurate, which does not matter that much – whether you like it or not. You can neither expect readers to research this detail of your CV to fully understand it nor to suppress subconscious bias by the impression th...
Include it. [Phi Beta Kappa](https://en.wikipedia.org/wiki/Phi_Beta_Kappa) isn't a part of the [Animal House](https://en.wikipedia.org/wiki/Animal_House) culture. It is an honor, bestowed by the faculty and only those respected by the faculty are considered. If someone confuses it with the [Dekes](https://en.wikipedi...
148,125
I'm a student in the US, about to graduate with a BS in zoology. I've just been invited to join [Phi Beta Kappa](https://www.pbk.org/) and am trying to find some more up-to-date discussions of whether or not it's worth it and I see a lot of conflicting opinions/information. It costs $99 for me to join, which some hav...
2020/04/23
[ "https://academia.stackexchange.com/questions/148125", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/123158/" ]
I am looking at this from a European perspective. Also I focus on the perception and not whether this is accurate, which does not matter that much – whether you like it or not. You can neither expect readers to research this detail of your CV to fully understand it nor to suppress subconscious bias by the impression th...
Save your money. At best it's meaningless and at worse it associates you with all the negative connotations of Greek society and none of the benefits (such as the social life and a network of close friends and contacts you get to know over the many years at school). I say it's meaningless because **everything that it ...
25,127,874
I've got a compiler written with LLVM and I'm looking to up my ABI compliance. For example, I've found it hard to actually find specification documents for C ABI on Windows x86 or Linux. And the ones I have found explain it in terms of RAX/EAX/etc, rather than IR terms that I can use. So far, I think I've figured that...
2014/08/04
[ "https://Stackoverflow.com/questions/25127874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/298661/" ]
I can't say I understand your question 100%, but it's worth noting that LLVM IR simply can not represent all the subtleties of platform ABIs. Therefore, in the Clang toolchain, it is the frontend that's responsible for performing ABI lowering, such as properly passing objects by value to functions, etc. Take a look at...
I ended up hacking Clang's CodeGen internals to perform C ABI calling for me (C++ ABI support was already done). Thus instead of having to re-implement (and re-test) their code, I simply re-used their work. Officially the CodeGen APIs aren't public and aren't meant to be used by anyone, but in this case, I managed to m...
55,440,011
I am taking a screenshot of a WKVebView in the completion handler of a javascript evaluation: ``` func loadPage(){ let fileURL = URL(fileURLWithPath: "...") let baseUrl = URL(fileURLWithPath: "...") webView?.navigationDelegate = self webView.loadFileURL(fileURL, allowingReadAccessTo: baseUrl) } func w...
2019/03/31
[ "https://Stackoverflow.com/questions/55440011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230632/" ]
You have to change the closure argument to `UnsafeRawBufferPointer` and then take its `baseAdress` (which is a `UnsafeRawPointer?`, the Swift equivalent of `void *` in C): ``` data.withUnsafeBytes( { (ptr : UnsafeRawBufferPointer) in let value = readFITfile(ptr.baseAddress) // ... }) ``` The Swift compiler c...
To get UnsafePointer now you should do something like that ``` data.withUnsafeBytes { (ptr: UnsafeRawBufferPointer) in if let ptrAddress = ptr.baseAddress, ptr.count > 0 { let pointer = ptrAddress.assumingMemoryBound(to: UInt8.self) // here you got UnsafePointer<UInt8> let value = readFITfile(ptr) ...
60,918,173
I'm currently working on a program in java to fill a 2D array with user inputted values. The program works perfectly when both the rows and columns are specifed to the same value (square matrix). But, when the values are different, it doesn't print and throws an index out of bounds exception and I can't seem to figure ...
2020/03/29
[ "https://Stackoverflow.com/questions/60918173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13148197/" ]
Seems like the code is missing one line, noted in comment: ``` if (l->age < limit){ struct list* tmp; tmp = l->next; free(l); l = tmp; // fix } ``` As answered by "chqrlie for yellow blockquotes", there other problems, which he has fixed in his answer. You co...
The function has undefined behavior because it returns nothing in the case when `l->next` is not equal to `NULL`. ``` //... if (l->next != NULL) l->next = delete_node (l->next, limit); else return l; } ``` Also in this code snippet ``` if (l->age < limit){ struct list* tmp; tmp = l->next; free(l...
60,918,173
I'm currently working on a program in java to fill a 2D array with user inputted values. The program works perfectly when both the rows and columns are specifed to the same value (square matrix). But, when the values are different, it doesn't print and throws an index out of bounds exception and I can't seem to figure ...
2020/03/29
[ "https://Stackoverflow.com/questions/60918173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13148197/" ]
Your function has multiple problems: * you do not return anything if `l` is `NULL` nor if `l->next` is `NULL`. * `l` is invalid after deleting a node. You should return `delete_node(tmp, limit)` after the `free(l);`. To have a single `return` statement, you can set `l` to this value. Here is a modified version: ```c...
The function has undefined behavior because it returns nothing in the case when `l->next` is not equal to `NULL`. ``` //... if (l->next != NULL) l->next = delete_node (l->next, limit); else return l; } ``` Also in this code snippet ``` if (l->age < limit){ struct list* tmp; tmp = l->next; free(l...
55,513,379
I have a list which is sorted and grouped based on 2 element of sublist like below ``` [[[2178393, 'a', 'online', 0, 20], [2178394, 'a', 'away', 0, 30], [2178395, 'a', 'away', 0, 40]],[[2178389, 'b', 'online', 0, 10], [2178390, 'b', 'online', 0, 15], [2178392, 'b', 'online', 1, 25], [2178391, 'b', 'online', 1, 30], [...
2019/04/04
[ "https://Stackoverflow.com/questions/55513379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7482017/" ]
> > # Properties defined by org.apache.kafka.clients.producer.ProducerConfig > > > # can be defined in this configuration section. > > > As this says, `ProducerConfig` is for producer settings, not broker settings, which is what `num.partitions` is (I think you got lost in which table the property was shown on ...
It appears that the topic is getting create by Default , which is the default behavior for Kafka. If that is the case you need to define the default number of partitions in the server.properties file for your broker. ``` # The default number of log partitions per topic. More partitions allow greater # parallelism for ...
55,778,345
I have added this code: ``` @client.command(pass_context=True) async def name(ctx): username = ctx.message.author.display_name ``` On to the end of my line of code, and I get this error when trying to get the bot online: ``` AttributeError: 'Client' object has no attribute 'command' ```
2019/04/20
[ "https://Stackoverflow.com/questions/55778345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11389358/" ]
You need to use [`discord.ext.commands.Bot`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot) instead of `discord.Client`. `Bot` is a subclass of `Client`, so you can also use all of the `Client` functionality with a `Bot` instance ``` from discord.ext.commands import Bot bot...
``` client = discord.Client(intents=intents ) ``` Check this :) ``` client=commands.Bot(command_prefix=".") ``` **This resolves my isssue :)**
142,883
*Westworld* premiered on HBO two weeks ago (as of the writing of this question, we've only seen Season 1, Episodes 1 and 2). One of the things they haven't shown us yet (I hope will be revealed soon) is how objects in the physical world (host robots, guest humans, even inanimate items like cowboy hats and guns) get "t...
2016/10/12
[ "https://scifi.stackexchange.com/questions/142883", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/53573/" ]
[It's still unknown](https://www.thrillist.com/entertainment/nation/westworld-robots-park-man-in-black-questions). > > Where, exactly, is this place? How do paying customers catch the train? It's a nice touch that customers arrive in town along with hosts, but it's also confusing. It's a bit more clear in Michael Cri...
Based on the first two episodes, we know: * Regional travel appears to be via a vast high-speed underground train, possibly an evacuated tube. If the tunnel air is evacuated, this could be a long-distance transportation network of the future, invisible to the surface. * The above explains what we know about the park h...
142,883
*Westworld* premiered on HBO two weeks ago (as of the writing of this question, we've only seen Season 1, Episodes 1 and 2). One of the things they haven't shown us yet (I hope will be revealed soon) is how objects in the physical world (host robots, guest humans, even inanimate items like cowboy hats and guns) get "t...
2016/10/12
[ "https://scifi.stackexchange.com/questions/142883", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/53573/" ]
[It's still unknown](https://www.thrillist.com/entertainment/nation/westworld-robots-park-man-in-black-questions). > > Where, exactly, is this place? How do paying customers catch the train? It's a nice touch that customers arrive in town along with hosts, but it's also confusing. It's a bit more clear in Michael Cri...
Based on the maps available on the [Westworld Website](https://discoverwestworld.com/), guests arrive by high-speed subterranean monorail, disembark at the Mesa Gold facility's "*Arrivals Monorail Terminal*" (situated a few miles from the centre of the park), then catch the olde-fashioned steam train which takes them t...
142,883
*Westworld* premiered on HBO two weeks ago (as of the writing of this question, we've only seen Season 1, Episodes 1 and 2). One of the things they haven't shown us yet (I hope will be revealed soon) is how objects in the physical world (host robots, guest humans, even inanimate items like cowboy hats and guns) get "t...
2016/10/12
[ "https://scifi.stackexchange.com/questions/142883", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/53573/" ]
Based on the maps available on the [Westworld Website](https://discoverwestworld.com/), guests arrive by high-speed subterranean monorail, disembark at the Mesa Gold facility's "*Arrivals Monorail Terminal*" (situated a few miles from the centre of the park), then catch the olde-fashioned steam train which takes them t...
Based on the first two episodes, we know: * Regional travel appears to be via a vast high-speed underground train, possibly an evacuated tube. If the tunnel air is evacuated, this could be a long-distance transportation network of the future, invisible to the surface. * The above explains what we know about the park h...
18,018,235
I am facing a problem in datagridview. I have done some code in keydown event for changing the tab focus but when tab reaches last of column it gives a error > > "Current cell cannot be set to an invisible cell". > > > I have made last of cell is invisible because i don't want to be visible that cell. I have wr...
2013/08/02
[ "https://Stackoverflow.com/questions/18018235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2405060/" ]
The error is quite self-explanatory: you are setting the `CurrentCell` as an invisible cell and it is prohibited, that means that the cell's row **or** the cell's column is hidden. To avoid this don't hide rows/columns or check the `Visible` property before setting the `CurrentCell`. If the problem is the last column ...
This error occurs when you try to select an hidden cell. Also you should not set rows to invisible in a datagridview since it has bugs. One solution would be instead of setting the row invisible, just filter the data source and get only those records which you want. This will be slow but can be served as a workaround....
10,384,395
I would like to have text block and hyperlink button in one scrollviewer, but it says property content is set more than once... ``` <!--ContentPanel - place additional content here--> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0"> <ScrollViewer> <TextBlock Horizon...
2012/04/30
[ "https://Stackoverflow.com/questions/10384395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1315073/" ]
You have two controls in your ScrollViewer : Textblock and HyperlinkButton. Group them into a Grid.
You should wrap it in a `StackPanel` or a `Grid`. That way, you can still set the `Content` property once, but have multiple items in it.
10,943,128
I am trying to do some customization on UITabBar. I am almost done with everything. However, I saw a small bar on the bottom of each UITabBarItem. I don't know what object it is. Can someone please tell me how to remove it? Or if someone can tell me how to make the UIImage inside the UITabBarItem to be displayed in fro...
2012/06/08
[ "https://Stackoverflow.com/questions/10943128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443682/" ]
I'm not familiar with Yii, but after looking it up, probably the best and most straightforward option is to use the `system.web.helpers.CJSON` class. What you would do is first read in your JSON file (country.json or city.json) to a string variable. This doesn't need to be a special operation; pretend you're reading i...
Step one: Read file into string and get a `responsestring` from your file. You can use file input stream or any for that. step second: parse it. ``` try{ JSONObject jobj=new JSONObject(response_str); JSONArray jarr=jobj.getJSONArray("sates"); for(int i=0;i<jarr.length();i++) { JSONObject jsonobj=jar...
10,943,128
I am trying to do some customization on UITabBar. I am almost done with everything. However, I saw a small bar on the bottom of each UITabBarItem. I don't know what object it is. Can someone please tell me how to remove it? Or if someone can tell me how to make the UIImage inside the UITabBarItem to be displayed in fro...
2012/06/08
[ "https://Stackoverflow.com/questions/10943128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443682/" ]
``` Yii::app()->clientScript->registerScript('dropdown', " $('#dropdown1').change(listval); function listval() { var regionid=$('#dropdown1').val();//regionid must be the value of option var city=".json_encode($cityarr)."; for(var i=0;i<city_array_count;i++) ...
I'm not familiar with Yii, but after looking it up, probably the best and most straightforward option is to use the `system.web.helpers.CJSON` class. What you would do is first read in your JSON file (country.json or city.json) to a string variable. This doesn't need to be a special operation; pretend you're reading i...
10,943,128
I am trying to do some customization on UITabBar. I am almost done with everything. However, I saw a small bar on the bottom of each UITabBarItem. I don't know what object it is. Can someone please tell me how to remove it? Or if someone can tell me how to make the UIImage inside the UITabBarItem to be displayed in fro...
2012/06/08
[ "https://Stackoverflow.com/questions/10943128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443682/" ]
``` Yii::app()->clientScript->registerScript('dropdown', " $('#dropdown1').change(listval); function listval() { var regionid=$('#dropdown1').val();//regionid must be the value of option var city=".json_encode($cityarr)."; for(var i=0;i<city_array_count;i++) ...
Step one: Read file into string and get a `responsestring` from your file. You can use file input stream or any for that. step second: parse it. ``` try{ JSONObject jobj=new JSONObject(response_str); JSONArray jarr=jobj.getJSONArray("sates"); for(int i=0;i<jarr.length();i++) { JSONObject jsonobj=jar...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
I would just simply make the first select option value the default and just hide that value in the dropdown with HTML5's new "hidden" feature. Like this: ``` <select name="" id=""> <option hidden value="default">Select An Option</option> <option value="1">One</option> <option value="2">Two</option> ...
I myself use it ``` <select selected=''> <option value=''></option> <option value='1'>ccc</option> <option value='2'>xxx</option> <option value='3'>zzz</option> <option value='4'>aaa</option> <option value='5'>qqq</option> <option value='6'>wwww</option> </select> ```
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
You just need to put attribute "selected" on a particular option instead direct to select element. Here is snippet for same and multiple working example with different values. ```html Select Option 3 :- <select name="hall" id="hall"> <option>1</option> <option>2</option> <option selected="selec...
none of these answer worked for me, reason is that I had an array in my database containing the previous selection and I wanted the user to see highlighted the same selections he had made the last time before changing them. I am also using React that doesn't like the selected tag. ``` VM71 react_devtools_backend.js:39...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
Another example; using JavaScript to set a selected option. *(You could use this example to for loop an array of values into a drop down component)* `<select id="yourDropDownElementId"><select/>` ``` // Get the select element var select = document.getElementById("yourDropDownElementId"); // Create a new option elem...
This example has been tested to work with multiple `<select>` elements on the page, and can also work with normal text elements. It has not been tested for setting the value to more than one selection when `<select multiple="true">`, however you can probably modify this sample to support that. * Add an attribute `data...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
I prefer this: ``` <select> <option selected hidden>Choose here</option> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> <option value="4">Four</option> <option value="5">Five</option> </select> ``` 'Choose here' disappears after an option has been sel...
Default selected value is **Option-4** ``` <html:select property="status" value="OPTION_4" styleClass="form-control"> <html:option value="">Select</html:option> <html:option value="OPTION_1" >Option-1</html:option> <html:option value="OPTION_2" >Option-2</html:option> ...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
I was having some troubles with it because I need some way to choose the option dynamically accordingly to the value that I have in the database. The script bellow works like a charm to me: ``` <?php //pick the value of database $selected_sexo = $query['s_sexo']; ?> <select name="s_sexo" id="s_sexo" required> <opti...
Select Ticket type disabeled are not friendly in such situations
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
I prefer this: ``` <select> <option selected hidden>Choose here</option> <option value="1">One</option> <option value="2">Two</option> <option value="3">Three</option> <option value="4">Four</option> <option value="5">Five</option> </select> ``` 'Choose here' disappears after an option has been sel...
Another example; using JavaScript to set a selected option. *(You could use this example to for loop an array of values into a drop down component)* `<select id="yourDropDownElementId"><select/>` ``` // Get the select element var select = document.getElementById("yourDropDownElementId"); // Create a new option elem...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
If you are in react you can use `defaultValue` as attribute instead of `value` in the select tag.
I would just simply make the first select option value the default and just hide that value in the dropdown with HTML5's new "hidden" feature. Like this: ``` <select name="" id=""> <option hidden value="default">Select An Option</option> <option value="1">One</option> <option value="2">Two</option> ...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
I use Angular and i set the default option by **HTML Template** ``` <select #selectConnection [(ngModel)]="selectedVal" class="form-control col-sm-6 " max-width="100px" title="Select" data-size="10"> <option >test1</option> <option >test2</option> </select> ``` **Script:** ...
This is how I did it... ``` <form action="../<SamePage>/" method="post"> <?php if ( $_POST['drop_down'] == "") { $selected = ""; } else { $selected = "selected"; } ?> <select name="select" size="1"> <option value="1" <?php $selected ?>>One</option> //////// OR //////// <op...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
In case you want to have a default text as a sort of placeholder/hint but not considered a valid value (something like "complete here", "select your nation" ecc.) you can do something like this: ```html <select> <option value="" selected disabled hidden>Choose here</option> <option value="1">One</option> <opt...
To set the default using PHP and JavaScript: ``` State: <select id="State"> <option value="" selected disabled hidden></option> <option value="Andhra Pradesh">Andhra Pradesh</option> <option value="Andaman and Nicobar Islands">Andaman and Nicobar Islands</option> . . <option value="West Bengal">West Bengal</option> </...
3,518,002
I thought that adding a `"value"` attribute set on the `<select>` element below would cause the `<option>` containing my provided `"value"` to be selected by default: ```html <select name="hall" id="hall" value="3"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</o...
2010/08/19
[ "https://Stackoverflow.com/questions/3518002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193251/" ]
Set `selected="selected"` for the option you want to be the default. ``` <option selected="selected"> 3 </option> ```
You can use: ``` <option value="someValue" selected>Some Value</option> ``` instead of, ``` <option value="someValue" selected = "selected">Some Value</option> ``` both are equally correct.
55,058,937
I'm building a small web app with Webpack-enabled CSS modules (via css-loader) and *without* React. My goal is to get the [benefits of short, obfuscated CSS class names](https://medium.freecodecamp.org/reducing-css-bundle-size-70-by-cutting-the-class-names-and-using-scope-isolation-625440de600b) (as I'm currently using...
2019/03/08
[ "https://Stackoverflow.com/questions/55058937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1543403/" ]
This github code might help you. <https://github.com/moorthy-g/css-module-for-raw-html> A bit of complicated setup needed. We need to wire the following packages together. - postcss-loader - postcss-modules - posthtml-css-modules - posthtml-loader The following postcss configuration creates modules dump ...
My understanding of Webpack, CSS Modules, & CSS-Loader is that the **entire point** is to use javascript to generate the files. This enables all the name translation and what not. What's your goal with Webpack if you're writing static HTML? There are several [static site generators](https://www.npmjs.com/package/sta...
3,890,375
I stumbled upon a question involving discontinuous derivative but I couldn't understand how could it happen that the derivative of a function (let's say $f(x)$) is defined at point (let's suppose $c$) but then it is discontinuous (or undefined) at the same point $c$. Is there a problem in calculus? (The function $f(x)...
2020/11/01
[ "https://math.stackexchange.com/questions/3890375", "https://math.stackexchange.com", "https://math.stackexchange.com/users/686464/" ]
The function $$ f(x) = \begin{cases} x^2\sin(1/x), &\text{if } x\ne0, \\ 0, &\text{if } x=0 \end{cases} $$ is differentiable everywhere (in particular, $f'(0)=0$) but its derivative is not continuous at $x=0$. Whether this is a "problem" in calculus is in the eye of the beholder! (By way of analogy, the school of Pyth...
Remember that it’s entirely possible for a function to be continuous at a point where the derivative is not. Moreover, take care not to confuse continuity with existence (or being well defined for that matter). There is no prerequisite for differentiability of a function based on the differentiability of its derivative...
60,171,623
I'm building an app with IONIC Angular, and I'm trying to print the result in HTML. From console.log it works correctly, but from the view I can't get the data printed json api ``` { "matches1": { "homeTeam": "Barcellona", "awayTeam": "Real Madrid", }, "matches2": { "homeTeam": "PSG", "awayTe...
2020/02/11
[ "https://Stackoverflow.com/questions/60171623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2324216/" ]
This should do the work : ``` export class HomePage { matches1: any; homeTeam1: any; awayTeam1: any; result1: any; items: any; private apiurl = 'https://myapi.xxx'; constructor(private httpService: HttpClient) { this.getdata(); } getdata() { this.httpService.get(this.apiurl).subscribe(re...
I like to use the json pipe (<https://angular.io/api/common/JsonPipe>), try this: ``` <pre>{{ items | json }}</pre> ``` Edit: In your case, it might be `item | json`. Also, Hala Madrid !
60,171,623
I'm building an app with IONIC Angular, and I'm trying to print the result in HTML. From console.log it works correctly, but from the view I can't get the data printed json api ``` { "matches1": { "homeTeam": "Barcellona", "awayTeam": "Real Madrid", }, "matches2": { "homeTeam": "PSG", "awayTe...
2020/02/11
[ "https://Stackoverflow.com/questions/60171623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2324216/" ]
This should do the work : ``` export class HomePage { matches1: any; homeTeam1: any; awayTeam1: any; result1: any; items: any; private apiurl = 'https://myapi.xxx'; constructor(private httpService: HttpClient) { this.getdata(); } getdata() { this.httpService.get(this.apiurl).subscribe(re...
You need to declare item in your Controller, and you can't use ngFor if your item is not a list. Right now your json is NOT returning an array, so if you can, it would be best to make it into a list of matches. Your Json would look better if it was something like this: ``` { "matches": [ { "homeTeam"...