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
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...
The actual regexp is ``` [a-z]?(.|\-)+(\w+|\b) ``` It wouldn't match `a` because it has a word ending character immediatly after it. its matched by `\b` <http://rubular.com/r/eP8D6pmCnQ>
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/" ]
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...
``` ^[\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>
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/" ]
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...
The actual regexp is ``` [a-z]?(.|\-)+(\w+|\b) ``` It wouldn't match `a` because it has a word ending character immediatly after it. its matched by `\b` <http://rubular.com/r/eP8D6pmCnQ>
39,201,431
I want to adjust the images with their respective texts below each image. There are four images in one line. and other four in second line. when I remove the any image from **first line** , then from the **second line** , first image should be placed to the last of the **first line**. just like **Queue** ```html ...
2016/08/29
[ "https://Stackoverflow.com/questions/39201431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
A simple `for` loop would be appropriate in this case: ``` for (int i = 0 ; i < iv.length ; ++i) { int resourceId = this.getResources().getIdentifier("iv" + i, "id", this.getPackageName()); iv[i] = (ImageView) findViewById(resourceId); } ``` But optimise your code. Use a `RecyclerView` And show your images i...
Dont do that! because of wasting time and performance problem. you can use listView or grid view to show 80 images.
33,077,507
went on NPMJS but could't find any libraries useful. It looks like nearly all of them requires it first to be stored on the server then upload to S3. Any chance the file can be uploaded directly to S3?
2015/10/12
[ "https://Stackoverflow.com/questions/33077507", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5435999/" ]
You missed 1 step, you are actually getting a map (key-value pair), using this map get `company name` ``` public static void main(String[] args) throws JSONException { String domainRequest = "{\"companyName\":{\"Company Name:\":\"kjh\",\"Address 1:\":\"kjhhkh\",\"Address 2:\":\"hkjhkj\",\"Address 3:\":\"hkjhhk...
It is weird your json format. You should be check it out. Remove colon from children property name. ``` String json = "{\"companyName\" : {\n" + " \"Company Name:\":\"kjh\",\n" + " \"Address 1:\":\"kjhhkh\",\n" + " \"Address 2:\":\"...
637,133
I have found a very useful script [here](http://jpsoft.com/forums/threads/processing-command-line-options-parameters-in-a-batch-file.131/) that will parse in arguments to a batch file and process them as follows: ``` BatchFile.btm /a /b:22 /longopt Parm1 Parm2 /quotedArg:"long quoted arg" - OPTION_a will equal 1. ...
2013/08/27
[ "https://superuser.com/questions/637133", "https://superuser.com", "https://superuser.com/users/222559/" ]
I have managed to translate the majority of this script to work in a Windows 7 batch file. I have not tested this against any other version of Windows. This program scans the command line sent to it and sets various environment variables that coorespond to the settings. It sets an OPTION\_arg variable for each arg o...
`%*` for every parameter. You might also find these useful: `%0` - the command used to call the batch file (could be `foo`, `..\foo`, `c:\bats\foo`, etc.) `%1` is the first command line parameter, `%2` is the second command line parameter, and so on till `%9` (and `SHIFT` can be used for those after the 9th)....
637,133
I have found a very useful script [here](http://jpsoft.com/forums/threads/processing-command-line-options-parameters-in-a-batch-file.131/) that will parse in arguments to a batch file and process them as follows: ``` BatchFile.btm /a /b:22 /longopt Parm1 Parm2 /quotedArg:"long quoted arg" - OPTION_a will equal 1. ...
2013/08/27
[ "https://superuser.com/questions/637133", "https://superuser.com", "https://superuser.com/users/222559/" ]
`%*` for every parameter. You might also find these useful: `%0` - the command used to call the batch file (could be `foo`, `..\foo`, `c:\bats\foo`, etc.) `%1` is the first command line parameter, `%2` is the second command line parameter, and so on till `%9` (and `SHIFT` can be used for those after the 9th)....
The batch scripting language does not support functions / procedures, so its modular design is hardly mentioned, but you can implement them with the help of its setlocal [enabledelayedexpansion] / endlocal. Under this mechanism, it is not too difficult to simulate "parameter" or "argument", except for the return of arr...
637,133
I have found a very useful script [here](http://jpsoft.com/forums/threads/processing-command-line-options-parameters-in-a-batch-file.131/) that will parse in arguments to a batch file and process them as follows: ``` BatchFile.btm /a /b:22 /longopt Parm1 Parm2 /quotedArg:"long quoted arg" - OPTION_a will equal 1. ...
2013/08/27
[ "https://superuser.com/questions/637133", "https://superuser.com", "https://superuser.com/users/222559/" ]
I have managed to translate the majority of this script to work in a Windows 7 batch file. I have not tested this against any other version of Windows. This program scans the command line sent to it and sets various environment variables that coorespond to the settings. It sets an OPTION\_arg variable for each arg o...
The batch scripting language does not support functions / procedures, so its modular design is hardly mentioned, but you can implement them with the help of its setlocal [enabledelayedexpansion] / endlocal. Under this mechanism, it is not too difficult to simulate "parameter" or "argument", except for the return of arr...
70,257,721
So I am using ChakraUI and React JS to make a project. Whenever I start the project it gives me the error, "TypeError: Cannot read properties of undefined (reading 'useSystemColorMode')". I didn't edit any global theme or anything in chakra. I just started making the navbar, designed with CSS. And when I try to run...
2021/12/07
[ "https://Stackoverflow.com/questions/70257721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13689497/" ]
So basically this is a problem with ChakraUI theme,even though I did not do anything with ChakraUI theme or whatsoever. I added theme.js file which included the following: ``` // theme.js // 1. import `extendTheme` function import { extendTheme } from "@chakra-ui/react"; // 2. Add your color mode config const config...
Once I used extendTheme instead of an object for theme the error was gone. <https://chakra-ui.com/docs/theming/customize-theme>
70,257,721
So I am using ChakraUI and React JS to make a project. Whenever I start the project it gives me the error, "TypeError: Cannot read properties of undefined (reading 'useSystemColorMode')". I didn't edit any global theme or anything in chakra. I just started making the navbar, designed with CSS. And when I try to run...
2021/12/07
[ "https://Stackoverflow.com/questions/70257721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13689497/" ]
So basically this is a problem with ChakraUI theme,even though I did not do anything with ChakraUI theme or whatsoever. I added theme.js file which included the following: ``` // theme.js // 1. import `extendTheme` function import { extendTheme } from "@chakra-ui/react"; // 2. Add your color mode config const config...
The first thing you should do is to check the name of the message type (error, success, warning) if you misspell it, the error will occure
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
While I would allow it, the rules put shields in the Armor Category, not the weapons list, and using a shield as a weapon is normally treated as an improvised melee weapon. My read of the rules would be that you cannot, as it's not listed as a weapon.
I would allow it at my table, based on your justification. Furthermore, why not? What's the downside of allowing an Eldritch Knight to bond with his shield? I don't see it breaking the game in any way, and if your character is built around using his shield as a weapon, then it would make sense that you could bond with ...
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
By strict RAW, no. Allowing it wouldn't harm your game meaningfully, however. Shields are in the armour category, and are thus not weapons. You could easily argue that you could use it as an improvised weapon, but that does not make it an actual weapon. Using improvised weapons as justification for doing this does not...
While I would allow it, the rules put shields in the Armor Category, not the weapons list, and using a shield as a weapon is normally treated as an improvised melee weapon. My read of the rules would be that you cannot, as it's not listed as a weapon.
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
While I would allow it, the rules put shields in the Armor Category, not the weapons list, and using a shield as a weapon is normally treated as an improvised melee weapon. My read of the rules would be that you cannot, as it's not listed as a weapon.
**Absolutely.** Since a shield can be used as an improvised weapon, it can be bonded. Since Crawford states that the shield would be considered a normal improvised weapon, it can qualify as such. Consider a player who has taken the Tavern Brawler feat so they are proficient with improvised weapons. This player may bo...
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
While I would allow it, the rules put shields in the Armor Category, not the weapons list, and using a shield as a weapon is normally treated as an improvised melee weapon. My read of the rules would be that you cannot, as it's not listed as a weapon.
i would think it be possible especially considering tavern brawler feat allows you to be proficient with improvised weapons thus eliminating any penaltiesand also shield master feat which allows you to useyour shield for offence( that makes it a weapon via bash or thrown). So Absolutely RAW allows for improvised weapon...
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
By strict RAW, no. Allowing it wouldn't harm your game meaningfully, however. Shields are in the armour category, and are thus not weapons. You could easily argue that you could use it as an improvised weapon, but that does not make it an actual weapon. Using improvised weapons as justification for doing this does not...
I would allow it at my table, based on your justification. Furthermore, why not? What's the downside of allowing an Eldritch Knight to bond with his shield? I don't see it breaking the game in any way, and if your character is built around using his shield as a weapon, then it would make sense that you could bond with ...
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
**Absolutely.** Since a shield can be used as an improvised weapon, it can be bonded. Since Crawford states that the shield would be considered a normal improvised weapon, it can qualify as such. Consider a player who has taken the Tavern Brawler feat so they are proficient with improvised weapons. This player may bo...
I would allow it at my table, based on your justification. Furthermore, why not? What's the downside of allowing an Eldritch Knight to bond with his shield? I don't see it breaking the game in any way, and if your character is built around using his shield as a weapon, then it would make sense that you could bond with ...
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
By strict RAW, no. Allowing it wouldn't harm your game meaningfully, however. Shields are in the armour category, and are thus not weapons. You could easily argue that you could use it as an improvised weapon, but that does not make it an actual weapon. Using improvised weapons as justification for doing this does not...
**Absolutely.** Since a shield can be used as an improvised weapon, it can be bonded. Since Crawford states that the shield would be considered a normal improvised weapon, it can qualify as such. Consider a player who has taken the Tavern Brawler feat so they are proficient with improvised weapons. This player may bo...
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
By strict RAW, no. Allowing it wouldn't harm your game meaningfully, however. Shields are in the armour category, and are thus not weapons. You could easily argue that you could use it as an improvised weapon, but that does not make it an actual weapon. Using improvised weapons as justification for doing this does not...
i would think it be possible especially considering tavern brawler feat allows you to be proficient with improvised weapons thus eliminating any penaltiesand also shield master feat which allows you to useyour shield for offence( that makes it a weapon via bash or thrown). So Absolutely RAW allows for improvised weapon...
70,721
Basically title. I'm a shield master who frequently uses his shield to slam people down prone. I want to minimize my chances of having my shield taken away from me. Jeremy Crawford states something interesting from his twitter below: > > [@dpnorton](https://twitter.com/dpnorton) If you attack with a shield, it's a n...
2015/11/04
[ "https://rpg.stackexchange.com/questions/70721", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/25690/" ]
**Absolutely.** Since a shield can be used as an improvised weapon, it can be bonded. Since Crawford states that the shield would be considered a normal improvised weapon, it can qualify as such. Consider a player who has taken the Tavern Brawler feat so they are proficient with improvised weapons. This player may bo...
i would think it be possible especially considering tavern brawler feat allows you to be proficient with improvised weapons thus eliminating any penaltiesand also shield master feat which allows you to useyour shield for offence( that makes it a weapon via bash or thrown). So Absolutely RAW allows for improvised weapon...
21,797,682
I am working on a Laravel Project with Vagrant. I access my project using this URL: localhost:8081 But recently, when I run "Vagrant up" and try to access through my browser, it says "Internal Server Error". ``` Internal Server Error The server encountered an internal error or misconfiguration and was unable to com...
2014/02/15
[ "https://Stackoverflow.com/questions/21797682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814764/" ]
I found out the solution a few weeks after I posted this. Apache on Debian/Ubuntu got updated around the time I posted this question and the doc root changed to /var/www/html instead of /var/www. So I had to change the sym link in the vagrant file to get it working.
Inspect your .htaccess or virtual host configuration. Try to remove them and access with absolute URL. If it won't help, check your php.ini file for errors.
21,797,682
I am working on a Laravel Project with Vagrant. I access my project using this URL: localhost:8081 But recently, when I run "Vagrant up" and try to access through my browser, it says "Internal Server Error". ``` Internal Server Error The server encountered an internal error or misconfiguration and was unable to com...
2014/02/15
[ "https://Stackoverflow.com/questions/21797682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814764/" ]
I found out the solution a few weeks after I posted this. Apache on Debian/Ubuntu got updated around the time I posted this question and the doc root changed to /var/www/html instead of /var/www. So I had to change the sym link in the vagrant file to get it working.
According to your error log report: > > [Sat Feb 15 11:17:47.144253 2014] [core:error] [pid 924] [client > 10.0.2.2:51189] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use > 'LimitInternalRecursion' to increase the limit if necessary. Use > 'LogLevel debug' to g...
65,831,278
I'm new to React. I'm having the next problem... At my functional component I have many states, there are 2 that have the sames fields (one is for an auxiliary operation) ``` const [fieldsToEdit, setFieldsToEdit] = useState({}); // This one get populated after the first render const [auxFields, setAuxFields] = useSta...
2021/01/21
[ "https://Stackoverflow.com/questions/65831278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11736461/" ]
You should not mutate state. Instead create a new object without modifying the previous one. ``` prevState[name] = value; return { ...prevState }; ``` The above first mutates the previous state, then returns a copy of it. Instead return a copy that contains the new value without modifying the previous state. ``` r...
``` setFieldsToEdit((prevState) => { const { name, value } = event.target; if(name === "fecha_presentacion") prevState[name] = value; else prevState[name] = Number(value); return ({ ...prevState }); ``` In prevState[name] = you mutating the state. Yo...
68,812,384
I have a table including some rows. If the row in its column is duplicate value, I don't want it. Let me exemplify. ``` ColA ColB ColC ColD 1 X Q 9 2 Y W 9 3 Z E 9 3 X R 9 3 Y T null 2 Z null null ``` I expect (ordering is negligible) ``` ColA ColB ColC C...
2021/08/17
[ "https://Stackoverflow.com/questions/68812384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4990642/" ]
I'm assuming what you meant by "function automatically invoking" is when you click on a button, you get prompted with the console.log "ex func works". Actually, that is the *intended* behaviour, because every time a React component's state gets updated (in this case, *value* changes because you clicked the + or - butto...
I really don't understand why do you need this. Shouldn't `my_value` value be based on the updated `value`? but anyway, you can do this: ``` const Counter = ({increase = f => f, decrease = f => f, value = 0}) => { const[my_value] = useState(extraFunc(value)); return ( <div> <button onClick={incre...
68,812,384
I have a table including some rows. If the row in its column is duplicate value, I don't want it. Let me exemplify. ``` ColA ColB ColC ColD 1 X Q 9 2 Y W 9 3 Z E 9 3 X R 9 3 Y T null 2 Z null null ``` I expect (ordering is negligible) ``` ColA ColB ColC C...
2021/08/17
[ "https://Stackoverflow.com/questions/68812384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4990642/" ]
I'm assuming what you meant by "function automatically invoking" is when you click on a button, you get prompted with the console.log "ex func works". Actually, that is the *intended* behaviour, because every time a React component's state gets updated (in this case, *value* changes because you clicked the + or - butto...
You can use `useEffect`, however assigning to `my_value` and then passing to the render as `{my_value}` is problematic. I will strongly recommend using a state variable for that too. ``` import {useState, useEffect} from 'react' const Counter = ({increase = f => f, decrease = f => f, value = 0}) => { const [myVa...
68,812,384
I have a table including some rows. If the row in its column is duplicate value, I don't want it. Let me exemplify. ``` ColA ColB ColC ColD 1 X Q 9 2 Y W 9 3 Z E 9 3 X R 9 3 Y T null 2 Z null null ``` I expect (ordering is negligible) ``` ColA ColB ColC C...
2021/08/17
[ "https://Stackoverflow.com/questions/68812384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4990642/" ]
I'm assuming what you meant by "function automatically invoking" is when you click on a button, you get prompted with the console.log "ex func works". Actually, that is the *intended* behaviour, because every time a React component's state gets updated (in this case, *value* changes because you clicked the + or - butto...
You can use `useEffect` Hook for this, by passing an empty array `[]` as second argument. Note: The counter will increase/decrease but Its value won't be displayed, because it is based on `extraFunc` which is executed only once. ```js const {useState, useEffect} = React; const ProfilerCheckerApp = () => { cons...
65,502,006
I am working on Flutter PWA, in the console I am not able to check the error logs (similar to android error logs) after executing the command. I tried working on VS code and Android studio How should I check the error logs while developing for Flutter PWA?
2020/12/30
[ "https://Stackoverflow.com/questions/65502006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
First of all you have to let Jackson know which subclass of your interface it should instantiate. You do it by adding `@JsonTypeInfo` and/or `@JsonSubTypes` annotations to your mix-in class. For single subclass the following would suffice: ``` @JsonTypeInfo(use = Id.NAME, defaultImpl = Level4Impl.class) public abstrac...
For adding properties to an object when that object is serialized you can use [@JsonAppend](https://fasterxml.github.io/jackson-databind/javadoc/2.8/com/fasterxml/jackson/databind/annotation/JsonAppend.html). For example: ``` @JsonAppend(attrs = {@JsonAppend.Attr(value = "nameTest")}) public class Level4Mixin {} ``` ...
65,502,006
I am working on Flutter PWA, in the console I am not able to check the error logs (similar to android error logs) after executing the command. I tried working on VS code and Android studio How should I check the error logs while developing for Flutter PWA?
2020/12/30
[ "https://Stackoverflow.com/questions/65502006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For adding properties to an object when that object is serialized you can use [@JsonAppend](https://fasterxml.github.io/jackson-databind/javadoc/2.8/com/fasterxml/jackson/databind/annotation/JsonAppend.html). For example: ``` @JsonAppend(attrs = {@JsonAppend.Attr(value = "nameTest")}) public class Level4Mixin {} ``` ...
In case you can't make it work by default (which was my case), try to modify existing `MappingJackson2HttpMessageConverter` converter, e.g. do it this way: ``` @Configuration public class WebMvcConfig implements WebMvcConfigurer { @Override public void configureMessageConverters(List<HttpMessageConverter<?>> ...
65,502,006
I am working on Flutter PWA, in the console I am not able to check the error logs (similar to android error logs) after executing the command. I tried working on VS code and Android studio How should I check the error logs while developing for Flutter PWA?
2020/12/30
[ "https://Stackoverflow.com/questions/65502006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
First of all you have to let Jackson know which subclass of your interface it should instantiate. You do it by adding `@JsonTypeInfo` and/or `@JsonSubTypes` annotations to your mix-in class. For single subclass the following would suffice: ``` @JsonTypeInfo(use = Id.NAME, defaultImpl = Level4Impl.class) public abstrac...
In case you can't make it work by default (which was my case), try to modify existing `MappingJackson2HttpMessageConverter` converter, e.g. do it this way: ``` @Configuration public class WebMvcConfig implements WebMvcConfigurer { @Override public void configureMessageConverters(List<HttpMessageConverter<?>> ...
24,736,872
In [this ng-book JSBin](http://jsbin.com/UWuLALOf/1/edit), does `$scope.$watch()` resolves to `$rootScope.$watch()` due to prototypal inheritance. Can we inject `$rootScope` explicitly inside the controller so that `$scope` would be same as `$rootScope` inside the controller, without going through prototypal inheritan...
2014/07/14
[ "https://Stackoverflow.com/questions/24736872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317018/" ]
Just inject it the same way as `$scope` or `$parse`, anything defined on $rootScope will be then accessible inside your controller. ``` app.controller('MyController', ['$scope', '$parse', '$rootScope', function($scope, $parse, $rootScope) { $rootScope.foo(); console.log($rootScope.bar); } ]); ```...
If you intend to use the `rootScope` so badly, it has a provider just as `scope` does. Including `'$rootScope'` into your controller as you do with the `'$scope'` does the trick. There's also the `$parent` attribute of the `$scope` which could come in handy, but IMO it tends to make code less maintainable if abused. I...
2,067
Among some computer users I've heard the claim that turning a computer on and off reduces the life of the computer, [here's an example of this claim](http://www.fiatforum.com/computing/74221-does-turning-your-computer-off-damage.html). In this claim, it is believed that turning the computer on and off stresses or damag...
2011/04/13
[ "https://skeptics.stackexchange.com/questions/2067", "https://skeptics.stackexchange.com", "https://skeptics.stackexchange.com/users/49/" ]
A PC has many failure modes, and it would be hard to address all of them. One of the more common is hard disk failures. Google did [an extensive study](http://labs.google.com/papers/disk_failures.pdf) and concluded that "for drives aged up to two years ... there is no significant correlation between failures and high p...
Obviously if the computer is turned off then electricity is saved (whether it is actually turned off or in standby/hibernate mode). Over time, the savings in electricity could equate to the cost of a new computer. When this intersection is reached it doesn't matter if keeping the computer on makes it last longer or not...
2,067
Among some computer users I've heard the claim that turning a computer on and off reduces the life of the computer, [here's an example of this claim](http://www.fiatforum.com/computing/74221-does-turning-your-computer-off-damage.html). In this claim, it is believed that turning the computer on and off stresses or damag...
2011/04/13
[ "https://skeptics.stackexchange.com/questions/2067", "https://skeptics.stackexchange.com", "https://skeptics.stackexchange.com/users/49/" ]
A PC has many failure modes, and it would be hard to address all of them. One of the more common is hard disk failures. Google did [an extensive study](http://labs.google.com/papers/disk_failures.pdf) and concluded that "for drives aged up to two years ... there is no significant correlation between failures and high p...
Another thing that nobody has talked about is the unstable power supply in poorer countries. In some countries (for example, [Pakistan](http://dawn.com/news/1033372/voltage-fluctuations-and-hesco)), you have frequent power cuts and/or brownouts. [Such voltage fluctuations can cause computers to fail.](http://www.natio...
13,821,542
Question about best practices / scaling of the web application. What would be the best way to access application settings on which all users rely and can not modify. Data needs to be served in JSON, application is written in PHP / JS. Have 3 ways in my mind: 1. Serve json as a php get request which will call fina...
2012/12/11
[ "https://Stackoverflow.com/questions/13821542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435719/" ]
Don't worry about speed in this case (unless you know that the wrong solution is unacceptably slow) and instead think of your requirements. This is especially true because if you are issuing server calls through a client, there's going to be a latency anyway that will likely dwarf the time for this operation. Also, th...
Taking all into consideration, php library with methods is the best solution for me. Thanks for the info though.
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
Not quite the same but close enough ... Hold two classical "tuning forks" in one hand with metal handles tightly touching. Tap the tines of one fork and it will "ring". Tap the other and it too will ring. The two are tightly joined mechanically but are isolated for frequencies that they are designed to oscillate a...
It's analogous to how broadcast radio works - just the medium is different. You can transmit and receive simultaneously on multiple different channels so long as the bandwidth of each channel is suitably constrained.
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
There are a few ways that engineers have devised to have multiple "channels" on the same medium. Consider circuit switching vs. packet switching. In a circuit switched telecom network a dedicated communications channel between two devices is established. All data is continuously transmitted while the channel is active ...
It's analogous to how broadcast radio works - just the medium is different. You can transmit and receive simultaneously on multiple different channels so long as the bandwidth of each channel is suitably constrained.
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
It's best to view this in the frequency domain rather than the time domain. Here is a basic example - two signals SIG (~1 MHz) and SIG2 (~2 MHz) are combined to form SIG+SIG2, then passed through LC filters with corresponding resonant frequencies to separate them again: Schematic: ![FreqMult](https://i.stack.imgur....
It's analogous to how broadcast radio works - just the medium is different. You can transmit and receive simultaneously on multiple different channels so long as the bandwidth of each channel is suitably constrained.
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
As long as the transmission medium is linear, ie 1v + 1v = 2v, you can have multiple transmitters sending different patterns which will linearly add in the medium, but can be sorted back out again by a receive "filter" which looks for the unique pattern of the corresponding transmitter. In conventional radio and compa...
It's analogous to how broadcast radio works - just the medium is different. You can transmit and receive simultaneously on multiple different channels so long as the bandwidth of each channel is suitably constrained.
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
There are a few ways that engineers have devised to have multiple "channels" on the same medium. Consider circuit switching vs. packet switching. In a circuit switched telecom network a dedicated communications channel between two devices is established. All data is continuously transmitted while the channel is active ...
Not quite the same but close enough ... Hold two classical "tuning forks" in one hand with metal handles tightly touching. Tap the tines of one fork and it will "ring". Tap the other and it too will ring. The two are tightly joined mechanically but are isolated for frequencies that they are designed to oscillate a...
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
It's best to view this in the frequency domain rather than the time domain. Here is a basic example - two signals SIG (~1 MHz) and SIG2 (~2 MHz) are combined to form SIG+SIG2, then passed through LC filters with corresponding resonant frequencies to separate them again: Schematic: ![FreqMult](https://i.stack.imgur....
Not quite the same but close enough ... Hold two classical "tuning forks" in one hand with metal handles tightly touching. Tap the tines of one fork and it will "ring". Tap the other and it too will ring. The two are tightly joined mechanically but are isolated for frequencies that they are designed to oscillate a...
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
As long as the transmission medium is linear, ie 1v + 1v = 2v, you can have multiple transmitters sending different patterns which will linearly add in the medium, but can be sorted back out again by a receive "filter" which looks for the unique pattern of the corresponding transmitter. In conventional radio and compa...
Not quite the same but close enough ... Hold two classical "tuning forks" in one hand with metal handles tightly touching. Tap the tines of one fork and it will "ring". Tap the other and it too will ring. The two are tightly joined mechanically but are isolated for frequencies that they are designed to oscillate a...
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
There are a few ways that engineers have devised to have multiple "channels" on the same medium. Consider circuit switching vs. packet switching. In a circuit switched telecom network a dedicated communications channel between two devices is established. All data is continuously transmitted while the channel is active ...
As long as the transmission medium is linear, ie 1v + 1v = 2v, you can have multiple transmitters sending different patterns which will linearly add in the medium, but can be sorted back out again by a receive "filter" which looks for the unique pattern of the corresponding transmitter. In conventional radio and compa...
22,649
I am studying data communication and networking. While reading about data transfer using electrical signals, I came across 'frequency division multiplexing'. I understood how data is transferred in the form of electrical signals i.e. by way of modulating frequency, amplitude etc. Understanding a one way transmission is...
2011/11/23
[ "https://electronics.stackexchange.com/questions/22649", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6699/" ]
It's best to view this in the frequency domain rather than the time domain. Here is a basic example - two signals SIG (~1 MHz) and SIG2 (~2 MHz) are combined to form SIG+SIG2, then passed through LC filters with corresponding resonant frequencies to separate them again: Schematic: ![FreqMult](https://i.stack.imgur....
As long as the transmission medium is linear, ie 1v + 1v = 2v, you can have multiple transmitters sending different patterns which will linearly add in the medium, but can be sorted back out again by a receive "filter" which looks for the unique pattern of the corresponding transmitter. In conventional radio and compa...
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
The following will load all desired lines of a file into an array variable. It will stop reading the input file as soon as the end line number is reached: ``` use strict; use warnings; my $start = 3; my $end = 6; my @lines; while (<>) { last if $. > $end; push @lines, $_ if $. >= $start; } ```
``` # cat x.pl #!/usr/bin/perl my @lines; my $start = 2; my $end = 4; my $i = 0; for( $i=0; $i<$start; $i++ ) { scalar(<STDIN>); } for( ; $i<=$end; $i++ ) { push @lines, scalar(<STDIN>); } print @lines; # cat xxx 1 2 3 4 5 # cat xxx | ./x.pl 3 ...
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
Reading line by line isn't going to be optimal. Fortunately someone has done the hardwork already :) use Tie::File; it present the file as an array. <http://perldoc.perl.org/Tie/File.html>
``` # cat x.pl #!/usr/bin/perl my @lines; my $start = 2; my $end = 4; my $i = 0; for( $i=0; $i<$start; $i++ ) { scalar(<STDIN>); } for( ; $i<=$end; $i++ ) { push @lines, scalar(<STDIN>); } print @lines; # cat xxx 1 2 3 4 5 # cat xxx | ./x.pl 3 ...
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
You can use flip-flop operators ``` while(<>) { if (($. == 3) .. ($. == 7)) { push @result, $_; } ```
``` # cat x.pl #!/usr/bin/perl my @lines; my $start = 2; my $end = 4; my $i = 0; for( $i=0; $i<$start; $i++ ) { scalar(<STDIN>); } for( ; $i<=$end; $i++ ) { push @lines, scalar(<STDIN>); } print @lines; # cat xxx 1 2 3 4 5 # cat xxx | ./x.pl 3 ...
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
Use the [range operator `..`](http://perldoc.perl.org/perlop.html#Range-Operators) (also known as the flip-flop operator), which offers the following syntactic sugar: > > If either operand of scalar `..` is a constant expression, that operand is considered true if it is equal (`==`) to the current input line number (...
``` # cat x.pl #!/usr/bin/perl my @lines; my $start = 2; my $end = 4; my $i = 0; for( $i=0; $i<$start; $i++ ) { scalar(<STDIN>); } for( ; $i<=$end; $i++ ) { push @lines, scalar(<STDIN>); } print @lines; # cat xxx 1 2 3 4 5 # cat xxx | ./x.pl 3 ...
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
The following will load all desired lines of a file into an array variable. It will stop reading the input file as soon as the end line number is reached: ``` use strict; use warnings; my $start = 3; my $end = 6; my @lines; while (<>) { last if $. > $end; push @lines, $_ if $. >= $start; } ```
Reading line by line isn't going to be optimal. Fortunately someone has done the hardwork already :) use Tie::File; it present the file as an array. <http://perldoc.perl.org/Tie/File.html>
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
Use the [range operator `..`](http://perldoc.perl.org/perlop.html#Range-Operators) (also known as the flip-flop operator), which offers the following syntactic sugar: > > If either operand of scalar `..` is a constant expression, that operand is considered true if it is equal (`==`) to the current input line number (...
The following will load all desired lines of a file into an array variable. It will stop reading the input file as soon as the end line number is reached: ``` use strict; use warnings; my $start = 3; my $end = 6; my @lines; while (<>) { last if $. > $end; push @lines, $_ if $. >= $start; } ```
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
You can use flip-flop operators ``` while(<>) { if (($. == 3) .. ($. == 7)) { push @result, $_; } ```
Reading line by line isn't going to be optimal. Fortunately someone has done the hardwork already :) use Tie::File; it present the file as an array. <http://perldoc.perl.org/Tie/File.html>
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
Use the [range operator `..`](http://perldoc.perl.org/perlop.html#Range-Operators) (also known as the flip-flop operator), which offers the following syntactic sugar: > > If either operand of scalar `..` is a constant expression, that operand is considered true if it is equal (`==`) to the current input line number (...
Reading line by line isn't going to be optimal. Fortunately someone has done the hardwork already :) use Tie::File; it present the file as an array. <http://perldoc.perl.org/Tie/File.html>
3,220,585
Given a start and end line number, what's the fastest way to read a range of lines from a file into a variable?
2010/07/10
[ "https://Stackoverflow.com/questions/3220585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312483/" ]
Use the [range operator `..`](http://perldoc.perl.org/perlop.html#Range-Operators) (also known as the flip-flop operator), which offers the following syntactic sugar: > > If either operand of scalar `..` is a constant expression, that operand is considered true if it is equal (`==`) to the current input line number (...
You can use flip-flop operators ``` while(<>) { if (($. == 3) .. ($. == 7)) { push @result, $_; } ```
781,558
The following inserting file method for `sed` used to be working, even before last line, but not any more. Is it a bug in the current `sed`? Demo of inserting file method with sed: ``` mkdir /tmp/test printf '%s\n' {1..3} > /tmp/test/f1 printf '%s\n' {one,two,three,four,five,six,seven,eight,nine,ten} > /tmp/test/f2 ...
2014/07/10
[ "https://superuser.com/questions/781558", "https://superuser.com", "https://superuser.com/users/203539/" ]
You can use Query from Excel Files : * Define name for primary table dataset - the short list of emails (Formulas tab -> Define name) * Define name for secondary table dataset - the long list of emails with additional data * Go to Data tab, select "From Other Sources", and from the dropdown, select "From Microsoft Que...
I would use the Power Query Add-In for this. I believe this is Windows only. Power Query can import CSV files and you can use the Merge command to join together two sets of data. <http://office.microsoft.com/en-au/excel-help/merge-queries-HA104149757.aspx?CTT=5&origin=HA103993872>
781,558
The following inserting file method for `sed` used to be working, even before last line, but not any more. Is it a bug in the current `sed`? Demo of inserting file method with sed: ``` mkdir /tmp/test printf '%s\n' {1..3} > /tmp/test/f1 printf '%s\n' {one,two,three,four,five,six,seven,eight,nine,ten} > /tmp/test/f2 ...
2014/07/10
[ "https://superuser.com/questions/781558", "https://superuser.com", "https://superuser.com/users/203539/" ]
You can use Query from Excel Files : * Define name for primary table dataset - the short list of emails (Formulas tab -> Define name) * Define name for secondary table dataset - the long list of emails with additional data * Go to Data tab, select "From Other Sources", and from the dropdown, select "From Microsoft Que...
You could try using a pivot table with the VLOOKUP command.
62,329,315
Write a Python program using lists, function and loops that will prompt a user to enter a temperature as an integer. Your program will print "it is hot" if the temperature is over 100, "it is cold" if the temperature is under 60, and "it is just right" if the temperature is between 61 and 99 inclusive. The program cont...
2020/06/11
[ "https://Stackoverflow.com/questions/62329315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13729100/" ]
Actually, there is a way to achieve that and you were almost there. First, as you already stated, the source or dot operator works either by providing a path (as string) or a [script block](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_script_blocks). See also: *[. (source o...
*At this time it is not possible to dot source a string variable.* I stand corrected! . { Invoke-Expression $MyFunctions } definitely works!
62,329,315
Write a Python program using lists, function and loops that will prompt a user to enter a temperature as an integer. Your program will print "it is hot" if the temperature is over 100, "it is cold" if the temperature is under 60, and "it is just right" if the temperature is between 61 and 99 inclusive. The program cont...
2020/06/11
[ "https://Stackoverflow.com/questions/62329315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13729100/" ]
While [@dwettstein's answer](https://stackoverflow.com/a/67106043/15243610) is a viable approach using `Invoke-Expression` to handle the fact that the function is stored as a string, there are other approaches that seem to achieve the same result below. One thing I'm not crystal clear on is the scoping itself, `Invoke...
*At this time it is not possible to dot source a string variable.* I stand corrected! . { Invoke-Expression $MyFunctions } definitely works!
62,329,315
Write a Python program using lists, function and loops that will prompt a user to enter a temperature as an integer. Your program will print "it is hot" if the temperature is over 100, "it is cold" if the temperature is under 60, and "it is just right" if the temperature is between 61 and 99 inclusive. The program cont...
2020/06/11
[ "https://Stackoverflow.com/questions/62329315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13729100/" ]
Actually, there is a way to achieve that and you were almost there. First, as you already stated, the source or dot operator works either by providing a path (as string) or a [script block](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_script_blocks). See also: *[. (source o...
While [@dwettstein's answer](https://stackoverflow.com/a/67106043/15243610) is a viable approach using `Invoke-Expression` to handle the fact that the function is stored as a string, there are other approaches that seem to achieve the same result below. One thing I'm not crystal clear on is the scoping itself, `Invoke...
12,490
Does the Agile community have recommended processes for a single Scrum Team managing tasks coming in from multiple backlogs? Context and Problem ------------------- * One Scrum Team * One Scrum Master * Delivering value to an Enterprise Organisation (+10,000 employees, +$2billion revenue) * Tasks come into the Team f...
2014/10/17
[ "https://pm.stackexchange.com/questions/12490", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/10462/" ]
TL;DR ----- > > Does the Agile community have recommended processes for a single Scrum Team managing tasks coming in from multiple backlogs? > > > **Sure: *don't do it.*** Multiple teams can work from a single Product Backlog, but never the other way around. A single team working from multiple Product Backlogs i...
You need a full-time dedicated Product Owner for the Scrum teams ---------------------------------------------------------------- In one of my previous assignments, as the Scrum Master, I worked with a group of Product Managers similar to what you describe. Also, the Product Managers had many other priorities and so g...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
Try this: ``` sudo ifconfig wlan0 down sudo ifconfig wlan0 up ```
You could try killing the power to your device. Assuming you are unable/unwilling to physically disconnect the device, you should run (as root): `iwconfig wlan0 txpower off`. I would then wait 10-15 seconds to make sure whatever hardware issue has caused the problem has been stopped, then: `iwconfig wlan0 txpower auto`...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
These don't need root, in case you are scripting: ``` nmcli networking off nmcli networking on ``` For more do: `man nmcli` **EDIT**: As these guys are saying in the comments, for WI-FI only: ``` nmcli radio wifi off nmcli radio wifi on ```
You could try killing the power to your device. Assuming you are unable/unwilling to physically disconnect the device, you should run (as root): `iwconfig wlan0 txpower off`. I would then wait 10-15 seconds to make sure whatever hardware issue has caused the problem has been stopped, then: `iwconfig wlan0 txpower auto`...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
You could try killing the power to your device. Assuming you are unable/unwilling to physically disconnect the device, you should run (as root): `iwconfig wlan0 txpower off`. I would then wait 10-15 seconds to make sure whatever hardware issue has caused the problem has been stopped, then: `iwconfig wlan0 txpower auto`...
As @TSJNachos117 mentions in [their comment](https://askubuntu.com/questions/271387/how-to-restart-wifi-connection/399159#comment1324571_399159), for versions from 15.04 onwards, [Ubuntu switched to `systemd`](https://askubuntu.com/questions/613366/rationale-for-switching-from-upstart-to-systemd) as the service manager...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
"Reload the Driver" =================== ### Find the module name Let's find the name of the kernel module for your wireless connection: ``` sudo hwinfo --network ``` (Install package `hwinfo` if you don't have it.) Look for the module name in the "Driver" line. ### Reload the module Now unload then re-load the ...
The workaround using "systemctl restart NetworkManager" works for me on two different notebooks with Broadcom and Atheros WiFi under Debian Buster and Ubuntu 19.04 - where the problem with "wifi won't wake up on resume" happens on every fourth resume or so (= it typically works just fine.) I've first tried creating a d...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
"Reload the Driver" =================== ### Find the module name Let's find the name of the kernel module for your wireless connection: ``` sudo hwinfo --network ``` (Install package `hwinfo` if you don't have it.) Look for the module name in the "Driver" line. ### Reload the module Now unload then re-load the ...
Created a script based on prior link advice with some mixing & matching of prior links. This works for me running under Mint Linux 17.3. The file below does *not* require root access. It also only restarts wifi *only* if it is already down. Now I just need to add this script to a cron job to check my wifi connection e...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
You could try killing the power to your device. Assuming you are unable/unwilling to physically disconnect the device, you should run (as root): `iwconfig wlan0 txpower off`. I would then wait 10-15 seconds to make sure whatever hardware issue has caused the problem has been stopped, then: `iwconfig wlan0 txpower auto`...
The workaround using "systemctl restart NetworkManager" works for me on two different notebooks with Broadcom and Atheros WiFi under Debian Buster and Ubuntu 19.04 - where the problem with "wifi won't wake up on resume" happens on every fourth resume or so (= it typically works just fine.) I've first tried creating a d...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
You just need to restart [Network Manager](https://help.ubuntu.com/community/NetworkManager): ``` sudo service NetworkManager restart ``` Before Ubuntu 20.10: ``` sudo service network-manager restart ```
"Reload the Driver" =================== ### Find the module name Let's find the name of the kernel module for your wireless connection: ``` sudo hwinfo --network ``` (Install package `hwinfo` if you don't have it.) Look for the module name in the "Driver" line. ### Reload the module Now unload then re-load the ...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
You could try killing the power to your device. Assuming you are unable/unwilling to physically disconnect the device, you should run (as root): `iwconfig wlan0 txpower off`. I would then wait 10-15 seconds to make sure whatever hardware issue has caused the problem has been stopped, then: `iwconfig wlan0 txpower auto`...
Created a script based on prior link advice with some mixing & matching of prior links. This works for me running under Mint Linux 17.3. The file below does *not* require root access. It also only restarts wifi *only* if it is already down. Now I just need to add this script to a cron job to check my wifi connection e...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
You just need to restart [Network Manager](https://help.ubuntu.com/community/NetworkManager): ``` sudo service NetworkManager restart ``` Before Ubuntu 20.10: ``` sudo service network-manager restart ```
Created a script based on prior link advice with some mixing & matching of prior links. This works for me running under Mint Linux 17.3. The file below does *not* require root access. It also only restarts wifi *only* if it is already down. Now I just need to add this script to a cron job to check my wifi connection e...
271,387
I think I do not have problem with hardware. Sometimes the WiFi connection simply disconnects, apparently. So this is not necessarily [the same as this case](https://askubuntu.com/questions/26054/how-to-restart-wifi-interface-without-rebooting-it-drops-connection), I might not need to reload any modules. But how to ju...
2013/03/22
[ "https://askubuntu.com/questions/271387", "https://askubuntu.com", "https://askubuntu.com/users/142651/" ]
You just need to restart [Network Manager](https://help.ubuntu.com/community/NetworkManager): ``` sudo service NetworkManager restart ``` Before Ubuntu 20.10: ``` sudo service network-manager restart ```
As @TSJNachos117 mentions in [their comment](https://askubuntu.com/questions/271387/how-to-restart-wifi-connection/399159#comment1324571_399159), for versions from 15.04 onwards, [Ubuntu switched to `systemd`](https://askubuntu.com/questions/613366/rationale-for-switching-from-upstart-to-systemd) as the service manager...
50,964
It's well known that the CPS (continuation-passing style) translation often employed in compilers corresponds to double negation translation under the Curry-Howard isomorphism. Though often the target language of a CPS translation is the same as the source language, sometimes it's a specialized language which only allo...
2022/01/12
[ "https://cstheory.stackexchange.com/questions/50964", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/51841/" ]
1. Such a logic of continuations (or a syntax of continuation that arose from logical considerations) would be Laurent's “polarised linear logic” (LLP): [Olivier Laurent, *Étude de la polarisation en logique* (2002)](https://tel.archives-ouvertes.fr/tel-00007884/en/). A good explanation of what is going on from a categ...
For me, what is going on is reasonably standard: * You have $c$ with free variables $(x\_i : \tau\_i)\_i$, and you replace it with $c[t\_i/x\_i]$ with the $(t\_i)\_i$ at types $(\tau\_i)\_i$; this is a standard cut/substitution. * The replacement is done along a variable $k$ that is defined somewhere and used elsewher...
50,964
It's well known that the CPS (continuation-passing style) translation often employed in compilers corresponds to double negation translation under the Curry-Howard isomorphism. Though often the target language of a CPS translation is the same as the source language, sometimes it's a specialized language which only allo...
2022/01/12
[ "https://cstheory.stackexchange.com/questions/50964", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/51841/" ]
For me, what is going on is reasonably standard: * You have $c$ with free variables $(x\_i : \tau\_i)\_i$, and you replace it with $c[t\_i/x\_i]$ with the $(t\_i)\_i$ at types $(\tau\_i)\_i$; this is a standard cut/substitution. * The replacement is done along a variable $k$ that is defined somewhere and used elsewher...
1. You may be interested in the Kappa calculus which has no higher order maps and broadly corresponds to Cartesian categories. You might also want to look into co-intuitionistic logic which has "coexponentials." Unfortunately you can't combine "coimplication" and "implication" constructively. You need to weaken somethi...
50,964
It's well known that the CPS (continuation-passing style) translation often employed in compilers corresponds to double negation translation under the Curry-Howard isomorphism. Though often the target language of a CPS translation is the same as the source language, sometimes it's a specialized language which only allo...
2022/01/12
[ "https://cstheory.stackexchange.com/questions/50964", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/51841/" ]
1. Such a logic of continuations (or a syntax of continuation that arose from logical considerations) would be Laurent's “polarised linear logic” (LLP): [Olivier Laurent, *Étude de la polarisation en logique* (2002)](https://tel.archives-ouvertes.fr/tel-00007884/en/). A good explanation of what is going on from a categ...
1. You may be interested in the Kappa calculus which has no higher order maps and broadly corresponds to Cartesian categories. You might also want to look into co-intuitionistic logic which has "coexponentials." Unfortunately you can't combine "coimplication" and "implication" constructively. You need to weaken somethi...
43,219,245
Everyone keeps saying how simple it is to move a file from point a to point b using fileutils, but I'm having lots of trouble moving a file :( I have a /temp/ folder in the directory wherever the .jar is located, in this temp folder I have a .txt file I want to move up a directory (so basically next to the .jar file)...
2017/04/04
[ "https://Stackoverflow.com/questions/43219245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7691338/" ]
ok i managed to do it, apparently the getPath() method returned some funny path and it failed there, so heres a code that works ``` public void downloadJar() { String absolutePath = getPath(); String from = absolutePath + "\\temp\\test.txt"; String to = absolutePath + "\\test.txt"; File fileTo = new Fi...
Why don't use this Java API for [Moving a File or Directory](https://docs.oracle.com/javase/tutorial/essential/io/move.html) `Files.move(from, to, StandardCopyOption.REPLACE_EXISTING);` **UPDATE** Looking at your source code I suggest the following implementation: ``` Path from = Paths.get(absolutePath, "/temp/tes...
3,251,223
Given: Every student has an email account Maggie does not have an email account Homer is a student Using E(x): x has an email, S(x): x is a student and M to represent Maggie while H represents Homer, I came up with the following premises: * 1: ∀x[S(x)→E(x)] * 2: ¬E(M) * 3: S(H) I then have to determine if the two fo...
2019/06/04
[ "https://math.stackexchange.com/questions/3251223", "https://math.stackexchange.com", "https://math.stackexchange.com/users/677962/" ]
A similar example using more machinery hence perhaps less tricky in the details: Let $X=[0,2\pi]$, $f\_n(t)=\cos(nt)$. If $f\_{n\_k}(x)\to f(x)$ for (almost) every $x$ then Dominated Convergence shows that $||f\_{n\_k}-f||\_2\to0$; this is impossible by orthogonality (for example, $||f\_n-f\_m||\_2^2=2\pi$.)
No, there does not. Consider $f\_n(x) = \cos(4^n \pi x)$ on $[0,1]$ (with range in $[-1,1]$ not $[0,1]$, but you can transform it). Then for any subsequence $f\_{n\_k}$, there is some $x \in [0,1]$ such that $f\_{n\_k}(x) \ge \cos(\pi/4)$ if $k$ is odd and $\le -\cos(\pi/4)$ if $k$ is even. All you need to do is choos...
67,157,374
I have a question about how to properly construct functions in python that have side effects. Let's say I have some code like this, that is supposed to remove occurrences of a number from a list: ``` def removeNumber(nums, val): nums = [num for num in nums if num != val] ``` If i then use this code from outside...
2021/04/19
[ "https://Stackoverflow.com/questions/67157374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5331467/" ]
Try this: ``` def removeNumber(nums, val): nums[:] = [num for num in nums if num != val] my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9] removeNumber(my_list, 4) print(my_list) ``` This way you modify the list elements, not the list itself. **Explanation** Assuming you have some basic knowledge about Python objects, y...
If I understood your question correctly, ``` def removeNumber(nums, val): nums = [num for num in nums if num != val] return nums my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9] my_list = removeNumber(my_list, 4) ``` Just return your new list from the function and reassign your list with it.
65,111,712
I have a table like: ``` SELECT s.date, s.orderid, s.num1, s.num2, s.sales, s.price FROM sales AS s ``` Resulting in ``` date | orderid | num1 | num 1 | sales | price 2020-11-01 | 1 | a | aa | 1 | 10 2020-11-01 | 8 | k | kk | 1 | 10 2020-11-02 | 1 | a | aa | -1 |...
2020/12/02
[ "https://Stackoverflow.com/questions/65111712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4435175/" ]
The dynamic programming state that you need are three flags for whether people 1, 2, and 3 have received anything, followed by 3 numbers giving the sum of what they have received mod 3, 5, and 7. In Python I'd build up a dictionary whose keys are tuples representing the state and whose values are the counts. In C++ yo...
For such small item number you can just generate all items distributions (3^12~~531000) and check for conditions. ``` int countWays(int n, int* arr, int aa = 0, int bb = 0, int cc = 0) { if (n < 0) { return (aa*bb*cc > 0 && (aa % 3) == 0 && (bb % 5) == 0 && (cc % 7) == 0) ? 1 : 0; } return countWay...
59,914
We're studying the kinetic theory of gases in school, and one of the points that was brought up was that: "Gases consist of particles in constant, random motion." How is it possible for gas particles to move in straight lines, entirely randomly? Doesn't gravity affect them, or is their mass so small that its effect on ...
2016/09/29
[ "https://chemistry.stackexchange.com/questions/59914", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/35422/" ]
Yes gravity pulls on gas molecules. That is why the atmosphere doesn't just float off into space. The gist is that the time between collisions is very short in the lower atmosphere, and the distances very short. The mean free path at atmospheric pressure is only about 70 nanometers. So the assumption is that gas part...
To add to previous answers, all molecules and atoms are affected by gravity and so the density of the atmosphere is greater at the surface of the earth compared to higher up, which is why climbing on Everest most climbers take extra oxygen (although, remarkably, it has been done without this aid). At room temperature...
50,227
[![enter image description here](https://i.stack.imgur.com/UoEkC.jpg)](https://i.stack.imgur.com/UoEkC.jpg) [![enter image description here](https://i.stack.imgur.com/X9vAy.png)](https://i.stack.imgur.com/X9vAy.png) You don't need to go far to agree that raising hands while singing and worshiping (with music or prayer)...
2016/06/13
[ "https://christianity.stackexchange.com/questions/50227", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24557/" ]
It goes all the way back to Genesis 29:35 at least with Leah raising her hands in praise to *YHWH* in naming Judah. As a Biblical Hebrew professor thinking in Hebrew, I find the Old Testament full of hand raising. After the most frequent verb for **spoken** praise *HaLeL* (Strong's [#1984](https://www.blueletterbible.o...
Exodus 17:11 So it came about when **Moses held his hand up**, that Israel prevailed, and when he let his hand down, Amalek prevailed. Nehemiah 8:6 Then Ezra blessed the LORD the great God. And all the people answered, "Amen, Amen!" while lifting up their hands; then they bowed low and worshipped the LORD with their...
50,227
[![enter image description here](https://i.stack.imgur.com/UoEkC.jpg)](https://i.stack.imgur.com/UoEkC.jpg) [![enter image description here](https://i.stack.imgur.com/X9vAy.png)](https://i.stack.imgur.com/X9vAy.png) You don't need to go far to agree that raising hands while singing and worshiping (with music or prayer)...
2016/06/13
[ "https://christianity.stackexchange.com/questions/50227", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24557/" ]
It goes all the way back to Genesis 29:35 at least with Leah raising her hands in praise to *YHWH* in naming Judah. As a Biblical Hebrew professor thinking in Hebrew, I find the Old Testament full of hand raising. After the most frequent verb for **spoken** praise *HaLeL* (Strong's [#1984](https://www.blueletterbible.o...
One thing my wife & I have noticed is that when a Modern Contemporary Worship song is played we see the hands lifting in the air. But when a Hymn is played/sung, we rarely ever see those same hands lifted up, if any and not usually til the chorus. So it seems that the music of today along with perhaps the lyrics to a ...
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
**Some Solutions:** * You can downgrade your pandas version to 0.21 which is no problem with pivot table with big size datas. * You can set your data to dictionary format like `df.groupby('EVENT_ID')['DIAGNOSIS'].apply(list).to_dict()`
An integer overflow inside library code is nothing you can do much about. You have basically three options: 1. **Change the input data** you provide to the library so the overflow does not occur. You probably need to make the input smaller in some sense. If that does not help, you may be using the library in a wrong w...
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
You can use `groupby` instead. Try this code: ``` reviews.groupby(['userId','movieId'])['rating'].max().unstack() ```
An integer overflow inside library code is nothing you can do much about. You have basically three options: 1. **Change the input data** you provide to the library so the overflow does not occur. You probably need to make the input smaller in some sense. If that does not help, you may be using the library in a wrong w...
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
An integer overflow inside library code is nothing you can do much about. You have basically three options: 1. **Change the input data** you provide to the library so the overflow does not occur. You probably need to make the input smaller in some sense. If that does not help, you may be using the library in a wrong w...
Converting the values column should resolve your issue: df[‘ratings’] = df[‘ratings’].astype(‘int64’)
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
**Some Solutions:** * You can downgrade your pandas version to 0.21 which is no problem with pivot table with big size datas. * You can set your data to dictionary format like `df.groupby('EVENT_ID')['DIAGNOSIS'].apply(list).to_dict()`
If you want **movieId** as your columns, first sort the dataframe using movieId as the key. Then divide (half) the dataframe such that each subset contains all the ratings for a particular movie. ``` subset1 = df[:n] subset2 = df[n:] ``` Now, apply to each of the subsets ``` matrix1 = subset1.pivot_table(values='...
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
**Some Solutions:** * You can downgrade your pandas version to 0.21 which is no problem with pivot table with big size datas. * You can set your data to dictionary format like `df.groupby('EVENT_ID')['DIAGNOSIS'].apply(list).to_dict()`
Converting the values column should resolve your issue: df[‘ratings’] = df[‘ratings’].astype(‘int64’)
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
You can use `groupby` instead. Try this code: ``` reviews.groupby(['userId','movieId'])['rating'].max().unstack() ```
If you want **movieId** as your columns, first sort the dataframe using movieId as the key. Then divide (half) the dataframe such that each subset contains all the ratings for a particular movie. ``` subset1 = df[:n] subset2 = df[n:] ``` Now, apply to each of the subsets ``` matrix1 = subset1.pivot_table(values='...
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
You can use `groupby` instead. Try this code: ``` reviews.groupby(['userId','movieId'])['rating'].max().unstack() ```
Converting the values column should resolve your issue: df[‘ratings’] = df[‘ratings’].astype(‘int64’)
56,790,261
I use the **pd.pivot\_table()** method to create a user-item matrix by pivoting the user-item activity data. However, the dataframe is so large that I got complain like this: > > Unstacked DataFrame is too big, causing **int32 overflow** > > > Any suggestions on solving this problem? Thanks! ``` r_matrix = df.pi...
2019/06/27
[ "https://Stackoverflow.com/questions/56790261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708377/" ]
If you want **movieId** as your columns, first sort the dataframe using movieId as the key. Then divide (half) the dataframe such that each subset contains all the ratings for a particular movie. ``` subset1 = df[:n] subset2 = df[n:] ``` Now, apply to each of the subsets ``` matrix1 = subset1.pivot_table(values='...
Converting the values column should resolve your issue: df[‘ratings’] = df[‘ratings’].astype(‘int64’)
77,333
In my WP8 application I need to show a couple of radio buttons to let the user select a value out of an `enum`. I don't want to hardcode either the value or the text (description) showed to the user. I would like my Model/ViewModel drive them for me. As of now, this is what I have: ``` //enum defined in model public...
2015/01/12
[ "https://codereview.stackexchange.com/questions/77333", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/62812/" ]
This looks perfectly reasonable. In fact, the only thing I would really change is this: ``` string parameterString = parameter as string; if ( parameterString == null ) return DependencyProperty.UnsetValue; if ( Enum.IsDefined (value.GetType (), value) == false ) return DependencyProperty.UnsetValue; ``` Yo...
I think it is worth mentioning, that this design decision will bite you back as soon as you start working on localization. There is no easy way to localize attributes, because you can only pass constant string values to attribute constuctor. If localization is out of the question, then this design is fine, I guess.
77,333
In my WP8 application I need to show a couple of radio buttons to let the user select a value out of an `enum`. I don't want to hardcode either the value or the text (description) showed to the user. I would like my Model/ViewModel drive them for me. As of now, this is what I have: ``` //enum defined in model public...
2015/01/12
[ "https://codereview.stackexchange.com/questions/77333", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/62812/" ]
This looks perfectly reasonable. In fact, the only thing I would really change is this: ``` string parameterString = parameter as string; if ( parameterString == null ) return DependencyProperty.UnsetValue; if ( Enum.IsDefined (value.GetType (), value) == false ) return DependencyProperty.UnsetValue; ``` Yo...
While I admit that chances are low that another `Unit` will pop up, I do feel that your solution is not really following the "spirit" of WPF/Silverlight. Particularly the fact that you code two RadioButtons with virtually the same code doesn't sit well with me. It feels conveluted, especially the enum-to-boolean conver...
77,333
In my WP8 application I need to show a couple of radio buttons to let the user select a value out of an `enum`. I don't want to hardcode either the value or the text (description) showed to the user. I would like my Model/ViewModel drive them for me. As of now, this is what I have: ``` //enum defined in model public...
2015/01/12
[ "https://codereview.stackexchange.com/questions/77333", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/62812/" ]
I think it is worth mentioning, that this design decision will bite you back as soon as you start working on localization. There is no easy way to localize attributes, because you can only pass constant string values to attribute constuctor. If localization is out of the question, then this design is fine, I guess.
While I admit that chances are low that another `Unit` will pop up, I do feel that your solution is not really following the "spirit" of WPF/Silverlight. Particularly the fact that you code two RadioButtons with virtually the same code doesn't sit well with me. It feels conveluted, especially the enum-to-boolean conver...
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
You should create referencing outlet for your button from storyboard to your VC named for example myButton than set its properties ``` myButton.layer.cornerRadius = 2; myButton.layer.borderWidth = 1; myButton.layer.borderColor = UIColor.whiteColor().CGColor ```
In Xcode 8.2 (Swift 3) you can use "Identity Inspector Tab". Search for "Users Defined Runtime Attributes", after selecting your UIButton. There you can define these attributes: 1. Key Path: layer.cornerRadius; 2-Type: Number, 3-Value: 2 2. Key Path: layer.borderWidth; 2-Type: Number, 3-Value: 1 3. Key Path: layer.bor...
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
as 0x7fffffff said. UIButton is the class it can be instatiated bu invoking its constructor like this ``` let instanceOfUIButton = UIButton() ``` then you can set the desired attributes: ``` instanceOfUIButton.layer.cornerRadius = 2; ```
Another option instead of creating a reference to each button would be to create a subclass of the type UIButton. You could then set the properties in the subclass. Next you could change the class of all the buttons in the storyboard that need to have the same properties. ``` class MyButton: UIButton { override fun...
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
You don't have to do this with code either. You can create a stretchable image and set it to the background image of the button in the attributes inspector. ![enter image description here](https://i.stack.imgur.com/YkH4k.png)
Add this line at the top ``` myButton.layer.masksToBounds = true ```
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
as 0x7fffffff said. UIButton is the class it can be instatiated bu invoking its constructor like this ``` let instanceOfUIButton = UIButton() ``` then you can set the desired attributes: ``` instanceOfUIButton.layer.cornerRadius = 2; ```
Add this line at the top ``` myButton.layer.masksToBounds = true ```
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
You should create referencing outlet for your button from storyboard to your VC named for example myButton than set its properties ``` myButton.layer.cornerRadius = 2; myButton.layer.borderWidth = 1; myButton.layer.borderColor = UIColor.whiteColor().CGColor ```
Add this line at the top ``` myButton.layer.masksToBounds = true ```
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
as 0x7fffffff said. UIButton is the class it can be instatiated bu invoking its constructor like this ``` let instanceOfUIButton = UIButton() ``` then you can set the desired attributes: ``` instanceOfUIButton.layer.cornerRadius = 2; ```
In Xcode 8.2 (Swift 3) you can use "Identity Inspector Tab". Search for "Users Defined Runtime Attributes", after selecting your UIButton. There you can define these attributes: 1. Key Path: layer.cornerRadius; 2-Type: Number, 3-Value: 2 2. Key Path: layer.borderWidth; 2-Type: Number, 3-Value: 1 3. Key Path: layer.bor...
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
You don't have to do this with code either. You can create a stretchable image and set it to the background image of the button in the attributes inspector. ![enter image description here](https://i.stack.imgur.com/YkH4k.png)
as 0x7fffffff said. UIButton is the class it can be instatiated bu invoking its constructor like this ``` let instanceOfUIButton = UIButton() ``` then you can set the desired attributes: ``` instanceOfUIButton.layer.cornerRadius = 2; ```
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
You should create referencing outlet for your button from storyboard to your VC named for example myButton than set its properties ``` myButton.layer.cornerRadius = 2; myButton.layer.borderWidth = 1; myButton.layer.borderColor = UIColor.whiteColor().CGColor ```
Another option instead of creating a reference to each button would be to create a subclass of the type UIButton. You could then set the properties in the subclass. Next you could change the class of all the buttons in the storyboard that need to have the same properties. ``` class MyButton: UIButton { override fun...
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
You should create referencing outlet for your button from storyboard to your VC named for example myButton than set its properties ``` myButton.layer.cornerRadius = 2; myButton.layer.borderWidth = 1; myButton.layer.borderColor = UIColor.whiteColor().CGColor ```
as 0x7fffffff said. UIButton is the class it can be instatiated bu invoking its constructor like this ``` let instanceOfUIButton = UIButton() ``` then you can set the desired attributes: ``` instanceOfUIButton.layer.cornerRadius = 2; ```
27,963,344
I want a flat looking white bordered around my `UIButton`. I would like it in Storyboard or programmatically. My code isn't working. ***Code:*** ``` UIButton.layer.cornerRadius = 2; UIButton.layer.borderWidth = 1; UIButton.layer.borderColor = UIColor.whiteColor() ```
2015/01/15
[ "https://Stackoverflow.com/questions/27963344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3496203/" ]
You should create referencing outlet for your button from storyboard to your VC named for example myButton than set its properties ``` myButton.layer.cornerRadius = 2; myButton.layer.borderWidth = 1; myButton.layer.borderColor = UIColor.whiteColor().CGColor ```
You don't have to do this with code either. You can create a stretchable image and set it to the background image of the button in the attributes inspector. ![enter image description here](https://i.stack.imgur.com/YkH4k.png)
45,387,842
I keepy getting TypeError: testsession.testset[0].athletes is undefined - i have tried lots of different ways, is it not possible to have an array of arrays of objects ```js var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; test...
2017/07/29
[ "https://Stackoverflow.com/questions/45387842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8020258/" ]
The testset[0] is a string. Make it an object ``` var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; testsession.testset = testset; //Earlier you pushed 400m directly which is a string hence causing the error later on testsession.tes...
When you try to access `testsession.testset[0]` that entry is a string. You maybe at least would like to set `testsession.testset[0] = {};` before accessing its members.
45,387,842
I keepy getting TypeError: testsession.testset[0].athletes is undefined - i have tried lots of different ways, is it not possible to have an array of arrays of objects ```js var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; test...
2017/07/29
[ "https://Stackoverflow.com/questions/45387842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8020258/" ]
When you try to access `testsession.testset[0]` that entry is a string. You maybe at least would like to set `testsession.testset[0] = {};` before accessing its members.
I think you are working code like this. ``` <script > var testsession = {}; testsession.testset = []; testsession.testset.push({testsetname:"week9"}); testsession.testset[0].list = []; testsession.testset[0].list.push({distance:"400M"}); testsession.testset[0].list[0].athletes = []; testsession.testset[0].list[0].a...
45,387,842
I keepy getting TypeError: testsession.testset[0].athletes is undefined - i have tried lots of different ways, is it not possible to have an array of arrays of objects ```js var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; test...
2017/07/29
[ "https://Stackoverflow.com/questions/45387842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8020258/" ]
The testset[0] is a string. Make it an object ``` var testsession = {}; var testsetname = {}; var testset = []; testsession.testsetname = testsetname; testsession.testsetname = "week9"; testsession.testset = testset; //Earlier you pushed 400m directly which is a string hence causing the error later on testsession.tes...
`testsession.testset[0]` is a primitive value, a string. The following statement will therefore not have the effect you may think it has: ``` testsession.testset[0].athletes = athletes; ``` What happens here? The primitive at the left has no `athletes` property, but JavaScript will coerce it to a `String` object, t...