qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
45,085,512
Is the contract handling code essentially just Java and run by the server ?. If I want to edit a contract's functionality do I have to release code to be installed across the network ?.
2017/07/13
[ "https://Stackoverflow.com/questions/45085512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3062416/" ]
Great question. The Corda technical whitepaper talks about this. See e.g. section 5.9: <https://docs.corda.net/_static/corda-technical-whitepaper.pdf> The short answer is that some of this infrastructure still needs to be built out but the key idea is that a State doesn't just say "the Java class with this name govern...
As Richard notes, states reference contracts. Indeed, there is a `contract` property in the base `ContractState` interface: ``` @CordaSerializable interface ContractState { val contract: Contract val participants: List<AbstractParty> } ``` A Corda transaction is required to change any state property. Therefo...
67,610,393
I'm trying to use Microsoft's client side validation along with a Content Security Policy In my ASP Net Core (v3.1) razor view I have the following: ``` <div asp-validation-summary="All" class="text-danger"></div> ``` When the page is first rendered, I get a list item with no text, just the red dot. The HTML has b...
2021/05/19
[ "https://Stackoverflow.com/questions/67610393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/704668/" ]
> > Can anyone suggest a fix for Safari > > > Safari does [not support 'unsafe-hashes'](https://csplite.com/csp/test296/#bug_Safari_unsafe-hashes) nor for `style-src` nor for `script-src`. Currently there is only one way of use 'unsafe-hashes': style-src 'unsafe-inline'; style-src-attr 'unsafe-hashes' 'sha256-aqN...
This is a known issue. [aspnetcore/issues/43714](https://github.com/dotnet/aspnetcore/issues/43714) The Tag Helper asp-validation-summary="All" renders this: ``` <div class="text-danger validation-summary-valid" data-valmsg-summary="true"> <ul> <li style="display:none"> @*CSP problem*@ </li> <...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
I see some reasons for throw in a switch statement. 1st: not instead of a break but as the body of the `default` case. Consider the following example where a switch is defined on an enumeration: ``` pubic enum E { A, B } ``` The switch as of the time as it is first written looks like: ``` E e = ...; switch (e)...
throw Can not be used instead of break in a switch statement. because throw is just used for exceptions while switch is used for conditional purposes...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
There are two cases in which you could use a `throw` to interrupt the flow of a switch: 1. **Flow Control**; in general, this is a *bad* practice - you don't want exceptional behavior deciding where your program decides to go next. 2. **Unlikely-but-plausible default case**; in case you hit a condition in which reachi...
I see some reasons for throw in a switch statement. 1st: not instead of a break but as the body of the `default` case. Consider the following example where a switch is defined on an enumeration: ``` pubic enum E { A, B } ``` The switch as of the time as it is first written looks like: ``` E e = ...; switch (e)...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
break is used to prevent falling thru to the next case, when you throw an exception there will be no falling thru ``` case 1: throw new UnsupportedOperationException(); break; <-- compile error, unreachable code ``` It typically makes sense to throw an exception in otherwise clause ``` swi...
There are few problems using throw instead of break; 1)when you throw some Exception the execution of rest of the function stops. ie: ``` int m=0; switch (m) { case 0: y=10; break; case 2: y=11; break; default: break; } System.out.println(y);//this y wi...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
There are two cases in which you could use a `throw` to interrupt the flow of a switch: 1. **Flow Control**; in general, this is a *bad* practice - you don't want exceptional behavior deciding where your program decides to go next. 2. **Unlikely-but-plausible default case**; in case you hit a condition in which reachi...
You can use `throw` in `switch` block but its not good coding/design practice. `throw` is meant to control exceptional/error situation in code not for controlling execution of instructions. Eventhough you can use `throw` in `switch` , I would recommded not to use it in `switch`. :)
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
You are talking about only one scenario, where you need to throw the exception. switch is designed to run a case and break it. If it is in a method and if you only use throw then how will you return a value from that method? In simple terms throw will return the method but break will not. You can continue running your ...
throw Can not be used instead of break in a switch statement. because throw is just used for exceptions while switch is used for conditional purposes...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
There are two cases in which you could use a `throw` to interrupt the flow of a switch: 1. **Flow Control**; in general, this is a *bad* practice - you don't want exceptional behavior deciding where your program decides to go next. 2. **Unlikely-but-plausible default case**; in case you hit a condition in which reachi...
You are talking about only one scenario, where you need to throw the exception. switch is designed to run a case and break it. If it is in a method and if you only use throw then how will you return a value from that method? In simple terms throw will return the method but break will not. You can continue running your ...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
You can use `throw` in `switch` block but its not good coding/design practice. `throw` is meant to control exceptional/error situation in code not for controlling execution of instructions. Eventhough you can use `throw` in `switch` , I would recommded not to use it in `switch`. :)
There are few problems using throw instead of break; 1)when you throw some Exception the execution of rest of the function stops. ie: ``` int m=0; switch (m) { case 0: y=10; break; case 2: y=11; break; default: break; } System.out.println(y);//this y wi...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
You can use `throw` in `switch` block but its not good coding/design practice. `throw` is meant to control exceptional/error situation in code not for controlling execution of instructions. Eventhough you can use `throw` in `switch` , I would recommded not to use it in `switch`. :)
throw Can not be used instead of break in a switch statement. because throw is just used for exceptions while switch is used for conditional purposes...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
I see some reasons for throw in a switch statement. 1st: not instead of a break but as the body of the `default` case. Consider the following example where a switch is defined on an enumeration: ``` pubic enum E { A, B } ``` The switch as of the time as it is first written looks like: ``` E e = ...; switch (e)...
You are talking about only one scenario, where you need to throw the exception. switch is designed to run a case and break it. If it is in a method and if you only use throw then how will you return a value from that method? In simple terms throw will return the method but break will not. You can continue running your ...
16,579,588
My site keeps getting viruses. Webmaster tools always points to the Jquery [Isotope plugin](http://isotope.metafizzy.co/) I downloaded (and paid for). Whenever I remove it, and download it again the site works, but a week down the track it gets black listed again. To remedy this I have linked directly to the same sour...
2013/05/16
[ "https://Stackoverflow.com/questions/16579588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1433268/" ]
I see some reasons for throw in a switch statement. 1st: not instead of a break but as the body of the `default` case. Consider the following example where a switch is defined on an enumeration: ``` pubic enum E { A, B } ``` The switch as of the time as it is first written looks like: ``` E e = ...; switch (e)...
You can use `throw` in `switch` block but its not good coding/design practice. `throw` is meant to control exceptional/error situation in code not for controlling execution of instructions. Eventhough you can use `throw` in `switch` , I would recommded not to use it in `switch`. :)
159,496
We've got a setup that we're using for different clients : a program connecting to a Firebird server on a local network. So far we mostly used 32bit processors running Ubuntu LTS (recently upgraded to 10.04). Now we introduced servers running on 64bit processors, running Ubuntu 10.04 64bit. Suddenly some queries run...
2010/07/12
[ "https://serverfault.com/questions/159496", "https://serverfault.com", "https://serverfault.com/users/37714/" ]
Not sure why this problem occurs, though it is only for certain clients so it could depend on how a web host handles "A" records. In any event, I added the following line to a vHost file for one of my clients: ServerAlias subdomain.clientsite.tld \*.subdomain.clientsite.tld and it seemed to do the trick. Got the id...
I can see how a client might have an A record of the form: subdomain.example.com. 251 IN A 10.9.8.7 I don't see why www.subdomain.example.com automatically resolves to the same IP, unless you have a CNAME for each subdomain. But then you say that anything.subdomain.example.com behaves this way, so I don't understand ...
67,908,133
If I have a function with argument (...) and want to check if a variable is defined in the argument. How can I do this? I have already looked at the solution provided at this link: [How to check if object (variable) is defined in R?](https://stackoverflow.com/questions/9368900/how-to-check-if-object-variable-is-defined...
2021/06/09
[ "https://Stackoverflow.com/questions/67908133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6361159/" ]
Does this suffice? ``` # Define a function for remaining scenarios f = function(...){"a" %in% names(list(...))} # Scenario 3 f() # [1] FALSE # Scenario 4 a <- 10 f() # [1] FALSE # Scenario 5 f(a = 5) # [1] FALSE f(a = 5) [1] TRUE ```
Generally you use `...` when you are passing parameters to other functions, not when you are using them in the function itself. It also makes a difference if you want to evaluate the parameter value or if you want to leave it unevaulated. If you need the latter, then you can do something like ``` f = function(...) { ...
21,737,294
I made two compressed copy of my folder, first by using the command `tar czf dir.tar.gz dir` This gives me an archive of size ~16kb. Then I tried another method, first i gunzipped all files inside the dir and then used ``` gzip ./dir/* tar cf dir.tar dir/*.gz ``` but the second method gave me dir.tar of size ~30kb ...
2014/02/12
[ "https://Stackoverflow.com/questions/21737294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Overhead from the per-file metadata and suboptimal conpression by `gzip` when processing files individually resulting from `gzip` not observing data in full and thus compressing with suboptimal dictionary (which is reset after each file).
`tar cf` should create an uncompressed archive, it means the size of your directory should almost be the same as your archive, maybe even more. `tar czf` will run `gunzip` compression through it. This can be further checked by doing a `man tar` in shell prompt in Linux, ``` -z, --gzip, --gunzip, --ungzip ...
21,737,294
I made two compressed copy of my folder, first by using the command `tar czf dir.tar.gz dir` This gives me an archive of size ~16kb. Then I tried another method, first i gunzipped all files inside the dir and then used ``` gzip ./dir/* tar cf dir.tar dir/*.gz ``` but the second method gave me dir.tar of size ~30kb ...
2014/02/12
[ "https://Stackoverflow.com/questions/21737294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Because zip process in general is more efficient on big sample than on small files. You have zipped 100 files of 1ko for example. Each file will have a certain compression, plus the [overhead of the gzip format](http://en.wikipedia.org/wiki/Gzip#File_format). ``` file1.tar -> files1.tar.gz (admit 30 bytes of headers...
`tar cf` should create an uncompressed archive, it means the size of your directory should almost be the same as your archive, maybe even more. `tar czf` will run `gunzip` compression through it. This can be further checked by doing a `man tar` in shell prompt in Linux, ``` -z, --gzip, --gunzip, --ungzip ...
21,737,294
I made two compressed copy of my folder, first by using the command `tar czf dir.tar.gz dir` This gives me an archive of size ~16kb. Then I tried another method, first i gunzipped all files inside the dir and then used ``` gzip ./dir/* tar cf dir.tar dir/*.gz ``` but the second method gave me dir.tar of size ~30kb ...
2014/02/12
[ "https://Stackoverflow.com/questions/21737294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Because zip process in general is more efficient on big sample than on small files. You have zipped 100 files of 1ko for example. Each file will have a certain compression, plus the [overhead of the gzip format](http://en.wikipedia.org/wiki/Gzip#File_format). ``` file1.tar -> files1.tar.gz (admit 30 bytes of headers...
Overhead from the per-file metadata and suboptimal conpression by `gzip` when processing files individually resulting from `gzip` not observing data in full and thus compressing with suboptimal dictionary (which is reset after each file).
35,997,873
When moving from OWIN to ASP.NET Core, I've found a bit of [information about dependencies to migration](http://katanaproject.codeplex.com/wikipage?title=roadmap&referringTitle=Home), but I've not found information about these other topics: * The middle-ware pipeline. How is this different, or not? * The DelegatingHan...
2016/03/14
[ "https://Stackoverflow.com/questions/35997873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/284758/" ]
* Middleware is quite similar between Katana and Core but you use HttpContext instead of IOwinContext. * Startup.cs is similar but there's much more DI support. * WebApi has been merged into MVC * DelegatingHandler is gone, use middleware instead. * HttpConfiguration has been split up into Routing and MvcOptions. Also...
I think you can start [here](https://docs.asp.net/en/latest/fundamentals/owin.html). It's an entire chapter about OWIN with ASP.NET Core. Hope this helps.
32,217,479
I have tried to include `adColony.jar` file into my libs folder. I can initiate the SKD okay. But when I try to compile the app, I get an error: > > Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/J...
2015/08/26
[ "https://Stackoverflow.com/questions/32217479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3792198/" ]
You can add **\*.jar** file using Android studio. In the project **right click** ``` -> new -> module -> import jar/AAR package -> import select the jar file to import -> click ok -> done ``` See the [screenshots here](https://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library/32087456#3208745...
Let me be a bit more precise here. You have to: 1. Copy the .jar file into the /libs folder of your Android Studio project (usually something like /ProjectName/app/libs) 2. Switch to Android Studio and select the Project perspective [![Android Studio Project perspective](https://i.stack.imgur.com/6kHlA.png)](https://...
42,786,042
I have a plugin with stores user activity in the table `wp_usermeta` and under `meta_key` `user_last_activity` and `meta_value` something like `a:12:{}` where `12` is the user id. So, If I was logged in as user with id: `12` my current page would run this code: ``` $user = get_user_id(); $activity = get_user_meta($u...
2017/03/14
[ "https://Stackoverflow.com/questions/42786042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7342807/" ]
I would advise to do a single query for the user\_meta instead of running `get_user_meta` within a foreach-loop. ``` global $wpdb; $results = $wpdb->get_results(" SELECT user_id, meta_value as 'user_last_activity' FROM $wpdb->usermeta WHERE `meta_key` = 'user_last_activity' "); var_dump($results); ```
You can use the [get\_users() function](https://codex.wordpress.org/Function_Reference/get_users) to get all of the users on your site, and then loop through those to grab the user activity. ``` $users = get_users(); // get array of WP_User objects foreach ( $users as $user ) { $activity = get_user_meta( $user->ID...
4,301,818
I am having trouble writing an SQL query to find a data "loop" in my Firebird table. Its very difficult to explain the situation so I will rather give an example: ``` Table: Explosion Stockcode | IngredientStockcode ---------------------------------- 001 | 010 001 | 011 001 | 012 010...
2010/11/29
[ "https://Stackoverflow.com/questions/4301818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383219/" ]
You have a typical graph/tree problem here. I'm afraid that one single query won't solve your issue. You'll need a loop to traverse each tree. But you have another problem, you can't easily select the root nodes. So you will either need to mark the root nodes or traverse your trees bottom up (so beginning with the b...
I'm not sure about the firebird SQL syntax, but this generic SQL Query shold help you: ``` select * from Explosion e1 inner join Explosion e2 on e1.Stockcode = e2.IngredientStockcode and e1.IngredientStockcode = e2.Stockcode ``` **EDIT** Had a quick check, and the documentation seems to suggest th...
35,283,536
I m trying to insert the following static url for a static folder inside a javascript so it can properly load a saved file, but i m still facing error. Here is what happens. the normal file location is <http://localhost/static/uploads/filename.ext> but with the following javascript, it fetch the location based on t...
2016/02/09
[ "https://Stackoverflow.com/questions/35283536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5306250/" ]
There are two paths to consider here and you need to pay close attention to which you're using where: 1. the absolute filepath on the server eg: `/opt/myapp/media/upload/<filename>`, and 2. the relative urlpath on the client eg: `https://localhost/static/upload/<filename>` Your easiest solution may be to simply retur...
Well, I have fixed the issue, I have stripped the url\_prefix parameters so i can call from the root url path. to avoid the previous issue.
88,022
I just crated a NFT and deployed it on Rinkeby to test it. I'm able to add my NFTs to wallets but I don't see the image I provided when minted it. What could be the reason? The image was a small .png and it's provided with a URI to the contract. All I see is a generic image. The Same NFT image is not showing on opense...
2020/10/03
[ "https://ethereum.stackexchange.com/questions/88022", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/45094/" ]
The `uri` need to point to a json file. The json file works with IPFS but over HTTP they usually add the ID of the NFT at the end of the URI which the IPFS Json file will no handle. Json file = IPFS (one file per NFT) <-- Decentralize API = HTTP request a DB by NFT ID. (one DB for all NFTs) <-- Centralized The Json...
This 3min tutorial explains how to view your NFT in your Metamask wallet: <https://docs.alchemyapi.io/alchemy/tutorials/how-to-write-and-deploy-an-nft/how-to-view-your-nft-in-your-wallet>
66,000,642
I have an HTTPApi API Gateway created with the Serverless Framework. But for some routes, the CORS is not working. ``` provider: name: aws runtime: nodejs12.x stage: dev region: us-west-2 timeout: 29 httpApi: cors: allowedOrigins: - '*' allowedMethods: - GET - OPTION...
2021/02/01
[ "https://Stackoverflow.com/questions/66000642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9085543/" ]
I have faced a similar problem. After 3 days of pulling my hair. I have found my problem. Everything was ok except, **In my client, there were few wrong URLs(spelling mistakes) pointing to my server API.** This is why few API was ok and few of them not working properly. After fixing to the right URL everything is ok. ...
Have you tried fixing the 'cors: true' value in the function event as in [Serverless with cors](https://www.serverless.com/blog/cors-api-gateway-survival-guide) ?
53,768,447
I am working with bash on a linux cluster. I am trying to extract reads from a .fastq file if they contain a match to a queried sequence. Below is an example .fastq file containing three reads. `$ cat example.fastq` ``` @SRR1111111.1 1/1 CTGGANAAGTGAAATAATATAAATTTTTCCACTATTGAATAAAAGCAACTTAAATTTTCTAAGTCG + AAAAA#EEEEE...
2018/12/13
[ "https://Stackoverflow.com/questions/53768447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6749238/" ]
Here is a solution using `agrep` to get the record numbers of matches and an awk that prints out those records with some context (due to missing `-A`and `-B` in `agrep`): ``` $ agrep -1 -n "GAAATGATA" file | awk -F: 'NR==FNR{for(i=($1-1);i<=($1+2);i++)a[i];next}FNR in a' - file ``` Output: ``` @SRR1111111.1 1/1...
You might try a file of patterns - ``` $: cat GAAATAATA .AAATAATA G.AATAATA GA.ATAATA GAA.TAATA GAAA.AATA GAAAT.ATA GAAATA.TA GAAATAA.A GAAATAAT. ``` then ``` grep -B 1 -A 2 -f GAAATAATA example.fastq > MATCH.fastq ``` but it will probably slow the process down a bit to add both full regex parsing AND an alterna...
53,768,447
I am working with bash on a linux cluster. I am trying to extract reads from a .fastq file if they contain a match to a queried sequence. Below is an example .fastq file containing three reads. `$ cat example.fastq` ``` @SRR1111111.1 1/1 CTGGANAAGTGAAATAATATAAATTTTTCCACTATTGAATAAAAGCAACTTAAATTTTCTAAGTCG + AAAAA#EEEEE...
2018/12/13
[ "https://Stackoverflow.com/questions/53768447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6749238/" ]
Here is a solution using `agrep` to get the record numbers of matches and an awk that prints out those records with some context (due to missing `-A`and `-B` in `agrep`): ``` $ agrep -1 -n "GAAATGATA" file | awk -F: 'NR==FNR{for(i=($1-1);i<=($1+2);i++)a[i];next}FNR in a' - file ``` Output: ``` @SRR1111111.1 1/1...
This should work but idk if the `MATCH.fastq` in your question is the expected output or not or even if your sample input contains any cases that need a working solution to find so idk if it's actually working or not: ``` $ cat tst.awk BEGIN { for (i=1; i<=length(seq); i++) { regexp = regexp sep substr(seq...
131,072
Sorry if this is a duplicate but I didn't find my answer in "Questions that already have your answer". Currently on my site if I visit an old URL link or if I outright make up a URL like `example.com/made-up-place.html` I am getting redirected with a 302. Whats weird is that it 302's by default instead of 301 for mov...
2014/01/24
[ "https://wordpress.stackexchange.com/questions/131072", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/35677/" ]
Information attached to the `wp_head` action hook is `echo`ed (if it needs to be `echo`ed) as it occurs. There is no "wp\_head" content string that you can search and replace. 1. You will need to find the callback functions/methods for the data you are interested in manipulating and hope that there hooks built in tha...
You could do one of the following things, for instance: 1. [Hook](http://codex.wordpress.org/Function_Reference/add_action) into [`wp_head`](http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head) and output your own meta information. This could be defined as a [post meta](http://codex.wordpress.org/Function_R...
131,072
Sorry if this is a duplicate but I didn't find my answer in "Questions that already have your answer". Currently on my site if I visit an old URL link or if I outright make up a URL like `example.com/made-up-place.html` I am getting redirected with a 302. Whats weird is that it 302's by default instead of 301 for mov...
2014/01/24
[ "https://wordpress.stackexchange.com/questions/131072", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/35677/" ]
I managed to find this post: <https://wordpress.stackexchange.com/a/75168/45611> It basically had what I needed. ``` /* * This whole block here changes the og:url that Wordpress Seo Yoast provides * It uses the addthis_share_url custom field, and if it is not present, it defaults * to the permalink, just like the ...
You could do one of the following things, for instance: 1. [Hook](http://codex.wordpress.org/Function_Reference/add_action) into [`wp_head`](http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head) and output your own meta information. This could be defined as a [post meta](http://codex.wordpress.org/Function_R...
14,226,449
I'm revising for a Software Engineering exam and one of the questions got me wondering. It showed a burndown chart where the team had made no progress on user stories for 10 days. The question was "Outline and justify any action that the ScrumMaster may consider taking at this point". I've thought about drastic action...
2013/01/09
[ "https://Stackoverflow.com/questions/14226449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1779136/" ]
There isn't enough information to give a complete answer but in my experience the first thing I'd do as Scrum Master is look at the burndown chart that plots task hours over time (rather than Story Points over time). It's quite common to see hours being burned down correctly but Story Points remaining static. Often re...
Rootcause analysis of why this is happening perhaps? is it the skills-gap? knowledge on the subject, as a team do they know how to approach these user stories, have they broken down the user stories into tasks during the sprint planning session, is the PO collaborative enough participative in the whole process? A goo...
14,226,449
I'm revising for a Software Engineering exam and one of the questions got me wondering. It showed a burndown chart where the team had made no progress on user stories for 10 days. The question was "Outline and justify any action that the ScrumMaster may consider taking at this point". I've thought about drastic action...
2013/01/09
[ "https://Stackoverflow.com/questions/14226449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1779136/" ]
I personally hate abstract questions like this - since you don't actually have enough information to give a "good" answer. How long is the sprint? What have the team been doing? What's the underlying cause of the lack of progress? These are all things you would already know if you were the scrum master of the team. You...
There isn't enough information to give a complete answer but in my experience the first thing I'd do as Scrum Master is look at the burndown chart that plots task hours over time (rather than Story Points over time). It's quite common to see hours being burned down correctly but Story Points remaining static. Often re...
14,226,449
I'm revising for a Software Engineering exam and one of the questions got me wondering. It showed a burndown chart where the team had made no progress on user stories for 10 days. The question was "Outline and justify any action that the ScrumMaster may consider taking at this point". I've thought about drastic action...
2013/01/09
[ "https://Stackoverflow.com/questions/14226449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1779136/" ]
I personally hate abstract questions like this - since you don't actually have enough information to give a "good" answer. How long is the sprint? What have the team been doing? What's the underlying cause of the lack of progress? These are all things you would already know if you were the scrum master of the team. You...
Rootcause analysis of why this is happening perhaps? is it the skills-gap? knowledge on the subject, as a team do they know how to approach these user stories, have they broken down the user stories into tasks during the sprint planning session, is the PO collaborative enough participative in the whole process? A goo...
30,823,841
When I construct the square array as I have and then pass it to the new Float32Array, I get an error, however, when I pass temp to Float32Array (and manually assign numTriangles to 6), everything works properly... asdf is logged to the console in both attempts, not sure why this is happening. ``` var square = [[-1,...
2015/06/13
[ "https://Stackoverflow.com/questions/30823841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654525/" ]
The method `join()` [produces a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2Fjoin), not an array. Float32Array cannot take neither a string or a 2-dimensional array as argument. A ...
Your arrays pointed by `square` and `temp` are references to corresponding arrays. So these references are always different, because the first is a result of `.join()` method, and the second is a reference to a static in-line array. You need to compare each element of both arrays in a cycle.
21,520,829
I have the following query to show the datas ``` Select convert(varchar(10),SR.StockDate,103) as StockDate,SR.PartNo, SR.Openingbalance,SR.Received,SR.Issued,SR.Balance,SR.Entrytype,A.MaterialName from StockRegister SR join LEDProducts A on SR.PartNo=A.PartNo where SR.LocationId='"+ dd...
2014/02/03
[ "https://Stackoverflow.com/questions/21520829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3234884/" ]
aspx code... ``` <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="WebApplication1.WebForm3" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> </div> </for...
You can use repeater control to do this with DataGrid Control with in set its datasource property also you can set ItemTemplate in the repeater for whatever controls you want to display for every product ``` <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <asp:GridView ID="GridView1" runat="se...
49,542,956
I'm trying to get a stepper to go to a set question based on where the user left off. I'm using selectedIndex, and setting it to a number I retrieved from the server. Html: ``` <mat-horizontal-stepper class="my-stepper" [linear]="true" #stepper="matHorizontalStepper" [selectedIndex]="currentQuestion"> <mat-step...
2018/03/28
[ "https://Stackoverflow.com/questions/49542956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9447500/" ]
The solution I came up with is putting the stepper in a div with an \*ngIf, and in the subscribe after all the data has been set, allowing the div to be shown. Html: ``` <div *ngIf="!processing"> <mat-horizontal-stepper class="my-stepper" [linear]="true" #stepper="matHorizontalStepper" [selectedIndex]="currentQ...
Your proposed solution is perfectly valid, another alternative is to initialise the value of `currentQuestion` at the beginning, so that when we are still waiting for the subscribe is not undefined ``` public currentVideoCount: number[]; public currentQuestion: number = 0; // Initialise currentQuestion ngAfterViewInit...
37,135,300
I have a requirement which may be little complicated. Think about I have bean class like: ``` public class A { private String column1; private String column2; private Map<String,String> dynamicColumns = Maps.newHashMap(); .... getter&setter of column1 and column2 .... public void addExtraColumnVal...
2016/05/10
[ "https://Stackoverflow.com/questions/37135300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3514285/" ]
Have you tried `ResultHandler`? question [MyBatis - ResultHandler is not invoked](https://stackoverflow.com/a/27249714/5619827) could be useful. In mybatis 3, you could see method `SqlSession#select(String statement, ResultHandler handler)`. You could do what ever you want in your custom `ResultHandler`. Please le...
**Yes** it can be done. 1.Whatever you are doing to select dynamic columns is ok. 2.**To map the result:** Since you are selecting the columns(dynamic) from table\_1(Which will not change),you can have a POJO class with the fields present in table\_1 and put that in resultMap. ``` <select id="queryDynamicColumns" p...
37,135,300
I have a requirement which may be little complicated. Think about I have bean class like: ``` public class A { private String column1; private String column2; private Map<String,String> dynamicColumns = Maps.newHashMap(); .... getter&setter of column1 and column2 .... public void addExtraColumnVal...
2016/05/10
[ "https://Stackoverflow.com/questions/37135300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3514285/" ]
Have you tried `ResultHandler`? question [MyBatis - ResultHandler is not invoked](https://stackoverflow.com/a/27249714/5619827) could be useful. In mybatis 3, you could see method `SqlSession#select(String statement, ResultHandler handler)`. You could do what ever you want in your custom `ResultHandler`. Please le...
Some dirty(?) tricks can solve your problems, but you have to start from the SQL side. Tactic: Select all dynamic columns as one column using a delimiter to join columns. Then split the columns into an array using the same delimiter. SELECT MANDATORY\_COL\_1 AS C1, MANDATORY\_COL\_2 AS C2, OPTIONAL\_COL\_3 || "^" OPTI...
37,135,300
I have a requirement which may be little complicated. Think about I have bean class like: ``` public class A { private String column1; private String column2; private Map<String,String> dynamicColumns = Maps.newHashMap(); .... getter&setter of column1 and column2 .... public void addExtraColumnVal...
2016/05/10
[ "https://Stackoverflow.com/questions/37135300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3514285/" ]
**Yes** it can be done. 1.Whatever you are doing to select dynamic columns is ok. 2.**To map the result:** Since you are selecting the columns(dynamic) from table\_1(Which will not change),you can have a POJO class with the fields present in table\_1 and put that in resultMap. ``` <select id="queryDynamicColumns" p...
Some dirty(?) tricks can solve your problems, but you have to start from the SQL side. Tactic: Select all dynamic columns as one column using a delimiter to join columns. Then split the columns into an array using the same delimiter. SELECT MANDATORY\_COL\_1 AS C1, MANDATORY\_COL\_2 AS C2, OPTIONAL\_COL\_3 || "^" OPTI...
25,668,656
I have tried to code the DFS algorithm as given in CLRS. Here's the code below. When I run it I got an error as "Your program stopped unexpectedly." When I debugged the code I got this line in the call stack "msvcrt!malloc()" and "operator new(unsigned int)". I'm using CodeBlocks. Where am I wrong? ``` #include<iostre...
2014/09/04
[ "https://Stackoverflow.com/questions/25668656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3739818/" ]
Use: ``` $('.xyz').each(function(i){ $(this).html($(this).html()+" word"+(i+1));//or $(this).text($(this).text()+" word"+(i+1)); }); ``` **[Working Demo](http://jsfiddle.net/2urzk5d7/)**
Look at this: ``` $('.xyz').each(function(i){ var count = i+1; $(this).html($(this).html()+ "word" + count) }); ``` <http://jsfiddle.net/y9043kdn/1/>
26,867,983
So I have this 2300+ pdf PDF that I need to deal with. Step 1 has to be deleting the pages I don't need from it. For example, pages 1 to 24 don’t contain any information that I need, then 25 to 28 I do need, 29 to 54 I don’t need, etc. The number of each pages I do need and the number of pages I don’t need vary with ea...
2014/11/11
[ "https://Stackoverflow.com/questions/26867983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532515/" ]
It's just the way the object model works. Before tables (ListObjects) were introduced, you could only have one autofilter applied to a sheet. You applied it using the Autofilter method of the Range object - presumably for consistency with how you apply an advanced filter, and possibly with the old XLM FILTER command. ...
there are other oddities associated with this history -- if your active cell or selection is within a ListObject Table which has filters active, activeworksheet.filtermode = true; if outside the table, then activeworksheet.filtermode = false. This in/out disparity does not happen with ordinary filtered Ranges
47,416,604
I have next task - draw ellipe trough 3 points (like in the picture). [![ellipse](https://i.stack.imgur.com/oWPi7.jpg)](https://i.stack.imgur.com/oWPi7.jpg) . User can drag theese points that to change ellipse size. Two of points placed on edges of great axis. In my solution I use GDI throug Graphics class. Now my s...
2017/11/21
[ "https://Stackoverflow.com/questions/47416604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6446035/" ]
Here is how to use the `DrawEllipse` method from a rotation, the minor axis and two vertices. First we calculate the `Size` of the bounding `Rectangle`: Given the `Points A and B` sitting on the short sides of length `smallSize` we get the long side with a little Pythagoras: ``` int longSide = (int)(Math.Sqrt((A.Y -...
Compute the similarity transform (translation and rotation) that brings the first two points to `(-a, 0)` and `(a, 0)`. [This can be done with a matrix transform or complex numbers.] Apply the same transform to the third point. Now the equation of the reduced ellipse is ``` x² / a² + y² / b² = 1. ``` You simply det...
48,550,114
Why should I always set a React Input Component's value manually? In my Example I can delete `value={this.state.email}` and `value={this.state.password}` and the code is valid and it works. But I see in the React Docs and in all of their examples you should set the value every render. Why is that? ```js function vali...
2018/01/31
[ "https://Stackoverflow.com/questions/48550114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1372844/" ]
The code may be valid and work, but you now have the same value (input) in two places; The input element's state AND React's state. This is why react has controlled components. "In HTML, form elements such as input, textarea, and select typically maintain their own state and update it based on user input. In React, ...
It's the difference between a React controlled form and a non-React controlled form. It's totally possible to use uncontrolled forms in React, but that limits your forms to just very, very basic forms. It can also create potential problems down the road because React should be the one controlling everything in your app...
7,126,524
I've been asked by a recruiter for how many years I'm testing HTML5/CCS3, and I never thought if our app uses any of those, and our UI developer is not online at the moment to ask. I googled it and found on yahoo answers that the source code for the HTML5 page will have ``` <!DOCTYPE html> ``` in it at the top. Is ...
2011/08/19
[ "https://Stackoverflow.com/questions/7126524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63503/" ]
### HTML5 HTML5 isn’t one big thing (see <http://diveintohtml5.ep.io/introduction.html>). There’s no easy way to tell if a given HTML page contains any HTML5 features other than listing all the new features in HTML5, and checking the page for them. * [Differences between HTML5 and HTML4](http://www.w3.org/TR/html5-di...
just download the css files with wget/curl and look at the defs, as well as looking at the page source to see if you see any css3 transforms. Or use webkit/firebug to look at the css.
1,897,352
In Sqlite I can use group\_concat to do: ``` 1...A 1...B 1...C 2...A 2...B 2...C 1...C,B,A 2...C,B,A ``` but the order of the concatenation is random - according to docs. I need to sort the output of group\_concat to be ``` 1...A,B,C 2...A,B,C ``` How can I do this?
2009/12/13
[ "https://Stackoverflow.com/questions/1897352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230781/" ]
Can you not use a subselect with the order by clause in, and then group concat the values? Something like ``` SELECT ID, GROUP_CONCAT(Val) FROM ( SELECT ID, Val FROM YourTable ORDER BY ID, Val ) GROUP BY ID; ```
To be more precise, according to the [docs](https://www.sqlite.org/lang_aggfunc.html): > > The order of the concatenated elements is arbitrary. > > > It does not really mean random, it just means that the developers reserve the right to use whatever ordering they whish, even different ones for different queries o...
1,897,352
In Sqlite I can use group\_concat to do: ``` 1...A 1...B 1...C 2...A 2...B 2...C 1...C,B,A 2...C,B,A ``` but the order of the concatenation is random - according to docs. I need to sort the output of group\_concat to be ``` 1...A,B,C 2...A,B,C ``` How can I do this?
2009/12/13
[ "https://Stackoverflow.com/questions/1897352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230781/" ]
Can you not use a subselect with the order by clause in, and then group concat the values? Something like ``` SELECT ID, GROUP_CONCAT(Val) FROM ( SELECT ID, Val FROM YourTable ORDER BY ID, Val ) GROUP BY ID; ```
Stumbling upon the underlying sorting-problem I tried this: (... on 10.4.18-MariaDB) ``` select GROUP_CONCAT(ex.ID) as ID_list FROM ( SELECT usr.ID FROM ( SELECT u1.ID as ID FROM table_users u1 ) usr GROUP BY ID ) ex ``` ... and found the serialized ID\_list ordered! But I don't have an explanation for this now "cor...
1,897,352
In Sqlite I can use group\_concat to do: ``` 1...A 1...B 1...C 2...A 2...B 2...C 1...C,B,A 2...C,B,A ``` but the order of the concatenation is random - according to docs. I need to sort the output of group\_concat to be ``` 1...A,B,C 2...A,B,C ``` How can I do this?
2009/12/13
[ "https://Stackoverflow.com/questions/1897352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230781/" ]
To be more precise, according to the [docs](https://www.sqlite.org/lang_aggfunc.html): > > The order of the concatenated elements is arbitrary. > > > It does not really mean random, it just means that the developers reserve the right to use whatever ordering they whish, even different ones for different queries o...
Stumbling upon the underlying sorting-problem I tried this: (... on 10.4.18-MariaDB) ``` select GROUP_CONCAT(ex.ID) as ID_list FROM ( SELECT usr.ID FROM ( SELECT u1.ID as ID FROM table_users u1 ) usr GROUP BY ID ) ex ``` ... and found the serialized ID\_list ordered! But I don't have an explanation for this now "cor...
13,567,015
In ElasticSearch, is there a way to rank search results by proximity to a given date (or number)?
2012/11/26
[ "https://Stackoverflow.com/questions/13567015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491341/" ]
Here is one possible implementation (in C): ``` int getMaxSign(const __m128 v) { __m128 v1, vmax, vmin, vsign; float sign; v1 = (__m128)_mm_alignr_epi8((__m128i)v, (__m128i)v, 4); // v1 = v rotated by 1 element vmax = _mm_max_ps(v, v1); // generate horizontal max/min vmin = _mm_min_ps(v,...
``` m = min(a,b,c); M = max(a,b,c); // return abs(m)>abs(M) ? sign(m): sign(M); // was return sign(m+M); ``` As correctly noticed by Paul\_R, the sign comes simply from the sum of the min and max values. Which ever has larger (opposite signed) absolute value, wins. But the idea can be exploited more: the sum ...
13,567,015
In ElasticSearch, is there a way to rank search results by proximity to a given date (or number)?
2012/11/26
[ "https://Stackoverflow.com/questions/13567015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491341/" ]
Here is one possible implementation (in C): ``` int getMaxSign(const __m128 v) { __m128 v1, vmax, vmin, vsign; float sign; v1 = (__m128)_mm_alignr_epi8((__m128i)v, (__m128i)v, 4); // v1 = v rotated by 1 element vmax = _mm_max_ps(v, v1); // generate horizontal max/min vmin = _mm_min_ps(v,...
If your numbers are discrete, and properly spaced, and drawing from a limited subset, there are other possibilities. If you're guaranteed that a, b, and c are integers for instance, then you can multiply the vector by itself to get an odd power and then dot it with <1, 1, 1>. If we multiply it by itself 4 times, for i...
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
Or even simpler: ``` #!/bin/sh test "$(tail -c 1 "$1")" && echo "no newline at eof: '$1'" ``` But if you want a more robust check: ``` test "$(tail -c 1 "$1" | wc -l)" -eq 0 && echo "no newline at eof: '$1'" ```
I'm coming up with a correction to my own answer. Below should work in all cases with no failures: ``` nl=$(printf '\012') nls=$(wc -l "${target_file}") lastlinecount=${nls%% *} lastlinecount=$((lastlinecount+1)) lastline=$(sed ${lastlinecount}' !d' "${target_file}") if [ "${lastline}" = "${nl}" ]; then echo "${t...
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
**[@Konrad](https://stackoverflow.com/questions/38746/how-to-detect-file-ends-in-newline#39185)**: tail does not return an empty line. I made a file that has some text that doesn't end in newline and a file that does. Here is the output from tail: ```none $ cat test_no_newline.txt this file doesn't end in newline$ $...
Here is a useful bash function: ``` function file_ends_with_newline() { [[ $(tail -c1 "$1" | wc -l) -gt 0 ]] } ``` You can use it like: ``` if ! file_ends_with_newline myfile.txt then echo "" >> myfile.txt fi # continue with other stuff that assumes myfile.txt ends with a newline ```
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
Using only `bash`: ``` x=`tail -n 1 your_textfile` if [ "$x" == "" ]; then echo "empty line"; fi ``` (Take care to copy the whitespaces correctly!) @grom: > > tail does not return an empty line > > > Damn. My test file didn't end on `\n` but on `\n\n`. Apparently `vim` can't create files that don't end on `\n...
You can get the last character of the file using `tail -c 1`. ``` my_file="/path/to/my/file" if [[ $(tail -c 1 "$my_file") != "" ]]; then echo "File doesn't end with a new line: $my_file" fi ```
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
A complete Bash solution with only `tail` command, that also deal correctly with empty files. ```sh #!/bin/bash # Return 0 if file $1 exists and ending by end of line character, # else return 1 [[ -s "$1" && -z "$(tail -c 1 "$1")" ]] ``` * `-s "$1"` checks if the file is not empty * `-z "$(tail -c 1 "$1")"` checks i...
You can get the last character of the file using `tail -c 1`. ``` my_file="/path/to/my/file" if [[ $(tail -c 1 "$my_file") != "" ]]; then echo "File doesn't end with a new line: $my_file" fi ```
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
You could use something like this as your pre-commit script: ``` #! /usr/bin/perl while (<>) { $last = $_; } if (! ($last =~ m/\n$/)) { print STDERR "File doesn't end with \\n!\n"; exit 1; } ```
The `read` command can not read a line without newline. ```sh if tail -c 1 "$1" | read -r line; then echo "newline" fi ``` Another answer. ```sh if [ $(tail -c 1 "$1" | od -An -b) = 012 ]; then echo "newline" fi ```
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
**[@Konrad](https://stackoverflow.com/questions/38746/how-to-detect-file-ends-in-newline#39185)**: tail does not return an empty line. I made a file that has some text that doesn't end in newline and a file that does. Here is the output from tail: ```none $ cat test_no_newline.txt this file doesn't end in newline$ $...
Using only `bash`: ``` x=`tail -n 1 your_textfile` if [ "$x" == "" ]; then echo "empty line"; fi ``` (Take care to copy the whitespaces correctly!) @grom: > > tail does not return an empty line > > > Damn. My test file didn't end on `\n` but on `\n\n`. Apparently `vim` can't create files that don't end on `\n...
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
Here is a useful bash function: ``` function file_ends_with_newline() { [[ $(tail -c1 "$1" | wc -l) -gt 0 ]] } ``` You can use it like: ``` if ! file_ends_with_newline myfile.txt then echo "" >> myfile.txt fi # continue with other stuff that assumes myfile.txt ends with a newline ```
I'm coming up with a correction to my own answer. Below should work in all cases with no failures: ``` nl=$(printf '\012') nls=$(wc -l "${target_file}") lastlinecount=${nls%% *} lastlinecount=$((lastlinecount+1)) lastline=$(sed ${lastlinecount}' !d' "${target_file}") if [ "${lastline}" = "${nl}" ]; then echo "${t...
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
Or even simpler: ``` #!/bin/sh test "$(tail -c 1 "$1")" && echo "no newline at eof: '$1'" ``` But if you want a more robust check: ``` test "$(tail -c 1 "$1" | wc -l)" -eq 0 && echo "no newline at eof: '$1'" ```
Using only `bash`: ``` x=`tail -n 1 your_textfile` if [ "$x" == "" ]; then echo "empty line"; fi ``` (Take care to copy the whitespaces correctly!) @grom: > > tail does not return an empty line > > > Damn. My test file didn't end on `\n` but on `\n\n`. Apparently `vim` can't create files that don't end on `\n...
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
**[@Konrad](https://stackoverflow.com/questions/38746/how-to-detect-file-ends-in-newline#39185)**: tail does not return an empty line. I made a file that has some text that doesn't end in newline and a file that does. Here is the output from tail: ```none $ cat test_no_newline.txt this file doesn't end in newline$ $...
Or even simpler: ``` #!/bin/sh test "$(tail -c 1 "$1")" && echo "no newline at eof: '$1'" ``` But if you want a more robust check: ``` test "$(tail -c 1 "$1" | wc -l)" -eq 0 && echo "no newline at eof: '$1'" ```
38,746
Over at [Can you modify text files when committing to subversion?](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion) [Grant](https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666) suggested that I block commits instead. ...
2008/09/02
[ "https://Stackoverflow.com/questions/38746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486/" ]
Here is a useful bash function: ``` function file_ends_with_newline() { [[ $(tail -c1 "$1" | wc -l) -gt 0 ]] } ``` You can use it like: ``` if ! file_ends_with_newline myfile.txt then echo "" >> myfile.txt fi # continue with other stuff that assumes myfile.txt ends with a newline ```
A complete Bash solution with only `tail` command, that also deal correctly with empty files. ```sh #!/bin/bash # Return 0 if file $1 exists and ending by end of line character, # else return 1 [[ -s "$1" && -z "$(tail -c 1 "$1")" ]] ``` * `-s "$1"` checks if the file is not empty * `-z "$(tail -c 1 "$1")"` checks i...
114,630
I've seen there exists some kind of improved armor (for example see [Leather Armor +3](https://roll20.net/compendium/dnd5e/Leather%20Armor%20+3)). But I am unable to find anything about this in the DM guide or PH. Is that official or common homebrew stuff? And: If I'm having for example a leather armor, how would I go...
2018/02/01
[ "https://rpg.stackexchange.com/questions/114630", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/40426/" ]
[Armor +3](https://www.dndbeyond.com/magic-items/armor-3) *is* magic armor. It's listed in the DMG on page 152 as a generic item. Basic +X armor doesn't have any special effects beyond improving the wearer's armor class, so it's all lumped into a single entry. The rules for DMs who wish to allow characters to [craft a...
The leather armor +3 that you linked is from the entry in the DMG called "armor, +1, +2, +3" in the list of magic items. For more information about magic items, please read DMG chapter 7, section "Magic Items" and chapter 6, section "Downtime Activities." Xanathar's Guide to Everything contains additional advice and op...
21,906,638
I use `calloc`, I've read that, `calloc` internally calls `new` handler, so what should I go for? Should I use `new` operator(which allocate fast) or `calloc`(which can allocate and initialize memory as well)?
2014/02/20
[ "https://Stackoverflow.com/questions/21906638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2978527/" ]
The question cannot really be answered, because it's based on the incorrect assumption that `new` merely allocates memory but doesn't initialize it. The contrary is the fact: `new` not only allocates memory (unless you use "placement new"), it also calls some objects constructor. I.e. `new` does much more than `calloc...
`calloc` isn't really comparable to `new`; it's closer to `operator new` (they are not the same). `calloc` will zero out the memory allocated whereas `operator new` and `malloc` won't. `new` constructs an object in the storage location but `calloc` doesn't. ``` // Using calloc: my_object* p = static_cast<my_object*>(s...
21,906,638
I use `calloc`, I've read that, `calloc` internally calls `new` handler, so what should I go for? Should I use `new` operator(which allocate fast) or `calloc`(which can allocate and initialize memory as well)?
2014/02/20
[ "https://Stackoverflow.com/questions/21906638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2978527/" ]
Well, everyone's told you about `new` not initialising memory etc, but they forgot about value-initialization syntax: ``` char *buffer = new char[size](); ``` So I would argue that you *always* use `new`. If you want to initialise the memory, use the above syntax. Otherwise, drop the parentheses.
`calloc` isn't really comparable to `new`; it's closer to `operator new` (they are not the same). `calloc` will zero out the memory allocated whereas `operator new` and `malloc` won't. `new` constructs an object in the storage location but `calloc` doesn't. ``` // Using calloc: my_object* p = static_cast<my_object*>(s...
21,906,638
I use `calloc`, I've read that, `calloc` internally calls `new` handler, so what should I go for? Should I use `new` operator(which allocate fast) or `calloc`(which can allocate and initialize memory as well)?
2014/02/20
[ "https://Stackoverflow.com/questions/21906638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2978527/" ]
`calloc` isn't really comparable to `new`; it's closer to `operator new` (they are not the same). `calloc` will zero out the memory allocated whereas `operator new` and `malloc` won't. `new` constructs an object in the storage location but `calloc` doesn't. ``` // Using calloc: my_object* p = static_cast<my_object*>(s...
> > Should I use new operator(which allocate fast) or calloc(which can allocate and initialize memory as well)? > > > In C++ you should never use \*alloc memory function (`malloc`, `calloc`, `free`, etc). They lead you to create code that is unsafe for C++ (for C it is fine). You should also use most specialized ...
21,906,638
I use `calloc`, I've read that, `calloc` internally calls `new` handler, so what should I go for? Should I use `new` operator(which allocate fast) or `calloc`(which can allocate and initialize memory as well)?
2014/02/20
[ "https://Stackoverflow.com/questions/21906638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2978527/" ]
The question cannot really be answered, because it's based on the incorrect assumption that `new` merely allocates memory but doesn't initialize it. The contrary is the fact: `new` not only allocates memory (unless you use "placement new"), it also calls some objects constructor. I.e. `new` does much more than `calloc...
> > Should I use new operator(which allocate fast) or calloc(which can allocate and initialize memory as well)? > > > In C++ you should never use \*alloc memory function (`malloc`, `calloc`, `free`, etc). They lead you to create code that is unsafe for C++ (for C it is fine). You should also use most specialized ...
21,906,638
I use `calloc`, I've read that, `calloc` internally calls `new` handler, so what should I go for? Should I use `new` operator(which allocate fast) or `calloc`(which can allocate and initialize memory as well)?
2014/02/20
[ "https://Stackoverflow.com/questions/21906638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2978527/" ]
Well, everyone's told you about `new` not initialising memory etc, but they forgot about value-initialization syntax: ``` char *buffer = new char[size](); ``` So I would argue that you *always* use `new`. If you want to initialise the memory, use the above syntax. Otherwise, drop the parentheses.
> > Should I use new operator(which allocate fast) or calloc(which can allocate and initialize memory as well)? > > > In C++ you should never use \*alloc memory function (`malloc`, `calloc`, `free`, etc). They lead you to create code that is unsafe for C++ (for C it is fine). You should also use most specialized ...
8,386
There is a 2TB Time Capsule on my home network (IP 192.168.0.1). How can I mount the Time Capsule's disk from my Raspberry Pi, automatically after reboots?
2013/07/11
[ "https://raspberrypi.stackexchange.com/questions/8386", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/8359/" ]
Put it in fstab. ``` sudo su mkdir /mnt/timecapsule echo "//timeCapsuleIp/Data /mnt/timecapsule cifs user=timecapsuleUsername,pass=timecapsuleUserPassword,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0" >> /etc/fstab ``` Required `cifs-utils` package should be already provided on raspbian. Of course change timecapsuleUse...
I got adding sec=ntlm to the options, the complete command is: ``` sudo su mkdir /mnt/timecapsule echo "//timeCapsuleIp/Data /mnt/timecapsule cifs user= timecapsuleUsername,pass= timecapsuleUserPassword,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0" >> /etc/fstab ``` Then, run this command: ``` mount -a ``` You should ...
8,386
There is a 2TB Time Capsule on my home network (IP 192.168.0.1). How can I mount the Time Capsule's disk from my Raspberry Pi, automatically after reboots?
2013/07/11
[ "https://raspberrypi.stackexchange.com/questions/8386", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/8359/" ]
Put it in fstab. ``` sudo su mkdir /mnt/timecapsule echo "//timeCapsuleIp/Data /mnt/timecapsule cifs user=timecapsuleUsername,pass=timecapsuleUserPassword,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0" >> /etc/fstab ``` Required `cifs-utils` package should be already provided on raspbian. Of course change timecapsuleUse...
Update for users of Raspberry Stretch v9. Note the addition of vers=1.0 ``` //IPofTimeCapsule/PathWithinYourTimeCapsule /mnt/TimeCapsule cifs username=insert,password=insert,rw,uid=1000,iocharset=utf8,sec=ntlm,vers=1.0 0 0 ```
8,386
There is a 2TB Time Capsule on my home network (IP 192.168.0.1). How can I mount the Time Capsule's disk from my Raspberry Pi, automatically after reboots?
2013/07/11
[ "https://raspberrypi.stackexchange.com/questions/8386", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/8359/" ]
Put it in fstab. ``` sudo su mkdir /mnt/timecapsule echo "//timeCapsuleIp/Data /mnt/timecapsule cifs user=timecapsuleUsername,pass=timecapsuleUserPassword,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0" >> /etc/fstab ``` Required `cifs-utils` package should be already provided on raspbian. Of course change timecapsuleUse...
For me, when using a disk password on the time capsule, it only worked when I added uid=504 (which is the userID used on the macintosh mainly using the timecapsule, not the uid used on the raspberry). When I didn't put uid=504 then I got "mount error(16): Device or resource busy" back from the time capsule.
8,386
There is a 2TB Time Capsule on my home network (IP 192.168.0.1). How can I mount the Time Capsule's disk from my Raspberry Pi, automatically after reboots?
2013/07/11
[ "https://raspberrypi.stackexchange.com/questions/8386", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/8359/" ]
I got adding sec=ntlm to the options, the complete command is: ``` sudo su mkdir /mnt/timecapsule echo "//timeCapsuleIp/Data /mnt/timecapsule cifs user= timecapsuleUsername,pass= timecapsuleUserPassword,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0" >> /etc/fstab ``` Then, run this command: ``` mount -a ``` You should ...
Update for users of Raspberry Stretch v9. Note the addition of vers=1.0 ``` //IPofTimeCapsule/PathWithinYourTimeCapsule /mnt/TimeCapsule cifs username=insert,password=insert,rw,uid=1000,iocharset=utf8,sec=ntlm,vers=1.0 0 0 ```
8,386
There is a 2TB Time Capsule on my home network (IP 192.168.0.1). How can I mount the Time Capsule's disk from my Raspberry Pi, automatically after reboots?
2013/07/11
[ "https://raspberrypi.stackexchange.com/questions/8386", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/8359/" ]
I got adding sec=ntlm to the options, the complete command is: ``` sudo su mkdir /mnt/timecapsule echo "//timeCapsuleIp/Data /mnt/timecapsule cifs user= timecapsuleUsername,pass= timecapsuleUserPassword,rw,uid=1000,iocharset=utf8,sec=ntlm 0 0" >> /etc/fstab ``` Then, run this command: ``` mount -a ``` You should ...
For me, when using a disk password on the time capsule, it only worked when I added uid=504 (which is the userID used on the macintosh mainly using the timecapsule, not the uid used on the raspberry). When I didn't put uid=504 then I got "mount error(16): Device or resource busy" back from the time capsule.
8,386
There is a 2TB Time Capsule on my home network (IP 192.168.0.1). How can I mount the Time Capsule's disk from my Raspberry Pi, automatically after reboots?
2013/07/11
[ "https://raspberrypi.stackexchange.com/questions/8386", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/8359/" ]
Update for users of Raspberry Stretch v9. Note the addition of vers=1.0 ``` //IPofTimeCapsule/PathWithinYourTimeCapsule /mnt/TimeCapsule cifs username=insert,password=insert,rw,uid=1000,iocharset=utf8,sec=ntlm,vers=1.0 0 0 ```
For me, when using a disk password on the time capsule, it only worked when I added uid=504 (which is the userID used on the macintosh mainly using the timecapsule, not the uid used on the raspberry). When I didn't put uid=504 then I got "mount error(16): Device or resource busy" back from the time capsule.
29,452,164
This code results in `x` pointing to a chunk of memory 100GB in size. ``` #include <stdlib.h> #include <stdio.h> int main() { auto x = malloc(1); for (int i = 1; i< 1024; ++i) x = realloc(x, i*1024ULL*1024*100); while (true); // Give us time to check top } ``` While this code fails allocation. ``` #inc...
2015/04/04
[ "https://Stackoverflow.com/questions/29452164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733424/" ]
As SeaSarp said, do not use tables. You can use the `ul` and `li` elements instead. To archive what you want, you can create two lists (one for every line) and put the images in each `li`. Like this: ``` <ul> <li> <img src="http://image_url" /> </li> <li> <img src="http://image_url" /> ...
Split it into 2 tables: ``` <table class="photos" style="border-spacing: 0; border-width: 0; padding: 0 0; border-width: 0; border: 1; width: 100%;" > <tr> <td><img src="Dad.jpg" alt="dad" /></td> <td><img src="gili.jpg" alt="gili" /></td> <td><img src="me2.jpg" alt="me" /></td> </tr> ...
53,700,018
I tried to install KubeFlow but use the wrong region, how to delete it? I tried to do it from Kubernetes clsuter but keep getting the same error when I try to create a new one: ``` Error 409: 'projects/dpe-cloud-mle/global/deployments/kubeflow' already exists and cannot be created., duplicate ```
2018/12/10
[ "https://Stackoverflow.com/questions/53700018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/260826/" ]
This is a feature of Deployment Manager, which is used to create the cluster. If you create any resource using DM, but edit or delete it manually (=elsewhere in the console), the record of it remains unchanged in the DM. To fix your issue, navigate to [Deployment Manager in your GCP Console](https://console.cloud.goo...
Alternatively you can also remove the deployment via the command line as mentioned on the [GKE set-up instructions](https://www.kubeflow.org/docs/started/getting-started-gke/) ``` ${KUBEFLOW_SRC}/scripts/kfctl.sh delete all ```
53,700,018
I tried to install KubeFlow but use the wrong region, how to delete it? I tried to do it from Kubernetes clsuter but keep getting the same error when I try to create a new one: ``` Error 409: 'projects/dpe-cloud-mle/global/deployments/kubeflow' already exists and cannot be created., duplicate ```
2018/12/10
[ "https://Stackoverflow.com/questions/53700018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/260826/" ]
This is a feature of Deployment Manager, which is used to create the cluster. If you create any resource using DM, but edit or delete it manually (=elsewhere in the console), the record of it remains unchanged in the DM. To fix your issue, navigate to [Deployment Manager in your GCP Console](https://console.cloud.goo...
run the following set of commands to delete all resources associated with the kubeflow deployment: //Delete the deployment via deployment manager gcloud deployment-manager --project=${PROJECT} deployments delete ${DEPLOYMENT\_NAME} //Delete your Cloud Storage bucket when you’ve finished with it: gsutil rm -r gs://...
53,700,018
I tried to install KubeFlow but use the wrong region, how to delete it? I tried to do it from Kubernetes clsuter but keep getting the same error when I try to create a new one: ``` Error 409: 'projects/dpe-cloud-mle/global/deployments/kubeflow' already exists and cannot be created., duplicate ```
2018/12/10
[ "https://Stackoverflow.com/questions/53700018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/260826/" ]
Alternatively you can also remove the deployment via the command line as mentioned on the [GKE set-up instructions](https://www.kubeflow.org/docs/started/getting-started-gke/) ``` ${KUBEFLOW_SRC}/scripts/kfctl.sh delete all ```
run the following set of commands to delete all resources associated with the kubeflow deployment: //Delete the deployment via deployment manager gcloud deployment-manager --project=${PROJECT} deployments delete ${DEPLOYMENT\_NAME} //Delete your Cloud Storage bucket when you’ve finished with it: gsutil rm -r gs://...
15,197,842
Sorry if am duplicating the Qn. But none of the answers present me a solution to my cross browser request problem. I need to send a GET request to a different URL using json and required headers. I tried the following code but doesnt seems to be working. It takes 3 parameters.. ``` var URL = 'url?firstName=myname&...
2013/03/04
[ "https://Stackoverflow.com/questions/15197842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2130985/" ]
As I wrote in the comment the answer of your first question is: If I understand your PRC well, in case of `@IP = ''` it should returns a wieder set of members. I think it is possible that the `Username, Email` or `Country` is longer in the member table then the `@Temp` table's definition. Match the column lenghts of `...
As per error message update: You need to check data length of select query and make sure your @Temp table columns are defined correctly. For example; You could extend the column length of `Country varchar(25)` to `Country varchar(50)` Also, I think your `CASE` statement doesn't make sense. What your `CASE` effectivel...
8,412
What is hyperconjugation and how do you know if there is hyperconjugation in a compound? Which orbitals are involved in hyperconjugation?
2014/02/10
[ "https://chemistry.stackexchange.com/questions/8412", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/4432/" ]
In the ethyl cation, one can write the following resonance structures: ![Resonance by hyperconjugation](https://i.stack.imgur.com/KRgPz.jpg) The structure on the right can be actually written 3 times since there are 3 hydrogens available. Note also that the "ethylenic-like" structure on the right involves a $\mathrm{...
Hyperconjugation is the interaction between adjacent orbital (empty $\mathrm{p}$ for cation, $\pi$ for alkene) with $\sigma$ bond, while common conjugation is between adjacent orbital and $\pi$ bond. As one example, one reason why more alkyl substituted alkenes are more stable than less substituted ones is because mor...
8,412
What is hyperconjugation and how do you know if there is hyperconjugation in a compound? Which orbitals are involved in hyperconjugation?
2014/02/10
[ "https://chemistry.stackexchange.com/questions/8412", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/4432/" ]
In the ethyl cation, one can write the following resonance structures: ![Resonance by hyperconjugation](https://i.stack.imgur.com/KRgPz.jpg) The structure on the right can be actually written 3 times since there are 3 hydrogens available. Note also that the "ethylenic-like" structure on the right involves a $\mathrm{...
Hyper-conjugation is in general a stabilizing interaction which involves the delocalization of σ-electrons belonging to the $\ce{C-H}$ bond of an alkyl group attached to an atom with an unshared p-orbital. The σ-electrons of a $\ce{C-H}$ bond of an alkyl group enter into partial conjugation with the attached unsaturate...
8,412
What is hyperconjugation and how do you know if there is hyperconjugation in a compound? Which orbitals are involved in hyperconjugation?
2014/02/10
[ "https://chemistry.stackexchange.com/questions/8412", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/4432/" ]
Hyperconjugation is the interaction between adjacent orbital (empty $\mathrm{p}$ for cation, $\pi$ for alkene) with $\sigma$ bond, while common conjugation is between adjacent orbital and $\pi$ bond. As one example, one reason why more alkyl substituted alkenes are more stable than less substituted ones is because mor...
Hyper-conjugation is in general a stabilizing interaction which involves the delocalization of σ-electrons belonging to the $\ce{C-H}$ bond of an alkyl group attached to an atom with an unshared p-orbital. The σ-electrons of a $\ce{C-H}$ bond of an alkyl group enter into partial conjugation with the attached unsaturate...
62,464,653
Documentation states that Azure Durable Function orchestrations code should be deterministic, cos of replays. In my case, I have some data in Azure Table Storage, that I need to fetch in workflow. The workflow is recursive and the data in Azure Table Storage can change during execution, and it is OK to have stale state...
2020/06/19
[ "https://Stackoverflow.com/questions/62464653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1045178/" ]
> > and I'd expect this to work > > > Then your expectations are wrong :-) Perhaps you'd get closer if you read [the regex documentation](https://perldoc.perl.org/perlre.html) (or [the tutorial](https://perldoc.perl.org/perlretut.html)). Some problems: 1. You match with `\w+`. The escape sequence `\w` matches le...
Try this: ``` cat /tmp/foo | perl -nle 'while (/<([^>]+)>/g){ print $1; }' ``` It should work. Tried it with ``` echo "Casperfoo DataOps <casperf@domain .com>;Booya Support <iptsupport@domain .com>; Tripped Support <Tsupport@domain capital.com>; Smith, Joe: IB Reference Data (NYK) <joe.smith@domain .com>; Johnson, ...
22
For example I answered a question and an external site helped me in finding that solution. Is it okay to add a reference to that site in my answer?
2013/12/19
[ "https://ebooks.meta.stackexchange.com/questions/22", "https://ebooks.meta.stackexchange.com", "https://ebooks.meta.stackexchange.com/users/-1/" ]
Current SE policy discourages link-only answers and require the answers to be self-contained, so that they remain valid after the external link is no more available. Links in answers are welcomed, as long as they provide additional reference etc. (so no ads). You are therefore free and welcomed to put links to externa...
If you have copied any content verbatim, you **have** to give a reference to the other site. Copying without admonition is a reason to remove an answer on SO/SE. If you looked things up on another site, but completely reworded information in your own answer, you don't really have to put in a reference. But it is still...
22
For example I answered a question and an external site helped me in finding that solution. Is it okay to add a reference to that site in my answer?
2013/12/19
[ "https://ebooks.meta.stackexchange.com/questions/22", "https://ebooks.meta.stackexchange.com", "https://ebooks.meta.stackexchange.com/users/-1/" ]
The Ebooks Stack Exchange is not a search engine or a collection of links. It's okay to add links for further reading, but this site was created to build a *definitive* collection of ***answers*** to ebook questions. The folks here will work hard to curate this collection of knowledge, so when someone comes looking f...
If you have copied any content verbatim, you **have** to give a reference to the other site. Copying without admonition is a reason to remove an answer on SO/SE. If you looked things up on another site, but completely reworded information in your own answer, you don't really have to put in a reference. But it is still...
22
For example I answered a question and an external site helped me in finding that solution. Is it okay to add a reference to that site in my answer?
2013/12/19
[ "https://ebooks.meta.stackexchange.com/questions/22", "https://ebooks.meta.stackexchange.com", "https://ebooks.meta.stackexchange.com/users/-1/" ]
If you have copied any content verbatim, you **have** to give a reference to the other site. Copying without admonition is a reason to remove an answer on SO/SE. If you looked things up on another site, but completely reworded information in your own answer, you don't really have to put in a reference. But it is still...
Put another way, if there is an external resource or reference that helps to answer the question, then by all means link to it. To avoid requiring users to go to another site to get the information, and avoiding link rot issues, excerpt relevant parts of the linked resource in your response. We want to have the relevan...
22
For example I answered a question and an external site helped me in finding that solution. Is it okay to add a reference to that site in my answer?
2013/12/19
[ "https://ebooks.meta.stackexchange.com/questions/22", "https://ebooks.meta.stackexchange.com", "https://ebooks.meta.stackexchange.com/users/-1/" ]
The Ebooks Stack Exchange is not a search engine or a collection of links. It's okay to add links for further reading, but this site was created to build a *definitive* collection of ***answers*** to ebook questions. The folks here will work hard to curate this collection of knowledge, so when someone comes looking f...
Current SE policy discourages link-only answers and require the answers to be self-contained, so that they remain valid after the external link is no more available. Links in answers are welcomed, as long as they provide additional reference etc. (so no ads). You are therefore free and welcomed to put links to externa...
22
For example I answered a question and an external site helped me in finding that solution. Is it okay to add a reference to that site in my answer?
2013/12/19
[ "https://ebooks.meta.stackexchange.com/questions/22", "https://ebooks.meta.stackexchange.com", "https://ebooks.meta.stackexchange.com/users/-1/" ]
Current SE policy discourages link-only answers and require the answers to be self-contained, so that they remain valid after the external link is no more available. Links in answers are welcomed, as long as they provide additional reference etc. (so no ads). You are therefore free and welcomed to put links to externa...
Put another way, if there is an external resource or reference that helps to answer the question, then by all means link to it. To avoid requiring users to go to another site to get the information, and avoiding link rot issues, excerpt relevant parts of the linked resource in your response. We want to have the relevan...
22
For example I answered a question and an external site helped me in finding that solution. Is it okay to add a reference to that site in my answer?
2013/12/19
[ "https://ebooks.meta.stackexchange.com/questions/22", "https://ebooks.meta.stackexchange.com", "https://ebooks.meta.stackexchange.com/users/-1/" ]
The Ebooks Stack Exchange is not a search engine or a collection of links. It's okay to add links for further reading, but this site was created to build a *definitive* collection of ***answers*** to ebook questions. The folks here will work hard to curate this collection of knowledge, so when someone comes looking f...
Put another way, if there is an external resource or reference that helps to answer the question, then by all means link to it. To avoid requiring users to go to another site to get the information, and avoiding link rot issues, excerpt relevant parts of the linked resource in your response. We want to have the relevan...
32,213,675
``` <td> <a runat="server" href="~/url.aspx"> <img src="<%= ResolveClientUrl("~/images/image1") %>" id="submissions" border="0" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('submissions','','<%= ResolveClientUrl("~/images/image2") %>',1)"></a></td> ``` When I try to run this code wit...
2015/08/25
[ "https://Stackoverflow.com/questions/32213675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3674529/" ]
Simply use `innerHTML` attribute to put HTML inside your element instead of `createTexteNode`, here's what you need: ``` var para = document.createElement("P"); para.innerHTML = "This is a paragraph. Can I do this: <a \"blabla\">like so?</a>"; document.body.appendChild(para); ``` Because as its name says, `document....
The simplest way to do this would be: ``` para.innerHTML = 'This is a paragraph. Here is a link: <a href="blabla">like so?</a>'; ```
32,213,675
``` <td> <a runat="server" href="~/url.aspx"> <img src="<%= ResolveClientUrl("~/images/image1") %>" id="submissions" border="0" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('submissions','','<%= ResolveClientUrl("~/images/image2") %>',1)"></a></td> ``` When I try to run this code wit...
2015/08/25
[ "https://Stackoverflow.com/questions/32213675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3674529/" ]
Simply use `innerHTML` attribute to put HTML inside your element instead of `createTexteNode`, here's what you need: ``` var para = document.createElement("P"); para.innerHTML = "This is a paragraph. Can I do this: <a \"blabla\">like so?</a>"; document.body.appendChild(para); ``` Because as its name says, `document....
I would use the [DOM API](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) approach instead of using `innerHTML` for readability, maintainability and [security reasons](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#Security_considerations). Sure `innerHTML` has been around fo...
2,929,384
Am really having a hard-time cracking this one. And no, its not homework. Am jst doing more examples in the textbook to see if i get the concept well It says, we define the polynomial $P\_n (x)$ for n being a member of all Natural numbers. $$\begin{align} P\_0 (x) &= 1\\ P\_{n + 1} &= (x - 1)P\_n (x) + x, n \geq 0 ...
2018/09/24
[ "https://math.stackexchange.com/questions/2929384", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273134/" ]
Without the option, this is a fair game. If the option is priced on the cheap side of fair, we buy the option and the option favors the player. If the option is rich, we don't buy the option. Assuming the option is cheap, we plan to exercise if our first card is in $[1,7]$ and we won't exercise if the first card is i...
If you are allowed one switch, your winning probability is $p(52) = \frac{5}{8}$, so you should be willing to pay up to 2 dollars for the right to switch. $p(N) = \sum\_{i=1}^{N} \frac{1}{N} \max(\frac{i-1}{N} + \frac{1}{2N}, \frac{1}{2}).$ so: $p(2n) = \frac{5}{8}$ $p(2n+1) = \frac{5}{8} - \frac{1}{(2n+1)^2}$ (I ...
2,929,384
Am really having a hard-time cracking this one. And no, its not homework. Am jst doing more examples in the textbook to see if i get the concept well It says, we define the polynomial $P\_n (x)$ for n being a member of all Natural numbers. $$\begin{align} P\_0 (x) &= 1\\ P\_{n + 1} &= (x - 1)P\_n (x) + x, n \geq 0 ...
2018/09/24
[ "https://math.stackexchange.com/questions/2929384", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273134/" ]
Without the option, this is a fair game. If the option is priced on the cheap side of fair, we buy the option and the option favors the player. If the option is rich, we don't buy the option. Assuming the option is cheap, we plan to exercise if our first card is in $[1,7]$ and we won't exercise if the first card is i...
Problem Statement ================= So to be clear the problem I'm about to solve is... Both have \$10 in and can win the full \$20. Loser gets nothing. One player is offered the option to be shown a card and if he would like to, switch to that card. The player does not get to look at his own card before switching. Ho...
24,125
I'm stuck trying to exclude the shipping cost from the order-totals table in the invoice email. At the moment, the invoice email looks like this: (I included a little translation for the most important fields) ![current result](https://i.stack.imgur.com/W8fyv.png) As you can see: the grand total (15.80€) includes th...
2014/06/17
[ "https://magento.stackexchange.com/questions/24125", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/9064/" ]
usually we do in the following way do a local ovveride of app/code/core/Mage/Checkout/Block/Cart/Totals.php and look for the function ``` public function renderTotal($total, $area = null, $colspan = 1) { $code = $total->getCode(); if ($total->getAs()) { $code = $total->getAs(); } if($code == ...
Go To > > System > configuration > > > In the left sidebar > > Sales > Shipping Methods : > > > *Enable Free Shipping* and disable the one's that are not required
69,411,134
I'm creating a web client for joining Teams meetings with the ACS Calling SDK. I'm having trouble loading the *diagnostics* API. Microsoft provides this page: <https://learn.microsoft.com/en-us/azure/communication-services/concepts/voice-video-calling/call-diagnostics> You are supposed to get the diagnostics this way...
2021/10/01
[ "https://Stackoverflow.com/questions/69411134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1156960/" ]
Catch the error, check the status and use it however you want ``` axios.post(`/api/myendpoint`, { data: 2 }, { headers: {'ACCEPT': 'application/json'} }, .then(response => { … }) .catch((error) => { if (error.response && error.response.status === 400) { let errorVar = error.response.data; conso...
you should catch the error and return the body like this: ``` .catch(error) => { console.log(error.response.data); } ``` Details in the [Axios document](https://www.npmjs.com/package/axios#handling-errors)
1,327,202
I created several virtual machines using Oracle Virtual Box. The total hard drive spaces these machines took up was ~40GB. I have since deleted these virtual machines from Virtual Box and My Computer is saying I have 58GB free when I should have ~40GB more free after deleting the virtual machines. Info: * I am on Wi...
2018/05/30
[ "https://superuser.com/questions/1327202", "https://superuser.com", "https://superuser.com/users/135490/" ]
If you want a quick fix and you are within secured intranet, you can use this on the server side: 1. Logon to Windows Server as a local administrator and open Server Manager from the desktop Task Bar or Start Screen. 2. In the left pane of Server Manager, click Local Server. Wait a few seconds for the information abou...
There's way to fix this issue as describe in [KB4093492](https://support.microsoft.com/en-us/help/4093492/credssp-updates-for-cve-2018-0886-march-13-2018). Basically have both client and server fully patch, and if that's not possible update the client computer's registry with this value: ``` Registry path : HKLM\Sof...
34,015,562
I have td in html table like this: I have to add or remove class `highlight` onclick of each td and based on returned data from server: ``` $("body").on("click","table#idnum tbody tr td",function(event){ var tdid = this.id; var url = '...server url ..........'; var data = {tdid:tdid}; $.ajax({ url, da...
2015/12/01
[ "https://Stackoverflow.com/questions/34015562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4329070/" ]
My solution is a local variable reuseIdentifier is initialized with the Apple defined variable cell.reuseIdentifier.
How about trying delete the DerivedData folder
52,720,900
Given this typescript (2.7.2) interface: ``` export interface A { b?: string; c?: boolean; } ``` This will print boolean 'false' as expected: ``` let a: A = {b: ''}; if (a.b && a.b.length > 0) { a.c = true; } else { a.c = false; } console.log(a.c); ``` However, this prints an empty '' string: ``` let a: ...
2018/10/09
[ "https://Stackoverflow.com/questions/52720900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2294055/" ]
`a.b && a.b.length > 0` which is equivalent to `"" && false` because empty string evaluates falsy. Expression `"" && false` evaluates to `""`. that is why `a.c` is `""`. Refactor it like this, ``` a.c = a.b && a.b.length > 0 ? true : false ```
This is more of a Javascript truthy/falsy issue. The `&&` operator will return the value of one of the operands. See [docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators): > > However, the && and || operators actually return the value of one of the specified operands, s...
52,720,900
Given this typescript (2.7.2) interface: ``` export interface A { b?: string; c?: boolean; } ``` This will print boolean 'false' as expected: ``` let a: A = {b: ''}; if (a.b && a.b.length > 0) { a.c = true; } else { a.c = false; } console.log(a.c); ``` However, this prints an empty '' string: ``` let a: ...
2018/10/09
[ "https://Stackoverflow.com/questions/52720900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2294055/" ]
`a.b && a.b.length > 0` which is equivalent to `"" && false` because empty string evaluates falsy. Expression `"" && false` evaluates to `""`. that is why `a.c` is `""`. Refactor it like this, ``` a.c = a.b && a.b.length > 0 ? true : false ```
Leaning on the reply from @nrgwsth you can refactor further while keeping your structure by replacing `a.b` with `!!a.b` in your conditions like this: ``` let a: A = {b: ''}; a.c = !!a.b && a.b.length > 0; console.log(a.c); ``` Applying `!a.b` converts `a.b` to its boolean negative, applying `!!a.b` gives you the po...
52,720,900
Given this typescript (2.7.2) interface: ``` export interface A { b?: string; c?: boolean; } ``` This will print boolean 'false' as expected: ``` let a: A = {b: ''}; if (a.b && a.b.length > 0) { a.c = true; } else { a.c = false; } console.log(a.c); ``` However, this prints an empty '' string: ``` let a: ...
2018/10/09
[ "https://Stackoverflow.com/questions/52720900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2294055/" ]
This is more of a Javascript truthy/falsy issue. The `&&` operator will return the value of one of the operands. See [docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators): > > However, the && and || operators actually return the value of one of the specified operands, s...
Leaning on the reply from @nrgwsth you can refactor further while keeping your structure by replacing `a.b` with `!!a.b` in your conditions like this: ``` let a: A = {b: ''}; a.c = !!a.b && a.b.length > 0; console.log(a.c); ``` Applying `!a.b` converts `a.b` to its boolean negative, applying `!!a.b` gives you the po...
18,316
I am newly licensed (Technician) and bought a UV-5RA as a cheap way to check out what's going on in my area and see if I'm finding it interesting enough to get a better UHF/VHF HT. The other day I was listening to a conversation happening on a local repeater and when one of the guys gave their call I looked it up for ...
2021/04/14
[ "https://ham.stackexchange.com/questions/18316", "https://ham.stackexchange.com", "https://ham.stackexchange.com/users/19193/" ]
Many radio manufacturers are aware that people don't want to hear CTCSS tones - so they put high-pass filters on both the output (speaker) and input (microphone). That eliminates the tone before it gets to your ears, and will also prevent an errant tone near the microphone from triggering a repeater somewhere. Some o...
The volume of the tones is typically low enough with respect to the voice signal that you can't hear it. Occasionally the tone generator in a radio will be poorly calibrated, and you do hear it. Usually the radio has a tone scan function, and you can use that to find out what tone is being used. You can also turn on t...
18,316
I am newly licensed (Technician) and bought a UV-5RA as a cheap way to check out what's going on in my area and see if I'm finding it interesting enough to get a better UHF/VHF HT. The other day I was listening to a conversation happening on a local repeater and when one of the guys gave their call I looked it up for ...
2021/04/14
[ "https://ham.stackexchange.com/questions/18316", "https://ham.stackexchange.com", "https://ham.stackexchange.com/users/19193/" ]
Many radio manufacturers are aware that people don't want to hear CTCSS tones - so they put high-pass filters on both the output (speaker) and input (microphone). That eliminates the tone before it gets to your ears, and will also prevent an errant tone near the microphone from triggering a repeater somewhere. Some o...
Same with SDR software. My SDR code runs on a iPhone that's connected to "HiFi" audio transducers. So I had to add a 270 Hz high-pass biquad IIR audio filtering subroutine to get rid of annoying hum when listening to NFM from local 2M repeaters. (I obviously switch that subroutine out when listening to broadcast wideba...
32,223
Can any properties of a ring other than being a field be captured by the geometry of its 2-dimensional free module? **Background:** In his wonderful, wonderful book Geometric Algebra, Emil Artin describes the following way of putting coordinates on affine geometries: Take a 2-dimensional Affine geometry A, that is, a...
2010/07/16
[ "https://mathoverflow.net/questions/32223", "https://mathoverflow.net", "https://mathoverflow.net/users/3988/" ]
I'm not sure that this is the answer you are looking for, but you might be interested in [Mnev's universality theorem.](http://en.wikipedia.org/wiki/Mnev%2527s_universality_theorem) Unwinding the language of semialgebraic sets, this says the following: Consider any finite set of polynomial equations and inequalities wi...
You don´t need a ring, you need a conical group, that is a group with a one-parameter of contracting automorphisms. This type of generalization of affine geometry following Artin style has been done here: [Infinitesimal affine geometry of metric spaces endowed with a dilatation structure, Houston Journal of Mathemati...
20,013,366
it seems i have run into a slight problem in my first shot at using PDO and prepared statements. Basically I am working on a profile page which includes an Inbox. I am using try/catch to produce the inbox: ``` <?php $sqlin = $db->prepare("SELECT * FROM message WHERE recipientID = (SELECT id FROM members WHERE username...
2013/11/16
[ "https://Stackoverflow.com/questions/20013366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2961387/" ]
I've edited your code with comments to explain what it is doing (and why it is not behaving as you expect): ``` int main( int argc, char* argv[]) { SDL_Startup(); // Set `Playing` to false while(Playing == false && quit == false) { // Do stuff which applies when `Playing` is false // // At some point, set `...
It is pretty simple. In your current implementation you will never return to your first while loop if your second loop is finished, because you reach the `return` of your main routine. I guess you should always use only one main loop for your game.
57,484,667
I am trying to add all Input / Output Octet AVPs to calculate total data used against each Rating-Group. The problem is, not always both Input / Output Octet AVPs will present in each Service-Data-Container AVP. While using tshark command with Tfields or Tjson option, the output looses the original hierarchy, making it...
2019/08/13
[ "https://Stackoverflow.com/questions/57484667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8498147/" ]
``` from ortools.sat.python import cp_model import collections class SolutionPrinter(cp_model.CpSolverSolutionCallback): """Print intermediate solutions.""" def __init__(self, variables): cp_model.CpSolverSolutionCallback.__init__(self) self.__variables = variables self.__num_vars = le...
Assuming you have these conditions ``` x = 2.5 y = 4 z = 2.9 ``` then you could build a list of values, and then apply `lambda`, `map` and `sum` to find things out. For example: ``` # Create the list of values values = [x, y, z] # Apply a lambda to each element of the list, checking if they # are within [2,3]. Thi...