qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
1,164,095
If we have a A.jar that contains B.class and this file is located in JBOSS/server/default/lib and WEB-INF/lib of an EAR file. We have java2ParentDelegation is turned off. if we want to load the B.class which one will be loaded? what if java2ParentDelegation is turned on?
2009/07/22
[ "https://Stackoverflow.com/questions/1164095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Like Ryan said: > > the pid you want is in tmp/pids/ > > > probably server.pid is the file you want. You should be able to run `kill -9 $(cat tmp/pids/server.pid)` to bring down a daemonized server.
The only **proper** way to kill the Ruby on Rails default server (which is WEBrick) is: ``` kill -INT $(cat tmp/pids/server.pid) ``` If you are running Mongrel, this is sufficient: ``` kill $(cat tmp/pids/server.pid) ``` Use `kill -9` if your daemon hung. Remember the implications of `kill -9` - if the data kept ...
1,164,095
If we have a A.jar that contains B.class and this file is located in JBOSS/server/default/lib and WEB-INF/lib of an EAR file. We have java2ParentDelegation is turned off. if we want to load the B.class which one will be loaded? what if java2ParentDelegation is turned on?
2009/07/22
[ "https://Stackoverflow.com/questions/1164095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
if it can be useful, on linux you can find which process is using a port (in this case 3000) you can use: > > lsof -i :3000 > > > it'll return the pid too
I came here because I were trying to (unsuccesfully) stop with a normal kill, and thought I'd being doing something wrong. A kill -9 is the only sure way to stop a ruby on rails server? What!? Do you know the implications of this? Can be a disaster...
1,164,095
If we have a A.jar that contains B.class and this file is located in JBOSS/server/default/lib and WEB-INF/lib of an EAR file. We have java2ParentDelegation is turned off. if we want to load the B.class which one will be loaded? what if java2ParentDelegation is turned on?
2009/07/22
[ "https://Stackoverflow.com/questions/1164095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How about a rake task? ``` desc 'stop rails' task :stop do pid_file = 'tmp/pids/server.pid' pid = File.read(pid_file).to_i Process.kill 9, pid File.delete pid_file end ``` run with rake stop or sudo rake stop
In your terminal to find out the process id (PID): ``` $ lsof -wni tcp:3000 ``` Then, use the number in the PID column to kill the process: ``` $ kill -9 <PID> ```
1,164,095
If we have a A.jar that contains B.class and this file is located in JBOSS/server/default/lib and WEB-INF/lib of an EAR file. We have java2ParentDelegation is turned off. if we want to load the B.class which one will be loaded? what if java2ParentDelegation is turned on?
2009/07/22
[ "https://Stackoverflow.com/questions/1164095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
if it can be useful, on linux you can find which process is using a port (in this case 3000) you can use: > > lsof -i :3000 > > > it'll return the pid too
Like Ryan said: > > the pid you want is in tmp/pids/ > > > probably server.pid is the file you want. You should be able to run `kill -9 $(cat tmp/pids/server.pid)` to bring down a daemonized server.
1,164,095
If we have a A.jar that contains B.class and this file is located in JBOSS/server/default/lib and WEB-INF/lib of an EAR file. We have java2ParentDelegation is turned off. if we want to load the B.class which one will be loaded? what if java2ParentDelegation is turned on?
2009/07/22
[ "https://Stackoverflow.com/questions/1164095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The only **proper** way to kill the Ruby on Rails default server (which is WEBrick) is: ``` kill -INT $(cat tmp/pids/server.pid) ``` If you are running Mongrel, this is sufficient: ``` kill $(cat tmp/pids/server.pid) ``` Use `kill -9` if your daemon hung. Remember the implications of `kill -9` - if the data kept ...
``` one-liner: kill -INT `ps -e | grep ruby | awk '{print $1}'` ``` `ps -e` lists every process on the system `grep ruby` searches that output for the ruby process `awk` passes the first argument of that output (the pid) to `kill -INT`. Try it with echo instead of kill if you just want to see the PID.
1,164,095
If we have a A.jar that contains B.class and this file is located in JBOSS/server/default/lib and WEB-INF/lib of an EAR file. We have java2ParentDelegation is turned off. if we want to load the B.class which one will be loaded? what if java2ParentDelegation is turned on?
2009/07/22
[ "https://Stackoverflow.com/questions/1164095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Like Ryan said: > > the pid you want is in tmp/pids/ > > > probably server.pid is the file you want. You should be able to run `kill -9 $(cat tmp/pids/server.pid)` to bring down a daemonized server.
In your terminal to find out the process id (PID): ``` $ lsof -wni tcp:3000 ``` Then, use the number in the PID column to kill the process: ``` $ kill -9 <PID> ```
44,623,055
have 2 times `$dayFrom = 10:00:00;` and `$dayTo = 12:00:00` i want to divide it in 15 minutes time duration. **Expected Result** `10:00:00, 10:15:00, 10:30:00, 10:45:00 and so on` Looking for help
2017/06/19
[ "https://Stackoverflow.com/questions/44623055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7957494/" ]
``` $timeArray = array(); $startTime = new \DateTime("2010-01-01 10:00:00"); $endTime = new \DateTime("2010-01-01 12:00:00"); while($startTime < $endTime) { $timeArray[] = $startTime->format('H:i:s'); $startTime->add(new \DateInterval('PT 15 M')); } echo implode(",",$timeArray); ``` Here You can go with t...
``` $dayFrom = "10:00:00"; $dayTo = "12:00:00"; while($endTime<$dayTo){ $endTime = strtotime($dayFrom) + 900; echo date('h:i:s', $endTime); } ``` Try this.
44,623,055
have 2 times `$dayFrom = 10:00:00;` and `$dayTo = 12:00:00` i want to divide it in 15 minutes time duration. **Expected Result** `10:00:00, 10:15:00, 10:30:00, 10:45:00 and so on` Looking for help
2017/06/19
[ "https://Stackoverflow.com/questions/44623055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7957494/" ]
You can also try this - ``` $dayFrom = strtotime('10:00:00'); $dayTo = strtotime('12:00:00'); while($dayFrom <= $dayTo) { echo date('H:i:s', $dayFrom); $dayFrom= strtotime('+ 15 MINUTES', $dayFrom); } ``` **Output** ``` 10:00:00 10:15:00 10:30:00 10:45:00 11:00:00 11:15:00 11:30:00 11:45:00 12:00:00 ``` [...
``` $dayFrom = "10:00:00"; $dayTo = "12:00:00"; while($endTime<$dayTo){ $endTime = strtotime($dayFrom) + 900; echo date('h:i:s', $endTime); } ``` Try this.
44,623,055
have 2 times `$dayFrom = 10:00:00;` and `$dayTo = 12:00:00` i want to divide it in 15 minutes time duration. **Expected Result** `10:00:00, 10:15:00, 10:30:00, 10:45:00 and so on` Looking for help
2017/06/19
[ "https://Stackoverflow.com/questions/44623055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7957494/" ]
Another variation on a theme - using DateInterval. ``` $df='H:i'; $timezone=new DateTimeZone('Europe/London'); $interval=new DateInterval('PT15M'); $ts=date( 'Y-m-d H:i:s', strtotime('10.00am') ); $tf=date( 'Y-m-d H:i:s', strtotime('12.00pm') ); $start=new DateTime( $ts, $timezone ); $end=new DateTime( $tf, $timezon...
``` $dayFrom = "10:00:00"; $dayTo = "12:00:00"; while($endTime<$dayTo){ $endTime = strtotime($dayFrom) + 900; echo date('h:i:s', $endTime); } ``` Try this.
227,122
I'm learning embedded programming (I'm not an Electrical Engineer). Sorry if this is not the right place or I'm asking this question incorrectly, but I had a very tough time trying to figure out a solution. I'm using a ATMega32 with a GPS module and a 16x2 LCD. I just want to read a NMEA sentence over UART and send the...
2016/04/08
[ "https://electronics.stackexchange.com/questions/227122", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106154/" ]
Your intuition is correct -- UART hardware doesn't have any synchronization beyond the byte level. (It does synchronize at the byte level for you, via a special start bit as discussed [here](https://wcscnet.com/tutorials/introduction-to-rs232-serial-communication/)) To synchronize "packets" longer than a byte, most hi...
If you look at the format of a NMEA message it has a defined start character ($) and an end character(s) CR+LF. Like this from Wikipedia: > > $GPAAM,A,A,0.10,N,WPTNME\*32 > > > Your software needs to look for the $ character and save all of the following characters into a buffer until it receives CR+LF. It can th...
227,122
I'm learning embedded programming (I'm not an Electrical Engineer). Sorry if this is not the right place or I'm asking this question incorrectly, but I had a very tough time trying to figure out a solution. I'm using a ATMega32 with a GPS module and a 16x2 LCD. I just want to read a NMEA sentence over UART and send the...
2016/04/08
[ "https://electronics.stackexchange.com/questions/227122", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106154/" ]
If you look at the format of a NMEA message it has a defined start character ($) and an end character(s) CR+LF. Like this from Wikipedia: > > $GPAAM,A,A,0.10,N,WPTNME\*32 > > > Your software needs to look for the $ character and save all of the following characters into a buffer until it receives CR+LF. It can th...
There are actually two questions involved in your post: 1) How is synchronization achieved? It is NOT. The only common factor the two devices have in common is time. This is what is specified by the Baudrate; specify a different baudrate for the two devices and you will receive garbage. Most hardware UARTs (and I hope...
227,122
I'm learning embedded programming (I'm not an Electrical Engineer). Sorry if this is not the right place or I'm asking this question incorrectly, but I had a very tough time trying to figure out a solution. I'm using a ATMega32 with a GPS module and a 16x2 LCD. I just want to read a NMEA sentence over UART and send the...
2016/04/08
[ "https://electronics.stackexchange.com/questions/227122", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106154/" ]
If you look at the format of a NMEA message it has a defined start character ($) and an end character(s) CR+LF. Like this from Wikipedia: > > $GPAAM,A,A,0.10,N,WPTNME\*32 > > > Your software needs to look for the $ character and save all of the following characters into a buffer until it receives CR+LF. It can th...
> > How is UART synchronization achieved? I know about start and stop bits, but once the UART gets a bad packet (raising a framing error for example) how can it recover and synchronize > > > Reliable synchronization can be achieved by leaving a "dead time" of at least one character period between transmissions. If...
227,122
I'm learning embedded programming (I'm not an Electrical Engineer). Sorry if this is not the right place or I'm asking this question incorrectly, but I had a very tough time trying to figure out a solution. I'm using a ATMega32 with a GPS module and a 16x2 LCD. I just want to read a NMEA sentence over UART and send the...
2016/04/08
[ "https://electronics.stackexchange.com/questions/227122", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106154/" ]
Your intuition is correct -- UART hardware doesn't have any synchronization beyond the byte level. (It does synchronize at the byte level for you, via a special start bit as discussed [here](https://wcscnet.com/tutorials/introduction-to-rs232-serial-communication/)) To synchronize "packets" longer than a byte, most hi...
There are actually two questions involved in your post: 1) How is synchronization achieved? It is NOT. The only common factor the two devices have in common is time. This is what is specified by the Baudrate; specify a different baudrate for the two devices and you will receive garbage. Most hardware UARTs (and I hope...
227,122
I'm learning embedded programming (I'm not an Electrical Engineer). Sorry if this is not the right place or I'm asking this question incorrectly, but I had a very tough time trying to figure out a solution. I'm using a ATMega32 with a GPS module and a 16x2 LCD. I just want to read a NMEA sentence over UART and send the...
2016/04/08
[ "https://electronics.stackexchange.com/questions/227122", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/106154/" ]
Your intuition is correct -- UART hardware doesn't have any synchronization beyond the byte level. (It does synchronize at the byte level for you, via a special start bit as discussed [here](https://wcscnet.com/tutorials/introduction-to-rs232-serial-communication/)) To synchronize "packets" longer than a byte, most hi...
> > How is UART synchronization achieved? I know about start and stop bits, but once the UART gets a bad packet (raising a framing error for example) how can it recover and synchronize > > > Reliable synchronization can be achieved by leaving a "dead time" of at least one character period between transmissions. If...
64,246
In order to troubleshoot a problem, I have a one-time question as to whether a specific `varchar(max)` field contains non-printing ASCII characters (other than white-space). The following is my straightforward idea about how to determine if there are such characters stored in our production database. ``` SELECT TOP 10...
2014/04/30
[ "https://dba.stackexchange.com/questions/64246", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/37796/" ]
1. If snapshot isolation is enabled you will not have any blocking issues. If not, you should probably run the query under `READ COMMITTED` or even `READ UNCOMMITTED`. It is a common myth that a `READ COMMITTED` scan locks the table. 2. You can use Resource Governor for this. Or use a `MAXDOP 1` hint. Controlling load ...
If you're worried about the performance of your query, you can take full advantage SQL Server's built in [Query Execution Plan tools](https://stackoverflow.com/questions/7359702/how-do-i-obtain-a-query-execution-plan) which should tell you how much effort the query is expected to take and what parts of it will be the b...
22,799,797
This is probably very simple. I have an image that paints and then a cover image that's gray and has a "?" mark on it. Essentially, the top image "HIDES" the bottom image until the user can "scratch off" the cover image. What's happening is, on REFRESH the images in the back (like Slot Machine images) are "flashing" g...
2014/04/02
[ "https://Stackoverflow.com/questions/22799797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2547324/" ]
Just call `solve` recursively. And you may as well create your own type for your operators instead of using strings. ``` data Op = Plus | Mult solve :: Tree Int Op -> Int solve (Leaf a) = a solve (Branch Plus args) = sum (map solve args) solve (Branch Mult args) = product (map solve args) ```
You could try this: ``` data Tree a b = Leaf a | Branch b [Tree a b] deriving (Eq,Read,Show) t1 = Branch '+' [Leaf 10, Leaf 20, Branch '*' [Leaf 2, Leaf 3, Leaf 4], Leaf 50] t2 = Branch '*' [t1,t1,t1] solve (Leaf a) = a solve (Branch op ts) = op' $ map solve ts where op' = case op...
22,799,797
This is probably very simple. I have an image that paints and then a cover image that's gray and has a "?" mark on it. Essentially, the top image "HIDES" the bottom image until the user can "scratch off" the cover image. What's happening is, on REFRESH the images in the back (like Slot Machine images) are "flashing" g...
2014/04/02
[ "https://Stackoverflow.com/questions/22799797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2547324/" ]
Just call `solve` recursively. And you may as well create your own type for your operators instead of using strings. ``` data Op = Plus | Mult solve :: Tree Int Op -> Int solve (Leaf a) = a solve (Branch Plus args) = sum (map solve args) solve (Branch Mult args) = product (map solve args) ```
A generic solution looks like so: ``` solve (Leaf a) = a solve (Branch f (t:ts)) = foldl' (\x -> f x . solve) (solve t) ts ``` Now you only need to map `Tree Int String` to `Tree Int (Int->Int->Int)`: ``` mapop (Branch "*" ts) = Branch (*) $ map mapop ts mapop (Branch "+" ts) = Branch (+) $ map mapop ts mapop (Leaf...
59,926
I need to write a web application using SQL Server 2005, asp.net, and ado.net. Much of the user data stored in this application must be encrypted (read HIPAA). In the past for projects that required encryption, I encrypted/decrypted in the application code. However, this was generally for encrypting passwords or credi...
2008/09/12
[ "https://Stackoverflow.com/questions/59926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4764/" ]
1) Look into using TRY..CATCH in SQL 2005. Unfortunately there is no FINALLY, so you'll have to handle both the success and error cases individually. 2) Not necessary if (1) handles the cleanup. 3) There isn't really a difference between client and server transactions with SQL Server. Connection.BeginTransaction() mo...
1. you can use @@error to see if any errors occured during the call to a sproc in SQL. 2. No to complicated. 3. You can but I prefer to use transactions in SQL Server itself.
59,926
I need to write a web application using SQL Server 2005, asp.net, and ado.net. Much of the user data stored in this application must be encrypted (read HIPAA). In the past for projects that required encryption, I encrypted/decrypted in the application code. However, this was generally for encrypting passwords or credi...
2008/09/12
[ "https://Stackoverflow.com/questions/59926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4764/" ]
I'm a big fan of option 3. Pretend for a minute you were going to set up transaction infrastructure anyways where: 1. Whenever a call to the datastore was about to be made if an existing transaction hadn't been started then one was created. 2. If a transaction is already in place then calls to the data store hook int...
1. you can use @@error to see if any errors occured during the call to a sproc in SQL. 2. No to complicated. 3. You can but I prefer to use transactions in SQL Server itself.
59,926
I need to write a web application using SQL Server 2005, asp.net, and ado.net. Much of the user data stored in this application must be encrypted (read HIPAA). In the past for projects that required encryption, I encrypted/decrypted in the application code. However, this was generally for encrypting passwords or credi...
2008/09/12
[ "https://Stackoverflow.com/questions/59926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4764/" ]
1) Look into using TRY..CATCH in SQL 2005. Unfortunately there is no FINALLY, so you'll have to handle both the success and error cases individually. 2) Not necessary if (1) handles the cleanup. 3) There isn't really a difference between client and server transactions with SQL Server. Connection.BeginTransaction() mo...
I'm a big fan of option 3. Pretend for a minute you were going to set up transaction infrastructure anyways where: 1. Whenever a call to the datastore was about to be made if an existing transaction hadn't been started then one was created. 2. If a transaction is already in place then calls to the data store hook int...
165,900
Size comparison maps are very popular, and can be found all over social media. Are there any geographic mathematical principles which completely dispel them. Can we comfortably assert they are neither accurate nor precise or should I admit they have some legitimacy? Here is an example below "Size comparison of the Grea...
2015/10/08
[ "https://gis.stackexchange.com/questions/165900", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/57236/" ]
It depends on the map projection. If both the source of country polygon, and the overlay/basemap are using equal area projections (which are not common, especially on webmaps) then yes a size comparison is 100% fair. Otherwise, no, different amounts of areal distortion are found at different parts of the globe. Furth...
Yes, I found an answer. As you aggregate a map, the size is distorted, especially when viewed over the web. Projections are based on different surfaces and distort maps in different ways. Two images layered on top of each other will generally always distort the different areas on a map, making a size comparison complet...
165,900
Size comparison maps are very popular, and can be found all over social media. Are there any geographic mathematical principles which completely dispel them. Can we comfortably assert they are neither accurate nor precise or should I admit they have some legitimacy? Here is an example below "Size comparison of the Grea...
2015/10/08
[ "https://gis.stackexchange.com/questions/165900", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/57236/" ]
One particular example which takes into consideration size as well as cultural and social relevance is this map of Detroit which has [made the rounds for several years](http://blog.thedetroithub.com/2010/08/12/comparing-detroit-to-other-cities-look-at-the-map/): [![enter image description here](https://i.stack.imgur.c...
It depends on the map projection. If both the source of country polygon, and the overlay/basemap are using equal area projections (which are not common, especially on webmaps) then yes a size comparison is 100% fair. Otherwise, no, different amounts of areal distortion are found at different parts of the globe. Furth...
165,900
Size comparison maps are very popular, and can be found all over social media. Are there any geographic mathematical principles which completely dispel them. Can we comfortably assert they are neither accurate nor precise or should I admit they have some legitimacy? Here is an example below "Size comparison of the Grea...
2015/10/08
[ "https://gis.stackexchange.com/questions/165900", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/57236/" ]
One particular example which takes into consideration size as well as cultural and social relevance is this map of Detroit which has [made the rounds for several years](http://blog.thedetroithub.com/2010/08/12/comparing-detroit-to-other-cities-look-at-the-map/): [![enter image description here](https://i.stack.imgur.c...
Yes, I found an answer. As you aggregate a map, the size is distorted, especially when viewed over the web. Projections are based on different surfaces and distort maps in different ways. Two images layered on top of each other will generally always distort the different areas on a map, making a size comparison complet...
28,646,213
So I'm trying to create a upload profile picture for my website... And I'm wondering if the `image` rule is secure enough in Laravel. Consider the following code: ``` input = [ 'profile_picture' => Input::file('profile_picture'), ]; $rules = ['profile_picture' => 'required|image']; $validator = Validator::make(...
2015/02/21
[ "https://Stackoverflow.com/questions/28646213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2709111/" ]
No it's not secure. At least you can't be sure if it is a real image as the MIME type can be manipulated. What usually helps is to use `getimagesize()` which will return `false` if the file is not an image. So you could extend the validator with this rule: ``` Validator::extend('real_image', function($attribute, $valu...
To answer your question We can't say anything as secured or not. But Yes **Laravel validates image only few format which you specified**. It is also mentioned [here](http://laravel.com/docs/5.0/validation). If you think it is a basic validation, then you shall use the third party package like [this](https://github.c...
497,591
I get this message when I compile it " ! Package inputenc Error: Unicode character ٰ (U+0670) (inputenc) not set up for use with LaTeX. " ``` \documentclass[11pt,a4paper]{report} \usepackage{arabtex} \usepackage[utf8]{inputenc} \usepackage[LFE,LAE]{fontenc} \usepackage[arabic]{babel} \usepackage{quran} \begin{document...
2019/06/26
[ "https://tex.stackexchange.com/questions/497591", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/168993/" ]
The `quran` package is for preparing files compiled with `xelatex` (or, as Davislor notes, `lualatex`). That is, it uses `latex` macros with the `xetex` (or `luatex`) binary, which handles unicode natively. By contrast, `arabtex` uses `latex` macros with the `pdftex` binary, which works with older and more limited enco...
Here is an example using the `babel` package and the Amiri Quran font on LuaLaTeX. ``` \documentclass{book} \usepackage[bidi=basic]{babel} \usepackage{fontspec} \usepackage{quran} \babelprovide[import, main]{arabic} \babelfont{rm}% [Ligatures=Common]{Libertinus Serif} \babelfont{sf}% [Ligatures=C...
497,591
I get this message when I compile it " ! Package inputenc Error: Unicode character ٰ (U+0670) (inputenc) not set up for use with LaTeX. " ``` \documentclass[11pt,a4paper]{report} \usepackage{arabtex} \usepackage[utf8]{inputenc} \usepackage[LFE,LAE]{fontenc} \usepackage[arabic]{babel} \usepackage{quran} \begin{document...
2019/06/26
[ "https://tex.stackexchange.com/questions/497591", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/168993/" ]
The `quran` package is for preparing files compiled with `xelatex` (or, as Davislor notes, `lualatex`). That is, it uses `latex` macros with the `xetex` (or `luatex`) binary, which handles unicode natively. By contrast, `arabtex` uses `latex` macros with the `pdftex` binary, which works with older and more limited enco...
The following example shows a possible and simultaneous usage of quran and quran-ur packages with English translation (without using arabtex or arabxetex or babel or fontspec). Required fonts can also be downloaded from <https://fonts.qurancomplex.gov.sa/wp02/?s=KFGQPC+Uthmanic+Script+HAFS> , and <https://urdufonts.net...
497,591
I get this message when I compile it " ! Package inputenc Error: Unicode character ٰ (U+0670) (inputenc) not set up for use with LaTeX. " ``` \documentclass[11pt,a4paper]{report} \usepackage{arabtex} \usepackage[utf8]{inputenc} \usepackage[LFE,LAE]{fontenc} \usepackage[arabic]{babel} \usepackage{quran} \begin{document...
2019/06/26
[ "https://tex.stackexchange.com/questions/497591", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/168993/" ]
Here is an example using the `babel` package and the Amiri Quran font on LuaLaTeX. ``` \documentclass{book} \usepackage[bidi=basic]{babel} \usepackage{fontspec} \usepackage{quran} \babelprovide[import, main]{arabic} \babelfont{rm}% [Ligatures=Common]{Libertinus Serif} \babelfont{sf}% [Ligatures=C...
The following example shows a possible and simultaneous usage of quran and quran-ur packages with English translation (without using arabtex or arabxetex or babel or fontspec). Required fonts can also be downloaded from <https://fonts.qurancomplex.gov.sa/wp02/?s=KFGQPC+Uthmanic+Script+HAFS> , and <https://urdufonts.net...
6,096,739
I have a div, with a specific style(let's say a certain background). What I want is, when one clicks on a list element having that div applied another specific style (another background type) to be applied to that div, If another area in a different element belonging to that div is clicked, the style should not chang...
2011/05/23
[ "https://Stackoverflow.com/questions/6096739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342279/" ]
you can use `.css` method of jquery.. reference [css method](http://api.jquery.com/css/)
``` $(document).ready(function() { $('#div_one').bind('click', function() { $('#div_two').addClass('large'); }); }); ``` If I understood your question. Or you can modify css directly: ``` var $speech = $('div.speech'); var currentSize = $speech.css('fontSize'); $speech.css('fontSize', '10px'); ```
6,096,739
I have a div, with a specific style(let's say a certain background). What I want is, when one clicks on a list element having that div applied another specific style (another background type) to be applied to that div, If another area in a different element belonging to that div is clicked, the style should not chang...
2011/05/23
[ "https://Stackoverflow.com/questions/6096739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342279/" ]
you can use `.css` method of jquery.. reference [css method](http://api.jquery.com/css/)
If I understand correctly you want to change the CSS style of an element by clicking an item in a `ul` list. Am I right? HTML: ``` <div class="results" style="background-color:Red;"> </div> <ul class="colors-list"> <li>Red</li> <li>Blue</li> <li>#ffee99</li> </ul> ``` jquery ``` $('.colors-list l...
6,096,739
I have a div, with a specific style(let's say a certain background). What I want is, when one clicks on a list element having that div applied another specific style (another background type) to be applied to that div, If another area in a different element belonging to that div is clicked, the style should not chang...
2011/05/23
[ "https://Stackoverflow.com/questions/6096739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342279/" ]
As what I have understand on your question, this is what you want. Here is a [jsFiddle](http://jsfiddle.net/gSAjV/2/) of the below: ```js $('.childDiv').click(function() { $(this).parent().find('.childDiv').css('background-color', '#ffffff'); $(this).css('background-color', '#ff0000'); }); ``` ```css .parentD...
you can use `.css` method of jquery.. reference [css method](http://api.jquery.com/css/)
6,096,739
I have a div, with a specific style(let's say a certain background). What I want is, when one clicks on a list element having that div applied another specific style (another background type) to be applied to that div, If another area in a different element belonging to that div is clicked, the style should not chang...
2011/05/23
[ "https://Stackoverflow.com/questions/6096739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342279/" ]
As what I have understand on your question, this is what you want. Here is a [jsFiddle](http://jsfiddle.net/gSAjV/2/) of the below: ```js $('.childDiv').click(function() { $(this).parent().find('.childDiv').css('background-color', '#ffffff'); $(this).css('background-color', '#ff0000'); }); ``` ```css .parentD...
``` $(document).ready(function() { $('#div_one').bind('click', function() { $('#div_two').addClass('large'); }); }); ``` If I understood your question. Or you can modify css directly: ``` var $speech = $('div.speech'); var currentSize = $speech.css('fontSize'); $speech.css('fontSize', '10px'); ```
6,096,739
I have a div, with a specific style(let's say a certain background). What I want is, when one clicks on a list element having that div applied another specific style (another background type) to be applied to that div, If another area in a different element belonging to that div is clicked, the style should not chang...
2011/05/23
[ "https://Stackoverflow.com/questions/6096739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/342279/" ]
As what I have understand on your question, this is what you want. Here is a [jsFiddle](http://jsfiddle.net/gSAjV/2/) of the below: ```js $('.childDiv').click(function() { $(this).parent().find('.childDiv').css('background-color', '#ffffff'); $(this).css('background-color', '#ff0000'); }); ``` ```css .parentD...
If I understand correctly you want to change the CSS style of an element by clicking an item in a `ul` list. Am I right? HTML: ``` <div class="results" style="background-color:Red;"> </div> <ul class="colors-list"> <li>Red</li> <li>Blue</li> <li>#ffee99</li> </ul> ``` jquery ``` $('.colors-list l...
56,731,135
I have two form arrays in my code. I need to combine them and perform addition and deletion on the combined array. I need to concatenate the form array controls of each form array ``` let a = this.nextBillForm.controls["electricityBillCycleEnergyCharges"] as FormArray; let b = this.nextBillForm.controls["electricityB...
2019/06/24
[ "https://Stackoverflow.com/questions/56731135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9456208/" ]
`FormArray` is not an array. It doesn't have `forEach` nor `concat` functions. You can operate on `controls` property though: ``` a.controls.forEach(control => { b.push(control); }); ``` or ``` const combined = a.controls.concat(b.controls); ``` See [FormArray documentation](https://angular.io/api/forms/FormArra...
Hi @Nat\_centralogic Both the ways that you have tried will not work because the form Array object is not an Array reference. It is the reference of form group. FormArray reference does not any method like concat or push i.e. why it is throwing errors. See in the image below: [![enter image description here](https://...
12,021,379
I'm using animate function, and I need to set the height property of the animation to match variable pituus, because the content height depends on form submit. ``` $.ajax({ type: "POST", url: "http://www.kotisivut.name/quiz.php", data: dataString, dataType: "text", error: function() { alert...
2012/08/18
[ "https://Stackoverflow.com/questions/12021379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You will have to make your own MapView and then use the onTouchListener() for it to detect a click on the map and based off the click location you will be able to get the geopoint using this code: ``` class HelloGoogleMaps extends MapActivity { @Override public void onCreate(Bundle savedInstanceState) { List<Overlay...
I would be further difficult to make your "own" mapview. I think you mean to use [ItemizedOverlay](https://developers.google.com/maps/documentation/android/reference/com/google/android/maps/ItemizedOverlay) class. You can put pins to mapview by overriding onTap() methods of this class.
60,167
If I have ComputerA that has their networking interface set with an MTU of 1500 and ComputerB has a network interface with an MTU of 1200 is there any way for ComputerA to know that ComputerB's MTU is 1200 or if it sends large packets it will get from ComputerB a request to fragment the packet?
2019/07/02
[ "https://networkengineering.stackexchange.com/questions/60167", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/59510/" ]
The hosts can use [Path MTU Discovery](https://www.rfc-editor.org/rfc/rfc1191) which is optional for IPv4 and mandatory for IPv6. With IPv4, a packet is fragmented where it is larger than the egress interface's MTU - that can happen on the source host or any intermediate router. In your example, the router between A a...
This is a bit of a sideline answer, as the question was about MTU, not MSS. ... and then there's TCP MSS, which helps in case of TCP, but of course not with UDP nor ICMP. Using the MSS field in the TCP header (only in the SYN and SYN-ACK packets of the initial 3-way handshake), hosts can signal to their peers how l...
69,637,782
I have the following situation using flex: [Codepen](https://codepen.io/eduardodeasousa/pen/rNzLrmV) ``` <html> <head> <style> * { box-sizing: border-box; } .first-card { border: 1px black solid; width: 480px; padding: 24px; display: flex; flex-direction: column; } .content { flex-wrap: wrap; grid-g...
2021/10/19
[ "https://Stackoverflow.com/questions/69637782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11946670/" ]
Use this with content `margin-bottom:clamp(0px,(450px - 100%)*9999,20px)`. It's a conditional margin based on the value `450px`. If the container is bigger than `450px` you have `0px` else you have `20px` ```css * { box-sizing: border-box; } .first-card { border: 1px black solid; width: 480px; padding: 24px; ...
Unfortunately with just CSS, no. If your div width relies on something like screen width, you could use [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries). With javascript, You could poll the element for its width and conditionally add or remove the styling needed for t...
27,108,992
Coming from a relational db background I find it easy to break apart user and their roles into normalized tables. But what is the customary way to do this in a mongo database? Scenario I have ``` ({ "roles" : [ {"role": "user"}, {"role": "manager"}, {"role": "admin"} ] "privile...
2014/11/24
[ "https://Stackoverflow.com/questions/27108992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745835/" ]
If your roles are plain Strings or a primitive tuple, you can store them as `array` inside each User's document. If the role is a complex entity, you can store them as an array of doc-refs. UPDATE: this is a document from my `userAccount` collection, generated by `Spring Security Core Grails plugin`: ``` { "_id" :...
Mongo DB user roles are defined as JSON documents. Try the following links <https://docs.mongodb.com/manual/reference/built-in-roles/> <https://scalegrid.io/blog/creating-role-based-access-control-in-mongodb/>
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
I won't try to justify the private set method as that sounds a bit weird to me. You could handle the one set by using a friend declaration. But then why would you define a setter when the friend could just set the value directly? I generally avoid setters if I can at all manage it. Instead I prefer provide facility to...
It's that last parenthetical that is important: assuming code works as intended. In my mind it's similar to permissions in Linux systems. You know the root password and you can delete any file, but you don't stay logged in as root so you don't do anything by accident. Similarly, when you have a private variable charac...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
The access specifiers mainly serve to denote the class interface, not to effectively limit the programmer's access or protect things. They serve to prevent *accidental* hacking. If something is set once, then you should try to set it when it is created, and make it `const`. If the interface doesn't need to be especia...
It's that last parenthetical that is important: assuming code works as intended. In my mind it's similar to permissions in Linux systems. You know the root password and you can delete any file, but you don't stay logged in as root so you don't do anything by accident. Similarly, when you have a private variable charac...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
The access specifiers mainly serve to denote the class interface, not to effectively limit the programmer's access or protect things. They serve to prevent *accidental* hacking. If something is set once, then you should try to set it when it is created, and make it `const`. If the interface doesn't need to be especia...
I won't try to justify the private set method as that sounds a bit weird to me. You could handle the one set by using a friend declaration. But then why would you define a setter when the friend could just set the value directly? I generally avoid setters if I can at all manage it. Instead I prefer provide facility to...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
I won't try to justify the private set method as that sounds a bit weird to me. You could handle the one set by using a friend declaration. But then why would you define a setter when the friend could just set the value directly? I generally avoid setters if I can at all manage it. Instead I prefer provide facility to...
Don't confuse the **private** and the **public** interfaces of the class. In theory these are completely different interfaces, and this is just a design feature of C++ that they're located physically in the same class declaration. It's perfectly ok to have a public getter/setter when the object property should be expo...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
I won't try to justify the private set method as that sounds a bit weird to me. You could handle the one set by using a friend declaration. But then why would you define a setter when the friend could just set the value directly? I generally avoid setters if I can at all manage it. Instead I prefer provide facility to...
If the variable is 'write once then forever read only' I'd recommend making it a `const` member that is initialized during construction. There's no value in a private 'setter' function because it won't be used. Also you avoid people using the setter function to set the name when it's never meant to be set. For example...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
I won't try to justify the private set method as that sounds a bit weird to me. You could handle the one set by using a friend declaration. But then why would you define a setter when the friend could just set the value directly? I generally avoid setters if I can at all manage it. Instead I prefer provide facility to...
Private getters and setters all make sense when the data in question involves several variables, have additional constraints you want to make sure you adhere to, and these operations are done several times in your class. Or when you plan further modifications to the data model and wish to abstract operations on the dat...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
The access specifiers mainly serve to denote the class interface, not to effectively limit the programmer's access or protect things. They serve to prevent *accidental* hacking. If something is set once, then you should try to set it when it is created, and make it `const`. If the interface doesn't need to be especia...
Don't confuse the **private** and the **public** interfaces of the class. In theory these are completely different interfaces, and this is just a design feature of C++ that they're located physically in the same class declaration. It's perfectly ok to have a public getter/setter when the object property should be expo...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
The access specifiers mainly serve to denote the class interface, not to effectively limit the programmer's access or protect things. They serve to prevent *accidental* hacking. If something is set once, then you should try to set it when it is created, and make it `const`. If the interface doesn't need to be especia...
If the variable is 'write once then forever read only' I'd recommend making it a `const` member that is initialized during construction. There's no value in a private 'setter' function because it won't be used. Also you avoid people using the setter function to set the name when it's never meant to be set. For example...
7,169,492
I've read a lot of guides that explain why I should use "private" and the answer is always "Because we don't want anyone else setting this as something". So, let me ask the following questions: Assuming that I want to have a variable that is set-once (perhaps something like a character name in a video game, ask once, ...
2011/08/24
[ "https://Stackoverflow.com/questions/7169492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859247/" ]
The access specifiers mainly serve to denote the class interface, not to effectively limit the programmer's access or protect things. They serve to prevent *accidental* hacking. If something is set once, then you should try to set it when it is created, and make it `const`. If the interface doesn't need to be especia...
Private getters and setters all make sense when the data in question involves several variables, have additional constraints you want to make sure you adhere to, and these operations are done several times in your class. Or when you plan further modifications to the data model and wish to abstract operations on the dat...
17,015,435
I am trying to learn python and regex at the same time and I am having some trouble in finding how to match till end of string and make a replacement on the fly. So, I have a string like so: ``` ss="this_is_my_awesome_string/mysuperid=687y98jhAlsji" ``` What I'd want is to first find `687y98jhAlsji` (I do not know ...
2013/06/10
[ "https://Stackoverflow.com/questions/17015435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/848746/" ]
You can try this: ``` re.sub(r'[^=]+$', 'myreplacedstuff', ss) ``` The idea is to use a character class that exclude the delimiter (here `=`) and to anchor the pattern with `$` explanation: `[^=]` is a character class and means *all characters that are not `=`* `[^=]+` one or more characters from this class ...
You can use regular expressions: ``` >>> import re >>> mymatch = re.search(r'mysuperid=(.*)', ss) >>> ss.replace(mymatch.group(1), 'replacing_stuff') 'this_is_my_awesome_string/mysuperid=replacing_stuff' ``` You should probably use @Casimir's answer though. It looks cleaner, and I'm not that good at regex :p.
27,435,453
I have a data frame with two numerical variables fatcontent and saltcontent plus two factor variables cond and spice that describe the different treatments. In this data frame each measurement for the numerical varibles was taken twice. ``` a <- data.frame(cond = rep(c("uncooked", "fried", "steamed", "baked", "grilled...
2014/12/12
[ "https://Stackoverflow.com/questions/27435453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4352241/" ]
I think this is what you are after. You want to find mean for each spice condition using uncooked data points. That is something I have done in my first step. Then, I wanted to add `fatmean` and `saltmean` in `ana` to your data frame, `a`. If your data is really huge, this may not be a memory efficient way. But, I used...
All you need to do is group by both the condition and spice, like so: ``` library(dplyr) a %>% group_by(spice, cond) %>% mutate(fat.norm = fatcontent / mean(fatcontent), salt.norm = saltcontent / mean(saltcontent)) # Source: local data frame [90 x 6] # Groups: spice, cond # # cond spice fatcontent...
27,435,453
I have a data frame with two numerical variables fatcontent and saltcontent plus two factor variables cond and spice that describe the different treatments. In this data frame each measurement for the numerical varibles was taken twice. ``` a <- data.frame(cond = rep(c("uncooked", "fried", "steamed", "baked", "grilled...
2014/12/12
[ "https://Stackoverflow.com/questions/27435453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4352241/" ]
A succinct way to normalize the data would be to include the "uncooked" condition right in the mean calculation so you don't need to filter, summarise, join and recalculate. Doing this with `mutate_each` means you only need to type it once. ``` group_by(a, spice) %>% mutate_each(funs(./mean(.[cond == "uncooked"])), ...
All you need to do is group by both the condition and spice, like so: ``` library(dplyr) a %>% group_by(spice, cond) %>% mutate(fat.norm = fatcontent / mean(fatcontent), salt.norm = saltcontent / mean(saltcontent)) # Source: local data frame [90 x 6] # Groups: spice, cond # # cond spice fatcontent...
855,369
I had been saving my photos to OneDrive. Now that there are so many I want to save them back to my PC but it keeps putting them in OneDrive and says the PC Pictures in Library is no longer available. When I go to make another folder for Pictures it tells me there's already a folder with that name. All I want to do is ...
2014/12/21
[ "https://superuser.com/questions/855369", "https://superuser.com", "https://superuser.com/users/400902/" ]
Your local Picture library is at: ``` c:\Users\<yourusername>\Pictures ``` Make sure that this isn't assigned to sync to OneDrive and make sure that you are actually copying to that location (try manually entering the full path in a Windows Explorer location bar). You may have inadvertently assigned that location t...
I believe Windows 8 allows you to automatically upload and sync your photos with OneDrive. I don't know for certain, but it probably merges your local Pictures folder with the OneDrive folder if that's enabled. Go into Settings, find the OneDrive settings and disable syncing for pictures. Try copying them after syncin...
603,536
How to send HUP signal and zero downtime restart nginx server using Node.js file
2015/03/31
[ "https://askubuntu.com/questions/603536", "https://askubuntu.com", "https://askubuntu.com/users/393448/" ]
You need three things: 1. The PID of your nginx server. Stored in: `/var/run/nginx.pid` 2. A command to send a `SIGHUP` (`1`) to the process with that PID: ``` kill -1 $(cat /var/run/nginx.pid) ``` 3. A way for node.js to send the `kill`. I'd go with [a child process](https://stackoverflow.com/questions/14458508/nod...
1. create a file inside `/etc/sudoers.d/`. Call it `reload-nginx` 2. Put the following with the following lines inside `reload-nginx`. `%dev` is user group of multiple users who can want to reload nginx. You can also restrict this privilege to a single user ``` %dev ALL=(ALL) NOPASSWD: /bin/systemctl reload nginx.serv...
18,356,530
I'm a bit of a .NET noob. I've been struggling trying to find a way to execute a command through a vb.net application and I found [this thread](http://social.msdn.microsoft.com/Forums/vstudio/en-US/c88f61f5-7f2b-4c9b-8523-a334186fb0b9/how-to-execute-a-command-line-in-vbnet) so what I came up with, to map a drive to ano...
2013/08/21
[ "https://Stackoverflow.com/questions/18356530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/642572/" ]
Your code need modifications ``` Dim application As New ProcessStartInfo("cmd.exe") With {.RedirectStandardInput = True, .UseShellExecute = False} Dim process As New Process process = process.Start(application) Dim command As String = "net use x: \\webtest01\c$ /USER:daylight\...
Change your code to ``` Dim command As String = "/C net use x: \\webtest01\c$ /USER:daylight\robbery TakeItNGo" Dim application As New ProcessStartInfo("cmd.exe", command) Dim process = process.Start(application) process.WaitForExit() process.Close() ``` The [ProcessStartInfo](http://msdn.microsoft.com/en-us/libra...
46,291,287
I review the [coreutils](http://www.gnu.org/software/coreutils/coreutils.html)'s source tree then i found the code below which confuse me a little. (at coreutils-8.23/lib/getopt.c line 237) ``` d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); ``` the using of '!' was reversing the logical stat...
2017/09/19
[ "https://Stackoverflow.com/questions/46291287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6288392/" ]
This is generally done to force the return into either a `1` or a `0`. If something returns either `0` or `NULL`, then the final state of `!!<expression>` will be `0` and thereby `false` . If something returns anything other than `0` or `NULL`, then the final state will be `1` and thereby `true` [Further reference...
You'll see this sometimes when using non `bool` as a bit mask. Any non-zero value is truthy. Negating a nonzero value produces `0`, which is falsy. Negating that again, always produces `1`, which is truthy. Note, that this final result can differ from the the input (which can be any other truthy value). Basically it ...
46,291,287
I review the [coreutils](http://www.gnu.org/software/coreutils/coreutils.html)'s source tree then i found the code below which confuse me a little. (at coreutils-8.23/lib/getopt.c line 237) ``` d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); ``` the using of '!' was reversing the logical stat...
2017/09/19
[ "https://Stackoverflow.com/questions/46291287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6288392/" ]
This is generally done to force the return into either a `1` or a `0`. If something returns either `0` or `NULL`, then the final state of `!!<expression>` will be `0` and thereby `false` . If something returns anything other than `0` or `NULL`, then the final state will be `1` and thereby `true` [Further reference...
As others have pointed out, the purpose is to guarantee that the truthy value is 1 instead of all possible nonzero values. This can prevent bugs where people rely on true being 1, leading to bugs like: ``` env = getenv("POSIXLY_CORRECT") if (env == true) { // handle the true case } ``` Engineers would use !! as...
53,685,933
I want to take an integer from the user, and generate a sequence of five numbers starting with the given integer, and multiplying each previous number by four, using iteration. E.g., if I enter `2` then the list should be `[2, 8, 32, 128, 512]`. ``` n = gets i = 0 while i < 4 n = n * 4 p n i = i + 1 end ```
2018/12/08
[ "https://Stackoverflow.com/questions/53685933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10435234/" ]
I am not sure if you are looking to create an array of numbers to use later or just want to iterate. In the following you can replace puts memo with whatever you want, memo will contain the value you are looking for each pass. ``` s = 2 (s...(s+5)).reduce(s) do |memo, i| puts memo memo = memo * 4 end ```
There are a lot of ways to accomplish what you are describing. You already have some implementations in the comments and in the other answer by @Abhimanyu. > > the trouble I'm having is to iterate the value for the sequence. I keep getting it as [2,2,2,2,2] > > > Your code example won't work because [`Kernel#gets...
53,685,933
I want to take an integer from the user, and generate a sequence of five numbers starting with the given integer, and multiplying each previous number by four, using iteration. E.g., if I enter `2` then the list should be `[2, 8, 32, 128, 512]`. ``` n = gets i = 0 while i < 4 n = n * 4 p n i = i + 1 end ```
2018/12/08
[ "https://Stackoverflow.com/questions/53685933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10435234/" ]
Run: ``` (5 - 1).times.with_object([gets.to_i]){|i, a| a.push(a.last * 4)} ``` Input: ``` 2 ``` Return value: ``` [2, 8, 32, 128, 512] ```
There are a lot of ways to accomplish what you are describing. You already have some implementations in the comments and in the other answer by @Abhimanyu. > > the trouble I'm having is to iterate the value for the sequence. I keep getting it as [2,2,2,2,2] > > > Your code example won't work because [`Kernel#gets...
77,894
Cron: `* */6 * * * /path/to/command` I want this cron to run once in every 6 hour. Whats wrong with the above cron definition, and why?
2013/06/01
[ "https://unix.stackexchange.com/questions/77894", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/40297/" ]
You have to specify a minute value in the first column. The star there makes it run on each minute value. ``` 10 */6 * * * /path/to/command ``` will make it run 10 minutes past the hour, every six hours (on all days). From `man 5 crontab`: *A field may be an asterisk (`*`), which always stands for 'first-last'*. Th...
It is not portable. This one should always work: ``` 0 0,6,12,18 * * * /path/to/command ```
77,894
Cron: `* */6 * * * /path/to/command` I want this cron to run once in every 6 hour. Whats wrong with the above cron definition, and why?
2013/06/01
[ "https://unix.stackexchange.com/questions/77894", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/40297/" ]
You have to specify a minute value in the first column. The star there makes it run on each minute value. ``` 10 */6 * * * /path/to/command ``` will make it run 10 minutes past the hour, every six hours (on all days). From `man 5 crontab`: *A field may be an asterisk (`*`), which always stands for 'first-last'*. Th...
You can always use Cron job simulators to validate you Job run schedule. Link for one of the cron job simulator - <http://www.dataphyx.com/cronsandbox/>
77,894
Cron: `* */6 * * * /path/to/command` I want this cron to run once in every 6 hour. Whats wrong with the above cron definition, and why?
2013/06/01
[ "https://unix.stackexchange.com/questions/77894", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/40297/" ]
It is not portable. This one should always work: ``` 0 0,6,12,18 * * * /path/to/command ```
You can always use Cron job simulators to validate you Job run schedule. Link for one of the cron job simulator - <http://www.dataphyx.com/cronsandbox/>
3,248,639
I am trying to prove the "only one" part of the problem. > > Let $A$ be a set of propositional symbols, $\alpha$ ba a WFF over $A$ and $M\subseteq A$. And let $M^+: = M \cup \{(\neg a): a\in (A-M)\}$. Then, only one of $M^+ \vdash \alpha$ or $M^+ \vdash \neg \alpha$ are true. > > > * $M^+\vdash \alpha$ means that...
2019/06/02
[ "https://math.stackexchange.com/questions/3248639", "https://math.stackexchange.com", "https://math.stackexchange.com/users/621970/" ]
Since you have the $\bot$ connective, we can define consistency to mean $\nvdash\bot$. You can also easily derive $\dfrac{\Sigma\vdash\bot}{\Sigma\vdash\beta}$ for any formula $\beta$. (How?) FI immediately implies that deriving $\Sigma\vdash\alpha$ and $\Sigma\vdash\neg\alpha$ means $\Sigma\vdash\bot$ is derivable, a...
The argument is by induction/recursion on the proofs of $\Sigma\vdash\alpha$ ($\Sigma\vdash\lnot\alpha$). Suppose $M^+\vdash\alpha$. I show that $M^+\not\vdash\lnot\alpha$ (the other direction is analogous). Let's assume, for a contradiction, that $M^+\vdash\lnot\alpha$. Then, there is a sequence $\Sigma$ of elements...
1,075,776
I do know the BSSID and passphrase of my wireless router and I want to connect my wireless interface to it without caring about the SSID. Thus, I do want it to work even after the SSID of the wireless router has been modified. What I have tried to achieve this is to alter my `/etc/network/interfaces`: ``` iface wlan0...
2016/05/11
[ "https://superuser.com/questions/1075776", "https://superuser.com", "https://superuser.com/users/238917/" ]
It is possible in general but may be tough with Archer C9. Get alternative firmware to your router. OpenWrt [supports Archer C9](https://wiki.openwrt.org/toh/tp-link/archer-c9) with serious [limitations](https://wiki.openwrt.org/doc/hardware/soc/soc.broadcom.bcm53xx) unfortunately (BCM4360 not usable at all!). With ot...
Archer C9 does not even include a modem. I think there's no way to use it as you intend, not even with an usb adapter
1,075,776
I do know the BSSID and passphrase of my wireless router and I want to connect my wireless interface to it without caring about the SSID. Thus, I do want it to work even after the SSID of the wireless router has been modified. What I have tried to achieve this is to alter my `/etc/network/interfaces`: ``` iface wlan0...
2016/05/11
[ "https://superuser.com/questions/1075776", "https://superuser.com", "https://superuser.com/users/238917/" ]
It is possible in general but may be tough with Archer C9. Get alternative firmware to your router. OpenWrt [supports Archer C9](https://wiki.openwrt.org/toh/tp-link/archer-c9) with serious [limitations](https://wiki.openwrt.org/doc/hardware/soc/soc.broadcom.bcm53xx) unfortunately (BCM4360 not usable at all!). With ot...
Your router will not do this for you on it's own. However, whilst the following method is a little convoluted, it should allow you to share your mobile internet connection through your computer's ethernet port to the router. First connect your computer to the internet through the mobile device. Now open `Control Pan...
1,075,776
I do know the BSSID and passphrase of my wireless router and I want to connect my wireless interface to it without caring about the SSID. Thus, I do want it to work even after the SSID of the wireless router has been modified. What I have tried to achieve this is to alter my `/etc/network/interfaces`: ``` iface wlan0...
2016/05/11
[ "https://superuser.com/questions/1075776", "https://superuser.com", "https://superuser.com/users/238917/" ]
It is possible in general but may be tough with Archer C9. Get alternative firmware to your router. OpenWrt [supports Archer C9](https://wiki.openwrt.org/toh/tp-link/archer-c9) with serious [limitations](https://wiki.openwrt.org/doc/hardware/soc/soc.broadcom.bcm53xx) unfortunately (BCM4360 not usable at all!). With ot...
Use the following device. TP-Link TL-MR3020 Mini Pocket 3G/4G Wireless Router. With this device you have to connect the USB 4G dongle. With configurations
33,909
I am a general contractor and while working with Architects, I receive large PDF files containing construction plans and specifications, usually lumped together in a single large multiple page PDF. When bidding out to subcontractors, I use Adobe acrobat to bookmark the pages with the individual file names I would like,...
2016/06/15
[ "https://softwarerecs.stackexchange.com/questions/33909", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/24436/" ]
[Visual Studio 2015](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx) is what you need. Microsoft provides a free community version. [![Visual Studio 2015](https://i.stack.imgur.com/ZJTEL.png)](https://i.stack.imgur.com/ZJTEL.png)
In addition to Visual Studio you could give the [Mono](https://en.wikipedia.org/wiki/Mono_(software)) Project & the [monodevelop](http://www.monodevelop.com) IDR a try. Screenshots ----------- CRM Services App project on Windows 10 [![enter image description here](https://i.stack.imgur.com/TzvTm.png)](https://i.stack...
66,378,577
I want to use a function as a **default** argument for another function that can be *overridden without calling the function.* Let's use this snippet: ``` def split(): word = input('Whats the word?') return [letter for letter in word] def do_something_with_letters(letters=split()) for letter in letters: ...
2021/02/26
[ "https://Stackoverflow.com/questions/66378577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13368313/" ]
> > Now, this is happening during the declaration of > do\_somthing\_with\_letters rather than during the function call(where > split() is used as a default value). > > > Because the function `split()` is being called when the function is declared. You can initialise `letters` with the function name (actually the ...
You have a counter-intuitive design, combining program steps that aren't functionally related. As a result, you're trying to warp the module design to compensate. user input and pre-processing the input are *not* fully linked in your program design -- so why do you insist on putting them into a module where they *are* ...
66,378,577
I want to use a function as a **default** argument for another function that can be *overridden without calling the function.* Let's use this snippet: ``` def split(): word = input('Whats the word?') return [letter for letter in word] def do_something_with_letters(letters=split()) for letter in letters: ...
2021/02/26
[ "https://Stackoverflow.com/questions/66378577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13368313/" ]
> > Now, this is happening during the declaration of > do\_somthing\_with\_letters rather than during the function call(where > split() is used as a default value). > > > Because the function `split()` is being called when the function is declared. You can initialise `letters` with the function name (actually the ...
I believe this sort of problem may call for a decorator. You can define a function, such as `verbose` (shown below), that when used to decorate a function that returns an iterable, modifies it according to the behavior as specified in `do_something_with_letters` from your post. Then by simply decorating the `split` fun...
66,378,577
I want to use a function as a **default** argument for another function that can be *overridden without calling the function.* Let's use this snippet: ``` def split(): word = input('Whats the word?') return [letter for letter in word] def do_something_with_letters(letters=split()) for letter in letters: ...
2021/02/26
[ "https://Stackoverflow.com/questions/66378577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13368313/" ]
You have a counter-intuitive design, combining program steps that aren't functionally related. As a result, you're trying to warp the module design to compensate. user input and pre-processing the input are *not* fully linked in your program design -- so why do you insist on putting them into a module where they *are* ...
I believe this sort of problem may call for a decorator. You can define a function, such as `verbose` (shown below), that when used to decorate a function that returns an iterable, modifies it according to the behavior as specified in `do_something_with_letters` from your post. Then by simply decorating the `split` fun...
13,798
In Qiskit, I need to define a custom gate or instruction that, once decomposed, turns into a series of basis gates, including measurements and classically controlled gates (this is the part that I can't get around). I already tried using `QuantumCircuit.to_gate()`, but it does not work, maybe there is a way to it with...
2020/09/17
[ "https://quantumcomputing.stackexchange.com/questions/13798", "https://quantumcomputing.stackexchange.com", "https://quantumcomputing.stackexchange.com/users/9200/" ]
You need to convert a circuit into an instruction, not a gate. A gate is assumed to be invertible, which is not the case if you have measurements and classical conditionals. Therefore, you need to create a custom instruction. Here is a short tutorial for that: First, create a circuit will all your gates and instructio...
I don't see a way to avoid the error you are getting as an `Instruction` can't handle multiple classical registers but here is a workaround. ``` def mygate(): qr = QuantumRegister(4) cr1 = ClassicalRegister(1) cr2 = ClassicalRegister(1) qc = QuantumCircuit(qr, cr1, cr2, name='mygate') ...
8,005,057
i am binding two table values in AutoCompleteExtender but my requirement is differentiate the two tables apply the colors i.e table1 values apply red color and table2 values apply green color how to write the code pls give me any suggestion my code is ``` [WebMethod] public string[] GetCompletionList(string pre...
2011/11/04
[ "https://Stackoverflow.com/questions/8005057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/926379/" ]
answer is add the javascript function ``` function getCustomers_Populated(sender, e) { var customers = sender.get_completionList().childNodes; var searchText = sender.get_element().value; for (var i = 0; i < customers.length; i++) { var customer = customers[i]; var ...
To selectively apply background colors to the autocompleteextender items you will probably have to use JavaScript. Since all the items from one table contain the string `',Employee'` and the items from the other contain `',NonEmployee'` you can use that information for styling. Set the properties: ``` OnClientShown=...
73,911,359
I made two files and my first file imported second file. But it cannot load my local images. It shows image like this [enter image description here](https://i.stack.imgur.com/NpisH.png) and to solve this problem I tried to use require function but when I used it, there is an error [Parsing error: Unexpected token, e...
2022/09/30
[ "https://Stackoverflow.com/questions/73911359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20108310/" ]
You don't need to import your images, just build an array of image paths and use it: ```js const imgs = [ "./images/shopping-cart.png", "./images/user.png", "./images/user.png" ] ``` then rewrite this part: ```js function NaviIconList (props) { return ( <div id="NaviIconList"> {image.map((image)...
Don't put `{}` everwhere ``` const image = [ { image : "./images/shopping-cart.png" }, { image : bell }, { image : user }, ]; ``` `{user}` is the same as `{ user: user }`
73,911,359
I made two files and my first file imported second file. But it cannot load my local images. It shows image like this [enter image description here](https://i.stack.imgur.com/NpisH.png) and to solve this problem I tried to use require function but when I used it, there is an error [Parsing error: Unexpected token, e...
2022/09/30
[ "https://Stackoverflow.com/questions/73911359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20108310/" ]
If you remove {} from your variable name, it will be fixed. Also, don't forget to add key prop to make your array item unique. Your code should be: ``` import React from "react"; import NaviIcon from "./NaviIcon"; import "../navi.css"; import cart from "./images/shopping-cart.png" import bell from "./images/user.png" ...
Don't put `{}` everwhere ``` const image = [ { image : "./images/shopping-cart.png" }, { image : bell }, { image : user }, ]; ``` `{user}` is the same as `{ user: user }`
73,911,359
I made two files and my first file imported second file. But it cannot load my local images. It shows image like this [enter image description here](https://i.stack.imgur.com/NpisH.png) and to solve this problem I tried to use require function but when I used it, there is an error [Parsing error: Unexpected token, e...
2022/09/30
[ "https://Stackoverflow.com/questions/73911359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20108310/" ]
You don't need to import your images, just build an array of image paths and use it: ```js const imgs = [ "./images/shopping-cart.png", "./images/user.png", "./images/user.png" ] ``` then rewrite this part: ```js function NaviIconList (props) { return ( <div id="NaviIconList"> {image.map((image)...
If you remove {} from your variable name, it will be fixed. Also, don't forget to add key prop to make your array item unique. Your code should be: ``` import React from "react"; import NaviIcon from "./NaviIcon"; import "../navi.css"; import cart from "./images/shopping-cart.png" import bell from "./images/user.png" ...
30,651,502
I was wondering if I could set up a lambda function for AWS, triggered whenever a new text file is uploaded into an s3 bucket. In the function, I would like to get the contents of the text file and process it somehow. I was wondering if this was possible...? For example, if I upload foo.txt, with contents foobarbaz, I...
2015/06/04
[ "https://Stackoverflow.com/questions/30651502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3841825/" ]
The S3 object key and bucket name are passed into your Lambda function via the *event* parameter. You can then get the object from S3 and read its contents. Basic code to retrieve bucket and object key from the Lambda `event` is as follows: ``` exports.handler = function(event, context, callback) { const bkt = eve...
You can use `data.Body.toString('ascii')` to get the contents of the text file, assuming that the text file was encoded used ascii format. You can also pass other encoding types to the function. Check out [Node-Buffer](https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end) for further details.
30,651,502
I was wondering if I could set up a lambda function for AWS, triggered whenever a new text file is uploaded into an s3 bucket. In the function, I would like to get the contents of the text file and process it somehow. I was wondering if this was possible...? For example, if I upload foo.txt, with contents foobarbaz, I...
2015/06/04
[ "https://Stackoverflow.com/questions/30651502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3841825/" ]
The S3 object key and bucket name are passed into your Lambda function via the *event* parameter. You can then get the object from S3 and read its contents. Basic code to retrieve bucket and object key from the Lambda `event` is as follows: ``` exports.handler = function(event, context, callback) { const bkt = eve...
I am using lambda function with a python 3.6 environment. The code below will read the contents of a file main.txt inside bucket my\_s3\_bucket. Make sure to replace name of bucket and file name according to your needs. ``` def lambda_handler(event, context): # TODO implement import boto3 s3 = boto3.cli...
30,651,502
I was wondering if I could set up a lambda function for AWS, triggered whenever a new text file is uploaded into an s3 bucket. In the function, I would like to get the contents of the text file and process it somehow. I was wondering if this was possible...? For example, if I upload foo.txt, with contents foobarbaz, I...
2015/06/04
[ "https://Stackoverflow.com/questions/30651502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3841825/" ]
The S3 object key and bucket name are passed into your Lambda function via the *event* parameter. You can then get the object from S3 and read its contents. Basic code to retrieve bucket and object key from the Lambda `event` is as follows: ``` exports.handler = function(event, context, callback) { const bkt = eve...
The new AWS SDK v3 means that the files are read back as a readable stream. You'll need to take that into consideration from now on as well. <https://carova.io/snippets/read-data-from-aws-s3-with-nodejs>
30,651,502
I was wondering if I could set up a lambda function for AWS, triggered whenever a new text file is uploaded into an s3 bucket. In the function, I would like to get the contents of the text file and process it somehow. I was wondering if this was possible...? For example, if I upload foo.txt, with contents foobarbaz, I...
2015/06/04
[ "https://Stackoverflow.com/questions/30651502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3841825/" ]
You can use `data.Body.toString('ascii')` to get the contents of the text file, assuming that the text file was encoded used ascii format. You can also pass other encoding types to the function. Check out [Node-Buffer](https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end) for further details.
The new AWS SDK v3 means that the files are read back as a readable stream. You'll need to take that into consideration from now on as well. <https://carova.io/snippets/read-data-from-aws-s3-with-nodejs>
30,651,502
I was wondering if I could set up a lambda function for AWS, triggered whenever a new text file is uploaded into an s3 bucket. In the function, I would like to get the contents of the text file and process it somehow. I was wondering if this was possible...? For example, if I upload foo.txt, with contents foobarbaz, I...
2015/06/04
[ "https://Stackoverflow.com/questions/30651502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3841825/" ]
I am using lambda function with a python 3.6 environment. The code below will read the contents of a file main.txt inside bucket my\_s3\_bucket. Make sure to replace name of bucket and file name according to your needs. ``` def lambda_handler(event, context): # TODO implement import boto3 s3 = boto3.cli...
The new AWS SDK v3 means that the files are read back as a readable stream. You'll need to take that into consideration from now on as well. <https://carova.io/snippets/read-data-from-aws-s3-with-nodejs>
53,640,839
I try to do a simple think but I am stuck. I have a div "scrolling" with a fixed position. When I scroll the page, I want that the div "scrolling" goes behind all other div below. I put an exemple in : [exemple jsfiddle](https://jsfiddle.net/Maxa88/huoxfyn5/41/) ``` .scrolling{ top: 230px; background-color:lightb...
2018/12/05
[ "https://Stackoverflow.com/questions/53640839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10238166/" ]
doable with `z-index`. But for the z-index to work, it must be `position: absolute`, `position:fixed`, or `position:relative`. ```css .top{ width:auto; background-attachment: fixed; height:300px; background-image: linear-gradient(pink, green); } .scrolling{ top: 230px; background-color:lightbl...
Pretty sure a (z index) is what you want to use here. I updated your fiddle below. Z index allows you to position from front to back. ``` <div class="top"> <div> Hello </div> <div> Hello </div> </div> <div class="scrolling"> SCROLL <br> I want to stay behind the div grey </div> <div class="fr...
53,640,839
I try to do a simple think but I am stuck. I have a div "scrolling" with a fixed position. When I scroll the page, I want that the div "scrolling" goes behind all other div below. I put an exemple in : [exemple jsfiddle](https://jsfiddle.net/Maxa88/huoxfyn5/41/) ``` .scrolling{ top: 230px; background-color:lightb...
2018/12/05
[ "https://Stackoverflow.com/questions/53640839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10238166/" ]
doable with `z-index`. But for the z-index to work, it must be `position: absolute`, `position:fixed`, or `position:relative`. ```css .top{ width:auto; background-attachment: fixed; height:300px; background-image: linear-gradient(pink, green); } .scrolling{ top: 230px; background-color:lightbl...
To answer your question, you need to understand concepts like `z-index` and/or how the stacking order works. There are great articles that will explain z-index, but one in particular I really enjoy is [What no one told you about z-index](https://philipwalton.com/articles/what-no-one-told-you-about-z-index/). A snippet...
53,640,839
I try to do a simple think but I am stuck. I have a div "scrolling" with a fixed position. When I scroll the page, I want that the div "scrolling" goes behind all other div below. I put an exemple in : [exemple jsfiddle](https://jsfiddle.net/Maxa88/huoxfyn5/41/) ``` .scrolling{ top: 230px; background-color:lightb...
2018/12/05
[ "https://Stackoverflow.com/questions/53640839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10238166/" ]
doable with `z-index`. But for the z-index to work, it must be `position: absolute`, `position:fixed`, or `position:relative`. ```css .top{ width:auto; background-attachment: fixed; height:300px; background-image: linear-gradient(pink, green); } .scrolling{ top: 230px; background-color:lightbl...
You need to use more z-index to element that you want to be seen and use less z-index to element "behind".
47,013,267
I encountered really strange issue for me with tag checkout. After merging latest changes from develop into master I created a tag from master and pushed to remote. Then on production pulled successfully but when I checkout the tag and run git status I get > > Not currently on any branch > > > On my local machin...
2017/10/30
[ "https://Stackoverflow.com/questions/47013267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3279573/" ]
This is a "normal" behaviour. By checking out on a tag, you position the HEAD of your local repository to the tag. You are no longer on a branch. This does not matter if you do not intend to make any change If you need to make a change, I would see two options : 1. you want to continue working on the branch where you...
The accepted answer is correct (and I've upvoted it). To detail the last bit—that one Git, a positively ancient 1.7, just says that you have a detached HEAD, but a more modern one, 2.13, says that you have a HEAD that is `detached at v1.0.0`—the `git status` command got many very useful and important boosts in function...
53,761,033
I have a function that can generate WAV audio frames into a list. Is there any way I can play audio from that list without using an intermediate file to generate an `AudioSegment` object? **EDIT:** For reference, [this](https://gitlab.com/Noammac/morse-practice/blob/master/morse_to_sound.py) is my code.
2018/12/13
[ "https://Stackoverflow.com/questions/53761033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6330498/" ]
I think that's a case of Broken By Design. Consider the following snippet: ``` my $a = Point.new(:3x, :2y); my $b = Point.new(:2x, :4y); say &infix:<cmp>.WHICH; say $a cmp $b; { multi sub infix:<cmp>(Point $a, Point $b) { $a.y cmp $b.y || $a.x cmp $b.x } say &infix:<cmp>.WHICH; say $a cmp $b; } say &inf...
The `cmp` that is being used is the cmp that is in lexical scope within `sort`, not the one you have defined. If you change a few lines to: ```perl6 multi sub infix:<cmp>(Point $a, Point $b) { say "Hey $a $b"; $a.y cmp $b.y || $a.x cmp $b.x } my @p = Point.new(:3x, :2y), Point.new(:2x, :4y), Point.new(:1x, :1y);...
42,188,880
I'm new to `javascript` and I have the following code: ``` <p id="demo"></p> <script> var text = ""; var x = 1; var y = 1; while(x < 9) { text += "<br>" + x +"," + y; x++; } document.getElementById("demo").innerHTML = text; </script> ``` It prints out a list of `coordinates`: ...
2017/02/12
[ "https://Stackoverflow.com/questions/42188880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5008663/" ]
You could use another while structure for the seconde value. ```js var text = "", x, y = 1; while (y <= 12) { x = 1; while (x <= 8) { text += "<br>" + x + "," + y; x++; } y++; } document.getElementById("demo").innerHTML = text; ``` ```html <p id="demo"></p> ``` Or ...
Write it like this: ```js var text = "", x,y; for (y=1; y<= 12; y++) { for (x=1; x<= 8; x++) { text += "<br>" + x + "," + y; } } document.getElementById("demo").innerHTML = text; ``` ```html <p id="demo"></p> ```
42,188,880
I'm new to `javascript` and I have the following code: ``` <p id="demo"></p> <script> var text = ""; var x = 1; var y = 1; while(x < 9) { text += "<br>" + x +"," + y; x++; } document.getElementById("demo").innerHTML = text; </script> ``` It prints out a list of `coordinates`: ...
2017/02/12
[ "https://Stackoverflow.com/questions/42188880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5008663/" ]
You could use another while structure for the seconde value. ```js var text = "", x, y = 1; while (y <= 12) { x = 1; while (x <= 8) { text += "<br>" + x + "," + y; x++; } y++; } document.getElementById("demo").innerHTML = text; ``` ```html <p id="demo"></p> ``` Or ...
You can nest loops. The best solution here is to use two nested `for` loops: ```js let text = ''; for (let y = 1; y <= 12; ++y) { for (let x = 1; x <= 8; ++x) { text += "<br>" + x + "," + y; } } document.getElementById("demo").innerHTML = text; ``` ```html <output id="demo"></output> ``` As you...
42,188,880
I'm new to `javascript` and I have the following code: ``` <p id="demo"></p> <script> var text = ""; var x = 1; var y = 1; while(x < 9) { text += "<br>" + x +"," + y; x++; } document.getElementById("demo").innerHTML = text; </script> ``` It prints out a list of `coordinates`: ...
2017/02/12
[ "https://Stackoverflow.com/questions/42188880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5008663/" ]
You could use another while structure for the seconde value. ```js var text = "", x, y = 1; while (y <= 12) { x = 1; while (x <= 8) { text += "<br>" + x + "," + y; x++; } y++; } document.getElementById("demo").innerHTML = text; ``` ```html <p id="demo"></p> ``` Or ...
Here is a fun solution. It is not what I would do but for educational purposes, so take it for what it is. It uses `Array.prototype.reduce` on inner and outer arrays. The accumulated result of the inner array on each iteration gets added to the accumulator of the outer array. The inner reduce is where all the actual d...
42,188,880
I'm new to `javascript` and I have the following code: ``` <p id="demo"></p> <script> var text = ""; var x = 1; var y = 1; while(x < 9) { text += "<br>" + x +"," + y; x++; } document.getElementById("demo").innerHTML = text; </script> ``` It prints out a list of `coordinates`: ...
2017/02/12
[ "https://Stackoverflow.com/questions/42188880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5008663/" ]
Write it like this: ```js var text = "", x,y; for (y=1; y<= 12; y++) { for (x=1; x<= 8; x++) { text += "<br>" + x + "," + y; } } document.getElementById("demo").innerHTML = text; ``` ```html <p id="demo"></p> ```
You can nest loops. The best solution here is to use two nested `for` loops: ```js let text = ''; for (let y = 1; y <= 12; ++y) { for (let x = 1; x <= 8; ++x) { text += "<br>" + x + "," + y; } } document.getElementById("demo").innerHTML = text; ``` ```html <output id="demo"></output> ``` As you...
42,188,880
I'm new to `javascript` and I have the following code: ``` <p id="demo"></p> <script> var text = ""; var x = 1; var y = 1; while(x < 9) { text += "<br>" + x +"," + y; x++; } document.getElementById("demo").innerHTML = text; </script> ``` It prints out a list of `coordinates`: ...
2017/02/12
[ "https://Stackoverflow.com/questions/42188880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5008663/" ]
Write it like this: ```js var text = "", x,y; for (y=1; y<= 12; y++) { for (x=1; x<= 8; x++) { text += "<br>" + x + "," + y; } } document.getElementById("demo").innerHTML = text; ``` ```html <p id="demo"></p> ```
Here is a fun solution. It is not what I would do but for educational purposes, so take it for what it is. It uses `Array.prototype.reduce` on inner and outer arrays. The accumulated result of the inner array on each iteration gets added to the accumulator of the outer array. The inner reduce is where all the actual d...
12,146
Over on [Seasoned Advice](http://cooking.stackexchange.com), there have been a number of questions related to the nature of kosher meat and the amount of salt absorbed by the meat. Most recently, [In what way is kosher chicken different from brined chicken in terms of salt absorption?](https://cooking.stackexchange.com...
2011/12/11
[ "https://judaism.stackexchange.com/questions/12146", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/957/" ]
The koshering process as done today is fairly straightforward: * Half-hour soak in water, then rinse. * Apply "kosher" salt all over (internal cavities too), then leave it there for an hour. * Triple rinse. So yes, it is likely the finished product will be saltier than meat that was never treated with salt. (As I hea...
Kosher meat must be salted to draw out the blood. I have recently been studying these laws, but I'm not experienced in the practice of it, so I cannot say for certain, but I do not believe, despite what you or others have heard, that Kosher meat should be (significantly) saltier than non-Kosher meat, simply because let...
339,134
Show that the infimum of the integrals $$\int\_0^1(y'^2(x)-1)^2dx$$ among all $y(x)\in C^2[0,1]$ such that $y(0)=y(1)=0$, is zero, but is not achieved by any function in this set. What I've worked on: Zero is obviously a lower bound for these integrals but I'm currently trying to show that any positive number cannot be...
2013/03/23
[ "https://math.stackexchange.com/questions/339134", "https://math.stackexchange.com", "https://math.stackexchange.com/users/60744/" ]
Start with functions of the form of a [Triangle wave](http://en.wikipedia.org/wiki/Triangular-wave_function), with slopes $\pm 1$, and smoothen the peaks using very short intervals near each peak. The integrand will be zero except at those short intervals - making the value of the functional very small (as small as des...
zero can not be achieved because if so, we should have $ y'(x)^2 = 1 $ so $ y'(x)=1 or -1 $ which just one of them can happen, $ y'(x) $ is continuous, and you can solve this equation and get a contradiction you can try to define functions with corresponding value arbitrary close to zero by considering functions whic...
724,763
I have a question about data binding which I am struggling with. I have the following property in my xaml.cs file: ``` private string _stationIdInstruction; public event PropertyChangedEventHandler PropertyChanged; public string StationIdInstruction { get { return _stationIdInstruction; } ...
2009/04/07
[ "https://Stackoverflow.com/questions/724763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88003/" ]
Yes, and don't forget to specify the binding context. E.g., ``` <Window ... Name="MyWindow"> <Grid DataContext="{Binding ElementName=MyWindow, Path=.}"> <TextBlock Text="{Binding Path=StationIdInstruction}" /> ```
Set your StationIdInstructions object on the DataContext of your control, and your TextBlock like so: ``` <TextBlock Text="{Binding StationIdInstruction}" /> ```
29,770,577
On this code, when I click **prev**, it loops like `54321 - 54321 -54321`. But when I click on **next**, it loops forever. I want it turn back to number 1 when the array is finished. I want it like `(next= 12345-12345-12345) and (prev=54321-54321-54321)` Is there a way to do it? ``` <?php $ar = array( 0 ...
2015/04/21
[ "https://Stackoverflow.com/questions/29770577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4791241/" ]
Dont open Library on MacintoshHDD. You need to open Library on your USERName Folder. There,normally library folder is hidden. You need to follow the following to see the hidden files. Or simply copy paste the path into the search finder on your mac.It will take you directly. The long way to show hidden Mac OS X files...
You should be able to find this using this method : ``` - (NSURL *)applicationDocumentsDirectory { NSLog(@"%@",[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]); return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains...
29,770,577
On this code, when I click **prev**, it loops like `54321 - 54321 -54321`. But when I click on **next**, it loops forever. I want it turn back to number 1 when the array is finished. I want it like `(next= 12345-12345-12345) and (prev=54321-54321-54321)` Is there a way to do it? ``` <?php $ar = array( 0 ...
2015/04/21
[ "https://Stackoverflow.com/questions/29770577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4791241/" ]
Dont open Library on MacintoshHDD. You need to open Library on your USERName Folder. There,normally library folder is hidden. You need to follow the following to see the hidden files. Or simply copy paste the path into the search finder on your mac.It will take you directly. The long way to show hidden Mac OS X files...
You just following line of code to Log. ``` NSString *databasePath = [[NSBundle mainBundle] pathForResource:@"myUsers" ofType:@"db"]; ``` Or use below code. ``` NSBundle* bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"myUsers" ofType:@"bundle"]]; NSLog(@"%@", bundle); NSString* test = [b...
29,770,577
On this code, when I click **prev**, it loops like `54321 - 54321 -54321`. But when I click on **next**, it loops forever. I want it turn back to number 1 when the array is finished. I want it like `(next= 12345-12345-12345) and (prev=54321-54321-54321)` Is there a way to do it? ``` <?php $ar = array( 0 ...
2015/04/21
[ "https://Stackoverflow.com/questions/29770577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4791241/" ]
Dont open Library on MacintoshHDD. You need to open Library on your USERName Folder. There,normally library folder is hidden. You need to follow the following to see the hidden files. Or simply copy paste the path into the search finder on your mac.It will take you directly. The long way to show hidden Mac OS X files...
I am using the [Core Data Editor](http://thermal-core.com/CoreDataEditor/ "Core Data Editor") a lot for my iOS projects. It is compatible with Mac and iOS applications and support XML, SQLite and binary stores, etc. It is free. :-) <http://thermal-core.com/CoreDataEditor/>
63,747,000
I have an `activity_main.xml` with an `BottomNavigationView` and a `NavHostFragment`. There are 2 tabs, `HomeFragment` with a video and `FavoritesFragment`. Within `FavoritesFragment` there is a list of favorite video's (thumbnails) and when I click on an item it loads the `HomeFragment` view with that specific video....
2020/09/04
[ "https://Stackoverflow.com/questions/63747000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/898307/" ]
Hey I don't know how kotlin works in android but here's how you should set it up, onBack press only goes to the previous activity and if there isn't one it shuts down, Since you have 1 activity and multiple fragments what you should do is override the onBackpress method and call the previous fragment and if none exist ...
Try override onBackPressed method in the host activity and place the code: ``` override fun onBackPressed() { if(!navController.popBackStack()) finish() } ```
30,103,653
I'm currently looking at writing an ElasticSearch.Net/NEST client as a possible replacement for PlainElastic.Net (since ElasticSearch.Net has failover functionality I want to use) In PlainElastic I can write something like: ``` var command = new SearchCommand(index, type); var result = Connection.Post(command, query)...
2015/05/07
[ "https://Stackoverflow.com/questions/30103653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1378400/" ]
The `SearchResponse<T>` has a Hits property (of type `IEnumberable<IHit<T>>` if I remember correctly.). Each hit then has a Source property, which is of type T. So ``` var enumerable = results.Hits.Select(h => h.Source); ``` gives you your `IEnumerable<T>`.
The response of your query will be a `Nest.ISearchResponse<T>`. By accessing the Documents property in the response you get an `IEnumerable<T>` which is the list of the results matching your search. **Update** In order to respond in the updated question: `T` in `var result = client.Search<T>("index", "type", query, n...
63,814,833
I have a dataframe column containing url encoded string such as: I would like to do something like that: ``` someDF.withColumn('newcol', URLDecoder.decode( col("mystring"), "utf-8" )) someDF.show() | mystring | newcol | -------------------------------------------------- | ThisIs%201rstStr...
2020/09/09
[ "https://Stackoverflow.com/questions/63814833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1195001/" ]
You can try the SparkSQL builtin function [reflect](https://spark.apache.org/docs/latest/api/sql/index.html#reflect): > > reflect(class, method[, arg1[, arg2 ..]]) - Calls a method with reflection. > > > ``` df = spark.createDataFrame([(e,) for e in ["ThisIs%201rstString", "This%20is%3Ethisone", "and%20so%20one"]...
Create a [UDF](https://jaceklaskowski.gitbooks.io/mastering-spark-sql/content/spark-sql-udfs.html) that performs the work ```scala import java.net.URLDecoder def decode(in:String) = URLDecoder.decode(in, "utf-8") val decode_udf = udf(decode(_)) df.withColumn("newcol", decode_udf('mystring)).show() ``` prints the ex...
34,179,612
1.can anyone please explain and read this code? this is Searching K-th key Pseudo code, It seems not difficult, but I am having a difficulty in understanding those lines of code. Especially, I want you to share how you approach in partition(), I understand reclusive function works, so you don't have to explain selectio...
2015/12/09
[ "https://Stackoverflow.com/questions/34179612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5171987/" ]
Setting ``` numpy.seterr(all='raise') ``` should do the trick. You should probably check out the [details](https://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.seterr.html) though.
``` import warnings warnings.filterwarnings('error', "Mean of empty slice.") # ... Your code here. ``` See the documentation of the [`warnings` module](https://docs.python.org/2/library/warnings.html) for more details.
26,812
ЕГЭ говорит, что суффиксальным. Объясните, пожалуйста, от какого слова оно образовано и как? Спасибо.
2013/11/30
[ "https://rus.stackexchange.com/questions/26812", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/665/" ]
Глагол *заканчивать* образован от глагола *закончить* суффиксальным способом (суффикс -ива-)
Заканчивать. Вот его строение: За - канч -ива- ть (несовершенный вид) за-кон-чить (совершенный вид) происходит чередование А-О в корне. Образовано слово от кончить - при помощи приставки ЗА- и суффикса -ИВА- (ТЬ -окончание)
26,812
ЕГЭ говорит, что суффиксальным. Объясните, пожалуйста, от какого слова оно образовано и как? Спасибо.
2013/11/30
[ "https://rus.stackexchange.com/questions/26812", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/665/" ]
Глагол *заканчивать* образован от глагола *закончить* суффиксальным способом (суффикс -ива-)
Словообразовательный разбор начинают с определения лексического значения слова. На экзамене словарей нет, поэтому придётся определять "своими словами". "Заканчивать" -- то же самое, что и "закончить".Только процесс ещё не завершён,поэтому глагол "заканчивать" несовершенного вида. Строим цепочку: закончить--и-- + ива = ...
26,812
ЕГЭ говорит, что суффиксальным. Объясните, пожалуйста, от какого слова оно образовано и как? Спасибо.
2013/11/30
[ "https://rus.stackexchange.com/questions/26812", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/665/" ]
Глагол *заканчивать* образован от глагола *закончить* суффиксальным способом (суффикс -ива-)
Да, Лорана и Янна дали правильные ответы. Слово "заканчивать" образуется суффиксальным способом от слова "закончить" Чтобы обосновать, надо обратиться к понятию видовой пары. Вот что сказано в с словаре лингвистических терминов. **"видовая пара** **Пара, образуемая глаголом несовершенного вида и глаголом совершенног...