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
8,692,013
According to the spec, global names with leading underscores are not allowed: > > 17.4.3.1.2 Global names > > — Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace. > > > Does this also apply for names defined in a top-level anonymous namespace?
2012/01/01
[ "https://Stackoverflow.com/questions/8692013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75889/" ]
Names starting with a leading underscore followed by a non-capital alphanumeric character and not including a double underscore are only reserved in the global namespace. The reason for this is that on some systems certain names need to get a leading underscore or are already used by the underlying operating system and...
Yes. But that quote doesn't address that (as you know it yourself). Here is what I think applies to that: > > **17.4.3.1.3 External linkage** > > > 3 . Each name having two consecutive underscores (2.11) is reserved to the implementation for use as a name with both extern "C" and extern "C++" linkage. > > > I ...
68,058,222
I am trying to perform the ShrinkWrap deformer on two 3D models to be able later on to perform the morph from one model to another . When i apply the function i did , when i manipulate the offset value or the target inflation it doesn't give me the same shape of the second Model , it gives me an incomplete different sh...
2021/06/20
[ "https://Stackoverflow.com/questions/68058222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16273640/" ]
I can give you my piece of code to create a shrinkWrap, I don't have maya so can't really check your code : ``` def getTargetMesh(targetTrans=str): sh = cmds.ls(targetTrans, dag=True, shapes=True) # Find if at least one of them is an allowable target type for s in sh: io = cmds.getAttr(s+".io") ...
I cleaned up DrWeeny's excellent answer for my own purposes and figured I might as well post it up. ``` import maya.cmds as cmds def create_shrink_wrap(mesh, target, **kwargs): """ Check available kwargs with parameters below. """ parameters = [ ("projection", 2), ("closestIfNoIntersec...
140,392
As a simplified example: ``` In[780]:= f[x_] := a /. {a -> x}; f[1] Out[781]= 1 ``` This yields the correct result. But ``` In[775]:= rule = {a -> x}; f[x_] := a /. rule; f[1] Out[777]= x ``` This does not work at all. It seems to me that the two ways should be equivalent. I want to use the second form to mak...
2017/03/18
[ "https://mathematica.stackexchange.com/questions/140392", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/47451/" ]
To fully understand this answer one must know about `DownValues`, the documentation is a good place to start reading about this, as well as [(96)](https://mathematica.stackexchange.com/q/96/731). In your situation, it is better to use `=` instead of delayed assignment `:=`. Let's take a look what this means for the fu...
You can make use of dynamic scoping, i.e. `Block`. ``` rule = {a -> x}; f[z_] := Block[{x}, x = z; a /. rule]; ``` `f[1]` now gives `1`. Practically speaking, in the way you did it at first, `x` on the right-hand side of `f[x_] := ...` is only local to the function definition. It is different from any `x` outside. ...
11,444,779
When I type in an input box, my firefox browser automatically provide suggestions based on whatever I typed in this input box before. With jQuery Autocomplete enabled on this input box, before Autocomplete finish loading its suggestions, browser's suggestion comes first. How can I disable the browser suggestion?
2012/07/12
[ "https://Stackoverflow.com/questions/11444779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775698/" ]
All you have to do is specify autocomplete="off" ``` <input type="text" value="" id="searchBox" autocomplete="off"> ```
If you are using HTML5 or normal HTML then you can use the following code: ``` <input name="username" size="40" autocomplete="off"> ```
11,444,779
When I type in an input box, my firefox browser automatically provide suggestions based on whatever I typed in this input box before. With jQuery Autocomplete enabled on this input box, before Autocomplete finish loading its suggestions, browser's suggestion comes first. How can I disable the browser suggestion?
2012/07/12
[ "https://Stackoverflow.com/questions/11444779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775698/" ]
All you have to do is specify autocomplete="off" ``` <input type="text" value="" id="searchBox" autocomplete="off"> ```
Lately it's better to use `autocomplete=nope`. Where `nope` is an invalid value. With the jQuery (UI) autocomplete plugin you can use the following to change it from `off` to `nope`: ``` $('#Element').autocomplete({ create: function( event, ui ) { $(this).attr('autocomplete', 'nope'); } }); ```
11,444,779
When I type in an input box, my firefox browser automatically provide suggestions based on whatever I typed in this input box before. With jQuery Autocomplete enabled on this input box, before Autocomplete finish loading its suggestions, browser's suggestion comes first. How can I disable the browser suggestion?
2012/07/12
[ "https://Stackoverflow.com/questions/11444779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775698/" ]
JQuery Autocomplete automatically adds autocomplete=off, you don't need to do this yourself. Are you using a browser extenstion that overrides autocomplete=off? If so, it will override this.
If you are using HTML5 or normal HTML then you can use the following code: ``` <input name="username" size="40" autocomplete="off"> ```
11,444,779
When I type in an input box, my firefox browser automatically provide suggestions based on whatever I typed in this input box before. With jQuery Autocomplete enabled on this input box, before Autocomplete finish loading its suggestions, browser's suggestion comes first. How can I disable the browser suggestion?
2012/07/12
[ "https://Stackoverflow.com/questions/11444779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775698/" ]
If you are using HTML5 or normal HTML then you can use the following code: ``` <input name="username" size="40" autocomplete="off"> ```
Lately it's better to use `autocomplete=nope`. Where `nope` is an invalid value. With the jQuery (UI) autocomplete plugin you can use the following to change it from `off` to `nope`: ``` $('#Element').autocomplete({ create: function( event, ui ) { $(this).attr('autocomplete', 'nope'); } }); ```
11,444,779
When I type in an input box, my firefox browser automatically provide suggestions based on whatever I typed in this input box before. With jQuery Autocomplete enabled on this input box, before Autocomplete finish loading its suggestions, browser's suggestion comes first. How can I disable the browser suggestion?
2012/07/12
[ "https://Stackoverflow.com/questions/11444779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775698/" ]
JQuery Autocomplete automatically adds autocomplete=off, you don't need to do this yourself. Are you using a browser extenstion that overrides autocomplete=off? If so, it will override this.
Lately it's better to use `autocomplete=nope`. Where `nope` is an invalid value. With the jQuery (UI) autocomplete plugin you can use the following to change it from `off` to `nope`: ``` $('#Element').autocomplete({ create: function( event, ui ) { $(this).attr('autocomplete', 'nope'); } }); ```
12,449
Is it possible to play music (or even video) stored on my laptop HDD, through XBMC which is running on my Pi attached to the TV?
2013/12/23
[ "https://raspberrypi.stackexchange.com/questions/12449", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/11467/" ]
Yes. If you install a DLNA server on your Laptop, or share the music folder on the laptop, XBMC can read from the share to play music on your TV. If the laptop is running Linux, then a NFS share is the way to do it. Otherwise if it's running Windows, XBMC can read SMB shares as well. Installing a DLNA server will be ...
Film and Music in iTunes require airplay to be activated in XMBC.
2,743,812
Has anyone already created a PDF document in an iPad app? I see that there are new functions in the UIKit to do this, but I can't find any code example for it. ``` BOOL UIGraphicsBeginPDFContextToFile ( NSString *path, CGRect bounds, NSDictionary *documentInfo ); void UIGraphicsBeginPDFPage ( void ); ``...
2010/04/30
[ "https://Stackoverflow.com/questions/2743812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/279778/" ]
Here is a method that will create a new PDF document. It does not do text formatting though. ``` - (void) createNewPDF: (NSString *) saveFileName withContent: (NSString *) content forSize: (int) fontSize andFont:(NSString *) font andColor: (UIColor *) color { NSArray *paths = NSSearchPathForDirectoriesInDomai...
This is a better solution as it uses the correct coordinate transform to get the text to print from the top down. ``` #define LEFT_MARGIN 25 #define RIGHT_MARGIN 25 #define TOP_MARGIN 35 #define BOTTOM_MARGIN 50 #define BOTTOM_FOOTER_MARGIN 32 #define DOC_WIDTH 595 #define DOC_HEIGHT 842 - (void) createPDF:(NSString...
2,743,812
Has anyone already created a PDF document in an iPad app? I see that there are new functions in the UIKit to do this, but I can't find any code example for it. ``` BOOL UIGraphicsBeginPDFContextToFile ( NSString *path, CGRect bounds, NSDictionary *documentInfo ); void UIGraphicsBeginPDFPage ( void ); ``...
2010/04/30
[ "https://Stackoverflow.com/questions/2743812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/279778/" ]
I actually got multi page PDF creation working by modifying the code above, like: ``` - (void) createPDF:(NSString *)fileName withContent:(NSString *)content forSize:(int)fontSize andFont:(NSString *)font andColor:(UIColor *)color { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomain...
Here is a method that will create a new PDF document. It does not do text formatting though. ``` - (void) createNewPDF: (NSString *) saveFileName withContent: (NSString *) content forSize: (int) fontSize andFont:(NSString *) font andColor: (UIColor *) color { NSArray *paths = NSSearchPathForDirectoriesInDomai...
2,743,812
Has anyone already created a PDF document in an iPad app? I see that there are new functions in the UIKit to do this, but I can't find any code example for it. ``` BOOL UIGraphicsBeginPDFContextToFile ( NSString *path, CGRect bounds, NSDictionary *documentInfo ); void UIGraphicsBeginPDFPage ( void ); ``...
2010/04/30
[ "https://Stackoverflow.com/questions/2743812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/279778/" ]
I actually got multi page PDF creation working by modifying the code above, like: ``` - (void) createPDF:(NSString *)fileName withContent:(NSString *)content forSize:(int)fontSize andFont:(NSString *)font andColor:(UIColor *)color { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomain...
This is a better solution as it uses the correct coordinate transform to get the text to print from the top down. ``` #define LEFT_MARGIN 25 #define RIGHT_MARGIN 25 #define TOP_MARGIN 35 #define BOTTOM_MARGIN 50 #define BOTTOM_FOOTER_MARGIN 32 #define DOC_WIDTH 595 #define DOC_HEIGHT 842 - (void) createPDF:(NSString...
2,743,812
Has anyone already created a PDF document in an iPad app? I see that there are new functions in the UIKit to do this, but I can't find any code example for it. ``` BOOL UIGraphicsBeginPDFContextToFile ( NSString *path, CGRect bounds, NSDictionary *documentInfo ); void UIGraphicsBeginPDFPage ( void ); ``...
2010/04/30
[ "https://Stackoverflow.com/questions/2743812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/279778/" ]
just to let you know that the error message: invalid Type1 font: unable to stream font and: FT\_Load\_Glyph failed: error 6. disappeared in iOS 4.2
This is a better solution as it uses the correct coordinate transform to get the text to print from the top down. ``` #define LEFT_MARGIN 25 #define RIGHT_MARGIN 25 #define TOP_MARGIN 35 #define BOTTOM_MARGIN 50 #define BOTTOM_FOOTER_MARGIN 32 #define DOC_WIDTH 595 #define DOC_HEIGHT 842 - (void) createPDF:(NSString...
2,743,812
Has anyone already created a PDF document in an iPad app? I see that there are new functions in the UIKit to do this, but I can't find any code example for it. ``` BOOL UIGraphicsBeginPDFContextToFile ( NSString *path, CGRect bounds, NSDictionary *documentInfo ); void UIGraphicsBeginPDFPage ( void ); ``...
2010/04/30
[ "https://Stackoverflow.com/questions/2743812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/279778/" ]
I actually got multi page PDF creation working by modifying the code above, like: ``` - (void) createPDF:(NSString *)fileName withContent:(NSString *)content forSize:(int)fontSize andFont:(NSString *)font andColor:(UIColor *)color { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomain...
just to let you know that the error message: invalid Type1 font: unable to stream font and: FT\_Load\_Glyph failed: error 6. disappeared in iOS 4.2
2,498,937
I have two text files that contain columnar data of the variety `position`-`value`, sorted by `position`. Here is an example of the first file (file `A`): ``` 100 1 101 1 102 0 103 2 104 1 ... ``` Here is an example of the second file (`B`): ``` 20 0 21 0 ... 100 2 101 1 192 3 193 1 ... ``...
2010/03/23
[ "https://Stackoverflow.com/questions/2498937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19410/" ]
If the files are sorted, step through them based on which one has the lower position. Pseudocode: ``` read Apos, Aval from A # initial values read Bpos, Bval from B until eof(A) or eof(B) if Apos == Bpos then compare() read Apos, Aval from A # advance both files to get a new position read Bpos, Bval fr...
For looping through files you can use the core [Tie::File](http://perldoc.perl.org/Tie/File.html) module. It represents a regular text file as an array.
2,498,937
I have two text files that contain columnar data of the variety `position`-`value`, sorted by `position`. Here is an example of the first file (file `A`): ``` 100 1 101 1 102 0 103 2 104 1 ... ``` Here is an example of the second file (`B`): ``` 20 0 21 0 ... 100 2 101 1 192 3 193 1 ... ``...
2010/03/23
[ "https://Stackoverflow.com/questions/2498937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19410/" ]
Looks like a problem one would likely stumble upon, for example database table data with keys and values. Here's an implementation of the pseudocode provided by rjp. ``` #!/usr/bin/perl use strict; use warnings; sub read_file_line { my $fh = shift; if ($fh and my $line = <$fh>) { chomp $line; return [ s...
For looping through files you can use the core [Tie::File](http://perldoc.perl.org/Tie/File.html) module. It represents a regular text file as an array.
2,498,937
I have two text files that contain columnar data of the variety `position`-`value`, sorted by `position`. Here is an example of the first file (file `A`): ``` 100 1 101 1 102 0 103 2 104 1 ... ``` Here is an example of the second file (`B`): ``` 20 0 21 0 ... 100 2 101 1 192 3 193 1 ... ``...
2010/03/23
[ "https://Stackoverflow.com/questions/2498937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19410/" ]
Looks like a problem one would likely stumble upon, for example database table data with keys and values. Here's an implementation of the pseudocode provided by rjp. ``` #!/usr/bin/perl use strict; use warnings; sub read_file_line { my $fh = shift; if ($fh and my $line = <$fh>) { chomp $line; return [ s...
If the files are sorted, step through them based on which one has the lower position. Pseudocode: ``` read Apos, Aval from A # initial values read Bpos, Bval from B until eof(A) or eof(B) if Apos == Bpos then compare() read Apos, Aval from A # advance both files to get a new position read Bpos, Bval fr...
2,498,937
I have two text files that contain columnar data of the variety `position`-`value`, sorted by `position`. Here is an example of the first file (file `A`): ``` 100 1 101 1 102 0 103 2 104 1 ... ``` Here is an example of the second file (`B`): ``` 20 0 21 0 ... 100 2 101 1 192 3 193 1 ... ``...
2010/03/23
[ "https://Stackoverflow.com/questions/2498937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19410/" ]
If the files are sorted, step through them based on which one has the lower position. Pseudocode: ``` read Apos, Aval from A # initial values read Bpos, Bval from B until eof(A) or eof(B) if Apos == Bpos then compare() read Apos, Aval from A # advance both files to get a new position read Bpos, Bval fr...
Here is a quick solution. If the data in both files is pretty much equivalent (e.g. same number of lines), you don't really need to store in hash tables. But I thought it would be helpful in case you the data is scrambled. Code: ``` open(f1, "<data1"); open(f2, "<data2"); # initialize hashes %data1 = (); %data2 = ();...
2,498,937
I have two text files that contain columnar data of the variety `position`-`value`, sorted by `position`. Here is an example of the first file (file `A`): ``` 100 1 101 1 102 0 103 2 104 1 ... ``` Here is an example of the second file (`B`): ``` 20 0 21 0 ... 100 2 101 1 192 3 193 1 ... ``...
2010/03/23
[ "https://Stackoverflow.com/questions/2498937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19410/" ]
Looks like a problem one would likely stumble upon, for example database table data with keys and values. Here's an implementation of the pseudocode provided by rjp. ``` #!/usr/bin/perl use strict; use warnings; sub read_file_line { my $fh = shift; if ($fh and my $line = <$fh>) { chomp $line; return [ s...
Here is a quick solution. If the data in both files is pretty much equivalent (e.g. same number of lines), you don't really need to store in hash tables. But I thought it would be helpful in case you the data is scrambled. Code: ``` open(f1, "<data1"); open(f2, "<data2"); # initialize hashes %data1 = (); %data2 = ();...
38,094,555
In a golang program I'm reading the Os.Stdin input from a bufio.Reader. After enter is pressed, the program reads the input and it is then printed onto the console. Is it possible to not print the input onto the console? After reading it, I process the input and reprint it (and no longer need the original input). I ...
2016/06/29
[ "https://Stackoverflow.com/questions/38094555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4443226/" ]
I cannot think to other methods than to use [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) to clear the terminal and move the cursor to a specific location (in your case to column 1:row 1). ``` var screen *bytes.Buffer = new(bytes.Buffer) var output *bufio.Writer = bufio.NewWriter(os.Stdout) ``` ...
It seems you are looking for a terminal-specific function to disable echo. This is usually used when writing passwords on the terminal (you can type but you don't see the characters). I suggest you give a try to [terminal.ReadPassword](https://godoc.org/golang.org/x/crypto/ssh/terminal#Terminal.ReadPassword) it should...
38,094,555
In a golang program I'm reading the Os.Stdin input from a bufio.Reader. After enter is pressed, the program reads the input and it is then printed onto the console. Is it possible to not print the input onto the console? After reading it, I process the input and reprint it (and no longer need the original input). I ...
2016/06/29
[ "https://Stackoverflow.com/questions/38094555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4443226/" ]
I cannot think to other methods than to use [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) to clear the terminal and move the cursor to a specific location (in your case to column 1:row 1). ``` var screen *bytes.Buffer = new(bytes.Buffer) var output *bufio.Writer = bufio.NewWriter(os.Stdout) ``` ...
other than crypto/ssh/terminal; ``` package main import ( "bufio" "fmt" "os" "os/exec" ) func raw(start bool) error { r := "raw" if !start { r = "-raw" } rawMode := exec.Command("stty", r) rawMode.Stdin = os.Stdin err := rawMode.Run() if err != nil { retur...
38,094,555
In a golang program I'm reading the Os.Stdin input from a bufio.Reader. After enter is pressed, the program reads the input and it is then printed onto the console. Is it possible to not print the input onto the console? After reading it, I process the input and reprint it (and no longer need the original input). I ...
2016/06/29
[ "https://Stackoverflow.com/questions/38094555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4443226/" ]
It seems you are looking for a terminal-specific function to disable echo. This is usually used when writing passwords on the terminal (you can type but you don't see the characters). I suggest you give a try to [terminal.ReadPassword](https://godoc.org/golang.org/x/crypto/ssh/terminal#Terminal.ReadPassword) it should...
other than crypto/ssh/terminal; ``` package main import ( "bufio" "fmt" "os" "os/exec" ) func raw(start bool) error { r := "raw" if !start { r = "-raw" } rawMode := exec.Command("stty", r) rawMode.Stdin = os.Stdin err := rawMode.Run() if err != nil { retur...
10,914,932
Hi everyone I want to send/receive data serially via rs-232 using c#,VS10 ... my code for do so is as follows ..... ``` SerialPort sp = new SerialPort(); //predefined values are baud rate =9600, parity=none, databits=8,stopbit=1 //for sending data I used a textbox same name itself and a button "sendbutton" which code...
2012/06/06
[ "https://Stackoverflow.com/questions/10914932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
First thing I would do is use a different application to read the data. HyperTerminal, for example. Try to figure out if your app is sending or not, then, once you get it to send, work on trying to figure out if it is receiving data properly or not.
Before you debug this. First rule of any hardware interation - you should verify that that the hardware and OS are correctly working. Both machines should be able to communicate to either other, or modems or other RS232 devices first. If the ports are all working properly, then you should try and debug your program usi...
10,914,932
Hi everyone I want to send/receive data serially via rs-232 using c#,VS10 ... my code for do so is as follows ..... ``` SerialPort sp = new SerialPort(); //predefined values are baud rate =9600, parity=none, databits=8,stopbit=1 //for sending data I used a textbox same name itself and a button "sendbutton" which code...
2012/06/06
[ "https://Stackoverflow.com/questions/10914932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
First thing I would do is use a different application to read the data. HyperTerminal, for example. Try to figure out if your app is sending or not, then, once you get it to send, work on trying to figure out if it is receiving data properly or not.
Call the `Open` method before trying to send anything. The [MSDN Documentation](http://msdn.microsoft.com/de-de/library/system.io.ports.serialport.open.aspx) on the `Open` method even has sample code.
10,914,932
Hi everyone I want to send/receive data serially via rs-232 using c#,VS10 ... my code for do so is as follows ..... ``` SerialPort sp = new SerialPort(); //predefined values are baud rate =9600, parity=none, databits=8,stopbit=1 //for sending data I used a textbox same name itself and a button "sendbutton" which code...
2012/06/06
[ "https://Stackoverflow.com/questions/10914932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Before you debug this. First rule of any hardware interation - you should verify that that the hardware and OS are correctly working. Both machines should be able to communicate to either other, or modems or other RS232 devices first. If the ports are all working properly, then you should try and debug your program usi...
Call the `Open` method before trying to send anything. The [MSDN Documentation](http://msdn.microsoft.com/de-de/library/system.io.ports.serialport.open.aspx) on the `Open` method even has sample code.
12,554,855
> > **Possible Duplicate:** > > [How to dismiss the dialog with click on outside of the dialog?](https://stackoverflow.com/questions/8384067/how-to-dismiss-the-dialog-with-click-on-outside-of-the-dialog) > > > How can I click outside of a popup to dismiss it? Here is my code: ``` cell.setOnClickListener(new...
2012/09/23
[ "https://Stackoverflow.com/questions/12554855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1455043/" ]
Please set setOutsideTouchable(true) along with the background. That worked fine for me. I know that setting the background drawable to null kills the OnTouchListener.
try this way. ``` cell.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { LayoutInflater layoutInflater = (LayoutInflater)ctx.getSystemService("layout_inflater"); View popupView = layoutInflater.inflate(R.layout.popup_w...
43,691,781
I need to pass a few values using POST method form to another payment processor site. Those values are something like tokens which are generated on my account, and I'm currently using basic form with input type="hidden" on those values. And also one variable is encrypted with sha1. But what I'm concerned is the securit...
2017/04/29
[ "https://Stackoverflow.com/questions/43691781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5621203/" ]
If you want to protect transmitted data from prying eyes, then the answer is not to be found in PHP or HTML, but in the web server itself. By default, data between the browser and the server is in plain text. Even binary data is encoded into plain text and decoded at the other end. The *only* way to secure your trans...
If you only want to hide your data from user, you can use sessions in PHP. If you want to secure your data also from ISP's then read answer of @Manngo . He explains everything.
62,172,316
I am using GOOGLE SHEETS and I am trying to manipulate received data in the following way: [![enter image description here](https://i.stack.imgur.com/ctF7b.png)](https://i.stack.imgur.com/ctF7b.png) In column A, I have a number. In column B I have a department. In column C I change the number to concatenate with the ...
2020/06/03
[ "https://Stackoverflow.com/questions/62172316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7155789/" ]
Give this a try: ``` =IF(LEFT(A2,2)="36",A2 & LEFT(B2,1),A2) ``` [![enter image description here](https://i.stack.imgur.com/yz4Qm.png)](https://i.stack.imgur.com/yz4Qm.png) This approach does not use `IFERROR()` or `CONCATENATE()`. It assumes your version of Excel uses the English version of the function names an...
``` =IF(LEFT(A2,2)="36",CONCATENATE(A2,LEFT(B2,1)),A2) ```
62,172,316
I am using GOOGLE SHEETS and I am trying to manipulate received data in the following way: [![enter image description here](https://i.stack.imgur.com/ctF7b.png)](https://i.stack.imgur.com/ctF7b.png) In column A, I have a number. In column B I have a department. In column C I change the number to concatenate with the ...
2020/06/03
[ "https://Stackoverflow.com/questions/62172316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7155789/" ]
Give this a try: ``` =IF(LEFT(A2,2)="36",A2 & LEFT(B2,1),A2) ``` [![enter image description here](https://i.stack.imgur.com/yz4Qm.png)](https://i.stack.imgur.com/yz4Qm.png) This approach does not use `IFERROR()` or `CONCATENATE()`. It assumes your version of Excel uses the English version of the function names an...
``` =A2 & LEFT(B2, LEFT(A2, 2)="36") ``` This is a ['golfed' answer](http://codegolf.stackexchange.com): made as short as possible (although, I have left the spaces in for readability) If the first 2 characters of cell A2 are `"36"`, then `LEFT(A2, 2)="36"` will be `True`. Otherwise, `LEFT(A2, 2)="36"` will be `Fals...
62,172,316
I am using GOOGLE SHEETS and I am trying to manipulate received data in the following way: [![enter image description here](https://i.stack.imgur.com/ctF7b.png)](https://i.stack.imgur.com/ctF7b.png) In column A, I have a number. In column B I have a department. In column C I change the number to concatenate with the ...
2020/06/03
[ "https://Stackoverflow.com/questions/62172316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7155789/" ]
``` =IF(LEFT(A2,2)="36",CONCATENATE(A2,LEFT(B2,1)),A2) ```
``` =A2 & LEFT(B2, LEFT(A2, 2)="36") ``` This is a ['golfed' answer](http://codegolf.stackexchange.com): made as short as possible (although, I have left the spaces in for readability) If the first 2 characters of cell A2 are `"36"`, then `LEFT(A2, 2)="36"` will be `True`. Otherwise, `LEFT(A2, 2)="36"` will be `Fals...
25,135,374
I want to make a jquery function which will be returning a number and I want to use that function somewhere else. please suggest if below is the rigt way of doing it. ``` <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> function print() { var count=1; $('#forwa...
2014/08/05
[ "https://Stackoverflow.com/questions/25135374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2866314/" ]
``` UIEdgeInsets UIEdgeInsetsMake ( CGFloat top, CGFloat left, CGFloat bottom, CGFloat right ); ``` You are setting the bottom. Try setting the top insets. Maybe a negative value will help.
`ContentInset` means The distance that the content view is inset from the enclosing scroll view. What you need to do is to change the origin.y value. See [How to make a UITextField move up when keyboard is present?](https://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present)
25,135,374
I want to make a jquery function which will be returning a number and I want to use that function somewhere else. please suggest if below is the rigt way of doing it. ``` <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> function print() { var count=1; $('#forwa...
2014/08/05
[ "https://Stackoverflow.com/questions/25135374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2866314/" ]
After much struggle, I was able to accomplish what I wanted. What I did was, in the `viewDidLoad` I registered for the keyboard notifications. And when the keyboard appears, I got its frame in to a variable and the login form's (which is a table view) frame into another variable. By using `CGRectIntersection` I got th...
``` UIEdgeInsets UIEdgeInsetsMake ( CGFloat top, CGFloat left, CGFloat bottom, CGFloat right ); ``` You are setting the bottom. Try setting the top insets. Maybe a negative value will help.
25,135,374
I want to make a jquery function which will be returning a number and I want to use that function somewhere else. please suggest if below is the rigt way of doing it. ``` <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> function print() { var count=1; $('#forwa...
2014/08/05
[ "https://Stackoverflow.com/questions/25135374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2866314/" ]
After much struggle, I was able to accomplish what I wanted. What I did was, in the `viewDidLoad` I registered for the keyboard notifications. And when the keyboard appears, I got its frame in to a variable and the login form's (which is a table view) frame into another variable. By using `CGRectIntersection` I got th...
`ContentInset` means The distance that the content view is inset from the enclosing scroll view. What you need to do is to change the origin.y value. See [How to make a UITextField move up when keyboard is present?](https://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present)
18,423
I am writing a science fiction novel, where a ship is stranded in a single star system (a red supergiant). One of the plot points is the star becoming supernova in several hours, so the characters have to fix their ship before that happens. I have basic knowledge of how it works: Iron generated from nuclear fusion get...
2016/09/21
[ "https://astronomy.stackexchange.com/questions/18423", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/14305/" ]
I think your best bet would be detecting neutrinos generated by nuclear burning inside the star (as we do for the Sun). Once the star hits the carbon-burning stage, it's actually putting out more energy in neutrinos than in photons. During the silicon-burning phase, which lasts for a few days and is what creates the de...
As [Dean said](https://astronomy.stackexchange.com/questions/18423/are-there-observable-changes-in-a-star-about-to-become-supernova-minutes-or-hou#comment28951_18423), supernova progenitors typically release neutrinos prior to full core collapse, remnant formation and the ejection of the outer layers of the star. The p...
18,423
I am writing a science fiction novel, where a ship is stranded in a single star system (a red supergiant). One of the plot points is the star becoming supernova in several hours, so the characters have to fix their ship before that happens. I have basic knowledge of how it works: Iron generated from nuclear fusion get...
2016/09/21
[ "https://astronomy.stackexchange.com/questions/18423", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/14305/" ]
I think your best bet would be detecting neutrinos generated by nuclear burning inside the star (as we do for the Sun). Once the star hits the carbon-burning stage, it's actually putting out more energy in neutrinos than in photons. During the silicon-burning phase, which lasts for a few days and is what creates the de...
Other answers are correct; a neutrino pulse is definitely expected as a result of a core-collapse supernova and should occur some hours before a shockwave arrives at the surface. There essentially would be no visible sign that the star was about to become a supernova and that is because the dynamical timescale of the ...
18,423
I am writing a science fiction novel, where a ship is stranded in a single star system (a red supergiant). One of the plot points is the star becoming supernova in several hours, so the characters have to fix their ship before that happens. I have basic knowledge of how it works: Iron generated from nuclear fusion get...
2016/09/21
[ "https://astronomy.stackexchange.com/questions/18423", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/14305/" ]
I think your best bet would be detecting neutrinos generated by nuclear burning inside the star (as we do for the Sun). Once the star hits the carbon-burning stage, it's actually putting out more energy in neutrinos than in photons. During the silicon-burning phase, which lasts for a few days and is what creates the de...
A superluminous supernova (aka hypernova) can exhibit a double peak to its brightness and some are theorizing that this may be the norm for a superluminous supernova, though as far as I know it's only actually been observed in one case so far (DES14X3taz). Anyway, in (at least) this case there was an initial substanti...
18,423
I am writing a science fiction novel, where a ship is stranded in a single star system (a red supergiant). One of the plot points is the star becoming supernova in several hours, so the characters have to fix their ship before that happens. I have basic knowledge of how it works: Iron generated from nuclear fusion get...
2016/09/21
[ "https://astronomy.stackexchange.com/questions/18423", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/14305/" ]
As [Dean said](https://astronomy.stackexchange.com/questions/18423/are-there-observable-changes-in-a-star-about-to-become-supernova-minutes-or-hou#comment28951_18423), supernova progenitors typically release neutrinos prior to full core collapse, remnant formation and the ejection of the outer layers of the star. The p...
A superluminous supernova (aka hypernova) can exhibit a double peak to its brightness and some are theorizing that this may be the norm for a superluminous supernova, though as far as I know it's only actually been observed in one case so far (DES14X3taz). Anyway, in (at least) this case there was an initial substanti...
18,423
I am writing a science fiction novel, where a ship is stranded in a single star system (a red supergiant). One of the plot points is the star becoming supernova in several hours, so the characters have to fix their ship before that happens. I have basic knowledge of how it works: Iron generated from nuclear fusion get...
2016/09/21
[ "https://astronomy.stackexchange.com/questions/18423", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/14305/" ]
Other answers are correct; a neutrino pulse is definitely expected as a result of a core-collapse supernova and should occur some hours before a shockwave arrives at the surface. There essentially would be no visible sign that the star was about to become a supernova and that is because the dynamical timescale of the ...
A superluminous supernova (aka hypernova) can exhibit a double peak to its brightness and some are theorizing that this may be the norm for a superluminous supernova, though as far as I know it's only actually been observed in one case so far (DES14X3taz). Anyway, in (at least) this case there was an initial substanti...
34,511
I have a time-domain signal that I want do a time-frequency analysis on it. When I tried the `Spectrogram`, I always get very low resolution. For example: I have a signal like this: ``` data = Table[ Piecewise[{{Sin[2 \[Pi] 10 t], 0 <= t < 1/4}, {Sin[2 \[Pi] 25 t], 1/4 <= t < 1/2}, {Sin[2 \[Pi] 50 t], ...
2013/10/21
[ "https://mathematica.stackexchange.com/questions/34511", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/1364/" ]
The `Spectrogram` function also allows you to alter the window length, overlap and apply a windowing function to your data segment before FFT. You'll get better results if you utilize those (which requires some knowledge of DSP and your specific problem) instead of using the default parameters and the rectangle window....
Urghhh ... I hate those `"RustTones"`... Nevertheless ^o^ ``` sa = SpectrogramArray[data2]; ListDensityPlot[Transpose@Abs@sa, ColorFunction -> "DeepSeaColors", AspectRatio -> 1/2, Frame -> None] ``` > > ![Spectrogram](https://i.stack.imgur.com/SwVbL.png) > > > ``` ListDensityPlot[Transpose@Abs...
34,511
I have a time-domain signal that I want do a time-frequency analysis on it. When I tried the `Spectrogram`, I always get very low resolution. For example: I have a signal like this: ``` data = Table[ Piecewise[{{Sin[2 \[Pi] 10 t], 0 <= t < 1/4}, {Sin[2 \[Pi] 25 t], 1/4 <= t < 1/2}, {Sin[2 \[Pi] 50 t], ...
2013/10/21
[ "https://mathematica.stackexchange.com/questions/34511", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/1364/" ]
The `Spectrogram` function also allows you to alter the window length, overlap and apply a windowing function to your data segment before FFT. You'll get better results if you utilize those (which requires some knowledge of DSP and your specific problem) instead of using the default parameters and the rectangle window....
Actually, we can get linear scale rather than log scale using wavelet transform, using the "LinearScalogramFunction" property of a `ContinuousWaveletData` object. This is the default wavelet scalogram: ``` sampleRate = 1023; data = Table[ Piecewise[{{Sin[2 π 10 t], 0 <= t < 1/4}, {Sin[2 π 25 t], 1/4 <= t < ...
21,907,918
I am presenting `UIViewController` like: ``` UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; PhotoViewController *resultVC = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([PhotoViewController class])]; [self.navigationController presentViewController...
2014/02/20
[ "https://Stackoverflow.com/questions/21907918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2406032/" ]
Yes, it is nil. `UIViewController.navigationController` property will only be set if the `ViewController` is pushed, not presented. A not-so-elegant solution is that you make a global reference(like put the reference in a singleton) to the `NavigationController` before you present it, then you can read it from inside y...
Just learn how work with navigationController. Replace next code: `[self.navigationController presentViewController:resultVC animated:YES completion:^{}];` on `[self.navigationController pushViewController:resultVC animated:YES];`
21,907,918
I am presenting `UIViewController` like: ``` UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; PhotoViewController *resultVC = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([PhotoViewController class])]; [self.navigationController presentViewController...
2014/02/20
[ "https://Stackoverflow.com/questions/21907918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2406032/" ]
Yes, it is nil. `UIViewController.navigationController` property will only be set if the `ViewController` is pushed, not presented. A not-so-elegant solution is that you make a global reference(like put the reference in a singleton) to the `NavigationController` before you present it, then you can read it from inside y...
I produce private `navigationController`(here is nav), then assign to the main window, following is the code: self.nav = [[UINavigationController alloc] initWithRootViewController:self]; [[[UIApplication sharedApplication] delegate] window].rootViewController = self.nav; you can push the `view controller` with the p...
64,793,902
Let's say that I have this dataframe : ``` Name = ['Lolo', 'Mike', 'Tobias','Luke','Sam'] Age = [19, 34, 13, 45, 52] Info_1 = ['Tall', 'Large', 'Small', 'Small',''] Info_2 = ['New York', 'Paris', 'Lisbon', '', 'Berlin'] Info_3 = ['Tall', 'Paris', 'Hi', 'Small', 'Thanks'] Data = [123,268,76,909,87] Sex = ['F', 'M', 'M'...
2020/11/11
[ "https://Stackoverflow.com/questions/64793902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14407578/" ]
Your `Data` columns seems to be `int` type. Convert it to strings first: ``` df['Data'] = df['Data'].astype(str) df['period'] = (df[['Info_1','Info_2','Info_3','Data']] .apply(lambda x: ' '.join(x[x!=''].unique()), axis=1) ) ``` Output: ``` Name Age Info_1 Info_2 Info_3 D...
I think it's probably easiest to first just concatenate all the fields you want with a space in between: ``` df['Info'] = df.Info_1 + ' ' + df.Info_2 + ' ' + df.Info_3 + ' ' + df.Data.astype(str) ``` Then you can write a function to remove the duplicate words from a string, something like this: ``` def remove_dup_...
68,752,661
I have used compose AnimatedVisibility in my project, But the anim is to short for my need. Is there a related API?
2021/08/12
[ "https://Stackoverflow.com/questions/68752661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16647334/" ]
Here is an example taken from [codelabs](https://developer.android.com/codelabs/jetpack-compose-animation?hl=nn&skip_cache=false#3). You can add your own animation specs with the durationMillis of each animation, one for entering, and one for exiting: ``` AnimatedVisibility( visible = shown, enter = slideInVe...
Well this is one way ``` @OptIn(ExperimentalAnimationApi::class) @Composable fun AnimatedVisibilityMark2(content: @Composable () -> Unit, visible: Boolean, durationMillis: Int) { AnimatedVisibility( visible = visible, enter = fadeIn( animationSpec = keyframes { this.dura...
15,090,971
I'm looking for an answer or advice how to make my slider ignore any clicks on the arrows until the movement to either left or right arrows is complete. I have a link here to show you exactly what is happening. <http://madaxedesign.co.uk/dev/index/> and the Jquery code below: ``` $(document).ready(function() { ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1228736/" ]
Use the [`:animated` selector](http://api.jquery.com/animated-selector/) to check if an animation is running. ``` $('#slider-nav .right_arrow').click(function() { if(ul.is(":animated")) return; ... }); ```
I think your issue is `slideRight()` is not returning anything... ``` function slideRight() { return ul.animate({ left: '0' }, 1000); } ```
15,090,971
I'm looking for an answer or advice how to make my slider ignore any clicks on the arrows until the movement to either left or right arrows is complete. I have a link here to show you exactly what is happening. <http://madaxedesign.co.uk/dev/index/> and the Jquery code below: ``` $(document).ready(function() { ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1228736/" ]
The trick is to keep a variable that tells you whether or not you're currently sliding, and only to execute sliding functions if it's `false`. Then when a sliding function executes, set it to `true`, and tell the callback to set it to false. I've called the variable `sliding` in the code below: ``` $(document).ready(f...
Use the [`:animated` selector](http://api.jquery.com/animated-selector/) to check if an animation is running. ``` $('#slider-nav .right_arrow').click(function() { if(ul.is(":animated")) return; ... }); ```
15,090,971
I'm looking for an answer or advice how to make my slider ignore any clicks on the arrows until the movement to either left or right arrows is complete. I have a link here to show you exactly what is happening. <http://madaxedesign.co.uk/dev/index/> and the Jquery code below: ``` $(document).ready(function() { ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1228736/" ]
The trick is to keep a variable that tells you whether or not you're currently sliding, and only to execute sliding functions if it's `false`. Then when a sliding function executes, set it to `true`, and tell the callback to set it to false. I've called the variable `sliding` in the code below: ``` $(document).ready(f...
I think your issue is `slideRight()` is not returning anything... ``` function slideRight() { return ul.animate({ left: '0' }, 1000); } ```
37,892,511
H have a regular expression that matches website urls ``` .+\.\w\w.*(.*) ``` I would like to extract the url that matches my string for example: > > what is google.com? > > > when i run my code ``` var x = /.+\.\w\w.*(.*)/ x.exec( "what is <http://google.com>?" ) ``` it instead returns > > ["what is <http...
2016/06/18
[ "https://Stackoverflow.com/questions/37892511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5871609/" ]
You can do it by using `Webview`. It will automatically consider mobile view only. Try this: make the `main.xml` file like this: ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:la...
Create a webview and inject a url. so easy way.
40,543
Prof. Pheno Menon has developed a artificial intelligence program which he calls "The Phenomenal Commentator". That day he called on me to give a demo of his phenomenal creation. "Here," he explained, "in the input box, you need to enter a literary extract, and *the program closely inspects it, letter by letter, and f...
2016/08/12
[ "https://puzzling.stackexchange.com/questions/40543", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/25412/" ]
The relation between the inputs and the outputs is that they are > > Anagrams of each other > > > 1. An exciting text phrases candid hate-tone. > > Nothing is certain except death and taxes (Thanks [@sconibulus](https://puzzling.stackexchange.com/a/40550/12914)!) > > > 2. Words worth noting; make tag. > ...
The first one is: > > Nothing is certain except death and taxes > > >
1,198,263
This question is not a duplicate of the other questions of this time. I want to ask is how strong is the following proof that I am going to give from an examination point of view? --- Proof: Consider a tree $T$ with $n$ vertices. Let us reconstruct the tree from the root vertex. When the first root vertex has been...
2015/03/20
[ "https://math.stackexchange.com/questions/1198263", "https://math.stackexchange.com", "https://math.stackexchange.com/users/169486/" ]
Consider the tree with *n* vertices. To Prove: The number of edges will be *n-1*. Assume **P(n):** Number of edges = *n-1* for the tree with *n* vertices. *n* will be natural number. **P(1):** For one node, there will be zero edges, since there is no other node to connect with. **P(2):** For two nodes, Number of edg...
What seems missing from the proof is: * After the $n$-th vertex is added, how do we know there exists some "unused" vertex $v$ which is adjacent to a "used" vertex? * How do we know that $v$ is not adjacent to multiple "used" vertices? * How do we know that this algorithm will terminate, having used all the vertices? ...
20,134,211
I've been looking at this code for ages now and I cant really understand what it want from me. I keep getting the same error message no matter what I try and I've looked through other threads to no avail. The error is **Fatal error: Call to a member function prepare() on a non-object in C:\wamp\www\new\_serverside\spri...
2013/11/21
[ "https://Stackoverflow.com/questions/20134211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3019749/" ]
1. This condition occurs because the show method adjusts the width of the JTextArea subcomponent (in this example because the component has setLineWrap(true), show() changes the width width from 0 to 100) of a JPopupMenu. In this state the first call to getPreferredSize() on the JTextArea will update the size of its pa...
This appears to be a feature of the [`DefaultMenuLayout`](http://docs.oracle.com/javase/7/docs/api/javax/swing/plaf/basic/DefaultMenuLayout.html), seen [here](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/javax/swing/plaf/basic/DefaultMenuLayout.java). It extends `BoxLayout` and expects a...
52,568,067
I'm trying to create a map of objects to use by the following code: ```js var MARKED ={className: 'emoji', img:'⚐'} ; var EMOJI_WONDER = {className: 'emoji', img: ''}; var EMOJI_WIN = {className: 'emoji', img: ''}; var emoMap={}; emoMap[EMOJI_WONDER]=EMOJI_WONDER; emoMap[MARKED]=MARKED; emoMap[EMOJI_WIN]=EMOJI_...
2018/09/29
[ "https://Stackoverflow.com/questions/52568067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10015099/" ]
When you do this: ``` emoMap[EMOJI_WONDER]=EMOJI_WONDER; ``` you're using `EMOJI_WONDER` as both the key (name) of the property and its value. Property names can only be strings or Symbols, they cannot be objects. So when you do that, `EMOJI_WONDER` is coerced to string to form a property name. Since all of your obj...
You have pass a variable object as a key for the object `emoMap`,you need to use string as key instead ```js var MARKED ={className: 'emoji', img:'⚐'} ; var EMOJI_WONDER = {className: 'emoji', img: ''}; var EMOJI_WIN = {className: 'emoji', img: ''}; var emoMap={}; emoMap["EMOJI_WONDER"]=EMOJI_WONDER;//add quote t...
52,568,067
I'm trying to create a map of objects to use by the following code: ```js var MARKED ={className: 'emoji', img:'⚐'} ; var EMOJI_WONDER = {className: 'emoji', img: ''}; var EMOJI_WIN = {className: 'emoji', img: ''}; var emoMap={}; emoMap[EMOJI_WONDER]=EMOJI_WONDER; emoMap[MARKED]=MARKED; emoMap[EMOJI_WIN]=EMOJI_...
2018/09/29
[ "https://Stackoverflow.com/questions/52568067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10015099/" ]
You have pass a variable object as a key for the object `emoMap`,you need to use string as key instead ```js var MARKED ={className: 'emoji', img:'⚐'} ; var EMOJI_WONDER = {className: 'emoji', img: ''}; var EMOJI_WIN = {className: 'emoji', img: ''}; var emoMap={}; emoMap["EMOJI_WONDER"]=EMOJI_WONDER;//add quote t...
What is happening in top case is that : `.toString()` gets called and on `MARKED`, `EMOJI_WONDER` and `EMOJI_WIN` before using it as a key. Therefore, all assignments get loaded upon the same key. Viz: `'[object Object]'`. Hence, when you print the output is: ``` { '[object Object]': { className: 'emo...
52,568,067
I'm trying to create a map of objects to use by the following code: ```js var MARKED ={className: 'emoji', img:'⚐'} ; var EMOJI_WONDER = {className: 'emoji', img: ''}; var EMOJI_WIN = {className: 'emoji', img: ''}; var emoMap={}; emoMap[EMOJI_WONDER]=EMOJI_WONDER; emoMap[MARKED]=MARKED; emoMap[EMOJI_WIN]=EMOJI_...
2018/09/29
[ "https://Stackoverflow.com/questions/52568067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10015099/" ]
When you do this: ``` emoMap[EMOJI_WONDER]=EMOJI_WONDER; ``` you're using `EMOJI_WONDER` as both the key (name) of the property and its value. Property names can only be strings or Symbols, they cannot be objects. So when you do that, `EMOJI_WONDER` is coerced to string to form a property name. Since all of your obj...
What is happening in top case is that : `.toString()` gets called and on `MARKED`, `EMOJI_WONDER` and `EMOJI_WIN` before using it as a key. Therefore, all assignments get loaded upon the same key. Viz: `'[object Object]'`. Hence, when you print the output is: ``` { '[object Object]': { className: 'emo...
20,494,041
I am developing a small test game on android. I use a SurfaceView to draw on a Canvas. Here comes my problem: Only one frame is shown, but `listener.draw(..)` gets called as it should, **so my game is a still image**. A thread calls `draw(..)` every iteration, but the screen doesn't update. ``` public class GameView...
2013/12/10
[ "https://Stackoverflow.com/questions/20494041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2373138/" ]
Googling some more hours gave me a solution: <http://danielnadeau.blogspot.de/2012/01/android-canvas-beginners-tutorial.html> instead of ``` try { canvas = holder.lockCanvas(); synchronized(holder) { draw(canvas); } } finally { if(canvas != null) { holder.unlockCanvasAndPost(canvas);...
Have you tried `invalidate()` ? <http://developer.android.com/reference/android/view/View.html> <https://stackoverflow.com/a/6755993/2945214>
22,963,610
I found allot of examples of AJAX and I think I can get some code with it to work on my own. If only I knew what the use of all the terms of the AJAX code where. I think in general it lacks the availability of these guides or special pages where constructed code is explained in detail for new programmers. This woul...
2014/04/09
[ "https://Stackoverflow.com/questions/22963610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3455717/" ]
Ajax is asynchronous, which mean you can use it to get new informations from the server without reloading the whole page. Here's an explanation of your code : ``` $.ajax({ ``` $ is the JQuery object, on which you're calling the ajax function ``` type: 'POST', ``` You're gonna send your data by post, which mean ...
`AJAX` is an acronym standing for Asynchronous `JavaScript` and `XML` and this technology help us to load data from the server without a browser page refresh. If you are new with `AJAX`, I would recommend you go through our `Ajax` Tutorial before proceeding further. `JQuery` is a great tool which provides a rich set ...
283,421
I'm trying to get a better understanding of the relationship of dielectric constant (relative permitivity) to dielectric strength (breakdown voltage).I want to know what happens when you layer materials of high dielectric constant but low dielectric strength with materials of low dielectric constant but high dielectric...
2017/01/31
[ "https://electronics.stackexchange.com/questions/283421", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/137524/" ]
These material properties are tradeoffs and cannot be improved by alternating materials. Each one becomes the weakest link. ``` Barium titanate k=1200, E = 1.2 kv/mm (max) k*E=1440 Mica k=3 , E = 118 kv/mm (max) k*E=354 ``` multiplying by cost gives you another metric k*E*$ /mm When you compare ever...
A conducting layer, like a 'field ring', can shape the field nearby so a single faulty dielectric layer does not produce a cascade failure in a multilayer capacitor structure. Except for some multilayer HV film capacitors, where an intermediate layer is added to make the item fail-safe against single internal short ci...
283,421
I'm trying to get a better understanding of the relationship of dielectric constant (relative permitivity) to dielectric strength (breakdown voltage).I want to know what happens when you layer materials of high dielectric constant but low dielectric strength with materials of low dielectric constant but high dielectric...
2017/01/31
[ "https://electronics.stackexchange.com/questions/283421", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/137524/" ]
This turns out to not be helpful in the way you are suggesting. The capacitance of the combined structure will be limited by the lower dielectric constant materials. The way you model this type of structure is to just treat it as three capacitors in series. You can mentally imagine that there is a thin conductive plat...
A conducting layer, like a 'field ring', can shape the field nearby so a single faulty dielectric layer does not produce a cascade failure in a multilayer capacitor structure. Except for some multilayer HV film capacitors, where an intermediate layer is added to make the item fail-safe against single internal short ci...
2,242,880
I just start to learn this topic and I don't understand what rejection sampling is. can someone give a brief explanation about it? I need to do rejection sampling in R programming.
2017/04/20
[ "https://math.stackexchange.com/questions/2242880", "https://math.stackexchange.com", "https://math.stackexchange.com/users/400865/" ]
The way I like to think about it is the following: I want to sample a uniform element of some set $S$, but I only have access to uniformly random elements of a superset $A$ of $S$ (i.e., $S\subset A$). So quite naturally, what I do is sample elements uniformly from $A$ until I get an element $s$ from $S$; the content o...
You need a proposal function $g(x)$ which satisfies $f(x)<cg(x)$ and is easy to sample from. Here we define $c$ as: $$c=\sup\_x\frac{f(x)}{g(x)}.$$ The first step is to generate $X$ from $g(x)$. For instance, using inverse sampling method. Next generate $U$ from the standard uniform distribution, $U[0,1]$. At last: if ...
69,562,434
I am working on an assignment where one of my columns contains measurements in feet, cm, and m, and I am trying to convert them all to metres. So far I have been able to convert individual cells to simple numeric values (e.g. 5\_ft\_7 to 5.7), but I cannot find a function that will convert them to metres, especially wi...
2021/10/13
[ "https://Stackoverflow.com/questions/69562434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Because of the calls to `delay(1000)`, your code requires you to press the button in the exact split-second instant when `digitalRead(1)` is called. The Arduino cannot listen for button presses while `delay()` is in action. Also, you call `delay(1000)` twice, which flashes the LED on and off once in two seconds, not tw...
I did some experimenting with a simulator similar to what i assume you setup is(use this to setup your situation for future Arduino questions to make it easier for people to understand and help) <https://wokwi.com/arduino/projects/312378906051084864> Besides adding a missing semi-colon here, and working with what i a...
10,371,440
I have ; ``` default : gcc -o function function.c ``` When I type make in terminal, following message is emitted ``` user@user-laptop:~/Desktop$ make gcc -o function function.c user@user-laptop:~/Desktop$ ``` But I want ``` user@user-laptop:~/Desktop$ make ...
2012/04/29
[ "https://Stackoverflow.com/questions/10371440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362516/" ]
Use an `@` to quiet the output: ``` default: @gcc -o ... ``` You can find the documentation here: [Recipe echoing](http://www.gnu.org/software/make/manual/make.html#Echoing). (Or you can invoke `make` with `make -s` to suppress all echoing.)
You can use `make --silent` (at least for GNU make)
10,371,440
I have ; ``` default : gcc -o function function.c ``` When I type make in terminal, following message is emitted ``` user@user-laptop:~/Desktop$ make gcc -o function function.c user@user-laptop:~/Desktop$ ``` But I want ``` user@user-laptop:~/Desktop$ make ...
2012/04/29
[ "https://Stackoverflow.com/questions/10371440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362516/" ]
Use an `@` to quiet the output: ``` default: @gcc -o ... ``` You can find the documentation here: [Recipe echoing](http://www.gnu.org/software/make/manual/make.html#Echoing). (Or you can invoke `make` with `make -s` to suppress all echoing.)
To tell Make to be quiet/silent for all the targets, put the following at the top of a Makefile, which will work as though `make --silent` was used without requiring one to provide the switch on command line. Works with GNU Make on Linux, I am not sure about all the other Make variants. ``` MAKEFLAGS += --silent ```
10,371,440
I have ; ``` default : gcc -o function function.c ``` When I type make in terminal, following message is emitted ``` user@user-laptop:~/Desktop$ make gcc -o function function.c user@user-laptop:~/Desktop$ ``` But I want ``` user@user-laptop:~/Desktop$ make ...
2012/04/29
[ "https://Stackoverflow.com/questions/10371440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362516/" ]
You can use `make --silent` (at least for GNU make)
To tell Make to be quiet/silent for all the targets, put the following at the top of a Makefile, which will work as though `make --silent` was used without requiring one to provide the switch on command line. Works with GNU Make on Linux, I am not sure about all the other Make variants. ``` MAKEFLAGS += --silent ```
22,314,419
Like this a result : ``` 75 Ansari 5 10 88 Koodoo 4 0 90 Koodoo 14 0 83 Koodoo 5 0 82 Koodoo, 6 0 81 Koodoo 4 0 79 Koodoo 5 0 74 Savage 1 0 80 Strike 2 36 87 Strike 4 15 78 Sullivan 3 15 77 Sullivan 2 0 ...
2014/03/11
[ "https://Stackoverflow.com/questions/22314419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3390405/" ]
``` import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import javax.crypto.Cipher; import javax.crypto.CipherInputStream; import javax.crypto.spec.SecretKeySpec; import javax.xml.bind.DatatypeConverter; public class Crypto { public FileInputStream mIn...
here is an pure java routine for .db.crypt12 without bouncycastle, but only JDK. ``` public class Crypt12 { public static void main(final String[] args) { final String c12File = "1/msgstore.db.crypt12"; // input file final String decryptedDbFile = "1/msgstore.db"; // sqlite3 db outp...
22,314,419
Like this a result : ``` 75 Ansari 5 10 88 Koodoo 4 0 90 Koodoo 14 0 83 Koodoo 5 0 82 Koodoo, 6 0 81 Koodoo 4 0 79 Koodoo 5 0 74 Savage 1 0 80 Strike 2 36 87 Strike 4 15 78 Sullivan 3 15 77 Sullivan 2 0 ...
2014/03/11
[ "https://Stackoverflow.com/questions/22314419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3390405/" ]
An updated answer for `.crypt12` files: These are compressed, and then encrypted using AES in GCM mode Here is some python code showing how: ```py """ Example how to decrypt whatsapp msgstore backups with extension .crypt12. Author: Willem Hengeveld <itsme@xs4all.nl> """ from Crypto.Cipher import AES import zlib imp...
here is an pure java routine for .db.crypt12 without bouncycastle, but only JDK. ``` public class Crypt12 { public static void main(final String[] args) { final String c12File = "1/msgstore.db.crypt12"; // input file final String decryptedDbFile = "1/msgstore.db"; // sqlite3 db outp...
12,864
The Amstrad CPC range of Z80 machines shipped with a ROM BASIC, designed and implemented by Locomotive Software. The most well known competitor was the Sinclair ZX Spectrum, also a Z80 machine, with similar capabilities. I'm aware that both Sinclair and Locomotive Basics were more advanced than the C64 Microsoft imp...
2019/11/24
[ "https://retrocomputing.stackexchange.com/questions/12864", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/5222/" ]
The big improvement to the *language* in Locomotive BASIC, compared to Sinclair BASIC (and many other BASICs), was the addition of timer support: ``` AFTER 50,0 GOSUB 320 ``` would call the subroutine at line 320 [after a second](http://www.cpcwiki.eu/index.php/Locomotive_BASIC#AFTER_.E2.80.B9time_delay.E2.80.BA.5B....
> > Was Locomotive BASIC significantly better than Sinclair BASIC? > > > TL;DR: Oh, yes, it was! ----------------------- --- > > I'm aware that both Basics were more advanced than the C64 Microsoft implementation, > > > Comparison of C64 BASIC to other BASICs of the same time is never in favour for the C64,...
12,864
The Amstrad CPC range of Z80 machines shipped with a ROM BASIC, designed and implemented by Locomotive Software. The most well known competitor was the Sinclair ZX Spectrum, also a Z80 machine, with similar capabilities. I'm aware that both Sinclair and Locomotive Basics were more advanced than the C64 Microsoft imp...
2019/11/24
[ "https://retrocomputing.stackexchange.com/questions/12864", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/5222/" ]
The big improvement to the *language* in Locomotive BASIC, compared to Sinclair BASIC (and many other BASICs), was the addition of timer support: ``` AFTER 50,0 GOSUB 320 ``` would call the subroutine at line 320 [after a second](http://www.cpcwiki.eu/index.php/Locomotive_BASIC#AFTER_.E2.80.B9time_delay.E2.80.BA.5B....
Considering how much of a [rush job](https://www.theregister.co.uk/2014/02/12/archaeologic_amstrad_cpc_464/) Locomotive BASIC was, it's remarkably good. But it's not perfect. Sinclair BASIC has one powerful keyword that Locomotive BASIC lacks: **VAL**. Sure, Locomotive BASIC has a `VAL()` function, but Sinclair's one ...
12,864
The Amstrad CPC range of Z80 machines shipped with a ROM BASIC, designed and implemented by Locomotive Software. The most well known competitor was the Sinclair ZX Spectrum, also a Z80 machine, with similar capabilities. I'm aware that both Sinclair and Locomotive Basics were more advanced than the C64 Microsoft imp...
2019/11/24
[ "https://retrocomputing.stackexchange.com/questions/12864", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/5222/" ]
> > Was Locomotive BASIC significantly better than Sinclair BASIC? > > > TL;DR: Oh, yes, it was! ----------------------- --- > > I'm aware that both Basics were more advanced than the C64 Microsoft implementation, > > > Comparison of C64 BASIC to other BASICs of the same time is never in favour for the C64,...
Considering how much of a [rush job](https://www.theregister.co.uk/2014/02/12/archaeologic_amstrad_cpc_464/) Locomotive BASIC was, it's remarkably good. But it's not perfect. Sinclair BASIC has one powerful keyword that Locomotive BASIC lacks: **VAL**. Sure, Locomotive BASIC has a `VAL()` function, but Sinclair's one ...
52,850,201
``` const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; const output = move(numbers, 3, -5); console.log(output); function move(array, index, offset) { const output = [...array]; const element = output.splice(index, 1)[0]; output.splice(index + offset, 0, element) return output; } ``` The first line is an...
2018/10/17
[ "https://Stackoverflow.com/questions/52850201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5073177/" ]
You need to cover the edge cases when the updated index is **less than 0** OR **greater than the array length**. You can try following ```js const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; function move(array, index, offset) { const output = [...array]; const element = output.splice(index, 1)[0]; let upd...
You could do this using `while` loop and iterating for the `Math.abs()` of the position you want to move to and then move in direction depending if parameter is positive or negative. ```js function move(arr, i, p) { let left = p < 0, counter = Math.abs(p), newPos = i; while (--counter > -1) { newP...
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
``` var d = 1.0d; // double var d0 = 1.0; // double var d1 = 1e+3; // double var d2 = 1e-3; // double var f = 1.0f; // float var m = 1.0m; // decimal var i = 1; // int var ui = 1U; // uint var ul = 1UL; // ulong var l = 1L; // long ``` I think that's all... there are no literal specifiers for ...
There isn't one for short. Just use `short s = 1;`.
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
``` var d = 1.0d; // double var d0 = 1.0; // double var d1 = 1e+3; // double var d2 = 1e-3; // double var f = 1.0f; // float var m = 1.0m; // decimal var i = 1; // int var ui = 1U; // uint var ul = 1UL; // ulong var l = 1L; // long ``` I think that's all... there are no literal specifiers for ...
From [Integer literals](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#integer-literals): > > The type of an integer literal is determined as follows: > > > * If the literal has no suffix, it has the first of these types in which its value can be represented:...
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
``` var d = 1.0d; // double var d0 = 1.0; // double var d1 = 1e+3; // double var d2 = 1e-3; // double var f = 1.0f; // float var m = 1.0m; // decimal var i = 1; // int var ui = 1U; // uint var ul = 1UL; // ulong var l = 1L; // long ``` I think that's all... there are no literal specifiers for ...
If your variable isn't already a short, you have to cast it explicitly : ``` Object s = (Int16) 1; ```
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
``` var d = 1.0d; // double var d0 = 1.0; // double var d1 = 1e+3; // double var d2 = 1e-3; // double var f = 1.0f; // float var m = 1.0m; // decimal var i = 1; // int var ui = 1U; // uint var ul = 1UL; // ulong var l = 1L; // long ``` I think that's all... there are no literal specifiers for ...
``` var myValue = unchecked((short)0x7F00); ``` The literal is int and thus must be cast to target type. If a value overflow occurs unchecked is required.
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
From [Integer literals](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#integer-literals): > > The type of an integer literal is determined as follows: > > > * If the literal has no suffix, it has the first of these types in which its value can be represented:...
There isn't one for short. Just use `short s = 1;`.
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
There isn't one for short. Just use `short s = 1;`.
``` var myValue = unchecked((short)0x7F00); ``` The literal is int and thus must be cast to target type. If a value overflow occurs unchecked is required.
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
From [Integer literals](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#integer-literals): > > The type of an integer literal is determined as follows: > > > * If the literal has no suffix, it has the first of these types in which its value can be represented:...
If your variable isn't already a short, you have to cast it explicitly : ``` Object s = (Int16) 1; ```
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
From [Integer literals](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#integer-literals): > > The type of an integer literal is determined as follows: > > > * If the literal has no suffix, it has the first of these types in which its value can be represented:...
``` var myValue = unchecked((short)0x7F00); ``` The literal is int and thus must be cast to target type. If a value overflow occurs unchecked is required.
5,820,721
In C/C#/etc. you can tell the compiler that a literal number is not what it appears to be (ie., `float` instead of `double`, `unsigned long` instead of `int`): ``` var d = 1.0; // double var f = 1.0f; // float var u = 1UL; // unsigned long ``` etc. Could someone point me to a list of these? I'm specifically looki...
2011/04/28
[ "https://Stackoverflow.com/questions/5820721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135769/" ]
If your variable isn't already a short, you have to cast it explicitly : ``` Object s = (Int16) 1; ```
``` var myValue = unchecked((short)0x7F00); ``` The literal is int and thus must be cast to target type. If a value overflow occurs unchecked is required.
3,827
I came across a woman talking about having a massage at a massage shop. What do you call a venue where relaxation massages (as opposed to remedial massages) are done? Is there something better than "massage shop"?
2013/03/11
[ "https://ell.stackexchange.com/questions/3827", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/54/" ]
"**Spa**" would be an acceptable term, although it doesn't necessarily refer specifically to massage. It can include massage, skin treatment, aromatherapy, etc. Though it isn't specifically limited to massage, "spa" does hold the idea of non-remedial activity. As @J. R. graciously pointed out, "**salon**" would also b...
When I go to get a massage, I say I am going to the **massage therapist**. While in most contexts that would refer to the individual practitioner (i.e. the specific person providing the massage), it can also refer to the practice in general, which in turn refers to the unit of business where one or more licensed therap...
3,181,984
I had a lecture concerning axiom of choice, and the teacher says that an equivalent property is that surjective maps are invertible at right. After, as an example, we had the function $\sqrt x$. The example goes as follow : $x\mapsto x^2$ is surjective $\mathbb R\to \mathbb R^+$. We are looking for function $f:\mathbb ...
2019/04/10
[ "https://math.stackexchange.com/questions/3181984", "https://math.stackexchange.com", "https://math.stackexchange.com/users/659895/" ]
We can prove, without the axiom of choice, that $A\_x=\{y\in\Bbb R\mid y^2=x\}$ has at most $2$ elements for every $x\geq 0$. Since $\Bbb R$ is linearly ordered, there is a "largest" and "smallest" of these two elements, so we can choose the largest. The axiom of choice is not needed. Well, you might say, what happen...
"For fix x, the equation $y^2=x$ has always 2 solutions.": Not true for $x = 0$. This is the only defect of the statement. There is a minor defect in the example of choosing the sign of each preimage of the square root function. As you have observed, the elements of the preimage sets are distinguishable and there is a...
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
Evaluate both polynomials at $x = -1, -2, -3,$ and $-4$. They are equal at these four values, and their leading coefficients are both equal to $1$. So they are the same polynomial.
$(x^2+5x+5)^2-1^2=(x^2+5x+4)(x^2+5x+6)=(x+1)(x+4)(x+2)(x+3)$
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
Evaluate both polynomials at $x = -1, -2, -3,$ and $-4$. They are equal at these four values, and their leading coefficients are both equal to $1$. So they are the same polynomial.
The key for this problem is observing that $(x+1)(x+2)(x+3)(x+4)+1$ is symmetric with respect to $x=-2.5$. Write it as $$(x+1)(x+2)(x+3)(x+4)+1= \\ \left( (x+2.5)-1.5\right)\left( (x+2.5)-0.5\right)\left((x+2.5)+0.5 \right)\left((x+2.5)+1.5 \right)+1$$ For simplicity, let us denote temporarily $x+2.5$ by $y$. Then w...
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
Evaluate both polynomials at $x = -1, -2, -3,$ and $-4$. They are equal at these four values, and their leading coefficients are both equal to $1$. So they are the same polynomial.
**Lemma** $\ ad\!-\!bc = -2\,\Rightarrow\, abcd = e^2\!-1,\,\ e = ad\!+\!1 = bc\!-\!1$ **Proof** $\ $ Notice that $\ abcd = (ad)(bc) = (e\!-\!1)(e\!+\!1) = e^2\!-1\ $ **QED** Yours is the special case $\ a,b,c,d\, =\, x\!+\!1,x\!+\!2,x\!+\!3,x\!+\!4$ **Generally** $\ \ AB\, =\, \left(\dfrac{A+B}2\right)^2-\left(\dfr...
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
I answered a similar question [here](https://math.stackexchange.com/questions/463506/factorize-x1x2x3x6-3x2). You can do it like this: $(x+2)(x+3) = x^2+5x+5+1$, $(x+1)(x+4) = x^2+5x+5-1$, so $$ (x+1)(x+2)(x+3)(x+4) = (x^2+5x+5+1)(x^2+5x+5-1) = (x^2+5x+5)^2-1^2. $$ This gives the answer $(x+1)(x+2)(x+3)(x+4)+1 =(x^2+5x...
$(x^2+5x+5)^2-1^2=(x^2+5x+4)(x^2+5x+6)=(x+1)(x+4)(x+2)(x+3)$
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
I answered a similar question [here](https://math.stackexchange.com/questions/463506/factorize-x1x2x3x6-3x2). You can do it like this: $(x+2)(x+3) = x^2+5x+5+1$, $(x+1)(x+4) = x^2+5x+5-1$, so $$ (x+1)(x+2)(x+3)(x+4) = (x^2+5x+5+1)(x^2+5x+5-1) = (x^2+5x+5)^2-1^2. $$ This gives the answer $(x+1)(x+2)(x+3)(x+4)+1 =(x^2+5x...
The key for this problem is observing that $(x+1)(x+2)(x+3)(x+4)+1$ is symmetric with respect to $x=-2.5$. Write it as $$(x+1)(x+2)(x+3)(x+4)+1= \\ \left( (x+2.5)-1.5\right)\left( (x+2.5)-0.5\right)\left((x+2.5)+0.5 \right)\left((x+2.5)+1.5 \right)+1$$ For simplicity, let us denote temporarily $x+2.5$ by $y$. Then w...
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
I answered a similar question [here](https://math.stackexchange.com/questions/463506/factorize-x1x2x3x6-3x2). You can do it like this: $(x+2)(x+3) = x^2+5x+5+1$, $(x+1)(x+4) = x^2+5x+5-1$, so $$ (x+1)(x+2)(x+3)(x+4) = (x^2+5x+5+1)(x^2+5x+5-1) = (x^2+5x+5)^2-1^2. $$ This gives the answer $(x+1)(x+2)(x+3)(x+4)+1 =(x^2+5x...
**Lemma** $\ ad\!-\!bc = -2\,\Rightarrow\, abcd = e^2\!-1,\,\ e = ad\!+\!1 = bc\!-\!1$ **Proof** $\ $ Notice that $\ abcd = (ad)(bc) = (e\!-\!1)(e\!+\!1) = e^2\!-1\ $ **QED** Yours is the special case $\ a,b,c,d\, =\, x\!+\!1,x\!+\!2,x\!+\!3,x\!+\!4$ **Generally** $\ \ AB\, =\, \left(\dfrac{A+B}2\right)^2-\left(\dfr...
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
$(x^2+5x+5)^2-1^2=(x^2+5x+4)(x^2+5x+6)=(x+1)(x+4)(x+2)(x+3)$
The key for this problem is observing that $(x+1)(x+2)(x+3)(x+4)+1$ is symmetric with respect to $x=-2.5$. Write it as $$(x+1)(x+2)(x+3)(x+4)+1= \\ \left( (x+2.5)-1.5\right)\left( (x+2.5)-0.5\right)\left((x+2.5)+0.5 \right)\left((x+2.5)+1.5 \right)+1$$ For simplicity, let us denote temporarily $x+2.5$ by $y$. Then w...
908,742
I have to factor this polynomial: $$(x+1)(x+2)(x+3)(x+4)+1$$ *WolframAlpha* gives $$(x^2+5x+5)^2$$ How can I prove it without expanding the result? Thanks!
2014/08/25
[ "https://math.stackexchange.com/questions/908742", "https://math.stackexchange.com", "https://math.stackexchange.com/users/171553/" ]
$(x^2+5x+5)^2-1^2=(x^2+5x+4)(x^2+5x+6)=(x+1)(x+4)(x+2)(x+3)$
**Lemma** $\ ad\!-\!bc = -2\,\Rightarrow\, abcd = e^2\!-1,\,\ e = ad\!+\!1 = bc\!-\!1$ **Proof** $\ $ Notice that $\ abcd = (ad)(bc) = (e\!-\!1)(e\!+\!1) = e^2\!-1\ $ **QED** Yours is the special case $\ a,b,c,d\, =\, x\!+\!1,x\!+\!2,x\!+\!3,x\!+\!4$ **Generally** $\ \ AB\, =\, \left(\dfrac{A+B}2\right)^2-\left(\dfr...
9,879,780
i've seen this thread : [How to implement a listener](https://stackoverflow.com/questions/5941960/android-how-to-implement-listener) about implement listeners. its actually pretty simple but i don't get how exactly its done and how to implement in my own code. i have this static variable variable: AppLoader.isInterne...
2012/03/26
[ "https://Stackoverflow.com/questions/9879780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1092770/" ]
Your Activity does nothing special, just register itself (since the interface is implemented directly in the class) with the Other class that provides the listener. ``` public class MyActivity extends Activity implements InternetManager.Listener { private TextView mText; private InternetManager mInetMgr; ...
The part that you're missing it the class that actually notifies the listener. So you would need a class (most likely a service) that runs and pings the state of the network. Then when it detects a change it should call onStateChange() in any registered listeners. Then you would call setTheListener on that service, not...
39,043,036
I am currently practicing some dynamic programming. I came across the Stack of Boxes. The boxes are represented as: ``` struct Box{ double h; double w; double d; }; ``` And the problem is creating the highest stack of boxes where each box in the stack is larger (in both width and depth) than the one a...
2016/08/19
[ "https://Stackoverflow.com/questions/39043036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3132173/" ]
> > And here is my question - Is this optimal? > > > It is incorrect. I tried your code with the same input, except for the depth of the third box which I made `0.5`. [Here is the result](http://coliru.stacked-crooked.com/a/05b36c9bc62a7d75). It gives 15 where the answer should be 10 since no other box can fit o...
The code is actually incorrect, because you are assuming that the optimal solution to a subproblem can be extended to include the current (nth) box when it can't necessarily. Example: `{2, 50, 1}, {1, 1, 2}, {1, 3, 3}` (The above example is unchanged by the 2 sorts.) Your algorithm's `getP(boxes, 3)` will determine, ...
185,272
The following code gives 20 data as output. [![Enter image description here](https://i.stack.imgur.com/BWLHd.png)](https://i.stack.imgur.com/BWLHd.png) How can I make a 5\*4 matrix by that data list?
2018/11/04
[ "https://mathematica.stackexchange.com/questions/185272", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/61032/" ]
Here is a starting point without the For loops: ``` Clear@f; f[i_, j_] /; OddQ[j] := c[i, j]; f[i_, j_] /; EvenQ[j] := s[i, j]; n1 = 2; res = Table[f[i, j], {i, -n1, n1}, {j, 1, 2*n1}]; (* Note MatrixForm is for presentation, not for computations *) res // MatrixForm ``` [![enter image description here](...
``` n = 2; Table[ If[OddQ[j], Cos[2. Pi i j/(2 n + 1)], Sin[2. Pi i j/(2 n + 1)] ], {i, -n, n}, {j, 1, 2 n} ] ```
239,196
I've just started messing around with cygwin. I've noticed when use the tab auto-complete feature for commands it always adds a '.exe' even though one isn't needed to run the command. Is there a way to hide the '.exe' part of the bash commands?
2011/01/29
[ "https://superuser.com/questions/239196", "https://superuser.com", "https://superuser.com/users/65228/" ]
Traditionally, [`lpr`](http://en.wikipedia.org/wiki/Lpr) is used to queue print jobs. As various printing systems evolved, most provided an `lpr`-compatible command. CUPS's [`lpr`](http://www.cups.org/documentation.php/man-lpr.html) is (unsurprisingly) named `lpr`, so just use it to send print jobs to a CUPS server.
Whats the output of the commad lsusb...As far as i know you need to install the printer driver or just install cups and on the browser type <http://localhost:631> and then add the printer and try printing a test page, see whther the printer you are using is listed while you add printer..(but at this point u need to sho...
239,196
I've just started messing around with cygwin. I've noticed when use the tab auto-complete feature for commands it always adds a '.exe' even though one isn't needed to run the command. Is there a way to hide the '.exe' part of the bash commands?
2011/01/29
[ "https://superuser.com/questions/239196", "https://superuser.com", "https://superuser.com/users/65228/" ]
Traditionally, [`lpr`](http://en.wikipedia.org/wiki/Lpr) is used to queue print jobs. As various printing systems evolved, most provided an `lpr`-compatible command. CUPS's [`lpr`](http://www.cups.org/documentation.php/man-lpr.html) is (unsurprisingly) named `lpr`, so just use it to send print jobs to a CUPS server.
Knowing what printer make and model you have is important because setting up a printer under Linux can take three paths: 1) The printer is directly supported with a named driver 2) The printer is well supported using a driver from a different make/model that works pretty well with your printer 3) You need/get best r...
52,462,948
I've been trying to figure out how to insert data into mySQL database for a long time. When I try to insert data, it returns "no database selected". I'm not too sure what's wrong with the code, could someone check it out? ``` <?php $servername = "localhost"; $database= "learnsc2_ts"; $username = "learnsc2_admin"; $pas...
2018/09/23
[ "https://Stackoverflow.com/questions/52462948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10402656/" ]
Give this a shot: ``` from django.db.models import Sum Countries.objects.aggregate(total_population=Sum('Population')) ``` More info on aggregation [here](https://docs.djangoproject.com/en/2.1/topics/db/aggregation/)
You can use Sum() here, ``` self.World_population = Countries.objects.aggregate(Sum('Population')) ``` <https://docs.djangoproject.com/en/2.1/topics/db/aggregation/>
75,427
I have recently been tasked with organizing the current status at my company. We work on a number of publically and/or privately funded R&D projects, and the amount of work has been increasing, which that has translated into additional employees. One of our current issues is that we don't have any project management sy...
2016/09/05
[ "https://workplace.stackexchange.com/questions/75427", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/48700/" ]
The "gentle" approach --------------------- The very first thing I would suggest if you have not already done so, is to ask them to stop because it makes you uncomfortable. Do this to everyone who is involved, including to the second director, at the time it occurs. With luck it will end there. The "hammer" approach ...
A lot of people handle this issue by growing a thicker skin and engaging in banter. Good natured ribbing of this type is usually not malicious and it means they like you and consider you tough enough to handle it. I have almost always been a minority at workplaces and just let most things slide unless I wanted to make...
75,427
I have recently been tasked with organizing the current status at my company. We work on a number of publically and/or privately funded R&D projects, and the amount of work has been increasing, which that has translated into additional employees. One of our current issues is that we don't have any project management sy...
2016/09/05
[ "https://workplace.stackexchange.com/questions/75427", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/48700/" ]
The "gentle" approach --------------------- The very first thing I would suggest if you have not already done so, is to ask them to stop because it makes you uncomfortable. Do this to everyone who is involved, including to the second director, at the time it occurs. With luck it will end there. The "hammer" approach ...
I like Jane's response, and I would like to add a third, less direct, approach to it. You could initiate a discussion about general "rules of conduct" for the office, without specifically aiming at sexism. There are already unwritten rules about handling conflict, how to dress, about eating at the desk, not stealing f...
75,427
I have recently been tasked with organizing the current status at my company. We work on a number of publically and/or privately funded R&D projects, and the amount of work has been increasing, which that has translated into additional employees. One of our current issues is that we don't have any project management sy...
2016/09/05
[ "https://workplace.stackexchange.com/questions/75427", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/48700/" ]
The "gentle" approach --------------------- The very first thing I would suggest if you have not already done so, is to ask them to stop because it makes you uncomfortable. Do this to everyone who is involved, including to the second director, at the time it occurs. With luck it will end there. The "hammer" approach ...
Mewing is unquestionably stupid and out of line. There's nothing wrong with the rest of your examples IMHO so I'll focus on that. Unfortunately you need to ruffle some feathers to get this going. **You made a mistake** by not naming the offending director (who I'll refer to as B) when you first spoke to the other one ...
75,427
I have recently been tasked with organizing the current status at my company. We work on a number of publically and/or privately funded R&D projects, and the amount of work has been increasing, which that has translated into additional employees. One of our current issues is that we don't have any project management sy...
2016/09/05
[ "https://workplace.stackexchange.com/questions/75427", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/48700/" ]
The "gentle" approach --------------------- The very first thing I would suggest if you have not already done so, is to ask them to stop because it makes you uncomfortable. Do this to everyone who is involved, including to the second director, at the time it occurs. With luck it will end there. The "hammer" approach ...
From your comment: > > The general culture is acceptable and probably not going to change, but some of the comments are taking it too far. > > > In that case, you might want to take the surgical approach - rather than making a general comment / report about behaviour (which could be met with denial, or the implic...
75,427
I have recently been tasked with organizing the current status at my company. We work on a number of publically and/or privately funded R&D projects, and the amount of work has been increasing, which that has translated into additional employees. One of our current issues is that we don't have any project management sy...
2016/09/05
[ "https://workplace.stackexchange.com/questions/75427", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/48700/" ]
The "gentle" approach --------------------- The very first thing I would suggest if you have not already done so, is to ask them to stop because it makes you uncomfortable. Do this to everyone who is involved, including to the second director, at the time it occurs. With luck it will end there. The "hammer" approach ...
My way of handling this has several steps. First, for the ones that are clearly not meant as anything except a joke and which you do not personally find upsetting, laugh out loud. Make a self-deprecating joke if you can. This is important as a first step because then when you object to certain other phrases, people are...
5,789,198
hi all i am going to ask basic question i searched many links for my question but none of the things not given exact result.here is my question: I want to pass rect value and returning the same type using some transformation for that i wrote one method but it is giving me the errors i know it may be syntactically wron...
2011/04/26
[ "https://Stackoverflow.com/questions/5789198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/481455/" ]
Used following line you will solve your problem. ``` [self yourFunction:[NSValue valueWithCGRect:rectFrame]]; ``` Above line is the simple method call and in objective-C you can not send CGRect as a parameter. so you have to CGRect convert into NSValue. At called function you have get GGRect from NSValue ``` yourV...
Try with below ``` -(void)viewDidLoad{ CGRect testRect= [self getNewRect:self.view.frame]; } -(CGRect) getNewRect:(CGRect) normalRect{ //some transformation return tranfermedrect; } ``` Add below in .h file ``` -(CGRect) getNewRect:(CGRect) normalRect ; ```