qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
7,852,466
How do I change `width` value assigned in `#center`? (I don't want to switch between CSS files just because 1 changed `width` value.) How do I dynamically change the value using Javascript? ```html <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <style type="text/css"> #main #center { ...
2011/10/21
[ "https://Stackoverflow.com/questions/7852466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1007481/" ]
``` document.getElementById( 'center' ).style.width = "700px"; ```
``` <div onclick="changeWidth()" id="main"> Stuff </div> <div onclick="changeWidth()" id="center"> More Stuff </div> function changeWidth(){ this.style.width = "700px"; } ```
12,828,421
I need it because I recently made an app that saves an object containing all the user-generated data to `localStorage`, and encodes/decodes it with `JSON`. The bizarre thing is that for some reason, Internet Explorer has poor, if not zero, support for JSON ("JSON is not defined"), and I'm not up to trying to re-create...
2012/10/10
[ "https://Stackoverflow.com/questions/12828421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175714/" ]
I think this is the best replacement: <http://bestiejs.github.com/json3/> It claims to be better than Crockford's JSON 2 for the following reasons (from their site): JSON 3... * Correctly serializes primitive wrapper objects ([Issue #28](https://github.com/douglascrockford/JSON-js/issues/28)). * Throws a TypeError w...
Try <https://github.com/douglascrockford/JSON-js>
12,828,421
I need it because I recently made an app that saves an object containing all the user-generated data to `localStorage`, and encodes/decodes it with `JSON`. The bizarre thing is that for some reason, Internet Explorer has poor, if not zero, support for JSON ("JSON is not defined"), and I'm not up to trying to re-create...
2012/10/10
[ "https://Stackoverflow.com/questions/12828421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175714/" ]
I think this is the best replacement: <http://bestiejs.github.com/json3/> It claims to be better than Crockford's JSON 2 for the following reasons (from their site): JSON 3... * Correctly serializes primitive wrapper objects ([Issue #28](https://github.com/douglascrockford/JSON-js/issues/28)). * Throws a TypeError w...
I think you should use the json2.js library: <https://github.com/douglascrockford/JSON-js>
12,828,421
I need it because I recently made an app that saves an object containing all the user-generated data to `localStorage`, and encodes/decodes it with `JSON`. The bizarre thing is that for some reason, Internet Explorer has poor, if not zero, support for JSON ("JSON is not defined"), and I'm not up to trying to re-create...
2012/10/10
[ "https://Stackoverflow.com/questions/12828421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1175714/" ]
Try <https://github.com/douglascrockford/JSON-js>
I think you should use the json2.js library: <https://github.com/douglascrockford/JSON-js>
170,286
A changeling's Change Appearance states: > > You also can't appear as a creature of a different size than you, and your basic shape stays the same; if you’re bipedal, you can’t use this trait to become quadrupedal, for instance. > > > But seeing that with a druid's Wild Shape can change you into a creature that i...
2020/06/11
[ "https://rpg.stackexchange.com/questions/170286", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/45589/" ]
According to RAW, you can't Change Appearance while Wild Shaped =============================================================== The rules for Wild Shape states concerning racial features is: > > You retain the benefit of any features from your class, race, or other source and can use them *if the new form is physica...
It is at the GM's discretion. ============================= The rules are somewhat unclear on this. While it is rather clear that *basic shape* was meant to refer to the changeling's, the part you cite somewhat contradicts this, by suggesting that a transformation quadruped -> quadruped works, especially so, since a c...
170,286
A changeling's Change Appearance states: > > You also can't appear as a creature of a different size than you, and your basic shape stays the same; if you’re bipedal, you can’t use this trait to become quadrupedal, for instance. > > > But seeing that with a druid's Wild Shape can change you into a creature that i...
2020/06/11
[ "https://rpg.stackexchange.com/questions/170286", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/45589/" ]
It is at the GM's discretion. ============================= The rules are somewhat unclear on this. While it is rather clear that *basic shape* was meant to refer to the changeling's, the part you cite somewhat contradicts this, by suggesting that a transformation quadruped -> quadruped works, especially so, since a c...
I would argue that there is no restriction from a Changeling using Shapechanger while in Wild Shape. If the verbiage that is italicized above is relevant, then it would also prevent the druid from using a second use of Wild Shape while in a wild shape form, and it has already been clarified that this is possible: [http...
170,286
A changeling's Change Appearance states: > > You also can't appear as a creature of a different size than you, and your basic shape stays the same; if you’re bipedal, you can’t use this trait to become quadrupedal, for instance. > > > But seeing that with a druid's Wild Shape can change you into a creature that i...
2020/06/11
[ "https://rpg.stackexchange.com/questions/170286", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/45589/" ]
According to RAW, you can't Change Appearance while Wild Shaped =============================================================== The rules for Wild Shape states concerning racial features is: > > You retain the benefit of any features from your class, race, or other source and can use them *if the new form is physica...
I would argue that there is no restriction from a Changeling using Shapechanger while in Wild Shape. If the verbiage that is italicized above is relevant, then it would also prevent the druid from using a second use of Wild Shape while in a wild shape form, and it has already been clarified that this is possible: [http...
43,501,652
I have an app which creates several surveys with random survey ids. As the ids are generated in the backend they are set in the controller. I read the documentation on that, however I do not really understand how to set the routeparams in order to always reach the page /survey/:surveryID. Here is my code so far: App ...
2017/04/19
[ "https://Stackoverflow.com/questions/43501652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4415232/" ]
To get your work done, ``` $location.path('/survey/' + Math.random()); ``` You can use search method to pass params as well, ``` $location.path('/myURL/').search({param: 'value'}); ``` $location methods are chainable. this produce : ``` /myURL/?param=value ```
You could also use the `updateParams` method for that: `$route.updateParams({'surveryID': Math.random()});` And access the data using `$routeParams.surveryID`
57,988,960
I'm just starting with `node.js` and `express.js` and trying to create a listener with port 3000 using `app.listen(3000)`. The problem I'm having is when I first load the app, the browser loads it just fine, but when I make some changes, save the file and reload the browser, it doesn't show any changes. Mean it is jus...
2019/09/18
[ "https://Stackoverflow.com/questions/57988960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10045025/" ]
You are looking for a tool like [nodemon](https://github.com/remy/nodemon) which does the server reloading. Unfortunately, nodemon doesn't reload the page itself, you still have to do it manually. Perhaps [browsersync](https://browsersync.io/) can help with that: it can be used for frontend development with live reload...
you have to restart the server or install nodemon
57,988,960
I'm just starting with `node.js` and `express.js` and trying to create a listener with port 3000 using `app.listen(3000)`. The problem I'm having is when I first load the app, the browser loads it just fine, but when I make some changes, save the file and reload the browser, it doesn't show any changes. Mean it is jus...
2019/09/18
[ "https://Stackoverflow.com/questions/57988960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10045025/" ]
You are looking for a tool like [nodemon](https://github.com/remy/nodemon) which does the server reloading. Unfortunately, nodemon doesn't reload the page itself, you still have to do it manually. Perhaps [browsersync](https://browsersync.io/) can help with that: it can be used for frontend development with live reload...
This might be a problem with your computer console, probably be an old mac, because I face the same problem as well, try and destroy all node action by using `killall node` for mac and for window computer `taskkill /im node.exe /F` this will terminate all node action on your computer, after restart the node server this...
57,988,960
I'm just starting with `node.js` and `express.js` and trying to create a listener with port 3000 using `app.listen(3000)`. The problem I'm having is when I first load the app, the browser loads it just fine, but when I make some changes, save the file and reload the browser, it doesn't show any changes. Mean it is jus...
2019/09/18
[ "https://Stackoverflow.com/questions/57988960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10045025/" ]
you have to restart the server or install nodemon
This might be a problem with your computer console, probably be an old mac, because I face the same problem as well, try and destroy all node action by using `killall node` for mac and for window computer `taskkill /im node.exe /F` this will terminate all node action on your computer, after restart the node server this...
3,446,208
I have just started web development.I want to make a screen to do basic add modify and delete operation. The screen I've designed will have 3 tabs which will be add , display and delete.When I click on any of this tab a sub-screen should open for doing the operation accordingly. Another I thing I want to do is , I've a...
2010/08/10
[ "https://Stackoverflow.com/questions/3446208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/415477/" ]
Follow this tutorial on ASP.NET MVC to get started in ASP.NET web development. <http://nerddinnerbook.s3.amazonaws.com/Intro.htm> The tutorial will show you how to create a database for your application and how to interact with it in code. It shows how to create views (web pages) and actions for Add, Read, Update and...
Hmmm... Controls to use. How about a [FormView](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.formview.aspx) or [DetailsView](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.aspx), possibly a [DataGrid](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.d...
511,214
I'm looking for a word to refer to the visual appearance of a word only. I'll use an example to help explain what I mean: "bow" can refer to the action of bowing to someone, or to a bow that I add when wrapping a gift. "bow" and "bow" are homographs because they are spelled the same way, though they have different mea...
2019/09/11
[ "https://english.stackexchange.com/questions/511214", "https://english.stackexchange.com", "https://english.stackexchange.com/users/57530/" ]
*bow* is a "string", to start with. We are looking at "meaningful strings" in the context of the English language. A "meaningful string" *can* have more than one meaning. To be precise we could say a "meaningful character string".
Homograph is what you want: > > What are homonyms, homophones, and homographs? > Homonym can be troublesome because it may refer to three distinct classes of words. Homonyms may be words with identical pronunciations but different spellings and meanings, such as to, too, and two. Or they may be words with both ident...
25,275,308
This problem involves three Sheets (A, B, C) Sheet A contains a data table and in Column A has a list of Names Sheet B contains a data table (Similar not the same as B) and in Column A has a list of Names Sheet C is a sheet called Name Matching. I already have a Macro that copies the names in Column A from both Sh...
2014/08/12
[ "https://Stackoverflow.com/questions/25275308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3935336/" ]
``` $("h3 a:contains('Skin')").remove(); ``` You need to target the links within the h3. The link will contain the text.
What about changing the h3:contains to a:contains?
5,602,645
I'm creating a very simple PInvoke sample: ``` extern "C" __declspec(dllexport) int Add(int a, int b) { return a + b; } [DllImport("CommonNativeLib.dll")] extern public static int Add(int a, int b); return NativeMethods.Add(a, b); ``` But whenever I call the above `NativeMethods.Add` method I get the following...
2011/04/09
[ "https://Stackoverflow.com/questions/5602645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/113141/" ]
You need to instead use *either* ``` [DllImport("CommonNativeLib.dll", CallingConvention = CallingConvention.Cdecl)] ``` **or** ``` extern "C" __declspec(dllexport) int __stdcall Add(int a, int b) ... ``` because regular C functions work differently than the Windows API functions; their "calling conventions" are ...
The Stack Imbalance reasons are either the signature is not matching else Calling Convention by default calling convention is stdcall. When your calling convention is stdcall callee cleans the stack if you want caller to clean the stack us cdecl calling convention. you can find more [Here](http://msdn.microsoft.com/en-...
20,758,380
I have some images that I want to use in my application ( 150 - 200 of them ). What's the best place to store them? * assets folder * drawable * why there
2013/12/24
[ "https://Stackoverflow.com/questions/20758380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/677024/" ]
if you must put these images into your application pack, choose drawable that images will be compressed. if you can download when required, store them in sd card is recommend.
You should read the Android article about [Supporting Different Screen Sizes](http://developer.android.com/training/multiscreen/screensizes.html), they show you the benefits of using the Android frame work for that task. If you wish to use assets folder or other solutions like dynamically download the images from your ...
20,758,380
I have some images that I want to use in my application ( 150 - 200 of them ). What's the best place to store them? * assets folder * drawable * why there
2013/12/24
[ "https://Stackoverflow.com/questions/20758380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/677024/" ]
**I don't think so there is bit difference in performance of using these two folders**, I think using drawable folder you can get easily images (All will be indexed in the R file, which makes it much faster (and much easier!) to load them.), and If you want to use it from asset then you have to use AssetManager then us...
if you must put these images into your application pack, choose drawable that images will be compressed. if you can download when required, store them in sd card is recommend.
20,758,380
I have some images that I want to use in my application ( 150 - 200 of them ). What's the best place to store them? * assets folder * drawable * why there
2013/12/24
[ "https://Stackoverflow.com/questions/20758380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/677024/" ]
**I don't think so there is bit difference in performance of using these two folders**, I think using drawable folder you can get easily images (All will be indexed in the R file, which makes it much faster (and much easier!) to load them.), and If you want to use it from asset then you have to use AssetManager then us...
You should read the Android article about [Supporting Different Screen Sizes](http://developer.android.com/training/multiscreen/screensizes.html), they show you the benefits of using the Android frame work for that task. If you wish to use assets folder or other solutions like dynamically download the images from your ...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
You can use python library resource to get memory usage. ``` import resource resource.getrusage(resource.RUSAGE_SELF).ru_maxrss ``` It will give memory usage in kilobytes, to convert in MB divide by 1000.
Reading the source of `free`'s information, `/proc/meminfo` on a linux system: ``` ~ head /proc/meminfo MemTotal: 4039168 kB MemFree: 2567392 kB MemAvailable: 3169436 kB Buffers: 81756 kB Cached: 712808 kB SwapCached: 0 kB Active: 835276 kB Inactive: 4...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
It is possible to do this with [memory\_profiler](https://pypi.python.org/pypi/memory_profiler). The function `memory_usage` returns a list of values, these represent the memory usage over time (by default over chunks of .1 second). If you need the maximum, just take the max of that list. Little example: ``` from memo...
This appears to work under Windows. Don't know about other operating systems. ``` In [50]: import os In [51]: import psutil In [52]: process = psutil.Process(os.getpid()) In [53]: process.get_ext_memory_info().peak_wset Out[53]: 41934848 ```
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
You can use python library resource to get memory usage. ``` import resource resource.getrusage(resource.RUSAGE_SELF).ru_maxrss ``` It will give memory usage in kilobytes, to convert in MB divide by 1000.
Have been struggling with this task as well. After experimenting with psutil and methods from Adam, I wrote a function (credits to Adam Lewis) to measure the memory used by a specific function. People may find it easier to grab and use. 1) [measure\_memory\_usage](https://gist.github.com/ds7711/bd2f817090eca8f66b9b23...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
Improvement of the answer of @Vader B (as it did not work for me out of box): ``` $ /usr/bin/time --verbose ./myscript.py Command being timed: "./myscript.py" User time (seconds): 16.78 System time (seconds): 2.74 Percent of CPU this job got: 117% Elapsed (wall clock) time (h:m...
Reading the source of `free`'s information, `/proc/meminfo` on a linux system: ``` ~ head /proc/meminfo MemTotal: 4039168 kB MemFree: 2567392 kB MemAvailable: 3169436 kB Buffers: 81756 kB Cached: 712808 kB SwapCached: 0 kB Active: 835276 kB Inactive: 4...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
This question seemed rather interesting and it gave me a reason to look into Guppy / Heapy, for that I thank you. I tried for about 2 hours to get Heapy to do monitor a function call / process without modifying its source with *zero* luck. I did find a way to accomplish your task using the built in Python library [...
Have been struggling with this task as well. After experimenting with psutil and methods from Adam, I wrote a function (credits to Adam Lewis) to measure the memory used by a specific function. People may find it easier to grab and use. 1) [measure\_memory\_usage](https://gist.github.com/ds7711/bd2f817090eca8f66b9b23...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
You can use python library resource to get memory usage. ``` import resource resource.getrusage(resource.RUSAGE_SELF).ru_maxrss ``` It will give memory usage in kilobytes, to convert in MB divide by 1000.
Standard Unix utility `time` tracks maximum memory usage of the process as well as other useful statistics for your program. Example output (`maxresident` is max memory usage, in Kilobytes.): ``` > time python ./scalabilty_test.py 45.31user 1.86system 0:47.23elapsed 99%CPU (0avgtext+0avgdata 369824maxresident)k 0inpu...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
This question seemed rather interesting and it gave me a reason to look into Guppy / Heapy, for that I thank you. I tried for about 2 hours to get Heapy to do monitor a function call / process without modifying its source with *zero* luck. I did find a way to accomplish your task using the built in Python library [...
This appears to work under Windows. Don't know about other operating systems. ``` In [50]: import os In [51]: import psutil In [52]: process = psutil.Process(os.getpid()) In [53]: process.get_ext_memory_info().peak_wset Out[53]: 41934848 ```
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
This question seemed rather interesting and it gave me a reason to look into Guppy / Heapy, for that I thank you. I tried for about 2 hours to get Heapy to do monitor a function call / process without modifying its source with *zero* luck. I did find a way to accomplish your task using the built in Python library [...
Reading the source of `free`'s information, `/proc/meminfo` on a linux system: ``` ~ head /proc/meminfo MemTotal: 4039168 kB MemFree: 2567392 kB MemAvailable: 3169436 kB Buffers: 81756 kB Cached: 712808 kB SwapCached: 0 kB Active: 835276 kB Inactive: 4...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
This question seemed rather interesting and it gave me a reason to look into Guppy / Heapy, for that I thank you. I tried for about 2 hours to get Heapy to do monitor a function call / process without modifying its source with *zero* luck. I did find a way to accomplish your task using the built in Python library [...
Improvement of the answer of @Vader B (as it did not work for me out of box): ``` $ /usr/bin/time --verbose ./myscript.py Command being timed: "./myscript.py" User time (seconds): 16.78 System time (seconds): 2.74 Percent of CPU this job got: 117% Elapsed (wall clock) time (h:m...
9,850,995
I want to find out what the maximum amount of RAM allocated during the call to a function is (in Python). There are other questions on SO related to tracking RAM usage: [Which Python memory profiler is recommended?](https://stackoverflow.com/questions/110259/python-memory-profiler) [How do I profile memory usage in P...
2012/03/24
[ "https://Stackoverflow.com/questions/9850995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180783/" ]
It is possible to do this with [memory\_profiler](https://pypi.python.org/pypi/memory_profiler). The function `memory_usage` returns a list of values, these represent the memory usage over time (by default over chunks of .1 second). If you need the maximum, just take the max of that list. Little example: ``` from memo...
Have been struggling with this task as well. After experimenting with psutil and methods from Adam, I wrote a function (credits to Adam Lewis) to measure the memory used by a specific function. People may find it easier to grab and use. 1) [measure\_memory\_usage](https://gist.github.com/ds7711/bd2f817090eca8f66b9b23...
12,492,266
Let's say I have a simple table with NBA players: id,player,mp,ppg (mp - matches played, ppg - points per game). I need a query that gets all the guys but split the result into two parts: * players who played in more or equal 30 games ordered by PPG desc, * players who played less than 30 games ordered by PPG desc ...
2012/09/19
[ "https://Stackoverflow.com/questions/12492266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327135/" ]
``` select id, player, mp, ppg from playerTable order by if (mp>=30, 1, 0) desc, ppg desc, mp desc` ```
``` SELECT * FROM tablename ORDER BY CASE WHEN mp >= 30 THEN PPG END DESC, CASE WHEN mp < 30 THEN PPG END ASC ```
12,492,266
Let's say I have a simple table with NBA players: id,player,mp,ppg (mp - matches played, ppg - points per game). I need a query that gets all the guys but split the result into two parts: * players who played in more or equal 30 games ordered by PPG desc, * players who played less than 30 games ordered by PPG desc ...
2012/09/19
[ "https://Stackoverflow.com/questions/12492266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327135/" ]
``` select id, player, mp, ppg from playerTable order by if (mp>=30, 1, 0) desc, ppg desc, mp desc` ```
Assuming `ppq` is allways lower than 1000000, this would work: ``` SELECT * -- or whatever you want FROM players ORDER BY IF(mp>=30,1000000+ppg,mp) desc ``` This assumes, that the second group is ordered by `mp` desc (as in example), not by `ppg` (as in text)
12,492,266
Let's say I have a simple table with NBA players: id,player,mp,ppg (mp - matches played, ppg - points per game). I need a query that gets all the guys but split the result into two parts: * players who played in more or equal 30 games ordered by PPG desc, * players who played less than 30 games ordered by PPG desc ...
2012/09/19
[ "https://Stackoverflow.com/questions/12492266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327135/" ]
``` select id, player, mp, ppg from playerTable order by if (mp>=30, 1, 0) desc, ppg desc, mp desc` ```
First order by MP>30 then by PPG ``` ORDER BY (CASE WHEN mp >= 30 THEN 1 ELSE 2 END) ASC, PPG DESC ```
12,492,266
Let's say I have a simple table with NBA players: id,player,mp,ppg (mp - matches played, ppg - points per game). I need a query that gets all the guys but split the result into two parts: * players who played in more or equal 30 games ordered by PPG desc, * players who played less than 30 games ordered by PPG desc ...
2012/09/19
[ "https://Stackoverflow.com/questions/12492266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1327135/" ]
``` select id, player, mp, ppg from playerTable order by if (mp>=30, 1, 0) desc, ppg desc, mp desc` ```
``` select player, mp, ppg from t order by mp < 30, ppg desc ```
15,048,773
I am using querydsl (which depends on sl4j-api 1.6) and arquillian-persistence-api (which depends on slf4j-jdk14 1.5.6). If I ignore in maven the older version 1.5.6 I get the following message on JBoss `SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger ...
2013/02/24
[ "https://Stackoverflow.com/questions/15048773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1400037/" ]
The message you are seeing is a warning, not an error. It means SLF4J is selecting a binding for you because you've not chosen one yourself. The default binding simply discards all log messages, which is not very useful. If you have conflicting versions in Maven, normally it's safer to force the newer version. Librari...
JBoss 7.1 has built-in support for SLF4J. Assuming this is a web application with WAR packaging you add `src/main/webapp/WEB-INF/jboss-deployment-structure.xml`: ``` <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <dependencies> <module name="org.slf4j" /> </depende...
15,048,773
I am using querydsl (which depends on sl4j-api 1.6) and arquillian-persistence-api (which depends on slf4j-jdk14 1.5.6). If I ignore in maven the older version 1.5.6 I get the following message on JBoss `SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger ...
2013/02/24
[ "https://Stackoverflow.com/questions/15048773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1400037/" ]
The message you are seeing is a warning, not an error. It means SLF4J is selecting a binding for you because you've not chosen one yourself. The default binding simply discards all log messages, which is not very useful. If you have conflicting versions in Maven, normally it's safer to force the newer version. Librari...
First of all. Regarding the dependencies. In order to add SLF4J you must put **ONE** and only **ONE** of these dependencies in your pom.xml. It depends on what implementation you choose to use. Every dependency you add in the pom.xml is added automatically in the classpath. If one of the below dependencies are provide...
15,048,773
I am using querydsl (which depends on sl4j-api 1.6) and arquillian-persistence-api (which depends on slf4j-jdk14 1.5.6). If I ignore in maven the older version 1.5.6 I get the following message on JBoss `SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger ...
2013/02/24
[ "https://Stackoverflow.com/questions/15048773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1400037/" ]
First of all. Regarding the dependencies. In order to add SLF4J you must put **ONE** and only **ONE** of these dependencies in your pom.xml. It depends on what implementation you choose to use. Every dependency you add in the pom.xml is added automatically in the classpath. If one of the below dependencies are provide...
JBoss 7.1 has built-in support for SLF4J. Assuming this is a web application with WAR packaging you add `src/main/webapp/WEB-INF/jboss-deployment-structure.xml`: ``` <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <dependencies> <module name="org.slf4j" /> </depende...
142,630
Inspired by [this challenge](https://codegolf.stackexchange.com/questions/140854/1326-starting-holdem-combos) and related to [this one](https://codegolf.stackexchange.com/questions/25056/compare-two-poker-hands). ### Background Badugi [bæduːɡiː] is a low-ball draw-poker variant. The Pokerstars World Cup Of Online Po...
2017/09/13
[ "https://codegolf.stackexchange.com/questions/142630", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/53748/" ]
[Perl 6](https://perl6.org), 128 bytes ====================================== ```perl6 {.map({.combinations(1..4).grep({!.join.comb.repeated}).map({-$_,$_».trans('ATK'=>'1BZ')».ord.sort(-*)}).min}).minpairs».key} ``` [Try it online!](https://tio.run/##dZLNTsJAFIXX8BSHpEmnpkwshQrhz7owkZoYElYSQupMsVWhONOYEMKTufPF8E6JR...
[Python 3](https://docs.python.org/3/), ~~207~~ 204 bytes ========================================================= ```python lambda i,j:L(h(i))-L(h(j))if L(h(i))!=L(h(j))else(h(i)<h(j))-(h(i)>h(j)) L=len def h(l):s=set();return[x[0]for x in sorted(y.translate({65:49,75:90,84:65})for y in l)if not(s&set(x)or s.update(...
142,630
Inspired by [this challenge](https://codegolf.stackexchange.com/questions/140854/1326-starting-holdem-combos) and related to [this one](https://codegolf.stackexchange.com/questions/25056/compare-two-poker-hands). ### Background Badugi [bæduːɡiː] is a low-ball draw-poker variant. The Pokerstars World Cup Of Online Po...
2017/09/13
[ "https://codegolf.stackexchange.com/questions/142630", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/53748/" ]
[Perl 6](https://perl6.org), 128 bytes ====================================== ```perl6 {.map({.combinations(1..4).grep({!.join.comb.repeated}).map({-$_,$_».trans('ATK'=>'1BZ')».ord.sort(-*)}).min}).minpairs».key} ``` [Try it online!](https://tio.run/##dZLNTsJAFIXX8BSHpEmnpkwshQrhz7owkZoYElYSQupMsVWhONOYEMKTufPF8E6JR...
[Jelly](https://github.com/DennisMitchell/jelly), 36 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ==================================================================================================================== ``` ẎŒQȦ;L;Ṗ€Ṣ$ “A+KYTE”yḲONŒPÇ€ṢṪµ€⁼€Ṁ$ ``` A monadic link taking a list of two li...
142,630
Inspired by [this challenge](https://codegolf.stackexchange.com/questions/140854/1326-starting-holdem-combos) and related to [this one](https://codegolf.stackexchange.com/questions/25056/compare-two-poker-hands). ### Background Badugi [bæduːɡiː] is a low-ball draw-poker variant. The Pokerstars World Cup Of Online Po...
2017/09/13
[ "https://codegolf.stackexchange.com/questions/142630", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/53748/" ]
JavaScript (ES6), ~~209~~ ~~202~~ ~~192~~ ~~182~~ 181 bytes =========================================================== *Saved 7 bytes thanks to @Neil* Takes input as an array of arrays of strings. Returns `true` if the first hand wins, `false` if the second hand wins, or `2` in the event of a tie. ```js a=>([a,b]=a...
[Python 3](https://docs.python.org/3/), ~~207~~ 204 bytes ========================================================= ```python lambda i,j:L(h(i))-L(h(j))if L(h(i))!=L(h(j))else(h(i)<h(j))-(h(i)>h(j)) L=len def h(l):s=set();return[x[0]for x in sorted(y.translate({65:49,75:90,84:65})for y in l)if not(s&set(x)or s.update(...
142,630
Inspired by [this challenge](https://codegolf.stackexchange.com/questions/140854/1326-starting-holdem-combos) and related to [this one](https://codegolf.stackexchange.com/questions/25056/compare-two-poker-hands). ### Background Badugi [bæduːɡiː] is a low-ball draw-poker variant. The Pokerstars World Cup Of Online Po...
2017/09/13
[ "https://codegolf.stackexchange.com/questions/142630", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/53748/" ]
JavaScript (ES6), ~~209~~ ~~202~~ ~~192~~ ~~182~~ 181 bytes =========================================================== *Saved 7 bytes thanks to @Neil* Takes input as an array of arrays of strings. Returns `true` if the first hand wins, `false` if the second hand wins, or `2` in the event of a tie. ```js a=>([a,b]=a...
[Jelly](https://github.com/DennisMitchell/jelly), 36 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) ==================================================================================================================== ``` ẎŒQȦ;L;Ṗ€Ṣ$ “A+KYTE”yḲONŒPÇ€ṢṪµ€⁼€Ṁ$ ``` A monadic link taking a list of two li...
11,769,159
I am using the following CSS code within a html page in order to set the H1 and H2 color values. ``` <style type="text/css"> img {border-style: none;} H1 {color: "#33CCFF"} H2 {color: "#33CCFF"} </style> ``` This is working fine for Internet explorer, but is failing for Chrome, Safari, and Firefox. How do I fix thi...
2012/08/01
[ "https://Stackoverflow.com/questions/11769159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385852/" ]
you need remove '"' around color * ; goes at the end of the css declaration always, like this: H1 {color:#FFF;width:100%;} H1#ID.class {color:#FFF;width:100%;} <==== right order for combining ID's + Class
You need to remove the quotes as Voodoo says, but you should also really be closing the color declaration with a semicolon (;). It may work without it, but you're really asking for trouble. ;)
23,944,108
I would like to share a common version variable between an sbtPlugin and the rest of the build Here is what I am trying: in `project/Build.scala`: ``` object Versions { scalaJs = "0.5.0-M3" } object MyBuild extends Build { //Use version number } ``` in `plugins.sbt`: ``` addSbtPlugin("org.scala-lang.modules.s...
2014/05/29
[ "https://Stackoverflow.com/questions/23944108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121477/" ]
For the `project/plugins.sbt` file you'd have to have another `project` under `project` with the `Versions.scala` file. That would make the definition of `Versions.scalaJs` visible. The reason for doing it is that `*.sbt` files belong to a project build definition at the current level with `*.scala` files under `proje...
My proposal is to hack. For example, in `build.sbt` you can add a task: ``` val readPluginSbt = taskKey[String]("Read plugins.sbt file.") readPluginSbt := { val lineIterator = scala.io.Source.fromFile(new java.io.File("project","plugins.sbt")).getLines val linesWithValIterator = lineIterator.filte...
23,944,108
I would like to share a common version variable between an sbtPlugin and the rest of the build Here is what I am trying: in `project/Build.scala`: ``` object Versions { scalaJs = "0.5.0-M3" } object MyBuild extends Build { //Use version number } ``` in `plugins.sbt`: ``` addSbtPlugin("org.scala-lang.modules.s...
2014/05/29
[ "https://Stackoverflow.com/questions/23944108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121477/" ]
sbt-buildinfo ------------- If you need to share `version` number between `build.sbt` and `hello.scala`, what would you normally do? I don't know about you, but I would use [sbt-buildinfo](https://github.com/sbt/sbt-buildinfo) that I wrote. This can be configured using `buildInfoKeys` setting to expose arbitrary key ...
For the `project/plugins.sbt` file you'd have to have another `project` under `project` with the `Versions.scala` file. That would make the definition of `Versions.scalaJs` visible. The reason for doing it is that `*.sbt` files belong to a project build definition at the current level with `*.scala` files under `proje...
23,944,108
I would like to share a common version variable between an sbtPlugin and the rest of the build Here is what I am trying: in `project/Build.scala`: ``` object Versions { scalaJs = "0.5.0-M3" } object MyBuild extends Build { //Use version number } ``` in `plugins.sbt`: ``` addSbtPlugin("org.scala-lang.modules.s...
2014/05/29
[ "https://Stackoverflow.com/questions/23944108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121477/" ]
sbt-buildinfo ------------- If you need to share `version` number between `build.sbt` and `hello.scala`, what would you normally do? I don't know about you, but I would use [sbt-buildinfo](https://github.com/sbt/sbt-buildinfo) that I wrote. This can be configured using `buildInfoKeys` setting to expose arbitrary key ...
My proposal is to hack. For example, in `build.sbt` you can add a task: ``` val readPluginSbt = taskKey[String]("Read plugins.sbt file.") readPluginSbt := { val lineIterator = scala.io.Source.fromFile(new java.io.File("project","plugins.sbt")).getLines val linesWithValIterator = lineIterator.filte...
148,433
I am looking for a way to replace my phone as a 2FA method. U2F is not universally supported. Most services that I use support TOTP (Google Authenticator), and so I thought the Yubikey would support loading the TOTP secret and, upon press of a button, somehow detect the web site I am on, generate the code, and enter it...
2017/01/15
[ "https://security.stackexchange.com/questions/148433", "https://security.stackexchange.com", "https://security.stackexchange.com/users/57381/" ]
The hardware token detects the website you're on, generates an appropriate code, and submits it directly without the user typing anything? That sounds a lot like u2f. The reason why you don't see this offered is the same reason why only a few sites support u2f: it would require the browser to interact directly with th...
@tylerl is not completely right here. (Especially since U2F requires additional software ;-) The yubikey can work independently of the any driver and any website. So the yubikey will not detect a website, if not in U2F mode. A full blown yubikey has the following modes: * PGP * U2F * AES yubico mode * HOTP * Challeng...
32,944,847
I have a compression command which I pipe to a md5sum check command as such: ``` tar zcvpf file.tar.gz file | xargs -I '{}' bash -c "test -f '{}' && md5sum '{}'" | tee file_mybackup.md5 ``` I would now like to split the tar.gz file into 100MB chunks. I can do this by: ``` tar zcvpf - file | split -d -b 1M - f...
2015/10/05
[ "https://Stackoverflow.com/questions/32944847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1977981/" ]
If the background task is assigned to a specific user, you could use session data to indicate that task has completed. In your Ajax function, you could look at this session data, and only look at the database when you have indication that this is completed: <https://docs.djangoproject.com/en/1.8/topics/http/sessions/>...
Maybe you should use Jquery and ajax to do the request using this.. <http://api.jquery.com/category/deferred-object/> Hope it helps you
26,801
After solving the first few levels in Crayon Physics my "world map" looks like this: ![enter image description here](https://i.stack.imgur.com/jVTrg.jpg) It appears I earned two flags on the first level, one flag on the following two, no flag for the fourth, then I earned two flags and... a ball. Is that just cosmet...
2011/07/27
[ "https://gaming.stackexchange.com/questions/26801", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/23/" ]
Those are cosmetic. Only the stars count. You can i[mprove your score](http://www.kloonigames.com/blog/crayonphysics/crayon-physics-deluxe-gameplay-update) by finishing a round in one of the following ways. 1. Hole in one - for this, you have to get the star by drawing a single line 2. Old School, and - for this, you ...
If you have two flags on one level, you can click the level then the 'solutions tab' and mark your solution as 'awesome'. This gives you one orange flag for the level, and an extra star.
634,507
Can you point out where am I going wrong ? I wanted to select 5 men from 7 men . This can be done very easily as 7C5 ways = 21ways, but I was confused as to why the following calculation didn't work out the same way -> I first selected 3 men from 7 men as 7C3 ways = 35 ways And then I selected 2 men from remaining 4 me...
2014/01/11
[ "https://math.stackexchange.com/questions/634507", "https://math.stackexchange.com", "https://math.stackexchange.com/users/120564/" ]
You are overcounting in the following way. If the men were elements of $M = \{A,B,C,D,E,F,G\}$ then you might choose $A,B,C$ from $M$ and then $D,E$ from the remaining four or you might choose $A,B,D$ and $C,E$ from the remaining four but you get the same five men in both cases. For any given five element set there...
Let's try it with smaller numbers. I want to select $3$ men from $4$ men. This can be done easily in $\_4\text{C}\_3=4$ ways. (Equivalently, I can choose to *omit* one of the $4$ men in $\_4\text{C}\_1=4$ ways.) This is clearly the right answer. Now let's try it another way. First I select $1$ man from $4$ men in $\_4...
634,507
Can you point out where am I going wrong ? I wanted to select 5 men from 7 men . This can be done very easily as 7C5 ways = 21ways, but I was confused as to why the following calculation didn't work out the same way -> I first selected 3 men from 7 men as 7C3 ways = 35 ways And then I selected 2 men from remaining 4 me...
2014/01/11
[ "https://math.stackexchange.com/questions/634507", "https://math.stackexchange.com", "https://math.stackexchange.com/users/120564/" ]
You are overcounting in the following way. If the men were elements of $M = \{A,B,C,D,E,F,G\}$ then you might choose $A,B,C$ from $M$ and then $D,E$ from the remaining four or you might choose $A,B,D$ and $C,E$ from the remaining four but you get the same five men in both cases. For any given five element set there...
Hi lets us concider a small real life example! See.... let us concider that we have 5 members such as A B C D E ok. Now you are willing to choose any 3 members from them to form a team.So then you will use the combination concept among them.right!fine...this will be simply 5C3 = ((120)/((2!)\*(3!)))= 10. **But accordi...
634,507
Can you point out where am I going wrong ? I wanted to select 5 men from 7 men . This can be done very easily as 7C5 ways = 21ways, but I was confused as to why the following calculation didn't work out the same way -> I first selected 3 men from 7 men as 7C3 ways = 35 ways And then I selected 2 men from remaining 4 me...
2014/01/11
[ "https://math.stackexchange.com/questions/634507", "https://math.stackexchange.com", "https://math.stackexchange.com/users/120564/" ]
Let's try it with smaller numbers. I want to select $3$ men from $4$ men. This can be done easily in $\_4\text{C}\_3=4$ ways. (Equivalently, I can choose to *omit* one of the $4$ men in $\_4\text{C}\_1=4$ ways.) This is clearly the right answer. Now let's try it another way. First I select $1$ man from $4$ men in $\_4...
Hi lets us concider a small real life example! See.... let us concider that we have 5 members such as A B C D E ok. Now you are willing to choose any 3 members from them to form a team.So then you will use the combination concept among them.right!fine...this will be simply 5C3 = ((120)/((2!)\*(3!)))= 10. **But accordi...
39,124,265
I want to get a sample from serial port in python. but when I run the code to know the rate of it, python gives me different values! it is usually about `24000` time per second. But sometimes it returns `14000`. What is this big difference's reason ? and if I want to sampling 1 million what should I do? this is the sa...
2016/08/24
[ "https://Stackoverflow.com/questions/39124265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526335/" ]
Investigate the `timeit` module, which was designed for applications like this. Benchmarks have to be run under very controlled conditions to be anything like repeatable. `timeit` runs your code a number of times and gives you the best result. Usually slower performance will be an indication that your computer is runni...
You will have always some time discrepancies in running code in python, it's because of resources your CPU `gives` to running your script. You have to make couple of tries and calculate average time of it.
39,124,265
I want to get a sample from serial port in python. but when I run the code to know the rate of it, python gives me different values! it is usually about `24000` time per second. But sometimes it returns `14000`. What is this big difference's reason ? and if I want to sampling 1 million what should I do? this is the sa...
2016/08/24
[ "https://Stackoverflow.com/questions/39124265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526335/" ]
Investigate the `timeit` module, which was designed for applications like this. Benchmarks have to be run under very controlled conditions to be anything like repeatable. `timeit` runs your code a number of times and gives you the best result. Usually slower performance will be an indication that your computer is runni...
I was @15000 at first execution and then arround 28000. In general the result depends mainly of * your CPU load * cache hit/miss * RAM access time But in your case it is the print which takes most of the execution time. So print access time to stdout is the cause of your variation. try this : ``` for item in g(10,...
24,281,460
I am currently creating a multistep form with Formhandler, including a variety of translation labels. At default, German labels are shown, but there is a option to switch the website to English - when I do this, the label texts change, so this works. **My problem:** when I submit the first step of the form in English ...
2014/06/18
[ "https://Stackoverflow.com/questions/24281460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3214306/" ]
I believe the problem is invoking `runAction` twice on the same node. **EDIT**: As LearnCocos2D mentioned in the comments invoking `runAction` more then once should work as long as the actions are not interfering with each other (i.e. two move actions on the same node running in parallel) so it's either a behavioral ...
Try with this: ``` CCAction *actionMove = [CCActionMoveBy actionWithDuration:ALERT_FADE_DURATION position:ccp(0.0f, 40.0f)]; CCAction *actionFade = [CCActionFadeOut actionWithDuration:ALERT_FADE_DURATION]; CCAction *actionRemove = [CCActionRemove action]; id seq = [CCActionSequence actions:actionMove, actionRemove, n...
10,909,063
The mongoDB API documentation seems to be lacking in this area. I am trying to use the aggregate function to get a count of popular tags in a certain collection. Here is the command I wish to execute: ``` db.runCommand( { aggregate : "articles", pipeline : [ { $unwind : "$Tags" }, ...
2012/06/06
[ "https://Stackoverflow.com/questions/10909063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1438940/" ]
Here's the corresponding C# Driver Doc page: [RunCommand()](http://api.mongodb.org/csharp/1.3.1/html/4fe0d8b2-161e-ff83-355d-7517b251d81a.htm). So basically you call `Database.RunCommand("MyCommand")`. This ticket in JIRA may come handy for an example of more complex commands requiring (multiple) properties: [CSHARP-47...
In MongoDB CSharp Drivers 2.0.0+: I use below syntax to run such commands: ``` var command = new CommandDocument { {"aggregate", "TestCollection"}, { "pipeline", new BsonArray { new BsonDocument {{"$unwind", "$Tags"}}, new BsonDocument { { ...
21,263,422
AWS (Amazon Web Service) provides an API for submitting HTTP requests to Alexa. This API is called Alexa Web Information Service. I submit an HTTP request with `&Action=UrlInfo` and `&ResponseGroup=UsageStats`. I then receive an XML within the HTTP response. Here is the part in the XML which is relevant to my quest...
2014/01/21
[ "https://Stackoverflow.com/questions/21263422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1382251/" ]
Regarding aws:PerMillion > > The PageViews PerMillion stat shows "out of every million pageviews > made by all users on the Internet today how many pageviews are made on > this site?" The daily pageviews number is then averaged over the > specified time period. > > > <https://forums.aws.amazon.com/message.jspa?...
I've annotated a sample result with my understanding of the return values based on Treton's answer: ```xml <aws:TopSites> <!-- Country in which the sites in this result have been grouped. --> <aws:Country> <aws:CountryName>Australia</aws:CountryName> <aws:CountryCode>AU</aws:CountryCode> <!-- Total nu...
12,018,257
I have a site where users can publish links. Users fill a form with 2 fields: * Title * URL When the user clicks "submit" I have a crawler that looks for an image of the link provided and makes a thumbnail. The problem is that **the crawler usually takes about 5-10 seconds to finish loading** and cropping the thumb....
2012/08/18
[ "https://Stackoverflow.com/questions/12018257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/949388/" ]
force user to fill first the url and then the title, when user go to title field start crawl data, till finish the title and press sumbit you will gain some time and make the proccess apparently faster.
Why use XHR at all if you don't need the data returned? Just let your form submit the link to `links.php` and let it save the image there!
12,018,257
I have a site where users can publish links. Users fill a form with 2 fields: * Title * URL When the user clicks "submit" I have a crawler that looks for an image of the link provided and makes a thumbnail. The problem is that **the crawler usually takes about 5-10 seconds to finish loading** and cropping the thumb....
2012/08/18
[ "https://Stackoverflow.com/questions/12018257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/949388/" ]
The AJAX request seems to fail, because when you navigate away, the user request is aborted. Because of that, the execution of `save_image.php` is interrupted. You can use PHP's [`ignore_user_abort`](http://de2.php.net/manual/en/function.ignore-user-abort.php) to force the PHP process to continue in the background. Pu...
Why use XHR at all if you don't need the data returned? Just let your form submit the link to `links.php` and let it save the image there!
12,018,257
I have a site where users can publish links. Users fill a form with 2 fields: * Title * URL When the user clicks "submit" I have a crawler that looks for an image of the link provided and makes a thumbnail. The problem is that **the crawler usually takes about 5-10 seconds to finish loading** and cropping the thumb....
2012/08/18
[ "https://Stackoverflow.com/questions/12018257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/949388/" ]
The AJAX request seems to fail, because when you navigate away, the user request is aborted. Because of that, the execution of `save_image.php` is interrupted. You can use PHP's [`ignore_user_abort`](http://de2.php.net/manual/en/function.ignore-user-abort.php) to force the PHP process to continue in the background. Pu...
force user to fill first the url and then the title, when user go to title field start crawl data, till finish the title and press sumbit you will gain some time and make the proccess apparently faster.
12,018,257
I have a site where users can publish links. Users fill a form with 2 fields: * Title * URL When the user clicks "submit" I have a crawler that looks for an image of the link provided and makes a thumbnail. The problem is that **the crawler usually takes about 5-10 seconds to finish loading** and cropping the thumb....
2012/08/18
[ "https://Stackoverflow.com/questions/12018257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/949388/" ]
force user to fill first the url and then the title, when user go to title field start crawl data, till finish the title and press sumbit you will gain some time and make the proccess apparently faster.
to understand your problem, we need to understand the working of javascript your code is as follows ``` $.ajax({ url: 'publish/submit_link.php', type: 'POST', dataType: 'JSON', data: { link : link, ...
12,018,257
I have a site where users can publish links. Users fill a form with 2 fields: * Title * URL When the user clicks "submit" I have a crawler that looks for an image of the link provided and makes a thumbnail. The problem is that **the crawler usually takes about 5-10 seconds to finish loading** and cropping the thumb....
2012/08/18
[ "https://Stackoverflow.com/questions/12018257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/949388/" ]
The AJAX request seems to fail, because when you navigate away, the user request is aborted. Because of that, the execution of `save_image.php` is interrupted. You can use PHP's [`ignore_user_abort`](http://de2.php.net/manual/en/function.ignore-user-abort.php) to force the PHP process to continue in the background. Pu...
to understand your problem, we need to understand the working of javascript your code is as follows ``` $.ajax({ url: 'publish/submit_link.php', type: 'POST', dataType: 'JSON', data: { link : link, ...
19,489,787
I have 3 images that are all in the same line and float left but i would also like to centre them. I have tried using `margin: 0px auto;` but it doesn't seem to do anything. Any suggestions? CSS: ``` #boxes .box { width:370px; height:241px; float: left; margin: 0px auto; background-image:url(../i...
2013/10/21
[ "https://Stackoverflow.com/questions/19489787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
From your selector, I can make out that the boxes which are floated to the left are nested inside element having an id of `#boxes`, so if you can, assign some fixed width to `#boxes` and than use `margin: auto;` ``` #boxes { width: 800px; /* You need to set this */ margin: auto; } ``` [**Demo**](http://jsfiddl...
You should align to center to your parent div that is `#boxes` not to your image. Try this: ``` #boxes{ margin: 0 auto; text-align: center; } ```
19,489,787
I have 3 images that are all in the same line and float left but i would also like to centre them. I have tried using `margin: 0px auto;` but it doesn't seem to do anything. Any suggestions? CSS: ``` #boxes .box { width:370px; height:241px; float: left; margin: 0px auto; background-image:url(../i...
2013/10/21
[ "https://Stackoverflow.com/questions/19489787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
From your selector, I can make out that the boxes which are floated to the left are nested inside element having an id of `#boxes`, so if you can, assign some fixed width to `#boxes` and than use `margin: auto;` ``` #boxes { width: 800px; /* You need to set this */ margin: auto; } ``` [**Demo**](http://jsfiddl...
Add this CSS ``` #boxes .box { width:370px; height:241px; float: left; margin: 0px auto; background-image:url(../imgs/box_front.png); background-repeat:no-repeat; background-position:center center; background-color: #FFF; } ```
19,489,787
I have 3 images that are all in the same line and float left but i would also like to centre them. I have tried using `margin: 0px auto;` but it doesn't seem to do anything. Any suggestions? CSS: ``` #boxes .box { width:370px; height:241px; float: left; margin: 0px auto; background-image:url(../i...
2013/10/21
[ "https://Stackoverflow.com/questions/19489787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It is impossible to center floated items. One of the things you can do - is make the items `inline-block` and set the `text-align: center` property to their parent. Online example: <http://jsfiddle.net/8HPWU/>
You should align to center to your parent div that is `#boxes` not to your image. Try this: ``` #boxes{ margin: 0 auto; text-align: center; } ```
19,489,787
I have 3 images that are all in the same line and float left but i would also like to centre them. I have tried using `margin: 0px auto;` but it doesn't seem to do anything. Any suggestions? CSS: ``` #boxes .box { width:370px; height:241px; float: left; margin: 0px auto; background-image:url(../i...
2013/10/21
[ "https://Stackoverflow.com/questions/19489787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It is impossible to center floated items. One of the things you can do - is make the items `inline-block` and set the `text-align: center` property to their parent. Online example: <http://jsfiddle.net/8HPWU/>
Add this CSS ``` #boxes .box { width:370px; height:241px; float: left; margin: 0px auto; background-image:url(../imgs/box_front.png); background-repeat:no-repeat; background-position:center center; background-color: #FFF; } ```
21,799,485
``` T1 - id, name, userID (stocks) - not really used in this cased T2 - id, name, stockID, userID (categories) T3 - id, name, stockID, categoryID, quality, userID (goods) ``` column "quality" can be "0" (good) or "1" (bad) and each goods (even same sort) = 1 row this SQL, (this "far" I can get), show only total coun...
2014/02/15
[ "https://Stackoverflow.com/questions/21799485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2576791/" ]
``` SELECT T2.name, SUM(CASE WHEN T3.quality=1 THEN 1 ELSE 0 END)AS BAD, COUNT(*)AS TOTAL FROM T2 LEFT JOIN T3 ON T2.id=T3.categoryID WHERE t2.stockid=2 GROUP BY T2.name; ```
I think you want to do the `left join` in the other direction (you could also do a `right outer join`). And change the `count()` to count matching records: ``` SELECT T2.name, coalesce(SUM(t.3bad), 0) as Bad, COUNT(t3.categoryID) AS TOTAL FROM T2 LEFT JOIN T3 ON T2.id = T3.categoryID and T3.stockID = 2; GROU...
7,226,226
I'm working on Two's complement addition. Basically I need to show the addition of -27 to +31, with both numbers in binary using 6 bits. My problem is with carry operations. Maybe I'm not doing it right or something. -27 is in binary: 111011 +31 is in binary: 011111 The answer I think should be: +4 is in bin...
2011/08/29
[ "https://Stackoverflow.com/questions/7226226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/494901/" ]
your math is wrong. 27 is `0 1 1 0 1 1` in binary (note the leading 0 I added for the sign) -27 is `1 0 0 0 1 1` in two's complement. when you do the math with this, you should get the correct result. --- Here's a "trick" to perform two's complement quickly. Starting from the LSB, copy down the numbers exactly un...
Hmmm, `31 - 27 = 4`, correct! :) `4 is 100` in binary though, an are you sure that `-27 is 111011`???
20,845,778
I currently have the problem that Jekyll does not work well with Markdown and LaTeX. So I have a lot of articles with `$\frac{some}{latex}$` or `$$\int^e_v {en} more$$`. **How can I replace `$...$` by `<span>$...$</span>` and `$$...$$` by `<div>$$..$$</div>`?** Things that make this task difficult are: * The `...` m...
2013/12/30
[ "https://Stackoverflow.com/questions/20845778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/562769/" ]
### We can accomplish this by doing two steps replacement: ``` import re str = "$rac{some}{latex}$$$\int^e_v {en} more$$\$rac{some}{latex}$$$\int^e_v {en} more$$\n$rac{some}{latex}$\n$$\int^e_v {en} more$$\n\$rac{some}{latex}$\n$$\int^e_v {en} more$$" #first step: str = re.sub(r'(?<![\\])\$\$([^\$]+)\$\$', "<div>$$\g...
I *know* you asked for regex, but you'll run into headaches for those edges cases you mentioned you'll handle by hand. (If there are other regex solutions posted, compare this answer with theirs). With this it's simple to change the behavior of double and single TeX markers and handle escapes in the TeX code. Here is a...
8,542,609
How to get active (having focus) frame (JInternalFrame) that is inside JDesktopPane? I need it for my MDI notepad (not that anybody would use that, just a training project). Looking at api, I see only functions to get all JInternalFrames, not active one.
2011/12/17
[ "https://Stackoverflow.com/questions/8542609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1046871/" ]
Use [JDekstopPane.getSelectedFrame()](http://docs.oracle.com/javase/7/docs/api/javax/swing/JDesktopPane.html) method (*From doc: currently active JInternalFrame in this JDesktopPane, or null if no JInternalFrame is currently active.*) or `JDesktopPane.getAllFrames()` to get list of all `JInternalFrames` currently displ...
Make a `List<JInternalFrame>` and check [`isSelected()`](http://docs.oracle.com/javase/7/docs/api/javax/swing/JInternalFrame.html#isSelected%28%29) as you iterate though it. Addendum: See also this [example](http://groups.google.com/group/comp.lang.java.programmer/msg/2e1b14bcad9bd7fa) that uses `Action` to select an ...
8,542,609
How to get active (having focus) frame (JInternalFrame) that is inside JDesktopPane? I need it for my MDI notepad (not that anybody would use that, just a training project). Looking at api, I see only functions to get all JInternalFrames, not active one.
2011/12/17
[ "https://Stackoverflow.com/questions/8542609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1046871/" ]
Use [JDekstopPane.getSelectedFrame()](http://docs.oracle.com/javase/7/docs/api/javax/swing/JDesktopPane.html) method (*From doc: currently active JInternalFrame in this JDesktopPane, or null if no JInternalFrame is currently active.*) or `JDesktopPane.getAllFrames()` to get list of all `JInternalFrames` currently displ...
Have you looked at the Java tutorial titled [How to Use Internal Frames](http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html)? In your code you need an `InternalFrameListener` ([API](http://docs.oracle.com/javase/7/docs/api/javax/swing/event/InternalFrameListener.html)) ([Tutorial](http://docs....
3,057,981
I've just been messing around with threads in Java to get my head around them (it seems like the best way to do so) and now understand what's going on with synchronize, wait() and notify(). I'm curious about whether there's a way to wait() on two resources at once. I think the following won't quite do what I'm thinkin...
2010/06/16
[ "https://Stackoverflow.com/questions/3057981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/297938/" ]
"\r" should work for both windows and Mac OS X. Something like: ``` std::cout << "will not see this\rwill see this" << std::flush; std::cout << std::endl; // all done ```
I don't have access to a mac, but from a pure console standpoint, this is going to be largely dependent on how it treats the carriage return and line-feed characters. If you can literally send one or the other to the console, you want to send *just* a carriage return. I'm pretty sure Mac treats both carriage returns a...
3,057,981
I've just been messing around with threads in Java to get my head around them (it seems like the best way to do so) and now understand what's going on with synchronize, wait() and notify(). I'm curious about whether there's a way to wait() on two resources at once. I think the following won't quite do what I'm thinkin...
2010/06/16
[ "https://Stackoverflow.com/questions/3057981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/297938/" ]
"\r" should work for both windows and Mac OS X. Something like: ``` std::cout << "will not see this\rwill see this" << std::flush; std::cout << std::endl; // all done ```
As Nathan Ernst's answer says, if you want a robust, proper way to do this, use curses - specifically [ncurses](https://en.wikipedia.org/wiki/Ncurses). If you want a low-effort hackish way that tends to work, carry on... Command-line terminals for Linux, UNIX, MacOS, Windows etc. tend to support a small set of basic ...
3,057,981
I've just been messing around with threads in Java to get my head around them (it seems like the best way to do so) and now understand what's going on with synchronize, wait() and notify(). I'm curious about whether there's a way to wait() on two resources at once. I think the following won't quite do what I'm thinkin...
2010/06/16
[ "https://Stackoverflow.com/questions/3057981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/297938/" ]
I don't have access to a mac, but from a pure console standpoint, this is going to be largely dependent on how it treats the carriage return and line-feed characters. If you can literally send one or the other to the console, you want to send *just* a carriage return. I'm pretty sure Mac treats both carriage returns a...
As Nathan Ernst's answer says, if you want a robust, proper way to do this, use curses - specifically [ncurses](https://en.wikipedia.org/wiki/Ncurses). If you want a low-effort hackish way that tends to work, carry on... Command-line terminals for Linux, UNIX, MacOS, Windows etc. tend to support a small set of basic ...
49,491,839
I have multiple WARs that expose CXF JAXRS endpoints. They have similar web.xml ``` <web-app id="app1"> <context-param> <param-name>contextClass</param-name> <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value> </context-param> <context-...
2018/03/26
[ "https://Stackoverflow.com/questions/49491839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/878418/" ]
The controller action on the server side will need a concrete type to read the entire body of the request ``` public class Order { public int OrderId { get; set; } public int[] Ids { get; set; } } ``` This is primarily because the action can only read from the body once. Update action to... ``` [HttpPost] ...
The HttpClient can do the serialisation for you. See if ``` var response = await client.PostAsJsonAsync($"{url}/admin/cancel", obj); ``` works better. Then you don't need to write the serialisation code yourself. If you still have a problem, use a tool such as Fiddler to monitor the actual request and see what para...
147,548
We are writing a application in which a part of the job is to fetch a relatively large (>10000 features) and often updated dataset from a WFS server, store a local copy, and do geospatial analyses on it. We are stuck on the downloading part, as we hit the default 1000 features limit on the server side, which we do not ...
2015/05/17
[ "https://gis.stackexchange.com/questions/147548", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/-1/" ]
If you are using Linux, you should be able to connect to a WFS server, and fetch a layer without any problem with `wget`. I was able to fetch a dataset consisting of 10209 features, which was 33.3 MB in size. My test command was the following: ``` wget -O output.gml "http://demo.opengeo.org/geoserver/wfs?request=GetFe...
You could try the OGR WFS option "-dsco OGR\_WFS\_PAGING\_ALLOWED=ON" as described in the docs <http://www.gdal.org/drv_wfs.html>
147,548
We are writing a application in which a part of the job is to fetch a relatively large (>10000 features) and often updated dataset from a WFS server, store a local copy, and do geospatial analyses on it. We are stuck on the downloading part, as we hit the default 1000 features limit on the server side, which we do not ...
2015/05/17
[ "https://gis.stackexchange.com/questions/147548", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/-1/" ]
The easiest way to do this, is to use GDAL's ogr2ogr utility. Firstly, you need to create an XML file with the URL to the WFS endpoint. ``` <OGRWFSDataSource> <URL>http://demo.opengeo.org/geoserver/ows?service=wfs&amp;typeName=osm:roads</URL> <PagingAllowed>ON</PagingAllowed> </OGRWFSDataSource> ``` If you wa...
You could try the OGR WFS option "-dsco OGR\_WFS\_PAGING\_ALLOWED=ON" as described in the docs <http://www.gdal.org/drv_wfs.html>
40,498,878
I'm trying to understand the concepts of Linked Lists. I've searched for information about my question but I haven't found any answer which would help me. I'd like to know how to check if linked list is sorted? Evidently, we can't use the simple two lines function as for regular lists. For example if I want to check if...
2016/11/09
[ "https://Stackoverflow.com/questions/40498878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6182035/" ]
You can do basically the same thing. The only caveat is that you need a way to iterate over your linked list... ``` class LinkedList: ... def __iter__(self): p = self.head while p: # I yield the data for simplicity in this problem. # Depending on the constraints for lin...
Calling this a **linkedList** does not cause it to become compatible with Python's **list** type. :-) Your **LinkedList** class doesn't have the methods necessary to make it an iterable object in Python. Thus, you can't use the built-in functions that work on iterables. You'd have to write a new method to check the li...
64,443,461
I am reading a file and looking for this string in the file.looking to capture the value(00:00:22) using regex.I have written regular expression but its not finding that value? ``` "20.10.02 00:00:22:135 INFO Running Cron : BatchJob" Pattern p = Pattern.compile("([01][0-9]|2[0-3]):([01][0-9]|2[0-3]) INFO Runni...
2020/10/20
[ "https://Stackoverflow.com/questions/64443461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/739115/" ]
This is not possible in TS right now. because it adds considerable complexity to their Control-Flow Analyzer. other than explicitly putting `foo !== null` as the `if expression`, there two possible things to do: 1- using [Assertions](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions): ``` ...
This is currently not possible (see [this issue](https://github.com/microsoft/TypeScript/issues/12184)). Here's a workaround. It assigns `wrappedFoo` a type which either contains a string and true, or null and false. After checking for the boolean value, Typescript knows which of those two it is: ```js const foo: str...
64,443,461
I am reading a file and looking for this string in the file.looking to capture the value(00:00:22) using regex.I have written regular expression but its not finding that value? ``` "20.10.02 00:00:22:135 INFO Running Cron : BatchJob" Pattern p = Pattern.compile("([01][0-9]|2[0-3]):([01][0-9]|2[0-3]) INFO Runni...
2020/10/20
[ "https://Stackoverflow.com/questions/64443461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/739115/" ]
This is not possible in TS right now. because it adds considerable complexity to their Control-Flow Analyzer. other than explicitly putting `foo !== null` as the `if expression`, there two possible things to do: 1- using [Assertions](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions): ``` ...
Next version of Typescript (4.4) [will support control flow analysis of conditional expressions](https://github.com/microsoft/TypeScript/pull/44730). The only change you'll need to do is `let foo` -> `const foo`, because > > Narrowing through indirect references occurs only when the conditional expression or discrimi...
49,320,384
Is there a way in Laravel to do some check on associating? For example I've `Home` and `Owner`, I would like on `associate` check if `Home` as already an `Owner`, and in that case I must execute some code... Some suggestions?
2018/03/16
[ "https://Stackoverflow.com/questions/49320384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1663720/" ]
You should use `event.stopPropagation();` who prevents the event from beeing trigger with the children elements. There is the doc : <https://api.jquery.com/event.stoppropagation/>
Its a Firefox-Bug. In Firefox the "Dragenter-Event" gets fired twice. No matter if there is any child-element or not. You could try to work with event.target and event.currentTarget in combination with pointer-events: none.
5,516,743
I'm trying to setup a 2-column layout where the left area is fixed and the main content is fluid. I've seen several answers on here, which tend to work. However, there is some odd behavior when I use a "jsTree" in my "left" area and jQuery UI tabs in the main/content area. **html** ``` <div id="main"> <div id="le...
2011/04/01
[ "https://Stackoverflow.com/questions/5516743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70535/" ]
Josiah has it right but a better solution is to change the nature of the clear-fix technique. The `.ui-helper-clearfix` does this: ``` .ui-helper-clearfix::after { clear: both; content: '.'; display: block; height: 0px; visibility: hidden; } ``` And the problem is the `clear:both`. You can get th...
The widget tabs header has a clear fix. [updated fiddle](http://jsfiddle.net/gBUw2/4/). You could fix this with a non float layout, or override the css like so: ``` #right .ui-helper-clearfix { display: inline-block; } ``` This makes it so that the header does not expand the full width of the container however.
5,516,743
I'm trying to setup a 2-column layout where the left area is fixed and the main content is fluid. I've seen several answers on here, which tend to work. However, there is some odd behavior when I use a "jsTree" in my "left" area and jQuery UI tabs in the main/content area. **html** ``` <div id="main"> <div id="le...
2011/04/01
[ "https://Stackoverflow.com/questions/5516743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70535/" ]
The widget tabs header has a clear fix. [updated fiddle](http://jsfiddle.net/gBUw2/4/). You could fix this with a non float layout, or override the css like so: ``` #right .ui-helper-clearfix { display: inline-block; } ``` This makes it so that the header does not expand the full width of the container however.
All you need to do is to simply tweak your css, like this: ``` #left { float: left; width: 23%; overflow: auto; } #right { float: left; width: 75%; display: block; } ``` This would also fix the issue that the tabs' container don't expand full width. Though you could tune the width percentage...
5,516,743
I'm trying to setup a 2-column layout where the left area is fixed and the main content is fluid. I've seen several answers on here, which tend to work. However, there is some odd behavior when I use a "jsTree" in my "left" area and jQuery UI tabs in the main/content area. **html** ``` <div id="main"> <div id="le...
2011/04/01
[ "https://Stackoverflow.com/questions/5516743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/70535/" ]
Josiah has it right but a better solution is to change the nature of the clear-fix technique. The `.ui-helper-clearfix` does this: ``` .ui-helper-clearfix::after { clear: both; content: '.'; display: block; height: 0px; visibility: hidden; } ``` And the problem is the `clear:both`. You can get th...
All you need to do is to simply tweak your css, like this: ``` #left { float: left; width: 23%; overflow: auto; } #right { float: left; width: 75%; display: block; } ``` This would also fix the issue that the tabs' container don't expand full width. Though you could tune the width percentage...
61,367,678
Consider following code snippet: ``` enum class Bar { A }; void foo(Bar) {} struct Baz { void foo() { foo(Bar::A); } }; ``` It fails to compile, the message from gcc 9.2 is: ``` :12:19: error: no matching function for call to 'Baz::foo(Bar)' 12 | foo(Bar::A); | ``` ...
2020/04/22
[ "https://Stackoverflow.com/questions/61367678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3414900/" ]
According to the rule of unqualified name lookup, from the standard, [[basic.lookup.unqual]/1](https://timsong-cpp.github.io/cppwp/basic.lookup.unqual#1), (emphasis mine) > > In all the cases listed in [basic.lookup.unqual], the scopes are searched for a declaration in the order listed in each of the respective cate...
The call to `foo` inside `Baz::foo()` will only look up names inside the class. If you mean to use the `foo` declared outside the class `Baz`, you need to use the scope-resolution operator, like this: ``` enum class Bar { A }; void foo(Bar) {} struct Baz { void foo() { ::foo(Bar::A); // looks up gl...
12,525
I've been scouring google to see if it's possible to record gameplay audio for consoles as well as live commentary from a microphone or headset. Most of what I come across, from either forums or product FAQs say that it's possible to do one but not both. On PCs, it's easy, but on consoles you can only do one. Or so I'm...
2014/09/02
[ "https://avp.stackexchange.com/questions/12525", "https://avp.stackexchange.com", "https://avp.stackexchange.com/users/6425/" ]
`-preset` ========= Use the slowest preset that is fast enough that it does not drop frames. You can see if `ffmpeg` is dropping frames in the console output (if I recall correctly). Presets are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow. `-crf` ====== Use the highest `-crf` value ...
You specify a preset and a quality value at the same time and by that overriding the preset. I would also recommend you don't encode with ffmpeg while capturing as this would be pretty slow on most PCs. The "error" in your ffmpeg commandline is the option `-crf 1`. `CRF` is a quality setting of x264 and the lower the ...
4,776,446
There a lot of C++ class libraries either open source or commercial like MFC, ATL, SmartWin++, QT. but none of them has the design and the architecture and the purity of .NET framework class library. What about the idea of implementing C++ library that is like .NET framework class library and provide the developers wit...
2011/01/23
[ "https://Stackoverflow.com/questions/4776446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/539471/" ]
Interesting question. But I believe it would be either a waste of time or not optimal to re-create the .NET BCL (base class library) for unmanaged C++. Why is that? 1. The C++ language is quite different from the .NET languages. This means that if you were to re-write the BCL for C++, you would optimally try to make t...
I assume: That you like C++ for performance reasons. That you like .NET for productivity reasons. You can try, but finally you will note that C++ will not supply the language constructions possible in managed languages (features as delegates, native interfaces, variance, lambda expressions, LINQ, etc), you can mimick ...
26,857
There is a lot of track remixes online. Most of producers use separated vocals from songs. It is almost impossible that they could cut only vocal out of total track in such good quality. What is more, anywhere in the network is not available finished dry vocal version. So how is it possible that they are in possession...
2013/10/17
[ "https://sound.stackexchange.com/questions/26857", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/6561/" ]
The generic term for split / separated tracks is "stems". If you google "vocal stems" you'll find free ones for random songs, not hits but usable. Vocal stems for popular songs are usually available (at a price) from the label or artist.
They purchased it from the artist, or possibly the record company. There is no other clean or effective option. Sound, and particularly voices are complex and once you mix sounds together, they can't be separated cleanly. It's kind of like if you mix water from one cup with water in another cup, you can't get the water...
25,234,556
In vim, I could use `:%sno/[abt]//g` to remove all text of "[abt]" literally (as explained [here](http://vim.wikia.com/wiki/Simplifying_regular_expressions_using_magic_and_no-magic)). I tried the same command in `evil-mode`, but it complains it doesn't understand the `sno` command, so how can I do the same thing in `e...
2014/08/11
[ "https://Stackoverflow.com/questions/25234556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266185/" ]
To my knowledge, `evil` does not (yet?) support the "magic/no magic" regexp options (actually, it only does a smallish subset of `ex` functionality~~, so I don't think `%` will work either~~). As @Ehvince's answer suggests, the standard Emacs way to do the replace is with `query-replace` or `query-replace-regexp`. If y...
You would use the emacs command `query-replace` bound to `M-%`: ``` M-% [abt] RET <nothing> RET ``` and then approve each occurence with `y` or all with `!`. The doc is at `C-h f query-replace`. `query-replace-regexp` is bound to `C-M-%`.
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
I think the best term *is* "reticle." Businesses that make the glass used in cameras call them reticles. See the images on this site: <http://www.reticles.com/reticles_kr900.htm>.
Cross hairs are meant for aiming (centering) and are not usually interactive. The rectangular visualization's primary purpose is not centering of focus, but selecting the relevant part of the image for scanning. Theoretically user can change both size and location in the screen, therefore this is not a common cross ha...
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
I think the best term *is* "reticle." Businesses that make the glass used in cameras call them reticles. See the images on this site: <http://www.reticles.com/reticles_kr900.htm>.
I've written a number of QR code-reading apps, and have always called it a "reticle" in my code, because (son of a photographer here) I was always taught that *any* lines, grid, crosshair, or indicia overlaid on a view (like a viewfinder in a camera) were *all* called reticles. Hence, it's a general term: a crosshair o...
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
**Colloquial: *Target Area,* \*Focus Area,\* or *Focus Frame*** It looks like "[target area](http://www.google.com/imgres?hl=en&biw=1428&bih=933&tbm=isch&tbnid=3bqqeUAwteODEM%3a&imgrefurl=http://www.androidapps-home.com/quickmark-barcode-scanner-android-6963.html&docid=Nbr4x3pvKwmdGM&imgurl=http://ssl.gstatic.com/an...
I've written a number of QR code-reading apps, and have always called it a "reticle" in my code, because (son of a photographer here) I was always taught that *any* lines, grid, crosshair, or indicia overlaid on a view (like a viewfinder in a camera) were *all* called reticles. Hence, it's a general term: a crosshair o...
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
I think the best term *is* "reticle." Businesses that make the glass used in cameras call them reticles. See the images on this site: <http://www.reticles.com/reticles_kr900.htm>.
According to [ehow](http://www.ehow.com/how_8488499_read-qr-codes-iphone.html) it is called a reticle. But I usually just hear it called the QR reader.
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
Well going to the actual source of QR codes - the company who invented them ([Denso Corporation](http://en.wikipedia.org/wiki/Denso)) don't seem to have given that a particular name at all. The products that they sell refer to that roughly in equal measure as the '[Reading Area](http://www.denso-adc.com/products/gt15)...
I've written a number of QR code-reading apps, and have always called it a "reticle" in my code, because (son of a photographer here) I was always taught that *any* lines, grid, crosshair, or indicia overlaid on a view (like a viewfinder in a camera) were *all* called reticles. Hence, it's a general term: a crosshair o...
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
**Colloquial: *Target Area,* \*Focus Area,\* or *Focus Frame*** It looks like "[target area](http://www.google.com/imgres?hl=en&biw=1428&bih=933&tbm=isch&tbnid=3bqqeUAwteODEM%3a&imgrefurl=http://www.androidapps-home.com/quickmark-barcode-scanner-android-6963.html&docid=Nbr4x3pvKwmdGM&imgurl=http://ssl.gstatic.com/an...
Well going to the actual source of QR codes - the company who invented them ([Denso Corporation](http://en.wikipedia.org/wiki/Denso)) don't seem to have given that a particular name at all. The products that they sell refer to that roughly in equal measure as the '[Reading Area](http://www.denso-adc.com/products/gt15)...
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
**Colloquial: *Target Area,* \*Focus Area,\* or *Focus Frame*** It looks like "[target area](http://www.google.com/imgres?hl=en&biw=1428&bih=933&tbm=isch&tbnid=3bqqeUAwteODEM%3a&imgrefurl=http://www.androidapps-home.com/quickmark-barcode-scanner-android-6963.html&docid=Nbr4x3pvKwmdGM&imgurl=http://ssl.gstatic.com/an...
According to [ehow](http://www.ehow.com/how_8488499_read-qr-codes-iphone.html) it is called a reticle. But I usually just hear it called the QR reader.
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
**Colloquial: *Target Area,* \*Focus Area,\* or *Focus Frame*** It looks like "[target area](http://www.google.com/imgres?hl=en&biw=1428&bih=933&tbm=isch&tbnid=3bqqeUAwteODEM%3a&imgrefurl=http://www.androidapps-home.com/quickmark-barcode-scanner-android-6963.html&docid=Nbr4x3pvKwmdGM&imgurl=http://ssl.gstatic.com/an...
Cross hairs are meant for aiming (centering) and are not usually interactive. The rectangular visualization's primary purpose is not centering of focus, but selecting the relevant part of the image for scanning. Theoretically user can change both size and location in the screen, therefore this is not a common cross ha...
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
**Colloquial: *Target Area,* \*Focus Area,\* or *Focus Frame*** It looks like "[target area](http://www.google.com/imgres?hl=en&biw=1428&bih=933&tbm=isch&tbnid=3bqqeUAwteODEM%3a&imgrefurl=http://www.androidapps-home.com/quickmark-barcode-scanner-android-6963.html&docid=Nbr4x3pvKwmdGM&imgurl=http://ssl.gstatic.com/an...
I think the best term *is* "reticle." Businesses that make the glass used in cameras call them reticles. See the images on this site: <http://www.reticles.com/reticles_kr900.htm>.
22,210
What do you call the square brackets used to target a barcode/QR scanner? I thought this would be called "reticle," but when I Google the term, all I see are circles with crosshairs. Is there a more precise term, especially in the context of a digital device/camera, or is reticle the word? ![scanner target](https://i....
2012/06/07
[ "https://ux.stackexchange.com/questions/22210", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/4695/" ]
Well going to the actual source of QR codes - the company who invented them ([Denso Corporation](http://en.wikipedia.org/wiki/Denso)) don't seem to have given that a particular name at all. The products that they sell refer to that roughly in equal measure as the '[Reading Area](http://www.denso-adc.com/products/gt15)...
Cross hairs are meant for aiming (centering) and are not usually interactive. The rectangular visualization's primary purpose is not centering of focus, but selecting the relevant part of the image for scanning. Theoretically user can change both size and location in the screen, therefore this is not a common cross ha...
32,710,883
When I try to debug my app in Android Studio I get a gradle error. I have now idea how I can fix it. Does anyone have any ideas or fixes for me so I can continue debugging my app. I googled it already and people are saying the cause could be that there are duplicate imports in the gradle file but I checked this and the...
2015/09/22
[ "https://Stackoverflow.com/questions/32710883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2841903/" ]
Try this : ``` $str = '1.8 to 250'; preg_match_all('!\d+!', $str, $matches); print_r($matches); ``` From this post [Extract numbers from a string](https://stackoverflow.com/questions/6278296/extract-numbers-from-a-string)
Try this: ``` $str = '1.8 to 250'; $string = explode(" ",$str); //print_r($string); for($i = 0;$i < count($string);$i++){ if(is_numeric($string[$i])){ print "\n $string[$i]"; } } ```
49,761,972
Assuming I want to ensure that `myKey` in `{ myKey: '' }` only contains the strings `foo`, `bar`, `baz`, I could achieve this in two ways. ``` // with a String Literal Type type MyKeyType = 'foo' | 'bar' | 'baz'; // or with a String Enum enum MyKeyType { FOO = 'foo', BAR = 'bar', ...
2018/04/10
[ "https://Stackoverflow.com/questions/49761972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6191996/" ]
The key thing to understand is that *the values of string enums are opaque*. The intended use case for a string enum is that you don't want other code to know or care what the literal string backing `MyKeyType.FOO` is. This means that you won't be able to, say, pass the *literal string* `"bar"` to a function accepting...
One benefit for an enum at development time is that you will see the list of options easily via intellisense: [![enter image description here](https://i.stack.imgur.com/X3IJr.png)](https://i.stack.imgur.com/X3IJr.png) Similarly, you could change an enum value easily using refactoring tools, instead of changing a stri...
49,761,972
Assuming I want to ensure that `myKey` in `{ myKey: '' }` only contains the strings `foo`, `bar`, `baz`, I could achieve this in two ways. ``` // with a String Literal Type type MyKeyType = 'foo' | 'bar' | 'baz'; // or with a String Enum enum MyKeyType { FOO = 'foo', BAR = 'bar', ...
2018/04/10
[ "https://Stackoverflow.com/questions/49761972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6191996/" ]
The key thing to understand is that *the values of string enums are opaque*. The intended use case for a string enum is that you don't want other code to know or care what the literal string backing `MyKeyType.FOO` is. This means that you won't be able to, say, pass the *literal string* `"bar"` to a function accepting...
Well, there is a **difference** between string enums and literal types in the transpiled code. Compare the **Typescript** Code ``` // with a String Literal Type type MyKeyType1 = 'foo' | 'bar' | 'baz'; // or with a String Enum enum MyKeyType2 { FOO = 'foo', BAR = 'bar', BAZ = 'baz' } ``` With the **tr...
49,761,972
Assuming I want to ensure that `myKey` in `{ myKey: '' }` only contains the strings `foo`, `bar`, `baz`, I could achieve this in two ways. ``` // with a String Literal Type type MyKeyType = 'foo' | 'bar' | 'baz'; // or with a String Enum enum MyKeyType { FOO = 'foo', BAR = 'bar', ...
2018/04/10
[ "https://Stackoverflow.com/questions/49761972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6191996/" ]
The key thing to understand is that *the values of string enums are opaque*. The intended use case for a string enum is that you don't want other code to know or care what the literal string backing `MyKeyType.FOO` is. This means that you won't be able to, say, pass the *literal string* `"bar"` to a function accepting...
A big downside of enum is that if you use number instead of string, the entirely enum is not safety in my opinion: i can always assign any number value to a variable of this kind ``` enum TYPE {MAN = 1, WOMAN = 2, BOY = 3, GIRL = 4}; let foo: TYPE = TYPE.MAN; foo = 37.14; //no problem for compiler ```