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
39,622,332
I have a data file that I need to read in C. It is compirsed of alternating 16-bit integer stored in binary form, and I need only the first column (ie, every other entry starting at 0) I have a simple python script that reads the files accurately: ``` import numpy as np fname = '[filename]' columntypes = np.dtype([(...
2016/09/21
[ "https://Stackoverflow.com/questions/39622332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2521423/" ]
Perform the endian swap as unsigned math and then assign to `double`. ``` void swapByteOrder_int16(double *current, const int16_t *rawsignal, size_t length) { for (size_t i = 0; i < length; i++) { int16_t x = rawsignal[2*i]; x = (x*1u << 8) | (x*1u >> 8); current[i] = x; } } ```
I prefer this mask and shift combination: ``` current[i] = ((rawsignal[2*i] & 0x00ff) << 8) | (rawsignal[2*i] >> 8) ```
39,622,332
I have a data file that I need to read in C. It is compirsed of alternating 16-bit integer stored in binary form, and I need only the first column (ie, every other entry starting at 0) I have a simple python script that reads the files accurately: ``` import numpy as np fname = '[filename]' columntypes = np.dtype([(...
2016/09/21
[ "https://Stackoverflow.com/questions/39622332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2521423/" ]
Perform the endian swap as unsigned math and then assign to `double`. ``` void swapByteOrder_int16(double *current, const int16_t *rawsignal, size_t length) { for (size_t i = 0; i < length; i++) { int16_t x = rawsignal[2*i]; x = (x*1u << 8) | (x*1u >> 8); current[i] = x; } } ```
As suggested by several people, doing the shifts as unsigned does the trick. I am answering this with my implementation just for the sake of completeness since I tweaked it a little from the accepted answer: ``` void swapByteOrder_int16(double *current, uint16_t *rawsignal, int64_t length) { union int16bits bitval...
39,622,332
I have a data file that I need to read in C. It is compirsed of alternating 16-bit integer stored in binary form, and I need only the first column (ie, every other entry starting at 0) I have a simple python script that reads the files accurately: ``` import numpy as np fname = '[filename]' columntypes = np.dtype([(...
2016/09/21
[ "https://Stackoverflow.com/questions/39622332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2521423/" ]
I prefer this mask and shift combination: ``` current[i] = ((rawsignal[2*i] & 0x00ff) << 8) | (rawsignal[2*i] >> 8) ```
Swapping bits with unsigned types will make things much easier: ``` void swapByteOrder_int16(double *current, void const *rawsignal_, size_t length) { uint16_t const *rawsignal = rawsignal_; size_t i; for (i=0; i<length; i++) { uint16_t tmp = rawsignal[2*i]; tmp = ((tmp >> 8) & 0xffu) | (...
39,622,332
I have a data file that I need to read in C. It is compirsed of alternating 16-bit integer stored in binary form, and I need only the first column (ie, every other entry starting at 0) I have a simple python script that reads the files accurately: ``` import numpy as np fname = '[filename]' columntypes = np.dtype([(...
2016/09/21
[ "https://Stackoverflow.com/questions/39622332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2521423/" ]
As suggested by several people, doing the shifts as unsigned does the trick. I am answering this with my implementation just for the sake of completeness since I tweaked it a little from the accepted answer: ``` void swapByteOrder_int16(double *current, uint16_t *rawsignal, int64_t length) { union int16bits bitval...
Swapping bits with unsigned types will make things much easier: ``` void swapByteOrder_int16(double *current, void const *rawsignal_, size_t length) { uint16_t const *rawsignal = rawsignal_; size_t i; for (i=0; i<length; i++) { uint16_t tmp = rawsignal[2*i]; tmp = ((tmp >> 8) & 0xffu) | (...
69,503,373
in our use case , we must fetch data from scylladb and put into Elasticsearch. if we take record one by one, it must take too much time. i found scylladb no binlog,right? so , do you have better suggestion?
2021/10/09
[ "https://Stackoverflow.com/questions/69503373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8317112/" ]
You might want to look at using Change Data Capture in Scylla, then using the CDC tables to feed a Kafka topic that will populate Elasticsearch. ScyllaDB's CDC connector for Kafka is built on Debezium. You can read more about it here. <https://debezium.io/blog/2021/09/22/deep-dive-into-a-debezium-community-connector-...
And if you want read everything on top of live additions using CDC, you can just write a sample scala spark application, that will just load everything needing a fulltext search from Scylla to Elastic (sample apps are on the internet or have a look at series of blogs around Scylla migrator, which explain how to properl...
43,000
I am trying to extend a volume, let's call it `/dev/vol1`. I see the initial volume size is 500MB when I call: `df --block-size=M /dev/vol1` then to extend it 100MB more I call: ``` lvextend -L+100M /dev/vol1 resize2fs /dev/vol1 ``` but when I check the size again with `df --block-size=M /dev/vol1` I get back 59...
2012/07/13
[ "https://unix.stackexchange.com/questions/43000", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/11897/" ]
You can misuse **/root/.ssh/rc** for your purpose (see man sshd) and include a `mailx` command there.
~/.bash\_profile is used, if bash is invoked as an interactive login shell. ~/.bashrc is used for non-login shells. However, using that file is not a reliable, because attacker could require that the shell initialization files are not read at all.
43,000
I am trying to extend a volume, let's call it `/dev/vol1`. I see the initial volume size is 500MB when I call: `df --block-size=M /dev/vol1` then to extend it 100MB more I call: ``` lvextend -L+100M /dev/vol1 resize2fs /dev/vol1 ``` but when I check the size again with `df --block-size=M /dev/vol1` I get back 59...
2012/07/13
[ "https://unix.stackexchange.com/questions/43000", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/11897/" ]
You can misuse **/root/.ssh/rc** for your purpose (see man sshd) and include a `mailx` command there.
From the sshd man page, 'authorized\_keys' section: > > command="command" > > > Specifies that the command is executed whenever this key is used for > authentication. The command supplied by the user > (if any) is ignored. The command is run on a pty if the client requests a pty; otherwise it is run without a tty...
4,782,536
Is there any way to prevent a ASP.Net Panel from rendering a DIV?
2011/01/24
[ "https://Stackoverflow.com/questions/4782536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157569/" ]
You can set the div to be a server-side control and then access it through the code-behind: ``` <div id="myDiv" runat="server">Some Content</div> ``` And then wherever you want to set the visibility: ``` var control = Page.FindControl("myDiv") as HtmlGenericControl; control.Visible = false; ```
as reflector says: ``` public Panel() : base(HtmlTextWriterTag.Div) { } ``` inherit Panel in your class and make constructor with tag you need.
261,090
In an exercise i found, a supposed atom called fictitious (Fi) has the following energy levels: [![Fi](https://i.stack.imgur.com/66UID.jpg)](https://i.stack.imgur.com/66UID.jpg) Then i´m asked: A) The energies of the emitted photons after a gas of Fi is bombarded with electrons with a kinetic energy of 3.7 eV B) If...
2016/06/06
[ "https://physics.stackexchange.com/questions/261090", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/37104/" ]
I do not know almost anything about string theory, but I can say something from the general quantum theory viewpoint. First of all you stated Malament's theorem hypotheses into a not very precise form. The sets $\Delta$ are assumed to be subsets of a 3D **spacelike** surface $\Sigma$ (the rest space of an observer) w...
The string action $$ S\_p = -T\int d\tau d\sigma (-\gamma)\gamma^{ab}g\_{\mu\nu}\partial\_aX^\mu\partial\_bX^\nu, $$ or Poyakov action, is evaluated in a path integral $Z = \int{\cal D}[X]e^{-iS}$, or defines states $$ |\psi\rangle = \int{\cal D}[X]e^{-iS}|n\rangle $$ on a Fock basis. In the light cone gauge, $X^\pm =...
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
Try ContentFlow: <http://www.jacksasylum.eu/ContentFlow/> Here is an example that is working on my iPhone : <http://www.majes.fr/>
You could try xFlow! <http://xflow.pwhitrow.com>
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
Try ContentFlow: <http://www.jacksasylum.eu/ContentFlow/> Here is an example that is working on my iPhone : <http://www.majes.fr/>
I mainly stick with native App development, so I don't know if there is an existing cover flow implementation, but using [Dashcode Parts](http://developer.apple.com/safari/library/documentation/AppleApplications/Conceptual/Dashcode_UserGuide/Contents/Resources/en.lproj/PartsReference/PartsReference.html#//apple_ref/doc...
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
This is the best one which i found till now ;) [Coverflow](http://addyosmani.com/blog/jqueryuicoverflow/#more-1785)
This might help you: <http://paulbakaus.com/2008/05/31/coverflow-anyone/> Though it doesn't seem that there is any official way to do it because CSS transforms only all a 2d matrix, so you can't get a trapezium shape.
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
**This is a cross-browser implementation of Cover Flow: <http://luwes.co/labs/js-cover-flow/>** The primary mode works in HTML5 (JavaScript/CSS) and it has a fallback for older browsers in flash. It supports mobile, you can flip through the covers with a simple swipe gesture. Tested on: Safari, Chrome, Firefox, Opera...
I mainly stick with native App development, so I don't know if there is an existing cover flow implementation, but using [Dashcode Parts](http://developer.apple.com/safari/library/documentation/AppleApplications/Conceptual/Dashcode_UserGuide/Contents/Resources/en.lproj/PartsReference/PartsReference.html#//apple_ref/doc...
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
This might help you: <http://paulbakaus.com/2008/05/31/coverflow-anyone/> Though it doesn't seem that there is any official way to do it because CSS transforms only all a 2d matrix, so you can't get a trapezium shape.
I mainly stick with native App development, so I don't know if there is an existing cover flow implementation, but using [Dashcode Parts](http://developer.apple.com/safari/library/documentation/AppleApplications/Conceptual/Dashcode_UserGuide/Contents/Resources/en.lproj/PartsReference/PartsReference.html#//apple_ref/doc...
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
This might help you: <http://paulbakaus.com/2008/05/31/coverflow-anyone/> Though it doesn't seem that there is any official way to do it because CSS transforms only all a 2d matrix, so you can't get a trapezium shape.
You could try xFlow! <http://xflow.pwhitrow.com>
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
This might help you: <http://paulbakaus.com/2008/05/31/coverflow-anyone/> Though it doesn't seem that there is any official way to do it because CSS transforms only all a 2d matrix, so you can't get a trapezium shape.
i just made this <http://coulisse.luvdasun.com/> not sure if it works on iphone / ipod, i still have to test that gr.
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
**This is a cross-browser implementation of Cover Flow: <http://luwes.co/labs/js-cover-flow/>** The primary mode works in HTML5 (JavaScript/CSS) and it has a fallback for older browsers in flash. It supports mobile, you can flip through the covers with a simple swipe gesture. Tested on: Safari, Chrome, Firefox, Opera...
You could try xFlow! <http://xflow.pwhitrow.com>
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
**This is a cross-browser implementation of Cover Flow: <http://luwes.co/labs/js-cover-flow/>** The primary mode works in HTML5 (JavaScript/CSS) and it has a fallback for older browsers in flash. It supports mobile, you can flip through the covers with a simple swipe gesture. Tested on: Safari, Chrome, Firefox, Opera...
i just made this <http://coulisse.luvdasun.com/> not sure if it works on iphone / ipod, i still have to test that gr.
2,662,873
I have to do a web page destined for iPhone and iPod-touch that needs to incorporate the Coverflow style of apple in a page to display a list of videos. I've heard something about gizmos that could help, but I can't find anything relevant or that could work properly with the iPhone/iPod-Touch navigation. Anyone know...
2010/04/18
[ "https://Stackoverflow.com/questions/2662873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319735/" ]
Try ContentFlow: <http://www.jacksasylum.eu/ContentFlow/> Here is an example that is working on my iPhone : <http://www.majes.fr/>
i just made this <http://coulisse.luvdasun.com/> not sure if it works on iphone / ipod, i still have to test that gr.
7,369,360
I don't know if it's possible, since my knowledge of image processing is low. I need to put my passport size photo on an A4 sheet so that I could print it out out. I tried using GIMP, great tool. Like I said earlier my expertise is very low in this field. I find it difficult to place the photos efficiently in A4 sheet....
2011/09/10
[ "https://Stackoverflow.com/questions/7369360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/567879/" ]
Use imagemagick: ``` $ convert -append photo1.jpg photo2.jpg photo3.jpg row1.jpg ``` Or try +append to change the orientation. Repeat as needed: ``` $ convert +append row1.jpg row2.jpg row3.jpg a4.jpg ``` I may have gotten the -append and the +append mixed up.
You can use imagemagick [Imagemaick command line tools](http://www.imagemagick.org/script/command-line-tools.php) [Examples](http://www.imagemagick.org/Usage/)
29,766,300
The folders (\one \two \three \four) could be named anything. What I do know is that \KNOWN will always appear in the folders I'm looking at. What I want to do is find a way to extract the name of \three. You can see my attempt below, but this only extracts \four. Thanks! ``` my_directory = r'e:\\one\\two\\three\\fou...
2015/04/21
[ "https://Stackoverflow.com/questions/29766300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4808169/" ]
Most webservers will automatically compress HTTP GET requests with something like gzip. Just make sure to turn on server compression for your `php` server.
Compress the HTML on the server, not on the client. E.g. a build step or a step before serving the file.
7,675,101
Is there a way to capture a mouse hover and stay (for a while) event but not if the mouse is passing by the element. So the event will be fired only when you hover and stay.
2011/10/06
[ "https://Stackoverflow.com/questions/7675101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969131/" ]
You can use [`setTimeout`](https://developer.mozilla.org/en/window.setTimeout) to create a delay before executing whatever code you need to, and [`clearTimeout`](https://developer.mozilla.org/en/DOM/window.clearTimeout) to cancel the timer when the mouse leaves the element: ``` var timer; $("#example").mouseover(funct...
Yes, a plugin exists for it. I use it in almost all of my hover code: * [jQuery HoverIntent](http://cherne.net/brian/resources/jquery.hoverIntent.html)
7,675,101
Is there a way to capture a mouse hover and stay (for a while) event but not if the mouse is passing by the element. So the event will be fired only when you hover and stay.
2011/10/06
[ "https://Stackoverflow.com/questions/7675101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969131/" ]
You can use [`setTimeout`](https://developer.mozilla.org/en/window.setTimeout) to create a delay before executing whatever code you need to, and [`clearTimeout`](https://developer.mozilla.org/en/DOM/window.clearTimeout) to cancel the timer when the mouse leaves the element: ``` var timer; $("#example").mouseover(funct...
There is the [hoverIntent](http://cherne.net/brian/resources/jquery.hoverIntent.html) plugin designed just for this.
7,675,101
Is there a way to capture a mouse hover and stay (for a while) event but not if the mouse is passing by the element. So the event will be fired only when you hover and stay.
2011/10/06
[ "https://Stackoverflow.com/questions/7675101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969131/" ]
You can use [`setTimeout`](https://developer.mozilla.org/en/window.setTimeout) to create a delay before executing whatever code you need to, and [`clearTimeout`](https://developer.mozilla.org/en/DOM/window.clearTimeout) to cancel the timer when the mouse leaves the element: ``` var timer; $("#example").mouseover(funct...
Look into using a javascript timer, starts counting when mouse over. When the mouse leaves, stop the timer. The timer can trigger an event, if the mouse off/leave never occurs, the timer will set off your hover/stay function. Probably JQuery pluggins for this as well.
7,675,101
Is there a way to capture a mouse hover and stay (for a while) event but not if the mouse is passing by the element. So the event will be fired only when you hover and stay.
2011/10/06
[ "https://Stackoverflow.com/questions/7675101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969131/" ]
You can use [`setTimeout`](https://developer.mozilla.org/en/window.setTimeout) to create a delay before executing whatever code you need to, and [`clearTimeout`](https://developer.mozilla.org/en/DOM/window.clearTimeout) to cancel the timer when the mouse leaves the element: ``` var timer; $("#example").mouseover(funct...
On mouseenter a timer will start after 500ms yourFunction will be call If the user leave before your delay, the timer will be cleared, so the function won't be called. ``` yourElement.live({ mouseenter: function() { t=setTimeout(function(){ yourFunction() }, 500); }, mouseleave: function() { ...
3,055,955
> > For which real values of parameter $a$ both roots of polynom $f(x)=(a+1)x^2 + 2ax + a +3$ are positive numbers. > > > In solution they give 3 conditions that have to be satisfied. 1) $(a+1)f(0)>0$ 2) $D>0$ 3) $x\_{0}>0$ First 2 i understand but not last one. I dont know what $x\_{0}>0$ is . When i calcula...
2018/12/29
[ "https://math.stackexchange.com/questions/3055955", "https://math.stackexchange.com", "https://math.stackexchange.com/users/617273/" ]
The discriminant must be positive: $$\Delta=4a^2-4(a+1)(a+3)>0\implies-16a-12>0\implies a<-\frac{12}{16}=-\frac34$$ Both roots, say $\;x\_1,x\_2\;$ , positive: $$\begin{cases}0<x\_1x\_2=\cfrac{a+3}{a+1}\iff a<-3\;\;\text{or}\;\;a>-1\\{}\\\text{And}\\{}{}\\ 0<x\_1+x\_2=-\frac{2a}{a+1}\implies\frac a{a+1}<0\iff -1<a<0...
It must be $$-\frac{a}{a+1}+\frac{\sqrt{-4a-3}}{a+1}>0$$ and $$-\frac{a}{a+1}-\frac{\sqrt{-4a-3}}{a+1}>0$$ and $$-4a-3>0$$
21,906,669
When I copy a text from Microsoft Word and the text is a heading in the clipboard I see it included a paragraph number. Then in another application I must remove the number manually. Can I copy just a text without any additional information? (The same is with Chrome when you copy a URL it adds a http:// automatically)
2014/02/20
[ "https://Stackoverflow.com/questions/21906669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1011867/" ]
Try this ``` Sub FormatFreeTextCopy() Dim ffText As DataObject Set ffText = New DataObject ffText.setText Selection.Text ffText.PutInClipboard End Sub ``` Note: You would have to Reference to [Microsoft Forms Object Library](http://excel-macro.tutorialhorizon.com/vba-excel-reference-libraries-in-exce...
There is a generic "paste plain text" [solution](https://autohotkey.com/board/topic/10412-paste-plain-text-and-copycut/) using autohotkey open-source automation software: ``` ^+v:: ; Text–only paste from ClipBoard Clip0 = %ClipBoardAll% ClipBoard = %ClipBoard% ; Convert to text ...
21,906,669
When I copy a text from Microsoft Word and the text is a heading in the clipboard I see it included a paragraph number. Then in another application I must remove the number manually. Can I copy just a text without any additional information? (The same is with Chrome when you copy a URL it adds a http:// automatically)
2014/02/20
[ "https://Stackoverflow.com/questions/21906669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1011867/" ]
**Method 1:-** one way is right mouse click and use this paste special option [![enter image description here](https://i.stack.imgur.com/awA42.png)](https://i.stack.imgur.com/awA42.png) **Method 2:-** assign a shortcut(`Ctrl`+`Shift`+`V`) for this operation (**Note: by default Ms word not set shortcut for it so we n...
There is a generic "paste plain text" [solution](https://autohotkey.com/board/topic/10412-paste-plain-text-and-copycut/) using autohotkey open-source automation software: ``` ^+v:: ; Text–only paste from ClipBoard Clip0 = %ClipBoardAll% ClipBoard = %ClipBoard% ; Convert to text ...
7,516,913
I am trying to write up a bash script to count the number of times a specific pattern matches on a list of files. I've googled for solutions but I've only found solutions for single files. I know I can use `egrep -o PATTERN file`, but how do I generalize to a list of files and out the sum at the end? EDIT: Adding th...
2011/09/22
[ "https://Stackoverflow.com/questions/7516913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/166789/" ]
You could use `grep -c` to count the matches within each file, and then use `awk` at the end to sum up the counts, e.g.: ``` grep -c PATTERN * | awk -F: '{sum+=$2} END{print sum}' ```
``` grep -o <pattern> file1 [file2 .. | *] | uniq -c ``` If you want the total only: ``` grep -o <pattern> file1 [file2 .. | *] | wc -l ``` Edit: The sort seems unnecessary.
7,516,913
I am trying to write up a bash script to count the number of times a specific pattern matches on a list of files. I've googled for solutions but I've only found solutions for single files. I know I can use `egrep -o PATTERN file`, but how do I generalize to a list of files and out the sum at the end? EDIT: Adding th...
2011/09/22
[ "https://Stackoverflow.com/questions/7516913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/166789/" ]
You could use `grep -c` to count the matches within each file, and then use `awk` at the end to sum up the counts, e.g.: ``` grep -c PATTERN * | awk -F: '{sum+=$2} END{print sum}' ```
The accepted answer has a problem in that `grep` will count as 1 even though the PATTERN may appear more than once on a line. Besides, one command does the job ``` awk 'BEGIN{RS="\0777";FS="PATTERN"} { print NF-1 } ' file ```
7,516,913
I am trying to write up a bash script to count the number of times a specific pattern matches on a list of files. I've googled for solutions but I've only found solutions for single files. I know I can use `egrep -o PATTERN file`, but how do I generalize to a list of files and out the sum at the end? EDIT: Adding th...
2011/09/22
[ "https://Stackoverflow.com/questions/7516913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/166789/" ]
``` grep -o <pattern> file1 [file2 .. | *] | uniq -c ``` If you want the total only: ``` grep -o <pattern> file1 [file2 .. | *] | wc -l ``` Edit: The sort seems unnecessary.
The accepted answer has a problem in that `grep` will count as 1 even though the PATTERN may appear more than once on a line. Besides, one command does the job ``` awk 'BEGIN{RS="\0777";FS="PATTERN"} { print NF-1 } ' file ```
3,400,076
As the title says, I'm trying to show that $\frac{\sqrt3}{1 + 2^{1/3}}$ is equal to $\sqrt{2^{2/3} - 1}$. It's used (without proof) in the solution to a question I'm stuck on, and I've checked they really are the same on Wolfram Alpha, but I can't work out how I'd be able to convert the former into the latter. Any hel...
2019/10/19
[ "https://math.stackexchange.com/questions/3400076", "https://math.stackexchange.com", "https://math.stackexchange.com/users/716482/" ]
Use that $$3=(2^{2/3}-1)(2^{2/3}+2\times 2^{1/3}+1)$$
The other answers require you to know our come up with a clever factorisation to get from one expression to the other. However, that's not the only way to show that two expressions represent the same number. Here is a way to see that they are equal without having to be clever about it. Just straight-forward calculation...
3,400,076
As the title says, I'm trying to show that $\frac{\sqrt3}{1 + 2^{1/3}}$ is equal to $\sqrt{2^{2/3} - 1}$. It's used (without proof) in the solution to a question I'm stuck on, and I've checked they really are the same on Wolfram Alpha, but I can't work out how I'd be able to convert the former into the latter. Any hel...
2019/10/19
[ "https://math.stackexchange.com/questions/3400076", "https://math.stackexchange.com", "https://math.stackexchange.com/users/716482/" ]
Use that $$3=(2^{2/3}-1)(2^{2/3}+2\times 2^{1/3}+1)$$
Use the formula: $a^3+b^3=(a+b)(a^2-ab+b^2)$. Note: $$\frac{\sqrt3}{1 + 2^{1/3}}=\frac{\sqrt{(2^{1/3})^3+1^3}}{1 + 2^{1/3}}= \frac{\sqrt{(2^{1/3}+1)(2^{2/3}-2^{1/3}+1)}}{2^{1/3}+1}=\\ \sqrt{\frac{2^{2/3}-2^{1/3}+1}{2^{1/3}+1}}=\sqrt{\frac{(2^{1/3}+1)(2^{2/3}-1)}{2^{1/3}+1}}=\sqrt{2^{2/3}-1}.$$
3,400,076
As the title says, I'm trying to show that $\frac{\sqrt3}{1 + 2^{1/3}}$ is equal to $\sqrt{2^{2/3} - 1}$. It's used (without proof) in the solution to a question I'm stuck on, and I've checked they really are the same on Wolfram Alpha, but I can't work out how I'd be able to convert the former into the latter. Any hel...
2019/10/19
[ "https://math.stackexchange.com/questions/3400076", "https://math.stackexchange.com", "https://math.stackexchange.com/users/716482/" ]
Note that\begin{align}\frac3{\left(1+2^{1/3}\right)^2}&=\frac3{1+2\times2^{1/3}+2^{2/3}}\\&=\frac3{1+2^{2/3}+2^{4/3}}\\&=\frac{3\left(1-2^{2/3}\right)}{\left(1+2^{2/3}+2^{4/3}\right)\left(1-2^{2/3}\right)}\\&=\frac{3\left(1-2^{2/3}\right)}{1-4}\\&=2^{2/3}-1.\end{align}
The other answers require you to know our come up with a clever factorisation to get from one expression to the other. However, that's not the only way to show that two expressions represent the same number. Here is a way to see that they are equal without having to be clever about it. Just straight-forward calculation...
3,400,076
As the title says, I'm trying to show that $\frac{\sqrt3}{1 + 2^{1/3}}$ is equal to $\sqrt{2^{2/3} - 1}$. It's used (without proof) in the solution to a question I'm stuck on, and I've checked they really are the same on Wolfram Alpha, but I can't work out how I'd be able to convert the former into the latter. Any hel...
2019/10/19
[ "https://math.stackexchange.com/questions/3400076", "https://math.stackexchange.com", "https://math.stackexchange.com/users/716482/" ]
Note that\begin{align}\frac3{\left(1+2^{1/3}\right)^2}&=\frac3{1+2\times2^{1/3}+2^{2/3}}\\&=\frac3{1+2^{2/3}+2^{4/3}}\\&=\frac{3\left(1-2^{2/3}\right)}{\left(1+2^{2/3}+2^{4/3}\right)\left(1-2^{2/3}\right)}\\&=\frac{3\left(1-2^{2/3}\right)}{1-4}\\&=2^{2/3}-1.\end{align}
Use the formula: $a^3+b^3=(a+b)(a^2-ab+b^2)$. Note: $$\frac{\sqrt3}{1 + 2^{1/3}}=\frac{\sqrt{(2^{1/3})^3+1^3}}{1 + 2^{1/3}}= \frac{\sqrt{(2^{1/3}+1)(2^{2/3}-2^{1/3}+1)}}{2^{1/3}+1}=\\ \sqrt{\frac{2^{2/3}-2^{1/3}+1}{2^{1/3}+1}}=\sqrt{\frac{(2^{1/3}+1)(2^{2/3}-1)}{2^{1/3}+1}}=\sqrt{2^{2/3}-1}.$$
3,400,076
As the title says, I'm trying to show that $\frac{\sqrt3}{1 + 2^{1/3}}$ is equal to $\sqrt{2^{2/3} - 1}$. It's used (without proof) in the solution to a question I'm stuck on, and I've checked they really are the same on Wolfram Alpha, but I can't work out how I'd be able to convert the former into the latter. Any hel...
2019/10/19
[ "https://math.stackexchange.com/questions/3400076", "https://math.stackexchange.com", "https://math.stackexchange.com/users/716482/" ]
The other answers require you to know our come up with a clever factorisation to get from one expression to the other. However, that's not the only way to show that two expressions represent the same number. Here is a way to see that they are equal without having to be clever about it. Just straight-forward calculation...
Use the formula: $a^3+b^3=(a+b)(a^2-ab+b^2)$. Note: $$\frac{\sqrt3}{1 + 2^{1/3}}=\frac{\sqrt{(2^{1/3})^3+1^3}}{1 + 2^{1/3}}= \frac{\sqrt{(2^{1/3}+1)(2^{2/3}-2^{1/3}+1)}}{2^{1/3}+1}=\\ \sqrt{\frac{2^{2/3}-2^{1/3}+1}{2^{1/3}+1}}=\sqrt{\frac{(2^{1/3}+1)(2^{2/3}-1)}{2^{1/3}+1}}=\sqrt{2^{2/3}-1}.$$
59,690
In **[Stranger Things](http://www.imdb.com/title/tt4574334/)** (2016) Will Byers gets taken to the "Upside Down". But he manages to communicate with his mother, e.g through the christmas lights.   [![Lights 1](https://i.stack.imgur.com/z45uE.png)](https://i.stack.imgur.com/z45uE.png) When Joyce is in the cupboard and...
2016/08/24
[ "https://movies.stackexchange.com/questions/59690", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/1525/" ]
There is no canonical answer for this yet but I have come across an interesting hypothesis by [u/mrzoink](https://www.reddit.com/user/mrzoink) in a [r/StrangerThings post](https://www.reddit.com/r/StrangerThings/comments/519y04/how_are_the_lights_manipulated_from_the_usd_world/d7akucu) in Reddit: > > Speculation: *Jo...
Agree with the previous answer, but may have something to add. After recently rewatching the series, I started to wonder about the nature of The Upside Down. When Eleven first astral projects into the presumed dimension, the dimension itself appears **completely back**, except for Eleven herself and that we can see s...
59,690
In **[Stranger Things](http://www.imdb.com/title/tt4574334/)** (2016) Will Byers gets taken to the "Upside Down". But he manages to communicate with his mother, e.g through the christmas lights.   [![Lights 1](https://i.stack.imgur.com/z45uE.png)](https://i.stack.imgur.com/z45uE.png) When Joyce is in the cupboard and...
2016/08/24
[ "https://movies.stackexchange.com/questions/59690", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/1525/" ]
There is no canonical answer for this yet but I have come across an interesting hypothesis by [u/mrzoink](https://www.reddit.com/user/mrzoink) in a [r/StrangerThings post](https://www.reddit.com/r/StrangerThings/comments/519y04/how_are_the_lights_manipulated_from_the_usd_world/d7akucu) in Reddit: > > Speculation: *Jo...
In the upside down, noise transfers between dimensions. When Nancy crawls through the gate, she is yelling jonathan's name, and he can hear her. Just because you cant see the lights in the house in the upside down, but it's always dark in the upside down. The upside down is a dark, uninhabited version of our world, aft...
59,690
In **[Stranger Things](http://www.imdb.com/title/tt4574334/)** (2016) Will Byers gets taken to the "Upside Down". But he manages to communicate with his mother, e.g through the christmas lights.   [![Lights 1](https://i.stack.imgur.com/z45uE.png)](https://i.stack.imgur.com/z45uE.png) When Joyce is in the cupboard and...
2016/08/24
[ "https://movies.stackexchange.com/questions/59690", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/1525/" ]
Agree with the previous answer, but may have something to add. After recently rewatching the series, I started to wonder about the nature of The Upside Down. When Eleven first astral projects into the presumed dimension, the dimension itself appears **completely back**, except for Eleven herself and that we can see s...
In the upside down, noise transfers between dimensions. When Nancy crawls through the gate, she is yelling jonathan's name, and he can hear her. Just because you cant see the lights in the house in the upside down, but it's always dark in the upside down. The upside down is a dark, uninhabited version of our world, aft...
44,187,564
I have a simple Ruby method meant to throttle some execution. ``` MAX_REQUESTS = 60 # per TIME_WINDOW = 1.minute def throttle cache_key = "#{request.ip}_count" count = Rails.cache.fetch(cache_key, expires_in: TIME_WINDOW.to_i) { 0 } if count.to_i >= MAX_REQUESTS render json: { message: 'Too many requests.'...
2017/05/25
[ "https://Stackoverflow.com/questions/44187564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504372/" ]
That's because `propTypes` is a static1 property of the class, not associated with a certain instance of the class but the class itself. React's prop type-checking looks for `propTypes` of a certain component as a static property of the component's class. It's not on the class's `prototype`, but on the class itself. I...
You declare / define a class and you instantiate objects of a certain class.
44,187,564
I have a simple Ruby method meant to throttle some execution. ``` MAX_REQUESTS = 60 # per TIME_WINDOW = 1.minute def throttle cache_key = "#{request.ip}_count" count = Rails.cache.fetch(cache_key, expires_in: TIME_WINDOW.to_i) { 0 } if count.to_i >= MAX_REQUESTS render json: { message: 'Too many requests.'...
2017/05/25
[ "https://Stackoverflow.com/questions/44187564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504372/" ]
[PropTypes](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) is a React specific API. It's a way that o tell React to perform basic runtime type-checking of the properties you pass to a component. In your example, you are saying that `Greeting` components can take a `name` property of type string...
You declare / define a class and you instantiate objects of a certain class.
44,187,564
I have a simple Ruby method meant to throttle some execution. ``` MAX_REQUESTS = 60 # per TIME_WINDOW = 1.minute def throttle cache_key = "#{request.ip}_count" count = Rails.cache.fetch(cache_key, expires_in: TIME_WINDOW.to_i) { 0 } if count.to_i >= MAX_REQUESTS render json: { message: 'Too many requests.'...
2017/05/25
[ "https://Stackoverflow.com/questions/44187564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504372/" ]
That's because `propTypes` is a static1 property of the class, not associated with a certain instance of the class but the class itself. React's prop type-checking looks for `propTypes` of a certain component as a static property of the component's class. It's not on the class's `prototype`, but on the class itself. I...
[PropTypes](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) is a React specific API. It's a way that o tell React to perform basic runtime type-checking of the properties you pass to a component. In your example, you are saying that `Greeting` components can take a `name` property of type string...
29,315,498
I want to replace WebClient to HttpClient in my code. What HttpContent I have to use in HttpClient to replace WebClient.UploadString? My WebClient code: ``` string data = string.Format("name={0}&warehouse={1}&address={2}", name, shop.Warehouse.Id, shop.Address); using (var wc = new WebClient()) { wc.Headers[HttpR...
2015/03/28
[ "https://Stackoverflow.com/questions/29315498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917874/" ]
You can construct your postdata and use it in the instance of the FormUrlEncodedContent like so: ``` // This is the postdata var data = new List<KeyValuePair<string, string>>(); data.Add(new KeyValuePair<string, string>("Name", "test")); HttpContent content = new FormUrlEncodedContent(data); ``` There are solutions...
you can also replace ``` string payload = System.IO.File.ReadAllText("e:\\IIF-Input3 (1).xml"); try { System.Net.WebClient client = new System.Net.WebClient(); client.Encoding = Encoding.UTF8; string res = client.UploadString("http://1.2.3.4:80/RunJson?name=Test", "P...
55,104,163
I am trying to use SVG in my react native project. This is the code for my component: ``` <Svg xmlns="http://www.w3.org/2000/svg" width="100%" height="507" viewBox="0 0 375 507" style={{position:'absolute', bottom:0}}> <Defs> <ClipPath id="a"> <Rect class="a" fill='#fff' stroke='#707070' width="375" h...
2019/03/11
[ "https://Stackoverflow.com/questions/55104163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9104773/" ]
I think @enxaneta is right, `clip-path` seems to not exist on `react-native-svg` please refer to the documentation, you may find on the docs here [react-native-svg #LinearGradient](https://github.com/react-native-community/react-native-svg#lineargradient) I think you should have to reference it like this: ``` ...
I found a solution that instead of using the svgs having gradient,I converted the SVG into a Lottie file. that works great and as an extra advantage, we can transform the SVG into a simple animation :)
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
K Libbrecht has a nice paper that answers your question in considerable detail and has some nice pictures-- his homepage: <http://www.its.caltech.edu/~atomic/publist/kglpub.htm> Scroll down to the article in American Scientist in his publications list "The Formation of Snow Crystals," K. G. Libbrecht, American Scienti...
Not all snowflakes are symmetrical. One can disrupt the symmetry quite easily by introducing impurities or some mechanical artifact. In nature, snowflakes have plenty of time to form and it is more natural for them to form symmetric shapes because of the molecular structure of water. That is, when there is more time f...
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
Not all snowflakes are symmetrical. One can disrupt the symmetry quite easily by introducing impurities or some mechanical artifact. In nature, snowflakes have plenty of time to form and it is more natural for them to form symmetric shapes because of the molecular structure of water. That is, when there is more time f...
Natural snow crystals are symmetric in shape because they are charged and several properties of the electromagnetic field act to keep them symmetric. You can learn more about by reading my paper available now on Research Gate/Roald Schrack
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
K Libbrecht has a nice paper that answers your question in considerable detail and has some nice pictures-- his homepage: <http://www.its.caltech.edu/~atomic/publist/kglpub.htm> Scroll down to the article in American Scientist in his publications list "The Formation of Snow Crystals," K. G. Libbrecht, American Scienti...
Natural snow crystals are symmetric in shape because they are charged and several properties of the electromagnetic field act to keep them symmetric. You can learn more about by reading my paper available now on Research Gate/Roald Schrack
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
Not all snowflakes are symmetrical. One can disrupt the symmetry quite easily by introducing impurities or some mechanical artifact. In nature, snowflakes have plenty of time to form and it is more natural for them to form symmetric shapes because of the molecular structure of water. That is, when there is more time f...
Not quite an answer but the first attempt to explain the shape was published by astronomer Johannes Kepler in 1611, the original is in Latin - "Strena Seu de Nive Sexangula" (A New Year's Gift of Hexagonal Snow). There is an English translation ("The Six-Cornered Snowflake") available at Amazon and elsewhere.
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
When water freezes, you get ice. Ice, like many solid materials, forms a crystalline structure. In the case of water, the crystalline structure may be attributed to the hydrogen bond, a special kind of an attractive interaction. So a big chunk of ice will have a crystalline structure - preferred directions, translatio...
My understanding is that there are two processes in operation in sequence, first there is a random process of one H2O attaching then a second process where the energy balance requirements over the entire crystal limit the allowed attachment points and this causes the symmetry, once all the valid points are filled the e...
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
K Libbrecht has a nice paper that answers your question in considerable detail and has some nice pictures-- his homepage: <http://www.its.caltech.edu/~atomic/publist/kglpub.htm> Scroll down to the article in American Scientist in his publications list "The Formation of Snow Crystals," K. G. Libbrecht, American Scienti...
Not quite an answer but the first attempt to explain the shape was published by astronomer Johannes Kepler in 1611, the original is in Latin - "Strena Seu de Nive Sexangula" (A New Year's Gift of Hexagonal Snow). There is an English translation ("The Six-Cornered Snowflake") available at Amazon and elsewhere.
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
When water freezes, you get ice. Ice, like many solid materials, forms a crystalline structure. In the case of water, the crystalline structure may be attributed to the hydrogen bond, a special kind of an attractive interaction. So a big chunk of ice will have a crystalline structure - preferred directions, translatio...
Not quite an answer but the first attempt to explain the shape was published by astronomer Johannes Kepler in 1611, the original is in Latin - "Strena Seu de Nive Sexangula" (A New Year's Gift of Hexagonal Snow). There is an English translation ("The Six-Cornered Snowflake") available at Amazon and elsewhere.
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
When water freezes, you get ice. Ice, like many solid materials, forms a crystalline structure. In the case of water, the crystalline structure may be attributed to the hydrogen bond, a special kind of an attractive interaction. So a big chunk of ice will have a crystalline structure - preferred directions, translatio...
Natural snow crystals are symmetric in shape because they are charged and several properties of the electromagnetic field act to keep them symmetric. You can learn more about by reading my paper available now on Research Gate/Roald Schrack
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
When water freezes, you get ice. Ice, like many solid materials, forms a crystalline structure. In the case of water, the crystalline structure may be attributed to the hydrogen bond, a special kind of an attractive interaction. So a big chunk of ice will have a crystalline structure - preferred directions, translatio...
Not all snowflakes are symmetrical. One can disrupt the symmetry quite easily by introducing impurities or some mechanical artifact. In nature, snowflakes have plenty of time to form and it is more natural for them to form symmetric shapes because of the molecular structure of water. That is, when there is more time f...
3,795
The title says it all. Why are snowflakes [symmetrical in shape](http://en.wikipedia.org/wiki/Snowflake#Gallery) and not a mush of ice? Is it a property of water freezing or what? Does anyone care to explain it to me? I'm intrigued by this and couldn't find an explanation.
2011/01/24
[ "https://physics.stackexchange.com/questions/3795", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/-1/" ]
K Libbrecht has a nice paper that answers your question in considerable detail and has some nice pictures-- his homepage: <http://www.its.caltech.edu/~atomic/publist/kglpub.htm> Scroll down to the article in American Scientist in his publications list "The Formation of Snow Crystals," K. G. Libbrecht, American Scienti...
My understanding is that there are two processes in operation in sequence, first there is a random process of one H2O attaching then a second process where the energy balance requirements over the entire crystal limit the allowed attachment points and this causes the symmetry, once all the valid points are filled the e...
33,054
Managed a very stupid mistake: changed the oil on my just-purchased '03 Kia Diesel Pregio on uneven ground. The drain plug on it is on the side of the pan, exacerbating the mistake. Initially drained only ~3.8L and refilled 7.1L. Manual states 7.1L for a complete change. So the oil was overfilled by 3.3L. I realize I...
2016/07/19
[ "https://mechanics.stackexchange.com/questions/33054", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/19875/" ]
if your oil is now at the correct level and the engine is not upset, then you may not have any problem. the starter behavior will be unrelated unless you have inadvertently, say, soaked it in oil.
When reading the oil level stick just take the lowest reading. Obviously if the oil stick is dry above F (even if only part of it) then the oil level is at least up to the F mark. The explanation for the amount above F is as you assume, just picking up from inside the oil level tube. Cant help with the oil change thou...
33,054
Managed a very stupid mistake: changed the oil on my just-purchased '03 Kia Diesel Pregio on uneven ground. The drain plug on it is on the side of the pan, exacerbating the mistake. Initially drained only ~3.8L and refilled 7.1L. Manual states 7.1L for a complete change. So the oil was overfilled by 3.3L. I realize I...
2016/07/19
[ "https://mechanics.stackexchange.com/questions/33054", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/19875/" ]
You are worrying too much, everything is fine and your car is very happy. If you have too high oil level, it can struggle with breathing, but it won't harm your engine, just drain it to level and happy days. Foamed oil will disappear after a longer jorney when your oil will heat up properly. If it is too low, it will h...
When reading the oil level stick just take the lowest reading. Obviously if the oil stick is dry above F (even if only part of it) then the oil level is at least up to the F mark. The explanation for the amount above F is as you assume, just picking up from inside the oil level tube. Cant help with the oil change thou...
2,798,111
I am using the following simple code to add full control to a directory, but it doesn't work. ``` String dir_name = @"folder_full_path"; DirectorySecurity dir_security = Directory.GetAccessControl(dir_name); FileSystemAccessRule access_rule = new FileSystemAccessRule(@"AccountName", ...
2010/05/09
[ "https://Stackoverflow.com/questions/2798111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/264052/" ]
After some reverse Engineering of the original ACL rules I got it to work with the following code: ``` IdentityReference everybodyIdentity = new SecurityIdentifier(WellKnownSidType.WorldSid, null); FileSystemAccessRule rule = new FileSystemAccessRule( everybodyIdentity, FileSystemRights.FullControl, Inhe...
:) Turn around. * Make a directory. * Assign Permissions. * Read DirectorySecurity ACL and check in the debugger how it looks ;) Voila.
6,780,094
I'm trying to update a dependancy property in VB.Net 4.0 inside of an Async callback. I feel like I am doing this correctly but I'm still getting the "The calling thread cannot access this object because a different thread owns it." error. Does someone see a better way of using delegates in VB.Net 4.0? ``` Private Wit...
2011/07/21
[ "https://Stackoverflow.com/questions/6780094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693757/" ]
Have you registered a parallel backend to `foreach` ? You may need to read up on use of `foreach` before you use it with `plyr`.
On Unix environments, you can do this using the doMC package and its function registerDoMC() ``` > registerDoMC() > example <- ddply(..., .parallel=TRUE) ```
6,780,094
I'm trying to update a dependancy property in VB.Net 4.0 inside of an Async callback. I feel like I am doing this correctly but I'm still getting the "The calling thread cannot access this object because a different thread owns it." error. Does someone see a better way of using delegates in VB.Net 4.0? ``` Private Wit...
2011/07/21
[ "https://Stackoverflow.com/questions/6780094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693757/" ]
Here's a simple working example: ``` > df <- data.frame(val=1:10, ind=c(rep(2, 5), rep(3, 5))) > library(doSNOW) > registerDoSNOW(makeCluster(2, type = "SOCK")) > system.time(print(ddply(df, .(ind), function(x) { Sys.sleep(2); sum(x) }, .parallel=FALSE))) ind V1 1 2 25 2 3 55 user system elapsed 0.00 ...
Have you registered a parallel backend to `foreach` ? You may need to read up on use of `foreach` before you use it with `plyr`.
6,780,094
I'm trying to update a dependancy property in VB.Net 4.0 inside of an Async callback. I feel like I am doing this correctly but I'm still getting the "The calling thread cannot access this object because a different thread owns it." error. Does someone see a better way of using delegates in VB.Net 4.0? ``` Private Wit...
2011/07/21
[ "https://Stackoverflow.com/questions/6780094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693757/" ]
A. I've been communicating with Hadley and there are no plans in the immediate future to fix this bug. The fix itself can be attempted by anyone. Here are some tips I received from Hadley: "It's relatively easy at the simplest level - you just need to pass a .export argument to foreach. Ideally, plyr would figure out ...
On Unix environments, you can do this using the doMC package and its function registerDoMC() ``` > registerDoMC() > example <- ddply(..., .parallel=TRUE) ```
6,780,094
I'm trying to update a dependancy property in VB.Net 4.0 inside of an Async callback. I feel like I am doing this correctly but I'm still getting the "The calling thread cannot access this object because a different thread owns it." error. Does someone see a better way of using delegates in VB.Net 4.0? ``` Private Wit...
2011/07/21
[ "https://Stackoverflow.com/questions/6780094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693757/" ]
Here's a simple working example: ``` > df <- data.frame(val=1:10, ind=c(rep(2, 5), rep(3, 5))) > library(doSNOW) > registerDoSNOW(makeCluster(2, type = "SOCK")) > system.time(print(ddply(df, .(ind), function(x) { Sys.sleep(2); sum(x) }, .parallel=FALSE))) ind V1 1 2 25 2 3 55 user system elapsed 0.00 ...
A. I've been communicating with Hadley and there are no plans in the immediate future to fix this bug. The fix itself can be attempted by anyone. Here are some tips I received from Hadley: "It's relatively easy at the simplest level - you just need to pass a .export argument to foreach. Ideally, plyr would figure out ...
6,780,094
I'm trying to update a dependancy property in VB.Net 4.0 inside of an Async callback. I feel like I am doing this correctly but I'm still getting the "The calling thread cannot access this object because a different thread owns it." error. Does someone see a better way of using delegates in VB.Net 4.0? ``` Private Wit...
2011/07/21
[ "https://Stackoverflow.com/questions/6780094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693757/" ]
Here's a simple working example: ``` > df <- data.frame(val=1:10, ind=c(rep(2, 5), rep(3, 5))) > library(doSNOW) > registerDoSNOW(makeCluster(2, type = "SOCK")) > system.time(print(ddply(df, .(ind), function(x) { Sys.sleep(2); sum(x) }, .parallel=FALSE))) ind V1 1 2 25 2 3 55 user system elapsed 0.00 ...
On Unix environments, you can do this using the doMC package and its function registerDoMC() ``` > registerDoMC() > example <- ddply(..., .parallel=TRUE) ```
10,656,012
I have a customer with store locator functionality based on Google maps API. Couple days ago the complained about locator not able to find 'Carson, CA' Here's a really simple demo from Google itself and it doesn't work either: <http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html> Is there a way t...
2012/05/18
[ "https://Stackoverflow.com/questions/10656012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75837/" ]
It does look like a bug as there is a Carson marked on the map south of Los Angeles. It happens: geocoder data gets updated and sometimes things get missed off. Bugs need to be raised in the issue tracker. Be sure to search first (although I didn't find a previous report for this) and choose the right template when rai...
I don't think this is actually a bug; let me gently suggest that I think you are probably using the wrong API for looking up "Carson, CA." I'm not being harsh, just trying to help. But Geocoding has two basic functions: 1. Given an address as input, reply with the best Lat-Lng coordinates for that address. 2. Given co...
33,079,526
I wrote a query in DBpedia SPARQL: ``` select distinct ?s where { ?s rdf:type dbo:Writer. ?s rdf:type yago:LivingPeople. ?s dbo:birthDate ?year. FILTER (?year > 1964-01-01). } ``` but it is showing: > > Virtuoso 42000 Error The estimated execution time 82850 (sec) exceeds the limit of 240 (sec). > > > What is...
2015/10/12
[ "https://Stackoverflow.com/questions/33079526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5436368/" ]
Laravel is going to complain if you try to mass-assign fields not specified in the model class definition. This is related to the fact that a malicious user could try to assign fileds in your model (i.e. adding some parameters to a form) that are not supposed to be updated from application's users In order to be abl...
You need to define either $fillable or $guarded properties on your model. If you want everything except id to be fillable, here's how you can define this: ``` class Keywords extends Model { protected $guarded = array('id'); } ```
6,825,827
[This](http://plugins.scbfolio.com/jquery_drag_drop_select/#Events) is exactly the behaviour I want: dragging items from a list to another. Now, I would like to add a "submit" button so that I can save the chosen items on the server side. How to do this? * Create a hidden form, and update the input values in an `aft...
2011/07/26
[ "https://Stackoverflow.com/questions/6825827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/226958/" ]
Instead of KeyPress event, maybe use the textchanged event. Text box has a max length attribute. Also, just call TextBox.Text=TextBox.Text.TrimStart() will remove any whitespace at beginning
You will want to watch the [TextChanged](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.textchanged.aspx) event -- that will let you know whenever the contents of the textbox have changed. Rather than checking to see if the length is 0, you can use the TrimStart() method suggested by user623879. ...
6,825,827
[This](http://plugins.scbfolio.com/jquery_drag_drop_select/#Events) is exactly the behaviour I want: dragging items from a list to another. Now, I would like to add a "submit" button so that I can save the chosen items on the server side. How to do this? * Create a hidden form, and update the input values in an `aft...
2011/07/26
[ "https://Stackoverflow.com/questions/6825827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/226958/" ]
Instead of KeyPress event, maybe use the textchanged event. Text box has a max length attribute. Also, just call TextBox.Text=TextBox.Text.TrimStart() will remove any whitespace at beginning
You need to set SelectionLength to 0 on textbox KeyPress, MouseUp and MouseMove events.
6,825,827
[This](http://plugins.scbfolio.com/jquery_drag_drop_select/#Events) is exactly the behaviour I want: dragging items from a list to another. Now, I would like to add a "submit" button so that I can save the chosen items on the server side. How to do this? * Create a hidden form, and update the input values in an `aft...
2011/07/26
[ "https://Stackoverflow.com/questions/6825827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/226958/" ]
~~Answering your question that in the title: To remove a selected text from a TextBox, use: myTextBox.Text = myTextBox1.Text.Substring(myTextBox1.SelectionStart, myTextBox1.SelectionLength);~~ If you want to prevent the user from selecting a text: 1. Use `Label` instead of the `TextBox`. 2. Handle the label.KeyPress e...
You will want to watch the [TextChanged](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.textchanged.aspx) event -- that will let you know whenever the contents of the textbox have changed. Rather than checking to see if the length is 0, you can use the TrimStart() method suggested by user623879. ...
6,825,827
[This](http://plugins.scbfolio.com/jquery_drag_drop_select/#Events) is exactly the behaviour I want: dragging items from a list to another. Now, I would like to add a "submit" button so that I can save the chosen items on the server side. How to do this? * Create a hidden form, and update the input values in an `aft...
2011/07/26
[ "https://Stackoverflow.com/questions/6825827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/226958/" ]
~~Answering your question that in the title: To remove a selected text from a TextBox, use: myTextBox.Text = myTextBox1.Text.Substring(myTextBox1.SelectionStart, myTextBox1.SelectionLength);~~ If you want to prevent the user from selecting a text: 1. Use `Label` instead of the `TextBox`. 2. Handle the label.KeyPress e...
You need to set SelectionLength to 0 on textbox KeyPress, MouseUp and MouseMove events.
9,316,694
Are their any bindings to use Cucumber with C? Google keeps telling me about vegetables when I ask.
2012/02/16
[ "https://Stackoverflow.com/questions/9316694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9859/" ]
It's possible to make Ruby bindings to a C application, but I haven't heard of any C binding for a Ruby application. It seems quite hard to make something like that. BTW, [cucumber docs](https://cucumber.io/docs#cucumber-implementations) lists all available ports and way to use their technology in an other langage. T...
I am Using Cucumber for while and I could not find any C binding. As Ruby is top of the C.you can try to convert it. for more info goto www.cuke.info or <https://github.com/cucumber/cucumber/wiki/>
12,129,077
This is relative an Chrome extension. I am trying a simple one which uses the Google Chart API I have this code in my html document "popup.html", which is loaded on the click on the Icon. ``` <!doctype html> <html> <head> <script type="text/javascript" src="js/libs/jquery-1.8.0.min.js"></script> <script type="tex...
2012/08/26
[ "https://Stackoverflow.com/questions/12129077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1128999/" ]
Just make it use the `https` protocol instead. The error you're getting is regarding the [Content Security Policy](https://developer.chrome.com/extensions/contentSecurityPolicy). See the `Relaxing the default policy` section of the page. It mentions that you can only whitelist `HTTPS`, `chrome-extension`, and `chrome-...
I wrestled with this issue for the past 12 hours and finally got it to work. Why did it take so long? Because I got thrown off the trail multiple times. First, the false leads: 1. "Make it HTTPS" -- Doesn't matter. My Chrome extension now makes regular HTTP calls to a different domain and works just fine. (UPDATE: A l...
12,129,077
This is relative an Chrome extension. I am trying a simple one which uses the Google Chart API I have this code in my html document "popup.html", which is loaded on the click on the Icon. ``` <!doctype html> <html> <head> <script type="text/javascript" src="js/libs/jquery-1.8.0.min.js"></script> <script type="tex...
2012/08/26
[ "https://Stackoverflow.com/questions/12129077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1128999/" ]
Just make it use the `https` protocol instead. The error you're getting is regarding the [Content Security Policy](https://developer.chrome.com/extensions/contentSecurityPolicy). See the `Relaxing the default policy` section of the page. It mentions that you can only whitelist `HTTPS`, `chrome-extension`, and `chrome-...
I get this error [Report] when I run Augury chrome extension to debug an Angular app. Disable the extension and the error goes away. This won't help people who are writing extensions, but it may help those that aren't. ``` [Report Only] Refused to load the script 'https://apis.google.com/js/googleapis.proxy.js?onload...
12,129,077
This is relative an Chrome extension. I am trying a simple one which uses the Google Chart API I have this code in my html document "popup.html", which is loaded on the click on the Icon. ``` <!doctype html> <html> <head> <script type="text/javascript" src="js/libs/jquery-1.8.0.min.js"></script> <script type="tex...
2012/08/26
[ "https://Stackoverflow.com/questions/12129077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1128999/" ]
I wrestled with this issue for the past 12 hours and finally got it to work. Why did it take so long? Because I got thrown off the trail multiple times. First, the false leads: 1. "Make it HTTPS" -- Doesn't matter. My Chrome extension now makes regular HTTP calls to a different domain and works just fine. (UPDATE: A l...
I get this error [Report] when I run Augury chrome extension to debug an Angular app. Disable the extension and the error goes away. This won't help people who are writing extensions, but it may help those that aren't. ``` [Report Only] Refused to load the script 'https://apis.google.com/js/googleapis.proxy.js?onload...
64,413,865
I wonder how to push notifications to my Flutter app users in both Android and iOS devices **Without** using any external service like Firebase or OneSignal? I want to implement a code in **PHP** which can send push real time notifications to all/spesific users in my **Flutter app** which works in both Android and iOS...
2020/10/18
[ "https://Stackoverflow.com/questions/64413865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11552313/" ]
iOS --- You will *always* need to integrate with Apple's Push Notification Server (APNS) if your app needs make API calls in the background. The reason is that once an app is put into the background, iOS will often put the app to sleep soon afterwards. The correct approach to this is to use a silent push notification...
Unfortunately, I think this is not possible. Even OneSignal uses the Firebase API to deliver the notifications, as you can see [here](https://onesignal.com/blog/firebase-vs-onesignal/). For all other solutions, you will have to balance the update frequency with internet use and battery consumption.
6,120
I have a batch job which gets a number of users in the start interface. So I implement the following APIs ``` global Database.QueryLocator start(Database.BatchableContext bc) global void execute(Database.BatchableContext bc, List<User> users) global void finish(Database.BatchableContext bc) ``` I am wondering is...
2013/01/10
[ "https://salesforce.stackexchange.com/questions/6120", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/943/" ]
I would recommend using the new Install Script functionality of managed packages. You could initialise the list when the package is installed (saves having to do the check in code you are proposing) [Link to the InstallHandler interface documentation](http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_i...
I think there are three considerations here: 1. Is the data static, or will it change as a result of user interaction 2. How much data is involved 3. Is the data identical for every subscriber Custom settings are designed to be used where data is "written seldom and read often". If the data doesn't change then perhap...
6,120
I have a batch job which gets a number of users in the start interface. So I implement the following APIs ``` global Database.QueryLocator start(Database.BatchableContext bc) global void execute(Database.BatchableContext bc, List<User> users) global void finish(Database.BatchableContext bc) ``` I am wondering is...
2013/01/10
[ "https://salesforce.stackexchange.com/questions/6120", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/943/" ]
I would recommend using the new Install Script functionality of managed packages. You could initialise the list when the package is installed (saves having to do the check in code you are proposing) [Link to the InstallHandler interface documentation](http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_i...
You mentioned state lists, I suspect you have other settings going in there but as an FYI in Spring 13 SFDC finally is releasing - State and Country Picklists — Beta <https://na1.salesforce.com/help/doc/en/salesforce_spring13_release_notes.pdf> Page 117
6,120
I have a batch job which gets a number of users in the start interface. So I implement the following APIs ``` global Database.QueryLocator start(Database.BatchableContext bc) global void execute(Database.BatchableContext bc, List<User> users) global void finish(Database.BatchableContext bc) ``` I am wondering is...
2013/01/10
[ "https://salesforce.stackexchange.com/questions/6120", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/943/" ]
I think there are three considerations here: 1. Is the data static, or will it change as a result of user interaction 2. How much data is involved 3. Is the data identical for every subscriber Custom settings are designed to be used where data is "written seldom and read often". If the data doesn't change then perhap...
You mentioned state lists, I suspect you have other settings going in there but as an FYI in Spring 13 SFDC finally is releasing - State and Country Picklists — Beta <https://na1.salesforce.com/help/doc/en/salesforce_spring13_release_notes.pdf> Page 117
65,837
I have worked as a lead product developer for this company for 10 years. I don't have any issues in our work environment except the following: ***my manager doesn't seem to value my time.*** Some examples: * He will call me for a meeting for which I am not required and which goes on for hours. * He schedules personal...
2016/04/25
[ "https://workplace.stackexchange.com/questions/65837", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/30480/" ]
You should not tell him that he is wasting your time, as he might not be realizing that, and he might be thinking that those meetings are in fact helping you all. So instead, think of alternative methods to have short meetings which can help execute the meetings successfully with productive takeaways, as well as optim...
You might want to consider *why* he's doing this. If he seemingly wants you to be privy to meetings between a boss and subordinates, in a company where you have worked for 10 years, it's entirely possible that you are being groomed for a promotion in which you'll *have to* be part of these types of meetings. In eithe...
65,837
I have worked as a lead product developer for this company for 10 years. I don't have any issues in our work environment except the following: ***my manager doesn't seem to value my time.*** Some examples: * He will call me for a meeting for which I am not required and which goes on for hours. * He schedules personal...
2016/04/25
[ "https://workplace.stackexchange.com/questions/65837", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/30480/" ]
You should not tell him that he is wasting your time, as he might not be realizing that, and he might be thinking that those meetings are in fact helping you all. So instead, think of alternative methods to have short meetings which can help execute the meetings successfully with productive takeaways, as well as optim...
Telling your boss that he is wasting your time is absolutely wrong and disrespectful. Rather ask him permission for not attending the meeting which you don't find useful. Also try to explain him how is that meeting not useful to you and that you have more important work left pending for the day. Well, glad if he agrees...
65,837
I have worked as a lead product developer for this company for 10 years. I don't have any issues in our work environment except the following: ***my manager doesn't seem to value my time.*** Some examples: * He will call me for a meeting for which I am not required and which goes on for hours. * He schedules personal...
2016/04/25
[ "https://workplace.stackexchange.com/questions/65837", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/30480/" ]
You might want to consider *why* he's doing this. If he seemingly wants you to be privy to meetings between a boss and subordinates, in a company where you have worked for 10 years, it's entirely possible that you are being groomed for a promotion in which you'll *have to* be part of these types of meetings. In eithe...
Telling your boss that he is wasting your time is absolutely wrong and disrespectful. Rather ask him permission for not attending the meeting which you don't find useful. Also try to explain him how is that meeting not useful to you and that you have more important work left pending for the day. Well, glad if he agrees...
65,837
I have worked as a lead product developer for this company for 10 years. I don't have any issues in our work environment except the following: ***my manager doesn't seem to value my time.*** Some examples: * He will call me for a meeting for which I am not required and which goes on for hours. * He schedules personal...
2016/04/25
[ "https://workplace.stackexchange.com/questions/65837", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/30480/" ]
> > I can't go home for the day until my work is done > > > This is why your manager doesn't value your time. He never experiences the negative consequences of having you stand around doing nothing for an hour, because you always take that hour out of your personal life. It's fairly natural, if a little careless, ...
You might want to consider *why* he's doing this. If he seemingly wants you to be privy to meetings between a boss and subordinates, in a company where you have worked for 10 years, it's entirely possible that you are being groomed for a promotion in which you'll *have to* be part of these types of meetings. In eithe...
65,837
I have worked as a lead product developer for this company for 10 years. I don't have any issues in our work environment except the following: ***my manager doesn't seem to value my time.*** Some examples: * He will call me for a meeting for which I am not required and which goes on for hours. * He schedules personal...
2016/04/25
[ "https://workplace.stackexchange.com/questions/65837", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/30480/" ]
> > I can't go home for the day until my work is done > > > This is why your manager doesn't value your time. He never experiences the negative consequences of having you stand around doing nothing for an hour, because you always take that hour out of your personal life. It's fairly natural, if a little careless, ...
Telling your boss that he is wasting your time is absolutely wrong and disrespectful. Rather ask him permission for not attending the meeting which you don't find useful. Also try to explain him how is that meeting not useful to you and that you have more important work left pending for the day. Well, glad if he agrees...
20,615,703
I have a lost password feature: 1. html form with a JSON call that when submitted and user/email is correct sends an activation code 2. after success, jQuery creates a new form(and removes the old one) Code: ``` $('form.lost').remove(); $('section#content').html('<form method="get" class="newpass"></form>'); $('form...
2013/12/16
[ "https://Stackoverflow.com/questions/20615703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1143676/" ]
I'm guessing you are using a `Collection` of `KeyValuePair<long, long>` and that these two values are the x and y coordinates. For settings only value, I would recommend setting the other value to `-1`. This would be fine as you are not using `ulong`. Say these assumptions are correct and your collection is called `Po...
If I am not wrong, you are using a dictionary and if is the case, the first value of the dictionary is for the X value and the second value is for the Y value. In a dictionary, the first value is the key and must be unique. i know that when you try to add two keys with the same value, the dicitionary throw an exceptio...
39,900,074
I am trying to test a pure react component. Component ========= ``` import React, {Component} from 'react'; class App extends Component { constructor (props){ super(props); props.init(); } render() { return ( <div className="container-wrapper"> {this.p...
2016/10/06
[ "https://Stackoverflow.com/questions/39900074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3236925/" ]
You can simply pass a child to your `<App />` component: ``` it('Renders App', () => { const component = renderer.create( <App init={blank}> Hello App. </App> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); ```
The previous solution still returns string. You can return any HTML element instead ``` it('Renders App', () => { const component = renderer.create( <App init={blank}> <div /> </App> ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); ```
4,719,686
I am sending an html formatted email message using MailMessage class. Code is as follows: ``` MailMessage message = new MailMessage(); message.body = "<html><body><b>test message</b></body></html>"; message.IsBodyHtml = true; ....... skipped To/From settings - irrelevant ....... new SmtpClient().Send(message); ``` W...
2011/01/18
[ "https://Stackoverflow.com/questions/4719686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151200/" ]
Encryption in SQL is really only good for securing the data as it rests on the server, although that doesn't mean that it is unimportant. When you mention that a prime concern is injection attacks or the likes, my concern would be whether or not the database uses a single account (SQL or otherwise) to connect to the da...
Some practices that we follow: 1. Never use dynamic sql. It's completely unnecessary. 2. Regardless of #1, always parameterize your queries. This alone will get rid of sql injection, but there are lots of other entry points. 3. Use the least priviledged account you can for accessing the database server. This typically...
4,719,686
I am sending an html formatted email message using MailMessage class. Code is as follows: ``` MailMessage message = new MailMessage(); message.body = "<html><body><b>test message</b></body></html>"; message.IsBodyHtml = true; ....... skipped To/From settings - irrelevant ....... new SmtpClient().Send(message); ``` W...
2011/01/18
[ "https://Stackoverflow.com/questions/4719686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151200/" ]
Encryption in SQL is really only good for securing the data as it rests on the server, although that doesn't mean that it is unimportant. When you mention that a prime concern is injection attacks or the likes, my concern would be whether or not the database uses a single account (SQL or otherwise) to connect to the da...
Your issue is key management. No matter how many way's you turn the problem around, you'll end up with one simple elementary fact: the service process needs access to the keys to encrypt the data (is important that is a background service because that implies it cannot obtain the root of the encryption hierarchy key fr...
4,719,686
I am sending an html formatted email message using MailMessage class. Code is as follows: ``` MailMessage message = new MailMessage(); message.body = "<html><body><b>test message</b></body></html>"; message.IsBodyHtml = true; ....... skipped To/From settings - irrelevant ....... new SmtpClient().Send(message); ``` W...
2011/01/18
[ "https://Stackoverflow.com/questions/4719686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151200/" ]
Some practices that we follow: 1. Never use dynamic sql. It's completely unnecessary. 2. Regardless of #1, always parameterize your queries. This alone will get rid of sql injection, but there are lots of other entry points. 3. Use the least priviledged account you can for accessing the database server. This typically...
Your issue is key management. No matter how many way's you turn the problem around, you'll end up with one simple elementary fact: the service process needs access to the keys to encrypt the data (is important that is a background service because that implies it cannot obtain the root of the encryption hierarchy key fr...
280,461
I was drawn to the word, ‘ingénue’ being used in reference to a male sportsman in the New York Times’ (October 15) article reporting that Lamar Odom, basketball star who won two N.B.A. titles with the Los Angeles Lakers was found unconscious in a Nevada brothel. It reads: > > When the E! network unveiled its plans fo...
2015/10/16
[ "https://english.stackexchange.com/questions/280461", "https://english.stackexchange.com", "https://english.stackexchange.com/users/3119/" ]
The term ingénue is used *metaphorically* suggesting that he is no fool and he was perfectly aware of what he was doing and what was going on in relation to the spinoff in which he probably had an active role. ***[Ingénue](http://www.vocabulary.com/dictionary/ingenue)***: > > * comes from the French ingénu meaning...
"Ingénue" is usually a cute little side character. I believe the usage in this case implies that Odom did not take a backseat roll in the making and marketing of the spinoff, but rather was very vocal and very involved.
48,671,906
I have recently upgraded my project from asp.net core 1.1 to asp.net core 2.0. and app us using .Net framework 4.6.1. Application is working as expected on local dev machine but once it deployed to server with dotnet publish command I am seeing this error > > InvalidOperationException: Cannot find reference assembly ...
2018/02/07
[ "https://Stackoverflow.com/questions/48671906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336767/" ]
Same issue was resolved when MvcRazorCompileOnPublish was added to .csproj file. Give it a try. ``` <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> ```
I noticed if you have the Views folder included with the compiled View.dll when you start your IIS pool, you get this error. I was doing this on purpose for a short term work around hack.
48,671,906
I have recently upgraded my project from asp.net core 1.1 to asp.net core 2.0. and app us using .Net framework 4.6.1. Application is working as expected on local dev machine but once it deployed to server with dotnet publish command I am seeing this error > > InvalidOperationException: Cannot find reference assembly ...
2018/02/07
[ "https://Stackoverflow.com/questions/48671906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336767/" ]
Same issue was resolved when MvcRazorCompileOnPublish was added to .csproj file. Give it a try. ``` <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish> <MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish> ```
In my case (I run .Net core in console application mode) none of above solutions didn't works, i just downloaded .Net Framework 4.6.1 from [this](https://dotnet.microsoft.com/download/dotnet-framework/net461) link.
48,671,906
I have recently upgraded my project from asp.net core 1.1 to asp.net core 2.0. and app us using .Net framework 4.6.1. Application is working as expected on local dev machine but once it deployed to server with dotnet publish command I am seeing this error > > InvalidOperationException: Cannot find reference assembly ...
2018/02/07
[ "https://Stackoverflow.com/questions/48671906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336767/" ]
I noticed if you have the Views folder included with the compiled View.dll when you start your IIS pool, you get this error. I was doing this on purpose for a short term work around hack.
In my case (I run .Net core in console application mode) none of above solutions didn't works, i just downloaded .Net Framework 4.6.1 from [this](https://dotnet.microsoft.com/download/dotnet-framework/net461) link.
53,634,916
I'm building some test BPMN 2.0 models and saving them to xml files, in a Java project, by following the examples provided by the official [doc](https://docs.camunda.org/manual/7.10/user-guide/model-api/bpmn-model-api/create-a-model/#example-2-create-a-simple-process-with-two-parallel-tasks), in this case the example 2...
2018/12/05
[ "https://Stackoverflow.com/questions/53634916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8737144/" ]
I finally got it working by switching to the fluent model builder API, following this <https://blog.camunda.com/post/2014/02/the-new-camunda-bpmn-model-api/> This is my updated test calss: ``` import org.camunda.bpm.model.bpmn.Bpmn; import org.camunda.bpm.model.bpmn.BpmnModelInstance; import org.camunda.bpm.model.bpm...
Missing isExecutable parameter in process ``` // create a process Process process = modelInstance.newInstance(Process.class); process.setExecutable(true); ```
53,725,691
When I try to load across a many-partitioned parquet file, some of the schema get inferred invalidly because of missing data which fills the schema in with nulls. I would think specifying the schema in the pyarrow.parquet.ParquetDataset would fix this but I don't know how to construct a schema of the correct pyarrow.pa...
2018/12/11
[ "https://Stackoverflow.com/questions/53725691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8296574/" ]
There is not an API to construct a Parquet schema in Python yet. You can use one that you read from a particular file, though (see `pq.ParquetFile(...).schema`). Could you open an issue on the ARROW JIRA project to request the feature to construct Parquet schemas in Python? <https://issues.apache.org/jira>
So thank you (whoever you are) if there was the ticket and fix in ARROW JIRA of this. I was able to merge schemas of files in dataset and read dataset: ``` import pyarrow as pa import pa.parquet as pq merged_schema = pa.schema([]) for filename in os.listdir(dataset_folder): schema_ = pq.read_table(os.path.join(...
163,224
I am currently studying Group Theory from I.N. Herstein's Topics in Algebra.However after studying about 50 pages of it I felt it lacks a bit of geometrical flavour (one of my friends described via email some time back how dihedral groups were treated in his course).He also said that Herstein's treatment is not exactly...
2012/06/26
[ "https://math.stackexchange.com/questions/163224", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I first learned algebra from Herstein in Honors Algebra as an undergraduate, so the book will always have a special place in my heart. Is it old fashioned? I dunno if at this level it really makes that much of a difference. No, it doesn't have any category theory or homological algebra and no, it doesn't have a geometr...
All of the books named in the comments are good choices. Probably look at as many as you can, and decide which one(s) you would like to work through. One book not listed is Dummit & Foote's Abstract Algebra. This book is a standard intro algebra book, for both undergraduate and graduate courses. It is fairly encyclope...
253,020
If a conductive wire was carrying current $I$, it would create a magnetic field: $$B=\frac{\mu\_0I}{2\pi r}$$ However, if it's not a wire, but instead a plate how would the expression change/adjust to that geometry? Also, if a conductive plate carrying current is placed in a magnetic field, would the geometry (from...
2016/04/30
[ "https://physics.stackexchange.com/questions/253020", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31452/" ]
Consider a rectangular Amperian loop instead of a circular one, oriented so the normal is perpendicular to the current. [![enter image description here](https://i.stack.imgur.com/qRVXI.gif)](https://i.stack.imgur.com/qRVXI.gif) The current enclosed is equal to the current $I$ times the length of the loop. $$\mu L K...
For a straight conducting wire, the magnetic field curls around it in concentric circular field lines. In the case of a current carrying plate (of infinite spread), you can consider it as a tightly packed combination of an infinite number of parallel wires all carrying the same current, with negligible cross-section al...
253,020
If a conductive wire was carrying current $I$, it would create a magnetic field: $$B=\frac{\mu\_0I}{2\pi r}$$ However, if it's not a wire, but instead a plate how would the expression change/adjust to that geometry? Also, if a conductive plate carrying current is placed in a magnetic field, would the geometry (from...
2016/04/30
[ "https://physics.stackexchange.com/questions/253020", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31452/" ]
Consider a rectangular Amperian loop instead of a circular one, oriented so the normal is perpendicular to the current. [![enter image description here](https://i.stack.imgur.com/qRVXI.gif)](https://i.stack.imgur.com/qRVXI.gif) The current enclosed is equal to the current $I$ times the length of the loop. $$\mu L K...
I like the above two answers, I think it's more what you're looking for, but I'll still add my two cents.. You could combine Maxwell's equations (while neglecting the timescales for charges to move to conductor surfaces ($\frac{\partial \mathbf{E}}{\partial t}$)) to get the induction equation $\frac{\partial \mathbf{...
253,020
If a conductive wire was carrying current $I$, it would create a magnetic field: $$B=\frac{\mu\_0I}{2\pi r}$$ However, if it's not a wire, but instead a plate how would the expression change/adjust to that geometry? Also, if a conductive plate carrying current is placed in a magnetic field, would the geometry (from...
2016/04/30
[ "https://physics.stackexchange.com/questions/253020", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/31452/" ]
For a straight conducting wire, the magnetic field curls around it in concentric circular field lines. In the case of a current carrying plate (of infinite spread), you can consider it as a tightly packed combination of an infinite number of parallel wires all carrying the same current, with negligible cross-section al...
I like the above two answers, I think it's more what you're looking for, but I'll still add my two cents.. You could combine Maxwell's equations (while neglecting the timescales for charges to move to conductor surfaces ($\frac{\partial \mathbf{E}}{\partial t}$)) to get the induction equation $\frac{\partial \mathbf{...
244,950
I rendered the form to create a taxonomy term via the [Inline Entity Form](https://www.drupal.org/project/inline_entity_form) module. Is there a way to validate the values submitted in that form using `hook_taxonomy_term_presave()` or another hook? I tried with `hook_form_alter()`, but it didn't work.
2017/08/31
[ "https://drupal.stackexchange.com/questions/244950", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/24334/" ]
We use the [Owl carousel](https://www.drupal.org/project/owlcarousel) for this. It lets you specify four breakpoints and the number of slides to show. There is a D8 recommendation for [Flickity](https://www.drupal.org/project/flickity) but it has some licensing restrictions.
I would recommend you do this in a custom way. Output the view in a simple unordered list and use a is library for the carousel. Owl carousel is my favourite, it's got the responsiveness you require.
244,950
I rendered the form to create a taxonomy term via the [Inline Entity Form](https://www.drupal.org/project/inline_entity_form) module. Is there a way to validate the values submitted in that form using `hook_taxonomy_term_presave()` or another hook? I tried with `hook_form_alter()`, but it didn't work.
2017/08/31
[ "https://drupal.stackexchange.com/questions/244950", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/24334/" ]
We use the [Owl carousel](https://www.drupal.org/project/owlcarousel) for this. It lets you specify four breakpoints and the number of slides to show. There is a D8 recommendation for [Flickity](https://www.drupal.org/project/flickity) but it has some licensing restrictions.
I agreed with Kevin howbrook and CG Monroe to use owl carousel module or alternative , but You can alter Drupal JS variables by implementing **hook\_js\_settings\_alter** in your module, ``` function MYMODULE_js_settings_alter(array &$settings, \Drupal\Core\Asset\AttachedAssetsInterface $assets) { if (isset($setti...
10,184,116
When i try to use the following code to load facebook or you youtube into iframe tags nothing is happened. page isn't loaded into iframe tag this problem occurs with multiple sites such as youtube, stackoverflow and facebook code: ``` <head> <title>HTML Test</title> <meta http-equiv="Content-T...
2012/04/17
[ "https://Stackoverflow.com/questions/10184116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1337621/" ]
I tried it <http://jsfiddle.net/KPk6n/1> And looking at the console, I get > > Display forbidden by X-Frame-Options > > > So I think those sites disallow framing, there probably is a workaround to this, but I'd say you should respect them and not frame them
The sites you speak of probably disable access from iFrames. My site works just fine in this example: <http://jsfiddle.net/3vxvm/>
65,883,495
I got an array of objects that has the following structure: ``` const cars = { ford: { entries: ['ford 150'] }, chrysler: { entries: ['Voyager'] }, honda: { entries: [] }, toyota: { entries: ['sienna'] }, mercedes: { entries: [] }, } ``` For the user to be able to rearrange th...
2021/01/25
[ "https://Stackoverflow.com/questions/65883495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11225065/" ]
You can convert the object to entries via `Object.entries()`, and then filter/sort by the value (the 2nd item in the pair), and convert back to an object using `Object.fromEntries()`: ```js const cars = {"ford":{"entries":["ford 150"]},"chrysler":{"entries":["Voyager"]},"honda":{"entries":[]},"toyota":{"entries":["sie...
Checking your code... the `filter` method doesn't works because return an array... do you need use `length` property to check if has values, otherwise it will always be `true` ```js const cars = { ford: { entries: ['ford 150'] }, chrysler: { entries: ['Voyager'] }, honda: { entries: [] }, toy...