qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
25,239
Today we studied about [mechanical stepless drives](http://en.wikipedia.org/wiki/Continuously_variable_transmission), which appear to be used quite widely in industry machines, such as CNC lathes. The concept of varying the transmission ratio arbitrary, without fixed steps, seems tempting for a bike. Has it ever been ...
2014/10/21
[ "https://bicycles.stackexchange.com/questions/25239", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/3927/" ]
There have been designs, but cyclists tend to be picky about increases in weight or losses in efficiency. Bicycles do not have the problems of large spinning masses or rough clutching at low speed, and we seem to do OK with discrete steps in the gear ratio.
The [NuVinci® N360](http://www.fallbrooktech.com/cycling/n360) is a continuous variable transmission that is roller based. It is marketed and used mainly on hybrid and low maintenance city bikes. They must have had some market success as they have been around since 2006. I recall seeing them at Interbike around that ti...
36,001,189
Years ago, when compiling with GCC, the following defines in a #include .h file could be pre-processed for use in info.plist: ``` #define MAJORVERSION 2 #define MINORVERSION 6 #define MAINTVERSION 4 <key>CFBundleShortVersionString</key> <string>MAJORVERSION.MINORVERSION.MAINTVERSION</string> ``` ...which would tur...
2016/03/15
[ "https://Stackoverflow.com/questions/36001189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
Here is the Python script I use to increment my build number, whenever a source code change is detected, and update one or more `Info.plist` files within the project. It was created to solve the issue raised in [this question](https://stackoverflow.com/questions/9258344/better-way-of-incrementing-build-number) I asked...
First, I would like to clarify what each key is meant to do: * `CFBundleShortVersionString` A string describing the released version of an app, using [semantic versioning](http://semver.org). This string will be displayed in the App Store description. * `CFBundleVersion` A string specifing the build version (release...
27,981,626
Can anyone please explain to me exactly what happens internally when we compile and run the below code... ``` class ObjTest{ public static void main(String [] args){ while(true){ String str = new String("Hello"); } } } ```
2015/01/16
[ "https://Stackoverflow.com/questions/27981626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4461138/" ]
Each iteration of ths infinite loop creates a new String instance. The instance created in the previous iteration becomes eligible for garbage collection, so whether you end up with an out of memory error or not depends on whether the garbage collector frees those old instances quicker than the loop creates new ones.
"while" execute the block statement while the condition is true. And you are passing "true" making the condition be always true. It will never stop
27,981,626
Can anyone please explain to me exactly what happens internally when we compile and run the below code... ``` class ObjTest{ public static void main(String [] args){ while(true){ String str = new String("Hello"); } } } ```
2015/01/16
[ "https://Stackoverflow.com/questions/27981626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4461138/" ]
Each iteration of ths infinite loop creates a new String instance. The instance created in the previous iteration becomes eligible for garbage collection, so whether you end up with an out of memory error or not depends on whether the garbage collector frees those old instances quicker than the loop creates new ones.
You have an infinite loop creating a String object. In every iteration a new object is created so old objects are available for garbage collector.
8,713,134
So i have implemented the game of life and now have to put every new generated field into a gif or pbm and at the end with a command I create an animated gif. The below function is given but I don't get the first parameter, a pointer const char? I see in the function that is the filename, but how do I write that, I'm...
2012/01/03
[ "https://Stackoverflow.com/questions/8713134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1123776/" ]
There is no guaranteed way. Deferred name resolution (as in if a table isn't there, give an error) applies at compile time, not create time. Although there is [some evidence to show that code may run with missing tables](https://stackoverflow.com/q/4556304/27535) It has been requested though: see the proposed [`SET ...
Please check my answer for the related question here: [I'm looking for a reliable way to verify T-SQL stored procedures. Anybody got one?](https://stackoverflow.com/questions/2784866/im-looking-for-a-reliable-way-to-verify-t-sql-stored-procedures-anybody-got-on/27399350#27399350) I have not checked it with 2 database...
48,651
I am thinking about this scenario of throwing a satellite to Mars orbit with a high spin, Can we just throw that? one hypothesis can be that high-frequency spinning generates apparent gravity so it might have enough mass to follow mars’ orbit and reach it without using any energy but If anyone has his own expertise on ...
2020/11/21
[ "https://space.stackexchange.com/questions/48651", "https://space.stackexchange.com", "https://space.stackexchange.com/users/38359/" ]
Your question isn't clear but I think I understand what you're after: Put your satellite at the end of a rope, spin it around and release it when it's moving at the right velocity. There are a couple of problems with this: 1. Unless your rope is exceedingly long you are going to subject your satellite to tremendous a...
How about if we just try it for low Earth orbit at first? If we can't do that, we definitely can't get it to Mars. OK, orbital velocity for low Earth orbit is about 7 km/sec. But if you are going to hurl something into orbit, it will have to start out with a lot *more* velocity than 7 km/sec, because it's going to l...
14,822,416
Im trying get an output to use on a different CALL. output i want is ``` Row | Col | Data | Seq <70% | Voters | 5519 | 8 <80% | Voters | 4352 | 8 <90% | Voters | 3251 | 8 100% | Voters | 2511 | 8 ``` the code i have is ``` SELECT CASE WHEN (poll_propensity >= 0.70 AND perm_ab...
2013/02/11
[ "https://Stackoverflow.com/questions/14822416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2062934/" ]
Simply change the orders of the WHEN statements since 1 > .7 the 1's are being lumped in with the .7 you need to start with .1 and then go down to the .7. ``` SELECT CASE WHEN (poll_propensity >= 1 AND perm_absentee = 'N' AND mail_propensity = 0) THEN '100%' WHEN (poll_propensity >= 0.90 AND perm...
It looks like you want the resultset returned from a statement like this: ``` SELECT r.Row , 'Voters' AS Col , CASE r.Row WHEN '< 70%' THEN IFNULL(d.c70,0) WHEN '< 80%' THEN IFNULL(d.c80,0) WHEN '< 90%' THEN IFNULL(d.c90,0) WHEN '100%' THEN IFNULL(d.c100,0) END AS D...
33,034,207
Following is my code here actually o/p should be hi..but it is giving no ``` <?php $arr=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $c='xyz,ccc'; if(in_array(isset($c) && $c,$arr)) { echo 'hi'; } else { echo 'no'; } ?> ``` output...
2015/10/09
[ "https://Stackoverflow.com/questions/33034207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5426157/" ]
``` <?php $listDays=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $day='Sunday'; //You cant test both days ! Just one value at a time if(true === in_array($day, $listDays)) { echo 'hi'; } else { echo 'no'; } ?> ``` Or option two if yo...
Change your code to: ``` <?php $arr=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $c='Sunday,Monday'; if(in_array(isset($c) && $c,$arr)) { echo 'hi'; } else { echo 'no'; } ```
33,034,207
Following is my code here actually o/p should be hi..but it is giving no ``` <?php $arr=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $c='xyz,ccc'; if(in_array(isset($c) && $c,$arr)) { echo 'hi'; } else { echo 'no'; } ?> ``` output...
2015/10/09
[ "https://Stackoverflow.com/questions/33034207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5426157/" ]
Side note, this is bad code: ``` in_array(isset($weekendArr) && $weekendArr,$arr) ``` do it like ``` isset($weekendArr) && in_array($weekendArr,$arr) ``` and in\_array is not strict so this ``` in_array(true,array('w','s')) ``` will be allways TRUE do it with: ``` in_array(true,array('w','s'),true) ``` an...
Change your code to: ``` <?php $arr=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $c='Sunday,Monday'; if(in_array(isset($c) && $c,$arr)) { echo 'hi'; } else { echo 'no'; } ```
33,034,207
Following is my code here actually o/p should be hi..but it is giving no ``` <?php $arr=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $c='xyz,ccc'; if(in_array(isset($c) && $c,$arr)) { echo 'hi'; } else { echo 'no'; } ?> ``` output...
2015/10/09
[ "https://Stackoverflow.com/questions/33034207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5426157/" ]
Side note, this is bad code: ``` in_array(isset($weekendArr) && $weekendArr,$arr) ``` do it like ``` isset($weekendArr) && in_array($weekendArr,$arr) ``` and in\_array is not strict so this ``` in_array(true,array('w','s')) ``` will be allways TRUE do it with: ``` in_array(true,array('w','s'),true) ``` an...
``` <?php $listDays=array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); $day='Sunday'; //You cant test both days ! Just one value at a time if(true === in_array($day, $listDays)) { echo 'hi'; } else { echo 'no'; } ?> ``` Or option two if yo...
49,768,232
I can't figure out how to auto-restart mongodb on Ubuntu 16.04 in the event that it crashes due to memory-pressure. I'm using supervisord for other scripts etc, but mongod is through systemctl and I'm not sure how that ties into it.
2018/04/11
[ "https://Stackoverflow.com/questions/49768232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577575/" ]
Figured it out: 1. Edit your mongod service: `sudo vim /lib/systemd/system/mongod.service` 2. Add `Restart=always` under `service` 3. Reload systemctl daemon: `sudo systemctl daemon-reload` Now whenever mongod gets killed. It'll get respawned by systemctl.
When you install `mongoDB` just run `systemctl enable mongod.service` on terminal. This will make your mongoDB service auto-start on every restart.
3,489,028
I have the method: ``` def checkAgainstDate(): currentDate = date.today() currentMonth = date.today().month if currentMonth == 1 year = currentDate.year-1 return date(year, 11, 01) elif currentMonth == 2: year = currentDate.year-1 return date(year, 12, 01) ...
2010/08/15
[ "https://Stackoverflow.com/questions/3489028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144983/" ]
[`dateutil`](http://labix.org/python-dateutil) is an amazing thing. It really should become stdlib someday. ``` >>> from dateutil.relativedelta import relativedelta >>> from datetime import datetime >>> (datetime.now() - relativedelta(months=2)).replace(day=1) datetime.datetime(2010, 6, 1, 13, 16, 29, 643077) >>> (dat...
Convert to an "absolute month number", subtract 2, convert back to year & month: ``` currentdate = date.today() monthindex = 12*currentdate.year + (currentdate.month-1) -2 return datetime( monthindex // 12, monthindex % 12 + 1, 1) ```
46,529,238
I need split array by 2-pair portions, only nearby values. For example I have following array: ``` select array[1,2,3,4,5] ``` And I want to get 4 rows with following values: ``` {1,2} {2,3} {3,4} {4,5} ``` Can I do it by SQL query?
2017/10/02
[ "https://Stackoverflow.com/questions/46529238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3343155/" ]
``` select a from ( select array[e, lead(e) over()] as a from unnest(array[1,2,3,4,5]) u(e) ) a where not exists ( select 1 from unnest(a) u (e) where e is null ); a ------- {1,2} {2,3} {3,4} {4,5} ```
One option is to do this with a recursive cte. Starting from the first position in the array and going up to the last. ``` with recursive cte(a,val,strt,ed,l) as (select a,a[1:2] as val,1 strt,2 ed,cardinality(a) as l from t union all select a,a[strt+1:ed+1],strt+1,ed+1,l from cte where ed<l ) select val from ct...
8,047
Both [education](https://scifi.stackexchange.com/questions/tagged/education "show questions tagged 'education'") and [murder](https://scifi.stackexchange.com/questions/tagged/murder "show questions tagged 'murder'") have > 5 questions, no wiki excerpt, and a poor "tag score". Should we give them wikis and define a pro...
2016/01/26
[ "https://scifi.meta.stackexchange.com/questions/8047", "https://scifi.meta.stackexchange.com", "https://scifi.meta.stackexchange.com/users/-1/" ]
I'm not running for mod, so I'll help you out with the more controversial solution: **Burn both tags.** Within the context of this Stack, it makes no sense to be an expert in [murder](https://scifi.stackexchange.com/questions/tagged/murder "show questions tagged 'murder'") or [education](https://scifi.stackexchange.c...
[education](https://scifi.stackexchange.com/questions/tagged/education "show questions tagged 'education'") to me looks middle-of-the-road enough that it's not going anywhere soon. It's one of the tags in the "other aspects of a question" category I'm not a fan of, but also not aggressively against. But the questions m...
35,411,972
I would like to write a loop in bash which executes until a certain command stops failing (returning non-zero exit code), like so: ``` while ! my_command; do # do something done ``` But inside this loop I need to check which exit code `my_command` returned, so I tried this: ``` while ! my_command; do if [ $...
2016/02/15
[ "https://Stackoverflow.com/questions/35411972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308392/" ]
In addition to the well-known `while` loop, POSIX provides an `until` loop that eliminates the need to negate the exit status of `my_command`. ``` # To demonstrate my_command () { read number; return $number; } until my_command; do if [ $? -eq 5 ]; then echo "Error was 5" else echo "Error was ...
If `true` command hurt your sensibility, you could write: ``` while my_command ; ret=$? ; [ $ret -ne 0 ];do echo do something with $ret done ``` This could be simplified: ``` while my_command ; ((ret=$?)) ;do echo do something with $ret done ``` But if you don't need *ResultCode*, you could simply: `...
35,411,972
I would like to write a loop in bash which executes until a certain command stops failing (returning non-zero exit code), like so: ``` while ! my_command; do # do something done ``` But inside this loop I need to check which exit code `my_command` returned, so I tried this: ``` while ! my_command; do if [ $...
2016/02/15
[ "https://Stackoverflow.com/questions/35411972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308392/" ]
If `true` command hurt your sensibility, you could write: ``` while my_command ; ret=$? ; [ $ret -ne 0 ];do echo do something with $ret done ``` This could be simplified: ``` while my_command ; ((ret=$?)) ;do echo do something with $ret done ``` But if you don't need *ResultCode*, you could simply: `...
You can get the status of a negated command from the `PIPESTATUS` built-in variable: ``` while ! my_command ; do some_code_dependent_on_exit_code "${PIPESTATUS[0]}" done ``` chepner's solution is better in this case, but `PIPESTATUS` is sometimes useful for similar problems.
35,411,972
I would like to write a loop in bash which executes until a certain command stops failing (returning non-zero exit code), like so: ``` while ! my_command; do # do something done ``` But inside this loop I need to check which exit code `my_command` returned, so I tried this: ``` while ! my_command; do if [ $...
2016/02/15
[ "https://Stackoverflow.com/questions/35411972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308392/" ]
If `true` command hurt your sensibility, you could write: ``` while my_command ; ret=$? ; [ $ret -ne 0 ];do echo do something with $ret done ``` This could be simplified: ``` while my_command ; ((ret=$?)) ;do echo do something with $ret done ``` But if you don't need *ResultCode*, you could simply: `...
So in my case I also need to ignore some exit codes and want to provide some useful output to the user so I wrote this up: ``` retrycmd(){ MSG=$1 IGNORE=$2 shift 2 local SLEEP_T=5 local L_CNT=5 local C_CNT=0 while ((C_CNT++ < ${L_CNT})) && ! $@;do RET=${PIPESTATUS[0]} #echo "RET: ${RET}" for ...
35,411,972
I would like to write a loop in bash which executes until a certain command stops failing (returning non-zero exit code), like so: ``` while ! my_command; do # do something done ``` But inside this loop I need to check which exit code `my_command` returned, so I tried this: ``` while ! my_command; do if [ $...
2016/02/15
[ "https://Stackoverflow.com/questions/35411972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308392/" ]
In addition to the well-known `while` loop, POSIX provides an `until` loop that eliminates the need to negate the exit status of `my_command`. ``` # To demonstrate my_command () { read number; return $number; } until my_command; do if [ $? -eq 5 ]; then echo "Error was 5" else echo "Error was ...
You can get the status of a negated command from the `PIPESTATUS` built-in variable: ``` while ! my_command ; do some_code_dependent_on_exit_code "${PIPESTATUS[0]}" done ``` chepner's solution is better in this case, but `PIPESTATUS` is sometimes useful for similar problems.
35,411,972
I would like to write a loop in bash which executes until a certain command stops failing (returning non-zero exit code), like so: ``` while ! my_command; do # do something done ``` But inside this loop I need to check which exit code `my_command` returned, so I tried this: ``` while ! my_command; do if [ $...
2016/02/15
[ "https://Stackoverflow.com/questions/35411972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308392/" ]
In addition to the well-known `while` loop, POSIX provides an `until` loop that eliminates the need to negate the exit status of `my_command`. ``` # To demonstrate my_command () { read number; return $number; } until my_command; do if [ $? -eq 5 ]; then echo "Error was 5" else echo "Error was ...
So in my case I also need to ignore some exit codes and want to provide some useful output to the user so I wrote this up: ``` retrycmd(){ MSG=$1 IGNORE=$2 shift 2 local SLEEP_T=5 local L_CNT=5 local C_CNT=0 while ((C_CNT++ < ${L_CNT})) && ! $@;do RET=${PIPESTATUS[0]} #echo "RET: ${RET}" for ...
35,411,972
I would like to write a loop in bash which executes until a certain command stops failing (returning non-zero exit code), like so: ``` while ! my_command; do # do something done ``` But inside this loop I need to check which exit code `my_command` returned, so I tried this: ``` while ! my_command; do if [ $...
2016/02/15
[ "https://Stackoverflow.com/questions/35411972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308392/" ]
You can get the status of a negated command from the `PIPESTATUS` built-in variable: ``` while ! my_command ; do some_code_dependent_on_exit_code "${PIPESTATUS[0]}" done ``` chepner's solution is better in this case, but `PIPESTATUS` is sometimes useful for similar problems.
So in my case I also need to ignore some exit codes and want to provide some useful output to the user so I wrote this up: ``` retrycmd(){ MSG=$1 IGNORE=$2 shift 2 local SLEEP_T=5 local L_CNT=5 local C_CNT=0 while ((C_CNT++ < ${L_CNT})) && ! $@;do RET=${PIPESTATUS[0]} #echo "RET: ${RET}" for ...
32,445,611
I have a two dimensional array e.g ``` 0 ,11 1 ,12 2, 13 3, 14 ``` so here I directly want to access element 13 only and want to compare with the value of some another element let's say x. How it could be done ?
2015/09/07
[ "https://Stackoverflow.com/questions/32445611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4563195/" ]
In the array above 13 is at index `array[2][1]`. Think of a 2 dimensional array as a normal array that contains arrays. The element 13 is in the 3rd array(index 2) in the 2d array in this case and it's the second element in this 3rd array(index 1). Combining this you get a 2d index of `[2][1]`. And to compare to a vari...
Essentially, you want to loop through both dimensions of the array. ``` for(int i = 0; i < array.length; i++) { for(int j = 0; j < array.length; j++) { if(array[i][j] == 13) { // Do something with array[i][j] } } } ```
15,124,913
I have a dataset with individuals names, addresses, phone numbers, etc. Some individuals appear multiple times, with slightly varying names/ and/or addressees and/or phone numbers. A snippet of the fake data is shown below: ``` first last address phone Jimmy Bamboo P.O. Box 1190 xxx-xx-xx...
2013/02/27
[ "https://Stackoverflow.com/questions/15124913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2117582/" ]
As I mentioned in the comments, this is not trivial. You have to decide the trade-off of programmer time/solution complexity with results. You will not achieve 100% results. You can only approach it, and the time and complexity cost will increase the closer to 100% you get. Start with an easy solution (exact matches), ...
You can calculate the pairwise matrix of Levenshtein distances. See this recent post for more info: <http://www.markvanderloo.eu/yaRb/2013/02/26/the-stringdist-package/>
52,041
Is it possible to install Sharepoint Server on Virtual PC and consume that server from the actual pc instance i.e. connect to the Sharepoint server on the virtual pc instance? How would I do this, what would be the IP Address for the connection, would it still be 127.0.0.1 even though it is on the Virtual PC? Cheers,...
2009/08/09
[ "https://serverfault.com/questions/52041", "https://serverfault.com", "https://serverfault.com/users/16137/" ]
Sure, this is definately possible. You will need to configure your VPC to allow this though: * You will need to set the VPC to use Bridged Networking. An exact how-to on this escapes me at the moment, but it's very very important. Bridged networking will allow your virtual PC to be visible to the rest of the network....
Absolutely. Your Virtual PC will use bridged networking, where it will share the network card with the physical host, but get its own IP address. If you're on a network which uses DHCP to supply clients with IP addresses you will notice that your virtual pc gets its own IP adress, and you can use that to access your sh...
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
Here's a quick class I wrote to make this easier. ``` using System.Web.Hosting; using System.Web.Optimization; // a more fault-tolerant bundle that doesn't blow up if the file isn't there public class BundleRelaxed : Bundle { public BundleRelaxed(string virtualPath) : base(virtualPath) { } p...
I got the same question! It seems to with IIS Express. I change the IIS Express' URL for Project Like: ``` "http://localhost:3555/" ``` then the problem gone.
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
I had the same issue. the problem in my case was that the script's folder with all the bootstrap/jqueries scripts was not in the wwwroot folder. once I added the script's folder to wwwroot the error went away.
I got the same question! It seems to with IIS Express. I change the IIS Express' URL for Project Like: ``` "http://localhost:3555/" ``` then the problem gone.
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
I had this issue when I opened a VS2017 project in VS2015, built the solution and then uploaded the DLLs. Rebuilding it in VS2017 and re-uploading the DLLs fixed the issue.
None of these answers helped me since I created my `jsx` files in a weird way. My code was working in localhost mode but failed in production. The fix for me was to go into the `csproj` file and change the file paths from `<None ...` to `<Content ...`
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
I had created a new `Angular` application and written ``` bundles.Add(new ScriptBundle("~/bundles/app") .IncludeDirectory("~/Angular", "*.js") .IncludeDirectory("~/Angular/directives/shared", "*.js") .IncludeDirectory("~/Angular/directives/main", "*.js") .IncludeDirectory("~/Angular/services", "*.js"))...
My problem was that my site had no files to bundle. However, I had created the site with an MVC template, which includes jQuery scripts. The bundle.config referred to those files and their folders. Not needing the scripts, I deleted them. After editing the bundle.config, all was good.
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
I had the same problem and found out that I had some bundles that pointed to non-exisiting files using {version} and \* wildcards such as ``` bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); ``` I removed all of those and the error went away.
I also got this error by having non-existant directories in my bundles.config file. Changing this: ``` <?xml version="1.0"?> <bundleConfig ignoreIfDebug="true" ignoreIfLocal="true"> <cssBundles> <add bundlePath="~/css/shared"> <directories> <add directoryPath="~/content/" search...
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
I too faced the same issue. Browsed to the file path under Script Folder.Copied the exact file name and made change in bundle.cs: Old Code : //Bundle.cs ``` public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").I...
look into your BundleConfig.cs file for the lines that invokes **IncludeDirectory()** ie: ``` bundles.Add(new Bundle("~/bundle_js_angularGrid").IncludeDirectory( "~/Scripts/Grid", "*.js", true)); ``` my Grid directory did not exist.
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
I had created a new `Angular` application and written ``` bundles.Add(new ScriptBundle("~/bundles/app") .IncludeDirectory("~/Angular", "*.js") .IncludeDirectory("~/Angular/directives/shared", "*.js") .IncludeDirectory("~/Angular/directives/main", "*.js") .IncludeDirectory("~/Angular/services", "*.js"))...
I also had this error when I combined all my separated bundles into one bundle. ``` bundles.Add(new ScriptBundle("~/bundles/one").Include( "~/Scripts/one.js")); bundles.Add(new ScriptBundle("~/bundles/two").Include( "~/Scripts/two.js")); ``` Changed to ``` bundles.Add(new ScriptBundle("~/bun...
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
I had the same problem and found out that I had some bundles that pointed to non-exisiting files using {version} and \* wildcards such as ``` bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); ``` I removed all of those and the error went away.
Here's a quick class I wrote to make this easier. ``` using System.Web.Hosting; using System.Web.Optimization; // a more fault-tolerant bundle that doesn't blow up if the file isn't there public class BundleRelaxed : Bundle { public BundleRelaxed(string virtualPath) : base(virtualPath) { } p...
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
This can also be caused by a race condition while deploying: If you use Visual Studio's "Publish" to deploy over a network file share, and check "Delete all existing files prior to publish." (I do this sometimes to ensure that we're not unknowingly still depending on files that have been removed from the project but a...
I had this issue when I opened a VS2017 project in VS2015, built the solution and then uploaded the DLLs. Rebuilding it in VS2017 and re-uploading the DLLs fixed the issue.
11,317,405
Planning to rewrite a complex, UI-heavy app so that its model is as cross-platform as reasonably possible. The research / reading I've done makes sense conceptually, but in terms of the model sending messages to the controller in some sort of cross-platform approach, I'm not seeing what a best practices approach would ...
2012/07/03
[ "https://Stackoverflow.com/questions/11317405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516545/" ]
Here's a quick class I wrote to make this easier. ``` using System.Web.Hosting; using System.Web.Optimization; // a more fault-tolerant bundle that doesn't blow up if the file isn't there public class BundleRelaxed : Bundle { public BundleRelaxed(string virtualPath) : base(virtualPath) { } p...
I ran into the same issue today it is actually I found that some of files under ~/Scripts is not published. The issue is resolved after I published the missing files
68,326,171
I have an application, when I deployed to GCP, it failed to start but it was running all good in my local with docker. I have no idea how to resolve this, do I need to include anything in my properties file? ```html *************************** APPLICATION FAILED TO START *************************** Description: Para...
2021/07/10
[ "https://Stackoverflow.com/questions/68326171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5252093/" ]
The most likely reason for `GcpContextAutoConfiguration` to be excluded is that your deployed properties have `spring.cloud.gcp.core.enabled=false` somewhere. To check exactly what Spring Boot autoconfigures and why, pass `-Ddebug=true` to your Java process (if running from Maven, pass it as `-Dspring-boot.run.jvmArgu...
Try adding the Spring Cloud GCP starter to your dependencies that configures the authentication and project settings: ``` <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-gcp-starter</artifactId> </dependency> ``` Also, if you specify the `spring-cloud-gcp-starter-pubsub` de...
395,430
I've done a fair bit of reading on stepper motors and acceleration. I had to wade through a lot of different strategies with a lot of calculations, including one which called for several candles, and "A maiden of virtue pure" Which while interesting, seemed impractical (Not enough space on the Arduino) Basically they a...
2018/09/11
[ "https://electronics.stackexchange.com/questions/395430", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/196596/" ]
Well, for short runs, it should be obvious that you can skip the coast phase. As for the others, it's pretty simple. Maintain constant acceleration until you are halfway to the target, then decelerate until you reach the target. However, there's a catch (there always is, isn't there?). If you have misjudged the dista...
If you want to roll your own it will be something like this. * If accel == decel then the number of steps for the accel phase is equal to the total number of steps required / 2. * Accelerate until you reach the target number of steps or until you reach Vmax. * Note the step count, c. * Run at Vmax until you reach targ...
395,430
I've done a fair bit of reading on stepper motors and acceleration. I had to wade through a lot of different strategies with a lot of calculations, including one which called for several candles, and "A maiden of virtue pure" Which while interesting, seemed impractical (Not enough space on the Arduino) Basically they a...
2018/09/11
[ "https://electronics.stackexchange.com/questions/395430", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/196596/" ]
Well, for short runs, it should be obvious that you can skip the coast phase. As for the others, it's pretty simple. Maintain constant acceleration until you are halfway to the target, then decelerate until you reach the target. However, there's a catch (there always is, isn't there?). If you have misjudged the dista...
When planning a [trapezoidal move profile](https://robotics.stackexchange.com/a/7512/37), if you are not travelling far enough, it devolves into a triangular move. I.e. "accelerate, max velocity, decelerate", becomes "accelerate, decelerate". I typically calculate cruise distance based on subtracting acceleration & de...
395,430
I've done a fair bit of reading on stepper motors and acceleration. I had to wade through a lot of different strategies with a lot of calculations, including one which called for several candles, and "A maiden of virtue pure" Which while interesting, seemed impractical (Not enough space on the Arduino) Basically they a...
2018/09/11
[ "https://electronics.stackexchange.com/questions/395430", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/196596/" ]
Well, for short runs, it should be obvious that you can skip the coast phase. As for the others, it's pretty simple. Maintain constant acceleration until you are halfway to the target, then decelerate until you reach the target. However, there's a catch (there always is, isn't there?). If you have misjudged the dista...
I gave you links of simple traj. planner from linuxnc.org. It has to be noted that is not in use since it has been superseeded by new and better (more complex) one. [wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple\_Tp\_Notes](http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Tp_Notes) [Source code](https://github.com/LinuxCNC...
395,430
I've done a fair bit of reading on stepper motors and acceleration. I had to wade through a lot of different strategies with a lot of calculations, including one which called for several candles, and "A maiden of virtue pure" Which while interesting, seemed impractical (Not enough space on the Arduino) Basically they a...
2018/09/11
[ "https://electronics.stackexchange.com/questions/395430", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/196596/" ]
You always need a deceleration ramp, or you'll incur a jerk and/or overshoot the target. My company uses acceleration and deceleration *times*, as in the time it takes to get from 0% to 100%. This is equivalent to an acceleration of $$ a = \frac{\Delta v}{\Delta t} \\ $$ where $$ \Delta v = v\_{\mbox{max}} \\ \Delta...
If you want to roll your own it will be something like this. * If accel == decel then the number of steps for the accel phase is equal to the total number of steps required / 2. * Accelerate until you reach the target number of steps or until you reach Vmax. * Note the step count, c. * Run at Vmax until you reach targ...
395,430
I've done a fair bit of reading on stepper motors and acceleration. I had to wade through a lot of different strategies with a lot of calculations, including one which called for several candles, and "A maiden of virtue pure" Which while interesting, seemed impractical (Not enough space on the Arduino) Basically they a...
2018/09/11
[ "https://electronics.stackexchange.com/questions/395430", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/196596/" ]
You always need a deceleration ramp, or you'll incur a jerk and/or overshoot the target. My company uses acceleration and deceleration *times*, as in the time it takes to get from 0% to 100%. This is equivalent to an acceleration of $$ a = \frac{\Delta v}{\Delta t} \\ $$ where $$ \Delta v = v\_{\mbox{max}} \\ \Delta...
When planning a [trapezoidal move profile](https://robotics.stackexchange.com/a/7512/37), if you are not travelling far enough, it devolves into a triangular move. I.e. "accelerate, max velocity, decelerate", becomes "accelerate, decelerate". I typically calculate cruise distance based on subtracting acceleration & de...
395,430
I've done a fair bit of reading on stepper motors and acceleration. I had to wade through a lot of different strategies with a lot of calculations, including one which called for several candles, and "A maiden of virtue pure" Which while interesting, seemed impractical (Not enough space on the Arduino) Basically they a...
2018/09/11
[ "https://electronics.stackexchange.com/questions/395430", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/196596/" ]
You always need a deceleration ramp, or you'll incur a jerk and/or overshoot the target. My company uses acceleration and deceleration *times*, as in the time it takes to get from 0% to 100%. This is equivalent to an acceleration of $$ a = \frac{\Delta v}{\Delta t} \\ $$ where $$ \Delta v = v\_{\mbox{max}} \\ \Delta...
I gave you links of simple traj. planner from linuxnc.org. It has to be noted that is not in use since it has been superseeded by new and better (more complex) one. [wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple\_Tp\_Notes](http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Tp_Notes) [Source code](https://github.com/LinuxCNC...
46,688,758
I have been struggling with this for a while now, I'm not sure if this is right. But I have a viewmodel with three tables and in my view I'm using the view model. The view has a kendo grid which needs data from one of the tables in the view model, I'm not able to bind the model to the grid. Any leads are appreciated. ...
2017/10/11
[ "https://Stackoverflow.com/questions/46688758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6849091/" ]
> > which event set the input from valid to invalid. > > > ... > > > which event displays the error message. > > > Just run your kendoValidator with `validator.validate();` The error messages are also set with `validate()`. Something like this should work: ``` $(document).on('input propertychange', function(...
Solved my Problem on my Own. I will edit the post so you can see what i mean but first i just give the dojo projcet. <https://dojo.telerik.com/OSONo/64> my edit: I am sorry for my previous anwser, i just want to give him my solution i mention in my comment. In my solution i created an event listener, how listen to...
764,042
My laptop comes with a 128GB SSD, and it have Windows installed. But since it has almost no space, I installed Ubuntu 16.04 on a USB drive (32GB, USB 2.0). It's working really well, but I don't want that anything goes wrong with my Windows drive, so I modified the `fstab` file and I added 2 lines: ``` UUID=3E98352E98...
2016/04/27
[ "https://askubuntu.com/questions/764042", "https://askubuntu.com", "https://askubuntu.com/users/337743/" ]
Mounting your Windows filesystems read-only seems a little more straight-forward to me than the umask option: ``` UUID=3E98352E9834E655 /mnt/hiro1 ntfs ro,noauto 0 0 UUID=24F62FADF62F7E64 /mnt/hiro2 ntfs ro,noauto 0 0 ``` I also made separate mount-points for each filesystem, in case you ever wanted to have ...
After you've installed Ubuntu, it will never do anything to modify those Windows drives unless you explicitly tell it to. In reality, I would never even worry about modifying your fstab file, but keeping the 'noauto' flag won't hurt anything and will, in fact, prevent Ubuntu from trying to mount the drives automatic...
4,601,345
If I have ``` var a = Array(Array(1, 2), 3, Array(4,5,6)) ``` and I want to convert this to ``` Array(1, 2, 3, 4, 5, 6) ``` what is the easiest way to do it? There is a solution for lists given in [this post](https://stackoverflow.com/questions/1598699/scala-list-flatten-no-implicit-argument-matching-parameter-...
2011/01/05
[ "https://Stackoverflow.com/questions/4601345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243233/" ]
``` def flatArray[T : ClassManifest](a:Array[Any]) = a.flatMap{ case ar:Array[T] => ar case x: T => Array(x) } ``` I've tried also to use the #flatten method, but it fails on NPE. Update: To answer Jus12's question: ``` def flatArray[T : Manifest](a:Array[Any]) = a.flatMap{ case ar: Array[_] if...
Similar to IttayD, without ClassManifest, and has Array[Any] as result. ``` scala> a.flatMap{ | case ar: Array[_] => ar | case x => List(x) | } res4: Array[Any] = Array(1, 2, 3, 4, 5, 6) ```
1,880,216
$$ \int \frac{\sin (x +\alpha)}{\cos^3 x}{\sqrt\frac{\csc x + \sec x}{\csc x - \sec x}}$$ $$ \int \frac{\sin \left(x +\alpha\right)}{\cos^3 x}{\sqrt\frac{ \cos x +\sin x }{\cos x - \sin x}}$$ $$ \int \frac{\sin \left(x +\alpha\right)}{\cos^3 x}{\frac{\sin x + \cos x}{\sqrt{\cos 2x}}}$$ $$ \sqrt 2 \int \frac{\sin \left...
2016/08/03
[ "https://math.stackexchange.com/questions/1880216", "https://math.stackexchange.com", "https://math.stackexchange.com/users/346279/" ]
$$I=\int \frac{\sin (x +\alpha)}{\cos^3 x}{\sqrt\frac{ \cos x +\sin x }{\cos x - \sin x}}dx,$$ $$I=\cos{\alpha}\int \frac{\sin x}{\cos^3 x}{\sqrt\frac{ \cos x +\sin x }{\cos x - \sin x}}dx+\sin{\alpha}\int \frac{1}{\cos^2 x}{\sqrt\frac{ \cos x +\sin x }{\cos x - \sin x}}dx,$$ $$I=\cos{\alpha} I\_1+\sin{\alpha}I\_2,$$ w...
Let $$I = \int \frac{\sin (x +\alpha)}{\cos^3 x}{\sqrt\frac{\csc x + \sec x}{\csc x - \sec x}}dx$$ $$I = \cos \alpha\int \frac{\sin x+\cos x\cdot \tan \alpha}{\cos x}\cdot \sqrt{\frac{1+\tan x}{1-\tan x}}\cdot \sec^2 xdx$$ So $$I = \cos \alpha \int (\tan \alpha+\tan x)\sqrt{\frac{1+\tan x}{1-\tan x}}\cdot \sec^2 xdx$...
58,241,823
I try to find an element by class name. Unfortunately the class name I have to select contains double underscores with raises a "no such element" error. `div-element` to select: ``` <div class="result-list-entry__data"> ... </div> ``` selection: ```py last_named_class = result.find_element_by_class_name('result-l...
2019/10/04
[ "https://Stackoverflow.com/questions/58241823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11579071/" ]
Perhaps you could use a contains query in your selector. Try something like this: ``` last_named_class = result.find_element_by_xpath("//div[contains(@class, 'result-list')]") ``` Hope this helps a bit.
Try below things, 1. Apply required wait (implicit or explicit wait) ```py driver.implicitly_wait(15) ``` ``` wait = WebDriverWait(driver, 10) wait.until(ec.visibility_of_element_located((By.XPATH, "//*[contains(@class,'result-list-entry')]"))) ``` 2. Check whether element is a child of iframe element. if so,...
58,241,823
I try to find an element by class name. Unfortunately the class name I have to select contains double underscores with raises a "no such element" error. `div-element` to select: ``` <div class="result-list-entry__data"> ... </div> ``` selection: ```py last_named_class = result.find_element_by_class_name('result-l...
2019/10/04
[ "https://Stackoverflow.com/questions/58241823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11579071/" ]
First of all, check if there is any iframes. if the element is in iframe , you will have to switch to the frame, before doing anything with that element. You can locate this element using partial string match on class attribute, something like this, ``` last_named_class = result.find_element_by_xpath("//*[contains(@c...
Try below things, 1. Apply required wait (implicit or explicit wait) ```py driver.implicitly_wait(15) ``` ``` wait = WebDriverWait(driver, 10) wait.until(ec.visibility_of_element_located((By.XPATH, "//*[contains(@class,'result-list-entry')]"))) ``` 2. Check whether element is a child of iframe element. if so,...
58,241,823
I try to find an element by class name. Unfortunately the class name I have to select contains double underscores with raises a "no such element" error. `div-element` to select: ``` <div class="result-list-entry__data"> ... </div> ``` selection: ```py last_named_class = result.find_element_by_class_name('result-l...
2019/10/04
[ "https://Stackoverflow.com/questions/58241823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11579071/" ]
You can try to get the list of all elements with class = "result-list-entry\_\_data" by using If you have more than one class in the DOM iterate the elementResult array based on the position ``` elementResult=[]; elementResult = driver.find_elements_by_class_name("result-list-entry__data"); ``` else ``` elemen...
Try below things, 1. Apply required wait (implicit or explicit wait) ```py driver.implicitly_wait(15) ``` ``` wait = WebDriverWait(driver, 10) wait.until(ec.visibility_of_element_located((By.XPATH, "//*[contains(@class,'result-list-entry')]"))) ``` 2. Check whether element is a child of iframe element. if so,...
58,241,823
I try to find an element by class name. Unfortunately the class name I have to select contains double underscores with raises a "no such element" error. `div-element` to select: ``` <div class="result-list-entry__data"> ... </div> ``` selection: ```py last_named_class = result.find_element_by_class_name('result-l...
2019/10/04
[ "https://Stackoverflow.com/questions/58241823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11579071/" ]
You can use the approach suggested before with two contains: ``` last_named_class = result.find_element_by_xpath("//div[contains(@class, 'result-list') and contains(@class, 'data')]" ```
Try below things, 1. Apply required wait (implicit or explicit wait) ```py driver.implicitly_wait(15) ``` ``` wait = WebDriverWait(driver, 10) wait.until(ec.visibility_of_element_located((By.XPATH, "//*[contains(@class,'result-list-entry')]"))) ``` 2. Check whether element is a child of iframe element. if so,...
53,623,141
Does Google Cloud provide public hostnames for their Compute instances? AWS seems to [generate public hostnames](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames) for their EC2 instances: > > A public (external) DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.co...
2018/12/04
[ "https://Stackoverflow.com/questions/53623141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6690391/" ]
No, GCE doesn't offer hostnames for an instance. It does assign external IP addresses for each instance. Associating a DNS record with your instance is the only method to generate a hostname. GCE does have built in private hostnames, inside the same network. For example two instances in the same VPC can ping each othe...
GCE instances don't currently have a public DNS name for their external IP address. But there is now a `gcloud compute config-ssh` ([docs](https://cloud.google.com/sdk/gcloud/reference/compute/config-ssh)) command that's a pretty good substitute. This will insert `Host` blocks into your `~/.ssh/config` file that conta...
53,623,141
Does Google Cloud provide public hostnames for their Compute instances? AWS seems to [generate public hostnames](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames) for their EC2 instances: > > A public (external) DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.co...
2018/12/04
[ "https://Stackoverflow.com/questions/53623141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6690391/" ]
No, GCE doesn't offer hostnames for an instance. It does assign external IP addresses for each instance. Associating a DNS record with your instance is the only method to generate a hostname. GCE does have built in private hostnames, inside the same network. For example two instances in the same VPC can ping each othe...
If your GCP instance has an external IP, ephemeral or static, then that IP address has public DNS entry that you can easily get with a reverse DNS lookup. Example: ```sh # get your external IP $ curl icanhazip.com 34.88.81.150 # do a reverse DNS lookup $ dig +short -x 34.88.81.150 150.81.88.34.bc.googleusercontent....
53,623,141
Does Google Cloud provide public hostnames for their Compute instances? AWS seems to [generate public hostnames](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames) for their EC2 instances: > > A public (external) DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.co...
2018/12/04
[ "https://Stackoverflow.com/questions/53623141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6690391/" ]
No. Source: [FridayPush's answer](https://stackoverflow.com/a/53623414/6690391) (thanks! from his profile, seems worthy of trust for Google-Cloud things :-)). The reason I wrote a separate answer is to make it clear that you can't have a public hostname totally through Google Cloud. You can either have an internal hos...
GCE instances don't currently have a public DNS name for their external IP address. But there is now a `gcloud compute config-ssh` ([docs](https://cloud.google.com/sdk/gcloud/reference/compute/config-ssh)) command that's a pretty good substitute. This will insert `Host` blocks into your `~/.ssh/config` file that conta...
53,623,141
Does Google Cloud provide public hostnames for their Compute instances? AWS seems to [generate public hostnames](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames) for their EC2 instances: > > A public (external) DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.co...
2018/12/04
[ "https://Stackoverflow.com/questions/53623141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6690391/" ]
No. Source: [FridayPush's answer](https://stackoverflow.com/a/53623414/6690391) (thanks! from his profile, seems worthy of trust for Google-Cloud things :-)). The reason I wrote a separate answer is to make it clear that you can't have a public hostname totally through Google Cloud. You can either have an internal hos...
If your GCP instance has an external IP, ephemeral or static, then that IP address has public DNS entry that you can easily get with a reverse DNS lookup. Example: ```sh # get your external IP $ curl icanhazip.com 34.88.81.150 # do a reverse DNS lookup $ dig +short -x 34.88.81.150 150.81.88.34.bc.googleusercontent....
53,623,141
Does Google Cloud provide public hostnames for their Compute instances? AWS seems to [generate public hostnames](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames) for their EC2 instances: > > A public (external) DNS hostname takes the form ec2-public-ipv4-address.compute-1.amazonaws.co...
2018/12/04
[ "https://Stackoverflow.com/questions/53623141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6690391/" ]
GCE instances don't currently have a public DNS name for their external IP address. But there is now a `gcloud compute config-ssh` ([docs](https://cloud.google.com/sdk/gcloud/reference/compute/config-ssh)) command that's a pretty good substitute. This will insert `Host` blocks into your `~/.ssh/config` file that conta...
If your GCP instance has an external IP, ephemeral or static, then that IP address has public DNS entry that you can easily get with a reverse DNS lookup. Example: ```sh # get your external IP $ curl icanhazip.com 34.88.81.150 # do a reverse DNS lookup $ dig +short -x 34.88.81.150 150.81.88.34.bc.googleusercontent....
30,146,126
I want to render marionette ItemView and append result html() to my div. My code: ``` var ProjectItemView = Backbone.Marionette.ItemView.extend({ template: "#ProjectItem", tagName: 'div', initialize: function () { this.model.on('change', this.life, this); this.model.on('change', th...
2015/05/09
[ "https://Stackoverflow.com/questions/30146126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4440478/" ]
As usual: never trust user input. The only difference between a request with `?paid=yes` or not in the querystring would be the message you show. You have to find a different way to validate the payment by communicating with the payment provider directly to check the result.
In my opinion you cant validate a payment in a query, I would instead give the client a ticket, so now the query would be `?ticket=UUID`, where uuid can be generated with GUID class `Giud.NewGuid()`. now in the database of your server you should create the ticket too and a boolean field indicating if the payment is do...
23,476,623
I'm very new to databases and I'm a novice to data abstraction, coming from Java. To teach myself, I'm working on an online app that will, among other things, allow users to be part of *multiple* groups. Sketching out the database, it seems I'll have to have something like a "Membership" table: ``` UserID|GroupID ---...
2014/05/05
[ "https://Stackoverflow.com/questions/23476623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3604787/" ]
That's a standard way for representing many-to-many relationship and is known as "junction table" (or "link table"). You already noted that both UserID and GroupID are foreign keys that reference other tables. But when it comes to keys (not *foreign* keys), you have several options: 1. Make a composite (primary) key...
This kind of set up is perfectly common and perfectly fine. I would add a primary key index on an auto-increment column as well, and also make sure to have indices on userid and groupid. If you know how your application will use the data and you can leverage compound (AKA composite AKA multi-column AKA...) indices,...
73,270,235
What I'm trying to achieve is to drag the widget anywhere on the screen. The solution below allows me to drag but goes beyond the limit of the screen. Are there any max/min function I can apply here or the corresponding calculation to keep the widget inside the height and width of the screen. ``` @override Widget...
2022/08/07
[ "https://Stackoverflow.com/questions/73270235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15250462/" ]
right click on D, then click on Edit Alias... Note: this is how i do in window.
"Labels" will appear as "Active" only when you drag a measure from your Data pane to the "Lable" box inside the Marks pane This is the best practice to apply any lables, dont use Edit Alias without understanding how Tableau works.
73,270,235
What I'm trying to achieve is to drag the widget anywhere on the screen. The solution below allows me to drag but goes beyond the limit of the screen. Are there any max/min function I can apply here or the corresponding calculation to keep the widget inside the height and width of the screen. ``` @override Widget...
2022/08/07
[ "https://Stackoverflow.com/questions/73270235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15250462/" ]
Best approach is to create calculated field. Name it how you want and assign new names via formula: **IF [Property type] = 'D' then 'Detached' ELSEIF \*\*\* END** Then you can use it instead of [Property type] and edit it whenever you need. P.S. I suggest to not use aliases, like MKD said.
"Labels" will appear as "Active" only when you drag a measure from your Data pane to the "Lable" box inside the Marks pane This is the best practice to apply any lables, dont use Edit Alias without understanding how Tableau works.
38,589,083
What I'm trying to achieve is that if i have 2 components nodes : * component1 + clientlib - component1.js * component2 + clientlib - component2.js and i drag them into page1, then when page1 is generated, only component1.js and component2.js will be loaded when navigating to page1 . One approach i saw is...
2016/07/26
[ "https://Stackoverflow.com/questions/38589083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3103399/" ]
There is no built in feature to do this. Although I've heard that the clientlib infrastructure is being looked at for a re-write so I'm optimistic that something like this will be added in the future. We have, and I know other company have, created a "deferred script tag." Ours is a very simple tag that take a chunk o...
Theoretically the possible way of doing is to write script in your page component/abstract page component that does something like this - Step1 : String path = currentPage.getPath() Step2 : Query this path for components (one way is to have a master list do a contains clause on sling:resourceType) Step 3: User reso...
40,716,111
I want to set alert when the value is same. And the value selected is back to previous value Here is my HTML: ```js $("#to").val("BGK"); var fromCity = ""; var toCity = ""; $('#from,#to').change(function(){ var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal ...
2016/11/21
[ "https://Stackoverflow.com/questions/40716111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5361782/" ]
You must storage the previous value as a backup. You can make it with a focus event: ``` $("#to").val("BGK"); var item = ''; var previous = ''; $('#from,#to').on('focus', function () { previous = this.value; item = this; }). change(function(){ var fromCityVal = $("#from").val(); ...
Please find the working fiddle as expected - [Fiddle](https://jsfiddle.net/dedi_wibisono17/hx1voew9/) ``` $('#from,#to').change(function() { var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal == toCityVal) { alert("city of origin may not be the same as the destination city!")...
40,716,111
I want to set alert when the value is same. And the value selected is back to previous value Here is my HTML: ```js $("#to").val("BGK"); var fromCity = ""; var toCity = ""; $('#from,#to').change(function(){ var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal ...
2016/11/21
[ "https://Stackoverflow.com/questions/40716111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5361782/" ]
You must storage the previous value as a backup. You can make it with a focus event: ``` $("#to").val("BGK"); var item = ''; var previous = ''; $('#from,#to').on('focus', function () { previous = this.value; item = this; }). change(function(){ var fromCityVal = $("#from").val(); ...
At page load , fetch your current selection values in a variable, and map the selection box with this value after alert.
40,716,111
I want to set alert when the value is same. And the value selected is back to previous value Here is my HTML: ```js $("#to").val("BGK"); var fromCity = ""; var toCity = ""; $('#from,#to').change(function(){ var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal ...
2016/11/21
[ "https://Stackoverflow.com/questions/40716111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5361782/" ]
Here is the fix . **[Working fiddle](https://jsfiddle.net/hx1voew9/1/)** ``` $("#to").val("BGK"); var fromCity; // have global variables to backup your selection in case of same values var toCity; $('#from,#to').on('focus', function() { fromCity = $("#from").val(); // on focus of the dropdown set the valu...
Please find the working fiddle as expected - [Fiddle](https://jsfiddle.net/dedi_wibisono17/hx1voew9/) ``` $('#from,#to').change(function() { var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal == toCityVal) { alert("city of origin may not be the same as the destination city!")...
40,716,111
I want to set alert when the value is same. And the value selected is back to previous value Here is my HTML: ```js $("#to").val("BGK"); var fromCity = ""; var toCity = ""; $('#from,#to').change(function(){ var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal ...
2016/11/21
[ "https://Stackoverflow.com/questions/40716111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5361782/" ]
Here is the fix . **[Working fiddle](https://jsfiddle.net/hx1voew9/1/)** ``` $("#to").val("BGK"); var fromCity; // have global variables to backup your selection in case of same values var toCity; $('#from,#to').on('focus', function() { fromCity = $("#from").val(); // on focus of the dropdown set the valu...
At page load , fetch your current selection values in a variable, and map the selection box with this value after alert.
40,716,111
I want to set alert when the value is same. And the value selected is back to previous value Here is my HTML: ```js $("#to").val("BGK"); var fromCity = ""; var toCity = ""; $('#from,#to').change(function(){ var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal ...
2016/11/21
[ "https://Stackoverflow.com/questions/40716111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5361782/" ]
Another option: ``` $("#to").val("BGK"); var $fromCityValOld = $("#from").val(); var $toCityValOld = $("#to").val(); $('#from,#to').change(function(){ $fromCityVal = $("#from").val(); $toCityVal = $("#to").val(); if ($fromCityVal == $toCityVal){ alert("city o...
Please find the working fiddle as expected - [Fiddle](https://jsfiddle.net/dedi_wibisono17/hx1voew9/) ``` $('#from,#to').change(function() { var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal == toCityVal) { alert("city of origin may not be the same as the destination city!")...
40,716,111
I want to set alert when the value is same. And the value selected is back to previous value Here is my HTML: ```js $("#to").val("BGK"); var fromCity = ""; var toCity = ""; $('#from,#to').change(function(){ var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal ...
2016/11/21
[ "https://Stackoverflow.com/questions/40716111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5361782/" ]
At page load , fetch your current selection values in a variable, and map the selection box with this value after alert.
Please find the working fiddle as expected - [Fiddle](https://jsfiddle.net/dedi_wibisono17/hx1voew9/) ``` $('#from,#to').change(function() { var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal == toCityVal) { alert("city of origin may not be the same as the destination city!")...
40,716,111
I want to set alert when the value is same. And the value selected is back to previous value Here is my HTML: ```js $("#to").val("BGK"); var fromCity = ""; var toCity = ""; $('#from,#to').change(function(){ var fromCityVal = $("#from").val(); var toCityVal = $("#to").val(); if (fromCityVal ...
2016/11/21
[ "https://Stackoverflow.com/questions/40716111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5361782/" ]
Another option: ``` $("#to").val("BGK"); var $fromCityValOld = $("#from").val(); var $toCityValOld = $("#to").val(); $('#from,#to').change(function(){ $fromCityVal = $("#from").val(); $toCityVal = $("#to").val(); if ($fromCityVal == $toCityVal){ alert("city o...
At page load , fetch your current selection values in a variable, and map the selection box with this value after alert.
1,167,911
I was wondering if the relation $X$ would be an equivalence relation only if the result is an even number. For example the relation $X$ is given by $a\ X\ b$ only if $a+b$ is even. Would this be considered an equivalence relation making is reflexive, symmetric and transitive? Thanks
2015/02/27
[ "https://math.stackexchange.com/questions/1167911", "https://math.stackexchange.com", "https://math.stackexchange.com/users/218955/" ]
Hint: * Is the sum of two odd numbers even or odd? * Is the sum of two even numbers even or odd? * Is the sum of an even number and an odd number even or odd? Given the answers to the above, split the testing of each property into different cases.
Use the definitions: For example: * $R$ is reflexive if, for every $x$, we have $xRx$. Take an arbitrary number $n$. Can you prove that $nRn$? You can prove this by showing that $n+n$ is even. If you cannot prove this, can you find an example where it is not true? * $R$ is symmetric if, for any $x,y$ such that $xRy$,...
1,412,693
I am looking for a way to determine the most "different" or "recognizable" N ASCII characters... For example, if N = 10, what would be the most different N characters in the ASCII set from 0x21 to 0x7E? Obviously, the character "X" is very different than "O" (the letter), but "O" (the letter) is very similar to "0" (ze...
2009/09/11
[ "https://Stackoverflow.com/questions/1412693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21293/" ]
Unfortunately I don't think there will be a single unique answer for this. It'll depend on the font: Compare the different ways that 0, f, s are represented and also stylistic flourishes. It'll depend on the type of damage the characters receive before being scanned, some may be more resilient against smudging, other...
Only one way to answer this question: test it. Create a set of samples for each letter, and run OCR on each sample. The letters that OCR gets right the most often are the most "recognizable"; the letters that OCR gets wrong most often are the most "different".
25,916,597
I would like to have an application wide banner to display custom messages to the user. This banner is not always present, but can be displayed on any screen in the app. When it is displayed, it does not sit on top of the current view, but instead forces the current view to resize below it. The goal is to implement the...
2014/09/18
[ "https://Stackoverflow.com/questions/25916597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947991/" ]
Your best bet is to sub class UINavigationController and implement the logic for resizing there instead of in the root view controller. For example implement a method like: ``` - (void)setShowBanner:(BOOL)show { CGRect frame = [self frameForViewControllersWhenShowingBanner:show]; for (UIViewController *vc in ...
This is a Swift 3 iOS 10 solution. Create a `UIView` subclass: ``` class NavigationBannerView: UIView { let iconImageView = UIImageView() let messageTextLabel = UILabel() override init(frame: CGRect) { super.init(frame: frame) backgroundColor = .red let iconImage = UIImage(name...
25,916,597
I would like to have an application wide banner to display custom messages to the user. This banner is not always present, but can be displayed on any screen in the app. When it is displayed, it does not sit on top of the current view, but instead forces the current view to resize below it. The goal is to implement the...
2014/09/18
[ "https://Stackoverflow.com/questions/25916597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/947991/" ]
This is pretty high-level but I would subclass `UIViewController` (ex: `BanneredViewController`), then have all your view controllers that are pushed onto the navigation controller inherit from `BanneredViewController`. In `BanneredViewController` you could control the state of the display of this banner, fire layout...
This is a Swift 3 iOS 10 solution. Create a `UIView` subclass: ``` class NavigationBannerView: UIView { let iconImageView = UIImageView() let messageTextLabel = UILabel() override init(frame: CGRect) { super.init(frame: frame) backgroundColor = .red let iconImage = UIImage(name...
48,219,875
I'm adding toolbar to an activity that has setDisplayHomeAsUpEnabled the toolbar is not displayed at all but when i tap where back button is located its working but toolbar is not displayed at all like toolbar's background color and title is not displaying instead its showing part of activity laying there here is how ...
2018/01/12
[ "https://Stackoverflow.com/questions/48219875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5710014/" ]
Try this ``` <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> ``` and ``` Toolbar toolbar = fin...
you can try making these changes.. ``` <style name="ThemeLogin" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">#292E37</item> <item name="colorAccent">@color/colorAccent</item> <ite...
48,219,875
I'm adding toolbar to an activity that has setDisplayHomeAsUpEnabled the toolbar is not displayed at all but when i tap where back button is located its working but toolbar is not displayed at all like toolbar's background color and title is not displaying instead its showing part of activity laying there here is how ...
2018/01/12
[ "https://Stackoverflow.com/questions/48219875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5710014/" ]
Try this ``` <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> ``` and ``` Toolbar toolbar = fin...
Try to use like below . ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff"> <android.support.design.widget.AppBarLayout ...
2,040,115
In Actionscript you can have a variable hold a reference to a class type and then compare an instance of a class to the variable with `is`. Example: ``` var a:Foo = new Foo(); var type:Class = Foo; if(a is type){ //this is true //do something } ``` Can you do something similar in C#? Or does the "is" keyword alw...
2010/01/11
[ "https://Stackoverflow.com/questions/2040115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29502/" ]
see also the [Type.IsInstanceOfType](http://msdn.microsoft.com/en-us/library/system.type.isinstanceoftype%28VS.100%29.aspx) method in the .NET framework, if you want to test against a variable type
It could also be followed by an interface name.
2,040,115
In Actionscript you can have a variable hold a reference to a class type and then compare an instance of a class to the variable with `is`. Example: ``` var a:Foo = new Foo(); var type:Class = Foo; if(a is type){ //this is true //do something } ``` Can you do something similar in C#? Or does the "is" keyword alw...
2010/01/11
[ "https://Stackoverflow.com/questions/2040115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29502/" ]
It could also be followed by an interface name.
Data types are objects so both the following are valid in C# ``` if (value is String) ... if (value is ExampleClass) ... ```
2,040,115
In Actionscript you can have a variable hold a reference to a class type and then compare an instance of a class to the variable with `is`. Example: ``` var a:Foo = new Foo(); var type:Class = Foo; if(a is type){ //this is true //do something } ``` Can you do something similar in C#? Or does the "is" keyword alw...
2010/01/11
[ "https://Stackoverflow.com/questions/2040115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29502/" ]
see also the [Type.IsInstanceOfType](http://msdn.microsoft.com/en-us/library/system.type.isinstanceoftype%28VS.100%29.aspx) method in the .NET framework, if you want to test against a variable type
Data types are objects so both the following are valid in C# ``` if (value is String) ... if (value is ExampleClass) ... ```
2,040,115
In Actionscript you can have a variable hold a reference to a class type and then compare an instance of a class to the variable with `is`. Example: ``` var a:Foo = new Foo(); var type:Class = Foo; if(a is type){ //this is true //do something } ``` Can you do something similar in C#? Or does the "is" keyword alw...
2010/01/11
[ "https://Stackoverflow.com/questions/2040115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29502/" ]
see also the [Type.IsInstanceOfType](http://msdn.microsoft.com/en-us/library/system.type.isinstanceoftype%28VS.100%29.aspx) method in the .NET framework, if you want to test against a variable type
.NET 2010 beta 2 : tested against FrameWork 4, 3.5 ("full" FrameWork versions, not "Client Profile" versions) *Given :* ``` public class Foo { public Foo() {} } ``` *And run-time execution of :* ``` Foo myFoo = new Foo(); Console.WriteLine(myFoo is Foo); Console.WriteLine(typeof(Foo).IsInstanceOfType(myFoo))...
2,040,115
In Actionscript you can have a variable hold a reference to a class type and then compare an instance of a class to the variable with `is`. Example: ``` var a:Foo = new Foo(); var type:Class = Foo; if(a is type){ //this is true //do something } ``` Can you do something similar in C#? Or does the "is" keyword alw...
2010/01/11
[ "https://Stackoverflow.com/questions/2040115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29502/" ]
.NET 2010 beta 2 : tested against FrameWork 4, 3.5 ("full" FrameWork versions, not "Client Profile" versions) *Given :* ``` public class Foo { public Foo() {} } ``` *And run-time execution of :* ``` Foo myFoo = new Foo(); Console.WriteLine(myFoo is Foo); Console.WriteLine(typeof(Foo).IsInstanceOfType(myFoo))...
Data types are objects so both the following are valid in C# ``` if (value is String) ... if (value is ExampleClass) ... ```
51,755,268
Currently I have two data frames representing excel spreadsheets. I wish to join the data where the dates are equal. This is a one to many join as one spread sheet has a date then I need to add data which has multiple rows with the same date an example: ``` A B date data da...
2018/08/08
[ "https://Stackoverflow.com/questions/51755268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4848801/" ]
So here's the option with merging: Assume you have two DataFrames: ``` import pandas as pd df1 = pd.DataFrame({'date': ['2015-01-01', '2015-01-02', '2015-01-03'], 'data': ['A', 'B', 'C']}) df2 = pd.DataFrame({'date': ['2015-01-01 to 2015-01-02', '2015-01-01 to 2015-01-02', '2015-01-02 to 2015-01-...
Let's use this [numpy method by @piRSquared](https://stackoverflow.com/a/44601120/6361531): ``` df1 = pd.DataFrame({'date': ['2015-01-01', '2015-01-02', '2015-01-03'], 'data': ['A', 'B', 'C']}) df2 = pd.DataFrame({'date': ['2015-01-01 to 2015-01-02', '2015-01-01 to 2015-01-02', '2015-01-02 to 2015...
4,279,770
I have an war osgi bundle that I have created from a legacy web application. The problem I have is that in the spring configuration there are references to files that reside on the classpath (see below) which are fine when the legacy war was deployed to tomcat as they could be found on thr filesystem. However, as osgi ...
2010/11/25
[ "https://Stackoverflow.com/questions/4279770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473351/" ]
Use [JSTL](http://download.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/) [`c:url`](http://download.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/c/url.html) with [`c:param`](http://download.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/c/param.html). ``` <c:url var="url" value="http://www.me-me.com/index.jsp"> <c:param name...
URL-encoding the values would be the right thing to do. ``` href='www.me-me.com/index.jsp?application=<%= URLEncoder.encode(myBean.getApplication(), "UTF-8") %>&appId=<%= URLEncoder.encode(myBean.getAppId(), "UTF-8") %>'>LINK ``` You can transport any string value as an URL parameter, but you *must* properly e...
18,071
In the UK does accent count as a "legally protected characteristics"? For example. If i have a thick Newcastle or Yorkshire accent, could an employer legally turn me down for a job for that reason? > > 6. Race > > > The Act continues to protect people against discrimination on the > grounds of their race, which i...
2017/03/30
[ "https://law.stackexchange.com/questions/18071", "https://law.stackexchange.com", "https://law.stackexchange.com/users/1321/" ]
Discrimination on place of birth is arguably a form of racial discrimination. But it seems unlikely that you would succeed arguing that you were discriminated against based on your accent. The discrimination would likely have to be about the country you were born in, rather than the regional "culture" you have
Unless and until the Socialist Republic of Yorkshire secedes from the United Kingdom, the fact that you come from Yorkshire is not going to count as 'nationality' or 'national origin' (far less 'race'), so it is not a legally protected characteristic. Employers have as much right to turn you down because of your accent...
18,071
In the UK does accent count as a "legally protected characteristics"? For example. If i have a thick Newcastle or Yorkshire accent, could an employer legally turn me down for a job for that reason? > > 6. Race > > > The Act continues to protect people against discrimination on the > grounds of their race, which i...
2017/03/30
[ "https://law.stackexchange.com/questions/18071", "https://law.stackexchange.com", "https://law.stackexchange.com/users/1321/" ]
Discrimination on place of birth is arguably a form of racial discrimination. But it seems unlikely that you would succeed arguing that you were discriminated against based on your accent. The discrimination would likely have to be about the country you were born in, rather than the regional "culture" you have
As a counter argument, even if your possession of an accent (and a thick one, by your own admission) was considered a protected element of nationality, the employer could still deny you on those grounds if they meet three criteria: 1. The requirement must be occupational in nature, with a link between the job and the ...
18,071
In the UK does accent count as a "legally protected characteristics"? For example. If i have a thick Newcastle or Yorkshire accent, could an employer legally turn me down for a job for that reason? > > 6. Race > > > The Act continues to protect people against discrimination on the > grounds of their race, which i...
2017/03/30
[ "https://law.stackexchange.com/questions/18071", "https://law.stackexchange.com", "https://law.stackexchange.com/users/1321/" ]
Unless and until the Socialist Republic of Yorkshire secedes from the United Kingdom, the fact that you come from Yorkshire is not going to count as 'nationality' or 'national origin' (far less 'race'), so it is not a legally protected characteristic. Employers have as much right to turn you down because of your accent...
As a counter argument, even if your possession of an accent (and a thick one, by your own admission) was considered a protected element of nationality, the employer could still deny you on those grounds if they meet three criteria: 1. The requirement must be occupational in nature, with a link between the job and the ...
42,069
I was reading a book by [Simon Haykin on neural networks](https://cours.etsmtl.ca/sys843/REFS/Books/ebook_Haykin09.pdf) when I came across the following strong statement (on the pdf's page 188): "However, we still have a computational complexity that is $\mathcal{O}(W^2)$, where $W$ is the size of weight vector $\math...
2022/10/26
[ "https://scicomp.stackexchange.com/questions/42069", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/43364/" ]
I'm guessing you're referring to the discussion on pages 188-189 of that book. The author doesn't give much detail on quasi-Newton methods or substantiate the $\mathscr O(W^2)$ complexity estimate. To me, the discussion there is pretty unsatisfying. Probably the archetypal quasi-Newton method is the [Broyden-Fletcher-...
Traditional quasi-newton methods like BFGS require $O(n^{2})$ storage for a potentially fully dense quasi-Hessian matrix and $O(n^{2})$ work in each iteration to update the factorized quasi-Hessian matrix (or its inverse.) For small neural network models with no more than a few thousand parameters, this is not at all ...
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
A rules engine can encapsulate business logic, often in a declarative manner. This avoids the need to custom-code business logic in software. A rules engine algorithm is how the rule matching and triggering is implemented, so it's an implementation detail rather that actually solving a problem itself. Algorithms might...
* **The problem is just too fiddly for traditional code**: The problem may not be complex, but you can't see a non-fragile way of building it. * **The problem is beyond any obvious algorithm based solution**: It is a complex problem to solve, there are no obvious traditional solutions or basically the problem isn't ful...
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
A rules engine can encapsulate business logic, often in a declarative manner. This avoids the need to custom-code business logic in software. A rules engine algorithm is how the rule matching and triggering is implemented, so it's an implementation detail rather that actually solving a problem itself. Algorithms might...
A rule engine calculates a decision, based on one or several input parameters.
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
A rules engine can encapsulate business logic, often in a declarative manner. This avoids the need to custom-code business logic in software. A rules engine algorithm is how the rule matching and triggering is implemented, so it's an implementation detail rather that actually solving a problem itself. Algorithms might...
Rules engines tend to try and solve problems that change frequently or are sometimes poorly defined quickly and easily. They are not very complicated and many implementations present serious performance and scaling challenges.
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
A rules engine can encapsulate business logic, often in a declarative manner. This avoids the need to custom-code business logic in software. A rules engine algorithm is how the rule matching and triggering is implemented, so it's an implementation detail rather that actually solving a problem itself. Algorithms might...
At the lowest level, a forward-chaining rule engine allows you to structure rule sets (often large rule sets) in roughly the following way: ``` if (Condition A) {assert (Condition B)} if (Condition C) {assert (Condition B)} if (Condition B) {do something} ``` The conditions can also have parameters: ``` if (Conditi...
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
* **The problem is just too fiddly for traditional code**: The problem may not be complex, but you can't see a non-fragile way of building it. * **The problem is beyond any obvious algorithm based solution**: It is a complex problem to solve, there are no obvious traditional solutions or basically the problem isn't ful...
A rule engine calculates a decision, based on one or several input parameters.
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
* **The problem is just too fiddly for traditional code**: The problem may not be complex, but you can't see a non-fragile way of building it. * **The problem is beyond any obvious algorithm based solution**: It is a complex problem to solve, there are no obvious traditional solutions or basically the problem isn't ful...
Rules engines tend to try and solve problems that change frequently or are sometimes poorly defined quickly and easily. They are not very complicated and many implementations present serious performance and scaling challenges.
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
At the lowest level, a forward-chaining rule engine allows you to structure rule sets (often large rule sets) in roughly the following way: ``` if (Condition A) {assert (Condition B)} if (Condition C) {assert (Condition B)} if (Condition B) {do something} ``` The conditions can also have parameters: ``` if (Conditi...
A rule engine calculates a decision, based on one or several input parameters.
2,457,924
What problem/s does a Rule Engine Algorithm solve? Which are the recommended ones?
2010/03/16
[ "https://Stackoverflow.com/questions/2457924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/67153/" ]
At the lowest level, a forward-chaining rule engine allows you to structure rule sets (often large rule sets) in roughly the following way: ``` if (Condition A) {assert (Condition B)} if (Condition C) {assert (Condition B)} if (Condition B) {do something} ``` The conditions can also have parameters: ``` if (Conditi...
Rules engines tend to try and solve problems that change frequently or are sometimes poorly defined quickly and easily. They are not very complicated and many implementations present serious performance and scaling challenges.
8,120,054
I am using underscore.js's templating capabilities from backbone.js, I have the following template that I define in my page like this: ``` <script type="text/template" id="businessunit_template"> <tr data-uid="{{Uid}}"> <td class="first"><span>{{Name}}</span></td> <td class="{{StatusClass}} tac">{{OverallSco...
2011/11/14
[ "https://Stackoverflow.com/questions/8120054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11755/" ]
That looks very much like the kind of faulty DOM fragment you get when you haven't declared the `.el` attribute in a `View` correctly. I'd put a breakpoint/`debugger` statement in `ReportBusinessUnitView.render()` and inspect the value of the `this.el` attribute from there. ([View.el](http://documentcloud.github.com/ba...
The inclusion of a default DIV tag to surround the template is, I believe, a safety measure. This gives a parent tag to which the view's events are attached. That way event propagation will work as expected. As well, if you discard a view and remove the inserted HTML all events will go with it allowing the garbage coll...
53,927,603
i have a text file of numbers like so **text.file** `'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9` i would like to convert this to an array like so : `myary= {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9}` but i want the **keys** to be a **string** and the **values...
2018/12/26
[ "https://Stackoverflow.com/questions/53927603", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10788284/" ]
using `ast.literal_eval` ``` import ast txt = "'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9" print (ast.literal_eval('{' + txt + '}')) #{'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9} ```
If you don't want to use literal\_eval ``` str="'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9" print({x[0].replace("'", ""):int(x[1]) for x in [y.split(': ') for y in [z for z in str.split(',')]] }) #{'2': 2, '7': 7, '8': 8, '4': 4, '1': 1, '9': 9, '3': 3, '6': 6, '5': 5} ```
38,776,883
tl;dr with Spring Boot and Thymeleaf, how do I return the column 1 value of the table in a form when the user clicks the button in column 5 of a particular row? Hi there! Long time listener, first time caller. I'd be much obliged for your help with this issue. I'm writing a server app using Spring Boot and Thymeleaf....
2016/08/04
[ "https://Stackoverflow.com/questions/38776883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1636508/" ]
I will show you how we solved that in our application. we generate a form for every action in a table row like this: ``` <table> <thead> ... </thead> <tbody> <tr th:each="entry : ${allEntries}"> ... <td> <form action="#" th:action="@{/dashboard/myEntries/} + ${{entry.id}}" method="...
Thanks to the comment from pDer666 I have a solution!! Changed the HTML to: ``` <table> <tr><th>Device IP</th> <th>Status</th> <th>Model Name</th> <th>Serial No.</th> <th>Remove?</th> </tr> <tr th:each="d : ${devices}"> <form action="#" th:action="@{/webservice/...
55,709,068
I had this routing configurations and it works perfecly, only one thing keeps anoying me: even though navigating the app works, when I go to address bar and hit enter, it redirects me to /dashboard even if I don't change the url and hit enter. Here is my routes configuration: ``` import { Routes } from '@angular/rout...
2019/04/16
[ "https://Stackoverflow.com/questions/55709068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055555/" ]
Who could guess? My problem was nothing about routes, it was a service that controls autentication and I mistakenly put at constructor a wrong condition: `if (loggedUser !== null) ths.router.navigateToUrl('/dashboard');` so when I logged in and navigate through menu it goes well, but when I hit reload or input an U...
You have two identical paths defined, one for `FullComponent`, another for redirecting to dashboard: ``` path: '', <---------------------- Empty path component: FullComponent, children: [ ... ] }, { path: '', <---------------------- Empty path redirectTo: '/dashboard', pathMatch: 'full' ...
55,709,068
I had this routing configurations and it works perfecly, only one thing keeps anoying me: even though navigating the app works, when I go to address bar and hit enter, it redirects me to /dashboard even if I don't change the url and hit enter. Here is my routes configuration: ``` import { Routes } from '@angular/rout...
2019/04/16
[ "https://Stackoverflow.com/questions/55709068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055555/" ]
You have two identical paths defined, one for `FullComponent`, another for redirecting to dashboard: ``` path: '', <---------------------- Empty path component: FullComponent, children: [ ... ] }, { path: '', <---------------------- Empty path redirectTo: '/dashboard', pathMatch: 'full' ...
It means some of the guard service preventing due to some error. you can remove the guard one by one from the routing file to identify the exact guard file. Then debug why that guard not allows. Note: the data you using to validate inside the guard is not available at the time of guard check execution. You probably h...
55,709,068
I had this routing configurations and it works perfecly, only one thing keeps anoying me: even though navigating the app works, when I go to address bar and hit enter, it redirects me to /dashboard even if I don't change the url and hit enter. Here is my routes configuration: ``` import { Routes } from '@angular/rout...
2019/04/16
[ "https://Stackoverflow.com/questions/55709068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055555/" ]
Who could guess? My problem was nothing about routes, it was a service that controls autentication and I mistakenly put at constructor a wrong condition: `if (loggedUser !== null) ths.router.navigateToUrl('/dashboard');` so when I logged in and navigate through menu it goes well, but when I hit reload or input an U...
It means some of the guard service preventing due to some error. you can remove the guard one by one from the routing file to identify the exact guard file. Then debug why that guard not allows. Note: the data you using to validate inside the guard is not available at the time of guard check execution. You probably h...
31,014,352
this is my code: ``` FileOutputStream fOut = openFileOutput("things", Context.MODE_PRIVATE); fOut.write(thing.getBytes()); ``` everytime i go through this method it erases the previous data in the file and overwrites it with the new one. I don't want this to happen because I want the text to be added Thanks for you...
2015/06/23
[ "https://Stackoverflow.com/questions/31014352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4347199/" ]
If you don't know how many elements there are going to be, you could use a `List<T>`: ``` var questions = new List<Question>(); var question = new Question(parameters); questions.Add(question); question = new Question(parameters2); questions.Add(question); ``` Then you can access questions in the list, by directly...
Use an array ``` var questions = new Question[numquestion]; for (int i = 0 to numquestion) { questions[i] = new Question(...); } ``` now you can refer to questions[n]
56,848,270
I want to logout by Angular using POST method, here is my code: ``` logout() { const url = 'http://localhost:8181/user/logout'; const xToken = localStorage.getItem('xAuthToken'); const basicHeader = 'Basic ' + localStorage.getItem('credentials'); const headers = new Headers({ 'x-auth-token': xT...
2019/07/02
[ "https://Stackoverflow.com/questions/56848270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7687530/" ]
To read the data you should do something like this : ``` from os import listdir from os.path import isfile, join import re import matplotlib.pyplot as plt mypath = '.' # edit with the path to your data files = [f for f in listdir(mypath) if isfile(join(mypath, f))] x = [] y = [] for file in files: label = file....
You can use Pillow or opencv libraries to read your images. ### For Pillow: ``` from PIL import Image import numpy as np img = PIL.Image.open("image_location/image_name") # This returns an image object img = np.asarray(img) # convert it to ndarray ``` ### For Opencv: ``` import cv2 img = cv2.imread("image_lo...
56,848,270
I want to logout by Angular using POST method, here is my code: ``` logout() { const url = 'http://localhost:8181/user/logout'; const xToken = localStorage.getItem('xAuthToken'); const basicHeader = 'Basic ' + localStorage.getItem('credentials'); const headers = new Headers({ 'x-auth-token': xT...
2019/07/02
[ "https://Stackoverflow.com/questions/56848270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7687530/" ]
You can use Pillow or opencv libraries to read your images. ### For Pillow: ``` from PIL import Image import numpy as np img = PIL.Image.open("image_location/image_name") # This returns an image object img = np.asarray(img) # convert it to ndarray ``` ### For Opencv: ``` import cv2 img = cv2.imread("image_lo...
Does this help? ``` import os import imageio def convert_word_to_label(word): if word == 'zero': return 0 elif word == 'one': return 1 elif word == 'two': return 2 elif word == 'three': return 3 elif word == 'four': return 4 elif word == 'five': ...
56,848,270
I want to logout by Angular using POST method, here is my code: ``` logout() { const url = 'http://localhost:8181/user/logout'; const xToken = localStorage.getItem('xAuthToken'); const basicHeader = 'Basic ' + localStorage.getItem('credentials'); const headers = new Headers({ 'x-auth-token': xT...
2019/07/02
[ "https://Stackoverflow.com/questions/56848270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7687530/" ]
To read the data you should do something like this : ``` from os import listdir from os.path import isfile, join import re import matplotlib.pyplot as plt mypath = '.' # edit with the path to your data files = [f for f in listdir(mypath) if isfile(join(mypath, f))] x = [] y = [] for file in files: label = file....
Does this help? ``` import os import imageio def convert_word_to_label(word): if word == 'zero': return 0 elif word == 'one': return 1 elif word == 'two': return 2 elif word == 'three': return 3 elif word == 'four': return 4 elif word == 'five': ...