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
1,288
Reference these search results: * ["without plugin"](https://wordpress.stackexchange.com/search?q=%22without%20plugin%22) (27 results) * ["without a plugin"](https://wordpress.stackexchange.com/search?q=%22without%20a%20plugin%22) (84 results) * ["without using a plugin"](https://wordpress.stackexchange.com/search?q=%...
2012/11/17
[ "https://wordpress.meta.stackexchange.com/questions/1288", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/3966/" ]
**This is a good point you raise that has some additional story behind it.** I agree with you that there is a general misconception that surrounds exactly what a plugin is and how they are not that different than a solution without a plugin that might find its way into your standard `functions.php` file. The whole "w...
Let's compare these requests: * Without a plugin please! * I would like answer, explaining internal code mechanics of this. * I had seen plugin accomplishing this, but have trouble following its code and would like it explained. * and so on... The problem is - they are essentially same in what they ask for *technical...
1,288
Reference these search results: * ["without plugin"](https://wordpress.stackexchange.com/search?q=%22without%20plugin%22) (27 results) * ["without a plugin"](https://wordpress.stackexchange.com/search?q=%22without%20a%20plugin%22) (84 results) * ["without using a plugin"](https://wordpress.stackexchange.com/search?q=%...
2012/11/17
[ "https://wordpress.meta.stackexchange.com/questions/1288", "https://wordpress.meta.stackexchange.com", "https://wordpress.meta.stackexchange.com/users/3966/" ]
I don’t see what we can do in these cases: Closing a question which is okay in all other aspects would be too drastic, and editing it out would change the meaning too much. My recommendation: Answer the question, ignore the “without a plugin” part. Our answers are **never** written just for the asker (that would be “t...
**This is a good point you raise that has some additional story behind it.** I agree with you that there is a general misconception that surrounds exactly what a plugin is and how they are not that different than a solution without a plugin that might find its way into your standard `functions.php` file. The whole "w...
6,603,404
Given that pthread\_spin\_lock is available, when would I use it, and when should one not use them ? i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?
2011/07/06
[ "https://Stackoverflow.com/questions/6603404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613821/" ]
The short answer is that a spinlock can be better when you plan to hold the lock for an extremely short interval (for example to do nothing but increment a counter), and contention is expected to be rare, but the operation is occurring often enough to be a potential performance bottleneck. The advantages of a spinlock ...
The spinlock is a "busy waiting" lock. It's main advantage is that it keeps the thread active and won't cause a context switch, so if you know that you will only be waiting for a very short time (because your critical operation is very quick), then this may give better performance than a mutex. Conversely a mutex will ...
6,603,404
Given that pthread\_spin\_lock is available, when would I use it, and when should one not use them ? i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?
2011/07/06
[ "https://Stackoverflow.com/questions/6603404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613821/" ]
The spinlock is a "busy waiting" lock. It's main advantage is that it keeps the thread active and won't cause a context switch, so if you know that you will only be waiting for a very short time (because your critical operation is very quick), then this may give better performance than a mutex. Conversely a mutex will ...
Spinlock has only interest in MP context. It is used to execute pseudo-atomical tasks. In monoprocessor system the principle is the following : 1. Lock the scheduler (if the task deals with interrupts, lock interrupts instead) 2. Do my atomic tack 3. Unlock the scheduler But in MP systems we have no guaranties that a...
6,603,404
Given that pthread\_spin\_lock is available, when would I use it, and when should one not use them ? i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?
2011/07/06
[ "https://Stackoverflow.com/questions/6603404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613821/" ]
The spinlock is a "busy waiting" lock. It's main advantage is that it keeps the thread active and won't cause a context switch, so if you know that you will only be waiting for a very short time (because your critical operation is very quick), then this may give better performance than a mutex. Conversely a mutex will ...
The safest method with a performance boost is a hybrid of the two: an adaptive mutex. When your system has multiple cores you spin for a few thousand cycles to capture the best case of low or no contention, then defer to a full mutex to yield to other threads for long contended locks. Both POSIX (`PTHREAD_MUTEX_ADAPT...
6,603,404
Given that pthread\_spin\_lock is available, when would I use it, and when should one not use them ? i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?
2011/07/06
[ "https://Stackoverflow.com/questions/6603404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613821/" ]
The short answer is that a spinlock can be better when you plan to hold the lock for an extremely short interval (for example to do nothing but increment a counter), and contention is expected to be rare, but the operation is occurring often enough to be a potential performance bottleneck. The advantages of a spinlock ...
Spinlock has only interest in MP context. It is used to execute pseudo-atomical tasks. In monoprocessor system the principle is the following : 1. Lock the scheduler (if the task deals with interrupts, lock interrupts instead) 2. Do my atomic tack 3. Unlock the scheduler But in MP systems we have no guaranties that a...
6,603,404
Given that pthread\_spin\_lock is available, when would I use it, and when should one not use them ? i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?
2011/07/06
[ "https://Stackoverflow.com/questions/6603404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613821/" ]
The short answer is that a spinlock can be better when you plan to hold the lock for an extremely short interval (for example to do nothing but increment a counter), and contention is expected to be rare, but the operation is occurring often enough to be a potential performance bottleneck. The advantages of a spinlock ...
The safest method with a performance boost is a hybrid of the two: an adaptive mutex. When your system has multiple cores you spin for a few thousand cycles to capture the best case of low or no contention, then defer to a full mutex to yield to other threads for long contended locks. Both POSIX (`PTHREAD_MUTEX_ADAPT...
6,603,404
Given that pthread\_spin\_lock is available, when would I use it, and when should one not use them ? i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?
2011/07/06
[ "https://Stackoverflow.com/questions/6603404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613821/" ]
The safest method with a performance boost is a hybrid of the two: an adaptive mutex. When your system has multiple cores you spin for a few thousand cycles to capture the best case of low or no contention, then defer to a full mutex to yield to other threads for long contended locks. Both POSIX (`PTHREAD_MUTEX_ADAPT...
Spinlock has only interest in MP context. It is used to execute pseudo-atomical tasks. In monoprocessor system the principle is the following : 1. Lock the scheduler (if the task deals with interrupts, lock interrupts instead) 2. Do my atomic tack 3. Unlock the scheduler But in MP systems we have no guaranties that a...
5,527,838
I've made a cocoa mac application which needs to check if a serial number/license key is correct, i'm unsure what type of algorithms would be the best for this. Lets say i have this serial number: 4829-1234-4321-1234-4326-5232 or any set of 4 numbers. I was thinking about using an algorithm like if the first set of th...
2011/04/03
[ "https://Stackoverflow.com/questions/5527838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308674/" ]
There are a number of options available in this arena. One option I would consider is implementing partial serial number verification (<http://www.brandonstaggs.com/2007/07/26/implementing-a-partial-serial-number-verification-system-in-delphi/>) The link is written for Delphi developers but the concept is a good one an...
The general idea I've heard is using [public-key cryptography](http://en.wikipedia.org/wiki/Public-key_cryptography). You generate a key pair, and put one of the keys into your application; the other is your private key. You collect a bit of information from a licensee, such as name and email address. You hash that, ...
5,527,838
I've made a cocoa mac application which needs to check if a serial number/license key is correct, i'm unsure what type of algorithms would be the best for this. Lets say i have this serial number: 4829-1234-4321-1234-4326-5232 or any set of 4 numbers. I was thinking about using an algorithm like if the first set of th...
2011/04/03
[ "https://Stackoverflow.com/questions/5527838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/308674/" ]
**Do not** attempt to build a serial number system from scratch without using public key cryptography. It will be child's play to crack it and create a keygen, no matter how convoluted you think your algorithm is. I recommend the [Aquatic Prime](https://github.com/bdrister/AquaticPrime) library which uses public-key e...
The general idea I've heard is using [public-key cryptography](http://en.wikipedia.org/wiki/Public-key_cryptography). You generate a key pair, and put one of the keys into your application; the other is your private key. You collect a bit of information from a licensee, such as name and email address. You hash that, ...
59,321,372
I am using the yii2 grid view - active record to load data. I need to join 3 tables in which each table has more than 100k records with search functionality. Combining these table with large data slow downs the loading of Grid. How to optimize it? ``` $query = ModelName::find(); $query->joinWith(['relationshipTable1'...
2019/12/13
[ "https://Stackoverflow.com/questions/59321372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12530799/" ]
I think I'm not sure about it * try to create a new model * after it fetch you data with join to select the data that you want * finally try to fetch those data in the new model and it will appear in the grid view * to optimize the time don't do the join with model there is three way to write query a procedural way wh...
Check the table’s structure. Add indexes to the the fields that contains the foreign keys on all tables.
24,328,747
I was trying to implement a new method to join two `Array`, returning an `Array` containing a common data type to the other two. To keep it clear, I would expect a way to do something like (knowing that the syntax is not correct...): ``` @infix func + <T,U,X where X super T, X super U>(left : Array<T>, right : Array<...
2014/06/20
[ "https://Stackoverflow.com/questions/24328747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1658749/" ]
Swift's type inference is smarter than you think. The secret is to look at the signature of the nil-coalescing operator `??`: ``` func ??<T>(optional: T?, defaultValue: @autoclosure () -> T) -> T func ??<T>(optional: T?, defaultValue: @autoclosure () -> T?) -> T? ``` It's clear when using this operator that it will ...
You can use the `:` syntax as follows: ``` // The parameter must be a UIViewController, or subclass func changeViewColor<T: UIViewController>(vc: T) { vc.view.backgroundColor = UIColor.redColor() } ```
10,297,554
How to upload an image in Dojo with its ajax call? The url of the image must get stored to the database.Is there anyway to do it?
2012/04/24
[ "https://Stackoverflow.com/questions/10297554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1321663/" ]
Dojo's xhr methods don't support binary data. You might want to use [dojox.form.Uploader](http://dojotoolkit.org/reference-guide/1.7/dojox/form/Uploader.html)
you could try an aproach using a hidden iframe ``` <form enctype="multipart/form-data" target="magicFrame" action="uploader.php"> <input type="file" name="image" /> <input type="submit" /> </form> <iframe name="magicFrame" id="magicFrame" style="display: none" ></iframe> ``` this will achieve the same result...
15,438,791
So I am receiving html from a foreign untrusted source via json. I want to display the html in a div container like so: ``` $('#container').html(dangerousHTMLCode); ``` How can I prevent most importantly javascript injection, and secondary would be altering the styles of the page in general. This is all client side....
2013/03/15
[ "https://Stackoverflow.com/questions/15438791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101909/" ]
OK my first attempt at this was a failure. I agree with Jan Dvorak's comment that the best approach is probably to do this with an XSS tool in a server-side proxy, especially since you're probably having to go through some kind of proxy anyway because you're doing cross-site requests and if you're using JSONP all is lo...
You could use an `iframe` and load the untrusted HTML inside that iframe. The iframe you have would use the `sandbox` attribute to prevent any JavaScript injected inside the iframe to modify the environment outside the iframe. ``` <iframe class="untrusted" src="http://unsafe.example.com/" sandbox /> ``` Or if the un...
85,731
In the following example instead of `\underbrace`, I want to use something like `\text bar\leftarrow j+1\rightarrow\textbar`. `(p_{1},p_{2}\ldots,p_{m-j},\underbrace{m,m,\dots,m}_{j+1})` Is there any similar command?
2012/12/06
[ "https://tex.stackexchange.com/questions/85731", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/14833/" ]
You can use `\underset` from [`amsmath`](http://ctan.org/pkg/amsmath): ![enter image description here](https://i.stack.imgur.com/5Kyae.png) ``` \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} $(p_{1},p_{2}\ldots,p_{m-j},\underbrace{m,m,\dots,m}_{j+1})$ \par $(p_{1},p_{2}\ldo...
If you want to be able to get a bit fancier, there is *always* the `tikz` way. This `\UnderArrow` macro will auto adjust for the longer texts either above or as part of the text below, and also allows you to apply styling to the lines and arrows: ![enter image description here](https://i.stack.imgur.com/2SPYZ.png) Co...
1,248
Bernard von NotHaus (the creator of the [Liberty Dollar](http://en.wikipedia.org/wiki/Liberty_Dollar)) was convicted of violating a U.S. federal law that forbids the minting of a currency by anyone in the U.S. besides the federal government. Might it be claimed that bitcoins are also a currency and their users or creat...
2011/09/25
[ "https://bitcoin.stackexchange.com/questions/1248", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/492/" ]
There are many complementary currencies in use around the United States quite openly and without government interference, including BerkShares, Ithaca Dollars and similar hyper-local currencies, various bartering or time swapping systems like LETS or Time Dollars, etc. The case you are referring to revolved around mint...
There is no evidence to suggest that law applies to Bitcoin. See also [What is the current legal status of Bitcoin?](https://bitcoin.stackexchange.com/questions/131/what-is-the-current-legal-status-of-bitcoin-around-the-world)
1,248
Bernard von NotHaus (the creator of the [Liberty Dollar](http://en.wikipedia.org/wiki/Liberty_Dollar)) was convicted of violating a U.S. federal law that forbids the minting of a currency by anyone in the U.S. besides the federal government. Might it be claimed that bitcoins are also a currency and their users or creat...
2011/09/25
[ "https://bitcoin.stackexchange.com/questions/1248", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/492/" ]
The convictions, currently under appeal, are for * making coins resembling and similar to United States coins * issuing, passing, selling, and possessing Liberty Dollar coins * issuing and passing Liberty Dollar coins intended for use as current money * conspiracy against the United States The essenges of bitcoin is ...
There is no evidence to suggest that law applies to Bitcoin. See also [What is the current legal status of Bitcoin?](https://bitcoin.stackexchange.com/questions/131/what-is-the-current-legal-status-of-bitcoin-around-the-world)
1,248
Bernard von NotHaus (the creator of the [Liberty Dollar](http://en.wikipedia.org/wiki/Liberty_Dollar)) was convicted of violating a U.S. federal law that forbids the minting of a currency by anyone in the U.S. besides the federal government. Might it be claimed that bitcoins are also a currency and their users or creat...
2011/09/25
[ "https://bitcoin.stackexchange.com/questions/1248", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/492/" ]
The court where NotHaus was tried is a District court (trial court). In the US federal system, trial court decisions are *persuasive* authority only - this means that other courts can read them and discuss them and use them as guidance, but they are not required to follow them the way they would be an opinion from a Ci...
There is no evidence to suggest that law applies to Bitcoin. See also [What is the current legal status of Bitcoin?](https://bitcoin.stackexchange.com/questions/131/what-is-the-current-legal-status-of-bitcoin-around-the-world)
1,248
Bernard von NotHaus (the creator of the [Liberty Dollar](http://en.wikipedia.org/wiki/Liberty_Dollar)) was convicted of violating a U.S. federal law that forbids the minting of a currency by anyone in the U.S. besides the federal government. Might it be claimed that bitcoins are also a currency and their users or creat...
2011/09/25
[ "https://bitcoin.stackexchange.com/questions/1248", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/492/" ]
There are many complementary currencies in use around the United States quite openly and without government interference, including BerkShares, Ithaca Dollars and similar hyper-local currencies, various bartering or time swapping systems like LETS or Time Dollars, etc. The case you are referring to revolved around mint...
The court where NotHaus was tried is a District court (trial court). In the US federal system, trial court decisions are *persuasive* authority only - this means that other courts can read them and discuss them and use them as guidance, but they are not required to follow them the way they would be an opinion from a Ci...
1,248
Bernard von NotHaus (the creator of the [Liberty Dollar](http://en.wikipedia.org/wiki/Liberty_Dollar)) was convicted of violating a U.S. federal law that forbids the minting of a currency by anyone in the U.S. besides the federal government. Might it be claimed that bitcoins are also a currency and their users or creat...
2011/09/25
[ "https://bitcoin.stackexchange.com/questions/1248", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/492/" ]
The convictions, currently under appeal, are for * making coins resembling and similar to United States coins * issuing, passing, selling, and possessing Liberty Dollar coins * issuing and passing Liberty Dollar coins intended for use as current money * conspiracy against the United States The essenges of bitcoin is ...
The court where NotHaus was tried is a District court (trial court). In the US federal system, trial court decisions are *persuasive* authority only - this means that other courts can read them and discuss them and use them as guidance, but they are not required to follow them the way they would be an opinion from a Ci...
1,329,292
What I have: ``` n = 5 0, 0, 0, 0, 1000, 0, 0, 0, 0 ``` What I want: ``` 0, 0, 0, 0, 200, 200, 200, 200, 200, 0, 0... ``` So when you see a value in the top row (1000), the bottom row will **evenly** split that value up *n* times until the sum of all the splits equals the original value. I'd prefer to avoid usin...
2018/06/07
[ "https://superuser.com/questions/1329292", "https://superuser.com", "https://superuser.com/users/912414/" ]
EDIT: While the previous, unnecessarily complicated, formula (see [this revision](//superuser.com/revisions/1329380/2)) will still be useful, for example, if a sliding scaling factor were to be needed to be applied to the inputs, I've replaced it in this answer with the new, simpler, much easier to understand version. ...
Code: ``` Sub Divide(n As Integer) Dim temp(), i As Integer, j As Integer, cnt As Integer, tmp ' Copy values from row to array temp = Rows(Selection.Row).Value ' Search for the last cell. Use SpecialCells instead is the better variant. For i = UBound(temp, 2) To LBound(temp, 2) Step -1 If Not IsEmpty(temp(1, i))...
1,329,292
What I have: ``` n = 5 0, 0, 0, 0, 1000, 0, 0, 0, 0 ``` What I want: ``` 0, 0, 0, 0, 200, 200, 200, 200, 200, 0, 0... ``` So when you see a value in the top row (1000), the bottom row will **evenly** split that value up *n* times until the sum of all the splits equals the original value. I'd prefer to avoid usin...
2018/06/07
[ "https://superuser.com/questions/1329292", "https://superuser.com", "https://superuser.com/users/912414/" ]
EDIT: While the previous, unnecessarily complicated, formula (see [this revision](//superuser.com/revisions/1329380/2)) will still be useful, for example, if a sliding scaling factor were to be needed to be applied to the inputs, I've replaced it in this answer with the new, simpler, much easier to understand version. ...
Here is a working solution without the need to use VBA. The only difference is that you would need to add a table somewhere to input each cost individually. I strongly encourage you to do this, as it simplifies calculations a lot, and also adds a lot of clarity financially speaking: you can easily add columns for thi...
24,001,777
I have a custom control in my WPF application, which has an **Apply** button. When the user clicks the button, I want to execute a command on my view-model (business logic), but also I want to perform some events for the user interface. It seems to me that if I use the `Command` property, I can't use the `Click` event...
2014/06/02
[ "https://Stackoverflow.com/questions/24001777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535637/" ]
See [this answer](https://stackoverflow.com/a/4732617/321697) for a detailed description as to why variables referenced in an anonymous inner class must be final. However, in your case there's a simpler solution: ``` holder.checkBox1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(Vie...
Short answer - just copy `ViewHolder` into `final` variable and use it inside `View.OnClickListener`. Like this: ``` final ViewHolder holderRef = holder; holder.checkBox1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub ...
24,001,777
I have a custom control in my WPF application, which has an **Apply** button. When the user clicks the button, I want to execute a command on my view-model (business logic), but also I want to perform some events for the user interface. It seems to me that if I use the `Command` property, I can't use the `Click` event...
2014/06/02
[ "https://Stackoverflow.com/questions/24001777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535637/" ]
Because of the way the anonymous inner classes work, it would need to be final. Considering you seem to want to assign this same functionality to each and every row of your list, I believe what you should do is create a class that implements the OnClickListener interface, and holds a reference to the checkBox of which'...
Short answer - just copy `ViewHolder` into `final` variable and use it inside `View.OnClickListener`. Like this: ``` final ViewHolder holderRef = holder; holder.checkBox1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub ...
24,001,777
I have a custom control in my WPF application, which has an **Apply** button. When the user clicks the button, I want to execute a command on my view-model (business logic), but also I want to perform some events for the user interface. It seems to me that if I use the `Command` property, I can't use the `Click` event...
2014/06/02
[ "https://Stackoverflow.com/questions/24001777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535637/" ]
See [this answer](https://stackoverflow.com/a/4732617/321697) for a detailed description as to why variables referenced in an anonymous inner class must be final. However, in your case there's a simpler solution: ``` holder.checkBox1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(Vie...
If you put `final` in your `holder` object then it will place in the heap. To reduce some memory going to the heap just use only the boolean from the holder as final instead the whole object. **example:** ``` holder.nombre_material.setText(entry.getNombreMaterial()); final boolean isChecked = holder.checkBox1.isChec...
24,001,777
I have a custom control in my WPF application, which has an **Apply** button. When the user clicks the button, I want to execute a command on my view-model (business logic), but also I want to perform some events for the user interface. It seems to me that if I use the `Command` property, I can't use the `Click` event...
2014/06/02
[ "https://Stackoverflow.com/questions/24001777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535637/" ]
Because of the way the anonymous inner classes work, it would need to be final. Considering you seem to want to assign this same functionality to each and every row of your list, I believe what you should do is create a class that implements the OnClickListener interface, and holds a reference to the checkBox of which'...
If you put `final` in your `holder` object then it will place in the heap. To reduce some memory going to the heap just use only the boolean from the holder as final instead the whole object. **example:** ``` holder.nombre_material.setText(entry.getNombreMaterial()); final boolean isChecked = holder.checkBox1.isChec...
24,001,777
I have a custom control in my WPF application, which has an **Apply** button. When the user clicks the button, I want to execute a command on my view-model (business logic), but also I want to perform some events for the user interface. It seems to me that if I use the `Command` property, I can't use the `Click` event...
2014/06/02
[ "https://Stackoverflow.com/questions/24001777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535637/" ]
Because of the way the anonymous inner classes work, it would need to be final. Considering you seem to want to assign this same functionality to each and every row of your list, I believe what you should do is create a class that implements the OnClickListener interface, and holds a reference to the checkBox of which'...
See [this answer](https://stackoverflow.com/a/4732617/321697) for a detailed description as to why variables referenced in an anonymous inner class must be final. However, in your case there's a simpler solution: ``` holder.checkBox1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(Vie...
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Have you considered Java's built-in [`Process`](http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Process.html) class? You can retrieve the exit value of the command and get the output(s) of the shell.
Depending on what you are doing ANT is a good way to go. If you create an ant script you can then execute that script from within java. Ant would also be better supported on other environments
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Looking at the names of the libraries you mentioned, **it seems like you want to run the commands on a remote server using ssh.** Check out <http://code.google.com/p/sshxcute/> Code is pretty easy ``` // Initialize a ConnBean object, parameter list is ip, username, password ConnBean cb = new ConnBean("ip ", "usernam...
Have you considered Java's built-in [`Process`](http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Process.html) class? You can retrieve the exit value of the command and get the output(s) of the shell.
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Try this: <https://github.com/fleipold/jproc> Basic usage: ``` String output = ProcBuilder.run("echo", "Hello World!"); assertEquals("Hello World!\n", output); ```
Is there something wrong with using the `exec()` method? ``` Process p = Runtime.getRuntime().exec("ls -l"); ``` You can read from output of this command by doing the following: ``` BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); ```
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Looking at the names of the libraries you mentioned, **it seems like you want to run the commands on a remote server using ssh.** Check out <http://code.google.com/p/sshxcute/> Code is pretty easy ``` // Initialize a ConnBean object, parameter list is ip, username, password ConnBean cb = new ConnBean("ip ", "usernam...
The [`ProcessBuilder`](http://docs.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html) class in the Java standard library supports creating processes and reading their output. You should be able to build it to do what you need, and being in the standard library, it has pretty good documentation.
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Try this: <https://github.com/fleipold/jproc> Basic usage: ``` String output = ProcBuilder.run("echo", "Hello World!"); assertEquals("Hello World!\n", output); ```
Depending on what you are doing ANT is a good way to go. If you create an ant script you can then execute that script from within java. Ant would also be better supported on other environments
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
The [`ProcessBuilder`](http://docs.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html) class in the Java standard library supports creating processes and reading their output. You should be able to build it to do what you need, and being in the standard library, it has pretty good documentation.
Is there something wrong with using the `exec()` method? ``` Process p = Runtime.getRuntime().exec("ls -l"); ``` You can read from output of this command by doing the following: ``` BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); ```
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Looking at the names of the libraries you mentioned, **it seems like you want to run the commands on a remote server using ssh.** Check out <http://code.google.com/p/sshxcute/> Code is pretty easy ``` // Initialize a ConnBean object, parameter list is ip, username, password ConnBean cb = new ConnBean("ip ", "usernam...
Is there something wrong with using the `exec()` method? ``` Process p = Runtime.getRuntime().exec("ls -l"); ``` You can read from output of this command by doing the following: ``` BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); ```
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Try this: <https://github.com/fleipold/jproc> Basic usage: ``` String output = ProcBuilder.run("echo", "Hello World!"); assertEquals("Hello World!\n", output); ```
If your commands are simple and not interactive, you can run 'em using plain java, as below: ``` Process process = runtime.exec("unix command"); InputStream iStream = process.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(iStream); BufferedReader bufReader = new BufferedReader(inputStrea...
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
Is there something wrong with using the `exec()` method? ``` Process p = Runtime.getRuntime().exec("ls -l"); ``` You can read from output of this command by doing the following: ``` BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); ```
Depending on what you are doing ANT is a good way to go. If you create an ant script you can then execute that script from within java. Ant would also be better supported on other environments
8,995,055
I am looking for libraries that I can use to send Unix commands from my Java code. I have already tried Expect4J and Gaynmed, but could not find good documentation with them. My requirements include: 1. Running multiple commands. 2. Capture output for previous command. 3. Take some action/Run different command based o...
2012/01/24
[ "https://Stackoverflow.com/questions/8995055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473768/" ]
The [`ProcessBuilder`](http://docs.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html) class in the Java standard library supports creating processes and reading their output. You should be able to build it to do what you need, and being in the standard library, it has pretty good documentation.
If your commands are simple and not interactive, you can run 'em using plain java, as below: ``` Process process = runtime.exec("unix command"); InputStream iStream = process.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader(iStream); BufferedReader bufReader = new BufferedReader(inputStrea...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
If you edit video files, set up a stripped RAID 0 configuration for your video files. I noticed significant improvement in the smoothness of video editing after I did this. <http://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_0> Of course you will need a minimum to two hard drives to do this, and it's easier if th...
**ADVANCED, DO NOT DO IF YOU DO NOT KNOW WHAT YOU ARE DOING** Compile your own kernel. <http://www.overclock.net/a/how-to-configure-and-compile-a-custom-linux-kernel-for-ubuntu> It may take quite some time, so do something else while you compile it. Once you're done, install the files and celebrate. Especially if you ...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
> > ### [Disclaimer] Administer the following at your own risk. > > > [Tushar Neupaney](http://linuxfanatic.wordpress.com/author/infobatica/) gives this advices [here](http://linuxfanatic.wordpress.com/2010/03/22/make-your-linux-box-blazing-fast/): **1. Use lighter applications (Replace your default applications ...
Buy as much memory as you can afford and the machine can hold.
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
Set `vm.swappiness=10` in `/etc/sysctl.conf`. I get a noticeable speed improvement when I fill memory. Since I use Eclipse most of the time, physical memory can become a sparse commodity. EDIT: From the [Ubuntu Swap FAQ](https://help.ubuntu.com/community/SwapFaq#What%20is%20swappiness%20and%20how%20do%20I%20change%20...
Close applications that are not used all the time. A lot of standard applications use a lot of memory and often also CPU while they are running in the background. Webbrowser, email clients etc are very inefficient in memory usage and the javascripts embedded often use CPU time with no benefit to the user. Just by onl...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
On one Ubuntu machine I have, I found that setting desktop effects to none (disabling all the graphical effects) made a huge UI speed improvement.
**Configure Swap** Part 1. Set swappiness. This *may* be as per degusa's answer, but it could be the opposite, and it'll have more effect when it is. One scenario that some of us are happy to be in is when we have plenty of RAM. Generally, we've a small percentage of it being directly used by the kernel and applicati...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
Put your /tmp directory into a ram disk <https://superuser.com/questions/175861/ramdisk-ubuntu-10-04>
Found what was slowing down my machine: `gwibber-service`. Maybe because I have an account in twitter that follows a lot of people and when it refreshed the machine went bad. I was monitoring the machine with top as said @kmassada and when it was really slow noticed the process. Then executing: ``` sudo sed -i 's/NoD...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
**RAID for everything!** (I'm experimenting with a lot of tips out there on performance, as the task is teaching me a lot of stuff, and as per the request in the original question, I'll make a separate post for each). If you've more than one drive, you can set up RAID. The pros and cons of different RAID levels is we...
One desktop that I would definitely recommend over Unity, or even XFCE, is **i3**. There's a website for it [here](https://i3wm.org/). I have seen major improvements in performance, even on my netbook with 1GB of RAM.
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
**RAID for everything!** (I'm experimenting with a lot of tips out there on performance, as the task is teaching me a lot of stuff, and as per the request in the original question, I'll make a separate post for each). If you've more than one drive, you can set up RAID. The pros and cons of different RAID levels is we...
I find strange that no one has mentioned anything about Unity. Unity is definitely something that one should consider removing if the system has to work faster (I shall not discuss whether Unity boost the user's productivity or not since this is quite subjective for many people). I just got my hands on a virtual appli...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
Buy as much memory as you can afford and the machine can hold.
**Configure Swap** Part 1. Set swappiness. This *may* be as per degusa's answer, but it could be the opposite, and it'll have more effect when it is. One scenario that some of us are happy to be in is when we have plenty of RAM. Generally, we've a small percentage of it being directly used by the kernel and applicati...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
If you are short of RAM, use [zramswap](http://www.webupd8.org/2011/10/increased-performance-in-linux-with.html) or `zram-config` from Ubuntu repos. It's virtual swap that compresses unused RAM contents instead of putting them to disk (which usually freezes the system after you hit the RAM barrier). I experience little...
Tuning ext4 for maximum smoke ============================= Enable writeback mode. This mode will typically provide the best ext4 performance. Note that it happens at cost of reliability as it disables journaling for writing data. Data may be written into the main filesystem after its metadata has been committed to th...
2,194
What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster. This is not meant to be ap...
2010/08/13
[ "https://askubuntu.com/questions/2194", "https://askubuntu.com", "https://askubuntu.com/users/431/" ]
1. Use **JFS** filesystem. It's *rock solid*. It has *lowest CPU usage* and a very good overall performance. 2. Set vm.vfs\_cache\_pressure. This is my /etc/sysctl.d/10-desktop-responsiveness [prefix the comment lines with a #, this web interface does not like them...] These settings increase responsiveness for a typ...
The ubuntu-tweak utility has a handy "Janitor" tool that allows you to clear caches and orphan packages very easily. ``` sudo apt-get install ubuntu-tweak ``` Note that as of 2016-04-16 Ubuntu Tweak is abandoned, with last update over year ago - see <https://github.com/tualatrix/ubuntu-tweak> (what makes <http://bl...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
While the linked video is explained as an amateur (high school) orchestra in which the musicians haven't fully developed their intonation, there are situations in which classical musicians play deliberately out of tune. (Of course, since they typically do this at the composer's instruction, one could say they really ar...
Aside from what Aaron already said(which is all correct), there is a certain practice that some people frown upon, but many others think it's fine. In instruments that can manipulate their intonation on the spot, like the violin, a soloist might sharpen or flatten tendency tones to create stronger tension/desire to the...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
While the linked video is explained as an amateur (high school) orchestra in which the musicians haven't fully developed their intonation, there are situations in which classical musicians play deliberately out of tune. (Of course, since they typically do this at the composer's instruction, one could say they really ar...
All that, with no conductor in sight! I'd put it down to possibly not enough rehearsal time, or an inexperienced orchestra. There's always this sort of intonation/tuning problem with either. Playing in tune with other strings takes years to get right - playing one string instrument by itself in tune is enough of a cha...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
While the linked video is explained as an amateur (high school) orchestra in which the musicians haven't fully developed their intonation, there are situations in which classical musicians play deliberately out of tune. (Of course, since they typically do this at the composer's instruction, one could say they really ar...
The other answers have given lots of reasons why classical musicians might go off pitch. But in this case, most of the issue is simply as Todd Wilcox and Tim wrote: the orchester is inexperienced, they didn't mean to play out of tune, still it happened. But I would say a bit more about that, more as an apology on beha...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
While the linked video is explained as an amateur (high school) orchestra in which the musicians haven't fully developed their intonation, there are situations in which classical musicians play deliberately out of tune. (Of course, since they typically do this at the composer's instruction, one could say they really ar...
Yes it is a thing. If you go into modern practice of old music (baroque and prior) it is quite common to see intentional out-of-tuneness for effect. And even more that that slight shifts from intonation can influence the character of a piece and are thus rather common. But in this case this is simply because these are ...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
While the linked video is explained as an amateur (high school) orchestra in which the musicians haven't fully developed their intonation, there are situations in which classical musicians play deliberately out of tune. (Of course, since they typically do this at the composer's instruction, one could say they really ar...
Another example of deliberately playing out of tune I'd like to bring to the table is perhaps one of the most stunning pieces on the classical guitar: Nikita Koshkin's *Usher Waltz*. This piece was inspired by the novel *The Fall of the House of Usher*, and the composer deliberately wrote out of tune passages to showca...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
Aside from what Aaron already said(which is all correct), there is a certain practice that some people frown upon, but many others think it's fine. In instruments that can manipulate their intonation on the spot, like the violin, a soloist might sharpen or flatten tendency tones to create stronger tension/desire to the...
Yes it is a thing. If you go into modern practice of old music (baroque and prior) it is quite common to see intentional out-of-tuneness for effect. And even more that that slight shifts from intonation can influence the character of a piece and are thus rather common. But in this case this is simply because these are ...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
All that, with no conductor in sight! I'd put it down to possibly not enough rehearsal time, or an inexperienced orchestra. There's always this sort of intonation/tuning problem with either. Playing in tune with other strings takes years to get right - playing one string instrument by itself in tune is enough of a cha...
Yes it is a thing. If you go into modern practice of old music (baroque and prior) it is quite common to see intentional out-of-tuneness for effect. And even more that that slight shifts from intonation can influence the character of a piece and are thus rather common. But in this case this is simply because these are ...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
The other answers have given lots of reasons why classical musicians might go off pitch. But in this case, most of the issue is simply as Todd Wilcox and Tim wrote: the orchester is inexperienced, they didn't mean to play out of tune, still it happened. But I would say a bit more about that, more as an apology on beha...
Yes it is a thing. If you go into modern practice of old music (baroque and prior) it is quite common to see intentional out-of-tuneness for effect. And even more that that slight shifts from intonation can influence the character of a piece and are thus rather common. But in this case this is simply because these are ...
127,235
Can anyone explain to me what's going on?: I am not and have never been a professional classical musician, but I don't think you need to be one to see that something is definitely wrong here — starting from the very intro by cello and then throughout the whole piece. And I am more than assured that performers themselv...
2023/02/03
[ "https://music.stackexchange.com/questions/127235", "https://music.stackexchange.com", "https://music.stackexchange.com/users/82163/" ]
Another example of deliberately playing out of tune I'd like to bring to the table is perhaps one of the most stunning pieces on the classical guitar: Nikita Koshkin's *Usher Waltz*. This piece was inspired by the novel *The Fall of the House of Usher*, and the composer deliberately wrote out of tune passages to showca...
Yes it is a thing. If you go into modern practice of old music (baroque and prior) it is quite common to see intentional out-of-tuneness for effect. And even more that that slight shifts from intonation can influence the character of a piece and are thus rather common. But in this case this is simply because these are ...
47,623,836
It looks that I came to the dead end. Is there any way to run scrapy spider inside asyncio loop? For example in the code below: ``` import asyncio from scrapy.crawler import CrawlerProcess from myscrapy import MySpider import scrapy async def do_some_work(): process = CrawlerProcess() await process.crawl(MySp...
2017/12/03
[ "https://Stackoverflow.com/questions/47623836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7366334/" ]
Scrapy does not currently support the `async` syntax. If you need to run Scrapy within asyncio-based code, you need to [run Scrapy as a script](http://doc.scrapy.org/en/latest/topics/practices.html#run-scrapy-from-a-script) it just as you would run any other synchronous code within an asynchronous function. That said...
The entire scrapy is synchronous code. No asynchronous mechanism(coroutine) to turn the running resource back to select loop whenever a blocking happen. The major blockings are the network requests. the libs scrapy uses don't support asyncio. So maybe you open the scrapy source code to implement asyncio or aiohttp to ...
77,881
I've to do a generic method `Classify<T>` that, given a sequence of elements of type `T` and an arbitrary number of predicates, returns an array of `n+1` lists (where `n` is the number of the predicates). More precisely, if the element satisfies the first predicate then it is added to the first list. If not, then if th...
2015/01/18
[ "https://codereview.stackexchange.com/questions/77881", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/63256/" ]
``` public List<T>[] Classify<T>(IEnumerable<T> sequence, params Predicate<T>[] predicates) { var result = new List<T>[predicates.Length + 1]; // It's clearer to create elements of the array explicitly for (int i = 0; i < result.Length; i++) result[i] = new List<T>(); foreach (var elem in seque...
The idea is to group the elements in the sequence by the predicate they satisfy (line 10) and return an array (line 12) of lists containing the elements in each group (line 11). This is one way to find the predicate index for the first predicate that is satisfied by an element (line 7): `predicates.TakeWhile(p => !p(...
77,881
I've to do a generic method `Classify<T>` that, given a sequence of elements of type `T` and an arbitrary number of predicates, returns an array of `n+1` lists (where `n` is the number of the predicates). More precisely, if the element satisfies the first predicate then it is added to the first list. If not, then if th...
2015/01/18
[ "https://codereview.stackexchange.com/questions/77881", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/63256/" ]
The idea is to group the elements in the sequence by the predicate they satisfy (line 10) and return an array (line 12) of lists containing the elements in each group (line 11). This is one way to find the predicate index for the first predicate that is satisfied by an element (line 7): `predicates.TakeWhile(p => !p(...
The Linq answers are readable (well maybe not Jon's :-) ) but they're all slower than the OP's original code. I started with the intention to write a semi-Linq solution that was readable, but faster than the original, however, Linq, and copying arrays,# is slow :-( In the end, I found this, which is readable, about 10...
77,881
I've to do a generic method `Classify<T>` that, given a sequence of elements of type `T` and an arbitrary number of predicates, returns an array of `n+1` lists (where `n` is the number of the predicates). More precisely, if the element satisfies the first predicate then it is added to the first list. If not, then if th...
2015/01/18
[ "https://codereview.stackexchange.com/questions/77881", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/63256/" ]
``` public List<T>[] Classify<T>(IEnumerable<T> sequence, params Predicate<T>[] predicates) { var result = new List<T>[predicates.Length + 1]; // It's clearer to create elements of the array explicitly for (int i = 0; i < result.Length; i++) result[i] = new List<T>(); foreach (var elem in seque...
There are many ways to strike the balance between LINQ and straight procedural code; the [answer by Mark](https://codereview.stackexchange.com/a/77887/7328) IMO strikes a very good balance between being succinct and easily understandable. That said you can do this without any procedural code (just LINQ methods) and ha...
77,881
I've to do a generic method `Classify<T>` that, given a sequence of elements of type `T` and an arbitrary number of predicates, returns an array of `n+1` lists (where `n` is the number of the predicates). More precisely, if the element satisfies the first predicate then it is added to the first list. If not, then if th...
2015/01/18
[ "https://codereview.stackexchange.com/questions/77881", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/63256/" ]
``` public List<T>[] Classify<T>(IEnumerable<T> sequence, params Predicate<T>[] predicates) { var result = new List<T>[predicates.Length + 1]; // It's clearer to create elements of the array explicitly for (int i = 0; i < result.Length; i++) result[i] = new List<T>(); foreach (var elem in seque...
The Linq answers are readable (well maybe not Jon's :-) ) but they're all slower than the OP's original code. I started with the intention to write a semi-Linq solution that was readable, but faster than the original, however, Linq, and copying arrays,# is slow :-( In the end, I found this, which is readable, about 10...
77,881
I've to do a generic method `Classify<T>` that, given a sequence of elements of type `T` and an arbitrary number of predicates, returns an array of `n+1` lists (where `n` is the number of the predicates). More precisely, if the element satisfies the first predicate then it is added to the first list. If not, then if th...
2015/01/18
[ "https://codereview.stackexchange.com/questions/77881", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/63256/" ]
There are many ways to strike the balance between LINQ and straight procedural code; the [answer by Mark](https://codereview.stackexchange.com/a/77887/7328) IMO strikes a very good balance between being succinct and easily understandable. That said you can do this without any procedural code (just LINQ methods) and ha...
The Linq answers are readable (well maybe not Jon's :-) ) but they're all slower than the OP's original code. I started with the intention to write a semi-Linq solution that was readable, but faster than the original, however, Linq, and copying arrays,# is slow :-( In the end, I found this, which is readable, about 10...
44,676,332
``` if (rbMale.Checked == false && rbFemale.Checked == false) { flag = true; e.Cancel = true; groupBox1.Focus(); errorProvider1.SetError(groupBox1, "Please Select the gender"); } else { e.Cancel = false; errorProvi...
2017/06/21
[ "https://Stackoverflow.com/questions/44676332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8066267/" ]
You can execute your second query as the parameter in the system proc, `sp_MSforeachdb` ``` EXECUTE master.sys.sp_MSforeachdb 'select TABLE_CATALOG,TABLE_NAME, COLUMN_NAME, DATA_TYPE from [?].INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = ''A_SPECIFIC_TABLE_NAME'' ' ``` If you want to filter for only certain database...
Use a dynamic sql in a loop to fetch DB Names or use dynamic sql with cursor Method 1: Using Loop ``` Declare @ssql nvarchar(max),@DBName varchar(100),@rowcount int,@datatype varchar(10) Create table #temp(id int identity(1,1) ,DBName varchar(100)) set @rowcount=0 set @datatype='int' Insert into #temp(DBName) SELE...
44,676,332
``` if (rbMale.Checked == false && rbFemale.Checked == false) { flag = true; e.Cancel = true; groupBox1.Focus(); errorProvider1.SetError(groupBox1, "Please Select the gender"); } else { e.Cancel = false; errorProvi...
2017/06/21
[ "https://Stackoverflow.com/questions/44676332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8066267/" ]
Here is another option that doesn't use any loops or cursors. I am using sys.database to generate a single select statement. Unless you have a LOT of databases this isn't going to be much, if any, performance boost over a loop based solution. But I really dislike cursors and loops and this is a fairly simple way to bui...
Use a dynamic sql in a loop to fetch DB Names or use dynamic sql with cursor Method 1: Using Loop ``` Declare @ssql nvarchar(max),@DBName varchar(100),@rowcount int,@datatype varchar(10) Create table #temp(id int identity(1,1) ,DBName varchar(100)) set @rowcount=0 set @datatype='int' Insert into #temp(DBName) SELE...
53,137,310
I am aware of three ways of writing subqueries into a query. * Normal subquery * With clause * Temporary table Subqueries get extremely messy when there are multiples of them in a query, and especially when you have nested subqueries. With clause is my preference, but you can only use the subqueries in a WITH clause...
2018/11/04
[ "https://Stackoverflow.com/questions/53137310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7147255/" ]
You need to use chaining. ``` $sub_1 = $data->find('td', 2)->find('td',1)->plaintext; $sub_2 = $data->find('td', 2)->find('td',2)->plaintext; ```
The following code will convert each `div` into an array and then strip the HTML code. ``` $cell_three = $data->find('td', 2)->innertext; $cell_three = explode("</div>", $cell_three); $cell_three = array_map(function($v){ return trim(strip_tags($v)); }, $cell_three); ``` Then you just loop over the array. ``` f...
4,222,741
Newbie here...easy question for you pro outthere How to put a button on a htmlpage that says E-mail here, and then the simplemodal contactform pop up (just like in the demo) Can't get it right with the link... :( Regards /Pia
2010/11/19
[ "https://Stackoverflow.com/questions/4222741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/513154/" ]
Give `<p>` an ID and you're on your way: ``` <p id='p1'>content...</p> ``` Javascript: ``` var text = document.getElementById('p1').innerHTML; text = text.replace("c","x"); ... document.getElementById('p1').innerHTML = text; ``` **EDIT** To target all `<p>`s, do as you said: ``` var allPs = document.getElements...
Use regular expressions and chain multiple replace's together: ``` window.onload = function() { var string = document.getElementsByTagName("p")[0].innerHTML; var replacedString = string.replace(/somespecialchar/gi, "replaceWith").replace(/someotherspecialchar/gi, "replaceWith").replace(/anotherchar/gi, "repla...
81,700
I want to take some video of a friend with a motor disorder while he is sleeping. We are doing this to help get information about what happens while he sleeps. I have a tripod and set up my iPad to video tape. But as soon as I turned off the light, the iPad could record nothing. I thought the iPad camera mode might h...
2016/08/05
[ "https://photo.stackexchange.com/questions/81700", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/54008/" ]
If trying other cards has not worked ([as indicated in comments](https://photo.stackexchange.com/q/81698/75526#comment140065_81698)), then the problem is not the card, it's the camera. You will need to get it repaired or at very least disassembled and cleaned by a specialist.
It might be the card, it might be the camera. Check for dirty contacts on both. If that doesn't help, try the card in a card reader attached to a computer, try a different card in the camera. Now you know where the problem lies, yes? If it's the card (and the pictures on it matter) there is free software that MIGHT be ...
81,700
I want to take some video of a friend with a motor disorder while he is sleeping. We are doing this to help get information about what happens while he sleeps. I have a tripod and set up my iPad to video tape. But as soon as I turned off the light, the iPad could record nothing. I thought the iPad camera mode might h...
2016/08/05
[ "https://photo.stackexchange.com/questions/81700", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/54008/" ]
If trying other cards has not worked ([as indicated in comments](https://photo.stackexchange.com/q/81698/75526#comment140065_81698)), then the problem is not the card, it's the camera. You will need to get it repaired or at very least disassembled and cleaned by a specialist.
I was dealing with the exact same problem. I took a Q-Tip and wiped the contacts off on the card. Worked like a champ!! The camera would read other cards and my computer would read the one the camera didn't like. So give it a try. Seems the camera may be a little more sensitive to the condition of the contacts. Good Lu...
81,700
I want to take some video of a friend with a motor disorder while he is sleeping. We are doing this to help get information about what happens while he sleeps. I have a tripod and set up my iPad to video tape. But as soon as I turned off the light, the iPad could record nothing. I thought the iPad camera mode might h...
2016/08/05
[ "https://photo.stackexchange.com/questions/81700", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/54008/" ]
> > We had this happen to our 6D and it was the circuit board. Sent to > Canon for repair and $400 - $600 later it came back working. I > believe on this occasion they should have ate the cost, but it wasn't > my camera and I didn't handle the return. > > > ***Here are some things we checked before sending in f...
It might be the card, it might be the camera. Check for dirty contacts on both. If that doesn't help, try the card in a card reader attached to a computer, try a different card in the camera. Now you know where the problem lies, yes? If it's the card (and the pictures on it matter) there is free software that MIGHT be ...
81,700
I want to take some video of a friend with a motor disorder while he is sleeping. We are doing this to help get information about what happens while he sleeps. I have a tripod and set up my iPad to video tape. But as soon as I turned off the light, the iPad could record nothing. I thought the iPad camera mode might h...
2016/08/05
[ "https://photo.stackexchange.com/questions/81700", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/54008/" ]
> > We had this happen to our 6D and it was the circuit board. Sent to > Canon for repair and $400 - $600 later it came back working. I > believe on this occasion they should have ate the cost, but it wasn't > my camera and I didn't handle the return. > > > ***Here are some things we checked before sending in f...
I was dealing with the exact same problem. I took a Q-Tip and wiped the contacts off on the card. Worked like a champ!! The camera would read other cards and my computer would read the one the camera didn't like. So give it a try. Seems the camera may be a little more sensitive to the condition of the contacts. Good Lu...
38,969
I want to replace b by a in visual selection. I have vimscript like this: ``` execute("normal! vip:s/a/b/g") ``` It works in command line mode. But not work in vimscript. How to fix it? How to replace the text directly on original text in vimscript?
2022/10/22
[ "https://vi.stackexchange.com/questions/38969", "https://vi.stackexchange.com", "https://vi.stackexchange.com/users/8747/" ]
I would do: ``` execute 'normal! vip' | s/a/b/g ```
I would probably write ``` '{,'}substitute/a/b/g ``` in a function.
27,372,660
I have the below code where I am trying to show alert when I click on label. But Even input items are firing because of same for attribute. How can make label click event fire? I tried some thing like $('label[for="CurrentMonth"]').click(function (e) { but it did not work. Any suggestions ``` <label class="labelHelp"...
2014/12/09
[ "https://Stackoverflow.com/questions/27372660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041205/" ]
Try with using return false. ``` $('[for="CurrentMonth"]').click(function (e) { alert("I clicked only on label"); return false; }); ``` check this link for more understanding: <http://saswal.wordpress.com/2014/07/09/event-preventdefault-event-stoppropagation-return-fal...
Well I have checked and test your code it is working perfectly. you can also check either you you have not put all you code or missing something. Please post your all code and see this example: <http://jsfiddle.net/5drc0xze/> HTML ``` <label class="labelHelp" for="CurrentMonth">Current Month</label> <input name="Cu...
27,372,660
I have the below code where I am trying to show alert when I click on label. But Even input items are firing because of same for attribute. How can make label click event fire? I tried some thing like $('label[for="CurrentMonth"]').click(function (e) { but it did not work. Any suggestions ``` <label class="labelHelp"...
2014/12/09
[ "https://Stackoverflow.com/questions/27372660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041205/" ]
Try with using return false. ``` $('[for="CurrentMonth"]').click(function (e) { alert("I clicked only on label"); return false; }); ``` check this link for more understanding: <http://saswal.wordpress.com/2014/07/09/event-preventdefault-event-stoppropagation-return-fal...
You should wrap the event handling inside document.getready method you code itself works like charm , check here <http://jsfiddle.net/0vn60ccL/> ``` $(document).ready(function(){ $('[for="CurrentMonth"]').click(function (e) { e.stopPropagation(); alert("I clicked only on label"); }); }); ``` Cur...
27,372,660
I have the below code where I am trying to show alert when I click on label. But Even input items are firing because of same for attribute. How can make label click event fire? I tried some thing like $('label[for="CurrentMonth"]').click(function (e) { but it did not work. Any suggestions ``` <label class="labelHelp"...
2014/12/09
[ "https://Stackoverflow.com/questions/27372660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041205/" ]
Your code as it stands should work. Your selection should only match an element with the for attribute set to "CurrentMonth". This [jsfiddle](http://jsfiddle.net/s8gs3Lvf/) shows that clicking on the Current Month label causes the click to fire, but clicking on the input text, or a different label does not. ``` <label...
Well I have checked and test your code it is working perfectly. you can also check either you you have not put all you code or missing something. Please post your all code and see this example: <http://jsfiddle.net/5drc0xze/> HTML ``` <label class="labelHelp" for="CurrentMonth">Current Month</label> <input name="Cu...
27,372,660
I have the below code where I am trying to show alert when I click on label. But Even input items are firing because of same for attribute. How can make label click event fire? I tried some thing like $('label[for="CurrentMonth"]').click(function (e) { but it did not work. Any suggestions ``` <label class="labelHelp"...
2014/12/09
[ "https://Stackoverflow.com/questions/27372660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041205/" ]
Your code as it stands should work. Your selection should only match an element with the for attribute set to "CurrentMonth". This [jsfiddle](http://jsfiddle.net/s8gs3Lvf/) shows that clicking on the Current Month label causes the click to fire, but clicking on the input text, or a different label does not. ``` <label...
You should wrap the event handling inside document.getready method you code itself works like charm , check here <http://jsfiddle.net/0vn60ccL/> ``` $(document).ready(function(){ $('[for="CurrentMonth"]').click(function (e) { e.stopPropagation(); alert("I clicked only on label"); }); }); ``` Cur...
8,934,607
I have an entity `ArticlePattern`, which has a property `pattern` (string). I need to access the database to check if pattern is correct. So I would like to define a method `ArticlePattern::isPatternValid()` and add a constraint (using Doctrine's annotation) which would check if isPatternValid is true during validation...
2012/01/19
[ "https://Stackoverflow.com/questions/8934607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/239129/" ]
A validator object can be: * A simple object, that has no connection to the framework environment at all. * A service (in the context of [dependency injection container](http://en.wikipedia.org/wiki/Dependency_injection#Automatically_injected_dependency)) which could do absolutley anything as long as it impements `Sym...
Your constraint should override the base `validatedBy()` method and return the id of the constraint validator service in your container. ``` public function validatedBy() { return 'my_pattern_validator'; } ```
8,004,758
Our application is "sometimes" timing out, we have a Java client connecting to a unix daemon and for some reason it is now and again throwing the following error: ``` SocketException: Cannot establish connection to daemon java.net.ConnectException: Connection timed out: connect at sun.nio.ch.Net.connect(Native Met...
2011/11/04
[ "https://Stackoverflow.com/questions/8004758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029032/" ]
'Connection timed out' means either that the network was temporarily down, which is the most likely, or, if it isn't running on Windows, that the server's socket backlog queue was full, which could happen under extreme load or denial-of-service attacks.
I'd agree with Crollster, although you could also check to see if you have a firewall on the host that may be causing problems. Does the UNIX hose have a firewall? Any intermediate firewalls? Is the UNIX host on the local LAN? If not, do you have spotty internet access? Networking is fun. :)
18,366,405
I have this crud URL format: > > domain.com/config/someconfig/edit/2 > > > Where I open the form ready to be prepped with the contents from record of id 2. **How**, can I just get the 2 from the URI? The easiest way possible would be something like: ``` if($location._uriseg(4) && typeof $location._uriseg(4) ==...
2013/08/21
[ "https://Stackoverflow.com/questions/18366405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165084/" ]
is this an angular route set up via $routeProvider.when? if so, you can use $routeParams to grab the value. something like: ``` $routeProvider.when('/thing/:thingId', { templateUrl: 'thing.html', controller: ThingCntl }); ``` then in your controller, you can used $routeParams.thingId to access the value
My version the codeigniter way.. ``` angular.module('myApp.Filters', []) .filter('uri', function($location) { return { segment: function(segment) { var data = $location.path().split("/"); if(data[segment-1]) { return data[segment-1]; } return false; }, to...
18,366,405
I have this crud URL format: > > domain.com/config/someconfig/edit/2 > > > Where I open the form ready to be prepped with the contents from record of id 2. **How**, can I just get the 2 from the URI? The easiest way possible would be something like: ``` if($location._uriseg(4) && typeof $location._uriseg(4) ==...
2013/08/21
[ "https://Stackoverflow.com/questions/18366405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/165084/" ]
Created a filter for angular to have that method (\_uriseg) available: ``` app.filter('_uriseg', function($location) { return function(segment) { // Get URI and remove the domain base url global var var query = $location.absUrl().replace(BASE_URL,""); // To obj var data = query.split("/"); //...
My version the codeigniter way.. ``` angular.module('myApp.Filters', []) .filter('uri', function($location) { return { segment: function(segment) { var data = $location.path().split("/"); if(data[segment-1]) { return data[segment-1]; } return false; }, to...
18,047
My dog has dry spots and I want to get a good shampoo. I saw a lot of shampoo online, but I know a lot of the benefits can be misleading. So, I'd like to what ingredients I should look for in dog shampoo. Currently, to combat the dry skin, I'm using coconut oil. My dog is a pitbull, three years old, pretty big, short...
2017/08/16
[ "https://pets.stackexchange.com/questions/18047", "https://pets.stackexchange.com", "https://pets.stackexchange.com/users/10163/" ]
For dry skin I highly recommend Oatmeal based shampoo. Oatmeal shampoo will moisturize your dogs skin as well as soften his coat. It also smells great if oatmeal is your thing. It doesn't really matter what brand you go for. Just look for oatmeal in the ingredients (the first brand that comes to mind though is Whole E...
Dry skin can be caused by a few things: 1. Low-quality diet 2. Allergies 3. Diseases such as [hypothyroidism](http://www.petmd.com/dog/conditions/endocrine/c_dg_hypothyroidism) or [cushings disease](http://www.petmd.com/dog/conditions/endocrine/c_dg_hyperadrenocorticism). Pitbulls are notorious for allergies, if you ...
20,918
My friend recent bought a house. All the rooms are wired for CAT5. In the garage theirs a networking panel that has some sort of punch panel and then all the CAT5 cable routed to the rooms. Problem we are having is that the RJ-45 connectors that are currently on ends in the panel to connect to a router/modem etc. f...
2015/08/26
[ "https://networkengineering.stackexchange.com/questions/20918", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/17524/" ]
As far as the RJ45 modular connectors go I have seen cheap ones not fit well. I like Leviton stuff myself. I have seen colors messed up like this. The way wiring code works White/Green Green/White with first color being the dominate one, so this would be your translation. Light Green = White / Green Dark Green = Gre...
just get yourself new RJs and repalce every RJ you have . non-standard connections will drive you nuts .
34,689,709
I just had a quick question on how processors and threads work. According to my current understanding, a core can only perform 1 process at a time. But we are able to produce a thread pool(lets say 30) with a larger number than the number of cores that we posses(lets say 4) and have them run concurrently. How is this p...
2016/01/09
[ "https://Stackoverflow.com/questions/34689709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5765683/" ]
Processes vs Threads -------------------- In days of old, each process had precisely one *thread* of execution, so processes were scheduled onto cores directly (and in these old days, there was almost only one core to schedule onto). However, in operating systems that support threading (which is almost all moderns OS'...
In short, your understanding of a core is correct. A core can execute 1 thread (aka process) at a time. However, your program doesn't **really** run 30 threads at once. Of those 30 threads, only 4 are running at a time, and the other 26 are waiting. The CPU will schedule threads and give each thread a slice of time to...
34,689,709
I just had a quick question on how processors and threads work. According to my current understanding, a core can only perform 1 process at a time. But we are able to produce a thread pool(lets say 30) with a larger number than the number of cores that we posses(lets say 4) and have them run concurrently. How is this p...
2016/01/09
[ "https://Stackoverflow.com/questions/34689709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5765683/" ]
Processes vs Threads -------------------- In days of old, each process had precisely one *thread* of execution, so processes were scheduled onto cores directly (and in these old days, there was almost only one core to schedule onto). However, in operating systems that support threading (which is almost all moderns OS'...
Java do not perform **Thread scheduling**, it leaves this on **Operating System** to perform Thread scheduling. For **computationally intensive** tasks, It is recommended to have thread pool size equal to number of cores available. But for **I/O bound** tasks we should have larger number of threads. There are many oth...
25,823
I can find what DLL supports English word breakers by using `sp_help_fulltext_system_components` but I have not been able to find an actual list of the word breaking characters for English (like blank, `.`, `%`, etc.). Anyone know of a source for this info?
2012/10/11
[ "https://dba.stackexchange.com/questions/25823", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13397/" ]
This isn't an official list, but using a loop to work through a list of characters, and using `sys.dm_fts_parser` like so: ``` declare @i integer declare @cnt integer set @i=0 while @i<255 begin set @cnt=0 select @cnt=COUNT(1) FROM sys.dm_fts_parser ('"word1'+REPLACE(CHAR(@i),'"','""')+'word2"', 1033, 0, 0) if ...
SQL Server (any version) considers any non alphanumeric character as a potential word breaker. Than means that there are situations where characters expected to break words are handled in a different way (direct or expanded) by the server. A typical word breaker is the dot ('.') These are some variations of dot handl...
43,345,260
Simply I have an Excel file and I loaded it into SQL Server 2008. I want to insert current date into the same cells added from Excel while date transferring... then date inserted automatically every time I added data and never lose old date. How can I do this? ``` string ssqltable = comboBox1.GetItemText(comboBox1.Se...
2017/04/11
[ "https://Stackoverflow.com/questions/43345260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4724519/" ]
Set `GETDATE()` as the default constraint for your Date column of Overseas table. SQL Command to add constraint: ``` ALTER TABLE Overseas ALTER COLUMN Date DATETIME NOT NULL DEFAULT GETDATE() ``` Post this, you need not pass any value to this column while inserting. Just insert the remaining columns, this will get ...
You can simply use **Datetime.Now();** function to get current date. Also Use the zzz format specifier to get the timezone offset as hours and minutes. You also want to use the HH format specifier to get the hours in 24 hour format. DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") Result: ``` 2011-08-09T23:49:58+02:...
43,345,260
Simply I have an Excel file and I loaded it into SQL Server 2008. I want to insert current date into the same cells added from Excel while date transferring... then date inserted automatically every time I added data and never lose old date. How can I do this? ``` string ssqltable = comboBox1.GetItemText(comboBox1.Se...
2017/04/11
[ "https://Stackoverflow.com/questions/43345260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4724519/" ]
Set `GETDATE()` as the default constraint for your Date column of Overseas table. SQL Command to add constraint: ``` ALTER TABLE Overseas ALTER COLUMN Date DATETIME NOT NULL DEFAULT GETDATE() ``` Post this, you need not pass any value to this column while inserting. Just insert the remaining columns, this will get ...
There is a function GETDATE() for this purpose. > > Returns the current database system timestamp as a datetime value > without the database time zone offset. This value is derived from the > operating system of the computer on which the instance of SQL Server > is running. > > > <https://learn.microsoft.com/e...
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
should enter your code directory and use "npm install" in your shell!
If you successfully installed EXPRESS but then also you get ***ReferenceError: express is not defined.*** Then, just put name of variable in first line and function name in second line same like this:- ``` var express = require('express'); var app = express(); ``` Not Like This:- ``` var exp = require('express'...
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
If you successfully installed EXPRESS but then also you get ***ReferenceError: express is not defined.*** Then, just put name of variable in first line and function name in second line same like this:- ``` var express = require('express'); var app = express(); ``` Not Like This:- ``` var exp = require('express'...
check the file permissions also please. Also may be your user login do not have the permission to make changes in the system. You may have to use sudo before the command to do so if you are on ubuntu or not a root user.
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
should enter your code directory and use "npm install" in your shell!
Just close your terminal and start it by right-clicking on it and selecting "Run as administrator" and then follow to the directory in which you want to create your server and run npm install express done!
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
If you successfully installed EXPRESS but then also you get ***ReferenceError: express is not defined.*** Then, just put name of variable in first line and function name in second line same like this:- ``` var express = require('express'); var app = express(); ``` Not Like This:- ``` var exp = require('express'...
use this command in your terminal npm install express make sure install inside your project folder
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
If you successfully installed EXPRESS but then also you get ***ReferenceError: express is not defined.*** Then, just put name of variable in first line and function name in second line same like this:- ``` var express = require('express'); var app = express(); ``` Not Like This:- ``` var exp = require('express'...
Just close your terminal and start it by right-clicking on it and selecting "Run as administrator" and then follow to the directory in which you want to create your server and run npm install express done!
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
For using express you need to follow these steps: 1) Basic setup with express Maybe you have to use `sudo` `npm install -g express` This command will install express globally. Also you can now use express on the command line. You can now use express to setup a basic environment using this command. `express [optio...
use this command in your terminal npm install express make sure install inside your project folder
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
For using express you need to follow these steps: 1) Basic setup with express Maybe you have to use `sudo` `npm install -g express` This command will install express globally. Also you can now use express on the command line. You can now use express to setup a basic environment using this command. `express [optio...
If you successfully installed EXPRESS but then also you get ***ReferenceError: express is not defined.*** Then, just put name of variable in first line and function name in second line same like this:- ``` var express = require('express'); var app = express(); ``` Not Like This:- ``` var exp = require('express'...
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
should enter your code directory and use "npm install" in your shell!
use this command in your terminal npm install express make sure install inside your project folder
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
should enter your code directory and use "npm install" in your shell!
check the file permissions also please. Also may be your user login do not have the permission to make changes in the system. You may have to use sudo before the command to do so if you are on ubuntu or not a root user.
21,900,031
One of the reasons that I moved from emacs to vim was to avoid awkward keybindings such as Ctrl+N and Ctrl+P for up and down. I would prefer more ergonomic keys like hjkl. However, I didn't find a way to navigate in Omnicomplete box without using arrow keys or Ctrl+N/P. Does vim provide other keys for up and down? ![...
2014/02/20
[ "https://Stackoverflow.com/questions/21900031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052922/" ]
For using express you need to follow these steps: 1) Basic setup with express Maybe you have to use `sudo` `npm install -g express` This command will install express globally. Also you can now use express on the command line. You can now use express to setup a basic environment using this command. `express [optio...
Just close your terminal and start it by right-clicking on it and selecting "Run as administrator" and then follow to the directory in which you want to create your server and run npm install express done!
428,285
The output of `du -sh folder` is some dimension and folder; how can I use `grep -o '*G'` and similar to just get the dimension, namely get rid of folder name?
2018/03/05
[ "https://unix.stackexchange.com/questions/428285", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/37522/" ]
I can offer a simple `cut` solution : ``` du -sh . | cut -f1 ``` The standard delimiter in `cut` is tab, so no need for any additional options. Simply print field 1. From your comment, it seems you are concerned with resources/speed so to quote Gilles from another answer: > > "Generally speaking, the more special...
You could use awk to only print the first column: ``` du -sh folder | awk '{print $1}' ``` For the file, also using awk: ``` awk '!($3="")' file ```
750,659
I have an example that I don't understand, especially 2 expressions. Given a spin in the state $|z + \rangle$, i.e., pointing up along the z-axis what are the probabilities of measuring $\pm \hbar/2$ along $\hat{n}$? I have these 2 expressions $$|+\rangle\_n = cos(\theta/2)e^{-i\phi/2}|+\rangle +sin(\theta/2)e^{i\ph...
2023/02/18
[ "https://physics.stackexchange.com/questions/750659", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/354087/" ]
> > If I'm sitting on the edge of a rotating merry-go-round, then from my perspective the world is rotating around me. > > > No, it isn't. Think about this carefully (or find a merry-go-round and do a practical experiment). From your perspective the merry-go-round is stationary and the rest of the world is rotatin...
I think the notion of "actual centre" depends on the frame in which you are considering your rotation motion. For an observer outside of the rotating frame, the merry-go-round actually has a centre about which it rotates. But when we shift frames to the person on the mere-go-round, the centre in the rotating frame wou...
750,659
I have an example that I don't understand, especially 2 expressions. Given a spin in the state $|z + \rangle$, i.e., pointing up along the z-axis what are the probabilities of measuring $\pm \hbar/2$ along $\hat{n}$? I have these 2 expressions $$|+\rangle\_n = cos(\theta/2)e^{-i\phi/2}|+\rangle +sin(\theta/2)e^{i\ph...
2023/02/18
[ "https://physics.stackexchange.com/questions/750659", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/354087/" ]
If there is a non rotating object (like a pole) in the center of the merry go round, this object will look rotating around itself, from the edge person perspective. But all other non rotating objects (the rest of the world) will rotate around the pole in the center. It is easy to see that for non rotating objects clo...
I think the notion of "actual centre" depends on the frame in which you are considering your rotation motion. For an observer outside of the rotating frame, the merry-go-round actually has a centre about which it rotates. But when we shift frames to the person on the mere-go-round, the centre in the rotating frame wou...
750,659
I have an example that I don't understand, especially 2 expressions. Given a spin in the state $|z + \rangle$, i.e., pointing up along the z-axis what are the probabilities of measuring $\pm \hbar/2$ along $\hat{n}$? I have these 2 expressions $$|+\rangle\_n = cos(\theta/2)e^{-i\phi/2}|+\rangle +sin(\theta/2)e^{i\ph...
2023/02/18
[ "https://physics.stackexchange.com/questions/750659", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/354087/" ]
$\def \b {\mathbf}$ [![enter image description here](https://i.stack.imgur.com/oYYtO.png)](https://i.stack.imgur.com/oYYtO.png) [![enter image description here](https://i.stack.imgur.com/agfvO.png)](https://i.stack.imgur.com/agfvO.png) In both cases the center of rotation is the same ,but you are looking at the obje...
I think the notion of "actual centre" depends on the frame in which you are considering your rotation motion. For an observer outside of the rotating frame, the merry-go-round actually has a centre about which it rotates. But when we shift frames to the person on the mere-go-round, the centre in the rotating frame wou...