qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
20,022,618
I've got an array of characters which could contain a NULL character. The array is not null-terminated, but I do know it's length. **Question** How do I output this exact array (including null characters) and nothing else (no trailing \n) to stdout? Unfortunately, I am not allowed to output one character at a t...
2013/11/16
[ "https://Stackoverflow.com/questions/20022618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1554503/" ]
``` char buffer[SIZE]; if(fwrite(buffer, 1, SIZE, stdout) != SIZE) { perror("fwrite"); } ```
Though hard to find if you're a C newbie, the answer turns out to be very easy. C sees stdout as a file, which means you can simply use fwrite to accomplish this. ``` fwrite(CHAR_ARRAY, sizeof(char), NR_CHARS, stdout); ```
598,287
I'm developing a generator to create a C# API wrapper for Facebook's API. I'm just about finished with the basic coding, except that there doesn't seem to be any well-formed declaration of the method signatures of all the API methods. I can parse the [schema for the element types](http://api.facebook.com/1.0/facebook....
2009/02/28
[ "https://Stackoverflow.com/questions/598287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2596/" ]
Facebook never released such a document, and the REST API that this question relates to has been deprecated.
There is a Facebook XSD at <http://api.facebook.com/1.0/facebook.xsd>. It defines the full schema and has the information you are looking for neatly packaged. No need to screen scrape :-p
598,287
I'm developing a generator to create a C# API wrapper for Facebook's API. I'm just about finished with the basic coding, except that there doesn't seem to be any well-formed declaration of the method signatures of all the API methods. I can parse the [schema for the element types](http://api.facebook.com/1.0/facebook....
2009/02/28
[ "https://Stackoverflow.com/questions/598287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2596/" ]
Facebook never released such a document, and the REST API that this question relates to has been deprecated.
You should look into using the C# SDK for the Graph API. It might not have the type safety you're looking for, but it is fairly complete and can be used with a variety of .net app types (MVC, WinForms, ASP.NET, etc) <http://facebooksdk.codeplex.com/>
62,699,525
I want to create a regex that can check user name in this terms: * two first letters are in a-z (no numbers allowed). * numbers after two letters are allowed. * space is allowed - not in the beginning. * after the space can be only a-z, but not number/special char (`john 2doe` )), but `john d2oe` is okay. * those rule...
2020/07/02
[ "https://Stackoverflow.com/questions/62699525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10932853/" ]
The reason so many examples out there are so different is because context trumps method. For example, if I'm running a physics experiment to verify a theoretical equation, then in essence the theoretical equation itself is the "test set" and I would want to use as much data as I could (i.e. use all the data) to reduce ...
You fit your model on the `train` sets, so the features `X_train` and the target `y_train`. So in your case, it is option 1: ``` model.fit(X_train,y_train) ``` Once your model is trained, you can test your model on the `X_test`, and comparing the `y_pred` that results from running the model on the test set to the `y...
62,699,525
I want to create a regex that can check user name in this terms: * two first letters are in a-z (no numbers allowed). * numbers after two letters are allowed. * space is allowed - not in the beginning. * after the space can be only a-z, but not number/special char (`john 2doe` )), but `john d2oe` is okay. * those rule...
2020/07/02
[ "https://Stackoverflow.com/questions/62699525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10932853/" ]
The reason so many examples out there are so different is because context trumps method. For example, if I'm running a physics experiment to verify a theoretical equation, then in essence the theoretical equation itself is the "test set" and I would want to use as much data as I could (i.e. use all the data) to reduce ...
The quick answer is: train your model on the train sample. Whatever your model is (linear regression or anything else), you always want to make sure your model is not **over-fitted**, meaning it will still perform well for unseen data. That's why you should always train your model on a subset of the full dataset (the ...
40,360,991
I was trying to hide facebook page plugin but it looks like it doesn't work. Here's my code on CSS ``` @media only screen and (max-width:800px){ .fb-page{ visibility: hidden; } ``` here's the HTML part where I store FB. ``` <section id="login-form" class="no-margin customloginform"> <label>Username: </label...
2016/11/01
[ "https://Stackoverflow.com/questions/40360991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3608524/" ]
OK, so the reason your `display: none`s aren't working is you have other rules in play. ![ ](https://i.stack.imgur.com/MXco1.png) You have a few choices: * Put an `!important` on your CSS `.fb-page { display: none }` media query. * Apply your media query later on in your list of CSS rules (after the two rules in the...
try: ``` @media only screen and (max-width:800px){ .fb-page{ display: none; } ``` or if you are using Bootstrap try hidden-xs or hidden-sm. Best of luck.
40,360,991
I was trying to hide facebook page plugin but it looks like it doesn't work. Here's my code on CSS ``` @media only screen and (max-width:800px){ .fb-page{ visibility: hidden; } ``` here's the HTML part where I store FB. ``` <section id="login-form" class="no-margin customloginform"> <label>Username: </label...
2016/11/01
[ "https://Stackoverflow.com/questions/40360991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3608524/" ]
OK, so the reason your `display: none`s aren't working is you have other rules in play. ![ ](https://i.stack.imgur.com/MXco1.png) You have a few choices: * Put an `!important` on your CSS `.fb-page { display: none }` media query. * Apply your media query later on in your list of CSS rules (after the two rules in the...
In your code you're missing the closing brace for `.fb-page` but I'd also say you should use `display: none` if you want to completely hide something at that breakpoint. Try this: ``` @media only screen and (max-width:800px){ .fb-page { display: none; } } ```
162,603
We made a command to print our software requirements but now that we hit things that use a lot of space we have an overflow issue. We used a `table` environment to keep everything together and avoid weird things like a final bar ending up on a different page but this clearly is a hack. I use two `tabular`s as writing ...
2014/02/26
[ "https://tex.stackexchange.com/questions/162603", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/46938/" ]
``` \documentclass[12pt,a4paper]{report} \newcommand{\requirement}[5]{\par \smallskip \hrule \nopagebreak \noindent{\large\strut}\textit{#3}\hfill\textbf{ID.#1.#2} \par \nopagebreak \hrule \par \nopagebreak \smallskip \clubpenalty10000 #4 \par \par \nopagebreak \hrule \noindent{\large\strut}\textbf{Motivation:}\par \s...
Use a `longtable`. MWE: ``` \documentclass[12pt,a4paper]{report} \usepackage{booktabs,longtable,array} \newcommand{\requirement}[5]{% \begin{longtable}[l]{@{}p{0.70\textwidth}>{\raggedleft\arraybackslash}p{\dimexpr0.30\textwidth-4\tabcolsep}} \toprule \emph{#3} & \textbf{ID.#1.#2} \\ \midrule #4 ...
35,723
So I SSH into a Ubuntu server and try to open the file in a Mac program (Coda) and get an error: ``` Couldn't get a file descriptor referring to the console ``` Using the command ``` open myfile.html ``` This works in a Mac terminal. I hope there are common Unix commands that provide a way to bridge this so I can...
2012/04/04
[ "https://unix.stackexchange.com/questions/35723", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
`open` is an OS X command. When SSHing you are running commands on Ubuntu, not OS X. You want to open a file locally? I believe Coda has SFTP support built in (so you could eschew the terminal entirely). Failing that, `scp` the file to your local system and open locally.
Typically on a Linux shell you would use `cat`, `more`, or `view` to view a text file. But since you are looking at html you could also use `links` to see a nicer view of it. These are are "terminal applications", that work in a text interface.
35,723
So I SSH into a Ubuntu server and try to open the file in a Mac program (Coda) and get an error: ``` Couldn't get a file descriptor referring to the console ``` Using the command ``` open myfile.html ``` This works in a Mac terminal. I hope there are common Unix commands that provide a way to bridge this so I can...
2012/04/04
[ "https://unix.stackexchange.com/questions/35723", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
`open` is an OS X command. When SSHing you are running commands on Ubuntu, not OS X. You want to open a file locally? I believe Coda has SFTP support built in (so you could eschew the terminal entirely). Failing that, `scp` the file to your local system and open locally.
The `open` command on Linux is unrelated; it is (on most distributions) another name for [`openvt`](http://linux.die.net/man/1/openvt), which starts a program in a new text console (a feature that isn't used much nowadays). The command corresponding to OSX's `open`, on a modern Linux system, is [`xdg-open`](http://lin...
35,723
So I SSH into a Ubuntu server and try to open the file in a Mac program (Coda) and get an error: ``` Couldn't get a file descriptor referring to the console ``` Using the command ``` open myfile.html ``` This works in a Mac terminal. I hope there are common Unix commands that provide a way to bridge this so I can...
2012/04/04
[ "https://unix.stackexchange.com/questions/35723", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
The `open` command on Linux is unrelated; it is (on most distributions) another name for [`openvt`](http://linux.die.net/man/1/openvt), which starts a program in a new text console (a feature that isn't used much nowadays). The command corresponding to OSX's `open`, on a modern Linux system, is [`xdg-open`](http://lin...
Typically on a Linux shell you would use `cat`, `more`, or `view` to view a text file. But since you are looking at html you could also use `links` to see a nicer view of it. These are are "terminal applications", that work in a text interface.
2,590,518
I was thinking back to my freshman year at college (five years ago) when I took an exam to place-out of intro-level computer science. There was a question about loop invariants, and I was wondering if loop invariants are really necessary in this case or if the question was simply a bad example... the question was to wr...
2010/04/07
[ "https://Stackoverflow.com/questions/2590518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136540/" ]
When you're solving hard problems and writing code that will be reused long after you've moved on, you (should) go through the process of proving the correctness of every routine you write, every day. Test driven development is a formalization of that idea, but the core of it is: you need to prove at least to yourself ...
In recent years "test driven development" under various names has been the furthest most people bother to go with reasoning about their code. It's rather like very careful and repeatable experimentation, versus logical reasoning. Science versus mathematics! There is some use of pre-conditions, post-conditions and loop...
2,590,518
I was thinking back to my freshman year at college (five years ago) when I took an exam to place-out of intro-level computer science. There was a question about loop invariants, and I was wondering if loop invariants are really necessary in this case or if the question was simply a bad example... the question was to wr...
2010/04/07
[ "https://Stackoverflow.com/questions/2590518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136540/" ]
> The professor wanted me to prove the loop using a loop invariant; Your professor wanted to make sure you understood loop invariants, not just prove something about a very simple function. > Is a loop invariant really needed as a proof of correctness in this case? Well, technically, no. By that reasoning, you don't...
In recent years "test driven development" under various names has been the furthest most people bother to go with reasoning about their code. It's rather like very careful and repeatable experimentation, versus logical reasoning. Science versus mathematics! There is some use of pre-conditions, post-conditions and loop...
2,590,518
I was thinking back to my freshman year at college (five years ago) when I took an exam to place-out of intro-level computer science. There was a question about loop invariants, and I was wondering if loop invariants are really necessary in this case or if the question was simply a bad example... the question was to wr...
2010/04/07
[ "https://Stackoverflow.com/questions/2590518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136540/" ]
> > to what extent are formal proofs of > correctness needed? > > > It depends, of course, but I think it's important for programmers to know how to write code that is not prone to errors, where it tends to be correct by construction. One example is the concept of "look-ahead", such as in parsing, where the next...
In recent years "test driven development" under various names has been the furthest most people bother to go with reasoning about their code. It's rather like very careful and repeatable experimentation, versus logical reasoning. Science versus mathematics! There is some use of pre-conditions, post-conditions and loop...
2,590,518
I was thinking back to my freshman year at college (five years ago) when I took an exam to place-out of intro-level computer science. There was a question about loop invariants, and I was wondering if loop invariants are really necessary in this case or if the question was simply a bad example... the question was to wr...
2010/04/07
[ "https://Stackoverflow.com/questions/2590518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136540/" ]
> The professor wanted me to prove the loop using a loop invariant; Your professor wanted to make sure you understood loop invariants, not just prove something about a very simple function. > Is a loop invariant really needed as a proof of correctness in this case? Well, technically, no. By that reasoning, you don't...
When you're solving hard problems and writing code that will be reused long after you've moved on, you (should) go through the process of proving the correctness of every routine you write, every day. Test driven development is a formalization of that idea, but the core of it is: you need to prove at least to yourself ...
2,590,518
I was thinking back to my freshman year at college (five years ago) when I took an exam to place-out of intro-level computer science. There was a question about loop invariants, and I was wondering if loop invariants are really necessary in this case or if the question was simply a bad example... the question was to wr...
2010/04/07
[ "https://Stackoverflow.com/questions/2590518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136540/" ]
> > to what extent are formal proofs of > correctness needed? > > > It depends, of course, but I think it's important for programmers to know how to write code that is not prone to errors, where it tends to be correct by construction. One example is the concept of "look-ahead", such as in parsing, where the next...
When you're solving hard problems and writing code that will be reused long after you've moved on, you (should) go through the process of proving the correctness of every routine you write, every day. Test driven development is a formalization of that idea, but the core of it is: you need to prove at least to yourself ...
2,590,518
I was thinking back to my freshman year at college (five years ago) when I took an exam to place-out of intro-level computer science. There was a question about loop invariants, and I was wondering if loop invariants are really necessary in this case or if the question was simply a bad example... the question was to wr...
2010/04/07
[ "https://Stackoverflow.com/questions/2590518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136540/" ]
> > to what extent are formal proofs of > correctness needed? > > > It depends, of course, but I think it's important for programmers to know how to write code that is not prone to errors, where it tends to be correct by construction. One example is the concept of "look-ahead", such as in parsing, where the next...
> The professor wanted me to prove the loop using a loop invariant; Your professor wanted to make sure you understood loop invariants, not just prove something about a very simple function. > Is a loop invariant really needed as a proof of correctness in this case? Well, technically, no. By that reasoning, you don't...
37,257,264
I have this Angular function that fires multiple times and I'm confused as to why it does this. On the backend, I have a console.log() statement that logs every time the endpoint is tapped. The statement fires 4 times. instagramService.tapInsta(); should only be called only once. Can someone tell me why and how this is...
2016/05/16
[ "https://Stackoverflow.com/questions/37257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6341409/" ]
Insert a `debugger;` into the body of the function, open (recommended in chrome) "Developer tools" (simply inspect a element) and check "Call stack", so you see what function are calling it.
How many instances of this are on the page? I believe Angular will have a controller for each instance which can cause this API call to occur multiple times. Generally you'll be better off placing API calls within a service (service, factory or provider, take your pick) which will be a singleton within the app.
37,257,264
I have this Angular function that fires multiple times and I'm confused as to why it does this. On the backend, I have a console.log() statement that logs every time the endpoint is tapped. The statement fires 4 times. instagramService.tapInsta(); should only be called only once. Can someone tell me why and how this is...
2016/05/16
[ "https://Stackoverflow.com/questions/37257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6341409/" ]
How many instances of this are on the page? I believe Angular will have a controller for each instance which can cause this API call to occur multiple times. Generally you'll be better off placing API calls within a service (service, factory or provider, take your pick) which will be a singleton within the app.
You aren't showing it, but are you using routing? If so, are you calling your controller in your routing template AND in your markup/view? If so, this can cause all functions to trigger twice. You only need to call to the controller in your routing.
37,257,264
I have this Angular function that fires multiple times and I'm confused as to why it does this. On the backend, I have a console.log() statement that logs every time the endpoint is tapped. The statement fires 4 times. instagramService.tapInsta(); should only be called only once. Can someone tell me why and how this is...
2016/05/16
[ "https://Stackoverflow.com/questions/37257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6341409/" ]
How many instances of this are on the page? I believe Angular will have a controller for each instance which can cause this API call to occur multiple times. Generally you'll be better off placing API calls within a service (service, factory or provider, take your pick) which will be a singleton within the app.
Thank you everyone for your help. It seems as if using the same controller for multiple directives calls functions in the controller multiple. So, if you're using the controller in 3 different directives - any statements called directly from a service, as opposed to being nested in a $scope function, will be called 3 t...
37,257,264
I have this Angular function that fires multiple times and I'm confused as to why it does this. On the backend, I have a console.log() statement that logs every time the endpoint is tapped. The statement fires 4 times. instagramService.tapInsta(); should only be called only once. Can someone tell me why and how this is...
2016/05/16
[ "https://Stackoverflow.com/questions/37257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6341409/" ]
Insert a `debugger;` into the body of the function, open (recommended in chrome) "Developer tools" (simply inspect a element) and check "Call stack", so you see what function are calling it.
You aren't showing it, but are you using routing? If so, are you calling your controller in your routing template AND in your markup/view? If so, this can cause all functions to trigger twice. You only need to call to the controller in your routing.
37,257,264
I have this Angular function that fires multiple times and I'm confused as to why it does this. On the backend, I have a console.log() statement that logs every time the endpoint is tapped. The statement fires 4 times. instagramService.tapInsta(); should only be called only once. Can someone tell me why and how this is...
2016/05/16
[ "https://Stackoverflow.com/questions/37257264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6341409/" ]
Insert a `debugger;` into the body of the function, open (recommended in chrome) "Developer tools" (simply inspect a element) and check "Call stack", so you see what function are calling it.
Thank you everyone for your help. It seems as if using the same controller for multiple directives calls functions in the controller multiple. So, if you're using the controller in 3 different directives - any statements called directly from a service, as opposed to being nested in a $scope function, will be called 3 t...
761,660
Objects that derive from HashAlgorithm such as MD5CryptoServiceProvider have a Dispose() method, but it's private. Instead it has a Clear() method which "Releases all resources" used by it. WTF? Is this how to correctly dispose of a HashAlgorithm then? ``` var hasher = new MD5CryptoServiceProvider(); byte[] hashCod...
2009/04/17
[ "https://Stackoverflow.com/questions/761660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11574/" ]
Looking with Reflector, the `Clear` method of `HashAlgorithm` simply calls the private `Dispose` method. The reason for exposing a method with name `Clear` was probably just that the designers of the class thought it would be a more suitable name for a hash algorithm. You see similar styles within other parts of the BC...
You should let the GC handle that for you. That's it's job. Some resources should be disposed of, like DB connections and file handles, so put those in a `using` block (C#). This isn't one of those cases, though.
761,660
Objects that derive from HashAlgorithm such as MD5CryptoServiceProvider have a Dispose() method, but it's private. Instead it has a Clear() method which "Releases all resources" used by it. WTF? Is this how to correctly dispose of a HashAlgorithm then? ``` var hasher = new MD5CryptoServiceProvider(); byte[] hashCod...
2009/04/17
[ "https://Stackoverflow.com/questions/761660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11574/" ]
While the `Dipose()` method is private, if you cast it to `IDisposable` you can gain access to it. As others have said, though, `Clear()` will call it for you. A better approach, however, is to enclose the declaration and and assignment of the variable in a using() block: ``` byte[] hashCode; using(var hasher = new ...
You should let the GC handle that for you. That's it's job. Some resources should be disposed of, like DB connections and file handles, so put those in a `using` block (C#). This isn't one of those cases, though.
20,609,209
I have been using Loki's Functor for a while and I recently asked a [question](https://stackoverflow.com/questions/20599849/lokis-functor-with-variadic-templates) about it (still unanswered...) I have been told to use std::function, but I prefer Loki's implementation of Functor since it also work with all sorts of poin...
2013/12/16
[ "https://Stackoverflow.com/questions/20609209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/710054/" ]
Use `std::bind`. ``` auto func = std::bind(&Toto::foo, ptr, std::placeholders::_1); ``` here, `func` will be deduced to type, that was returned from `std::bind` or if you don't like `auto` you can use (and you want to use `std::function`) ``` std::function<void(int)> func = std::bind(&Toto::foo, ptr, std::placehol...
Use `std::bind`. ``` struct Toto { void foo( int param ) { std::cout << "foo: " << param << std::endl; } }; int main() { std::shared_ptr<Toto> ptr = std::make_shared<Toto>(); std::function< void(int) > func( std::bind( &Toto::foo, std::bind( [ptr] () { return ptr.get(); } ), ...
20,609,209
I have been using Loki's Functor for a while and I recently asked a [question](https://stackoverflow.com/questions/20599849/lokis-functor-with-variadic-templates) about it (still unanswered...) I have been told to use std::function, but I prefer Loki's implementation of Functor since it also work with all sorts of poin...
2013/12/16
[ "https://Stackoverflow.com/questions/20609209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/710054/" ]
Use `std::bind`. ``` auto func = std::bind(&Toto::foo, ptr, std::placeholders::_1); ``` here, `func` will be deduced to type, that was returned from `std::bind` or if you don't like `auto` you can use (and you want to use `std::function`) ``` std::function<void(int)> func = std::bind(&Toto::foo, ptr, std::placehol...
If you don't want to use `std::bind`, an option is to use a lambda function, resulting in even smaller code and I personally find it more intuitive: ``` auto func = [&ptr](int p){ ptr->foo(p); }; ``` or without `auto`: ``` std::function<void(int)> func = [&ptr](int p){ ptr->foo(p); }; ``` But this only works if t...
20,609,209
I have been using Loki's Functor for a while and I recently asked a [question](https://stackoverflow.com/questions/20599849/lokis-functor-with-variadic-templates) about it (still unanswered...) I have been told to use std::function, but I prefer Loki's implementation of Functor since it also work with all sorts of poin...
2013/12/16
[ "https://Stackoverflow.com/questions/20609209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/710054/" ]
If you don't want to use `std::bind`, an option is to use a lambda function, resulting in even smaller code and I personally find it more intuitive: ``` auto func = [&ptr](int p){ ptr->foo(p); }; ``` or without `auto`: ``` std::function<void(int)> func = [&ptr](int p){ ptr->foo(p); }; ``` But this only works if t...
Use `std::bind`. ``` struct Toto { void foo( int param ) { std::cout << "foo: " << param << std::endl; } }; int main() { std::shared_ptr<Toto> ptr = std::make_shared<Toto>(); std::function< void(int) > func( std::bind( &Toto::foo, std::bind( [ptr] () { return ptr.get(); } ), ...
1,419,069
The question is pretty much self-explanatory. I Googled many sites, many methods, tried many encodings, but I can't get it to match. I'm trying to make the string "asdasd" match. (<http://www.fileformat.info/tool/hash.htm?text=asdasd>)
2009/09/13
[ "https://Stackoverflow.com/questions/1419069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/154502/" ]
Try this ``` using System.Security.Cryptography public static string HashPassword(string unhashedPassword) { return BitConverter.ToString(new SHA512CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(unhashedPassword))).Replace("-", String.Empty).ToUpper(); } ```
BitConverter works just fine ... ``` var testVal = "asdasd"; var enc = new ASCIIEncoding(); var bytes = enc.GetBytes( testVal ); var sha = new SHA512Managed(); var result = sha.ComputeHash( bytes ); var resStr = BitConverter.ToString( result ); var nodash = resStr.Replace( "-", "" ); nodash.Dump(); ``` (Fixed for...
1,419,069
The question is pretty much self-explanatory. I Googled many sites, many methods, tried many encodings, but I can't get it to match. I'm trying to make the string "asdasd" match. (<http://www.fileformat.info/tool/hash.htm?text=asdasd>)
2009/09/13
[ "https://Stackoverflow.com/questions/1419069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/154502/" ]
Try this ``` using System.Security.Cryptography public static string HashPassword(string unhashedPassword) { return BitConverter.ToString(new SHA512CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(unhashedPassword))).Replace("-", String.Empty).ToUpper(); } ```
I just spent several hours trying to get a .NET hash function to match PHP's Crypt function. Not fun. There are multiple challenges here, since the PHP implementation of Crypt returns a base64 encoded string, and doesn't do multiple hashing iterations (e.g. 5000 is default for Crypt.) I was not able to get similar ou...
8,498,589
My current RegEx for phone number validation is `^\d{8,}$` which validates minimum length is 8 and does not allow special characters or letters and my question is what's the RegEx which does not allow 9-15 consecutive duplicate numbers plus the current condition (minimum length is 8 and no special characters or letters...
2011/12/14
[ "https://Stackoverflow.com/questions/8498589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1096925/" ]
If I understand your requirements correctly, this regex will do it: ```js /^(?!.*(\d)\1{8})\d{8,}$/ ``` Here is a commented version (in C# syntax): ```cs Regex regexObj = new Regex(@" # Match digits sequence with no same digit 9 times in a row. ^ # Anchor to start of string (?!.*(\d)\1{8...
So `11111111` (8 `1`s) is ok, but `111111111` (9 `1`s) isn't? A regex isn't *always* the right answer. I'd keep the existing `^\d{8,}$` regex and then check for repeated digits separately. Since you're only (for now?) forbidding 10 distinct numbers, you could just set up a hash of forbidden numbers and check against i...
8,498,589
My current RegEx for phone number validation is `^\d{8,}$` which validates minimum length is 8 and does not allow special characters or letters and my question is what's the RegEx which does not allow 9-15 consecutive duplicate numbers plus the current condition (minimum length is 8 and no special characters or letters...
2011/12/14
[ "https://Stackoverflow.com/questions/8498589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1096925/" ]
To understand the regex in a better way NODE EXPLANATION ``` ^ the beginning of the string (?! look ahead to see if there is not: .* any character except \n (0 or more times (matching the most amount possible)) ( ...
So `11111111` (8 `1`s) is ok, but `111111111` (9 `1`s) isn't? A regex isn't *always* the right answer. I'd keep the existing `^\d{8,}$` regex and then check for repeated digits separately. Since you're only (for now?) forbidding 10 distinct numbers, you could just set up a hash of forbidden numbers and check against i...
539,482
I'm trying to put together some rather long equation within two cases. I need them to align and I've come so far: ``` \begin{align} s(t)= \begin{cases} &s_1(t)\\ &s_2(t)\\ &s_3(t)\\ &s_4(t)\\ &s_5(t) \end{cases} = \begin{cases} &S \cdot k_1 \cdot\frac{t}{T}+S\:\dot k_3\dot\:\sin{(4\cdot...
2020/04/19
[ "https://tex.stackexchange.com/questions/539482", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/213138/" ]
The following is a bit an abuse of notation, but it's clearer than the version with the double big brace. I also removed all `\cdot` symbols, because they're not used in the standard practice of mathematics, the juxtaposition of symbols is multiplication. ```latex \documentclass{article} \usepackage{amsmath} \usepack...
I propose this solution with the `empheq` package and the `alignat` environment. I also removed the unnecessary parentheses and used the mediumsized fractions from `nccmath` (to be loaded before empheq). ``` \documentclass{article} \usepackage{graphicx} \usepackage{lipsum} \usepackage[margin=30mm,includefoot]{geometry...
38,198,148
I need the "OK" button at the bottom of this page to stay above the keypad when opened. It works on Android as you can see in the screenshot on the left, but not in IOS (screenshot on the right). Can you help me with the code please ? Moreover, as you can see the "select-on-focus" directive doesn't work in iOS... And...
2016/07/05
[ "https://Stackoverflow.com/questions/38198148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2217647/" ]
For the keyboard/scroll issue, I didn't find better than this directive (only for ios): ``` .directive('keyboardResize', function ($ionicScrollDelegate) { return { restrict: 'A', link: function postLink(scope, element, attrs) { function onKeyboardShow (e) { element.cs...
Ionic actually supports this feature by default. Have a look at the `keyboard-attach` attribute directive. > > keyboard-attach is an attribute directive which will cause an element to float above the keyboard when the keyboard shows. Currently only supports the ion-footer-bar directive. > > > ``` <ion-footer-bar ...
33,948,902
I included this at the top of my php file: ``` <?php header('Content-Type: text/html; charset=UTF-8'); ?> ``` I did this because my file.php was not displaying "á, é, í, ó, ú or ¿" in the html file or from data queried from my database. After I placed the 'header('Content-Type: text/html; charset=UTF-8');' line...
2015/11/27
[ "https://Stackoverflow.com/questions/33948902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5539694/" ]
There are a couple of reasons this could be happening. It is however important that your entire line of code uses the same set of charset, and that all functions that can be set to a specific charset, is set to the same. The most widely used one is UTF-8, which is the one I'm suggesting you use. **Connection** * You ...
Are you sure? And are you sure that you are retrieving your data from the data base? Having said that, most databases require you to save data in a way that is NOT exactly like your question. There is really valid security reasons for this.
33,948,902
I included this at the top of my php file: ``` <?php header('Content-Type: text/html; charset=UTF-8'); ?> ``` I did this because my file.php was not displaying "á, é, í, ó, ú or ¿" in the html file or from data queried from my database. After I placed the 'header('Content-Type: text/html; charset=UTF-8');' line...
2015/11/27
[ "https://Stackoverflow.com/questions/33948902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5539694/" ]
There are a couple of reasons this could be happening. It is however important that your entire line of code uses the same set of charset, and that all functions that can be set to a specific charset, is set to the same. The most widely used one is UTF-8, which is the one I'm suggesting you use. **Connection** * You ...
You should use utf8\_general\_ci as a database encoding also before insert query you should run this query ``` Mysql_query(" SET NAMES 'utf8'"); ```
60,792,563
I am not a javascript coder, but I need to modify this code so that I can have a status bar shown for multiple times during the week. How can I add to this statement to cover another day of the week or other times on Sunday? I need to have the bar show up Sunday from 5pm to 7pm and Thursday between 7p and 9p. Just wond...
2020/03/21
[ "https://Stackoverflow.com/questions/60792563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13101365/" ]
First of all, you must understand how the Date's instance methods that you are using works. You can try it here [getDay](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay), and here [getHours](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Dat...
I would suggest you to refactor like this ``` if (showForDay(d)) { jQuery(".streaming").show(); } else { jQuery(".streaming").hide(); } function showForDay(d){ // put all your conditions here if (d.getDay() == 0 && d.getHours() >= 9 && d.getHours() <= 12) return true if (d.getDay() == 0 && d.getHours() >= 1...
60,792,563
I am not a javascript coder, but I need to modify this code so that I can have a status bar shown for multiple times during the week. How can I add to this statement to cover another day of the week or other times on Sunday? I need to have the bar show up Sunday from 5pm to 7pm and Thursday between 7p and 9p. Just wond...
2020/03/21
[ "https://Stackoverflow.com/questions/60792563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13101365/" ]
Thanks for the help. Based on your help I have modified it and also added a specific minute as well. Is this a proper way to do this or should I not be using get.Minutes? ``` var date = new Date(); var day = date.getDay(); var hour = date.getHours(); var minute = date.getMinutes(); if ((day == 0 && hour >= 08 && mi...
I would suggest you to refactor like this ``` if (showForDay(d)) { jQuery(".streaming").show(); } else { jQuery(".streaming").hide(); } function showForDay(d){ // put all your conditions here if (d.getDay() == 0 && d.getHours() >= 9 && d.getHours() <= 12) return true if (d.getDay() == 0 && d.getHours() >= 1...
60,792,563
I am not a javascript coder, but I need to modify this code so that I can have a status bar shown for multiple times during the week. How can I add to this statement to cover another day of the week or other times on Sunday? I need to have the bar show up Sunday from 5pm to 7pm and Thursday between 7p and 9p. Just wond...
2020/03/21
[ "https://Stackoverflow.com/questions/60792563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13101365/" ]
First of all, you must understand how the Date's instance methods that you are using works. You can try it here [getDay](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay), and here [getHours](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Dat...
Thanks for the help. Based on your help I have modified it and also added a specific minute as well. Is this a proper way to do this or should I not be using get.Minutes? ``` var date = new Date(); var day = date.getDay(); var hour = date.getHours(); var minute = date.getMinutes(); if ((day == 0 && hour >= 08 && mi...
17,369,066
I am trying to have a search feature for a database. The three different options or chemicals gases and supplies. ``` <form action="/search/" method="get"> <input name="q" type="text"> <input value="Search" type="submit"> <input value="Chemicals" form="radiobuttons" name="item" type="radio">Chemicals&nbsp; ...
2013/06/28
[ "https://Stackoverflow.com/questions/17369066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2482595/" ]
Consider using the [django forms](https://docs.djangoproject.com/en/dev/topics/forms/) api. It will make your life a lot simpler since it can include validation, data cleaning, reusable code, etc. question was updated, here's more now that the code has changed. you need to instantiate your form in your view method an...
While the forms framework is the way to go, your immediate problem is that none of your radio buttons have a `value` attribute.
19,497,836
I am getting "**This operation is not supported for a relative URI.**" error while accessing WCF service from my web-browser. The service is hosted on local IIS and following is its configuration: ``` <system.serviceModel> <!-- change --> <bindings> <customBinding> <binding name="Wrabind" closeTi...
2013/10/21
[ "https://Stackoverflow.com/questions/19497836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1124494/" ]
The 32-bit version supports code compiled back when 64 bits were just a myth, like flying cars or responsive politicians.
Historically, file sizes, offsets, inode numbers and so on were "unsigned long" in the UNIX API, which has 32 bits on 32 bit platforms, and therefore are good for 2GB (when signed) filesizes. Enourmous back then, not even good enough for a DVD image or many movies nowadays. To handle files large than that, most syscal...
19,497,836
I am getting "**This operation is not supported for a relative URI.**" error while accessing WCF service from my web-browser. The service is hosted on local IIS and following is its configuration: ``` <system.serviceModel> <!-- change --> <bindings> <customBinding> <binding name="Wrabind" closeTi...
2013/10/21
[ "https://Stackoverflow.com/questions/19497836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1124494/" ]
Ok, this is not just because of the need for backward compatibility. There is one more reason to it. The Linux kernel supports the 32 bit processes running on the userland even though the Kernel is running on the 64 bit mode. This is called the 32 bit compatibility mode. So for the processes running in 32 bit mode, ev...
Historically, file sizes, offsets, inode numbers and so on were "unsigned long" in the UNIX API, which has 32 bits on 32 bit platforms, and therefore are good for 2GB (when signed) filesizes. Enourmous back then, not even good enough for a DVD image or many movies nowadays. To handle files large than that, most syscal...
27,368,404
Okay, so I have a `<tr>` table being built from a string that looks something like this: `13467` ``` 1= monday 2= tuesday ... 7= sunday so 13467 = mon,wed,thurs,sat,sun ``` My existing code manually checked the string, like so ``` if (breakfastDays.Contains("1")) { sb.Append("<td class=\"active\">&nbsp;</td...
2014/12/08
[ "https://Stackoverflow.com/questions/27368404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3296811/" ]
Yes, you can use a loop. The only tricky thing is the variables that you increase, it would be easier if you used an array for that. ``` for (char c = '1'; c <= '7'; c++) { if (breakfastDays.Contains(c)) { sb.Append("<td class=\"active\">&nbsp;</td>"); switch (c) { case '1': mo++; break; case '2'...
This will fix the issue of having to write seven tests for the table: ``` for (int i = 1; i <= 7; i++) { if (breakfastDays.Contains(i.ToString()) { sb.Append("<td class=\"active\">&nbsp;</td>")); } else { sb.Append("<td>&nbsp;</td>"); } } ``` We could sure get more clever but ...
27,368,404
Okay, so I have a `<tr>` table being built from a string that looks something like this: `13467` ``` 1= monday 2= tuesday ... 7= sunday so 13467 = mon,wed,thurs,sat,sun ``` My existing code manually checked the string, like so ``` if (breakfastDays.Contains("1")) { sb.Append("<td class=\"active\">&nbsp;</td...
2014/12/08
[ "https://Stackoverflow.com/questions/27368404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3296811/" ]
I think that `mo` and `tu` are counts that keep count of the days of the week. A better way might be an array: ``` public static void Main() { int[] breakfastDays = new int[7]; string days = "13467"; var sb = new StringBuilder(); for (int i = 0; i < 7; i++) { if (days.Contains((i + 1).ToSt...
This will fix the issue of having to write seven tests for the table: ``` for (int i = 1; i <= 7; i++) { if (breakfastDays.Contains(i.ToString()) { sb.Append("<td class=\"active\">&nbsp;</td>")); } else { sb.Append("<td>&nbsp;</td>"); } } ``` We could sure get more clever but ...
27,368,404
Okay, so I have a `<tr>` table being built from a string that looks something like this: `13467` ``` 1= monday 2= tuesday ... 7= sunday so 13467 = mon,wed,thurs,sat,sun ``` My existing code manually checked the string, like so ``` if (breakfastDays.Contains("1")) { sb.Append("<td class=\"active\">&nbsp;</td...
2014/12/08
[ "https://Stackoverflow.com/questions/27368404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3296811/" ]
I would first see if you can get rid of individual variables for the day counters, that seems clunky and issue-prone. That, and reducing this to a simple loop, something like: ``` // Set up buckets for each day, with an initial count of 0 var dayMap = "1234567".ToDictionary(c => c, c => 0); // For each key ("day")......
This will fix the issue of having to write seven tests for the table: ``` for (int i = 1; i <= 7; i++) { if (breakfastDays.Contains(i.ToString()) { sb.Append("<td class=\"active\">&nbsp;</td>")); } else { sb.Append("<td>&nbsp;</td>"); } } ``` We could sure get more clever but ...
27,368,404
Okay, so I have a `<tr>` table being built from a string that looks something like this: `13467` ``` 1= monday 2= tuesday ... 7= sunday so 13467 = mon,wed,thurs,sat,sun ``` My existing code manually checked the string, like so ``` if (breakfastDays.Contains("1")) { sb.Append("<td class=\"active\">&nbsp;</td...
2014/12/08
[ "https://Stackoverflow.com/questions/27368404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3296811/" ]
Yes, you can use a loop. The only tricky thing is the variables that you increase, it would be easier if you used an array for that. ``` for (char c = '1'; c <= '7'; c++) { if (breakfastDays.Contains(c)) { sb.Append("<td class=\"active\">&nbsp;</td>"); switch (c) { case '1': mo++; break; case '2'...
I think that `mo` and `tu` are counts that keep count of the days of the week. A better way might be an array: ``` public static void Main() { int[] breakfastDays = new int[7]; string days = "13467"; var sb = new StringBuilder(); for (int i = 0; i < 7; i++) { if (days.Contains((i + 1).ToSt...
27,368,404
Okay, so I have a `<tr>` table being built from a string that looks something like this: `13467` ``` 1= monday 2= tuesday ... 7= sunday so 13467 = mon,wed,thurs,sat,sun ``` My existing code manually checked the string, like so ``` if (breakfastDays.Contains("1")) { sb.Append("<td class=\"active\">&nbsp;</td...
2014/12/08
[ "https://Stackoverflow.com/questions/27368404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3296811/" ]
Yes, you can use a loop. The only tricky thing is the variables that you increase, it would be easier if you used an array for that. ``` for (char c = '1'; c <= '7'; c++) { if (breakfastDays.Contains(c)) { sb.Append("<td class=\"active\">&nbsp;</td>"); switch (c) { case '1': mo++; break; case '2'...
I would first see if you can get rid of individual variables for the day counters, that seems clunky and issue-prone. That, and reducing this to a simple loop, something like: ``` // Set up buckets for each day, with an initial count of 0 var dayMap = "1234567".ToDictionary(c => c, c => 0); // For each key ("day")......
72,388,266
After login i setting user token to my user Secure storage. Like : ``` Future<AuthResponseModel?> login(AuthRequstModel model) async { try { Response response = await _dio.post(loginPath, data: model); if (response.statusCode == 200) { final AuthResponseModel authResponseModel = AuthResponseMod...
2022/05/26
[ "https://Stackoverflow.com/questions/72388266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15295971/" ]
I think token is not getting updated because `_dio` is already intitalized. Try to request for token when dio request is made like : ``` class ApiService { final _dio = Dio(); Future<Response?> get(String path) async { try { Response response = await _dio.get('${ApiConstants.BASE_URL}$path', options: Op...
your are getting instance because UserSecureStorage.getField("token") is future so you can get token when you put await keyword so try like this await UserSecureStorage.getField("token")
72,388,266
After login i setting user token to my user Secure storage. Like : ``` Future<AuthResponseModel?> login(AuthRequstModel model) async { try { Response response = await _dio.post(loginPath, data: model); if (response.statusCode == 200) { final AuthResponseModel authResponseModel = AuthResponseMod...
2022/05/26
[ "https://Stackoverflow.com/questions/72388266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15295971/" ]
Use `options` in [get](https://pub.dev/documentation/dio/latest/dio/Dio/get.html) method to add `headers` for a single request or [interceptors](https://pub.dev/packages/dio#interceptors) for all requests.
your are getting instance because UserSecureStorage.getField("token") is future so you can get token when you put await keyword so try like this await UserSecureStorage.getField("token")
72,388,266
After login i setting user token to my user Secure storage. Like : ``` Future<AuthResponseModel?> login(AuthRequstModel model) async { try { Response response = await _dio.post(loginPath, data: model); if (response.statusCode == 200) { final AuthResponseModel authResponseModel = AuthResponseMod...
2022/05/26
[ "https://Stackoverflow.com/questions/72388266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15295971/" ]
I think that it is not an issue easily solvable, I would try with two different methods, you can maintain the token in a state manager such as Provider so you don't have to rely on an async function to retrive it, but this of course add in the code the state manager structure that complicates thing a little. A bit mor...
your are getting instance because UserSecureStorage.getField("token") is future so you can get token when you put await keyword so try like this await UserSecureStorage.getField("token")
72,388,266
After login i setting user token to my user Secure storage. Like : ``` Future<AuthResponseModel?> login(AuthRequstModel model) async { try { Response response = await _dio.post(loginPath, data: model); if (response.statusCode == 200) { final AuthResponseModel authResponseModel = AuthResponseMod...
2022/05/26
[ "https://Stackoverflow.com/questions/72388266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15295971/" ]
I think token is not getting updated because `_dio` is already intitalized. Try to request for token when dio request is made like : ``` class ApiService { final _dio = Dio(); Future<Response?> get(String path) async { try { Response response = await _dio.get('${ApiConstants.BASE_URL}$path', options: Op...
Use `options` in [get](https://pub.dev/documentation/dio/latest/dio/Dio/get.html) method to add `headers` for a single request or [interceptors](https://pub.dev/packages/dio#interceptors) for all requests.
72,388,266
After login i setting user token to my user Secure storage. Like : ``` Future<AuthResponseModel?> login(AuthRequstModel model) async { try { Response response = await _dio.post(loginPath, data: model); if (response.statusCode == 200) { final AuthResponseModel authResponseModel = AuthResponseMod...
2022/05/26
[ "https://Stackoverflow.com/questions/72388266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15295971/" ]
I think token is not getting updated because `_dio` is already intitalized. Try to request for token when dio request is made like : ``` class ApiService { final _dio = Dio(); Future<Response?> get(String path) async { try { Response response = await _dio.get('${ApiConstants.BASE_URL}$path', options: Op...
I think that it is not an issue easily solvable, I would try with two different methods, you can maintain the token in a state manager such as Provider so you don't have to rely on an async function to retrive it, but this of course add in the code the state manager structure that complicates thing a little. A bit mor...
3,679
Great Saints are said to have lot of powers which come for their meditation. Like god Sai Baba removing out the intestines and cleaning them, and Sri Madvirat Pothuluri Veerabrahmendra Swamy telling the future etc. My question is, do they know **everything**? I mean, physics, chemistry, maths, computer science, future...
2014/11/11
[ "https://hinduism.stackexchange.com/questions/3679", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/312/" ]
**Here is one perspective about 'knowing everything' based on some scriptural statements:** I don't think the saints, mystics or bhaktas would know **everything** in the sense you have described. Only the Supreme Lord knows everything. The sages can know as much as He allows them to know for their service to Him. We s...
Great saints can know everything if they want to. The potential is there. When the word '*Sarvagyaata*' or Omniscient is used, it indicates a potency to know everything. Although, they choose not to intervene too much in the mundane aspects, unless required. > > "The avatar role-plays with deliberate and voluntary se...
3,679
Great Saints are said to have lot of powers which come for their meditation. Like god Sai Baba removing out the intestines and cleaning them, and Sri Madvirat Pothuluri Veerabrahmendra Swamy telling the future etc. My question is, do they know **everything**? I mean, physics, chemistry, maths, computer science, future...
2014/11/11
[ "https://hinduism.stackexchange.com/questions/3679", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/312/" ]
They do not know 'everything'. Swami Vivekananda said that a realized soul knows the essence of Reality; it does not mean that he knows every particular aspect of It's infinite manifestations. To know clay does not mean that you know every form of clay. To know Brahman is to know everything as One without a second - wi...
Great saints can know everything if they want to. The potential is there. When the word '*Sarvagyaata*' or Omniscient is used, it indicates a potency to know everything. Although, they choose not to intervene too much in the mundane aspects, unless required. > > "The avatar role-plays with deliberate and voluntary se...
541,036
I am trying to install Ubuntu 14.10 (also tried 14.04.1 LTS) on my 2009 Macbook Pro 5,2. I have installed rEFInd, I have made a bootable USB as instructed on the Ubuntu site. I can get to the grub screen. But when I select to either try Ubuntu or install it, I get an error saying `i8042: No Controller Found` and the pr...
2014/10/24
[ "https://askubuntu.com/questions/541036", "https://askubuntu.com", "https://askubuntu.com/users/341926/" ]
I managed to solve my problem by turning off disk encryption on the Mac OS X SSD. The solution was less than ideal, but I now have two hard drives in my Macbook Pro, an SSD with OS X Mavericks and an HDD with Ubuntu.
For anyone else having this problem, it seems like it might be caused by a display driver issue. This can be fixed by adding the 'nomodeset' parameter in the kernel settings on startup. This instructs the kernel to **not** load video settings during startup but leave it to the X driver when it loads. This means no beau...
127,952
I am using QGIS 2.6.0-Brighton and I am trying to add a custom field to my layer made from a shapefile of Italian provinces; everything seems fine when I create a categorized views using region codes, something like this: ![Italian provinces colored by region code](https://i.stack.imgur.com/UcUr4.png) then when I try...
2015/01/01
[ "https://gis.stackexchange.com/questions/127952", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/43506/" ]
It is because you are still in editing mode. What you are seeing are little red 'x' symbols over every vertex in your shapefile. Once you have finished with your edit, right-click your layer and click 'stop editing' and everything will be as it was.
You are in edit mode. Just click the pencil to save your new column and disable edit mode.
270,522
I'm trying to do some fields calculation to avoid creating a "limited" sequential loop but I'm facing a little problem. Pretty sure this can be done but I've yet to find the solution. Here is The problem: I have 3 different types of splines join together using a join geometry node (as test samples). What I need is to g...
2022/07/27
[ "https://blender.stackexchange.com/questions/270522", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/152244/" ]
i think what you are searching for is the node "field at index". Check out this node setup: [![enter image description here](https://i.stack.imgur.com/oVcxO.jpg)](https://i.stack.imgur.com/oVcxO.jpg) It sets the position of the cylinder to each control position of the splines. [![enter image description here](https...
As I understand it, you want to wrap the index per spline so that the first point gets the index of the last point. You can solve this as follows: [![enter image description here](https://i.stack.imgur.com/H0xUm.png)](https://i.stack.imgur.com/H0xUm.png) You would only have to use the math node `Wrap`, and use the n...
24,510,646
``` public static class People { List<string> names {get; set;} } public class Threading { public static async Task DoSomething() { var t1 = new Task1("bob"); var t2 = new Task1("erin"); await Task.WhenAll(t1,t2); } private static async Task Task1(string name) ...
2014/07/01
[ "https://Stackoverflow.com/questions/24510646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3233108/" ]
Okay so what I figured worked best for my case was I used a lock statement. ``` public class Class1 { private static Object thisLock = new Object(); private static async Task Task1(string name) { await Task.Run(() => { AddToList(name); } } private static AddToList(string name)...
for a simple case like this the easiest way to get thread-safety is using the `lock` statement: ``` public static class People { static List<string> _names = new List<string>(); public static void AddName(string name) { lock (_names) { _names.Add(name); } } public static IEnumerable<...
32,900,305
I'm having some issues with this, I keep getting: `AttributeError: 'int' object has no attribute 'encode'` When I run it. I thought UTF-8 would be the go to for this. Subscribers will only ever return numbers, or NoneTypes. Any help would be greatly appreciated. ``` import urllib2,time,csv,json,requests,urlparse...
2015/10/02
[ "https://Stackoverflow.com/questions/32900305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3950855/" ]
because one of these ``` [userID,titleResponse,facebooksubscribers,instagramsubscribers,vinesubscribers]‌ ``` element is int and you can't perform encode operation on int. You may want to do the type casting in your for loop. Replace ``` row = [s.encode('utf-8') for s in [userID,titleResponse,facebooksubscribers,...
I had a similar issue when loading data from an xlsx file. The problem I ran into after implementing the solutions above was that I would receive the error: ``` AttributeError: 'int' object has no attribute 'encode' ``` since the data I was parsing was not just unicode. The solution I found was a simple try/except w...
32,900,305
I'm having some issues with this, I keep getting: `AttributeError: 'int' object has no attribute 'encode'` When I run it. I thought UTF-8 would be the go to for this. Subscribers will only ever return numbers, or NoneTypes. Any help would be greatly appreciated. ``` import urllib2,time,csv,json,requests,urlparse...
2015/10/02
[ "https://Stackoverflow.com/questions/32900305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3950855/" ]
Use this : ``` repr(s).encode('utf-8') ``` instead of : ``` s.encode('utf-8') ```
I had a similar issue when loading data from an xlsx file. The problem I ran into after implementing the solutions above was that I would receive the error: ``` AttributeError: 'int' object has no attribute 'encode' ``` since the data I was parsing was not just unicode. The solution I found was a simple try/except w...
62,219,409
We are looking to access an external vendor's Redshift data. We are on the same platform (AWS). What is the best approach? Is it possible to directly connect to their Redshift instance as opposed to copy data from their Redshift database to an S3 bucket in our account?
2020/06/05
[ "https://Stackoverflow.com/questions/62219409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5236758/" ]
I have solved your same problem changing the user database password with a password like name.number in the database access in the security section. Then copying that password in the MongoURI
in your database URI You got to replace with username that you created on mongodb Atlas same goes with the and . For example if your credentials are:- username: jonDoe, password: test@abcd, database name: myBlogs mongodb://jonDoe:test@abcd@xxxx-uaglu.mongodb.net/myBlogs?retryWrites=true&w=majority.
10,115,460
I'm writing a tic tac toe program and i have the board set up, and the game works for the majority. determining who wins. what i am trying to do right now is after a winner is determined, a message box pops up and says who ever wins. I would like the message box to contain two buttons. One button with the text, "Ok for...
2012/04/11
[ "https://Stackoverflow.com/questions/10115460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239062/" ]
The easiest way to do that is by creating a new `Form` that functions as a `MessageBox`. There are many `API` to customized the `MessageBox` but gives you extra time. So this is what you are going to do. * Create a new Form * Set MaximizeButton, MinimizeButton and ShowOnTitleBar to `False` * Set `FormBorderStyle` to F...
Why don't you try this : ``` If Msgbox("Your text here") <> MsgboxResult.Yes then Exit Else Your code there to continue the game. End if ``` Hope this helps.
10,115,460
I'm writing a tic tac toe program and i have the board set up, and the game works for the majority. determining who wins. what i am trying to do right now is after a winner is determined, a message box pops up and says who ever wins. I would like the message box to contain two buttons. One button with the text, "Ok for...
2012/04/11
[ "https://Stackoverflow.com/questions/10115460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239062/" ]
The easiest way to do that is by creating a new `Form` that functions as a `MessageBox`. There are many `API` to customized the `MessageBox` but gives you extra time. So this is what you are going to do. * Create a new Form * Set MaximizeButton, MinimizeButton and ShowOnTitleBar to `False` * Set `FormBorderStyle` to F...
Try this ``` Select Case msgbox("You Win! Do you want to play another game?",vbYesNo) case vbYes 'add code to start a new game case vbNo 'add code to exit your app Unload Me End Select ```
10,115,460
I'm writing a tic tac toe program and i have the board set up, and the game works for the majority. determining who wins. what i am trying to do right now is after a winner is determined, a message box pops up and says who ever wins. I would like the message box to contain two buttons. One button with the text, "Ok for...
2012/04/11
[ "https://Stackoverflow.com/questions/10115460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1239062/" ]
Why don't you try this : ``` If Msgbox("Your text here") <> MsgboxResult.Yes then Exit Else Your code there to continue the game. End if ``` Hope this helps.
Try this ``` Select Case msgbox("You Win! Do you want to play another game?",vbYesNo) case vbYes 'add code to start a new game case vbNo 'add code to exit your app Unload Me End Select ```
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
Sounds like [Partimage](http://www.partimage.org/) might be what you are looking for?
+1 Partimage . The [system rescue CD](http://www.sysresccd.org) might help if you just want to save something. Plug in a removable drive and/or a network mount once it has booted and write the image to disk. If you're trying to image an entire drive for transport, don't forget to save the partition table (and the boo...
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
Sounds like [Partimage](http://www.partimage.org/) might be what you are looking for?
If you're using LVM, clonezilla is the way to go.
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
Sounds like [Partimage](http://www.partimage.org/) might be what you are looking for?
I use partimage for get image also this program worke with command. If you get image by bash script you work with this and `dumpe2fs` or `xfsdump` commands.
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
One option would be to create the file system image as a [**sparse file**](http://en.wikipedia.org/wiki/Sparse_file). You could first run an utility such as [zerofree](https://frippery.org/uml/) on your ext3 file system to make sure all free blocks are filled with zeros, and then just image the disk with `dd` and pipe ...
+1 Partimage . The [system rescue CD](http://www.sysresccd.org) might help if you just want to save something. Plug in a removable drive and/or a network mount once it has booted and write the image to disk. If you're trying to image an entire drive for transport, don't forget to save the partition table (and the boo...
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
One option would be to create the file system image as a [**sparse file**](http://en.wikipedia.org/wiki/Sparse_file). You could first run an utility such as [zerofree](https://frippery.org/uml/) on your ext3 file system to make sure all free blocks are filled with zeros, and then just image the disk with `dd` and pipe ...
If you're using LVM, clonezilla is the way to go.
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
One option would be to create the file system image as a [**sparse file**](http://en.wikipedia.org/wiki/Sparse_file). You could first run an utility such as [zerofree](https://frippery.org/uml/) on your ext3 file system to make sure all free blocks are filled with zeros, and then just image the disk with `dd` and pipe ...
I use partimage for get image also this program worke with command. If you get image by bash script you work with this and `dumpe2fs` or `xfsdump` commands.
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
If you're using LVM, clonezilla is the way to go.
+1 Partimage . The [system rescue CD](http://www.sysresccd.org) might help if you just want to save something. Plug in a removable drive and/or a network mount once it has booted and write the image to disk. If you're trying to image an entire drive for transport, don't forget to save the partition table (and the boo...
93,667
I want to create image from hard disk without free space (useless space) in linux(ex3 type). I've been tried to create image with **dd** command but this command gave us total size of hard disk. I need data on this hard disk without free space. thanks a lot.
2009/12/12
[ "https://serverfault.com/questions/93667", "https://serverfault.com", "https://serverfault.com/users/24098/" ]
If you're using LVM, clonezilla is the way to go.
I use partimage for get image also this program worke with command. If you get image by bash script you work with this and `dumpe2fs` or `xfsdump` commands.
50,954,913
Or in other words, how do i know when a action that's dispatched is complete? I have a webapp where I'd update the redux store through dispatches on user input. If i push the redux store's state to the server right after dispatching, the server does not have the most updated info. I need to wait for the action to comp...
2018/06/20
[ "https://Stackoverflow.com/questions/50954913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2017263/" ]
A little late to the question, but for the people who got here based on the question title - take a look into: ``` store.subscribe() store.getState() ``` where 'store' is a reference to your redux store. ``` store.subscribe(() => { const newState = store.getState(); // check out your updated state }); ```...
Dispatching is entirely synchronous, unless altered by a middleware. So, as soon as the call to `dispatch()` returns, the store state has been updated and all subscribers have been notified. If you need to wait for some async behavior to complete, you can write a thunk that returns a promise, and chain off that when y...
62,091,545
My application worked well when I run it through Android Studio but it crashes when I download it from Google Play store. It used to work well but suddenly this happened without changing anything this is the google play crash log: ``` java.lang.NoClassDefFoundError: at net.sourceforge.jtds.jdbc.Support.ca...
2020/05/29
[ "https://Stackoverflow.com/questions/62091545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9110092/" ]
Assuming you know what you are doing, yes, it is possible to set values with programmatic names in a class body, and retrieve then, and have these values restricted to that class body. All you have to do is to use the`locals()` call to get the namespace dictionary, and use that dictionary to hold your values: ```py c...
These two independent classes don't reference each other, so as long as you don't pass the same object to both, then neither will 'pollute' the other. To set a value and get a value on an object, you could use something like this: ``` class A: def __init__(self): self.letter = None def set_value(self, ...
2,290,333
How can I show that the subspace $\{x\in \ell\_2 \mid \sum\_{n=1} ^\infty x\_n \frac 1{\sqrt n}=0\}$ is dense in $\ell\_2$? Can it be done with "simple" tools just by using the definition of a dense subspace? or can it be done by using the fact that $\ell\_2$ is a Hilbert space?
2017/05/21
[ "https://math.stackexchange.com/questions/2290333", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242903/" ]
If $f$ has a rational root, then it is an integer factor of $p$, so is $\pm1$ or $\pm p$. Each of these can be swiftly disposed of. There is also the possibility of $f$ factoring into two quadratic polynomials. This factorisation will have the form $(x^2+ax+1)(x^2-ax+p)$ or $(x^2+ax-1)(x^2-ax-p)$. I'll leave it to you...
Split the problem into two cases: $p = 2$ and $p \neq 2$. If $p = 2$, consider reduction modulo $3$. If $p \neq 2$, consider reduction modulo $2$. In both cases, it's easy to check that the polynomial has no roots over the finite field, but the possibility remains that the polynomial can factor into a product of two...
2,290,333
How can I show that the subspace $\{x\in \ell\_2 \mid \sum\_{n=1} ^\infty x\_n \frac 1{\sqrt n}=0\}$ is dense in $\ell\_2$? Can it be done with "simple" tools just by using the definition of a dense subspace? or can it be done by using the fact that $\ell\_2$ is a Hilbert space?
2017/05/21
[ "https://math.stackexchange.com/questions/2290333", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242903/" ]
A linear factor $x-a$ would require $a\mid p$, i.e., $a\in\{-p,-1,1,p\}$, and none of these is a root: $f(-p)=p^4\ne 0$, $f(-1)=p\ne 0$, $f(1)=p+2\ne 0$, $f(p)=p^4+2p\ne 0$. Remains the case of two quadratic factors $$f(x)=(x^2+ax+b)(x^2+cx+d).$$ Then $bd=p$ (constant term), $a+c=0$ (cubic term), $ad+bc=1$ (linear term...
Split the problem into two cases: $p = 2$ and $p \neq 2$. If $p = 2$, consider reduction modulo $3$. If $p \neq 2$, consider reduction modulo $2$. In both cases, it's easy to check that the polynomial has no roots over the finite field, but the possibility remains that the polynomial can factor into a product of two...
28,264,252
I'm working on an f# solution to [this problem](https://projecteuler.net/problem=14) where I need to find the generator element above 1,000,000 with the longest generated sequence I use a tail-recursive function that memoizes the previous results to speed up the calculation. This is my current implementation. ``` let ...
2015/02/01
[ "https://Stackoverflow.com/questions/28264252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1387761/" ]
I think the underlying question may have been *How to combine a memoizing function with a potentially costly calculating function that takes more than one argument?*. In this case, that second argument isn't needed. There's nothing inherently wrong with memoizing 2168612 elements (the size of the dictionary after the c...
You're on the right track, but there's one thing very wrong in how you implement your memoization. Your memoize function takes a function of one argument and returns a memoized version of it. When you use it in `memSequence` however, you give it a curried, two argument function. What then happens is that the memoize ...
29,732,990
I am trying to install mono package onto a Docker container, but mono requires git , autoconf, libtool, automake, build-essential , mono-devel, gettext packages. the problem I am having is that libtool requires libc-dev, and libc-dev requires gcc compiler. The docker container does not have any compiler installed, ...
2015/04/19
[ "https://Stackoverflow.com/questions/29732990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3196127/" ]
In your Dockerfile: ``` FROM ubuntu # ... ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \ apt-get -y install gcc mono-mcs && \ rm -rf /var/lib/apt/lists/* ```
As I understand it, the OP has confused the terminology, and probably meant to ask: > > installing a GCC compiler onto a Docker *image* > > > My answer starts by addressing the title of the question (regarding *containers*), then moves on to the intent of the question (regarding *images*). If you can run a BASH ...
29,732,990
I am trying to install mono package onto a Docker container, but mono requires git , autoconf, libtool, automake, build-essential , mono-devel, gettext packages. the problem I am having is that libtool requires libc-dev, and libc-dev requires gcc compiler. The docker container does not have any compiler installed, ...
2015/04/19
[ "https://Stackoverflow.com/questions/29732990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3196127/" ]
In your Dockerfile: ``` FROM ubuntu # ... ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \ apt-get -y install gcc mono-mcs && \ rm -rf /var/lib/apt/lists/* ```
You could also grab an official image that already has GCC and/or some/most of the tools you need already installed. The docker store has a lot of official images already setup: <https://store.docker.com/search?page_size=99&q=&source=verified> I'm not sure if it's the right mono, but they have a mono image: <https://s...
29,732,990
I am trying to install mono package onto a Docker container, but mono requires git , autoconf, libtool, automake, build-essential , mono-devel, gettext packages. the problem I am having is that libtool requires libc-dev, and libc-dev requires gcc compiler. The docker container does not have any compiler installed, ...
2015/04/19
[ "https://Stackoverflow.com/questions/29732990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3196127/" ]
As I understand it, the OP has confused the terminology, and probably meant to ask: > > installing a GCC compiler onto a Docker *image* > > > My answer starts by addressing the title of the question (regarding *containers*), then moves on to the intent of the question (regarding *images*). If you can run a BASH ...
You could also grab an official image that already has GCC and/or some/most of the tools you need already installed. The docker store has a lot of official images already setup: <https://store.docker.com/search?page_size=99&q=&source=verified> I'm not sure if it's the right mono, but they have a mono image: <https://s...
18,902
What does a *dry* sense of humor mean? [This article](http://www.ehow.com/how_2151193_develop-dry-sense-humor.html#ixzz1IGUHd0GX) explains how to develop it, but not what it is. > > **How to Develop a Dry Sense of Humor** > > > Developing a dry sense of > humor can be challenging and fun. > Learn how to develo...
2011/04/01
[ "https://english.stackexchange.com/questions/18902", "https://english.stackexchange.com", "https://english.stackexchange.com/users/740/" ]
Here is a relevant definition that says it all: > > **dry** *adjective* > > (of a joke or sense of humor) subtle, expressed in a matter-of-fact way, and having the appearance of being unconscious or unintentional: > > *he delighted his friends with a dry, covert sense of humor* > > > [NOAD](http://oxforddict...
It should mean being sarcastic and ironic. Check my answer here: [The word ‘dryly’ as an adverb](https://english.stackexchange.com/questions/18840/the-word-dry-as-an-adverb)
18,902
What does a *dry* sense of humor mean? [This article](http://www.ehow.com/how_2151193_develop-dry-sense-humor.html#ixzz1IGUHd0GX) explains how to develop it, but not what it is. > > **How to Develop a Dry Sense of Humor** > > > Developing a dry sense of > humor can be challenging and fun. > Learn how to develo...
2011/04/01
[ "https://english.stackexchange.com/questions/18902", "https://english.stackexchange.com", "https://english.stackexchange.com/users/740/" ]
Here is a relevant definition that says it all: > > **dry** *adjective* > > (of a joke or sense of humor) subtle, expressed in a matter-of-fact way, and having the appearance of being unconscious or unintentional: > > *he delighted his friends with a dry, covert sense of humor* > > > [NOAD](http://oxforddict...
The article itself is an example of dry humor.
566,888
So I conducted a though experiment where I take a hollow spherical conductor and beef it up with a lot of electric charge. Here, I have ignored the ionization of air due to that huge amount of charge. Okay, coming to the point, is it possible that the hollow conductor, which is made of a certain metal and let's say if ...
2020/07/20
[ "https://physics.stackexchange.com/questions/566888", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/269573/" ]
No! Uniform motion is motion in which velocity is constant and acceleration is 0. Uniform acceleration : Motion in which acceleration is constant , therefore velocity is increasing or decreasing or even just the direction is changing for example a uniform circular motion **Note:** Every uniform motion is having unif...
No, uniform motion implies constant speed, whereas uniform acceleration means constant acceleration.
365,128
With a list of thousands of words and a small list of letters I am trying to find the least amount of words to make use of all given letters, assuming my dictionary of words covers all letters. The first step is obviously to remove all words with none of the letters. Then I approached this by calculating the relative...
2018/02/01
[ "https://softwareengineering.stackexchange.com/questions/365128", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/60437/" ]
While there may be a more ideal solution out there than this, I think it will get you closer. Right now your algorithm is rating words that have "rare" letters as more important than overall coverage for the list of letters. Probably the best way of reducing the number of words you use will be to pick words that contai...
I would pre-process each word in the dictionary to map the word to its list of unique letters. Then just look for the map entry with your desired letters. In a perl one-liner: ``` perl -MList::Util=uniq -slne ' ($word = $_) =~ s/\W//g; # remove punctuation, etc $key = join "", uniq sort split //, lc $word...
365,128
With a list of thousands of words and a small list of letters I am trying to find the least amount of words to make use of all given letters, assuming my dictionary of words covers all letters. The first step is obviously to remove all words with none of the letters. Then I approached this by calculating the relative...
2018/02/01
[ "https://softwareengineering.stackexchange.com/questions/365128", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/60437/" ]
While there may be a more ideal solution out there than this, I think it will get you closer. Right now your algorithm is rating words that have "rare" letters as more important than overall coverage for the list of letters. Probably the best way of reducing the number of words you use will be to pick words that contai...
If you throw out all the uninteresting letters and words, then reduce each word to the subset of interesting letters contained, you have a [Set cover problem](https://en.wikipedia.org/wiki/Set_cover_problem). This is NP-complete. If you don't want to do an exhaustive search, the best you can do is repeatedly take the w...
365,128
With a list of thousands of words and a small list of letters I am trying to find the least amount of words to make use of all given letters, assuming my dictionary of words covers all letters. The first step is obviously to remove all words with none of the letters. Then I approached this by calculating the relative...
2018/02/01
[ "https://softwareengineering.stackexchange.com/questions/365128", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/60437/" ]
If you throw out all the uninteresting letters and words, then reduce each word to the subset of interesting letters contained, you have a [Set cover problem](https://en.wikipedia.org/wiki/Set_cover_problem). This is NP-complete. If you don't want to do an exhaustive search, the best you can do is repeatedly take the w...
I would pre-process each word in the dictionary to map the word to its list of unique letters. Then just look for the map entry with your desired letters. In a perl one-liner: ``` perl -MList::Util=uniq -slne ' ($word = $_) =~ s/\W//g; # remove punctuation, etc $key = join "", uniq sort split //, lc $word...
27,735,780
Happy new year!:) I'm fairly new to PHP and i'm trying to write a function to get the childs of the parent categories, and re use that function again to get the childs of childs categories. However, it is not working as I was hoping, and I can't really figure out why. I hope you have a minute to help me out here. T...
2015/01/01
[ "https://Stackoverflow.com/questions/27735780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4338708/" ]
You're using `$_POST['e-mail']`. `e-mail` is the ID of the `<input>` tag. You should be using `$_POST['email']` because `name="email"`.
According to your form this: ``` $email = $_POST['e-mail']; ``` Should be this: ``` $email = $_POST['email']; ``` You have `e-mail` as the `id` not the `name`. The php looks at `name` and not `id`
9,877,333
Reading [this page](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html), it says: > > ...the URI in a PUT request identifies the entity enclosed with the request -- the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. > > > From this I gather th...
2012/03/26
[ "https://Stackoverflow.com/questions/9877333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/789683/" ]
PUT should only be used when the client knows for sure the resulting resource that should contain the entity after the request completes. If you are simply collecting data from clients, then likely you should be using POST instead.
That is why in REST semantics, the PUT is used for updates and to create any resource you are supposed to be using POST.
146,773
I don't mean the plans, pictures, etc., I mean the actual thing. **Had she actually seen it with her own eyes before she was taken on board as a prisoner?**
2016/12/07
[ "https://scifi.stackexchange.com/questions/146773", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/70161/" ]
**No.** According to the new (and fully canon) ANH novelisation, Leia hadn't seen the Death Star before. When she collected the plans in orbit of Scarif, her ship was apparently isolated in the hold of a larger Rebel capital ship which could explain why she didn't see it. These are her thoughts as she first arrived at...
I've just came back from the Rogue One, and this contradicts previous information. It wasn't clearly said but it seemed that Leia never saw the Death Star or its destructive power before. Leia is on the Tantive IV (as in the beginning of Episode IV) during the final battle on Scarif, which was docked to the command sh...
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
Perhaps "To illustrate this, I will...", "Demonstrating this, I will..." or "As an example,.."
Is the sentence in question immediately followed by the character actually performing the demonstration? In that case: "Observe." (Does thing). However, the whole thought "in order to demonstrate this, I will..." might be completely unnecessary. If the character already talked about the thing, just having them do t...
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
Perhaps "To illustrate this, I will...", "Demonstrating this, I will..." or "As an example,.."
Is it appropriate to use "Therefore"?
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
Perhaps "To illustrate this, I will...", "Demonstrating this, I will..." or "As an example,.."
"I'll show this (is true, is so, isn't so) by. . .
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
I would sometimes use "to this end", however that is also more a general term. Something like: "We wish to show that space whales are secretly communicating with us. To this end, we will monitor the frequencies determined to be most likely to carry space whale song."
Is the sentence in question immediately followed by the character actually performing the demonstration? In that case: "Observe." (Does thing). However, the whole thought "in order to demonstrate this, I will..." might be completely unnecessary. If the character already talked about the thing, just having them do t...
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
I would sometimes use "to this end", however that is also more a general term. Something like: "We wish to show that space whales are secretly communicating with us. To this end, we will monitor the frequencies determined to be most likely to carry space whale song."
Is it appropriate to use "Therefore"?
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
I would sometimes use "to this end", however that is also more a general term. Something like: "We wish to show that space whales are secretly communicating with us. To this end, we will monitor the frequencies determined to be most likely to carry space whale song."
"I'll show this (is true, is so, isn't so) by. . .
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
Is the sentence in question immediately followed by the character actually performing the demonstration? In that case: "Observe." (Does thing). However, the whole thought "in order to demonstrate this, I will..." might be completely unnecessary. If the character already talked about the thing, just having them do t...
Is it appropriate to use "Therefore"?
214,914
What is a better way of saying "in order to demonstrate this, I will..."? I already use "to that effect" in the same paragraph. I'm looking for something as compact and concise as "to that effect" that will also be a good transition for the beginning of a new paragraph.
2014/12/14
[ "https://english.stackexchange.com/questions/214914", "https://english.stackexchange.com", "https://english.stackexchange.com/users/-1/" ]
Is the sentence in question immediately followed by the character actually performing the demonstration? In that case: "Observe." (Does thing). However, the whole thought "in order to demonstrate this, I will..." might be completely unnecessary. If the character already talked about the thing, just having them do t...
"I'll show this (is true, is so, isn't so) by. . .
46,532,273
Hey guys I been reading about pointers, structs and data structures in C over the last couple of days. Now I am trying to implement a Hash Table in C by following along this tutorial: <https://www.tutorialspoint.com/data_structures_algorithms/hash_table_program_in_c.htm> However tutorialspoint is assuming there will o...
2017/10/02
[ "https://Stackoverflow.com/questions/46532273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8545938/" ]
You could try below ``` select bx.id, recieved, sum(c.sent) sent from ( SELECT a.id, sum(b.received) recieved from a INNER JOIN b ON a.id=b.uid group by a.id ) bx INNER JOIN c ON c.uid=bx.id group by bx.id, bx.recieved; ``` **[>>>Demo<<<](http://sqlfiddle.com/#!4/4dea9/10)**
This gets rid of the subquery, but introduces something else you might not want: ``` ( SELECT uid, 'Received' AS direction, SUM(received) AS HowMany WHERE uid = 1 GROUP BY uid ) UNION ALL ( SELECT uid, 'Sent' AS direction, SUM(sent) AS HowMany WHERE uid = 1 GROUP BY uid ) ```
46,532,273
Hey guys I been reading about pointers, structs and data structures in C over the last couple of days. Now I am trying to implement a Hash Table in C by following along this tutorial: <https://www.tutorialspoint.com/data_structures_algorithms/hash_table_program_in_c.htm> However tutorialspoint is assuming there will o...
2017/10/02
[ "https://Stackoverflow.com/questions/46532273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8545938/" ]
You should join the aggregated result and not the raw tables ``` select a.uid, t1.received, t2.sent from a inner join ( select uid, sum(received) received from b group by uid ) t1 on t1.uid = a.id inner join ( select uid, sum(sent) sent from c group by uid ) t2 on t2.uid = a.id wher...
This gets rid of the subquery, but introduces something else you might not want: ``` ( SELECT uid, 'Received' AS direction, SUM(received) AS HowMany WHERE uid = 1 GROUP BY uid ) UNION ALL ( SELECT uid, 'Sent' AS direction, SUM(sent) AS HowMany WHERE uid = 1 GROUP BY uid ) ```
710,750
I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points; for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$. I can only guess that the curve is upwards and that I may create the system: $$ y\_1 = ax^2\_1 + bx\_1 + c\\ y\_2 = ax^2\_2 + bx\_2 + c\\ y\_3 = ax^2\_3 + bx\_3 ...
2014/03/13
[ "https://math.stackexchange.com/questions/710750", "https://math.stackexchange.com", "https://math.stackexchange.com/users/99172/" ]
Each of the points (1,3), (-1,-5) and (-2,12) satisfies the equation $y = ax^2 + bx + c$ for some unknown a,b,c. The task is to find a,b and c. Start by substituting each of the points into the equation, we have $$ \begin{align} 3 &= a(1)^2 + b(1) + c \\ -5 &= a(-1)^2 + b(-1) + c \\ 12 &= a(-2)^2 + b(-2) + c \end{alig...
The matrix you are about to build is a [Vandermonde Matrix](http://en.wikipedia.org/wiki/Vandermonde_matrix): $$ \vec y = \pmatrix{1&x\_1&x\_1^2\\1&x\_2&x\_2^2\\1&x\_3&x\_3^2\\}\pmatrix{c\\b\\a} $$ *A square Vandermonde matrix is thus invertible if and only if the $x\_i$ are distinct; an explicit formula for the inver...
710,750
I am having trouble calculating the quadratic curve $f(x)$ that goes through 3 points; for example a curve that goes through $A(1,3), B(-1,-5), and C(-2,12)$. I can only guess that the curve is upwards and that I may create the system: $$ y\_1 = ax^2\_1 + bx\_1 + c\\ y\_2 = ax^2\_2 + bx\_2 + c\\ y\_3 = ax^2\_3 + bx\_3 ...
2014/03/13
[ "https://math.stackexchange.com/questions/710750", "https://math.stackexchange.com", "https://math.stackexchange.com/users/99172/" ]
The matrix you are about to build is a [Vandermonde Matrix](http://en.wikipedia.org/wiki/Vandermonde_matrix): $$ \vec y = \pmatrix{1&x\_1&x\_1^2\\1&x\_2&x\_2^2\\1&x\_3&x\_3^2\\}\pmatrix{c\\b\\a} $$ *A square Vandermonde matrix is thus invertible if and only if the $x\_i$ are distinct; an explicit formula for the inver...
$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle #1 \right\rangle} \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace} \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcom...