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
637
The inspiration for my question comes from The Great C by Philip K Dick. To summarize, the Great C is a computer that has taken over a large portion of the planet. It uses proxy agents to keep control by relentlessly patrolling the area and killing anything that gets in its way. My question is an extension of this ide...
2014/09/30
[ "https://worldbuilding.stackexchange.com/questions/637", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/119/" ]
There is a lot we don't know about this computer, but let us consider that it was created by a civilisation of some kind and placed on the planet with both the intelligence for agency and some facility for acting on its environment, which if it is to survive for any length of time, would probably be necessary—I will as...
Yes, it would be possible, though I would say it would require to have been set up to do so by people. > > Would it even be possible to gain enough energy to power itself and > continue expanding? > > > Certainly. All it needs is some sort of sustainable and or reproducible power plant and input to the plant. Co...
637
The inspiration for my question comes from The Great C by Philip K Dick. To summarize, the Great C is a computer that has taken over a large portion of the planet. It uses proxy agents to keep control by relentlessly patrolling the area and killing anything that gets in its way. My question is an extension of this ide...
2014/09/30
[ "https://worldbuilding.stackexchange.com/questions/637", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/119/" ]
**tl;dr**: Yes, **in vacuo**, probably, but what that would look like and if it even is possible considering all the other factors in play, requires a lot more information about details of its history and circumstances. A few basic decisions have to be made before this kind of question can be well-defined enough to pr...
Yes, it would be possible, though I would say it would require to have been set up to do so by people. > > Would it even be possible to gain enough energy to power itself and > continue expanding? > > > Certainly. All it needs is some sort of sustainable and or reproducible power plant and input to the plant. Co...
65,732
I have a primary workflow that kicks off a To-Do task. the task goes to a task list that is shared with many other tasks. my problem is that i'm only allowed from the secondary task workflow to know the original workflow name, id or list id. i need a way to scope down to what the name of the To-Do task is. any way...
2013/04/12
[ "https://sharepoint.stackexchange.com/questions/65732", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/10608/" ]
I found out what I was going wrong. Instead of: ``` spFile.Item["CustomColumn"] = "CustomColumnValue"; spFile.Update(); ``` do this: ``` spFile.Item.Properties["CustomColumn"] = "CustomColumnValue"; spFile.Item.SystemUpdate(); spFile.Update(); ```
Your solution is right, this is another solution using a hashtable variable: you can upload the file from a SPFolder or SPWeb as following: ``` // Add custom value to the column library System.Collections.Hashtable properties = new System.Collections.Hashtable(); properties.Add("My custom column name", "My value"); w...
65,732
I have a primary workflow that kicks off a To-Do task. the task goes to a task list that is shared with many other tasks. my problem is that i'm only allowed from the secondary task workflow to know the original workflow name, id or list id. i need a way to scope down to what the name of the To-Do task is. any way...
2013/04/12
[ "https://sharepoint.stackexchange.com/questions/65732", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/10608/" ]
This works for me. ``` spfile.Item["Title"] = "Workk"; spfile.Item.Update(); spfile.Update(); ```
Your solution is right, this is another solution using a hashtable variable: you can upload the file from a SPFolder or SPWeb as following: ``` // Add custom value to the column library System.Collections.Hashtable properties = new System.Collections.Hashtable(); properties.Add("My custom column name", "My value"); w...
46,142,145
I have an `AJAX` pagination that is working, actually it does not work better, I'm trying to understand how `AJAX` works with the url for pagination to work correctly. What happens is that in normal pagination, without AJAX each of the links worked normal, more specifically the prev and the next: `prev 1 2 3 4 next`, ...
2017/09/10
[ "https://Stackoverflow.com/questions/46142145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4858201/" ]
As per the code you provided, you are referring to the document before it gets loaded. ``` var output = document.getElementById("output"); // <- here and output.innerHTML = "hello world"; win.loadURL('file://' + __dirname + '/index.html'); // <- here ``` Check if the DOM is ready before manipulating it.
The name of your JavaScript file is index.js. But you are including script.js file in the script tag. Change the script tag to specify path of index.js file: ``` <script src="./path_of_file/index.js"></script> ```
4,098,563
THE ODEs has the following form: \begin{align\*} \frac{dy}{dt} &= - \lambda xy\\ \frac{dx}{dt} &= -\eta y^2, \end{align\*} where $\lambda$ and $\eta$ are constants. $y(0) = C\_1 >0$ and $x(0) = C\_2 >0$. Is there any standard tool to analyze it? Thanks.
2021/04/11
[ "https://math.stackexchange.com/questions/4098563", "https://math.stackexchange.com", "https://math.stackexchange.com/users/601630/" ]
You can deduce that: $$\dfrac {dy}{dx}=\dfrac {\lambda x}{\eta y}$$ $$\eta y^2 -\lambda x^2=C$$
If $x$ and $y$ only depend on $t$ i think you could just have $$y=\pm\sqrt{-\frac{dx}{dt}\frac{1}{\eta}}$$ and substitute it into the first equation.
58,472,705
I am calling a fetch request akin to this. ``` fetch('https://api-endpoint.com/api', { method: "POST", headers: new Headers({ 'custom-header': 'custom header value' }) } ) .then(res=>{ /* code */ }) .catch(err=>{ /* co...
2019/10/20
[ "https://Stackoverflow.com/questions/58472705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8980003/" ]
You can enable and disable AEC,AGC - using the `AudioUnitSetProperty` > > <https://developer.apple.com/documentation/audiotoolbox/1440371-audiounitsetproperty> > > > Here is some code snippet for the same. ``` lResult = AudioUnitSetProperty(lAUAudioUnit, kAUVoiceIOProperty_BypassVo...
i was try above solution , but it didn't work for me. below is my code : ``` var componentDesc: AudioComponentDescription = AudioComponentDescription( componentType: OSType(kAudioUnitType_Output), componentSubType: OSType(...
58,472,705
I am calling a fetch request akin to this. ``` fetch('https://api-endpoint.com/api', { method: "POST", headers: new Headers({ 'custom-header': 'custom header value' }) } ) .then(res=>{ /* code */ }) .catch(err=>{ /* co...
2019/10/20
[ "https://Stackoverflow.com/questions/58472705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8980003/" ]
What the app needs is access to unprocessed audio after disabling the AGC (Auto Gain Control) filters on the audio channel. To get access to raw and unprocessed audio, turn on **Measurement mode** in iOS. As appears in the iOS documentation [here](https://developer.apple.com/documentation/avfaudio/avaudiosession/mode/...
i was try above solution , but it didn't work for me. below is my code : ``` var componentDesc: AudioComponentDescription = AudioComponentDescription( componentType: OSType(kAudioUnitType_Output), componentSubType: OSType(...
51,144,404
Simple question: what selector is needed to access the Geolocate Control in Mapbox GL JS? You can easily get access to all the various map controls to add attributes such as title tags, accessibility tags (aria-label, etc) and even to enable bootstrap tooltips and data-toggles and so forth. However,I have not been ab...
2018/07/02
[ "https://Stackoverflow.com/questions/51144404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10023692/" ]
You can add `[JsonObject(MemberSerialization.OptIn)]` attribute to your class, then everything will be ignored unless you explicitly Opt-In by using a `[JsonProperty]` attribute on the members. ``` [JsonObject(MemberSerialization.OptIn)] public class Address { [JsonProperty] private string _field1 = "bob"; ...
You could create a custom [`IContractResolver`](https://www.newtonsoft.com/json/help/html/ContractResolver.htm) and decide to serialize depending on a [custom attribute](https://stackoverflow.com/a/2656213/2441442) you created: ``` public class IgnorePropertyResolver : DefaultContractResolver { protected override ...
51,144,404
Simple question: what selector is needed to access the Geolocate Control in Mapbox GL JS? You can easily get access to all the various map controls to add attributes such as title tags, accessibility tags (aria-label, etc) and even to enable bootstrap tooltips and data-toggles and so forth. However,I have not been ab...
2018/07/02
[ "https://Stackoverflow.com/questions/51144404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10023692/" ]
If you mark your class with `[JsonObject(MemberSerialization.Fields)]`, that will get you most of the way there. This attribute tells Json.Net that you want it to serialize all fields in a class, regardless of access modifiers, but not properties. However, if you have any auto properties in your class (i.e. those dec...
You could create a custom [`IContractResolver`](https://www.newtonsoft.com/json/help/html/ContractResolver.htm) and decide to serialize depending on a [custom attribute](https://stackoverflow.com/a/2656213/2441442) you created: ``` public class IgnorePropertyResolver : DefaultContractResolver { protected override ...
723,879
Is there any `ls` parameter which I can use to display file-size for directories **as well**. When I do `ls -s`, it shows me `block-size`(4k always) instead of directory size. Thank you!!! *Edit - Partial achievement* As told by @Arronical, Command `du -sh *` shows the files & directories with their size. One sma...
2016/01/21
[ "https://askubuntu.com/questions/723879", "https://askubuntu.com", "https://askubuntu.com/users/398352/" ]
**Basic idea** One could emulate the `ls -l` with find. For instance, like with `find` command that will run `du` per each directory and file found: ``` find . -maxdepth 1 ! -name "." -printf "%M %u %g " -exec du -sh {} \; 2> /dev/null ``` Sample output ( side note , here I am using `-type d` to show listing ...
I'm not aware of any parameters for the `ls` command which can achieve this, but it is possible to find the sizes of the directories and files in the present working directory with the `du` command. Try using: ``` du -sh ./* ``` It should be possible to create a function or a script which gives you information as t...
723,879
Is there any `ls` parameter which I can use to display file-size for directories **as well**. When I do `ls -s`, it shows me `block-size`(4k always) instead of directory size. Thank you!!! *Edit - Partial achievement* As told by @Arronical, Command `du -sh *` shows the files & directories with their size. One sma...
2016/01/21
[ "https://askubuntu.com/questions/723879", "https://askubuntu.com", "https://askubuntu.com/users/398352/" ]
I'm not aware of any parameters for the `ls` command which can achieve this, but it is possible to find the sizes of the directories and files in the present working directory with the `du` command. Try using: ``` du -sh ./* ``` It should be possible to create a function or a script which gives you information as t...
Parsing the output of `ls` always leads to grief. See [this explanation](http://mywiki.wooledge.org/ParsingLs "this explanation"). Use `stat` (`man stat`) instead. from `man stat`: ``` NAME stat - display file or file system status SYNOPSIS stat [OPTION]... FILE... DESCRIPTION Display file or ...
723,879
Is there any `ls` parameter which I can use to display file-size for directories **as well**. When I do `ls -s`, it shows me `block-size`(4k always) instead of directory size. Thank you!!! *Edit - Partial achievement* As told by @Arronical, Command `du -sh *` shows the files & directories with their size. One sma...
2016/01/21
[ "https://askubuntu.com/questions/723879", "https://askubuntu.com", "https://askubuntu.com/users/398352/" ]
**Basic idea** One could emulate the `ls -l` with find. For instance, like with `find` command that will run `du` per each directory and file found: ``` find . -maxdepth 1 ! -name "." -printf "%M %u %g " -exec du -sh {} \; 2> /dev/null ``` Sample output ( side note , here I am using `-type d` to show listing ...
Parsing the output of `ls` always leads to grief. See [this explanation](http://mywiki.wooledge.org/ParsingLs "this explanation"). Use `stat` (`man stat`) instead. from `man stat`: ``` NAME stat - display file or file system status SYNOPSIS stat [OPTION]... FILE... DESCRIPTION Display file or ...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
If your button width: `android:layout_width="wrap_content"` then your code will be like this: ``` <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/img name" android:gravity="left|center" android:text="Button" /> `...
``` <Button android:id="@+id/btSettings" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/back_button" android:drawablePadding="5dp" android:drawableLeft="@drawable/ic_launcher" android:text="Settings" android:padding="20dp" andro...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
If your button width: `android:layout_width="wrap_content"` then your code will be like this: ``` <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/img name" android:gravity="left|center" android:text="Button" /> `...
Check this link I found useful. <http://porcupineprogrammer.blogspot.co.uk/2013/03/android-ui-struggles-making-button-with.html>
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
Maybe you should use RelativeLayout with rounded corners, than put TextView and ImageView inside of it.
``` <Button android:id="@+id/btSettings" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/back_button" android:drawablePadding="5dp" android:drawableLeft="@drawable/ic_launcher" android:text="Settings" android:padding="20dp" andro...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
If your button width: `android:layout_width="wrap_content"` then your code will be like this: ``` <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableLeft="@drawable/img name" android:gravity="left|center" android:text="Button" /> `...
You can use android:paddingLeft, android:paddingRight and layout\_width at a fixed width to solve the issue. ``` <Button android:id="@+id/btSettings" android:layout_width="148dp" android:layout_height="wrap_content" android:paddingLeft="32dp" android:paddingRight="32dp" android:background="@drawable/bt_general" androi...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
I had achieved that with following code. May be used as an easier alternative to above solutions. ``` <Button android:id="@+id/btnUserProfile" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:drawableLe...
Check this link I found useful. <http://porcupineprogrammer.blogspot.co.uk/2013/03/android-ui-struggles-making-button-with.html>
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
Try below layout ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="100dip" android:orientation="horizontal" android:background="@drawable/round_corners_drawable" > <ImageView android:id="...
Try to use TextView, ``` <TextView android:id="@+id/txtSettings" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/tvWhatever" android:layout_centerHorizontal="true" android:text="@string/settings" android:textColor="#000000" /> ``` In Java...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
Here is how i do things : **LAYERS** ``` <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/rounded_border"/> <item android:drawable="@drawable/selector_button"/> </layer-list> ``` --- **SELECTOR** ``` <?xml ...
Try to use TextView, ``` <TextView android:id="@+id/txtSettings" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/tvWhatever" android:layout_centerHorizontal="true" android:text="@string/settings" android:textColor="#000000" /> ``` In Java...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
Maybe you should use RelativeLayout with rounded corners, than put TextView and ImageView inside of it.
I just implemented this kind of button (and it has been deployed in a large scale app), it is not really complicated : content of large\_button.xml : ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andro...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
Maybe you should use RelativeLayout with rounded corners, than put TextView and ImageView inside of it.
You can use android:paddingLeft, android:paddingRight and layout\_width at a fixed width to solve the issue. ``` <Button android:id="@+id/btSettings" android:layout_width="148dp" android:layout_height="wrap_content" android:paddingLeft="32dp" android:paddingRight="32dp" android:background="@drawable/bt_general" androi...
19,133,545
This is hard to describe well but I'll do the best I can. I have an arraylist of objects. Inside those objects are attributes. Instead of everything inside one class, they are all separate classes. This is the first time I'm working with stuff like this and I'm not sure if I got the syntax right. I'm trying to make pri...
2013/10/02
[ "https://Stackoverflow.com/questions/19133545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2837858/" ]
Try this: Follow this : <http://porcupineprogrammer.blogspot.in/2013/03/android-ui-struggles-making-button-with.html> ``` <FrameLayout style="?android:attr/buttonStyle" android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:layout_width="wrap_content" ...
Found a class called CenteredIconButton that extends Button at this link. Worked like magic. [How to have Image and Text Center within a Button](https://stackoverflow.com/questions/4817449/how-to-have-image-and-text-center-within-a-button#tab-top) . Thanks to @atomicode
27,100,533
All of the examples that I have seen so far regarding db connectivity in MVC are using Entity Framework. So my question is, Is it must for db handling in MVC?
2014/11/24
[ "https://Stackoverflow.com/questions/27100533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4286671/" ]
No it is not a must. You can implement your database layer. But the thing you need is define Models for MVC: ``` public class MyClass { [Display(Name = "SomeName")] [Required(ErrorMessage = "required")] public int? SomeId { get; set; } //... } ``` for scaffolding. Here is example implementation fo...
No, surely it is NOT a must. But Entity Framework is **Microsoft’s recommended data access** technology for new applications. And it has some very nice features. That`s why it is so pupular. It also has some very nice features: 1. Shield Yourself From SQL 2. Much faster to build the DAL (DATA ACCESS LAYER) 3. Easie...
34,930,671
I have a text, something like: ``` 1: hello people on stackoverflow, this here is my sample string 2: to show you what I want to achive. Here are some lines 3: I want to select 4: asdAsasDAqdVGevSerE312d1d14fF2Asdc 5: klhkblkljhb2k324JKgnqwwuUIH82mjkaw 6: heLloIsWhatIwantToSelectToo 7: thisLineshouldnotbeselected 8: b...
2016/01/21
[ "https://Stackoverflow.com/questions/34930671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1906168/" ]
> > a regexp to select lines having more than 1 uppercased character and no whitespaces. > > > You could use the following regular expression: ``` /^\S*[A-Z]\S*[A-Z]\S*$/ ``` [**Example Here**](https://regex101.com/r/mM2dQ1/1) * `^` - Anchor denoting the start of the line * `\S*` - Zero or more non-white space...
``` ^\S*[A-Z]\S*[A-Z]\S*$ ``` * `^` start of string * `\S*` zero or more non-whitespace characters * `[A-Z]` uppercase character * `$` end of string Regex match in PHP: `preg_match("/^\S*[A-Z]\S*[A-Z]\S*$/", $text)`
34,930,671
I have a text, something like: ``` 1: hello people on stackoverflow, this here is my sample string 2: to show you what I want to achive. Here are some lines 3: I want to select 4: asdAsasDAqdVGevSerE312d1d14fF2Asdc 5: klhkblkljhb2k324JKgnqwwuUIH82mjkaw 6: heLloIsWhatIwantToSelectToo 7: thisLineshouldnotbeselected 8: b...
2016/01/21
[ "https://Stackoverflow.com/questions/34930671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1906168/" ]
> > a regexp to select lines having more than 1 uppercased character and no whitespaces. > > > You could use the following regular expression: ``` /^\S*[A-Z]\S*[A-Z]\S*$/ ``` [**Example Here**](https://regex101.com/r/mM2dQ1/1) * `^` - Anchor denoting the start of the line * `\S*` - Zero or more non-white space...
``` ([a-z0-9]*[A-Z][a-z0-9]*[A-Z]\w*) ``` This seems to work based on <http://regexr.com/> Basically I use \*, which means optional with any ammount, so it could have from 0 to whatever number regex support of characters from a-z or 0-9, then I expect at least 1 upper case, followed again by 0 to infinite characters...
55,185,800
I have a react router app: ``` export default () => ( <Router basename={process.env.REACT_APP_BASENAME || ""}> <div> {routes.map((route, index) => { return ( <PrivateRoute key={index} path={route.path} exact={route.exact} component={prop...
2019/03/15
[ "https://Stackoverflow.com/questions/55185800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10840790/" ]
You could try ``` let bindFunctionSpy = spyOn(component.someFunction.prototype, 'bind').and.callThrough(); ```
Try spying on Function.prototype like this - ``` spyOn(Function.prototype, 'bind'); ``` it worked for me.
55,185,800
I have a react router app: ``` export default () => ( <Router basename={process.env.REACT_APP_BASENAME || ""}> <div> {routes.map((route, index) => { return ( <PrivateRoute key={index} path={route.path} exact={route.exact} component={prop...
2019/03/15
[ "https://Stackoverflow.com/questions/55185800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10840790/" ]
The best way to do this is just casting your function to the `CallableFunction` type. ``` let bindFunctionSpy = spyOn(component.someFunction as CallableFunction, 'bind').and.callThrough(); ```
Try spying on Function.prototype like this - ``` spyOn(Function.prototype, 'bind'); ``` it worked for me.
60,945,686
here is my task description, as I need to pass some data to the GCP cloud task HTTP request body, I need to convert a list to bytes list(as it is only accept bye data type), then convert back into a python list for the GCP cloud function. Right now I am having trouble converting a byte list back to a python list. Here ...
2020/03/31
[ "https://Stackoverflow.com/questions/60945686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660790/" ]
`str(payload)` converts the list to a str, and this is not an easily reversible operation. A better approach is to use the [json](https://docs.python.org/3/library/json.html) module to serialise and deserialise the list and its elements. ``` >>> import json >>> dataset_id='ICN444499559951515151' >>> name='testing_1' ...
Your variable `byte_list` isn't actually a list. It is a byte string representing a list. Similarly, `x` is a string, not a list. To convert the string back to a list, you have to apply some logic on how this should happens, as there is no standard conversion from string to list. This can be done in one line with a l...
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
Try this: `mailto:%22John%20Wayne%22%3cjw@email.com%3e?subject..` Wrap the name in `%22` and the email has `%3c` before it and `%3e` after it and `%20` for spaces That will output: `"John Wayne"<jw@email.com>` Full list of URL Encoding here: <http://www.w3schools.com/tags/ref_urlencode.asp>
You can't set the receipt name on mailto links
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
``` <a href="mailto:lala lala2(astark1@unl.edu)?subject=MailTo Comments&cc=ASTARK1@UNL.EDU&bcc=id@internet.node">ddddd</a> ``` **Remember** to use only one ? (question mark), when providing multiple entries beyond e-mail address
This all depends on what mail client you use. I've tried that long before at Outlook express and it's ok. But after many years, I use Dream Mail and it will only bring in the mail address part while leave out the name part.
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
I tried ``` mailto:John Wayne<jw@email.com>?subject... ``` and it seems to work.
``` <a href="mailto:lala lala2(astark1@unl.edu)?subject=MailTo Comments&cc=ASTARK1@UNL.EDU&bcc=id@internet.node">ddddd</a> ``` **Remember** to use only one ? (question mark), when providing multiple entries beyond e-mail address
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
I tried ``` mailto:John Wayne<jw@email.com>?subject... ``` and it seems to work.
As mentioned in other answers, [RFC 2368](https://www.rfc-editor.org/rfc/rfc2368) allows the full `mailbox` syntax, which can be in `name-addr` (`display-name` plus `angle-addr`) form ([RFC 5322](https://www.rfc-editor.org/rfc/rfc5322#section-3.4)). Unfortunately, it was obsoleted by [RFC 6068](https://www.rfc-editor.o...
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
I tried ``` mailto:John Wayne<jw@email.com>?subject... ``` and it seems to work.
You can't set the receipt name on mailto links
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
``` <a href="mailto:lala lala2(astark1@unl.edu)?subject=MailTo Comments&cc=ASTARK1@UNL.EDU&bcc=id@internet.node">ddddd</a> ``` **Remember** to use only one ? (question mark), when providing multiple entries beyond e-mail address
You can't set the receipt name on mailto links
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
As mentioned in other answers, [RFC 2368](https://www.rfc-editor.org/rfc/rfc2368) allows the full `mailbox` syntax, which can be in `name-addr` (`display-name` plus `angle-addr`) form ([RFC 5322](https://www.rfc-editor.org/rfc/rfc5322#section-3.4)). Unfortunately, it was obsoleted by [RFC 6068](https://www.rfc-editor.o...
``` <a href="mailto:lala lala2(astark1@unl.edu)?subject=MailTo Comments&cc=ASTARK1@UNL.EDU&bcc=id@internet.node">ddddd</a> ``` **Remember** to use only one ? (question mark), when providing multiple entries beyond e-mail address
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
Try this: `mailto:%22John%20Wayne%22%3cjw@email.com%3e?subject..` Wrap the name in `%22` and the email has `%3c` before it and `%3e` after it and `%20` for spaces That will output: `"John Wayne"<jw@email.com>` Full list of URL Encoding here: <http://www.w3schools.com/tags/ref_urlencode.asp>
I tried ``` mailto:John Wayne<jw@email.com>?subject... ``` and it seems to work.
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
The original standard for `mailto:` links, [RFC 1738](https://www.rfc-editor.org/rfc/rfc1738), says this: > > A mailto URL takes the form: > > > > ``` > mailto:<rfc822-addr-spec> > > ``` > > where `<rfc822-addr-spec>` is (the encoding of an) `addr-spec`, as > specified in RFC 822 [[6](https://www.rfc-editor.org/...
This all depends on what mail client you use. I've tried that long before at Outlook express and it's ok. But after many years, I use Dream Mail and it will only bring in the mail address part while leave out the name part.
8,147,805
How do I set a proper name for the recipient when in HTML I want to use the "mailto" tag. Something like: ``` mailto:"John Wayne(jw@email.com)?subject.. ``` How do I achieve that ??
2011/11/16
[ "https://Stackoverflow.com/questions/8147805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486818/" ]
I tried ``` mailto:John Wayne<jw@email.com>?subject... ``` and it seems to work.
This all depends on what mail client you use. I've tried that long before at Outlook express and it's ok. But after many years, I use Dream Mail and it will only bring in the mail address part while leave out the name part.
1,530,420
How to calculate $\lim \_{n\rightarrow \infty }\left( \dfrac {n-3}{n}\right) ^{n}$, The answer is $e^{-3}$, I'm comfusing with the process...
2015/11/15
[ "https://math.stackexchange.com/questions/1530420", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242951/" ]
Hint: Just rewrite $$ \frac{n-3}{n} = 1-\frac{3}{n}. $$ Then multiply and divide the exponent by $3$...
> > $$\lim \_{n\rightarrow \infty }\left( \dfrac {n-3}{n}\right) ^{n}$$ > > > $$\lim \_{n\rightarrow \infty }\exp\left( n\ln \bigg(\dfrac {n-3}{n}\bigg)\right) $$ $$\exp\bigg(\lim \_{n\rightarrow \infty }\left( \dfrac {\ln(\frac{n-3}{n})}{1/n}\right) \bigg)$$ Lhopital: $$=\exp\bigg( \lim \_{n\rightarrow \infty ...
1,530,420
How to calculate $\lim \_{n\rightarrow \infty }\left( \dfrac {n-3}{n}\right) ^{n}$, The answer is $e^{-3}$, I'm comfusing with the process...
2015/11/15
[ "https://math.stackexchange.com/questions/1530420", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242951/" ]
Recall that: $$\forall n\in\mathbb{N},\left(\frac{n-3}{n}\right)^n=\exp\left(n\ln\left(1-\frac{3}{n}\right)\right).$$ Besides, one has: $$\ln\left(1-\frac{3}{n}\right)=-\frac{3}{n}+o\left(\frac{1}{n}\right).$$ Hence, one has: $$n\ln\left(1-\frac{3}{n}\right)\underset{n\to+\infty}{\longrightarrow}-3.$$ Since $\exp$ is c...
> > $$\lim \_{n\rightarrow \infty }\left( \dfrac {n-3}{n}\right) ^{n}$$ > > > $$\lim \_{n\rightarrow \infty }\exp\left( n\ln \bigg(\dfrac {n-3}{n}\bigg)\right) $$ $$\exp\bigg(\lim \_{n\rightarrow \infty }\left( \dfrac {\ln(\frac{n-3}{n})}{1/n}\right) \bigg)$$ Lhopital: $$=\exp\bigg( \lim \_{n\rightarrow \infty ...
955,031
Which datasource best supports multi-threading in Spring?
2009/06/05
[ "https://Stackoverflow.com/questions/955031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114194/" ]
To support multi-threading you would need to use a data source that supports connection pooling so that each thread can use its own connection. The most common database connection pools are [Commons DBCP](http://commons.apache.org/dbcp/) and [C3p0](http://sourceforge.net/projects/c3p0) and can be easily integrated wit...
JDBC Connections are [not thread-safe](http://www.ibm.com/developerworks/java/library/j-threads3.html). You have to manage that yourself. If you're using Spring in a web app, it's usually one thread per request. If you pool your connections, that will mean the thread gets its connection from the pool, uses it, and ret...
15,495,611
Following on from my question yesterday, I now have the code below somewhat successfully working. It allows me to change the first form item and submits it to 'process.php' in the background and turns the field green. However the trigger only works on the first form item, in this case "cstate". It doesn't trigger when ...
2013/03/19
[ "https://Stackoverflow.com/questions/15495611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204411/" ]
In your database, make a column like "alreadyInUse", mark it as true when a user makes a call and mark it as false, when the user will be done. While handling other users, always check whether alreadyInUse is false or not and if it's false, only then proceed further. I would suggest you to use threads and synchronizati...
You could use a select for update locking read for example: ``` $mysqli->autocommit(FALSE); $result = $mysqli->query("SELECT * FROM feed WHERE id = ? FOR UPDATE")->fetch_array(); //do stuff $mysqli->commit(); ``` or a named lock: ``` $result = $mysqli->query('SELECT GET_LOCK(?, 5) AS feedlock')->fetch_array(); i...
15,495,611
Following on from my question yesterday, I now have the code below somewhat successfully working. It allows me to change the first form item and submits it to 'process.php' in the background and turns the field green. However the trigger only works on the first form item, in this case "cstate". It doesn't trigger when ...
2013/03/19
[ "https://Stackoverflow.com/questions/15495611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204411/" ]
In your database, make a column like "alreadyInUse", mark it as true when a user makes a call and mark it as false, when the user will be done. While handling other users, always check whether alreadyInUse is false or not and if it's false, only then proceed further. I would suggest you to use threads and synchronizati...
I am second on to suggest proceed with the threads and synchronization, but don't think you need an extra column as your start can serve the same purpose and will save you some memory also.
15,495,611
Following on from my question yesterday, I now have the code below somewhat successfully working. It allows me to change the first form item and submits it to 'process.php' in the background and turns the field green. However the trigger only works on the first form item, in this case "cstate". It doesn't trigger when ...
2013/03/19
[ "https://Stackoverflow.com/questions/15495611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204411/" ]
I am second on to suggest proceed with the threads and synchronization, but don't think you need an extra column as your start can serve the same purpose and will save you some memory also.
You could use a select for update locking read for example: ``` $mysqli->autocommit(FALSE); $result = $mysqli->query("SELECT * FROM feed WHERE id = ? FOR UPDATE")->fetch_array(); //do stuff $mysqli->commit(); ``` or a named lock: ``` $result = $mysqli->query('SELECT GET_LOCK(?, 5) AS feedlock')->fetch_array(); i...
55,580,263
In this example code ``` (defvar mat (make-array (list 5 3) :initial-contents '((1 2 3) (4 5 6) (7 8 9) (10 11 12) (13 ...
2019/04/08
[ "https://Stackoverflow.com/questions/55580263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9081035/" ]
Macros work on syntax and thus `a` and `d` get bound to the symbols `ary` and `dim` and are of course not anything else than symbols that will be variables that evaluate to arrays and numbers after the macro has done its work and the expanded code actually runs. The expansion can be done at compile time so long befor...
A macro sees code. You cannot ask the source code what bindings it will have in the future. You can just call DESCRIBE to see what the value of `a` is. `a` has the symbol `ary` as a value. `array-dimensions` expects an actually array as an argument, not a symbol. ``` CL-USER 8 > (defun loop-over-dim (ary dim) ...
49,766,131
Hi I have a shell variable like this ``` input="/local/1/hadoop/MISDATA1/Risk_Analytics/blocker/risk/" ``` I want to replace the last part 'risk' to 'risk\_unzip' like this ``` /local/1/hadoop/MISDATA1/Risk_Analytics/blocker/risk_unzip/ ``` I tried like this ``` output="$( echo -e "$input" | tr 'risk' 'risk_unzi...
2018/04/11
[ "https://Stackoverflow.com/questions/49766131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8235369/" ]
If you are using bash: ``` output=${input/risk/risk_input} ``` If you want it to work with any Posix shell (in which case, the bash tag is incorrect), but you know that `risk` is the last component: ``` output=${input%risk/}risk_input/ ```
Following may help you on same. ``` echo "$input" | awk -F"/" '$(NF-1)=="risk"{$(NF-1)="risk_unzip"} 1' OFS="/" ```
49,766,131
Hi I have a shell variable like this ``` input="/local/1/hadoop/MISDATA1/Risk_Analytics/blocker/risk/" ``` I want to replace the last part 'risk' to 'risk\_unzip' like this ``` /local/1/hadoop/MISDATA1/Risk_Analytics/blocker/risk_unzip/ ``` I tried like this ``` output="$( echo -e "$input" | tr 'risk' 'risk_unzi...
2018/04/11
[ "https://Stackoverflow.com/questions/49766131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8235369/" ]
Try with `sed` like below:- ``` input="/local/1/hadoop/MISDATA1/Risk_Analytics/blocker/risk/" input=$(echo "$input" | sed 's/risk/risk_unzip/g') ```
Following may help you on same. ``` echo "$input" | awk -F"/" '$(NF-1)=="risk"{$(NF-1)="risk_unzip"} 1' OFS="/" ```
65,837,710
What I want to do is overload the delete operator for my class to automatically set the pointer to null after deleting it so I can safe delete it inside a member function, like that: ``` # include <iostream> class Buddy { public: Buddy(void) : _hp(100) { } ~Buddy(void) { std::cout << "Buddy is dead!" << ...
2021/01/22
[ "https://Stackoverflow.com/questions/65837710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13242312/" ]
With smart ptr abuse, you might do: ``` class Buddy { Buddy() = default; Buddy(const Buddy&) = delete; Buddy& operator=(const Buddy&) = delete; public: ~Buddy() { std::cout << "Buddy is dead!" << std::endl; } void getDamage(int amount) { _hp -= amount; if (_hp <= 0) ...
> > is there a proper way to set the pointer to null inside the class > like I want to do? > > > No, it is neither possible nor helpful. This ``` void operator delete(void * ptr) { ::delete (Buddy*)ptr; ptr = nullptr; } ``` does not work because the function receives `ptr` by value, so ...
65,837,710
What I want to do is overload the delete operator for my class to automatically set the pointer to null after deleting it so I can safe delete it inside a member function, like that: ``` # include <iostream> class Buddy { public: Buddy(void) : _hp(100) { } ~Buddy(void) { std::cout << "Buddy is dead!" << ...
2021/01/22
[ "https://Stackoverflow.com/questions/65837710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13242312/" ]
With smart ptr abuse, you might do: ``` class Buddy { Buddy() = default; Buddy(const Buddy&) = delete; Buddy& operator=(const Buddy&) = delete; public: ~Buddy() { std::cout << "Buddy is dead!" << std::endl; } void getDamage(int amount) { _hp -= amount; if (_hp <= 0) ...
No. It is not possible to overload `operator delete` so that it sets the pointer to null. This is because the standard requires the first parameter to `operator delete` (which is the pointer to be deleted) to have type `void*` and thus the `operator delete` only receives a copy of the pointer and cannot modify the ori...
10,447
[Jeff Skierka Designs post in facebook in may 2012](https://www.facebook.com/JeffSkierkaDesigns/photos/a.221660404619664.47826.221657327953305/221660407952997/?type=1) Dosen't this public display of the same idea by a different author before the presentation date of this publication constitutes nulifies this patent an...
2014/10/24
[ "https://patents.stackexchange.com/questions/10447", "https://patents.stackexchange.com", "https://patents.stackexchange.com/users/11767/" ]
A patent doesn't become spontaneously invalid by someone posting undiscovered killer prior art. Until they go to court with someone for infringement or a third party pays the fees for an interpartes review by the USPTO, the status of the patent doesn't change. In practice, if the patentee knew about this they would pro...
It could be prior art if published before the filing date unless derived from the inventor. See the Core77 web page showing the date [25 May 2012](http://www.core77.com/blog/furniture_design/things_that_look_like_other_things_mixtape_table_by_jeff_skierka_22544.asp). The design patent [USD697343](http://www.google.com/...
82,659
I have a 2013 Toyota Sequoia Platinum that I bought used primarily as a tow car. The tires that came on the Sequoia were Michelin 275 55 R20 111H which appeared to be in good shape. However, first trip out they failed---there were large chunks out of the rear tires. Unfortunately I was in the middle of nowhere at the m...
2021/04/25
[ "https://mechanics.stackexchange.com/questions/82659", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/63345/" ]
No, using a “magic” oil won’t repair the cat. But using the incorrect oil can easily damage it. Replacing the cat will be needed to get the car road legal.
Catalytic converter performs best when the exhaust gas temperature is between 300-400degree celsius. Engine oil, a part from providing lubrication to the piston-cylinder also reduces the cylinder temperature thus reducing the exhaust gas temperature slightly. But the change is not very significant. we can use specific ...
386,728
I am using path-based authentication with svnserve, but it is giving me permission errors if I specify a repository. However, if I just specify a path then it authenticates. In my authz file, if I do this it works: ``` [/my/path] my_username = r ``` If I do this, it does not work: ``` [svn:/my/path] my_username = ...
2008/12/22
[ "https://Stackoverflow.com/questions/386728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This probably means there's only one repository known to svnserve. Please give more details about your current configuration if you want a precise answer and not guesswork.
When you did svnadmin create \_\_\_\_\_\_\_\_\_ what ever you gave in that blank is your repository name. For path-based authorization you define your repository by name. You then can specifiy a path within the repository. I primarily use HTTP Auth, so I'm not sure if there are any differences with svnserv. Using H...
47,284,617
Hello I would like to know how to organize my code: **I have a simple user interface:** ``` export interface User { Account: string; Name: string; EMail: string; PictureURL: string; Department: string; JobTitle: string; Initials: string; Skype: string; Office: string; MobileNumber: string; DirectLine: string; IsChec...
2017/11/14
[ "https://Stackoverflow.com/questions/47284617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7855674/" ]
Assuming the rest of your code is correct, you need to change your logical test from Or to And ``` If b <> "y" And b <> "n" Then MsgBox ("The only allowable entry here is Y or N") End If ```
You can try this code below. It checks to see if the change was in either column A *or* column D and exits if neither column was changed. Then you know that the change was in either column A or column D and check exactly which column. Then you do the appropriate check and show the appropriate message box depending on ...
47,284,617
Hello I would like to know how to organize my code: **I have a simple user interface:** ``` export interface User { Account: string; Name: string; EMail: string; PictureURL: string; Department: string; JobTitle: string; Initials: string; Skype: string; Office: string; MobileNumber: string; DirectLine: string; IsChec...
2017/11/14
[ "https://Stackoverflow.com/questions/47284617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7855674/" ]
You have this line ``` If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub ``` So when they change anything in column D, it's not in A and the code exits before ever reaching your code for D
You can try this code below. It checks to see if the change was in either column A *or* column D and exits if neither column was changed. Then you know that the change was in either column A or column D and check exactly which column. Then you do the appropriate check and show the appropriate message box depending on ...
51,637,097
I want to calculate the scoring rate of each zone by using bygroup in pandas, but not sure how to do it: Suppose the df has two columns as: ``` Shot_type Shot_zone Goal Penalty_area Saved Penalty_area Goal Goal Box Saved Goal Box ``` Here I want to groupy by Shot\_zone, and calculate the...
2018/08/01
[ "https://Stackoverflow.com/questions/51637097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8459943/" ]
Using ``` pd.crosstab(df.Shot_type,df.Shot_zone,normalize='index') Out[662]: Shot_zone GoalBox Penalty_area Shot_type Goal 0.5 0.5 Saved 0.5 0.5 ```
One way is to binarize your `Shot_type` column, i.e. set to `True` if it equals `'Goal'`, and then use `GroupBy` + `mean`: ``` res = df.assign(Shot_type=df['Shot_type']=='Goal')\ .groupby('Shot_zone')['Shot_type'].mean() print(res) Shot_zone GoalBox 0.5 Penalty_area 0.5 Name: Shot_type, dtype: flo...
51,637,097
I want to calculate the scoring rate of each zone by using bygroup in pandas, but not sure how to do it: Suppose the df has two columns as: ``` Shot_type Shot_zone Goal Penalty_area Saved Penalty_area Goal Goal Box Saved Goal Box ``` Here I want to groupy by Shot\_zone, and calculate the...
2018/08/01
[ "https://Stackoverflow.com/questions/51637097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8459943/" ]
Can also `groupby` and `apply` ``` df.groupby('Shot_zone').Shot_type.apply(lambda s: '{}%'.format((s[s=='Goal']).size/(s.size) * 100)) Shot_zone Goal_Box 50.0% Penalty_area 50.0% ```
One way is to binarize your `Shot_type` column, i.e. set to `True` if it equals `'Goal'`, and then use `GroupBy` + `mean`: ``` res = df.assign(Shot_type=df['Shot_type']=='Goal')\ .groupby('Shot_zone')['Shot_type'].mean() print(res) Shot_zone GoalBox 0.5 Penalty_area 0.5 Name: Shot_type, dtype: flo...
51,637,097
I want to calculate the scoring rate of each zone by using bygroup in pandas, but not sure how to do it: Suppose the df has two columns as: ``` Shot_type Shot_zone Goal Penalty_area Saved Penalty_area Goal Goal Box Saved Goal Box ``` Here I want to groupy by Shot\_zone, and calculate the...
2018/08/01
[ "https://Stackoverflow.com/questions/51637097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8459943/" ]
Using ``` pd.crosstab(df.Shot_type,df.Shot_zone,normalize='index') Out[662]: Shot_zone GoalBox Penalty_area Shot_type Goal 0.5 0.5 Saved 0.5 0.5 ```
You can do the same using following: ``` data[data['Shot_type']=='Goal'].groupby(['Shot_zone'])['Shot_zone'].count() /data.groupby(['Shot_zone'])['Shot_zone'].count()) ```
51,637,097
I want to calculate the scoring rate of each zone by using bygroup in pandas, but not sure how to do it: Suppose the df has two columns as: ``` Shot_type Shot_zone Goal Penalty_area Saved Penalty_area Goal Goal Box Saved Goal Box ``` Here I want to groupy by Shot\_zone, and calculate the...
2018/08/01
[ "https://Stackoverflow.com/questions/51637097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8459943/" ]
Can also `groupby` and `apply` ``` df.groupby('Shot_zone').Shot_type.apply(lambda s: '{}%'.format((s[s=='Goal']).size/(s.size) * 100)) Shot_zone Goal_Box 50.0% Penalty_area 50.0% ```
You can do the same using following: ``` data[data['Shot_type']=='Goal'].groupby(['Shot_zone'])['Shot_zone'].count() /data.groupby(['Shot_zone'])['Shot_zone'].count()) ```
839,775
I’m using Ubuntu Linux. Below is the uname info ``` myuser@myinstance:~$ uname -a Linux myinstance 3.18.0-52-generic #123-Ubuntu SMP Fri Feb 19 14:27:58 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux ``` I’m trying to upgrade the version of Ruby on my machine, which is currently installed at ``` /usr/lib/ruby/1.9.1 ``` ...
2016/10/20
[ "https://askubuntu.com/questions/839775", "https://askubuntu.com", "https://askubuntu.com/users/609471/" ]
Why not use [ruby 2.3](https://packages.ubuntu.com/search?keywords=ruby2.3) which is available in the repositories for 16.04 and 17.10 with ``` sudo apt update ``` After the update is finished run: ``` sudo apt-get install ruby2.3 ruby2.3-dev ``` Or try ruby 2.4 or 2.5 You can get those via the brightbox PPA 1....
On Ubuntu 14.04 this worked for me to install `ruby 2.4.1` ``` sudo apt-get update sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev ``` Then install `rbenv` ...
72,567,915
I have a folder with about 30 images saved as '0001', '0002' etc... so on and forth and I have filenames that I want to rename them with in a list. I have written some code but am currently getting the error > > FileNotFoundError: [WinError 2] The system cannot find the file specified: '0001.jpg' -> 'Filename1' > > ...
2022/06/10
[ "https://Stackoverflow.com/questions/72567915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10991612/" ]
Some problems with your code... `onsubmit="event.preventDefault(); ...` ...prevents the form from submitting the file provided by `<input type="file" ...` to the form `action` target: *upload.php* conventionally, such as clicking the `submit` button. ~ ``` echo "..." . basename( $_FILES['uploadedFile']['name']) . "...
You can use this code to handle upload file ``` <?php if ($_SERVER['REQUEST_METHOD'] !== 'POST') { echo "Empty data, please select file"; die; } if (!isset($_FILES["fileupload"])) { echo "Wrong data struct"; die; } if ($_FILES["fileupload"]['error'] != 0) { echo "Uploaded...
60,655,022
say I have the following JSON: ``` { "selfExclusionMessage":{ "accountId":989898, "expired":"false", "userId":"37327513", "products": [ "arcade", "vegas", "ex" ] } } ``` How can I check that a specific value is present in the products key array. For example if "arcad...
2020/03/12
[ "https://Stackoverflow.com/questions/60655022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7195284/" ]
You just have to parse it with [JSON.parse](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/JSON/parse). The you can use [includes](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/includes) array prototype to check if the value is in the array. ``` cons...
``` function searchValue( json, value ) { return Array.isArray(json.selfExclusionMessage.products) && json.selfExclusionMessage.products.includes( value ); } ```
60,655,022
say I have the following JSON: ``` { "selfExclusionMessage":{ "accountId":989898, "expired":"false", "userId":"37327513", "products": [ "arcade", "vegas", "ex" ] } } ``` How can I check that a specific value is present in the products key array. For example if "arcad...
2020/03/12
[ "https://Stackoverflow.com/questions/60655022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7195284/" ]
You can use conditional (ternary) operator with `includes()`: ```js var jsonData = { "selfExclusionMessage":{ "accountId":989898, "expired":"false", "userId":"37327513", "products": [ "arcade", "vegas", "ex" ] } } function isExists(data, key, value){ retur...
``` function searchValue( json, value ) { return Array.isArray(json.selfExclusionMessage.products) && json.selfExclusionMessage.products.includes( value ); } ```
60,655,022
say I have the following JSON: ``` { "selfExclusionMessage":{ "accountId":989898, "expired":"false", "userId":"37327513", "products": [ "arcade", "vegas", "ex" ] } } ``` How can I check that a specific value is present in the products key array. For example if "arcad...
2020/03/12
[ "https://Stackoverflow.com/questions/60655022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7195284/" ]
How about ``` let o = JSON.parse(myJSON); for (let v of Object.values(o)) { if (Array.isArray(v)) return Array.includes("arcade"); else return false; } ``` Explanation: (1) Parse JSON into an object (2) check all object values for arrays (3) if there's an array, check to see if it has the desired value
``` function searchValue( json, value ) { return Array.isArray(json.selfExclusionMessage.products) && json.selfExclusionMessage.products.includes( value ); } ```
60,655,022
say I have the following JSON: ``` { "selfExclusionMessage":{ "accountId":989898, "expired":"false", "userId":"37327513", "products": [ "arcade", "vegas", "ex" ] } } ``` How can I check that a specific value is present in the products key array. For example if "arcad...
2020/03/12
[ "https://Stackoverflow.com/questions/60655022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7195284/" ]
```js var JSON = { "selfExclusionMessage": { "accountId": 989898, "expired": "false", "userId": "37327513", "products": [ "arcade", "vegas", "ex" ] } }; if ("products" in JSON.selfExclusionMessage) { console.log('Exist!'); if (JSON.selfExclusionMessage.products.includes("ve...
``` function searchValue( json, value ) { return Array.isArray(json.selfExclusionMessage.products) && json.selfExclusionMessage.products.includes( value ); } ```
355,266
I have the following circuit (AC regime): [![enter image description here](https://i.stack.imgur.com/oG2Uj.jpg)](https://i.stack.imgur.com/oG2Uj.jpg) I am given the current **I** in the branch **4-5**. I don't understand what happens with **Ig2** here. Is it annulled? Should the circuit look like this: [![enter imag...
2018/02/10
[ "https://electronics.stackexchange.com/questions/355266", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/144676/" ]
The current of Ig2 must flow through the short circuit between node 4 and 5. It has no other influence on the rest of the circuit. To see why, just apply superimposition, leaving only Ig2 active. You'll have Ig2 with its terminal shorted, so no voltage across them. Anything else connected between node 4 and 5 cannot b...
It looks to me that the current from IG2 can go two ways, against I(branch 4-5) producing what flows in there and also thru resistor Z1. Removing IG2 will affect the circuit and will change both the I(branch 4-5) and the current thru Z1. Additionally, all other components will be affected. So the current from IG2 goes...
41,479,062
My Task is to Hide/Unhide rows of an excel workbook on the basis of whether a string exists in a particular row or not. The problem I am facing is that it is taking me about 20 seconds to perform this task on 1000 Rows with the following code. The file might be having as many as 2k-3k rows and I want to reduce this loa...
2017/01/05
[ "https://Stackoverflow.com/questions/41479062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6092408/" ]
i Dont know much about ionic but seems error is in module ``` <ion-view view-title="My Page"> <ion-content> Hello! </ion-content> </ion-view> ``` according to error if you are using `ion-view` or any component in your app, than you must add that component in the main module. like in angular2 we did ...
ion-view is not an element like it says. Remove and the closing
41,479,062
My Task is to Hide/Unhide rows of an excel workbook on the basis of whether a string exists in a particular row or not. The problem I am facing is that it is taking me about 20 seconds to perform this task on 1000 Rows with the following code. The file might be having as many as 2k-3k rows and I want to reduce this loa...
2017/01/05
[ "https://Stackoverflow.com/questions/41479062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6092408/" ]
ion-view is a valid component in ionic version 1 and not available in version 2. In order to set image background you can set a css class and set 'background' attribute ``` <ion-content class="view-class"> Hello! </ion-content> ``` In your corresponding scss ``` .view-class { background: url("path_to_image") ...
ion-view is not an element like it says. Remove and the closing
41,479,062
My Task is to Hide/Unhide rows of an excel workbook on the basis of whether a string exists in a particular row or not. The problem I am facing is that it is taking me about 20 seconds to perform this task on 1000 Rows with the following code. The file might be having as many as 2k-3k rows and I want to reduce this loa...
2017/01/05
[ "https://Stackoverflow.com/questions/41479062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6092408/" ]
ion-view is a valid component in ionic version 1 and not available in version 2. In order to set image background you can set a css class and set 'background' attribute ``` <ion-content class="view-class"> Hello! </ion-content> ``` In your corresponding scss ``` .view-class { background: url("path_to_image") ...
i Dont know much about ionic but seems error is in module ``` <ion-view view-title="My Page"> <ion-content> Hello! </ion-content> </ion-view> ``` according to error if you are using `ion-view` or any component in your app, than you must add that component in the main module. like in angular2 we did ...
41,479,062
My Task is to Hide/Unhide rows of an excel workbook on the basis of whether a string exists in a particular row or not. The problem I am facing is that it is taking me about 20 seconds to perform this task on 1000 Rows with the following code. The file might be having as many as 2k-3k rows and I want to reduce this loa...
2017/01/05
[ "https://Stackoverflow.com/questions/41479062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6092408/" ]
i Dont know much about ionic but seems error is in module ``` <ion-view view-title="My Page"> <ion-content> Hello! </ion-content> </ion-view> ``` according to error if you are using `ion-view` or any component in your app, than you must add that component in the main module. like in angular2 we did ...
From the looks of it, I think the page or component you have created is in a separate module. Please add the IonicModule import to that module and import that module in app module. ``` import { NgModule } from "@angular/core"; import { ItemsComponent } from "./items/items"; import { ItemComponent } from "./item/item";...
41,479,062
My Task is to Hide/Unhide rows of an excel workbook on the basis of whether a string exists in a particular row or not. The problem I am facing is that it is taking me about 20 seconds to perform this task on 1000 Rows with the following code. The file might be having as many as 2k-3k rows and I want to reduce this loa...
2017/01/05
[ "https://Stackoverflow.com/questions/41479062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6092408/" ]
ion-view is a valid component in ionic version 1 and not available in version 2. In order to set image background you can set a css class and set 'background' attribute ``` <ion-content class="view-class"> Hello! </ion-content> ``` In your corresponding scss ``` .view-class { background: url("path_to_image") ...
From the looks of it, I think the page or component you have created is in a separate module. Please add the IonicModule import to that module and import that module in app module. ``` import { NgModule } from "@angular/core"; import { ItemsComponent } from "./items/items"; import { ItemComponent } from "./item/item";...
111,084
Sorry if my question seams trivial, but I wonder if it is actually possible. In Drupal 7, with the i18n module I can easily translate a content entry, but from this, I feel like it creates a fork of my language source content. So my update on the source language are no longer reflected on the translated content. Exam...
2014/04/24
[ "https://drupal.stackexchange.com/questions/111084", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/25052/" ]
The best way to do so is by configuring the multilingual parameter of your node type as "Enabled, with field translation". The steps : * enable the module i18n\_fields * edit your node type * go to publishing options tab * set Multilingual support => "Enabled, with field translation" This way, there will be only o...
I haven't tried it myself but perhaps the [Entity Translation](https://drupal.org/project/entity_translation) module is what you want to be looking at?
56,216,201
``` #include <iostream> using namespace std; int main() { int x = 5; int* y = &x; int& z = y; return 0; } ``` For this code, the compiler gives an error on `int& z = y;` saying: ``` ./example.cpp: In function 'int main()': ./example.cpp:7:11: error: invalid conversion from 'int*' to 'int' [-fpermis...
2019/05/20
[ "https://Stackoverflow.com/questions/56216201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6397798/" ]
C++ has a long history of errors stemming from implicit conversions. Have a look at Stephen Dewhurst's book "C++ Gotchas"; the longest chapter is on conversions. This topic is literally full of pitfalls, and we should be glad that the above must be typed out explicitly. That being said... > > Are there any corner cas...
You should think a C++ reference as an alias rather than a pointer. This is different from Java references which looks more like a pointer. Then the compiler message is perfectly clear: the aliased object should be an int and you try to reference an int\*. For more informations about references: <https://isocpp.org/wi...
56,216,201
``` #include <iostream> using namespace std; int main() { int x = 5; int* y = &x; int& z = y; return 0; } ``` For this code, the compiler gives an error on `int& z = y;` saying: ``` ./example.cpp: In function 'int main()': ./example.cpp:7:11: error: invalid conversion from 'int*' to 'int' [-fpermis...
2019/05/20
[ "https://Stackoverflow.com/questions/56216201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6397798/" ]
C++ has a long history of errors stemming from implicit conversions. Have a look at Stephen Dewhurst's book "C++ Gotchas"; the longest chapter is on conversions. This topic is literally full of pitfalls, and we should be glad that the above must be typed out explicitly. That being said... > > Are there any corner cas...
A pointer can be null, a reference cannot. **Note : you can't do that** ``` int* ptr = nullptr; int& ref = *ptr; // dereferencing a nullptr is UB ``` If C++ allow implicite conversion for reference to pointer it mean than it will implicitely deference a pointer, which can be UB.
56,216,201
``` #include <iostream> using namespace std; int main() { int x = 5; int* y = &x; int& z = y; return 0; } ``` For this code, the compiler gives an error on `int& z = y;` saying: ``` ./example.cpp: In function 'int main()': ./example.cpp:7:11: error: invalid conversion from 'int*' to 'int' [-fpermis...
2019/05/20
[ "https://Stackoverflow.com/questions/56216201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6397798/" ]
A pointer can be null, a reference cannot. **Note : you can't do that** ``` int* ptr = nullptr; int& ref = *ptr; // dereferencing a nullptr is UB ``` If C++ allow implicite conversion for reference to pointer it mean than it will implicitely deference a pointer, which can be UB.
You should think a C++ reference as an alias rather than a pointer. This is different from Java references which looks more like a pointer. Then the compiler message is perfectly clear: the aliased object should be an int and you try to reference an int\*. For more informations about references: <https://isocpp.org/wi...
6,092,149
I temporarily disabled landscape orientations in my iPhone app while I fixed a problem with an image. Now, for the life of me, I can't get any pages to AutoRotate to either landscape orientation. It worked fine previously. I have all 4 orientations identified in the `UISupportedInterfaceOrientations` in the `info.plist...
2011/05/23
[ "https://Stackoverflow.com/questions/6092149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/667937/" ]
If you are certain that each viewController has ``` -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } ``` then you may want to try deleting the `Build/` directory, selecting `clean all targets` in the build options, and then relaunching t...
You may want to clean all targets - the updated plist may not be getting copied into the app bundle. If this is on the device, you may try deleting the app from the device as well.
72,909
I joined a research group of a faculty member in 201x, and worked with her for three years. During that time, I collaborated with a large hospital to perform research in the domain of medical informatics. I spoke about my research at two conferences; one was a talk, and the other was a poster presentation. My advisor a...
2016/07/17
[ "https://academia.stackexchange.com/questions/72909", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/58171/" ]
I suggest you respond to the student and your former advisor roughly as follows: * You do not consent to their proposal to publish the paper, as prepared, with you listed as 4th author. You believe that the substance of your contribution entitles you to first authorship, either on this paper, or on another paper to be...
A paper must not be published without the (explicit or implicit) consent of all coauthors. This holds true for preprint servers as the arXiv just as for journals, etc. Given the state of your relationship, there is no basis for assuming implicit consent of your former supervisor. Thus, submitting the paper to the arX...
72,909
I joined a research group of a faculty member in 201x, and worked with her for three years. During that time, I collaborated with a large hospital to perform research in the domain of medical informatics. I spoke about my research at two conferences; one was a talk, and the other was a poster presentation. My advisor a...
2016/07/17
[ "https://academia.stackexchange.com/questions/72909", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/58171/" ]
A paper must not be published without the (explicit or implicit) consent of all coauthors. This holds true for preprint servers as the arXiv just as for journals, etc. Given the state of your relationship, there is no basis for assuming implicit consent of your former supervisor. Thus, submitting the paper to the arX...
The advise you're getting from other answerers is fine -- though I have a few points to offer. In this analysis, I'm entirely leaving the circumstances of your separation from the school out of the scenario, as there are quite a few sides to stories like this, and chances are your department and faculty don't have the ...
72,909
I joined a research group of a faculty member in 201x, and worked with her for three years. During that time, I collaborated with a large hospital to perform research in the domain of medical informatics. I spoke about my research at two conferences; one was a talk, and the other was a poster presentation. My advisor a...
2016/07/17
[ "https://academia.stackexchange.com/questions/72909", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/58171/" ]
I suggest you respond to the student and your former advisor roughly as follows: * You do not consent to their proposal to publish the paper, as prepared, with you listed as 4th author. You believe that the substance of your contribution entitles you to first authorship, either on this paper, or on another paper to be...
The advise you're getting from other answerers is fine -- though I have a few points to offer. In this analysis, I'm entirely leaving the circumstances of your separation from the school out of the scenario, as there are quite a few sides to stories like this, and chances are your department and faculty don't have the ...
44,384,959
You know, when there are for example two planes in the same position, in different colors, they will start kind of battling against each other so some parts are another texture and some parts other. I think that Scenekit's renderingOrder should fix this, but i couldn't get it to work. I gave planeA 0 for renderingOrde...
2017/06/06
[ "https://Stackoverflow.com/questions/44384959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8118419/" ]
This is commonly referred to as Z-fighting, and has been an issue in 3D for as long as 3D has existed. *There are two basic, and not ideal, ways to deal with this, for what I currently understand of your situation:* **1.** Remove the plane you don't want to be seeing, until you need it, probably when the camera goes...
Having a similar problem with overlapping boxes representing vertical planes. Here's a solution that might work for you if you're not using transparent nodes (I do, so my issue remains, I'll update when it's resolved): Use a flattened node that contains all your planes geometries. You can flatten all node's childrenu...
44,384,959
You know, when there are for example two planes in the same position, in different colors, they will start kind of battling against each other so some parts are another texture and some parts other. I think that Scenekit's renderingOrder should fix this, but i couldn't get it to work. I gave planeA 0 for renderingOrde...
2017/06/06
[ "https://Stackoverflow.com/questions/44384959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8118419/" ]
This is commonly referred to as Z-fighting, and has been an issue in 3D for as long as 3D has existed. *There are two basic, and not ideal, ways to deal with this, for what I currently understand of your situation:* **1.** Remove the plane you don't want to be seeing, until you need it, probably when the camera goes...
### For 2022. Fortunately the solution is now simple, tweak the use of the depth buffer. ``` for i in 0..<theRelevantNodes.count { let n = theRelevantNodes[i] n.geometry?.firstMaterial?.readsFromDepthBuffer = false } ``` Typically you just want to disable using the depth buffer information, and fortunately t...
81,594
I'm currently trying to understand Fourier transform and I've got curious about why Fourier transform exists. Let's suppose that we have a 10 seconds of non-periodic wave. For example: [![a nonperiodic wave](https://i.stack.imgur.com/e0HXW.png)](https://i.stack.imgur.com/e0HXW.png) As far as I understand, the concep...
2022/02/18
[ "https://dsp.stackexchange.com/questions/81594", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/61114/" ]
There's a few misconceptions here: > > the concept of Fourier transform is to think the wave's period is infinite > > > No, that's not the case. Also, from an argument by limits, it would follow that any signal with infinite period *must* be a constant. Also, Fourier theory inherits that *any* signal that's peri...
Fourier Transform in [wavetable synthesizers like Serum](https://www.youtube.com/watch?v=B2sycKI58kE) allows you to make very fine tunings to the waves harmonics where you can create a filter-like sound or do additive synthesis adding in frequencies here and there to make new textures. [Here's some info by ADSR](https:...
20,873,235
I have researched this for several days now and I just can't get anything to work. I am using php to query a MySQL database. I'm getting a response via ajax but I need to be able to use the response. For example I need to take the response multiplied by 5. I can show the response in my HTML but I can't do anything to m...
2014/01/01
[ "https://Stackoverflow.com/questions/20873235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2975225/" ]
parseInt returns a number, so you need to do this: ``` stockPriceApple = parseInt(result,10); $('#responsecontainerApple').html(stockPriceApple); ``` As the content of your success function
if you want to read data into your success function, you first have to do: `json_encode($result)` at server-side (PHP) and then decode it in your java-script success function like: `var str = JSON.parse(result); alert str[0]` for example: server side php ``` function sendjson(){ $data=array(0=>'zero'...
6,176,663
I am using Blogspot and My code is as follows: ``` //JQuery Code above <head> tag: <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http:/...
2011/05/30
[ "https://Stackoverflow.com/questions/6176663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450320/" ]
One can follow the below procedure. 1. Empty a register (for instance, `"a`). ``` qaq ``` or ``` :let @a = '' ``` 2. Run the command1 ``` :g/\d\+/norm!//e^Mv??^M"Ay ``` If it is necessary to append a new line character after each of the matches, run this command instead:2 ``` :g/\d\+/norm!//e^Ma^M^[??^Mv$"Ayu...
If your text obeys the pattern you posted you can start visual mode blockwise with `Ctrl`+`V` and select from `1` in the first line to `9` in the last line. Then you just copy to the `+` register, which is the system clipboard, by typing `"+y`. Edit: I have tested this new solution for the text: ``` abc123 456efg hi...
6,176,663
I am using Blogspot and My code is as follows: ``` //JQuery Code above <head> tag: <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http:/...
2011/05/30
[ "https://Stackoverflow.com/questions/6176663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450320/" ]
If your text obeys the pattern you posted you can start visual mode blockwise with `Ctrl`+`V` and select from `1` in the first line to `9` in the last line. Then you just copy to the `+` register, which is the system clipboard, by typing `"+y`. Edit: I have tested this new solution for the text: ``` abc123 456efg hi...
Use this command to extract all URLs, and append to the end of file: ``` :let urls = [] | %s/http:[^"]*/\=add(urls, submatch(0))[-1]/g | call setline(line('$')+1, urls) ```
6,176,663
I am using Blogspot and My code is as follows: ``` //JQuery Code above <head> tag: <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http:/...
2011/05/30
[ "https://Stackoverflow.com/questions/6176663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450320/" ]
One can follow the below procedure. 1. Empty a register (for instance, `"a`). ``` qaq ``` or ``` :let @a = '' ``` 2. Run the command1 ``` :g/\d\+/norm!//e^Mv??^M"Ay ``` If it is necessary to append a new line character after each of the matches, run this command instead:2 ``` :g/\d\+/norm!//e^Ma^M^[??^Mv$"Ayu...
Use this command to extract all URLs, and append to the end of file: ``` :let urls = [] | %s/http:[^"]*/\=add(urls, submatch(0))[-1]/g | call setline(line('$')+1, urls) ```
2,798,073
We have $y' = x/y$, which is a first-order homogeneous differential equation. It can be solved by rearranging to $y\ dy = x\ dx$ and then integrating both parts which yields that $y = \pm\sqrt{x^2+c}$ . Now if we use the substitution $y=ux\implies y'=u'x+u,$ and rewrite the differential equation as $$u'x+u=\frac1u$$...
2018/05/27
[ "https://math.stackexchange.com/questions/2798073", "https://math.stackexchange.com", "https://math.stackexchange.com/users/402830/" ]
When you rearranged your equation to get $$(\frac{1}{1/u-u})du=(1/x)dx$$ you have implicitly assumed that $u \ne \pm 1$ so $u=\pm 1$ is out of question.
Note that for the substitution $y=ux$ $$u'x+u=\frac 1 u \implies \int \frac {u}{1-u^2}du=\int \frac {dx}x$$ Then for $( u\neq \pm1,0)$ $$-\frac 12 \int \frac {-2u}{1-u^2}du=\int \frac {dx}x \implies 1-u^2=\frac K{x^2}$$ $$\ln(1-u^2)=-2\ln(x)+K \implies 1-u^2 =e^{-2\ln(x)+K}$$ $$\implies 1-u^2=\frac K{x^2}$$ $$\implie...
71,234,434
currently i am putting the full url in urlist i want the only string after pageno in the urlist and the program should go on rest as it as. [https://bidplus.gem.gov.in/bidlists?bidlists&page\_no=\*\*AMCR24yMNFkfoXF3wKPmGMy\_wV8TJPAlxm6oWiTHGOI\*](https://bidplus.gem.gov.in/bidlists?bidlists&page_no=**AMCR24yMNFkfoXF3w...
2022/02/23
[ "https://Stackoverflow.com/questions/71234434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11230192/" ]
You could try the following: ``` const italics = document.querySelectorAll('em'); italics.forEach(italic => { italic.style.backgroundColor = '#d9f9f9'; }); ```
Your first suggestion says `".em"` where it should say `"em"`. Your seconds suggestion says `em` where it should say `"em"`.
71,234,434
currently i am putting the full url in urlist i want the only string after pageno in the urlist and the program should go on rest as it as. [https://bidplus.gem.gov.in/bidlists?bidlists&page\_no=\*\*AMCR24yMNFkfoXF3wKPmGMy\_wV8TJPAlxm6oWiTHGOI\*](https://bidplus.gem.gov.in/bidlists?bidlists&page_no=**AMCR24yMNFkfoXF3w...
2022/02/23
[ "https://Stackoverflow.com/questions/71234434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11230192/" ]
See [querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll): Notices this method return an array, so we should loop it: ``` var emList = document.querySelectorAll('em'); [].forEach.call(emList , function(em) { // do whatever em.style.color = "red"; }); ```
Your first suggestion says `".em"` where it should say `"em"`. Your seconds suggestion says `em` where it should say `"em"`.
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
loop over the hashmap, and count the number of repetitions. ``` for(Integer value:myMap.values() ){ Integer count = 1; if(countMap.contains(value)){ count = countMap.get(value); count++; } countMap.put(value, count); } ``` then loop over the result map, and find the max(s): ``` Integer maxValue=0;...
Simple solution is you need to write your own put method for getting repeated values **for repeated values** ``` put(String x, int i){ List<Integer> list = map.get(x); if(list == null){ list = new ArrayList<Integer>(); map.put(x, list); } list.add(i); ``` } So, in this case, map to ...
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
loop over the hashmap, and count the number of repetitions. ``` for(Integer value:myMap.values() ){ Integer count = 1; if(countMap.contains(value)){ count = countMap.get(value); count++; } countMap.put(value, count); } ``` then loop over the result map, and find the max(s): ``` Integer maxValue=0;...
We can use a number of simple methods to do this. First, we can define a method that counts elements, and returns a map from the value to its occurrence count: ``` Map<T, Integer> countAll(Collection<T> c){ return c.stream().collect(groupingByConcurrent(k->k, Collectors.counting())); } ``` Then, to filter out a...
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
loop over the hashmap, and count the number of repetitions. ``` for(Integer value:myMap.values() ){ Integer count = 1; if(countMap.contains(value)){ count = countMap.get(value); count++; } countMap.put(value, count); } ``` then loop over the result map, and find the max(s): ``` Integer maxValue=0;...
Try this simple method: ``` public String getMapKeyWithHighestValue(HashMap<String, Integer> map) { String keyWithHighestVal = ""; // getting the maximum value in the Hashmap int maxValueInMap = (Collections.max(map.values())); //iterate through the map to get the key that corresponds to the maximum value in the Ha...
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
Don't reinvent the wheel and use the `frequency` method of the `Collections` class: ``` public static int frequency(Collection<?> c, Object o) ``` If you need to *count* the occurrences for all values, use a Map and loop cleverly :) Or put your values in a Set and loop on each element of the set with the `frequency`...
Simple solution is you need to write your own put method for getting repeated values **for repeated values** ``` put(String x, int i){ List<Integer> list = map.get(x); if(list == null){ list = new ArrayList<Integer>(); map.put(x, list); } list.add(i); ``` } So, in this case, map to ...
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
Don't reinvent the wheel and use the `frequency` method of the `Collections` class: ``` public static int frequency(Collection<?> c, Object o) ``` If you need to *count* the occurrences for all values, use a Map and loop cleverly :) Or put your values in a Set and loop on each element of the set with the `frequency`...
We can use a number of simple methods to do this. First, we can define a method that counts elements, and returns a map from the value to its occurrence count: ``` Map<T, Integer> countAll(Collection<T> c){ return c.stream().collect(groupingByConcurrent(k->k, Collectors.counting())); } ``` Then, to filter out a...
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
Don't reinvent the wheel and use the `frequency` method of the `Collections` class: ``` public static int frequency(Collection<?> c, Object o) ``` If you need to *count* the occurrences for all values, use a Map and loop cleverly :) Or put your values in a Set and loop on each element of the set with the `frequency`...
Try this simple method: ``` public String getMapKeyWithHighestValue(HashMap<String, Integer> map) { String keyWithHighestVal = ""; // getting the maximum value in the Hashmap int maxValueInMap = (Collections.max(map.values())); //iterate through the map to get the key that corresponds to the maximum value in the Ha...
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
Simple solution is you need to write your own put method for getting repeated values **for repeated values** ``` put(String x, int i){ List<Integer> list = map.get(x); if(list == null){ list = new ArrayList<Integer>(); map.put(x, list); } list.add(i); ``` } So, in this case, map to ...
Try this simple method: ``` public String getMapKeyWithHighestValue(HashMap<String, Integer> map) { String keyWithHighestVal = ""; // getting the maximum value in the Hashmap int maxValueInMap = (Collections.max(map.values())); //iterate through the map to get the key that corresponds to the maximum value in the Ha...
23,264,466
I've a php object that outputs as : ``` Array ( [0] => stdClass Object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ...
2014/04/24
[ "https://Stackoverflow.com/questions/23264466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443702/" ]
We can use a number of simple methods to do this. First, we can define a method that counts elements, and returns a map from the value to its occurrence count: ``` Map<T, Integer> countAll(Collection<T> c){ return c.stream().collect(groupingByConcurrent(k->k, Collectors.counting())); } ``` Then, to filter out a...
Try this simple method: ``` public String getMapKeyWithHighestValue(HashMap<String, Integer> map) { String keyWithHighestVal = ""; // getting the maximum value in the Hashmap int maxValueInMap = (Collections.max(map.values())); //iterate through the map to get the key that corresponds to the maximum value in the Ha...
19,477,922
I was reluctant to post this question at first as it seems like functionality that could be pretty fundamental to the way in which TFS manages work items, but I cannot find anything documented that covers it; how do I categorise TFS work items (more specifically, new tasks)? I've created a bunch of tasks. Some may fal...
2013/10/20
[ "https://Stackoverflow.com/questions/19477922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
There are a handful of ways that people typically categorize/organize their Tasks: 1. Group tasks by User Story. This is done by linking the WI's, and this information will show up in WI Queries, and on the Task Board (task board only available in tfs 2012 and up). 2. Use the Area field and Area hierarchy to categoriz...
Surprisingly difficult to find anything on this. I was already using 'linked item' as I should, the problem was the query. I created a new query and set the type to 'Tree...' so that the hierarchical structure was pulled back in away that mimicked a tasks and sub-tasks structure.
9,711,185
i have a Class called "Services" in the App\_code folder that contain Method like this: ``` public static ???? GetAllCustomers() { string conn = ConfigurationManager.ConnectionStrings["ConnectToDB"].ConnectionString; using (SqlConnection connection= new SqlConnection(conn)) { using (SqlCommand cmd...
2012/03/14
[ "https://Stackoverflow.com/questions/9711185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245814/" ]
Why not have your program open a [Unix](http://en.wikipedia.org/wiki/Unix_domain_socket) or [Network](http://en.wikipedia.org/wiki/Network_socket) Socket, and build some kind of interface to allow systems to connect and request the status as needed?
What about creating a shared memory segment and opening that with your programs? One thing, all people sharing the shared memory segment MUST be on the same system.
9,711,185
i have a Class called "Services" in the App\_code folder that contain Method like this: ``` public static ???? GetAllCustomers() { string conn = ConfigurationManager.ConnectionStrings["ConnectToDB"].ConnectionString; using (SqlConnection connection= new SqlConnection(conn)) { using (SqlCommand cmd...
2012/03/14
[ "https://Stackoverflow.com/questions/9711185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245814/" ]
Why not have your program open a [Unix](http://en.wikipedia.org/wiki/Unix_domain_socket) or [Network](http://en.wikipedia.org/wiki/Network_socket) Socket, and build some kind of interface to allow systems to connect and request the status as needed?
Anything in /dev/shm, it's in ram so it's fast, and no syncing issues.