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
966,457
This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#). Please provide a code example with your answer, if possible. Thank you!
2009/06/08
[ "https://Stackoverflow.com/questions/966457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114916/" ]
VB allows nonvirtual calls to virtual instance methods (`call` in IL), whereas C# only allows virtual calls (`callvirt` in IL). Consider the following code: ``` Class Base Public Overridable Sub Foo() Console.WriteLine("Base") End Sub Public Sub InvokeFoo() Me.Foo() MyClass.Foo() ...
In C# you have to assign your variable before you can use it. I think you can turn this off, but it's the default behavior. So something like this: ``` int something; if (something == 10) { ... } ``` Isn't allowed, but the VB equivalent would be.
966,457
This is **code-related** as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in VB don't exist in C#). Please provide a code example with your answer, if possible. Thank you!
2009/06/08
[ "https://Stackoverflow.com/questions/966457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114916/" ]
VB.NET has support for CIL Exception Filters, C# doesn't: ``` Try ... Catch ex As SomeException When ex.SomeProperty = 1 ... End Try ```
Off the top of my head (pre 4.0): VB language "features" not supported in C#: * Optional Parameters * Late Binding * Case insensativity I'm sure there's more. Your question might get better answers if you ask for specific examples of where each language excels. VB is a currently better than C# when interacting with ...
5,253,732
I want to put some restrictions to the images uploaded by the users, so the script that process them never runs out of memory. The images that take more memory, are the ones with higher resolution. They don't need to have a big size in bytes. For example, a 46kb image, with 4000x2500 resolution, and some transparencie...
2011/03/09
[ "https://Stackoverflow.com/questions/5253732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459537/" ]
Generally, the rule of thumb is, width x height x 4 (rgba) for both the source and destination images, and don't forget about the amount of memory the script itself has already consumed.
Using the GD library once the file has been uploaded you can use [getimagesize()](http://www.php.net/manual/en/function.getimagesize.php). You can then check the height and width to determine if you want to process it or return an error, it also returns the number of bits used per color if you want to take that into ac...
49,320,599
Size of data to get: 20,000 approx Issue: searching Elastic Search indexed data using below command in python but not getting any results back. ``` from pyelasticsearch import ElasticSearch es_repo = ElasticSearch(settings.ES_INDEX_URL) search_results = es_repo.search( query, index=advertiser_name, es_fr...
2018/03/16
[ "https://Stackoverflow.com/questions/49320599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2286762/" ]
for real time use the best solution is to use the [search after query](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-search-after.html) . You need only a date field, and another field that uniquely identify a doc - it's enough a `_id` field or an `_uid` field. Try something like this, in...
Probably its [ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html) constraints. ``` index.max_result_window index setting which defaults to 10,000 ```
548,330
I'm trying to better organise a bash script as part of a re-write/re-organisation and am wondering what "best practice" is in the following situation: ``` ymd=`echo "${NOEXT}" | egrep -o -m 1 "\-20[0-9]{2}\-[0-9]{2}\-[0-9]{2}\-"` ``` or ``` ymd=`egrep -o -m 1 "\-20[0-9]{2}\-[0-9]{2}\-[0-9]{2}\-" <<< ${NOEXT}` ```...
2013/02/08
[ "https://superuser.com/questions/548330", "https://superuser.com", "https://superuser.com/users/46739/" ]
The latter doesn't which you can (roughly) verify by looking (on an idle system) at the increase of the PIDs - when running the former, it will increase by 2, when running the latter, it will only increase by 1. But, it's a [Bashism](http://mywiki.wooledge.org/Bashism), and maybe should be replaced with a here documen...
If you can use `bash` and don't require POSIX compatibility, you can do the regular expression match without using the external call to `egrep`. ``` [[ $NOEXT =~ -20[0-9]{2}-[0-9]{2}-[0-9]{2}- ]] ymd=${BASH_REMATCH[0]} ```
13,455,937
TLDR; look at last paragrap. A developer from our partner software company needs to call our WCF (**basic http binding**) service, and he asked us to turn it to asmx for themselves, cause he has trouble with calling it from Oracle. WCF service is being used on different platforms (.net, java, php) with no error. His...
2012/11/19
[ "https://Stackoverflow.com/questions/13455937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/855509/" ]
This is down to the browser and how it interprets the styles, it is somewhat out of your control. However, with particular CSS and jQuery workarounds you should be able to get around it. For instance, if you do not need to the item to be positioned absolutely then you could remove this, or change it to `position:static...
Just remove the `position` style and you will get `auto` instead of computed value. ``` div { top: auto; bottom:20px; right:20px; left:0px; } ``` you can test it [here](http://jsfiddle.net/UEyxD/16/).
13,455,937
TLDR; look at last paragrap. A developer from our partner software company needs to call our WCF (**basic http binding**) service, and he asked us to turn it to asmx for themselves, cause he has trouble with calling it from Oracle. WCF service is being used on different platforms (.net, java, php) with no error. His...
2012/11/19
[ "https://Stackoverflow.com/questions/13455937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/855509/" ]
You Can Get integer Value of top when you set 'auto' with below code: ``` $(function(){ var top = $('div').offset().top; alert(top); });​ ``` * offset Return Position Value When you Set To Auto
Just remove the `position` style and you will get `auto` instead of computed value. ``` div { top: auto; bottom:20px; right:20px; left:0px; } ``` you can test it [here](http://jsfiddle.net/UEyxD/16/).
13,455,937
TLDR; look at last paragrap. A developer from our partner software company needs to call our WCF (**basic http binding**) service, and he asked us to turn it to asmx for themselves, cause he has trouble with calling it from Oracle. WCF service is being used on different platforms (.net, java, php) with no error. His...
2012/11/19
[ "https://Stackoverflow.com/questions/13455937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/855509/" ]
I also had this annoying problem. Some browsers return the computed position if the element is visible at the moment. The trick is to hide it, read the css and then make it visible again (if was not already hidden). I wrote a convenient function that takes care of this and will return `auto` in Firefox. [**jsFiddle*...
Just remove the `position` style and you will get `auto` instead of computed value. ``` div { top: auto; bottom:20px; right:20px; left:0px; } ``` you can test it [here](http://jsfiddle.net/UEyxD/16/).
71,020,450
This regex: `\p{L}+` matches these characters "ASKJKSDJKDSJÄÖÅüé" of the example string "ASKJKSDJK\_-.;,DSJÄÖÅ!”#€%&/()=?`¨’<>üé" which is great but is the exact opposite of what I want. Which leads me to negating regexes. Goal: ===== I want to match any and all characters that are *not a letter nor a number* in mult...
2022/02/07
[ "https://Stackoverflow.com/questions/71020450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/427009/" ]
I created a script to solve your issue. In one folder create a .py file with the following: ``` import os import json files=os.listdir() for file in files: with open(file, "r") as json_file: if os.path.basename(__file__) != file: users = json.load(json_file) unique_users= list({ u...
``` #suppose here we have some json files with names using numbers ranging from 1 to 500 and ending with the extension .json #such as 1.json, 2.json, etc # but not limited to naming files using numbers, # but here I use numbers for convenience only import json from pathlib import Path def load_json(filename): f...
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Check NOAA's [GSHHG](http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html) (Global Self-consistent, Hierarchical, High-resolution Geography Database). The database is constantly being updated and maintained (latest update since Im answering this Q: July 1, 2013) GSHHG is: > > a high-resolution geography data set ama...
GSHHG is definitive your first choice, but depend on the scale you need take also a look at <http://www.naturalearthdata.com/>
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Check NOAA's [GSHHG](http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html) (Global Self-consistent, Hierarchical, High-resolution Geography Database). The database is constantly being updated and maintained (latest update since Im answering this Q: July 1, 2013) GSHHG is: > > a high-resolution geography data set ama...
Check Out <https://osmdata.openstreetmap.de/> for both WSG84 and Mercator Projection.
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Natural Earth would be the place to go. The data is open source and generalised for use at different scales. <http://naturalearthdata.com/downloads/10m-physical-vectors>
Check NOAA's [GSHHG](http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html) (Global Self-consistent, Hierarchical, High-resolution Geography Database). The database is constantly being updated and maintained (latest update since Im answering this Q: July 1, 2013) GSHHG is: > > a high-resolution geography data set ama...
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Check out <https://osmdata.openstreetmap.de/> from Jochen Topf. The data has been derived from OpenStreetMap ways tagged with natural=coastline. See also the data update.
GSHHG is definitive your first choice, but depend on the scale you need take also a look at <http://www.naturalearthdata.com/>
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Natural Earth would be the place to go. The data is open source and generalised for use at different scales. <http://naturalearthdata.com/downloads/10m-physical-vectors>
GSHHG is definitive your first choice, but depend on the scale you need take also a look at <http://www.naturalearthdata.com/>
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Check out <https://osmdata.openstreetmap.de/> from Jochen Topf. The data has been derived from OpenStreetMap ways tagged with natural=coastline. See also the data update.
Check Out <https://osmdata.openstreetmap.de/> for both WSG84 and Mercator Projection.
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Natural Earth would be the place to go. The data is open source and generalised for use at different scales. <http://naturalearthdata.com/downloads/10m-physical-vectors>
Check out <https://osmdata.openstreetmap.de/> from Jochen Topf. The data has been derived from OpenStreetMap ways tagged with natural=coastline. See also the data update.
72,774
Im developing an application to print flight paths on a world map. To do this i need a dataset to describe the latitude and longitude of various coastlines (and country borders if possible) of the world so I can plot them. Is there anywhere on the web I can find this kind of data? (preferably free/cheap) Thanks!
2013/09/28
[ "https://gis.stackexchange.com/questions/72774", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/22430/" ]
Natural Earth would be the place to go. The data is open source and generalised for use at different scales. <http://naturalearthdata.com/downloads/10m-physical-vectors>
Check Out <https://osmdata.openstreetmap.de/> for both WSG84 and Mercator Projection.
23,830,568
I'm trying to make a program that puts the reverse of an array into another array. So, I made a function to do the reverse. And passed the array to be reversed by value. And the array used to store the reverse by reference. But when I run the program it crashes. ``` #include <stdio.h> #include <conio.h> #define size 5...
2014/05/23
[ "https://Stackoverflow.com/questions/23830568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3417785/" ]
DAX has no NULL, it has only BLANK, where BLANK has very different semantics from a SQL NULL. These [two](https://msdn.microsoft.com/en-us/library/ee634820.aspx) [pages](https://msdn.microsoft.com/en-us/library/gg492146.aspx#Anchor_2) might help understanding the semantics of a DAX BLANK. That being said, if you want...
So this is a work around and not an answer to the Question "how to display nulls in PowerPivot using DAX" Instead of doing this in PowerPivot, depending on the complexity of your query it may be easier to replace the nulls in the SQL query first using isnull.
23,830,568
I'm trying to make a program that puts the reverse of an array into another array. So, I made a function to do the reverse. And passed the array to be reversed by value. And the array used to store the reverse by reference. But when I run the program it crashes. ``` #include <stdio.h> #include <conio.h> #define size 5...
2014/05/23
[ "https://Stackoverflow.com/questions/23830568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3417785/" ]
DAX has no NULL, it has only BLANK, where BLANK has very different semantics from a SQL NULL. These [two](https://msdn.microsoft.com/en-us/library/ee634820.aspx) [pages](https://msdn.microsoft.com/en-us/library/gg492146.aspx#Anchor_2) might help understanding the semantics of a DAX BLANK. That being said, if you want...
Even if this post is older... I found the following solution helpful: instead of using e.g. averagex over a set that might contain 0 values, I use sumx()/countrows, where countrows count the rows in the table to which I like to aggregate. Then 0 values are considered. While this works fine to calculate an average, I am...
23,830,568
I'm trying to make a program that puts the reverse of an array into another array. So, I made a function to do the reverse. And passed the array to be reversed by value. And the array used to store the reverse by reference. But when I run the program it crashes. ``` #include <stdio.h> #include <conio.h> #define size 5...
2014/05/23
[ "https://Stackoverflow.com/questions/23830568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3417785/" ]
DAX has no NULL, it has only BLANK, where BLANK has very different semantics from a SQL NULL. These [two](https://msdn.microsoft.com/en-us/library/ee634820.aspx) [pages](https://msdn.microsoft.com/en-us/library/gg492146.aspx#Anchor_2) might help understanding the semantics of a DAX BLANK. That being said, if you want...
Just add 0 (+ 0) to expression in the formula bar
231,661
Could you tell me what’s wrong in this phrase: "In this database, there are failed copies of the file." Is it grammatically correct to write "In this database" at the beggining of a sentence? Thank you.
2015/03/04
[ "https://english.stackexchange.com/questions/231661", "https://english.stackexchange.com", "https://english.stackexchange.com/users/112554/" ]
You can keep the original- * In this database there are failed copies of the file. In this database, there are failed copies of the file. > > or can rephrase it to- > > > * The failed copies of the file are in this database. > > >
I think it's fine. Maybe you can drop that comma if you decide to say: "There are failed copies of the file in this database." Otherwise, I believe it's grammatically correct.
138,489
Every once in a while on a computer I'm ssh'd into, I will accidentally type "cat largefile.txt" and my screen will start rushing with text for the next 10 minutes. I'm always working in a screen session, so my current solution is to just log out and then log back in, and since it can go 100X faster when I'm logged out...
2010/05/06
[ "https://superuser.com/questions/138489", "https://superuser.com", "https://superuser.com/users/5003/" ]
The obviously easy solution would be to not use `cat`. Your shell isn't a text viewer. Use `less` which is designed for this.
If you're using Bash, try `Ctrl`-`z` `kill %` `Enter` What shell are you using? (`Ctrl`-`c` works for me, by the way.)
138,489
Every once in a while on a computer I'm ssh'd into, I will accidentally type "cat largefile.txt" and my screen will start rushing with text for the next 10 minutes. I'm always working in a screen session, so my current solution is to just log out and then log back in, and since it can go 100X faster when I'm logged out...
2010/05/06
[ "https://superuser.com/questions/138489", "https://superuser.com", "https://superuser.com/users/5003/" ]
The obviously easy solution would be to not use `cat`. Your shell isn't a text viewer. Use `less` which is designed for this.
If you start a new `screen` window via `^A ^C`, you will I think be able to "dodge" the oncoming buffer without having to logout & log back in again. It seems that the bottleneck is transmission of the buffer characters to your local terminal; switching to another window should alleviate the need for this effort. Not e...
138,489
Every once in a while on a computer I'm ssh'd into, I will accidentally type "cat largefile.txt" and my screen will start rushing with text for the next 10 minutes. I'm always working in a screen session, so my current solution is to just log out and then log back in, and since it can go 100X faster when I'm logged out...
2010/05/06
[ "https://superuser.com/questions/138489", "https://superuser.com", "https://superuser.com/users/5003/" ]
If you're using Bash, try `Ctrl`-`z` `kill %` `Enter` What shell are you using? (`Ctrl`-`c` works for me, by the way.)
If you start a new `screen` window via `^A ^C`, you will I think be able to "dodge" the oncoming buffer without having to logout & log back in again. It seems that the bottleneck is transmission of the buffer characters to your local terminal; switching to another window should alleviate the need for this effort. Not e...
11,381,168
My fren wants me to develop a website for him for a face-cake bakery. I am supposed to supply a form for users so that they can order cakes and submit the photo to be printed on the cake.Now I need to make a dynamic imaging system that shows the preview of how the cake would look with the image user submitted.. it woul...
2012/07/08
[ "https://Stackoverflow.com/questions/11381168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1509654/" ]
It sounds like you're trying to do two things: 1. Display a user-selected photo on the client side (before it goes to the server). 2. Transform that image so it appears in the correct position on a cake. Both of these functions traditionally fall in the domain of backend processing, but thanks to the HTML5 and CSS3 d...
you can use absolute positioning and 3d transform css, border radius circles with overfow hidden with background none and the image as child element with round cakes. Thats about it.
63,906,657
I am new to git and would like to understand what would happen in the following scenario. I have the following branches: 1. Master Branch (currently deployed to Prod) 2. Enhancement #1 - CleanupUntrackedFiles Branch: This was spawned off of Master. I made updates to the gitignore file to not include particular extensi...
2020/09/15
[ "https://Stackoverflow.com/questions/63906657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11659873/" ]
According to the [GitHub documentation](https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes), the scope for public repositories is `public_repo`, and for private repositories is `repo`. A token with one of those scopes is the most limited access possible for Git push or pull access; howev...
Although it's been two years since the question was asked, there is now a solution from GitHub. GitHub recently introduced a new feature called "fine-grained personal access tokens". <https://github.blog/2022-10-18-introducing-fine-grained-personal-access-tokens-for-github> > > **Personal access tokens** (classic) a...
57,667,410
I have a rails application running on a digital ocean server with IP xxx.xxx.xxx.xx .the deployed with Capistrano was easy now running with ease.Now I'm thinking to deploy another application to the same server using capistrano, After many research i'm not getting any proper solutions for my doubts or cant find any bes...
2019/08/27
[ "https://Stackoverflow.com/questions/57667410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10476417/" ]
For each app, you need to make sure whatever server you are using is listening on a different socket. After that, you have to add another server block in Nginx configurations like below, ``` upstream app_one { # Path to server1 SOCK file } upstream app_two { # Path to server2 SOCK file } server { listen...
For testing purposes or limited-user-count applications you can have as many domains as you wish. You'd simply add to `/etc/hosts` (assuming you have Linux box) ``` NGINX.IP.ADDR.ESS domain-one.com NGINX.IP.ADDR.ESS domain-two.com ``` Then use these server names in corresponding server blocks in your Nginx config fi...
141,750
SQL Server simple problem - ensure that only 1 batch is active at one time. Each batch has an assigned BatchID# - however that ID# might not be unique if a batch is re-run at some point. However, for a given ID# there should only ever be one "active" batch - that is only one batch with BatchComplete equal to NULL. So ...
2016/06/20
[ "https://dba.stackexchange.com/questions/141750", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/98290/" ]
I don't have access to SQL Server so I googled the syntax for generated columns, but there's probably syntax errors in here anyhow. The idea is to use a generated column that has a unique value (BatchNumber) whenever BatchComplete is not null, and a non-unique number (BatchId) otherwise: ``` CREATE TABLE BatchTable (...
You can Use ajax request for checking and in codeigniter has built in function Is\_Unique[databse.table\_name]
24,015
I am looking at a matrix reconstruction algorithm that, given singular values $\sigma\_i$ and quantum states $|u\_i\rangle$ and $|v\_i\rangle$ that are efficiently prepared on a quantum computer, produces a matrix $M$ such that $M=\sum\_i \sigma\_i |u\_i \rangle\langle v\_i|$. It seems like I can do two things: I) Q...
2022/02/09
[ "https://quantumcomputing.stackexchange.com/questions/24015", "https://quantumcomputing.stackexchange.com", "https://quantumcomputing.stackexchange.com/users/19689/" ]
This outer product is, in general, not Hermitian and so does not correspond directly to a physical observable. Taking a lesson from $2\times 2$ matrices (ie from polarimetry), we can measure the two Hermitian observables $$X=|a\rangle\langle b|+|b\rangle\langle a|$$ and $$Y=-i(|a\rangle\langle b|-|b\rangle\langle a|),$...
If you know $|u\_i\rangle\langle v\_i|$ then you can deduce $|u\_i\rangle$ and $|v\_i\rangle$ as well (up to a global phase). So, reconstructing the product can't be easier then reconstruction of the states. But since $|u\_i\rangle$, $|v\_i\rangle$ are real it's enough to use measurements in the standard basis to reco...
44,077,177
I can't find this in the docs or by searching, maybe someone has some tips. I'm trying to check how many connections are on a presence channel on the backend. I can check fine on the front-end with Echo like so: ``` Echo.join('chat') .here((users) => { // users.length is the proper count of connections ...
2017/05/19
[ "https://Stackoverflow.com/questions/44077177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1406734/" ]
If you are using Pusher, the backend can just do the following: ``` $response = $pusher->get( '/channels/presence-channel-name/users' ); if( $response[ 'status'] == 200 ) { // convert to associative array for easier consumption $users = json_decode( $response[ 'body' ], true )[ 'users' ]; } $userCount = count($us...
I don't think it's possible. The channels are between the client (website with JS) and the WebSocket-Server (own NodeJS-Server or the Pusher-Servers). Laravel is just pushing events to them but is never pulling. To find a solution we have to know which driver you are using (redis or pusher). It's maybe possible to ask...
44,077,177
I can't find this in the docs or by searching, maybe someone has some tips. I'm trying to check how many connections are on a presence channel on the backend. I can check fine on the front-end with Echo like so: ``` Echo.join('chat') .here((users) => { // users.length is the proper count of connections ...
2017/05/19
[ "https://Stackoverflow.com/questions/44077177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1406734/" ]
I don't think it's possible. The channels are between the client (website with JS) and the WebSocket-Server (own NodeJS-Server or the Pusher-Servers). Laravel is just pushing events to them but is never pulling. To find a solution we have to know which driver you are using (redis or pusher). It's maybe possible to ask...
Or could be this one as response { "user\_id": "a\_user\_id" "name": "member\_added", // or "member\_removed" "channel": "presence-your\_channel\_name", }
44,077,177
I can't find this in the docs or by searching, maybe someone has some tips. I'm trying to check how many connections are on a presence channel on the backend. I can check fine on the front-end with Echo like so: ``` Echo.join('chat') .here((users) => { // users.length is the proper count of connections ...
2017/05/19
[ "https://Stackoverflow.com/questions/44077177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1406734/" ]
If you are using Pusher, the backend can just do the following: ``` $response = $pusher->get( '/channels/presence-channel-name/users' ); if( $response[ 'status'] == 200 ) { // convert to associative array for easier consumption $users = json_decode( $response[ 'body' ], true )[ 'users' ]; } $userCount = count($us...
Or could be this one as response { "user\_id": "a\_user\_id" "name": "member\_added", // or "member\_removed" "channel": "presence-your\_channel\_name", }
20,318,289
I'm trying to use downloaded custom language for the google's Tesseract OCR engine, it has the following files but no traineddata file, please see my code below which gives me an error only when I try to use the new language, can someone help. files: cp27.DangAmbigs cp27.freq-dawg cp27.inttemp cp27.normpro...
2013/12/01
[ "https://Stackoverflow.com/questions/20318289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987642/" ]
I would probably bind to keyup, then check for space and if it is space I would create a div above the textarea that will have a clickable 'X', something like this (obviously you need some css to make it look nice and you need a container div above your text area with height auto to append your tags to instead of the b...
I almost sure I saw such plugin. Google "jQuery plugin" and you will find that it is already implemented for you...
20,318,289
I'm trying to use downloaded custom language for the google's Tesseract OCR engine, it has the following files but no traineddata file, please see my code below which gives me an error only when I try to use the new language, can someone help. files: cp27.DangAmbigs cp27.freq-dawg cp27.inttemp cp27.normpro...
2013/12/01
[ "https://Stackoverflow.com/questions/20318289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987642/" ]
I almost sure I saw such plugin. Google "jQuery plugin" and you will find that it is already implemented for you...
Did your answer get cut off? Anyway, use something like this: HTML: ``` <div id="tags"></div><input type="text" id="tags-input"/> ``` JavaScript: ``` var tagsInput = $("#tags-input"), tags = $("#tags"); tagsInput.keydown(function(e){ if (e.keyCode == 32) { // when space bar is pressed var tag = $...
20,318,289
I'm trying to use downloaded custom language for the google's Tesseract OCR engine, it has the following files but no traineddata file, please see my code below which gives me an error only when I try to use the new language, can someone help. files: cp27.DangAmbigs cp27.freq-dawg cp27.inttemp cp27.normpro...
2013/12/01
[ "https://Stackoverflow.com/questions/20318289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987642/" ]
I would probably bind to keyup, then check for space and if it is space I would create a div above the textarea that will have a clickable 'X', something like this (obviously you need some css to make it look nice and you need a container div above your text area with height auto to append your tags to instead of the b...
Did your answer get cut off? Anyway, use something like this: HTML: ``` <div id="tags"></div><input type="text" id="tags-input"/> ``` JavaScript: ``` var tagsInput = $("#tags-input"), tags = $("#tags"); tagsInput.keydown(function(e){ if (e.keyCode == 32) { // when space bar is pressed var tag = $...
44,630
I read the Wikipedia article on [DNA methylation](https://en.wikipedia.org/wiki/DNA_methylation) Let's say I want to extract and then stock my current DNA methylation marks somewhere so that I can use it safely 20 years in the future for a medical procedure that doesn't exist yet. What method should I use?
2016/03/26
[ "https://biology.stackexchange.com/questions/44630", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/22779/" ]
To record the current methylation state of your DNA, you can use [bisulfite sequencing](https://en.wikipedia.org/wiki/Bisulfite_sequencing). Basically, you take half of your DNA sample and treat with bisulfite, which deaminates cytosines (C->U) , so they read as T instead of C. Methylated cytosines are protected, so th...
I believe the DNA is going to be as stable in native form as it should be after bisulfite treatment. You can use commercially available methods of storing DNA samples and safely assume it will be intact in 20 years time.
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
You can do remote debugging targeting the Android Browser with the [weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/) project. Or use [Chrome remote debugging](https://developers.google.com/chrome-developer-tools/docs/remote-debugging) with the Chrome for Android browser. As far as I know, you can't target...
It cannot be done, because the debugger backend code is not there. The source code you are referencing to is a copy of webkit source in android, but it is not compiled into android release bits.
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
Now it is easy with Android 4.4. See <https://developers.google.com/chrome-developer-tools/docs/remote-debugging#debugging-webviews>
It cannot be done, because the debugger backend code is not there. The source code you are referencing to is a copy of webkit source in android, but it is not compiled into android release bits.
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
> > **For android >= 4.4 (kitkat)** > > > See [Remote debugging on Android with Chrome](https://developer.chrome.com/devtools/docs/remote-debugging) > > **For android < 4.4 (Lower versions)** > > > Use very good open source tool: [weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/Installing.html)....
It cannot be done, because the debugger backend code is not there. The source code you are referencing to is a copy of webkit source in android, but it is not compiled into android release bits.
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
Now it is easy with Android 4.4. See <https://developers.google.com/chrome-developer-tools/docs/remote-debugging#debugging-webviews>
You can do remote debugging targeting the Android Browser with the [weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/) project. Or use [Chrome remote debugging](https://developers.google.com/chrome-developer-tools/docs/remote-debugging) with the Chrome for Android browser. As far as I know, you can't target...
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
> > **For android >= 4.4 (kitkat)** > > > See [Remote debugging on Android with Chrome](https://developer.chrome.com/devtools/docs/remote-debugging) > > **For android < 4.4 (Lower versions)** > > > Use very good open source tool: [weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/Installing.html)....
You can do remote debugging targeting the Android Browser with the [weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/) project. Or use [Chrome remote debugging](https://developers.google.com/chrome-developer-tools/docs/remote-debugging) with the Chrome for Android browser. As far as I know, you can't target...
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
You can do remote debugging targeting the Android Browser with the [weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/) project. Or use [Chrome remote debugging](https://developers.google.com/chrome-developer-tools/docs/remote-debugging) with the Chrome for Android browser. As far as I know, you can't target...
Pre KitKat [jsHyBugger](https://www.jshybugger.com/#!/) works well ( trial version and annual single user license €29 ) ( I have no connection to the developers / have purchased a license )
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
Now it is easy with Android 4.4. See <https://developers.google.com/chrome-developer-tools/docs/remote-debugging#debugging-webviews>
Pre KitKat [jsHyBugger](https://www.jshybugger.com/#!/) works well ( trial version and annual single user license €29 ) ( I have no connection to the developers / have purchased a license )
13,801,819
I need to inspect javascript execution (webview widget) in an android application, while debugging; through SDK & usb cable and/or http/websockets; from destop computer (e.g. chrome running on desktop). Webkit's sources includes DebuggerServer implementation ( platform\_external\_webkit\Source\WebKit\android\wds\De...
2012/12/10
[ "https://Stackoverflow.com/questions/13801819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1717056/" ]
> > **For android >= 4.4 (kitkat)** > > > See [Remote debugging on Android with Chrome](https://developer.chrome.com/devtools/docs/remote-debugging) > > **For android < 4.4 (Lower versions)** > > > Use very good open source tool: [weinre](http://people.apache.org/~pmuellr/weinre/docs/latest/Installing.html)....
Pre KitKat [jsHyBugger](https://www.jshybugger.com/#!/) works well ( trial version and annual single user license €29 ) ( I have no connection to the developers / have purchased a license )
29,901,913
Honestly it is really hard to explain what I am trying to do because I can't think of words that would help me describe it. Anyway, the problem is that I want to sort a list of lists: ``` [['a', [10, 6, 5]], ['b', [7, 4, 2]], ['c', [10, 6, 4]], ['d', [7, 3, 2]]] ``` This is an example of the list I am trying to sort...
2015/04/27
[ "https://Stackoverflow.com/questions/29901913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4838670/" ]
You can use the `key` argument of the `sorted` function, and sort by the second element of each sublist. This will sort from element 0 to element N for each sublist. And the `reverse` argument is so you can sort highest to lowest (instead of the default lowest to highest) ``` >>> l = [['a', [10, 6, 5]], ['b', [7, 4, 2...
You simply specify a key function that returns all the keys you need. In your case the second element of each list (e.g. `[10, 6, 5]`) does the job since comparing lists compares them element by element. ``` from operator import itemgetter sorted(whatever, key=itemgetter(1), reverse=True) ``` `itemgetter(1)` is the ...
29,901,913
Honestly it is really hard to explain what I am trying to do because I can't think of words that would help me describe it. Anyway, the problem is that I want to sort a list of lists: ``` [['a', [10, 6, 5]], ['b', [7, 4, 2]], ['c', [10, 6, 4]], ['d', [7, 3, 2]]] ``` This is an example of the list I am trying to sort...
2015/04/27
[ "https://Stackoverflow.com/questions/29901913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4838670/" ]
You can use the `key` argument of the `sorted` function, and sort by the second element of each sublist. This will sort from element 0 to element N for each sublist. And the `reverse` argument is so you can sort highest to lowest (instead of the default lowest to highest) ``` >>> l = [['a', [10, 6, 5]], ['b', [7, 4, 2...
* Sorting in reverse order is supported by the python built-in sorted through a third keyword parameter `reverse`. * To solve the other problem, where in, the data is sorted based on score rather than the name, which is not in then natural order, can be solved by specifying a custom key, which is supported through the ...
17,204,632
I would like to achieve 100% coverage on a module. My problem is that there is a variable (called data) within a method which I am trying to inject data in to test my exception handling. Can this be done with mocking? If not how can i fully test my exception handling? ``` module CSV module Extractor class Conversion...
2013/06/20
[ "https://Stackoverflow.com/questions/17204632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1438150/" ]
Extract the code that returns the data to a separate method. Then when you test `open` you can stub out that method to return various strings that will exercise the different branches of the `case` statement. Roughly like this for the setup: ``` def self.get_data(path) `.\\csv2text.exe #{path} -f xml --xml_output_st...
Problem with testing your module lies in the way you have designed your code. Think about splitting extractor into two classes (or modules, it's matter of taste -- I'd go with classes as they are a bit easier to test), of which one would read data from external system call, and second would expect this data to be passe...
16,773,728
i'm having a php code used with jscarousel 2 ``` http://www.egrappler.com/jquery-contentthumbnail-slder-v2-0-jscarousel-v2-0/ ``` to display items from the database as a carousel and having links like this ``` <a id="addtocart" product="<?php echo $productID; ?>" href="#addDiv" >add</a> ``` and a hidden div ``` ...
2013/05/27
[ "https://Stackoverflow.com/questions/16773728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1151715/" ]
What exactly do you want to do? I think the problem is, you are working with IDs. Maybe you should add the "click" event you are using to a class. Every ID may be in a html document just once, so you can just have one element with the ID addtocart. ``` <a href="#addDiv" class="fancybox" product="<?php echo $productID;...
the solution : just used this code at the end of the document.ready ``` $("a.add_to_cart").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic' }); ``` and worked normally but after document.ready makes it doesn't work
22,337,536
I wanted to know what was the best practice followed for storing sensitive fields like email and phone number in the database. Lets say you want to search by email and phone number , and the application sends emails and sms to its users as well. Because this data is sensitive you need to encrypt it. Hashing is not an ...
2014/03/11
[ "https://Stackoverflow.com/questions/22337536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1109467/" ]
**Actually**, encrypting the same message twice with **AES** with the same key and the same initialization vector (IV) will produce the same output - always. **However**, using the same key and the same IV would leak information about the encrypted data. Due to the way **AES** encrypts in blocks of 16 bytes, two emai...
If you want to encrypt your data, place the table on an encrypted filesystem or use a database that provides a facility for encrypted tables. Encrypting data in the database itself would lead to very poor performance for a number of reasons, the most obvious being that a simple table scan (let's say you're looking for...
22,337,536
I wanted to know what was the best practice followed for storing sensitive fields like email and phone number in the database. Lets say you want to search by email and phone number , and the application sends emails and sms to its users as well. Because this data is sensitive you need to encrypt it. Hashing is not an ...
2014/03/11
[ "https://Stackoverflow.com/questions/22337536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1109467/" ]
Check out [CipherSweet](https://github.com/paragonie/ciphersweet/). It's a very permissively-licensed open source library that provides searchable encryption in PHP. Its implementation is *similar* to [Ebbe's answer](https://stackoverflow.com/a/22338530/2224584), but with a lot more caveats: 1. CipherSweet automatica...
If you want to encrypt your data, place the table on an encrypted filesystem or use a database that provides a facility for encrypted tables. Encrypting data in the database itself would lead to very poor performance for a number of reasons, the most obvious being that a simple table scan (let's say you're looking for...
33,416
I have a category with 2 levels. And I want to be able to let the user do a search based on those. The problem is that it needs to be `AND` between all level 1 categories, and `OR` within child categories. So let's say I have a category structure like this: ``` - Elevator - Air condition - View - Ocean - Mountains...
2020/01/15
[ "https://craftcms.stackexchange.com/questions/33416", "https://craftcms.stackexchange.com", "https://craftcms.stackexchange.com/users/968/" ]
If I understand properly, you should be able to do this: ```php $entries = \craft\elements\Entry::find() ->section('yourSection') ->category(['and', 695]) ->relatedTo([698,698])->all(); ``` Assuming `category` is the name of your relational field, you can use that to pass the `and` condition (though with...
Not able to comment, so trying an answer. Did you tried to build a custom hierarchy by scrolling the content of each level in a custom object ?
3,694
How much contact should I expect to have with my literary agent (from a sizeable London firm, representing my first novel)? Are months of silence to be expected/endured? If so...how many?
2011/08/22
[ "https://writers.stackexchange.com/questions/3694", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/2503/" ]
I wasn't going to post an answer for this, but I've got to disagree with Joshin. You're in a business relationship with your agent. You're entitled to respectful business communication. There's a vast difference between you needing your hand held and you needing to know what your business partner is up to. Months of...
If you are really good they'll be happy if you just send them a check on a regular basis. Think of a clerk in a store. Their job is to make sure that when a buyer comes into the store they find what they need. Rarely (if ever) do they contact the guy in China who is making the tools. If you are making tools in Chin...
1,070,154
I bought a new laptop (Lenovo Thinkpad) which came with Windows 10 installed. I threw out the hard disk, replaced it with an SSD and installed Linux on it. Now I put the old hard disk into an USB disk case and tried to boot, but Windows throws an error while booting (the USB disk was recognized properly and also the W...
2016/04/26
[ "https://superuser.com/questions/1070154", "https://superuser.com", "https://superuser.com/users/3052/" ]
Ah, `INACCESSIBLE BOOT DEVICE` seems to be a windows 10 favourite... The first possible solution is outlined below, with an extra twist in case you need it. It seems to work for most people, but as your circumstances are slightly different we will have to see: 1. At the blue screen where the error appears, click Adv...
Windows does not support boot from a USB disk. Instead of booting directly from the external disk, you could use VirtualBox to build a virtual machine that boots from the external USB disk. Here is one reference among the many that can be found : [Using a Physical Hard Drive with a VirtualBox VM](http://www.server...
1,070,154
I bought a new laptop (Lenovo Thinkpad) which came with Windows 10 installed. I threw out the hard disk, replaced it with an SSD and installed Linux on it. Now I put the old hard disk into an USB disk case and tried to boot, but Windows throws an error while booting (the USB disk was recognized properly and also the W...
2016/04/26
[ "https://superuser.com/questions/1070154", "https://superuser.com", "https://superuser.com/users/3052/" ]
Ah, `INACCESSIBLE BOOT DEVICE` seems to be a windows 10 favourite... The first possible solution is outlined below, with an extra twist in case you need it. It seems to work for most people, but as your circumstances are slightly different we will have to see: 1. At the blue screen where the error appears, click Adv...
I fell over this article when I needed a copy of one of my physical machines. It had a hardware failure and I raided the disk, but before that I imaged it. When the replacement machine had a problem and I had to RMA it I wound up with a problem and decided to try and resurrect the original machine. Unfortunately with t...
63,679,919
I am using react router and I have the following code: ``` let history = useHistory(); let goToReviewPage = () => history.push(`review/${productId}`); ``` My current url is: `/foo/bar` and calling `goToReviewPage()` will redirect me to `/foo/review/${productId}` instead of `/foo/bar/review/${productId}` I am not ...
2020/09/01
[ "https://Stackoverflow.com/questions/63679919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1834787/" ]
You can use React Router's `match.url`. Example: ``` const Component = ({ productId }) => { const match = useRouteMatch(); const history = useHistory(); const handleClick = () => { history.push(`${match.url}/review/${productId}`); }; return ( <button onClick={handleClick}>Click me</button> ); }; ...
One way is to use `window.location` to obtain the current path. For example: ``` history.push(window.location.pathname + '/' + `review/${productId}`); ``` [**window.location api**](https://www.w3schools.com/js/js_window_location.asp)
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
`SELECT` statements return the rows of their result sets in an *unpredictable* order unless you give an `ORDER BY` clause. Certain DBMS products give the illusion that their result sets are in a predictable order. But if you rely on that you're bound to be disappointed.
Another solution that I found here. ``` select ID from USER where ID in (5004, 5003, 5005, 5002, 5008) order by decode(ID, 5002, 1, 5003, 2, 5004, 3, 5005, 4, 5008, 5); ``` order by decode(COLUMN NAME, VALUE, POSITION) \*Note: Only need to repeat the VALUE and POSITION And yah, thanks for all the respond...
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
if you want to keep the order as your in list, you can do something like this: ``` SQL> create type user_va as varray(1000) of number; 2 / Type created. SQL> with users as (select /*+ cardinality(a, 10) */ rownum r, a.column_value user_id 2 from table(user_va(11, 0, 19, 5)) a) 3 select d.us...
If your question is about *why the ordering occurs* then the answer is: Do you have an index or primary key defined on the column ID? If yes the database responds to your query with an index scan. That is: it looks up the IDs in the IN clause not in the table itself but in the index defined on your ID-column. Within th...
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
This is one way I've seen in the past using `INSTR`: ``` SELECT * FROM YourTable WHERE ID IN (5004, 5003, 5005, 5002, 5008) ORDER BY INSTR ('5004,5003,5005,5002,5008', id) ``` [SQL Fiddle Demo](http://sqlfiddle.com/#!4/0c283/1) I've also seen use of `CASE` like this: ``` ORDER BY CASE ID WHEN 5004 THEN 1 ...
If your question is about *why the ordering occurs* then the answer is: Do you have an index or primary key defined on the column ID? If yes the database responds to your query with an index scan. That is: it looks up the IDs in the IN clause not in the table itself but in the index defined on your ID-column. Within th...
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
This is one way I've seen in the past using `INSTR`: ``` SELECT * FROM YourTable WHERE ID IN (5004, 5003, 5005, 5002, 5008) ORDER BY INSTR ('5004,5003,5005,5002,5008', id) ``` [SQL Fiddle Demo](http://sqlfiddle.com/#!4/0c283/1) I've also seen use of `CASE` like this: ``` ORDER BY CASE ID WHEN 5004 THEN 1 ...
There is no guarantee of sort order without an ORDER BY clause.
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
`SELECT` statements return the rows of their result sets in an *unpredictable* order unless you give an `ORDER BY` clause. Certain DBMS products give the illusion that their result sets are in a predictable order. But if you rely on that you're bound to be disappointed.
if you want to keep the order as your in list, you can do something like this: ``` SQL> create type user_va as varray(1000) of number; 2 / Type created. SQL> with users as (select /*+ cardinality(a, 10) */ rownum r, a.column_value user_id 2 from table(user_va(11, 0, 19, 5)) a) 3 select d.us...
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
if you want to keep the order as your in list, you can do something like this: ``` SQL> create type user_va as varray(1000) of number; 2 / Type created. SQL> with users as (select /*+ cardinality(a, 10) */ rownum r, a.column_value user_id 2 from table(user_va(11, 0, 19, 5)) a) 3 select d.us...
There is no guarantee of sort order without an ORDER BY clause.
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
`SELECT` statements return the rows of their result sets in an *unpredictable* order unless you give an `ORDER BY` clause. Certain DBMS products give the illusion that their result sets are in a predictable order. But if you rely on that you're bound to be disappointed.
If your question is about *why the ordering occurs* then the answer is: Do you have an index or primary key defined on the column ID? If yes the database responds to your query with an index scan. That is: it looks up the IDs in the IN clause not in the table itself but in the index defined on your ID-column. Within th...
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
This is one way I've seen in the past using `INSTR`: ``` SELECT * FROM YourTable WHERE ID IN (5004, 5003, 5005, 5002, 5008) ORDER BY INSTR ('5004,5003,5005,5002,5008', id) ``` [SQL Fiddle Demo](http://sqlfiddle.com/#!4/0c283/1) I've also seen use of `CASE` like this: ``` ORDER BY CASE ID WHEN 5004 THEN 1 ...
Another solution that I found here. ``` select ID from USER where ID in (5004, 5003, 5005, 5002, 5008) order by decode(ID, 5002, 1, 5003, 2, 5004, 3, 5005, 4, 5008, 5); ``` order by decode(COLUMN NAME, VALUE, POSITION) \*Note: Only need to repeat the VALUE and POSITION And yah, thanks for all the respond...
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
This is one way I've seen in the past using `INSTR`: ``` SELECT * FROM YourTable WHERE ID IN (5004, 5003, 5005, 5002, 5008) ORDER BY INSTR ('5004,5003,5005,5002,5008', id) ``` [SQL Fiddle Demo](http://sqlfiddle.com/#!4/0c283/1) I've also seen use of `CASE` like this: ``` ORDER BY CASE ID WHEN 5004 THEN 1 ...
if you want to keep the order as your in list, you can do something like this: ``` SQL> create type user_va as varray(1000) of number; 2 / Type created. SQL> with users as (select /*+ cardinality(a, 10) */ rownum r, a.column_value user_id 2 from table(user_va(11, 0, 19, 5)) a) 3 select d.us...
15,090,419
May I know is there any solution to get the result without ordering in Oracle? It is because when I execute the query as follows, it seems to automatically helps me to sort it by ID field. ``` SELECT ID FROM USER WHERE ID IN (5004, 5003, 5005, 5002, 5008); Actual results Expected results ---5002 ...
2013/02/26
[ "https://Stackoverflow.com/questions/15090419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2111420/" ]
if you want to keep the order as your in list, you can do something like this: ``` SQL> create type user_va as varray(1000) of number; 2 / Type created. SQL> with users as (select /*+ cardinality(a, 10) */ rownum r, a.column_value user_id 2 from table(user_va(11, 0, 19, 5)) a) 3 select d.us...
Another solution that I found here. ``` select ID from USER where ID in (5004, 5003, 5005, 5002, 5008) order by decode(ID, 5002, 1, 5003, 2, 5004, 3, 5005, 4, 5008, 5); ``` order by decode(COLUMN NAME, VALUE, POSITION) \*Note: Only need to repeat the VALUE and POSITION And yah, thanks for all the respond...
256,359
I read in an American Accent book that there is no break between sibilants adjoining each other between words. For example, this phrase: > > I was starting to worry. > > > The words *was* + *starting* sound like [wə**zs**tɑrt̬ɪŋ] with no break. Am I right? I marked the sibilant sounds with bold. I used the schwa...
2015/07/01
[ "https://english.stackexchange.com/questions/256359", "https://english.stackexchange.com", "https://english.stackexchange.com/users/111955/" ]
Well, there is never a break between words unless you make one. You could say first the word "was", stop making sounds, then say "starting", if you chose to make that break. If there is no period of silence between them, the [zs] pronunciation is just a [z] followed immediately by [s]. If you happen to be an English s...
You are right. Was, despite ending with an 's' sounds like a 'z' with an American speaker no mater where you are. Because of that [wəstɑrt̬ɪŋ] isn't correct. That would only work if both the 's' in "was" and "starting" were pronounced the same. As for the lack of break, that would be correct as well. Even in a lengthen...
62,490
Does Microsoft Virtual PC have any scripting capabilities? I'm trying to automatically launch a web browser inside the VM and have it go to url specified by a parameter.
2009/10/29
[ "https://superuser.com/questions/62490", "https://superuser.com", "https://superuser.com/users/2582/" ]
For "basic" viruses you'll want to boot up in safe mode and delete the executable (you could use Process Explorer, or task manager from Vista onwards, to locate the file), but for more advanced types I always find using Sysinternal's Autoruns to remove their ability to start up (along with any helper applications they ...
99% CPU you say? Sounds like a poorly coded keylogger. Try checking `msconfig` for suspicious startup entries first and foremost. You can use [Process Explorer](http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) to find information about the process itself, and if you have the location of the program, kill ...
62,490
Does Microsoft Virtual PC have any scripting capabilities? I'm trying to automatically launch a web browser inside the VM and have it go to url specified by a parameter.
2009/10/29
[ "https://superuser.com/questions/62490", "https://superuser.com", "https://superuser.com/users/2582/" ]
For "basic" viruses you'll want to boot up in safe mode and delete the executable (you could use Process Explorer, or task manager from Vista onwards, to locate the file), but for more advanced types I always find using Sysinternal's Autoruns to remove their ability to start up (along with any helper applications they ...
My advice would be not to search on Google directly for the executable, but rather to Google for a reliable anti-malware site (e.g. your antivirus vendor, or the other big ones like Symantec etc), then search within their site to see if it's a known issue.
9,364
This will perhaps look like a very basic and trivial question. But I find it confusing. As an experience, when you are travelling in non-AC car in summer, have people felt if putting on or putting off the windowpane affect how much heat it feels inside to passengers. On one hand, I feel that heat can still come inside...
2011/05/02
[ "https://physics.stackexchange.com/questions/9364", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/1093/" ]
A couple of different effects here. A glass windowed box will heat up to considerably more than the outside temperature. Radiation from the sun, as visible and near infrared light, passes easily through the glass - hits the black interior surfaces and heats them up, this in turn heats the air and the glass stops the w...
Keeping your windows closed increases the temperature inside the car because of a greenhouse-like effect. The inside of the car continually receives radiation from the sun, re-emits it to warm the air inside the car but doesn't allow the heated air to leave the car by convection. Hence the car will be considerably hott...
9,364
This will perhaps look like a very basic and trivial question. But I find it confusing. As an experience, when you are travelling in non-AC car in summer, have people felt if putting on or putting off the windowpane affect how much heat it feels inside to passengers. On one hand, I feel that heat can still come inside...
2011/05/02
[ "https://physics.stackexchange.com/questions/9364", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/1093/" ]
A couple of different effects here. A glass windowed box will heat up to considerably more than the outside temperature. Radiation from the sun, as visible and near infrared light, passes easily through the glass - hits the black interior surfaces and heats them up, this in turn heats the air and the glass stops the w...
If the car is in the sun closed windows will trap heat due to two mechanisms. As dbrane says the greenhouse effect is named after onr of these this effects, the radiation comes in at shortwave lengths, and the reradiated thermal energy is partially blocked by the glass. But any dark object in direct sunlight will get s...
16,228,509
I'm exploring the boost asio offerings the client sends a header of 1 byte indicating the length of bytes to follow. relevant server code: ``` enum {max_length=1}; void handle_read(const boost::system::error_code & error, const size_t & bytes_transferred){ if (! error){ ++ctr; std::string inc_data_str(...
2013/04/26
[ "https://Stackoverflow.com/questions/16228509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1411750/" ]
Your client is broken because of buffer lifetime ``` void on_write( const boost::system::error_code& error_code ) { if ( !error_code ) { std::string transfer_data("15"); std::vector<char> v_td(transfer_data.begin(), transfer_data.end()); // ^ // ...
Well, the exception message says, there is a bad lexical cast. I see one in your server code: ``` int size_inc_next = boost::lexical_cast<int>(inc_data_str); ``` Maybe you should put a breakpoint there and debug. When you get the message > > received string: X with size 1 bytes\_transferred: 1 ctr: 159686 > > ...
65,102,314
I am trying to connect to Salesforce using node js / jsforce library and use promises. Unfortunately one of the methods is executing prior to getting connection. i have method A : makeconnection which returns the connection i have method B : which loads data from Salesforce based on the connection reference from metho...
2020/12/02
[ "https://Stackoverflow.com/questions/65102314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14746367/" ]
Here is your fix : ``` <div> <label class="radio" v-for="singleGender in genders"> <input type="radio" v-model="gender" v-bind:value="singleGender.code"> {{singleGender.description}} </label> </div> <div>{{gender}}</div> ``` And here is your data : ``` data: { gender: "M", genders: [ { code: "...
Here is the solution: ``` <template> <div> <label class="radio" v-for="(gender, index) in genders" :key="index"> <input type="radio" :value="gender.code" v-model="selGender" @click="selectedGender(gender.code)" /> {{ gender.description }} </label> </div> </template> <script> export default { ...
65,102,314
I am trying to connect to Salesforce using node js / jsforce library and use promises. Unfortunately one of the methods is executing prior to getting connection. i have method A : makeconnection which returns the connection i have method B : which loads data from Salesforce based on the connection reference from metho...
2020/12/02
[ "https://Stackoverflow.com/questions/65102314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14746367/" ]
Instead of using loops & click event handlers, you can simply use `v-model` to bind your radio options `value` attribute to your vue data's `gender` variable: ``` <div> <label for="male"> <input type="radio" id="male" value="M" v-model="gender">Male </label> <label for="female"> <input type...
Here is the solution: ``` <template> <div> <label class="radio" v-for="(gender, index) in genders" :key="index"> <input type="radio" :value="gender.code" v-model="selGender" @click="selectedGender(gender.code)" /> {{ gender.description }} </label> </div> </template> <script> export default { ...
662,914
I have a very strange issue with PFsense as router running in KVM with CentOS 7. https connections are incredibly slow (10KB/s or less), and uploads over https simply don't work; for example using <https://imgur.com> over https loads, but uploading an image will take minutes, after which it says it failed. I have a d...
2015/01/28
[ "https://serverfault.com/questions/662914", "https://serverfault.com", "https://serverfault.com/users/126695/" ]
It's entirely possible that if you're using pfSense 2.2 or later, you're being affected by [this](https://forum.pfsense.org/index.php?topic=88467.0). Symptoms would include: 1. Slowness for other VMs hosted on the KVM platform if they need to access a network resource which is on the other side of one of the router i...
How is the dual-WAN configured ? Is it in redundancy mode, load balancing or distributed ? This may be the problem if at a point a switch happens between the WANs and the secondary/backup one is a lot slower.
662,914
I have a very strange issue with PFsense as router running in KVM with CentOS 7. https connections are incredibly slow (10KB/s or less), and uploads over https simply don't work; for example using <https://imgur.com> over https loads, but uploading an image will take minutes, after which it says it failed. I have a d...
2015/01/28
[ "https://serverfault.com/questions/662914", "https://serverfault.com", "https://serverfault.com/users/126695/" ]
It's entirely possible that if you're using pfSense 2.2 or later, you're being affected by [this](https://forum.pfsense.org/index.php?topic=88467.0). Symptoms would include: 1. Slowness for other VMs hosted on the KVM platform if they need to access a network resource which is on the other side of one of the router i...
Have you perhaps enabled a setting that penalises "unknown" or encrypted traffic? This setting is usually intended to punish or make the network unusable for file sharing and p2p users, but perhaps pfsense is seeing that https is encrypted and penalising it accordingly.
662,914
I have a very strange issue with PFsense as router running in KVM with CentOS 7. https connections are incredibly slow (10KB/s or less), and uploads over https simply don't work; for example using <https://imgur.com> over https loads, but uploading an image will take minutes, after which it says it failed. I have a d...
2015/01/28
[ "https://serverfault.com/questions/662914", "https://serverfault.com", "https://serverfault.com/users/126695/" ]
It's entirely possible that if you're using pfSense 2.2 or later, you're being affected by [this](https://forum.pfsense.org/index.php?topic=88467.0). Symptoms would include: 1. Slowness for other VMs hosted on the KVM platform if they need to access a network resource which is on the other side of one of the router i...
Please check if you don't have an incorrect ldap/radius server configuration. To test please backup your settings and remove the server. That was the problem in my case.
57,611
I am amused by the story of Beethoven dueling another composer in Vienna, in which he takes the other composer's music, puts it upside down, and proceeds to humiliate him. I feel as though keyboardists with that kind of talent must exist nowadays, but they are perhaps not as popular as they once were. Do we have such ...
2017/05/18
[ "https://music.stackexchange.com/questions/57611", "https://music.stackexchange.com", "https://music.stackexchange.com/users/33712/" ]
The type of keyboard music typically composed during the classical age was so much less complex, and the number of professional musicians was so much smaller, that the comparison cannot be made in any reasonable way. A lot of present-day pianists could probably sight-read the music of a second-rate composer from 1800...
[Jordan Rudess](http://www.jordanrudess.com/) (Dream Theater) is an impressive keyboarder and a true wizard, maybe not quite as famous as Beethoven. He's not only an accomplished piano virtuoso, he's also constantly pushing the boundaries of his instrument, e.g. by controlling and designing sounds in innovative ways su...
57,611
I am amused by the story of Beethoven dueling another composer in Vienna, in which he takes the other composer's music, puts it upside down, and proceeds to humiliate him. I feel as though keyboardists with that kind of talent must exist nowadays, but they are perhaps not as popular as they once were. Do we have such ...
2017/05/18
[ "https://music.stackexchange.com/questions/57611", "https://music.stackexchange.com", "https://music.stackexchange.com/users/33712/" ]
The type of keyboard music typically composed during the classical age was so much less complex, and the number of professional musicians was so much smaller, that the comparison cannot be made in any reasonable way. A lot of present-day pianists could probably sight-read the music of a second-rate composer from 1800...
You should definitely check out keyboardists from progressive rock bands. Prog rock musicians really introduced synthesizers to the popular music/rock scene and elicited really unconventional sounds from those synthesizers. Listen to what they'd done with synthesizers in the 70s, and you'd be amazed. That was 50 years ...
57,611
I am amused by the story of Beethoven dueling another composer in Vienna, in which he takes the other composer's music, puts it upside down, and proceeds to humiliate him. I feel as though keyboardists with that kind of talent must exist nowadays, but they are perhaps not as popular as they once were. Do we have such ...
2017/05/18
[ "https://music.stackexchange.com/questions/57611", "https://music.stackexchange.com", "https://music.stackexchange.com/users/33712/" ]
Keep in mind that the Beethoven "duel" is legend. By legend I don't mean that it didn't happen, only that it's one of those famous stories passed down through the generations, and stories like that only come along once or twice in a lifetime. We certainly still have "rock star" pianists today that you might want to ch...
[Jordan Rudess](http://www.jordanrudess.com/) (Dream Theater) is an impressive keyboarder and a true wizard, maybe not quite as famous as Beethoven. He's not only an accomplished piano virtuoso, he's also constantly pushing the boundaries of his instrument, e.g. by controlling and designing sounds in innovative ways su...
57,611
I am amused by the story of Beethoven dueling another composer in Vienna, in which he takes the other composer's music, puts it upside down, and proceeds to humiliate him. I feel as though keyboardists with that kind of talent must exist nowadays, but they are perhaps not as popular as they once were. Do we have such ...
2017/05/18
[ "https://music.stackexchange.com/questions/57611", "https://music.stackexchange.com", "https://music.stackexchange.com/users/33712/" ]
Keep in mind that the Beethoven "duel" is legend. By legend I don't mean that it didn't happen, only that it's one of those famous stories passed down through the generations, and stories like that only come along once or twice in a lifetime. We certainly still have "rock star" pianists today that you might want to ch...
You should definitely check out keyboardists from progressive rock bands. Prog rock musicians really introduced synthesizers to the popular music/rock scene and elicited really unconventional sounds from those synthesizers. Listen to what they'd done with synthesizers in the 70s, and you'd be amazed. That was 50 years ...
57,611
I am amused by the story of Beethoven dueling another composer in Vienna, in which he takes the other composer's music, puts it upside down, and proceeds to humiliate him. I feel as though keyboardists with that kind of talent must exist nowadays, but they are perhaps not as popular as they once were. Do we have such ...
2017/05/18
[ "https://music.stackexchange.com/questions/57611", "https://music.stackexchange.com", "https://music.stackexchange.com/users/33712/" ]
One of my favorite up-and-coming pianist/composers is Aysedeniz Gokcin. Not yet 30 years old, she's someone who combines a marvelous piano technique with impressive compositional skills. Here's her "Pink Floyd Lisztified," an arrangement of some of Pink Floyd's songs in the manner of Liszt:
[Jordan Rudess](http://www.jordanrudess.com/) (Dream Theater) is an impressive keyboarder and a true wizard, maybe not quite as famous as Beethoven. He's not only an accomplished piano virtuoso, he's also constantly pushing the boundaries of his instrument, e.g. by controlling and designing sounds in innovative ways su...
57,611
I am amused by the story of Beethoven dueling another composer in Vienna, in which he takes the other composer's music, puts it upside down, and proceeds to humiliate him. I feel as though keyboardists with that kind of talent must exist nowadays, but they are perhaps not as popular as they once were. Do we have such ...
2017/05/18
[ "https://music.stackexchange.com/questions/57611", "https://music.stackexchange.com", "https://music.stackexchange.com/users/33712/" ]
You should definitely check out keyboardists from progressive rock bands. Prog rock musicians really introduced synthesizers to the popular music/rock scene and elicited really unconventional sounds from those synthesizers. Listen to what they'd done with synthesizers in the 70s, and you'd be amazed. That was 50 years ...
[Jordan Rudess](http://www.jordanrudess.com/) (Dream Theater) is an impressive keyboarder and a true wizard, maybe not quite as famous as Beethoven. He's not only an accomplished piano virtuoso, he's also constantly pushing the boundaries of his instrument, e.g. by controlling and designing sounds in innovative ways su...
57,611
I am amused by the story of Beethoven dueling another composer in Vienna, in which he takes the other composer's music, puts it upside down, and proceeds to humiliate him. I feel as though keyboardists with that kind of talent must exist nowadays, but they are perhaps not as popular as they once were. Do we have such ...
2017/05/18
[ "https://music.stackexchange.com/questions/57611", "https://music.stackexchange.com", "https://music.stackexchange.com/users/33712/" ]
One of my favorite up-and-coming pianist/composers is Aysedeniz Gokcin. Not yet 30 years old, she's someone who combines a marvelous piano technique with impressive compositional skills. Here's her "Pink Floyd Lisztified," an arrangement of some of Pink Floyd's songs in the manner of Liszt:
You should definitely check out keyboardists from progressive rock bands. Prog rock musicians really introduced synthesizers to the popular music/rock scene and elicited really unconventional sounds from those synthesizers. Listen to what they'd done with synthesizers in the 70s, and you'd be amazed. That was 50 years ...
39,764,579
I have an output that looks like this: ``` colA | colB | Value A | a | 46 A | b | 8979 A | C | 684168468 B | a | 68546841 B | b | 456846 B | c | 468468 C | a | 684684 . | . | . . | . | . ``` The list goes on and on. Colb repeats a sequence of a,b,c, and there c...
2016/09/29
[ "https://Stackoverflow.com/questions/39764579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1658855/" ]
Simple PIVOT: ``` SELECT * FROM YourTable PIVOT (SUM(Value) FOR colB IN (a,b,c)) P ``` --- **Example** ``` WITH Src AS ( SELECT * FROM (VALUES ('A', 'a', 46 ), ('A', 'b', 8979 ), ('A', 'C', 684168468), ('B', 'a', 68546841 ), ('B', 'b', 456846 ), ('B', 'c', 468468 ), ('...
It is also possible to improve Pawel's solution by using [dynamic SQL pivot query](http://www.kodyaz.com/articles/t-sql-dynamic-pivot-table-example-code.aspx) as follows This will take task of you to create the column list from possible data values from second column ``` DECLARE @values varchar(max) SELECT @values = ...
14,394,255
I am reading this article - ~~<http://www.robertsosinski.com/2009/04/28/binding-scope-in-javascript/>~~ - where a custom bind function is made. ``` Function.prototype.bind = function(scope) { var _function = this; return function() { return _function.apply(scope, arguments); } } alice = { name: "alice" }...
2013/01/18
[ "https://Stackoverflow.com/questions/14394255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798635/" ]
``` Why is the return in _function.apply(scope, arguments); there? And what is it doing and what is being returned? I removed that return and it still works. ``` This is there in case you want to return a value. Currently your talk function is not returning any value so you don't need it. if you change your talk fun...
It returns the result of applying the original function (the one being bound). When you make `_function.apply`, the `_function` will be called with `scope` as the context, so inside the function `this` will always refer to the `scope`. The second parameter `arguments` is there to pass all the arguments to the original...
14,394,255
I am reading this article - ~~<http://www.robertsosinski.com/2009/04/28/binding-scope-in-javascript/>~~ - where a custom bind function is made. ``` Function.prototype.bind = function(scope) { var _function = this; return function() { return _function.apply(scope, arguments); } } alice = { name: "alice" }...
2013/01/18
[ "https://Stackoverflow.com/questions/14394255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798635/" ]
``` Why is the return in _function.apply(scope, arguments); there? And what is it doing and what is being returned? I removed that return and it still works. ``` This is there in case you want to return a value. Currently your talk function is not returning any value so you don't need it. if you change your talk fun...
In the return you simply return new function. You close the `scope` and `_function` in the scope of the returned anonymous function. It's called closure - all variables visible in the parent function (the one which return the anonymous one) are visible in the returned function. Here is your example: ``` Function.pro...
14,394,255
I am reading this article - ~~<http://www.robertsosinski.com/2009/04/28/binding-scope-in-javascript/>~~ - where a custom bind function is made. ``` Function.prototype.bind = function(scope) { var _function = this; return function() { return _function.apply(scope, arguments); } } alice = { name: "alice" }...
2013/01/18
[ "https://Stackoverflow.com/questions/14394255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798635/" ]
It returns the result of applying the original function (the one being bound). When you make `_function.apply`, the `_function` will be called with `scope` as the context, so inside the function `this` will always refer to the `scope`. The second parameter `arguments` is there to pass all the arguments to the original...
In the return you simply return new function. You close the `scope` and `_function` in the scope of the returned anonymous function. It's called closure - all variables visible in the parent function (the one which return the anonymous one) are visible in the returned function. Here is your example: ``` Function.pro...
51,593
Every time I open Windows Explorer it is not maximized so I have to double click on the window header. Is there some way to have it open maximized by default?
2009/10/06
[ "https://superuser.com/questions/51593", "https://superuser.com", "https://superuser.com/users/13336/" ]
**Tip #1 - Maximize Window Explorer window from shortcut** ![alt text](https://i.stack.imgur.com/GJwL6.png) **Tip #2 Registry Setting** A little snooping in the registry turns up the MaximizeApps key. I don’t know if this works on all apps or just Windows Explorer but I solved my problem. Find this Key ``` * HKEY_...
Eusing's **[Auto Window Manager](http://www.eusing.com/WindowManager/WindowManager.htm)** will do that (and a lot more useful things) for you. > > **Automatically maximize** or minimize or normal **all new windows you > specify**. > > > Automatically minimize all new windows > you specify to system tray. > > > ...
51,593
Every time I open Windows Explorer it is not maximized so I have to double click on the window header. Is there some way to have it open maximized by default?
2009/10/06
[ "https://superuser.com/questions/51593", "https://superuser.com", "https://superuser.com/users/13336/" ]
**Tip #1 - Maximize Window Explorer window from shortcut** ![alt text](https://i.stack.imgur.com/GJwL6.png) **Tip #2 Registry Setting** A little snooping in the registry turns up the MaximizeApps key. I don’t know if this works on all apps or just Windows Explorer but I solved my problem. Find this Key ``` * HKEY_...
A VBscript that will do the tip #3 of @joe automatically (Windows 8+) ``` Dim WshShell Set WshShell = createObject("Wscript.Shell") WshShell.Run "explorer.exe" Wscript.Sleep 2000 WshShell.AppActivate "File explorer" WshShell.Sleep 2000 WshShell.SendKeys "+%{F4}" Set WshShell = Nothing ``` Set `WshShell.AppActivate` ...
51,593
Every time I open Windows Explorer it is not maximized so I have to double click on the window header. Is there some way to have it open maximized by default?
2009/10/06
[ "https://superuser.com/questions/51593", "https://superuser.com", "https://superuser.com/users/13336/" ]
Eusing's **[Auto Window Manager](http://www.eusing.com/WindowManager/WindowManager.htm)** will do that (and a lot more useful things) for you. > > **Automatically maximize** or minimize or normal **all new windows you > specify**. > > > Automatically minimize all new windows > you specify to system tray. > > > ...
A VBscript that will do the tip #3 of @joe automatically (Windows 8+) ``` Dim WshShell Set WshShell = createObject("Wscript.Shell") WshShell.Run "explorer.exe" Wscript.Sleep 2000 WshShell.AppActivate "File explorer" WshShell.Sleep 2000 WshShell.SendKeys "+%{F4}" Set WshShell = Nothing ``` Set `WshShell.AppActivate` ...
37,744,695
I am trying to get the content of an email I receive using SES. But the response I get is crazy ``` { "notificationType": "Received", "receipt": { "timestamp": "2015-09-11T20:32:33.936Z", "processingTimeMillis": 222, "recipients": [ "recipient@example.com" ], ...
2016/06/10
[ "https://Stackoverflow.com/questions/37744695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820957/" ]
Yes it is ! As an example if you use gmail or another email client, go to view the raw data or source of your mail you'll see about the same thing (a bit different as here its a JSON representation) but emails' content are based on [RFC2045](https://www.rfc-editor.org/rfc/rfc2045) The [Contents of Notifications for A...
This POJO might help: ``` public class SESMessageData { public SESMessageData() { } private String notificationType; private Receipt receipt; private Mail mail; public String getNotificationType() { return notificationType; } public void setNotificationType(String notificationType) { this.notificationTyp...
67,701,715
I need to run tests in different environments : `DEV`, `STAGING`, `PRODUCTION`. And needless to say, the environment variables/secrets for the above environments would obviously be different. I quick solution would be to have an env file for each environment like `dev.env`, `staging.env` & `prod.env` But according to...
2021/05/26
[ "https://Stackoverflow.com/questions/67701715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13889044/" ]
If I understand correctly what they're writing here: **Should I have multiple .env files?** > > No. We strongly recommend against having a "main" .env file and an "environment" .env file like .env.test. Your config should vary between deploys, and you should not be sharing values between environments. > > > This...
In my opinion, it's better to have multiple .env in your project. For example in Symfony, we can configure multiple environment for our project, example: local, dev, prod. it's purpose is to have a more clean and readable code. I'm not sure about over technologies but you can read a little bit about .env in this Symf...
7,327
Rolled aluminum descending rings like the [SMC Descending ring](http://www.innermountainoutfitters.com/descending-ring/) are light *(11g)* and cheap *($3)* which makes them great for carrying and leaving behind on long descents, but in my mind they are disposable pro, you use them once for retrieving your rope after a ...
2014/12/09
[ "https://outdoors.stackexchange.com/questions/7327", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/4148/" ]
No == It is ***not*** ok to use that type of descending ring for fixed anchors. SMC Descending Rings are a one-piece aluminum ring which are intended to be placed at the top of a pull down rappel in place of a carabiner in order to facilitate recovery of ropes. SMC [issues the following](http://www.rocknrescue.com/a...
SMC's site doesn't say anything very helpful but, keep in mind that 14kN is enough to lift a medium sized car. In a rappel only situation, it should last for years. That being said....using 'left gear' is a judgment you should make for yourself. Even if you can't see any defects in a piece of metal, you never know if ...
193,497
My friend recorded some videos on his camcorder, and the one I want to convert is 1.66gb, 1440x1080, 6 audio channels. I want to shrink this down to something like 480x360, and 2 audio channels... or anything small enough that I can upload it to facebook/youtube. I also want to crop out a section of it. I tried ffmpeg...
2010/09/28
[ "https://superuser.com/questions/193497", "https://superuser.com", "https://superuser.com/users/5106/" ]
I'm using the heck out of [HandBrake](http://handbrake.fr/). It's my favorite by far. it will convert MTS. I'm running Win8 /8.1 now. Used it all the time in 7 as well.
Give [MediaCoder](http://www.mediacoderhq.com/) a shot. It should do what you want with a few clicks.
125,759
I've carried out a couple of repairs on my iPhone 5 over the last fortnight, including replacing the screen. I detached the home button from its mounting in the original screen, and placed it in the new screen. It works fine, but I need to glue it to the contact that it sits on top of. What glue does Apple use to do th...
2014/03/27
[ "https://apple.stackexchange.com/questions/125759", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/30215/" ]
I realize this is an older question, but a common problem for several iphone models. Might help someone. The whole assembly is larger than the home button hole. Problem is the round plastic button does come loose from the whole assembly. It is glued in place and can break free. As long as everything is functioning co...
I can't see any mention of glue on the [iFixIt guide to replace the Home button on the iPhone 5](https://www.ifixit.com/Guide/iPhone+5+Home+Button+Replacement/10594), nor on the comments there, or on the list of products or related products on the replacement button ([plastic](https://www.ifixit.com/Store/Parts/iPhone-...
125,759
I've carried out a couple of repairs on my iPhone 5 over the last fortnight, including replacing the screen. I detached the home button from its mounting in the original screen, and placed it in the new screen. It works fine, but I need to glue it to the contact that it sits on top of. What glue does Apple use to do th...
2014/03/27
[ "https://apple.stackexchange.com/questions/125759", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/30215/" ]
I realize this is an older question, but a common problem for several iphone models. Might help someone. The whole assembly is larger than the home button hole. Problem is the round plastic button does come loose from the whole assembly. It is glued in place and can break free. As long as everything is functioning co...
I use 0,5mm thick vhb tape that I cut around the edge of the button on each side. This settles the button in its lodgement, and prevent casual wobbling.
43,291,879
I have a `DatagridTemplateColumn` using a `ComboBox`, but the `ItemSource` will not fill with the bound collection. I should mention that the `DataGrid` is being correctly bound and any other collections in the veiwModel is working, it is just this `ComboBox` in the datagrid does not work. This is the MCVE sample cod...
2017/04/08
[ "https://Stackoverflow.com/questions/43291879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6283475/" ]
I fixed doing this: I Try adding: import {CUSTOM\_ELEMENTS\_SCHEMA} from '@angular/core'; to app.module.ts then i add it to the NgModule Schemas: @NgModule({ schemas: [ CUSTOM\_ELEMENTS\_SCHEMA ]}) that will fix it. Good luck!
Try adding `import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';` to app.module.ts
84,537
***EDIT***: I'm settling for a simpler system: no solar thermal panels; just a small 50 liter water heater, AC powered, run through the inverter. (So, practically no hot water in the winter time.) I'm planning to build an off-grid summer house in southern Finland. The plan includes: * electricity: PV panels + invert...
2016/02/16
[ "https://diy.stackexchange.com/questions/84537", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/50309/" ]
It's quite common, it can be pumped, it's a bit less efficient to pump particularly when cold and somewhat poorer at heat transfer than pure water. Primary impact on service life is minimizing oxygen exposure (sealed system) and choosing a PPG product with a suitable pH/corrosion control additive package.
Since this is a new-build, I would focus really hard on passive solar design. This is a new concept of building, with different materials and practices - it's not a glue-on afterthought to a conventionally built house). This type of design is likely to be earth sheltered, heavily insulated, have huge thermal mass insid...
11,917,086
I have created a JavaScript function which will return data containing 2 URL's. And I would like to insert these into the HTML code. e.g. the return URL values are JavsScript file ``` http://www.domain.com/javascript.js ``` CSS file ``` http://www.domain.com/buttons.css ``` I need to insert these into the code ...
2012/08/11
[ "https://Stackoverflow.com/questions/11917086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/511666/" ]
One of the ways you can do it is suggested in the snippet below obtained from <http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml> --- To load a .js or .css file dynamically, in a nutshell, it means using DOM methods to first create a swanky new "SCRIPT" or "LINK" element, assign it the appropriate attri...
You can easily add nodes to the head element using javascript: ``` link=document.createElement('link'); link.href= your_css_href_function(); link.rel='stylesheet'; link.type='text/css'; document.getElementsByTagName('head')[0].appendChild(link); ``` And the same for your javascript tag: ``` script=document.createE...
11,917,086
I have created a JavaScript function which will return data containing 2 URL's. And I would like to insert these into the HTML code. e.g. the return URL values are JavsScript file ``` http://www.domain.com/javascript.js ``` CSS file ``` http://www.domain.com/buttons.css ``` I need to insert these into the code ...
2012/08/11
[ "https://Stackoverflow.com/questions/11917086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/511666/" ]
You can load external css (and also js) files dynamically using javascript. Just create the appropriate `<link>` element using javascript. ``` var url = computeUrl(); /* Obtain url */ var link = document.createElement('link'); /* Create the link element */ link.setAttribute(...
One of the ways you can do it is suggested in the snippet below obtained from <http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml> --- To load a .js or .css file dynamically, in a nutshell, it means using DOM methods to first create a swanky new "SCRIPT" or "LINK" element, assign it the appropriate attri...