qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
44,599
> > **Possible Duplicate:** > > [Is fire matter or energy?](https://physics.stackexchange.com/questions/9708/is-fire-matter-or-energy) > > > What is the basic form of fire? physics defines every entity by a basic form either solid or liquid or as a gas, example: water is liquid, ice as solid, water vapor: gas...
2012/11/19
[ "https://physics.stackexchange.com/questions/44599", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/16106/" ]
Fire is a reaction between molecules in gases. It may look as if a piece of wood is burning, but actually the burning happens in gases given off by the wood as it is heated. Burning wood, paper etc is a complicated business, so let's take a relatively simple system like burning the gas in your cooker (assuming you use...
The basic form of fire is what we perceive which is simply heat and visible light (as we can't see IR). It's not *itself* a matter... But, instead it's a natural process. Perhaps, it will not completely convert matter into energy because some will be left as the products of the flame. [Fire](http://en.wikipedia.org/wik...
44,599
> > **Possible Duplicate:** > > [Is fire matter or energy?](https://physics.stackexchange.com/questions/9708/is-fire-matter-or-energy) > > > What is the basic form of fire? physics defines every entity by a basic form either solid or liquid or as a gas, example: water is liquid, ice as solid, water vapor: gas...
2012/11/19
[ "https://physics.stackexchange.com/questions/44599", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/16106/" ]
Fire is a reaction between molecules in gases. It may look as if a piece of wood is burning, but actually the burning happens in gases given off by the wood as it is heated. Burning wood, paper etc is a complicated business, so let's take a relatively simple system like burning the gas in your cooker (assuming you use...
Fire usually consists of something that burns (often solid - wood or coal, say) and the flames accompanying the burning. The flames consist of hot reacting gases, which emit light in the frequencies from the emission spectrum of the hot molecules and radicals, giving rise to colors depending on the chemical composition...
53,460,838
I have a userform that is activated whenever I check a checkbox that is on the sheet, and if I uncheck it, it is hidden from the screen. The problem is that when I press the red close (X) button from the userform, the checkbox doesn't uncheck, but it should, since the userform is no longer on the screen. I don't know h...
2018/11/24
[ "https://Stackoverflow.com/questions/53460838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10618733/" ]
Though it might not be best practice you could use the following code in the QueryClose event ``` Private Sub UserForm_QueryClose(Cancel As Integer _ , CloseMode As Integer) ' Prevent the form being unloaded If CloseMode = vbFormControlMenu Then Cancel = True ' Hide...
i've solved it: ``` Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then ThisWorkbook.Worksheets("Sheet1").CheckBox1.Value = False End If End Sub ```
30,453,507
I have a string in the form: ``` var targetString = "{hello: 5, world: 10}, {hello: 4, otherworld: 11}"; ``` Using the syntax ``` var targetObject = JSON.parse(targetString) ``` I only receive: ``` targetObject = { hello: 5, world: 10 } ``` So it only takes the first part and not the second part. How can ...
2015/05/26
[ "https://Stackoverflow.com/questions/30453507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4262057/" ]
Make it enclosed in array `[]` and enclose keys within quotes: ``` var targetString = '[{"hello":5,"world":10},{"hello":4,"otherworld":11}]'; var targetObject = JSON.parse(targetString); ```
This is the correct syntax for an array of objects: ```js var targetString = '[{"hello": 5, "world": 10}, {"hello": 4, "otherworld": 11}]'; var targetArray = JSON.parse(targetString); console.log(targetArray); ``` The array elements have to be enclosed in square brackets, and the property names have to be in double...
30,453,507
I have a string in the form: ``` var targetString = "{hello: 5, world: 10}, {hello: 4, otherworld: 11}"; ``` Using the syntax ``` var targetObject = JSON.parse(targetString) ``` I only receive: ``` targetObject = { hello: 5, world: 10 } ``` So it only takes the first part and not the second part. How can ...
2015/05/26
[ "https://Stackoverflow.com/questions/30453507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4262057/" ]
Make it enclosed in array `[]` and enclose keys within quotes: ``` var targetString = '[{"hello":5,"world":10},{"hello":4,"otherworld":11}]'; var targetObject = JSON.parse(targetString); ```
You need to wrap the json-keys into double-quotes, otherwise its not valid JSON. ``` var targetString = '[{"hello": 5, "world": 10}, {"hello": 4, "otherworld": 11}]'; ```
30,453,507
I have a string in the form: ``` var targetString = "{hello: 5, world: 10}, {hello: 4, otherworld: 11}"; ``` Using the syntax ``` var targetObject = JSON.parse(targetString) ``` I only receive: ``` targetObject = { hello: 5, world: 10 } ``` So it only takes the first part and not the second part. How can ...
2015/05/26
[ "https://Stackoverflow.com/questions/30453507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4262057/" ]
Make it enclosed in array `[]` and enclose keys within quotes: ``` var targetString = '[{"hello":5,"world":10},{"hello":4,"otherworld":11}]'; var targetObject = JSON.parse(targetString); ```
If you take a look at `JSON.parse()`'s corresponding method, [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify), you'll need to enclose the keys in quotation marks for it to work. While you can generally get away with not using quotes with JavaScript, t...
30,453,507
I have a string in the form: ``` var targetString = "{hello: 5, world: 10}, {hello: 4, otherworld: 11}"; ``` Using the syntax ``` var targetObject = JSON.parse(targetString) ``` I only receive: ``` targetObject = { hello: 5, world: 10 } ``` So it only takes the first part and not the second part. How can ...
2015/05/26
[ "https://Stackoverflow.com/questions/30453507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4262057/" ]
This is the correct syntax for an array of objects: ```js var targetString = '[{"hello": 5, "world": 10}, {"hello": 4, "otherworld": 11}]'; var targetArray = JSON.parse(targetString); console.log(targetArray); ``` The array elements have to be enclosed in square brackets, and the property names have to be in double...
You need to wrap the json-keys into double-quotes, otherwise its not valid JSON. ``` var targetString = '[{"hello": 5, "world": 10}, {"hello": 4, "otherworld": 11}]'; ```
30,453,507
I have a string in the form: ``` var targetString = "{hello: 5, world: 10}, {hello: 4, otherworld: 11}"; ``` Using the syntax ``` var targetObject = JSON.parse(targetString) ``` I only receive: ``` targetObject = { hello: 5, world: 10 } ``` So it only takes the first part and not the second part. How can ...
2015/05/26
[ "https://Stackoverflow.com/questions/30453507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4262057/" ]
This is the correct syntax for an array of objects: ```js var targetString = '[{"hello": 5, "world": 10}, {"hello": 4, "otherworld": 11}]'; var targetArray = JSON.parse(targetString); console.log(targetArray); ``` The array elements have to be enclosed in square brackets, and the property names have to be in double...
If you take a look at `JSON.parse()`'s corresponding method, [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify), you'll need to enclose the keys in quotation marks for it to work. While you can generally get away with not using quotes with JavaScript, t...
20,241,398
I want to run a Bash function that defines a few variables and then, after the function has run, list all of the variables that it has 'attempted' to define. Such a list would include the names of those variables that were pre-existing but were unchanged in value by the function. Could you point me in the right directi...
2013/11/27
[ "https://Stackoverflow.com/questions/20241398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1556092/" ]
Try the first answer: ``` x <- barplot(table(mtcars$cyl), xaxt="n") labs <- paste(names(table(mtcars$cyl)), "cylinders") text(cex=1, x=x-.25, y=-1.25, labs, xpd=TRUE, srt=45) ``` But change cex=1 to cex=.8 or .6 in the text() function: ``` text(cex=.6, x=x-.25, y=-1.25, labs, xpd=TRUE, srt=45) ``` In the picture ...
I had the same problem with a grouped bar plot. I assume that you only want one label below each group. I may be wrong about this, since you don't state it explicitly, but this seems to be the case since your labels are repeated in image. In that case you can use the solution proposed by Stu although you have to apply ...
20,241,398
I want to run a Bash function that defines a few variables and then, after the function has run, list all of the variables that it has 'attempted' to define. Such a list would include the names of those variables that were pre-existing but were unchanged in value by the function. Could you point me in the right directi...
2013/11/27
[ "https://Stackoverflow.com/questions/20241398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1556092/" ]
I am not a base plot proficient, so maybe my solution is not very simple. I think that using ggplot2 is better here. ![enter image description here](https://i.stack.imgur.com/Sd27L.png) ``` def.par <- par(no.readonly = TRUE) ## divide device into two rows and 1 column ## allocate figure 1 for barplot ## allocate ...
I had the same problem with a grouped bar plot. I assume that you only want one label below each group. I may be wrong about this, since you don't state it explicitly, but this seems to be the case since your labels are repeated in image. In that case you can use the solution proposed by Stu although you have to apply ...
71,665,162
Hello how to change an id of document to diffrent when some ids are equal? I want to change some of employees `id_director` to object id thats is equal to `id_director`. I mean for example, when some document have `id_director = 100` then changed it to \_id with value of employee where `id_employee = 100`. I was tryin...
2022/03/29
[ "https://Stackoverflow.com/questions/71665162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18622291/" ]
If you're only interested in success and failure, and not for which product, then you could just count the occurrences of 'ERROR' and 'SUCCESS'. so with your fileC ``` Program Start PRODUCT "Washer" Code Executing ERROR Checking other stuffs.... Program Start PRODUCT "Bolt" Code Executing SUCCESS Checking other stuff...
For simplicity purpose, I suggest merging all file as one file, then parse this file. ``` import os path = '\\\\myserver\logs' output = './master-data.txt' def merge(): with open(output, 'w', newline='') as out: for f in os.listdir(path): if f.endswith(".log"): with open(os.pa...
71,665,162
Hello how to change an id of document to diffrent when some ids are equal? I want to change some of employees `id_director` to object id thats is equal to `id_director`. I mean for example, when some document have `id_director = 100` then changed it to \_id with value of employee where `id_employee = 100`. I was tryin...
2022/03/29
[ "https://Stackoverflow.com/questions/71665162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18622291/" ]
If you're only interested in success and failure, and not for which product, then you could just count the occurrences of 'ERROR' and 'SUCCESS'. so with your fileC ``` Program Start PRODUCT "Washer" Code Executing ERROR Checking other stuffs.... Program Start PRODUCT "Bolt" Code Executing SUCCESS Checking other stuff...
You mention splitting, but from what I read you are mainly after getting how many times a program was started and what the status was. You can achieve this by counting the number of occurences of each in the following way ``` # Opening files and appending file content to a list with content of all files path = os.getc...
1,077,285
I have a utc timestamp in the IS8601 format and am trying to convert it to unix time. This is my console session: ``` In [9]: mydate Out[9]: '2009-07-17T01:21:00.000Z' In [10]: parseddate = iso8601.parse_date(mydate) In [14]: ti = time.mktime(parseddate.timetuple()) In [25]: datetime.datetime.utcfromtimestamp(ti) Ou...
2009/07/03
[ "https://Stackoverflow.com/questions/1077285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/94633/" ]
You can create an `struct_time` in UTC with [`datetime.utctimetuple()`](http://docs.python.org/library/datetime.html#datetime.datetime.utctimetuple) and then convert this to a unix timestamp with [`calendar.timegm()`](http://docs.python.org/library/calendar.html#calendar.timegm): ``` calendar.timegm(parseddate.utctime...
I am just guessing, but one hour difference can be not because of time zones, but because of daylight savings on/off.
1,077,285
I have a utc timestamp in the IS8601 format and am trying to convert it to unix time. This is my console session: ``` In [9]: mydate Out[9]: '2009-07-17T01:21:00.000Z' In [10]: parseddate = iso8601.parse_date(mydate) In [14]: ti = time.mktime(parseddate.timetuple()) In [25]: datetime.datetime.utcfromtimestamp(ti) Ou...
2009/07/03
[ "https://Stackoverflow.com/questions/1077285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/94633/" ]
I am just guessing, but one hour difference can be not because of time zones, but because of daylight savings on/off.
``` import time import datetime import calendar def date_time_to_utc_epoch(dt_utc): #convert from utc date time object (yyyy-mm-dd hh:mm:ss) to UTC epoch frmt="%Y-%m-%d %H:%M:%S" dtst=dt_utc.strftime(frmt) #convert datetime object to string time_struct = time.strptime(dtst, frmt) #conv...
1,077,285
I have a utc timestamp in the IS8601 format and am trying to convert it to unix time. This is my console session: ``` In [9]: mydate Out[9]: '2009-07-17T01:21:00.000Z' In [10]: parseddate = iso8601.parse_date(mydate) In [14]: ti = time.mktime(parseddate.timetuple()) In [25]: datetime.datetime.utcfromtimestamp(ti) Ou...
2009/07/03
[ "https://Stackoverflow.com/questions/1077285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/94633/" ]
You can create an `struct_time` in UTC with [`datetime.utctimetuple()`](http://docs.python.org/library/datetime.html#datetime.datetime.utctimetuple) and then convert this to a unix timestamp with [`calendar.timegm()`](http://docs.python.org/library/calendar.html#calendar.timegm): ``` calendar.timegm(parseddate.utctime...
``` naive_utc_dt = parseddate.replace(tzinfo=None) timestamp = (naive_utc_dt - datetime(1970, 1, 1)).total_seconds() # -> 1247793660.0 ``` See more details in [another answer to similar question](https://stackoverflow.com/a/8778548/4279). And back: ``` utc_dt = datetime.utcfromtimestamp(timestamp) # -> datetime.dat...
1,077,285
I have a utc timestamp in the IS8601 format and am trying to convert it to unix time. This is my console session: ``` In [9]: mydate Out[9]: '2009-07-17T01:21:00.000Z' In [10]: parseddate = iso8601.parse_date(mydate) In [14]: ti = time.mktime(parseddate.timetuple()) In [25]: datetime.datetime.utcfromtimestamp(ti) Ou...
2009/07/03
[ "https://Stackoverflow.com/questions/1077285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/94633/" ]
You can create an `struct_time` in UTC with [`datetime.utctimetuple()`](http://docs.python.org/library/datetime.html#datetime.datetime.utctimetuple) and then convert this to a unix timestamp with [`calendar.timegm()`](http://docs.python.org/library/calendar.html#calendar.timegm): ``` calendar.timegm(parseddate.utctime...
``` import time import datetime import calendar def date_time_to_utc_epoch(dt_utc): #convert from utc date time object (yyyy-mm-dd hh:mm:ss) to UTC epoch frmt="%Y-%m-%d %H:%M:%S" dtst=dt_utc.strftime(frmt) #convert datetime object to string time_struct = time.strptime(dtst, frmt) #conv...
1,077,285
I have a utc timestamp in the IS8601 format and am trying to convert it to unix time. This is my console session: ``` In [9]: mydate Out[9]: '2009-07-17T01:21:00.000Z' In [10]: parseddate = iso8601.parse_date(mydate) In [14]: ti = time.mktime(parseddate.timetuple()) In [25]: datetime.datetime.utcfromtimestamp(ti) Ou...
2009/07/03
[ "https://Stackoverflow.com/questions/1077285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/94633/" ]
``` naive_utc_dt = parseddate.replace(tzinfo=None) timestamp = (naive_utc_dt - datetime(1970, 1, 1)).total_seconds() # -> 1247793660.0 ``` See more details in [another answer to similar question](https://stackoverflow.com/a/8778548/4279). And back: ``` utc_dt = datetime.utcfromtimestamp(timestamp) # -> datetime.dat...
``` import time import datetime import calendar def date_time_to_utc_epoch(dt_utc): #convert from utc date time object (yyyy-mm-dd hh:mm:ss) to UTC epoch frmt="%Y-%m-%d %H:%M:%S" dtst=dt_utc.strftime(frmt) #convert datetime object to string time_struct = time.strptime(dtst, frmt) #conv...
2,234
I am trying to build a worm gear based on a single axis solar tracker for a worm gear box. I need some guidance choosing a worm gear & drive motor for the application. These are the steps I have explored so far - if I am wrong could someone please give links to material which gives a good explanation so I can learn and...
2015/03/28
[ "https://engineering.stackexchange.com/questions/2234", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/1063/" ]
I think this depends on how much information you want, and how formally you want to track it. It sounds like currently, none of this information is written down anywhere, which is obviously the first problem. But putting down information for a solution that you don't intend to pursue is, at best, a less-than-optimal us...
*This [answer from Trevor](https://engineering.stackexchange.com/a/2231/33) gives a pretty good over all philosophy, but I want to get more at the details.* **First, figure out why the alternate records are not being kept.** This likely started out as either a foresight issue or a storage (paper or computer) issue. A...
2,234
I am trying to build a worm gear based on a single axis solar tracker for a worm gear box. I need some guidance choosing a worm gear & drive motor for the application. These are the steps I have explored so far - if I am wrong could someone please give links to material which gives a good explanation so I can learn and...
2015/03/28
[ "https://engineering.stackexchange.com/questions/2234", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/1063/" ]
I think this depends on how much information you want, and how formally you want to track it. It sounds like currently, none of this information is written down anywhere, which is obviously the first problem. But putting down information for a solution that you don't intend to pursue is, at best, a less-than-optimal us...
Following are three general methods how white goods, consumer goods and OEM manufactures I have associated with document ideas. **Front End (Conceptualization) idea documentation** Create project numbers for ideas considered big, impact full, and ground breaking but not currently considered for implementation. Doc...
2,234
I am trying to build a worm gear based on a single axis solar tracker for a worm gear box. I need some guidance choosing a worm gear & drive motor for the application. These are the steps I have explored so far - if I am wrong could someone please give links to material which gives a good explanation so I can learn and...
2015/03/28
[ "https://engineering.stackexchange.com/questions/2234", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/1063/" ]
I think this depends on how much information you want, and how formally you want to track it. It sounds like currently, none of this information is written down anywhere, which is obviously the first problem. But putting down information for a solution that you don't intend to pursue is, at best, a less-than-optimal us...
Others have made a lot of good comments about documentation in general, but I want to suggest a particular class of software that will help tremendously. I find [version control software](https://en.wikipedia.org/wiki/Revision_control) to be excellent for these sorts of issues. It's not too common outside of software ...
2,234
I am trying to build a worm gear based on a single axis solar tracker for a worm gear box. I need some guidance choosing a worm gear & drive motor for the application. These are the steps I have explored so far - if I am wrong could someone please give links to material which gives a good explanation so I can learn and...
2015/03/28
[ "https://engineering.stackexchange.com/questions/2234", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/1063/" ]
*This [answer from Trevor](https://engineering.stackexchange.com/a/2231/33) gives a pretty good over all philosophy, but I want to get more at the details.* **First, figure out why the alternate records are not being kept.** This likely started out as either a foresight issue or a storage (paper or computer) issue. A...
Following are three general methods how white goods, consumer goods and OEM manufactures I have associated with document ideas. **Front End (Conceptualization) idea documentation** Create project numbers for ideas considered big, impact full, and ground breaking but not currently considered for implementation. Doc...
2,234
I am trying to build a worm gear based on a single axis solar tracker for a worm gear box. I need some guidance choosing a worm gear & drive motor for the application. These are the steps I have explored so far - if I am wrong could someone please give links to material which gives a good explanation so I can learn and...
2015/03/28
[ "https://engineering.stackexchange.com/questions/2234", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/1063/" ]
*This [answer from Trevor](https://engineering.stackexchange.com/a/2231/33) gives a pretty good over all philosophy, but I want to get more at the details.* **First, figure out why the alternate records are not being kept.** This likely started out as either a foresight issue or a storage (paper or computer) issue. A...
Others have made a lot of good comments about documentation in general, but I want to suggest a particular class of software that will help tremendously. I find [version control software](https://en.wikipedia.org/wiki/Revision_control) to be excellent for these sorts of issues. It's not too common outside of software ...
32,883,582
I'm wondering which options are there for docker container deployment in production. Given I have separate APP and DB server containers and data-only containers holding deployables and other holding database files. I just have one server for now, which I would like to "docker enable", but what is the best way to deplo...
2015/10/01
[ "https://Stackoverflow.com/questions/32883582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2944265/" ]
My team recently built a Docker continuous deployment system and I thought I'd share it here since you seem to have the same questions we had. It pretty much does what you asked: "hit a button and some tool will take care of stopping, starting, exchanging all needed docker containers" We had the challenge that our Doc...
I think most people start their container journey using tools from [Docker Toolbox](https://www.docker.com/toolbox). Those tools provide a good start and work as promised, but you'll end up wanting more. With these tools, you are missing for example integrated overlay networking, DNS, load balancing, aggregated logging...
1,584,159
Thanks for looking. All sincerely helpful answers are voted up. I use a password strength meter to let the user know how strong the password they've chosen is. But this password checker obviously doesn't cover how weak under a dictionary attack the password is. How can I check for that, and is it worth it? Also my ...
2009/10/18
[ "https://Stackoverflow.com/questions/1584159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184362/" ]
Opinions are going to vary and some people will say that checking for dictionary words is important. I disagree and instead favor requiring different cases of letters, numbers and special characters like !@#$%^&\*()\_-=+. Obviously passwords should be case sensitive. Dictionary attacks are much less likely to succeed ...
If you are using proper complexity requirements (length, mix of casing, numbers, symbols, and perhaps forbid repeat a char consecutively) then I'd say it's not really worth it. If you're in a situation where that would be required then probably password authentication would not be good enough for your situation anyway.
1,584,159
Thanks for looking. All sincerely helpful answers are voted up. I use a password strength meter to let the user know how strong the password they've chosen is. But this password checker obviously doesn't cover how weak under a dictionary attack the password is. How can I check for that, and is it worth it? Also my ...
2009/10/18
[ "https://Stackoverflow.com/questions/1584159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184362/" ]
Opinions are going to vary and some people will say that checking for dictionary words is important. I disagree and instead favor requiring different cases of letters, numbers and special characters like !@#$%^&\*()\_-=+. Obviously passwords should be case sensitive. Dictionary attacks are much less likely to succeed ...
SSL === If your website in any way or on any page requests sensitive personal information, *including passwords*, then you should enable and enforce SSL across the entire site. This will ensure that all passwords are transmitted in encrypted form from the browser to the server, and that nobody can sniff the passwords ...
1,584,159
Thanks for looking. All sincerely helpful answers are voted up. I use a password strength meter to let the user know how strong the password they've chosen is. But this password checker obviously doesn't cover how weak under a dictionary attack the password is. How can I check for that, and is it worth it? Also my ...
2009/10/18
[ "https://Stackoverflow.com/questions/1584159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184362/" ]
Opinions are going to vary and some people will say that checking for dictionary words is important. I disagree and instead favor requiring different cases of letters, numbers and special characters like !@#$%^&\*()\_-=+. Obviously passwords should be case sensitive. Dictionary attacks are much less likely to succeed ...
One additional point - if you control the site, you can stop dictionary attacks by limiting the number of times a user can try a user/pass. It is great you want your users to have better passwords and you should continue in that direction but a better solution for the dictionary/brute force attack would be an exponen...
1,584,159
Thanks for looking. All sincerely helpful answers are voted up. I use a password strength meter to let the user know how strong the password they've chosen is. But this password checker obviously doesn't cover how weak under a dictionary attack the password is. How can I check for that, and is it worth it? Also my ...
2009/10/18
[ "https://Stackoverflow.com/questions/1584159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184362/" ]
I'm coming to this question later than the others, and I'm surprised that no-one has pointed out that a dictionary check might not be exhaustive. At least no-one has said it in so many words. I think you need a large dictionary, where each entry is hashed and compared to the *hashed* password. This will allow you to s...
If you are using proper complexity requirements (length, mix of casing, numbers, symbols, and perhaps forbid repeat a char consecutively) then I'd say it's not really worth it. If you're in a situation where that would be required then probably password authentication would not be good enough for your situation anyway.
1,584,159
Thanks for looking. All sincerely helpful answers are voted up. I use a password strength meter to let the user know how strong the password they've chosen is. But this password checker obviously doesn't cover how weak under a dictionary attack the password is. How can I check for that, and is it worth it? Also my ...
2009/10/18
[ "https://Stackoverflow.com/questions/1584159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184362/" ]
I'm coming to this question later than the others, and I'm surprised that no-one has pointed out that a dictionary check might not be exhaustive. At least no-one has said it in so many words. I think you need a large dictionary, where each entry is hashed and compared to the *hashed* password. This will allow you to s...
SSL === If your website in any way or on any page requests sensitive personal information, *including passwords*, then you should enable and enforce SSL across the entire site. This will ensure that all passwords are transmitted in encrypted form from the browser to the server, and that nobody can sniff the passwords ...
1,584,159
Thanks for looking. All sincerely helpful answers are voted up. I use a password strength meter to let the user know how strong the password they've chosen is. But this password checker obviously doesn't cover how weak under a dictionary attack the password is. How can I check for that, and is it worth it? Also my ...
2009/10/18
[ "https://Stackoverflow.com/questions/1584159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184362/" ]
I'm coming to this question later than the others, and I'm surprised that no-one has pointed out that a dictionary check might not be exhaustive. At least no-one has said it in so many words. I think you need a large dictionary, where each entry is hashed and compared to the *hashed* password. This will allow you to s...
One additional point - if you control the site, you can stop dictionary attacks by limiting the number of times a user can try a user/pass. It is great you want your users to have better passwords and you should continue in that direction but a better solution for the dictionary/brute force attack would be an exponen...
46,854,072
I'm still working through the lessons on DataCamp for R, so please forgive me if this question seems naïve. Consider the following (very contrived) sample: ``` library(dplyr) library(tibble) type <- c("Dog", "Cat", "Cat", "Cat") name <- c("Ella", "Arrow", "Gabby", "Eddie") pets = tibble(name, type) name <- c("Ella...
2017/10/20
[ "https://Stackoverflow.com/questions/46854072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47580/" ]
Both subset the first parameter, but `setdiff` requires the columns to be the same: ```r library(dplyr) setdiff(mtcars, mtcars[1:30, ]) #> mpg cyl disp hp drat wt qsec vs am gear carb #> 1 15.0 8 301 335 3.54 3.57 14.6 0 1 5 8 #> 2 21.4 4 121 109 4.11 2.78 18.6 1 1 4 2 setdiff(mtcars, mtc...
One difference between setdiff and anti\_join is that you can select columns in anti\_join. For example: ``` df1 <- data.frame(a = c(1,3,5,4), b = c(5,6,7,8)) df2 <- data.frame( a = c(1,2,3,4), b = c(5,9,7,8)) #df1 looks like df2 look like # a b a b # 1 5 1 5 # 3 6 ...
28,704,239
Hello I've made a GUI with a button to select a folder containing files and then plot them all on a single axes in the GUI. I've also made a button so that if the user wants to open up this plot in new figure they can. However, for this button, they have to select the same folder again (all I did was include figure; a...
2015/02/24
[ "https://Stackoverflow.com/questions/28704239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4596826/" ]
Edit: now I read your comment on the other answer, there is a faster way to do what you want. The first answer explained how to save and retrieve values from different part of your gui, but all you need in your case is to do a copy of your axes in a new figure. So another way to achieve that is : Keep exactly the same...
You can use savefig command in Matlab to save the figure and the pressing of the button simply loading that figure. Write ``` savefig('figure1.fig') ``` at the end of the first bit of code. And just ``` openfig('figure1.fig','new') ``` in the second bit of code.
29,983,151
I am getting `OutofMemoryException` while trying to add files to a .zip file. I am using 32-bit architecture for building and running the application. ```cs string[] filePaths = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\capture\\capture"); System.IO.Compression.Z...
2015/05/01
[ "https://Stackoverflow.com/questions/29983151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3269550/" ]
The exact reason depends on a variety of factors, but most likely you are simply just adding too much to the archive. Try using the `ZipArchiveMode.Create` option instead, which writes the archive directly to disk without caching it in memory. If you are really trying to update an existing archive, you can still use `...
The reason is simple. OutOfMemoryException means memory is not enough for the execution. Compression consumes a lot of memory. There is no guarantee that a change of logic can solve the problem. But you can consider different methods to alleviate it. 1. Since your main program must be 32-bit, you can consider startin...
57,702,534
I have a class of `Player` with a number of attributes to measure their overall state. I have a second class of `Character` (Class Type) that sets up some unique configurations for my players depending on their instance of character. Where I am having trouble, is calling a single generic function at the player level th...
2019/08/29
[ "https://Stackoverflow.com/questions/57702534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9414465/" ]
Please post the traceback error messages. I think the problem is in `Milestone1()` you check `self.power` and `self.position` but self refers to the instance of `Character` not `Player`, and character has no power or position attributes. Here are 2 fixes I can think of: 1. **Inheritance**: If you make player a subcla...
I'd recommend initizliaing a power value in the Character class as well, or creating a generic method in the Character class and then overriding it in the Player class.
57,702,534
I have a class of `Player` with a number of attributes to measure their overall state. I have a second class of `Character` (Class Type) that sets up some unique configurations for my players depending on their instance of character. Where I am having trouble, is calling a single generic function at the player level th...
2019/08/29
[ "https://Stackoverflow.com/questions/57702534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9414465/" ]
Please post the traceback error messages. I think the problem is in `Milestone1()` you check `self.power` and `self.position` but self refers to the instance of `Character` not `Player`, and character has no power or position attributes. Here are 2 fixes I can think of: 1. **Inheritance**: If you make player a subcla...
What you have is a container class `Player` that has a one-to-one relationship with the `Character`. You do not want to duplicate the attributes of Character (like `ms1` within `Player`, especially not during `__init__` before anything at all has happened in your game. Instead just access that Character's attributes fr...
145,278
I'am using **Luma theme** and I tried to override some **`phtml`** from `module_catalog`. In luma theme folder which is in `vendor/theme-frontend-luma` in `/Magento_Catalog` I created the same path as **phtml** form that I tried to override and it's not working. Is it possible to do that in Luma theme? or the only way...
2016/11/11
[ "https://magento.stackexchange.com/questions/145278", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/47014/" ]
You can not change directly in `vendon/magento/theme-frontend-luma` folder instead of you have to create new theme in `app/design/frontend/<vendor>/<theme>`, you can refer magento docs [How to create new theme in magento 2 ?](http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html) Once you ...
You have to override using this path `app/design/frontend/{vendor}/{theme}/Magento_Catalog/templates/{file.phtml}` You can also refer this blog. [Overwrite module phtml file and re-write in own theme Magento 2](http://blog.trimantra.com/overwrite-module-phtml-file-re-write-theme-magento-2/) let me know if not work.
145,278
I'am using **Luma theme** and I tried to override some **`phtml`** from `module_catalog`. In luma theme folder which is in `vendor/theme-frontend-luma` in `/Magento_Catalog` I created the same path as **phtml** form that I tried to override and it's not working. Is it possible to do that in Luma theme? or the only way...
2016/11/11
[ "https://magento.stackexchange.com/questions/145278", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/47014/" ]
You can not change directly in `vendon/magento/theme-frontend-luma` folder instead of you have to create new theme in `app/design/frontend/<vendor>/<theme>`, you can refer magento docs [How to create new theme in magento 2 ?](http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html) Once you ...
I'm not sure you can overrride this way even if you can it's not ideal, you should create your own custom theme in `app/design/frontend/<Vendor>/<theme>` which inherits from Luma so any changes that you make will override Luma theme's functionality for rest it will use default luma styles/functionality. Make sure to ...
145,278
I'am using **Luma theme** and I tried to override some **`phtml`** from `module_catalog`. In luma theme folder which is in `vendor/theme-frontend-luma` in `/Magento_Catalog` I created the same path as **phtml** form that I tried to override and it's not working. Is it possible to do that in Luma theme? or the only way...
2016/11/11
[ "https://magento.stackexchange.com/questions/145278", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/47014/" ]
You can not change directly in `vendon/magento/theme-frontend-luma` folder instead of you have to create new theme in `app/design/frontend/<vendor>/<theme>`, you can refer magento docs [How to create new theme in magento 2 ?](http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html) Once you ...
You can override template and block using layout handler use to remove old block ``` <referenceBlock name="blockname" remove="true"/> ``` and then add your block here is example ``` <body> <referenceBlock name="adjustments" remove="true"/> <referenceBlock name="creditmemo_totals"> <block class="M...
45,951,386
before I ask this question I have already debugged it for hours and read similar question post but I still cannot solve this problem. I checked that the error occurs when I define void drop(int size, int x\_coor, int y\_coor, int grid) this method.How to fix this error? This is the error: > > main.c:11: error: ','...
2017/08/30
[ "https://Stackoverflow.com/questions/45951386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7027796/" ]
``` void drop(int size, int x_coor, int y_coor, int grid); ``` It is getting converted to ``` void drop(int 10, int x_coor, int y_coor, int grid); ``` After compiler preprocessing step, as you have defined `#define size 10` You should declare it as ``` void drop(int , int , int , int ); ``` Or just use diffe...
I've just tried compiling your code, and it seems like the `#define size` macro is conflicting with the `int size` parameter in the `drop` function. Here is the output of `gcc` on my Mac: ``` temp.c:11:15: error: expected ')' void drop(int size, int x_coor, int y_coor, int grid); ^ temp.c:8:14: note: ex...
136,277
I keep reading that the reason why $\ce{CH2Cl2}$ is polar because due to its tetrahedral shape, the dipoles can not cancel each other out but doesn't $\ce{CH4}$ also have tetrahedral shape too? I assumed, since the reason for $\ce{CH2Cl2}$ being polar is apparently due to the 109.5° angles from the tetrahedral shape, t...
2020/07/08
[ "https://chemistry.stackexchange.com/questions/136277", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/95713/" ]
**There are two reasons why dichloromethane is polar and the tetrahedral shape is only one** The reasons why any molecule is polar–which is usual chemistry talk means that the molecule has a dipole moment–is that the individual dipole moments of its constituent bonds don't balance out. That means that we need to know ...
Note that polarity can be considered for the whole molecule, functional group or particular bonds.E.g. $\ce{CO2}$ has zero permanent dipole moment, as bond dipoles cancel each other. But the bonds themselves are polar enough due their dipole moment, being able to involve the molecule in polar intermolecular interaction...
5,130,541
> > **Possible Duplicate:** > > [PHP function Question](https://stackoverflow.com/questions/5128198/php-function-question) > > > I asked this question earlier but I do not think I provided enough code for the question to be answered. I racking my brain on this and I cannot figure it out. The is the error I am...
2011/02/26
[ "https://Stackoverflow.com/questions/5130541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/604359/" ]
You function is named `__retrieve_full_name()` and you're trying to call `retrieve_full_name()`. It can't work, you must rename your fonction in your class. I think you misunderstood the concept of ["magic" method](http://php.net/manual/en/language.oop5.magic.php) in PHP. All classes in PHP have some methods already d...
If you refer to [here](http://php.net/manual/en/language.oop5.magic.php) There is only specific times when you should consider using the magic methods. I believe your \_\_retrieve\_full\_name() should not be one of those execeptions. > > It is recommended that you do not use function names with \_\_ in PHP unless yo...
4,156,648
I have had this happen to me often. I am working on a master branch and I need to test a plugin, so I create a new branch and check it out. I download the plugin into the project directory and test it out. Then I switch back to the master branch and delete the branch I had created. What ends up happening is the files...
2010/11/11
[ "https://Stackoverflow.com/questions/4156648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32816/" ]
git will not remove untracked files from your working copy, so unless you added the files of the plugin and created a commit on the new branch git will not do anything to your plugin files. if you want to remove untracked file from your working tree, use [`git clean`](http://schacon.github.com/git/git-clean.html) – be...
try checkout -f see git --help checkout: Proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.
4,156,648
I have had this happen to me often. I am working on a master branch and I need to test a plugin, so I create a new branch and check it out. I download the plugin into the project directory and test it out. Then I switch back to the master branch and delete the branch I had created. What ends up happening is the files...
2010/11/11
[ "https://Stackoverflow.com/questions/4156648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32816/" ]
git will not remove untracked files from your working copy, so unless you added the files of the plugin and created a commit on the new branch git will not do anything to your plugin files. if you want to remove untracked file from your working tree, use [`git clean`](http://schacon.github.com/git/git-clean.html) – be...
If you are switching back and forth between branches where the directory structures are different, and you find that there are some artifacts left over, you might need to run: ``` git clean -df ``` This will "delete" "force". You will loose ALL untracked files, I think this might be one step away from: ``` git rese...
20,303,761
on buttonclick I'm taking image from file system and save into database, everything is ok but I want when I select image to display that image into pictureBox1 ``` OpenFileDialog open = new OpenFileDialog() { Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg" }; if (open.ShowDialog() == Dial...
2013/11/30
[ "https://Stackoverflow.com/questions/20303761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783193/" ]
You can use `Image` property to set the Image for `PictureBox` Control. Try This: ``` DialogResult result= openFileDialog1.ShowDialog(); if(result==DialogResult.OK) pictureBox1.Image =new Bitmap(openFileDialog1.FileName); ``` if you want to add it in your code **Complete Code:** ``` ...
Simple code: ``` picturebox.Image = Bitmap.FromFile(yourimagepath); ```
20,303,761
on buttonclick I'm taking image from file system and save into database, everything is ok but I want when I select image to display that image into pictureBox1 ``` OpenFileDialog open = new OpenFileDialog() { Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg" }; if (open.ShowDialog() == Dial...
2013/11/30
[ "https://Stackoverflow.com/questions/20303761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783193/" ]
Simple code: ``` picturebox.Image = Bitmap.FromFile(yourimagepath); ```
``` OpenFileDialog open = new OpenFileDialog() { Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg" }; if (open.ShowDialog() == DialogResult.OK) { PictureBoxObjectName.Image = Image.FromFile(open.FileName); } ```
20,303,761
on buttonclick I'm taking image from file system and save into database, everything is ok but I want when I select image to display that image into pictureBox1 ``` OpenFileDialog open = new OpenFileDialog() { Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg" }; if (open.ShowDialog() == Dial...
2013/11/30
[ "https://Stackoverflow.com/questions/20303761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783193/" ]
Simple code: ``` picturebox.Image = Bitmap.FromFile(yourimagepath); ```
``` openFileDialog1.Multiselect = false; openFileDialog1.Filter= "jpg files (*.jpg)|*.jpg"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { foreach (String file in openFileDialog1.FileNames) { picturebox1.Image = Image.FromFile(File); } } ``` This is for selection of one imag...
20,303,761
on buttonclick I'm taking image from file system and save into database, everything is ok but I want when I select image to display that image into pictureBox1 ``` OpenFileDialog open = new OpenFileDialog() { Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg" }; if (open.ShowDialog() == Dial...
2013/11/30
[ "https://Stackoverflow.com/questions/20303761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783193/" ]
You can use `Image` property to set the Image for `PictureBox` Control. Try This: ``` DialogResult result= openFileDialog1.ShowDialog(); if(result==DialogResult.OK) pictureBox1.Image =new Bitmap(openFileDialog1.FileName); ``` if you want to add it in your code **Complete Code:** ``` ...
``` OpenFileDialog open = new OpenFileDialog() { Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg" }; if (open.ShowDialog() == DialogResult.OK) { PictureBoxObjectName.Image = Image.FromFile(open.FileName); } ```
20,303,761
on buttonclick I'm taking image from file system and save into database, everything is ok but I want when I select image to display that image into pictureBox1 ``` OpenFileDialog open = new OpenFileDialog() { Filter = "Image Files(*.jpeg;*.bmp;*.png;*.jpg)|*.jpeg;*.bmp;*.png;*.jpg" }; if (open.ShowDialog() == Dial...
2013/11/30
[ "https://Stackoverflow.com/questions/20303761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2783193/" ]
You can use `Image` property to set the Image for `PictureBox` Control. Try This: ``` DialogResult result= openFileDialog1.ShowDialog(); if(result==DialogResult.OK) pictureBox1.Image =new Bitmap(openFileDialog1.FileName); ``` if you want to add it in your code **Complete Code:** ``` ...
``` openFileDialog1.Multiselect = false; openFileDialog1.Filter= "jpg files (*.jpg)|*.jpg"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { foreach (String file in openFileDialog1.FileNames) { picturebox1.Image = Image.FromFile(File); } } ``` This is for selection of one imag...
15,105,115
I have made a site where user login with google,where a popup window opens for login,when user click the submit button,the popup window close & user redirect to another page. I have done the code but it works fine in FF bt not working in chrome This is my code,can anyone plz suggest what changes I need to do so that ...
2013/02/27
[ "https://Stackoverflow.com/questions/15105115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2024872/" ]
i believe window.close() is not working in chrome for you. Once i faced the problem i fixed the problem using replace window.close(); with the code below ``` window.open('', '_self', ''); //simple bug fix window.close(); ``` Also try putting the this ``` echo '<script>window.opener.location.href="index2.php"</scri...
Please try with below any one of the option echo('opener.window.location.reload(true); window.close();'); or echo('window.opener.location.reload(false); window.close();'); if still problem exist let me know
26,843,336
The below code works fine but when I place mouse on the parent window and drag it, the child and parent window gets separted. But I want that child and parent window moves together and not get separated, when I place mouse and move it. I tried some stuffs like WS\_DISABLED for child window but it did not worked. please...
2014/11/10
[ "https://Stackoverflow.com/questions/26843336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4235448/" ]
The `hMenu` parameter for [CreateWindowEx](http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680.aspx) is overloaded, and has two distinct meanings depending on the `dwStyle` parameter. Here are the important pieces of information from the documentation: > > For an overlapped or pop-up window, *hMenu* iden...
Maybe you need WS\_CHILD style for hwndPB... WS\_POPUP means that "child" window is simply disabling the parent, and they are not moved together. BTW, "non MFC" is also known as Win32 app.
20,129,132
The URL is: <http://robjhyndman.com/tsdldata/data/cryer2.dat> This is what i need to achieve: ``` '''(str) -> reader Open the URL url, read past the three-line header, and return the open reader.''' ``` This is what i tried: ``` list1=[] f=urllib.request.urlopen('http://robjhyndman.com/tsdldata/data/cryer2.dat')...
2013/11/21
[ "https://Stackoverflow.com/questions/20129132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3018826/" ]
`isdigit` returns `False` for all items in `datasplit` except '1964', because the numbers are `float` values (containing a `.`), not `int`. `isdigit` only checks for numbers. Also, you probably don't want to add the whole `datasplit` list to your result, only the actual item. You could skip the first two lines (using...
As written, you are looking to see if, for any element in the list `datasplit`, that element is composed of nothing but digits. If that is the case, then you are appending the entirety of `datasplit` into `list1`. The only element which is all digits is '1964', so you get one copy of the whole list appended, and that's...
20,129,132
The URL is: <http://robjhyndman.com/tsdldata/data/cryer2.dat> This is what i need to achieve: ``` '''(str) -> reader Open the URL url, read past the three-line header, and return the open reader.''' ``` This is what i tried: ``` list1=[] f=urllib.request.urlopen('http://robjhyndman.com/tsdldata/data/cryer2.dat')...
2013/11/21
[ "https://Stackoverflow.com/questions/20129132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3018826/" ]
`isdigit` returns `False` for all items in `datasplit` except '1964', because the numbers are `float` values (containing a `.`), not `int`. `isdigit` only checks for numbers. Also, you probably don't want to add the whole `datasplit` list to your result, only the actual item. You could skip the first two lines (using...
In general, if there's a simple way to describe the format, it's clearer to parse in terms of that format than to ignore it and try to recover the information in some other way. And the format here is trivial: It's got 3 header lines that you want to ignore, and then it's got a table as whitespace-separated CSV (or, if...
6,697,847
I've got a need to display Office documents in a browser-based Silverlight application. The solution that I've got in place right now involves using Office Automation to convert the various Office docs to XPS, and then displaying the resulting XPS files in Silverlight with the [FirstFloor Document Toolkit for Silverlig...
2011/07/14
[ "https://Stackoverflow.com/questions/6697847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68231/" ]
I think you have two choices: at runtime, or using static analysis. **At runtime** You will be able to hook into your tests at runtime using JUnit's [RunListener](http://api.dpml.net/junit/4.2/org/junit/runner/notification/RunListener.html) (TestNG has a similar abstraction), but how could you tell when assertions ar...
I'd say your best bet would be a regex search or some kind of static analysis. Whichever, it has to be able to identify test methods and determine whether they contain an assertion, where an assertion is some assert\* call, a mock verification, and/or an "expected exception" clause at the very least. All of those const...
6,697,847
I've got a need to display Office documents in a browser-based Silverlight application. The solution that I've got in place right now involves using Office Automation to convert the various Office docs to XPS, and then displaying the resulting XPS files in Silverlight with the [FirstFloor Document Toolkit for Silverlig...
2011/07/14
[ "https://Stackoverflow.com/questions/6697847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68231/" ]
Simpler approach could have been been JUnit and TestNG supporting assert counter which can print not just the number of tests but also asserts used in the test methods. I have written a wrapper for Assert class which overrides all the methods and has a counter.. You could also try to use IntelliJ's Structured Search ...
I'd say your best bet would be a regex search or some kind of static analysis. Whichever, it has to be able to identify test methods and determine whether they contain an assertion, where an assertion is some assert\* call, a mock verification, and/or an "expected exception" clause at the very least. All of those const...
6,697,847
I've got a need to display Office documents in a browser-based Silverlight application. The solution that I've got in place right now involves using Office Automation to convert the various Office docs to XPS, and then displaying the resulting XPS files in Silverlight with the [FirstFloor Document Toolkit for Silverlig...
2011/07/14
[ "https://Stackoverflow.com/questions/6697847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68231/" ]
I think you have two choices: at runtime, or using static analysis. **At runtime** You will be able to hook into your tests at runtime using JUnit's [RunListener](http://api.dpml.net/junit/4.2/org/junit/runner/notification/RunListener.html) (TestNG has a similar abstraction), but how could you tell when assertions ar...
Simpler approach could have been been JUnit and TestNG supporting assert counter which can print not just the number of tests but also asserts used in the test methods. I have written a wrapper for Assert class which overrides all the methods and has a counter.. You could also try to use IntelliJ's Structured Search ...
52,147,748
I've got two components: button and progress bar. I would like to render the progress bar instead of the button once the button is clicked. Click is handled correctly, when I place the alert before the return it is displayed. Progress bar itself is rendered correctly as well. So it's only a problem with rendering it on...
2018/09/03
[ "https://Stackoverflow.com/questions/52147748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3449093/" ]
Returning a JSX from a function would not magically render it! You need to somehow put that JSX somewhere in the `render` function. Here is one way to do so: ``` class ProgressButton extends React.Component { constructor() { super(); this.state = { showBar: false, }; this.handleClick = this.ha...
React will only render what's in the render functions, the fact that some random function happen to return a component has no impact as long as that component isn't a part of some component's render function. You could solve this instead by having some state that determines if the Bar should render or not, and togglin...
52,147,748
I've got two components: button and progress bar. I would like to render the progress bar instead of the button once the button is clicked. Click is handled correctly, when I place the alert before the return it is displayed. Progress bar itself is rendered correctly as well. So it's only a problem with rendering it on...
2018/09/03
[ "https://Stackoverflow.com/questions/52147748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3449093/" ]
React will only render what's in the render functions, the fact that some random function happen to return a component has no impact as long as that component isn't a part of some component's render function. You could solve this instead by having some state that determines if the Bar should render or not, and togglin...
That just won't work. You could try something like this ``` class ProgressButton extends React.Component { constructor () { super() this.state = { showBar : false; } } handleClick = () => { this.setState({showBar: true}); } render () { var { showBar } = this.state; return ...
52,147,748
I've got two components: button and progress bar. I would like to render the progress bar instead of the button once the button is clicked. Click is handled correctly, when I place the alert before the return it is displayed. Progress bar itself is rendered correctly as well. So it's only a problem with rendering it on...
2018/09/03
[ "https://Stackoverflow.com/questions/52147748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3449093/" ]
Returning a JSX from a function would not magically render it! You need to somehow put that JSX somewhere in the `render` function. Here is one way to do so: ``` class ProgressButton extends React.Component { constructor() { super(); this.state = { showBar: false, }; this.handleClick = this.ha...
You cannot update a view like this and it is against the rules. (As I am also a new ReactJS developer I have ongoing experience.) 1. Use a conditional render. For example <https://reactjs.org/docs/conditional-rendering.html> 2. Use a modal with the progress bar and display it on the button click action.
52,147,748
I've got two components: button and progress bar. I would like to render the progress bar instead of the button once the button is clicked. Click is handled correctly, when I place the alert before the return it is displayed. Progress bar itself is rendered correctly as well. So it's only a problem with rendering it on...
2018/09/03
[ "https://Stackoverflow.com/questions/52147748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3449093/" ]
Returning a JSX from a function would not magically render it! You need to somehow put that JSX somewhere in the `render` function. Here is one way to do so: ``` class ProgressButton extends React.Component { constructor() { super(); this.state = { showBar: false, }; this.handleClick = this.ha...
That just won't work. You could try something like this ``` class ProgressButton extends React.Component { constructor () { super() this.state = { showBar : false; } } handleClick = () => { this.setState({showBar: true}); } render () { var { showBar } = this.state; return ...
52,147,748
I've got two components: button and progress bar. I would like to render the progress bar instead of the button once the button is clicked. Click is handled correctly, when I place the alert before the return it is displayed. Progress bar itself is rendered correctly as well. So it's only a problem with rendering it on...
2018/09/03
[ "https://Stackoverflow.com/questions/52147748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3449093/" ]
Returning a JSX from a function would not magically render it! You need to somehow put that JSX somewhere in the `render` function. Here is one way to do so: ``` class ProgressButton extends React.Component { constructor() { super(); this.state = { showBar: false, }; this.handleClick = this.ha...
You cannot return components from normal functions,you can do the following way to render the progressbar ``` class ProgressButton extends React.Component { constructor () { super() this.handleClick = this.handleClick.bind(this); this.state = {openBar:false} } handleClick () { this.setState({ope...
52,147,748
I've got two components: button and progress bar. I would like to render the progress bar instead of the button once the button is clicked. Click is handled correctly, when I place the alert before the return it is displayed. Progress bar itself is rendered correctly as well. So it's only a problem with rendering it on...
2018/09/03
[ "https://Stackoverflow.com/questions/52147748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3449093/" ]
You cannot update a view like this and it is against the rules. (As I am also a new ReactJS developer I have ongoing experience.) 1. Use a conditional render. For example <https://reactjs.org/docs/conditional-rendering.html> 2. Use a modal with the progress bar and display it on the button click action.
That just won't work. You could try something like this ``` class ProgressButton extends React.Component { constructor () { super() this.state = { showBar : false; } } handleClick = () => { this.setState({showBar: true}); } render () { var { showBar } = this.state; return ...
52,147,748
I've got two components: button and progress bar. I would like to render the progress bar instead of the button once the button is clicked. Click is handled correctly, when I place the alert before the return it is displayed. Progress bar itself is rendered correctly as well. So it's only a problem with rendering it on...
2018/09/03
[ "https://Stackoverflow.com/questions/52147748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3449093/" ]
You cannot return components from normal functions,you can do the following way to render the progressbar ``` class ProgressButton extends React.Component { constructor () { super() this.handleClick = this.handleClick.bind(this); this.state = {openBar:false} } handleClick () { this.setState({ope...
That just won't work. You could try something like this ``` class ProgressButton extends React.Component { constructor () { super() this.state = { showBar : false; } } handleClick = () => { this.setState({showBar: true}); } render () { var { showBar } = this.state; return ...
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
It's simply not allowed by [the grammar](http://docs.python.org/reference/grammar.html). The relevant productions are: ``` for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT ``` As you can see, after a `for` you can either put a simple statement or a ...
try something like : ``` In [14]: from __future__ import print_function In [17]: for x in xrange(10): print (x,'is even') if x%2==0 else None ....: 0 is even 2 is even 4 is even 6 is even 8 is even ```
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
From the [formal grammar for 2.7](http://docs.python.org/reference/grammar.html): ``` compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else'...
try something like : ``` In [14]: from __future__ import print_function In [17]: for x in xrange(10): print (x,'is even') if x%2==0 else None ....: 0 is even 2 is even 4 is even 6 is even 8 is even ```
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
It's simply not allowed by [the grammar](http://docs.python.org/reference/grammar.html). The relevant productions are: ``` for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT ``` As you can see, after a `for` you can either put a simple statement or a ...
You can try this: ``` for y in (x for x in xrange(10) if x % 2 == 0): print y ```
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
It's simply not allowed by [the grammar](http://docs.python.org/reference/grammar.html). The relevant productions are: ``` for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT ``` As you can see, after a `for` you can either put a simple statement or a ...
If you want something similar, use a list comprehension: ``` print '\n'.join('{0} is even'.format(x) for x in xrange(10) if x % 2 == 0) ``` Prints: ``` 0 is even 2 is even 4 is even 6 is even 8 is even ```
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
It's simply not allowed by [the grammar](http://docs.python.org/reference/grammar.html). The relevant productions are: ``` for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT ``` As you can see, after a `for` you can either put a simple statement or a ...
The Python docs about [compound statements](http://docs.python.org/2/reference/compound_stmts.html) states a ***reason*** for the *decision* on **why** does *the grammar disallow this*: > > A suite can be one or more semicolon-separated simple statements on > the same line as the header, following the header’s colon...
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
From the [formal grammar for 2.7](http://docs.python.org/reference/grammar.html): ``` compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else'...
You can try this: ``` for y in (x for x in xrange(10) if x % 2 == 0): print y ```
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
From the [formal grammar for 2.7](http://docs.python.org/reference/grammar.html): ``` compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else'...
If you want something similar, use a list comprehension: ``` print '\n'.join('{0} is even'.format(x) for x in xrange(10) if x % 2 == 0) ``` Prints: ``` 0 is even 2 is even 4 is even 6 is even 8 is even ```
12,941,105
I have been trying to convert a simple execution such as: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` to a one liner version: ``` for x in xrange(10): if x % 2 == 0: print x, 'is even' ``` which gives me: ``` File "foo.py", line 1 for x in xrange(10): if x % 2 == 0: print x, ...
2012/10/17
[ "https://Stackoverflow.com/questions/12941105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385119/" ]
From the [formal grammar for 2.7](http://docs.python.org/reference/grammar.html): ``` compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else'...
The Python docs about [compound statements](http://docs.python.org/2/reference/compound_stmts.html) states a ***reason*** for the *decision* on **why** does *the grammar disallow this*: > > A suite can be one or more semicolon-separated simple statements on > the same line as the header, following the header’s colon...
44,701,477
Well, I did some research before asking this question. I thought this is very straight forward as this common scenario. This is my anchor tag. ``` <a [routerLink]="['./product', 1]">Vitamins</a> ``` When use click on that I am getting data by passing the Id to Web API. After getting data, the Url shows up as <h...
2017/06/22
[ "https://Stackoverflow.com/questions/44701477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4218929/" ]
Try using Location object. ``` import { Location } from '@angular/common'; constructor(public location: Location) {} ``` And when you want to update the window URL without redirecting or navigating with router object, put this: ``` this.location.go('vitamins'); ``` This should write 'vitamins' after your base ur...
I probably would just link to `<a [routerLink]="'/product'">Vitamins</a>`. Make it optional and handle this case in your component or service (if no `id` is passed, set it to `1`) In other cases you probably want the url to look like `http://myexample.com/vitamins/2` otherwise a direct link wouldn't be possible (or ho...
1,666,684
I use Debian/testing Linux on my multiple machines. For security reasons, I always install it on an encrypted LVM. Typically I use the ext4 filesystems with size 1TB to 3TB. Unfortunately, it creates certain very nasty side-effects. When I perform a filesystem-intensive operations (e.g. compiling of a few students' B...
2021/07/30
[ "https://superuser.com/questions/1666684", "https://superuser.com", "https://superuser.com/users/736373/" ]
I have found the similar problem described in <https://askubuntu.com/questions/1406444/what-is-causing-my-system-to-stall-freeze-corrupt-data-when-using-lvm-luks> . One of modifications described here has eliminated freezing the system at massive writes. ``` cryptsetup --perf-no_write_workqueue refresh name_of_the_m...
It seems that the problem may be related (as found in the comments) with lack of entropy in the system. That explains why the problem occures in systems with encrypted LVM. The true random bytes are needed for encryption of the written data. I have installed the `rng-tools5`, and `haveged` (as @michalng suggests, than...
44,028,828
In my database, my text is stored like this : ``` {"en":"My super title is fantastic"} ``` I do a foreach for get the value ``` foreach ($queries as $query) { $results[] = ['slug' => $query->slug, 'value' => $query->title]; } ``` But, the result is : ``` {"en":"My super title is fantastic"} ``` An...
2017/05/17
[ "https://Stackoverflow.com/questions/44028828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7550182/" ]
I need the JSON because I retrieve it in Javascript after – Jeremy 22 hours ago so you use json\_decode(); and then json\_encode();
You can use [json\_decode](http://php.net/manual/en/function.json-decode.php), example: ``` $yourvar = '{"en":"My super title is fantastic"}'; $array = json_decode($yourvar, true); echo current($array); // is what you need ```
6,530,733
I am moving a UIButton using the ``` animateWithDuration:delay:option:animations:completion ``` method. Now, I want it to stop moving when it passes over a specific point. How do I do that? Any insights appreciated!
2011/06/30
[ "https://Stackoverflow.com/questions/6530733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/783853/" ]
``` >>> text = """Hello, this is the first sentence. This is the second. And this may or may not be the third. Am I right? No? lol...""" >>> import re >>> s = re.split(r'[.?!:]+', text) >>> def search(word, sentences): return [i for i in sentences if re.search(r'\b%s\b' % word, i)] >>> search('is', s) ['Hello...
That's how you can simply do it in shell. You should write it in script yourself. ``` >>> text = '''this is sentence 1. and that is sentence 2. and sometimes sentences are good. when that's sentence 4, there's a good reason. and that's sentence 5.''' >>> for line in text.spli...
6,530,733
I am moving a UIButton using the ``` animateWithDuration:delay:option:animations:completion ``` method. Now, I want it to stop moving when it passes over a specific point. How do I do that? Any insights appreciated!
2011/06/30
[ "https://Stackoverflow.com/questions/6530733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/783853/" ]
``` >>> text = """Hello, this is the first sentence. This is the second. And this may or may not be the third. Am I right? No? lol...""" >>> import re >>> s = re.split(r'[.?!:]+', text) >>> def search(word, sentences): return [i for i in sentences if re.search(r'\b%s\b' % word, i)] >>> search('is', s) ['Hello...
I don't have much experience with this but you might be looking for [`nltk`](http://www.nltk.org/). Try [this](http://nltk.googlecode.com/svn/trunk/doc/api/nltk.tokenize.punkt.PunktSentenceTokenizer-class.html); use `span_tokenize` and find which span the index of your word falls under, then look that sentence up.
6,530,733
I am moving a UIButton using the ``` animateWithDuration:delay:option:animations:completion ``` method. Now, I want it to stop moving when it passes over a specific point. How do I do that? Any insights appreciated!
2011/06/30
[ "https://Stackoverflow.com/questions/6530733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/783853/" ]
``` >>> text = """Hello, this is the first sentence. This is the second. And this may or may not be the third. Am I right? No? lol...""" >>> import re >>> s = re.split(r'[.?!:]+', text) >>> def search(word, sentences): return [i for i in sentences if re.search(r'\b%s\b' % word, i)] >>> search('is', s) ['Hello...
use grep or egrep commands with subprocess module of python, it may help you. e.g: ``` from subprocess import Popen, PIPE stdout = Popen("grep 'word1' document.txt", shell=True, stdout=PIPE).stdout #to search 2 different words: stdout = Popen("egrep 'word1|word2' document.txt", #shell=True, #stdout=PIPE).stdo...
4,414,382
> > Let $A \to B$ a finite algebra, i.e., $B$ is finitely generated as $A$-module. If $S \subseteq B$ is a multiplicative subset, then $S^{-1}B$ is also finite $A$-algebra? > > > If not, how about $A=K$ a field and $S=\{1,b,b^2,\cdots\}$ for some $ 0 \neq b \in B$? (In this special case I guess it is true and ask...
2022/03/28
[ "https://math.stackexchange.com/questions/4414382", "https://math.stackexchange.com", "https://math.stackexchange.com/users/526708/" ]
I think this seldom happens. Let $B$ be a finite $A$-algebra and $b\in B$. If $x\_1,\dotsc,x\_n\in B$ generate $B$ as an $A$-module and $B[1/b]$ is a finitely generated $A$-module, then there is a $d\ge0$, such that $x\_1,\dotsc,x\_n,\frac{x\_1}{b},\dotsc,\frac{x\_n}{b},\dotsc,\frac{x\_1}{b^d},\dotsc,\frac{x\_n}{b^d}\i...
If $B$ is a finite dimensional $K$-algebra and $b\in B$ then let $g\in K[x]$ be its minimal polynomial, write $g = x^r f\in K[x]$ with $f(0)\ne 0$, show that $f(b)\in \ker(B\to B[b^{-1}])$ and that $b\in B/(f(b))^\times$, whence $B[b^{-1}]=B/(f(b))$ and $\dim\_K S^{-1} B\le \dim\_K B$.
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
this should work ``` function getSecondPart(str) { return str.split(':')[1]; } ```
try ``` 'string'.includes(':') ``` you can check if the symbol or letter is in the word by includes in the words
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
this should work ``` function getSecondPart(str) { return str.split(':')[1]; } ```
As a last resort you have also the regular expression route to extract the value following semicolons preceded by a label: ```js const subject = "example: myresult"; const re = /^.+?\: (.+)$/im; const match = re.exec(subject); let result = ""; if (match !== null) { result = match[1]; } console.log(result); ```
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
this should work ``` function getSecondPart(str) { return str.split(':')[1]; } ```
Assuming the ": " is always consistent this should work for you: ```js var myresult = "example: myresult"; console.log(myresult.split(': ')[1]); ```
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
use `string.includes(searchString, position)`, that have a second param of position to start the search. > > [position Optional](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#parameters) > The position within the string at which to begin searching for searchString. (...
try ``` 'string'.includes(':') ``` you can check if the symbol or letter is in the word by includes in the words
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
As a last resort you have also the regular expression route to extract the value following semicolons preceded by a label: ```js const subject = "example: myresult"; const re = /^.+?\: (.+)$/im; const match = re.exec(subject); let result = ""; if (match !== null) { result = match[1]; } console.log(result); ```
try ``` 'string'.includes(':') ``` you can check if the symbol or letter is in the word by includes in the words
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
Assuming the ": " is always consistent this should work for you: ```js var myresult = "example: myresult"; console.log(myresult.split(': ')[1]); ```
try ``` 'string'.includes(':') ``` you can check if the symbol or letter is in the word by includes in the words
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
use `string.includes(searchString, position)`, that have a second param of position to start the search. > > [position Optional](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#parameters) > The position within the string at which to begin searching for searchString. (...
As a last resort you have also the regular expression route to extract the value following semicolons preceded by a label: ```js const subject = "example: myresult"; const re = /^.+?\: (.+)$/im; const match = re.exec(subject); let result = ""; if (match !== null) { result = match[1]; } console.log(result); ```
74,388,085
I've this: ``` "example: myresult" ``` And I need a method that looks for this from ": " ``` "myresult" ``` I tried with String.search()
2022/11/10
[ "https://Stackoverflow.com/questions/74388085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20439814/" ]
use `string.includes(searchString, position)`, that have a second param of position to start the search. > > [position Optional](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#parameters) > The position within the string at which to begin searching for searchString. (...
Assuming the ": " is always consistent this should work for you: ```js var myresult = "example: myresult"; console.log(myresult.split(': ')[1]); ```
31,999,583
I got a table working in html with filters but I still have problem: 1. I'm trying to have multiple filters working at once, i trying to have it shows the quest type aswell as if has or has not been completed 2. I am unable to get the completed quest filter to work I have added a checkbox filter to add a class to the ...
2015/08/13
[ "https://Stackoverflow.com/questions/31999583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5219526/" ]
Here you had all figured out just I added this one `if ($(this).hasClass(c))` instead of `if ($(this).attr("class") == c)` Refer snippet ```js $(function(){// Filter Row Script Type of Quest // ........................................ $('.filterMenu a').on('click', function (e) { e.preventDefault(); var c...
I know you already accepted, but I modified your code a bit, and came up with a working method of using both filters in combination. Here's the HTML I changed (I really only modified the list anchors in both filters, so they have the attribute of filterVal instead of class): ``` <div class="filterMenuCompleted"> <...
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
I have changed the identation. In my opinion this reads better: ``` string script = @"<script type='text/javascript'> alert('Booking Complete! Thank you for choosing Euro-City-Tours'); window.location.href = ""http://stackoverflow.com""; </script>"; ClientScript.Registe...
Add the redirect after the `alert()`, the script will halt until the alert is clicked away: ``` alert('Hello!'); window.location = 'somewhere.html'; ```
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
I have changed the identation. In my opinion this reads better: ``` string script = @"<script type='text/javascript'> alert('Booking Complete! Thank you for choosing Euro-City-Tours'); window.location.href = ""http://stackoverflow.com""; </script>"; ClientScript.Registe...
Just a simple ``` window.location.href = "/Home"; ``` does the tricks
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
You should do this, because alert is a dialog, and execute the code after it close. ``` string script = "<script type=\"text/javascript\"> alert('Booking Complete! Thank you for choosing Euro-City-Tours'); window.location.replace('my home page url'); </script>"; ```
Add the redirect after the `alert()`, the script will halt until the alert is clicked away: ``` alert('Hello!'); window.location = 'somewhere.html'; ```
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
To redirect to another page, you can use: window.location = "<http://www.yoururl.com>"; Thanks.,
You could try the `confirm` function provided it is an alert box. What happens here is `window.location` will redirect your current page to the specified url ``` var clickedBtn=confirm("Alert box"); if (clickedBtn==true) { //pressed ok. Redirect to url window.location = "http://www.yoururl.com"; } else { //press...
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
You should do this, because alert is a dialog, and execute the code after it close. ``` string script = "<script type=\"text/javascript\"> alert('Booking Complete! Thank you for choosing Euro-City-Tours'); window.location.replace('my home page url'); </script>"; ```
You could try the `confirm` function provided it is an alert box. What happens here is `window.location` will redirect your current page to the specified url ``` var clickedBtn=confirm("Alert box"); if (clickedBtn==true) { //pressed ok. Redirect to url window.location = "http://www.yoururl.com"; } else { //press...
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
You could try the `confirm` function provided it is an alert box. What happens here is `window.location` will redirect your current page to the specified url ``` var clickedBtn=confirm("Alert box"); if (clickedBtn==true) { //pressed ok. Redirect to url window.location = "http://www.yoururl.com"; } else { //press...
Just a simple ``` window.location.href = "/Home"; ``` does the tricks
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
You should do this, because alert is a dialog, and execute the code after it close. ``` string script = "<script type=\"text/javascript\"> alert('Booking Complete! Thank you for choosing Euro-City-Tours'); window.location.replace('my home page url'); </script>"; ```
Just a simple ``` window.location.href = "/Home"; ``` does the tricks
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
just to make it a little fancy and to give the user a chance to read and close the alert before redirecting. ``` var delay = 5000; setTimeout(function () { window.location.href = "/Home/Index"; }, delay); alert("You will be redirected to Home Page after 5 seconds"); ``` the alert will ex...
Just a simple ``` window.location.href = "/Home"; ``` does the tricks
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
Add the redirect after the `alert()`, the script will halt until the alert is clicked away: ``` alert('Hello!'); window.location = 'somewhere.html'; ```
Just a simple ``` window.location.href = "/Home"; ``` does the tricks
43,892,007
I am trying to split a single string into array or JSON format. Kindly help in doing that in angular js controller (not in HTML view). The string format is like, ``` string="Name1;Email1;ID1~Name2;Email2;ID2" ``` None of the ways I tried worked. I tried using string.split('~') but I am getting an error as split is ...
2017/05/10
[ "https://Stackoverflow.com/questions/43892007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7924465/" ]
I have changed the identation. In my opinion this reads better: ``` string script = @"<script type='text/javascript'> alert('Booking Complete! Thank you for choosing Euro-City-Tours'); window.location.href = ""http://stackoverflow.com""; </script>"; ClientScript.Registe...
You could try the `confirm` function provided it is an alert box. What happens here is `window.location` will redirect your current page to the specified url ``` var clickedBtn=confirm("Alert box"); if (clickedBtn==true) { //pressed ok. Redirect to url window.location = "http://www.yoururl.com"; } else { //press...
73,218,380
I am trying to use subprocess module in python3 to fetch output of shell command in MacOS. command I am using: ``` read_key = ["binary", "arg1", "arg2", "arg3"] proc = subprocess.Popen(read_key, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ``` Different output I got. ``` >>> proc.communicate() (b'M...
2022/08/03
[ "https://Stackoverflow.com/questions/73218380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1609952/" ]
Your output was in `bytes` format, you can decode it into `utf-8` ``` proc.communicate()[0].strip().decode('utf-8') ```
thanks to @AKH and AnhPC03 I am using below code now: ``` read_key = ["binary", "arg1", "arg2", "arg3"] proc = subprocess.Popen(read_key, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8') output = proc.communicate()[0].strip() print(output) MY_EXPECTED_OUTPUT_STRING ```
73,218,380
I am trying to use subprocess module in python3 to fetch output of shell command in MacOS. command I am using: ``` read_key = ["binary", "arg1", "arg2", "arg3"] proc = subprocess.Popen(read_key, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ``` Different output I got. ``` >>> proc.communicate() (b'M...
2022/08/03
[ "https://Stackoverflow.com/questions/73218380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1609952/" ]
By default, `subprocess.Popen` treats the output streams as binary (so you get `bytes`, hence `b'...'`). (The subprocess could print out e.g. an image, which is binary data, and you wouldn't want that to be mangled.) You can add the `encoding` parameter to have `subprocess.Popen` decode everything for you: ``` proc =...
thanks to @AKH and AnhPC03 I am using below code now: ``` read_key = ["binary", "arg1", "arg2", "arg3"] proc = subprocess.Popen(read_key, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8') output = proc.communicate()[0].strip() print(output) MY_EXPECTED_OUTPUT_STRING ```
67,076,710
Is a bundler such as rollup needed when creating a react component library? I.e. if all I have is a simple project with Buttons/Checkboxes etc. as typescript files which are then published on npm, doesn’t running tsc with a proper config turn all of it into a dist bundle? What is the advantage of rollup then? I read t...
2021/04/13
[ "https://Stackoverflow.com/questions/67076710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2478928/" ]
The short answer is no, a bundler is not necessarily needed. A bundler is a handy tool that can do a lot of the gruntwork of transpiling and moving files around for you. In your case, if you have a simple group of ts or tsx files, and you simply want to transpile them to js on a 1 to 1 basis (1 new js file for every t...
You would use rollup for wider compatibility. Bundlers are useful when using JavaScript features not yet implemented universally because they simplify adding build tools that can polyfill/transpile modern features and syntax to comply with the current implemented web standards. Since you are publishing a library inste...
28,555,114
I have a string must begin with a letter, consist of letters, numbers, periods and minus, but only end with letters or numbers; the minimum length of - one character, maximum - 20. Here I wrote test lines where last must be ignored: ``` abcAA123.-as a aa aA a1 a1a a.a a-s ad.a1 ads.a a-12 A-j A.b A.....-bg v--.1.2.3.a...
2015/02/17
[ "https://Stackoverflow.com/questions/28555114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1708960/" ]
You need to use lookarounds. ``` ^(?=.*[A-Za-z0-9]$)[A-Za-z][A-Za-z\d.-]{0,19}$ ``` [DEMO](https://regex101.com/r/uN4lT5/6) * `(?=.*[A-Za-z0-9]$)` Asserts that the match must ends with a letter or digit. * `[A-Za-z]` Must starts with a letter. * `[A-Za-z\d.-]{0,19}` matches the chars according to the pattern presen...
Your Regex matches only strings with at least 2 characters. The `?` in the part `(\w|\.|\-)+?` makes the quantifier lazy which means it matches as few as possible but the `+` quantifier matches at least one character. You should replace the `+` with a `*` if you want that part to match at least none. Edit: I've notice...
28,555,114
I have a string must begin with a letter, consist of letters, numbers, periods and minus, but only end with letters or numbers; the minimum length of - one character, maximum - 20. Here I wrote test lines where last must be ignored: ``` abcAA123.-as a aa aA a1 a1a a.a a-s ad.a1 ads.a a-12 A-j A.b A.....-bg v--.1.2.3.a...
2015/02/17
[ "https://Stackoverflow.com/questions/28555114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1708960/" ]
You need to use lookarounds. ``` ^(?=.*[A-Za-z0-9]$)[A-Za-z][A-Za-z\d.-]{0,19}$ ``` [DEMO](https://regex101.com/r/uN4lT5/6) * `(?=.*[A-Za-z0-9]$)` Asserts that the match must ends with a letter or digit. * `[A-Za-z]` Must starts with a letter. * `[A-Za-z\d.-]{0,19}` matches the chars according to the pattern presen...
``` ^[\w.-]{0,19}[0-9a-zA-Z]$ ``` Simply use this and you are good to go.Your currect regex does not work as it reuqires at least 2 cahracter.See demo. <https://www.regex101.com/r/rK5lU1/40>