qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
50,984,161 | I have two arrays with values. I am trying to get `desiredArray` which should check `firstArray` values in `secondArray` and if its a match, it should add the numbers of those value associated with them and push it to `desiredArray`. Could any one help?
```js
firstArray = ["Jack Sparrow", "Ryan Gosling", "Peter Parker... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50984161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9891009/"
] | Simple way you may try this.
```
//Define query string in route
Route::get('admin/invoice/{id}','ControllerName@show')
//Get `id` in show function
public function show(Invoice $invoice,$id)
{
$invoice_id = $id;
}
``` | Try using `$invoiceId`
```
public function show(Invoice $invoice, $invoiceId)
{
$clients = Invoice::with('user','products')->get();
$invoices = Invoice::with('products')->findOrFail($invoiceId);
return view('admin.invoices.show', compact('invoice','invoices'),compact('clients'));
}
``` |
50,984,161 | I have two arrays with values. I am trying to get `desiredArray` which should check `firstArray` values in `secondArray` and if its a match, it should add the numbers of those value associated with them and push it to `desiredArray`. Could any one help?
```js
firstArray = ["Jack Sparrow", "Ryan Gosling", "Peter Parker... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50984161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9891009/"
] | Simple way you may try this.
```
//Define query string in route
Route::get('admin/invoice/{id}','ControllerName@show')
//Get `id` in show function
public function show(Invoice $invoice,$id)
{
$invoice_id = $id;
}
``` | do this if you want to get the url segment in controller.
```
$invoice_id = request()->segment(3);
```
if you want this in view
```
{{ Request::segment(3) }}
```
Goodluck! |
50,984,161 | I have two arrays with values. I am trying to get `desiredArray` which should check `firstArray` values in `secondArray` and if its a match, it should add the numbers of those value associated with them and push it to `desiredArray`. Could any one help?
```js
firstArray = ["Jack Sparrow", "Ryan Gosling", "Peter Parker... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50984161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9891009/"
] | Simple way you may try this.
```
//Define query string in route
Route::get('admin/invoice/{id}','ControllerName@show')
//Get `id` in show function
public function show(Invoice $invoice,$id)
{
$invoice_id = $id;
}
``` | Usually happens when giving a route name different from the controller name
Example:
```
Route::resource('xyzs', 'AbcController');
```
Expected:
```
Route::resource('abcs', 'AbcController');
``` |
644,187 | Here's how I started:
$$\int\frac{\sin{(2x)}}{1+\cos^2 x} dx = -2\int\frac{-\sin x\cos x}{1+\cos^2 x} dx = -2\int \frac{u}{1+u^2}du $$
I know the answer ends up being this from here:
$$ -\ln\left(1+\cos^2 x\right) $$
But I don't understand where this u in the numerator goes, it seems like the answer should
look like... | 2014/01/19 | [
"https://math.stackexchange.com/questions/644187",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/66171/"
] | No substitution at all needed. Just a little trigonometry and some basic integration rules:
$$(\cos^2x)'=-2\sin x\cos x\;\;,\;\;\sin 2x=2\sin x\cos x$$
so
$$\int\frac{\sin 2x}{1+\cos^2x}dx=-\int\frac{-2\sin x\cos x}{1+\cos^2x}dx$$
and now you may want to use the general rule
$$\int\frac{f'(x)}{f(x)}dx=\log f(x)+C$... | Make the substitution $u=1+\cos^2x$. Then $du= -2\sin x\cos x=-\sin 2x$, so the integral becomes
$$- \int \frac{du}{u} = -\ln(1+\cos^2x) + C. $$ |
99,437 | I'm a Ph.D. graduate in biotechnology/molecular biology, who is actively seeking a post-doctoral position at a US or Europe-based institute. I'm neither from US, nor from Europe. Thus, I believe, my chances of getting a postdoc position is slightly harder, compared to some others.
My Ph.D. supervisor was very strict i... | 2017/11/26 | [
"https://academia.stackexchange.com/questions/99437",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/79355/"
] | In the UK and Scandinavia at least, provided you show that those papers are in review you should be ok except for very highly competitive labs. The 'well-known professors' are most likely to be running those kinds of labs BUT you may well still get in if you are experienced in a topic or technique they are looking for.... | >
> Do you agree with this PI? Should I wait until I get to reach to the
> level of having 4 published papers, which might happen after 6 months
> or something. Or, do you think papers "under review" are nearly as
> impactful as papers "published"?
>
>
>
They're not nearly as impactful because *they're not publ... |
4,076,952 | I have the following tables:
```
Product(ProductID, ProductName ...)
ProductBidHistory(ProductID, UserID, Amount, Status, ...)
```
The BidHistory table can grow to have many records for every product, I want a report containing approved bid for every products i.e.Amount where status = approved.
* Is it ok to have ... | 2010/11/02 | [
"https://Stackoverflow.com/questions/4076952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/477489/"
] | From the pure design perspective, you shouldn't keep two copies of the same data. This could lead to data inconsistency. What if the approved amount and the bid history do not agree?
From the performance perspective, you may duplicate the data to gain the speedup in the generation of the report.
From the application... | This realy depends on the size of these tables.
If they are not to large, I would recomend that you not duplicate the columns, as this will cause more overhead in the application layer. A simple view or user defined table function should be good enough. Also ensure that you have indexes on the correct columns.
But if... |
4,076,952 | I have the following tables:
```
Product(ProductID, ProductName ...)
ProductBidHistory(ProductID, UserID, Amount, Status, ...)
```
The BidHistory table can grow to have many records for every product, I want a report containing approved bid for every products i.e.Amount where status = approved.
* Is it ok to have ... | 2010/11/02 | [
"https://Stackoverflow.com/questions/4076952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/477489/"
] | From the pure design perspective, you shouldn't keep two copies of the same data. This could lead to data inconsistency. What if the approved amount and the bid history do not agree?
From the performance perspective, you may duplicate the data to gain the speedup in the generation of the report.
From the application... | In general, you should never duplicate the columns in a relational database, so that it would be possible to get answers that do not jibe with each other depending upon how the (valid) queries were expressed.
Approved is not an attribute of the product but an attribute of the bid, and you should always try to have th... |
39,889,656 | I have this javascript code attached that puts some content into a popup window and then tries to print it:
```
$(".print_friendly_popup").click(function() {
var target = $(this).data('print-target');
var left = (screen.width/2)-(500/2);
var top = (screen.height/2)-(500/2);
var win = window.open("", "t... | 2016/10/06 | [
"https://Stackoverflow.com/questions/39889656",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/795374/"
] | So how about this: create some sort of "checker" to see if the window has the content in it, for example:
```
var checkForContent = function () {
setTimeout(function () {
var content = win.document.querySelector('body').innerHTML
if (content.length) {
win.print()
win.close()
} else {
c... | Try
```
win.onload = function(e){
//..... your codes
}
``` |
74,652,858 | my code goes through quite a large number of arrays where everything is sorted so that it is in the right place. It flies 3 times through the input data to sort everything well, which causes empty arrays to appear. I try to delete them with the following code, but in some cases the code leaves me 1 empty array
The fol... | 2022/12/02 | [
"https://Stackoverflow.com/questions/74652858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13613817/"
] | >
> 1. Is it safe to signal a condition variable after it had been destroyed?
>
>
>
No. [Its docs](https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_destroy.html) say:
>
> A destroyed condition variable object can be reinitialized using
> `pthread_cond_init()`; **the results of otherwise re... | This is not safe. Destroy will destroy any shared memory used by these objects. The solution to your problem is to `join` all the threads that are using your your mutexes and cond-vars (except one) and only then destroy them. |
15,025,040 | I understand that when linking against a static library i.e. libname.a, the binary code for the used functions is taken out of the archive and *inserted* in the application binary. Therefore, the static library MUST be present at compilation time.
However, with shared libraries I am lost. The function definitions are ... | 2013/02/22 | [
"https://Stackoverflow.com/questions/15025040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1145760/"
] | The shared libraries need to be fed to the linker's command line so that a reference to the specific functions and the file in which these functions reside, is stored into the executable. When the executable is run, the dynamic linker (`/lib/ld-linux.so`, `/libexec/ld-elf.so`, etc, depending on your system) is loaded f... | See the man pages for **dlopen** and **dlsym** for explicit dynamic link loader management. |
35,789,283 | I am working on iOS project and sending the Json string to backend through wcf webservice, Its working successfully for many users but for some users backend getting incomplete json string.
Code for generating Json string
```
NSData *data = [NSJSONSerialization dataWithJSONObject:EmployeeDetails options:0 error:nil];... | 2016/03/04 | [
"https://Stackoverflow.com/questions/35789283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2024276/"
] | Well, I'd say [TomSwift](https://stackoverflow.com/a/39047833/6165597) is on the right track... It's apparent that the broken JSON is simply missing "} from the end of the string. That does indeed look like something being sanitised by a regex...
You really should find the source of the problem; But for a quick and dir... | I had a similar problem in PHP/CodeIgniter recently and the problem was that the JSON was being "sanitized" via some overly ambitious regular expressions before it arrived to my handler. Perhaps there's some similar sanitization that happens in WCF?
Things I would try:
1. Using [Charles Proxy](https://www.charlesprox... |
12,640,728 | I have one spinner in which I have set the value through an `Adapter`. The problem is that when the spinner is closed at that time it shows the text as perfectly readable with proper size. But when we click on spinner and show the text, that text shows me as not readable that means with cut text.
This problem is only ... | 2012/09/28 | [
"https://Stackoverflow.com/questions/12640728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1468193/"
] | try the following code:
```
<Spinner
android:id="@+id/ddCountry"
android:layout_width="fill_parent"
android:layout_height="20dp"
/>
```
try to change the layout\_height as want to fit ur spinner | Set `android:layout_height="wrap_content"` |
12,640,728 | I have one spinner in which I have set the value through an `Adapter`. The problem is that when the spinner is closed at that time it shows the text as perfectly readable with proper size. But when we click on spinner and show the text, that text shows me as not readable that means with cut text.
This problem is only ... | 2012/09/28 | [
"https://Stackoverflow.com/questions/12640728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1468193/"
] | try the following code:
```
<Spinner
android:id="@+id/ddCountry"
android:layout_width="fill_parent"
android:layout_height="20dp"
/>
```
try to change the layout\_height as want to fit ur spinner | The problem is obviously in your dropdown layout.
Rather than using the stock drop-down layout of `android.R.layout.simple_spinner_dropdown_item` (which Samsung may have modified for their devices), create your own and set the text size to match the closed spinner.
This could be as simple as copying the default to ... |
12,640,728 | I have one spinner in which I have set the value through an `Adapter`. The problem is that when the spinner is closed at that time it shows the text as perfectly readable with proper size. But when we click on spinner and show the text, that text shows me as not readable that means with cut text.
This problem is only ... | 2012/09/28 | [
"https://Stackoverflow.com/questions/12640728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1468193/"
] | I got the solution.Its my mistake that i had set the `android:anyDensity="false"`.So it was not working in Galaxy tab. | Set `android:layout_height="wrap_content"` |
12,640,728 | I have one spinner in which I have set the value through an `Adapter`. The problem is that when the spinner is closed at that time it shows the text as perfectly readable with proper size. But when we click on spinner and show the text, that text shows me as not readable that means with cut text.
This problem is only ... | 2012/09/28 | [
"https://Stackoverflow.com/questions/12640728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1468193/"
] | I got the solution.Its my mistake that i had set the `android:anyDensity="false"`.So it was not working in Galaxy tab. | The problem is obviously in your dropdown layout.
Rather than using the stock drop-down layout of `android.R.layout.simple_spinner_dropdown_item` (which Samsung may have modified for their devices), create your own and set the text size to match the closed spinner.
This could be as simple as copying the default to ... |
52,318,634 | I've created a script that loops through a bunch of folders and processes them each in to webpack bundles. This works great, except that I can't figure out why the `Promise` around the loop isn't resolving.
Some things I've tried:
* If I put a `console.log("hello world")` just before `resolve()`, within the `} else {... | 2018/09/13 | [
"https://Stackoverflow.com/questions/52318634",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/654480/"
] | You are recursively calling your promise, but none of these promises will resolve aside from the last one because you have put your resolve inside of your resolve clause. I think if you put the resolve outside of else and keep the rest the same it should resolve after finishing the recursion.
```
if (script_folders.le... | I think the issue has to do with the way you are making the recursive call.
Try making it
```
if (script_folders.length > 0) {
process_script_folders().then(resolve);
} else {
resolve();
}
``` |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | UThis is connected to your SurfaceView.
Make sure you don't touch the SurfaceView after you have called prepare on you MediaPlayer and that it is visible. In your case where you try to wake up the screen make sure that everything happens in the correct order. So preparing the MediaPlayer for playback is the very last t... | I got around this issue with the below implementation.
```
@Override
protected void onPause()
{
Log.v("MediaVideo", "onPause");
super.onPause();
this.mVideoView.pause();
this.mVideoView.setVisibility(View.GONE);
}
@Override
protected void onDestroy()
{
Log.v("MediaVideo", "onDestroy");
super.o... |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | UThis is connected to your SurfaceView.
Make sure you don't touch the SurfaceView after you have called prepare on you MediaPlayer and that it is visible. In your case where you try to wake up the screen make sure that everything happens in the correct order. So preparing the MediaPlayer for playback is the very last t... | Is your Galaxy Nexus by any chance rooted and running the Keyboard Manager app?
I saw the exact same stack trace as you when testing my app out and kept noticing the following line in my logcat dumps:
```
06-26 08:42:49.511 I/ActivityManager( 218): START {flg=0x10050000 cmp=com.ne0fhykLabs.android.utility.km/.Transit... |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | UThis is connected to your SurfaceView.
Make sure you don't touch the SurfaceView after you have called prepare on you MediaPlayer and that it is visible. In your case where you try to wake up the screen make sure that everything happens in the correct order. So preparing the MediaPlayer for playback is the very last t... | Overriding the `onpause` and `onresume` callbacks seemed to fix it for me and it's ONLY for the NEXUS Galaxy that has this problem. |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | UThis is connected to your SurfaceView.
Make sure you don't touch the SurfaceView after you have called prepare on you MediaPlayer and that it is visible. In your case where you try to wake up the screen make sure that everything happens in the correct order. So preparing the MediaPlayer for playback is the very last t... | I had the same problem with an ICS no name tablet.
SurfaceHolder isn't created when setDisplay method is called, which cause:
```
03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released
```
To fix it, I use:
```
private void setupVideo(String file){
...
mMe... |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | I got around this issue with the below implementation.
```
@Override
protected void onPause()
{
Log.v("MediaVideo", "onPause");
super.onPause();
this.mVideoView.pause();
this.mVideoView.setVisibility(View.GONE);
}
@Override
protected void onDestroy()
{
Log.v("MediaVideo", "onDestroy");
super.o... | Is your Galaxy Nexus by any chance rooted and running the Keyboard Manager app?
I saw the exact same stack trace as you when testing my app out and kept noticing the following line in my logcat dumps:
```
06-26 08:42:49.511 I/ActivityManager( 218): START {flg=0x10050000 cmp=com.ne0fhykLabs.android.utility.km/.Transit... |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | I got around this issue with the below implementation.
```
@Override
protected void onPause()
{
Log.v("MediaVideo", "onPause");
super.onPause();
this.mVideoView.pause();
this.mVideoView.setVisibility(View.GONE);
}
@Override
protected void onDestroy()
{
Log.v("MediaVideo", "onDestroy");
super.o... | Overriding the `onpause` and `onresume` callbacks seemed to fix it for me and it's ONLY for the NEXUS Galaxy that has this problem. |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | I had the same problem with an ICS no name tablet.
SurfaceHolder isn't created when setDisplay method is called, which cause:
```
03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released
```
To fix it, I use:
```
private void setupVideo(String file){
...
mMe... | I got around this issue with the below implementation.
```
@Override
protected void onPause()
{
Log.v("MediaVideo", "onPause");
super.onPause();
this.mVideoView.pause();
this.mVideoView.setVisibility(View.GONE);
}
@Override
protected void onDestroy()
{
Log.v("MediaVideo", "onDestroy");
super.o... |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | I had the same problem with an ICS no name tablet.
SurfaceHolder isn't created when setDisplay method is called, which cause:
```
03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released
```
To fix it, I use:
```
private void setupVideo(String file){
...
mMe... | Is your Galaxy Nexus by any chance rooted and running the Keyboard Manager app?
I saw the exact same stack trace as you when testing my app out and kept noticing the following line in my logcat dumps:
```
06-26 08:42:49.511 I/ActivityManager( 218): START {flg=0x10050000 cmp=com.ne0fhykLabs.android.utility.km/.Transit... |
9,812,067 | I have an application thats main goal is to play a specific video file.
it plays the video correctly sometimes. But other times it gives me this error:
```
03-21 14:52:36.181: I/AwesomePlayer(119):
setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4')
03-21 14:52:36.196: W/VideoView(26612): Unable to open... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9812067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507810/"
] | I had the same problem with an ICS no name tablet.
SurfaceHolder isn't created when setDisplay method is called, which cause:
```
03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released
```
To fix it, I use:
```
private void setupVideo(String file){
...
mMe... | Overriding the `onpause` and `onresume` callbacks seemed to fix it for me and it's ONLY for the NEXUS Galaxy that has this problem. |
5,869 | I have a few function. For both of them need javascript code. I need to add javascript code in header only when function is active. At this time I have all my javascript code in header for all my function and newermind which one of them is active. I tried to make this code but nothing is changed:
All I have in
**scrip... | 2010/12/23 | [
"https://wordpress.stackexchange.com/questions/5869",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1752/"
] | Basically your approach fails because `function_exist()` simply check for function definition. It doesn't care if function is ever run or anything like that.
In your case I think it makes sense to handle enqueue in same way as your slider choice, something like this:
```
$sliders = get_option('src_switcher');
if($sl... | Check your logic...
You say that you have 3 functions defined in a file.
```
if(condition_1_true) // in your case it is
execute_function_1
elseif(condition_2_true) // this one is true also, but never gets executed because first one was true too
execute_function_2
elseif(condition_3_true) // same here
... |
5,869 | I have a few function. For both of them need javascript code. I need to add javascript code in header only when function is active. At this time I have all my javascript code in header for all my function and newermind which one of them is active. I tried to make this code but nothing is changed:
All I have in
**scrip... | 2010/12/23 | [
"https://wordpress.stackexchange.com/questions/5869",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1752/"
] | Hi **@Denis Belousov:**
Okay, based on your responses I'm going to ask why tie it to the function existing, why not just test the return value of `get_option('src_switcher')` like this?
```
function my_scripts() {
if (!is_admin()) {
wp_enqueue_script('jquery');
wp_enqueue_script( 'custom',
get_blogin... | Check your logic...
You say that you have 3 functions defined in a file.
```
if(condition_1_true) // in your case it is
execute_function_1
elseif(condition_2_true) // this one is true also, but never gets executed because first one was true too
execute_function_2
elseif(condition_3_true) // same here
... |
5,869 | I have a few function. For both of them need javascript code. I need to add javascript code in header only when function is active. At this time I have all my javascript code in header for all my function and newermind which one of them is active. I tried to make this code but nothing is changed:
All I have in
**scrip... | 2010/12/23 | [
"https://wordpress.stackexchange.com/questions/5869",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1752/"
] | Hi **@Denis Belousov:**
Okay, based on your responses I'm going to ask why tie it to the function existing, why not just test the return value of `get_option('src_switcher')` like this?
```
function my_scripts() {
if (!is_admin()) {
wp_enqueue_script('jquery');
wp_enqueue_script( 'custom',
get_blogin... | Basically your approach fails because `function_exist()` simply check for function definition. It doesn't care if function is ever run or anything like that.
In your case I think it makes sense to handle enqueue in same way as your slider choice, something like this:
```
$sliders = get_option('src_switcher');
if($sl... |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | Are you
>
> patience?
>
>
>
Because
>
> If you are not that patient, you will lose patience easily
>
>
> | Let's give it a noteworthy shot.
>
> Chess/checkers pieces.
>
>
>
The less you have, the more likely is it for you to lose it.
>
> With fewer pieces, it might be harder to prevent the opponent from taking them.
>
> If you don't believe me, try defending your 5 remaining pawns from a bloodthirsty queen.
>... |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | Are you
>
> patience?
>
>
>
Because
>
> If you are not that patient, you will lose patience easily
>
>
> | >
> **Balance**
>
> Since, the less balance you have, more likely to lose it.
>
>
> |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | Are you
>
> patience?
>
>
>
Because
>
> If you are not that patient, you will lose patience easily
>
>
> | It could be
>
> Poker Chips because you will lose them to the beginning pot and you cannot take risky bets.
>
>
> |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | Are you
>
> patience?
>
>
>
Because
>
> If you are not that patient, you will lose patience easily
>
>
> | This could be a lot of things, like:
>
> Hope, Focus, Confidence, Trust - the less you have of each of these, the easier it is to lose them.
>
>
>
In addition to all the other good answers already posted. |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | Let's give it a noteworthy shot.
>
> Chess/checkers pieces.
>
>
>
The less you have, the more likely is it for you to lose it.
>
> With fewer pieces, it might be harder to prevent the opponent from taking them.
>
> If you don't believe me, try defending your 5 remaining pawns from a bloodthirsty queen.
>... | It could be
>
> Poker Chips because you will lose them to the beginning pot and you cannot take risky bets.
>
>
> |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | Let's give it a noteworthy shot.
>
> Chess/checkers pieces.
>
>
>
The less you have, the more likely is it for you to lose it.
>
> With fewer pieces, it might be harder to prevent the opponent from taking them.
>
> If you don't believe me, try defending your 5 remaining pawns from a bloodthirsty queen.
>... | This could be a lot of things, like:
>
> Hope, Focus, Confidence, Trust - the less you have of each of these, the easier it is to lose them.
>
>
>
In addition to all the other good answers already posted. |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | >
> **Balance**
>
> Since, the less balance you have, more likely to lose it.
>
>
> | It could be
>
> Poker Chips because you will lose them to the beginning pot and you cannot take risky bets.
>
>
> |
64,307 | Can you tell me?
The less you have, the more likely is it for you to lose it. What am I thinking about? | 2018/04/18 | [
"https://puzzling.stackexchange.com/questions/64307",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/31496/"
] | >
> **Balance**
>
> Since, the less balance you have, more likely to lose it.
>
>
> | This could be a lot of things, like:
>
> Hope, Focus, Confidence, Trust - the less you have of each of these, the easier it is to lose them.
>
>
>
In addition to all the other good answers already posted. |
16,269,084 | My code is here: <http://jsfiddle.net/GwUmb/4/>
```
$(document).ready(function(){
$(".trigger,.trigger-2").click(function(){
$(".panel,.panel-2").toggle("fast");
$(this).toggleClass("active");
return false;
});
});
```
I've been struggling to load panel-2 from trigger-2...I notice... | 2013/04/28 | [
"https://Stackoverflow.com/questions/16269084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2023783/"
] | The issue here is that no matter which trigger you click, *both* (or all) panels will be activated because you are selecting them both and calling `.toggle` on them. There are many ways to solve this such as storing the corresponding index of the panel on the trigger as `data`, or using the index. The latter may work w... | Another option for you is to use a single class name for your links/containers. I have cleaned up your code a little bit and provided a hover function to display your links. It should be a good starting point for you. A CSS approach using lists may be an even easier approach...
working example is here <http://jsfiddle... |
453,464 | I have tmux installed with iTerm2 on OS X.
While I can do `Cmd+left/right` to switch between tabs, I cannot seem to be able to switch between panes under the same tab using `Ctl+b o` (that is, `Control` and `b` together, followed by an `o`?) as suggested by others.
I don't think I've touched any default key binding f... | 2012/07/25 | [
"https://superuser.com/questions/453464",
"https://superuser.com",
"https://superuser.com/users/140701/"
] | `Cmd` + `Opt` + `Up` or `Down` or `Left` or `Right` works for me. | You can see a list of all your bindings using `Ctl+b ?`. You're looking for the following line:
```
bind-key o select-pane -t :.+
```
although it sounds as if you may have a key other than 'o' bound to it. |
22,683,269 | I am new to shell script. I have a file `app.conf` as :
```
[MySql]
user = root
password = root123
domain = localhost
database = db_name
port = 3306
[Logs]
level = logging.DEBUG
[Server]
port = 8080
```
I want to parse this file in shell script and want to extract mysql credentials from the same. How can I achieve... | 2014/03/27 | [
"https://Stackoverflow.com/questions/22683269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2745266/"
] | I'd do this:
```
pw=$(awk '/^password/{print $3}' app.conf)
user=$(awk '/^user/{print $3}' app.conf)
echo $pw
root123
echo $user
root
```
The `$()` sets the variable `pw` to the output of the command inside. The command inside looks through your app.conf file for a line starting `password` and then prints the 3rd... | Using awk:
```
awk -F ' *= *' '$1=="user"||$1=="password"{print $2}' my.cnf
root
gogslab
``` |
22,683,269 | I am new to shell script. I have a file `app.conf` as :
```
[MySql]
user = root
password = root123
domain = localhost
database = db_name
port = 3306
[Logs]
level = logging.DEBUG
[Server]
port = 8080
```
I want to parse this file in shell script and want to extract mysql credentials from the same. How can I achieve... | 2014/03/27 | [
"https://Stackoverflow.com/questions/22683269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2745266/"
] | Using awk:
```
awk -F ' *= *' '$1=="user"||$1=="password"{print $2}' my.cnf
root
gogslab
``` | I ran in a similar problem yesterday and thought the best solution might be, if you get an associative array like "key - value" after parsing the file.
I you like to see a running example have a look at <https://github.com/philippkemmeter/set-resolution/blob/master/set-resolution>.
Adapted to your problem, this might... |
22,683,269 | I am new to shell script. I have a file `app.conf` as :
```
[MySql]
user = root
password = root123
domain = localhost
database = db_name
port = 3306
[Logs]
level = logging.DEBUG
[Server]
port = 8080
```
I want to parse this file in shell script and want to extract mysql credentials from the same. How can I achieve... | 2014/03/27 | [
"https://Stackoverflow.com/questions/22683269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2745266/"
] | I'd do this:
```
pw=$(awk '/^password/{print $3}' app.conf)
user=$(awk '/^user/{print $3}' app.conf)
echo $pw
root123
echo $user
root
```
The `$()` sets the variable `pw` to the output of the command inside. The command inside looks through your app.conf file for a line starting `password` and then prints the 3rd... | You will want to search for "shell ini file parser". I would start with something like this:
```
ini_get () {
awk -v section="$2" -v variable="$3" '
$0 == "[" section "]" { in_section = 1; next }
in_section && $1 == variable {
$1=""
$2=""
sub(/^[[:space:]]+/, "")... |
22,683,269 | I am new to shell script. I have a file `app.conf` as :
```
[MySql]
user = root
password = root123
domain = localhost
database = db_name
port = 3306
[Logs]
level = logging.DEBUG
[Server]
port = 8080
```
I want to parse this file in shell script and want to extract mysql credentials from the same. How can I achieve... | 2014/03/27 | [
"https://Stackoverflow.com/questions/22683269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2745266/"
] | I'd do this:
```
pw=$(awk '/^password/{print $3}' app.conf)
user=$(awk '/^user/{print $3}' app.conf)
echo $pw
root123
echo $user
root
```
The `$()` sets the variable `pw` to the output of the command inside. The command inside looks through your app.conf file for a line starting `password` and then prints the 3rd... | I ran in a similar problem yesterday and thought the best solution might be, if you get an associative array like "key - value" after parsing the file.
I you like to see a running example have a look at <https://github.com/philippkemmeter/set-resolution/blob/master/set-resolution>.
Adapted to your problem, this might... |
22,683,269 | I am new to shell script. I have a file `app.conf` as :
```
[MySql]
user = root
password = root123
domain = localhost
database = db_name
port = 3306
[Logs]
level = logging.DEBUG
[Server]
port = 8080
```
I want to parse this file in shell script and want to extract mysql credentials from the same. How can I achieve... | 2014/03/27 | [
"https://Stackoverflow.com/questions/22683269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2745266/"
] | You will want to search for "shell ini file parser". I would start with something like this:
```
ini_get () {
awk -v section="$2" -v variable="$3" '
$0 == "[" section "]" { in_section = 1; next }
in_section && $1 == variable {
$1=""
$2=""
sub(/^[[:space:]]+/, "")... | I ran in a similar problem yesterday and thought the best solution might be, if you get an associative array like "key - value" after parsing the file.
I you like to see a running example have a look at <https://github.com/philippkemmeter/set-resolution/blob/master/set-resolution>.
Adapted to your problem, this might... |
23,142,155 | I posted this question yesterday: <https://stackoverflow.com/questions/23119494/what-is-the-best-way-to-dynamically-change-the-style-of-a-uicollectionview> and received 0 responses.
I decided to experiment a bit. What I'm trying to do is have a grid style default collection view display change to a single file display... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23142155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/439688/"
] | You might want to look into [RMQ](https://github.com/infinitered/rmq) if you are going to be doing much of this. The code would be far simpler. Example:
```
view.parent.find(UILabel).attr(text: '') # Sets all UILabels below parent to blank
```
or, if you're bent on removing the labels:
```
view.parent.find(UILabel)... | I think it is better to clear the text of the label or you can hide and then make it visible instead of adding and removing the view. |
10,410,030 | I have a database of documents which are tagged with keywords. I am trying to find (and then count) the unique tags which are used alongside each other. So for any given tag, I want to know what tags have been used alongside that tag.
For example, if I had one document which had the tags `[fruit, apple, plant]` then w... | 2012/05/02 | [
"https://Stackoverflow.com/questions/10410030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/307614/"
] | Your answer is nice, and as I said in the comments, if it works for you, that's all you should care about. Here is an alternative implementation in case you ever bump into performance problems.
CouchDB likes tall lists, not fat lists. Instead of view rows keeping an array with every previous tag ever seen, this soluti... | I have found a correct solution I am much happier with. The trick was that CouchDB must be set to `reduce_limit = false` so that it stops checking its heuristic against your query.
You can set this via Futon on <http://localhost:5984/_utils/config.html> under the **query\_server\_config** settings, by double clicking ... |
14,128,787 | I'm looking for a way to specify where a line should break ***if*** it cannot fit on its line in a way similar to `­` (soft/discretionary hyphen), but with a space. I tried googling it but didn't get many relevant hits (mostly for InDesign despite specifying "html"), and what I did get was a few people saying they ... | 2013/01/02 | [
"https://Stackoverflow.com/questions/14128787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/758177/"
] | You could use the [`<wbr>`](http://www.w3.org/TR/html5/text-level-semantics.html#the-wbr-element) tag.
EDIT: As mentioned in the comments, you could use a [zero-width space](http://en.wikipedia.org/wiki/Zero-width_space): `​` (See also: [What's the opposite of a nbsp?](https://stackoverflow.com/questions/2046530... | I don't think there's any native way to do that, but here's a hack I've been using whenever I really need this sort of thing:
```
var str = "Hello,<br>My name is foo.";
str = str.replace(/ /g, ' ').replace(/<br>/g, ' ');
```
Basically, use a non-breaking space to separate the words you don't want to break at.
... |
14,128,787 | I'm looking for a way to specify where a line should break ***if*** it cannot fit on its line in a way similar to `­` (soft/discretionary hyphen), but with a space. I tried googling it but didn't get many relevant hits (mostly for InDesign despite specifying "html"), and what I did get was a few people saying they ... | 2013/01/02 | [
"https://Stackoverflow.com/questions/14128787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/758177/"
] | To indicate where line break should *not* appear between words, use a NO-BREAK SPACE, or ' `, between words. Any normal space *is* breakable. So you can write e.g.
```
Hello, my name is foo.
```
If you would rather indicate the allowed breaks (as per your comment below), you can wrap the text inside ... | I don't think there's any native way to do that, but here's a hack I've been using whenever I really need this sort of thing:
```
var str = "Hello,<br>My name is foo.";
str = str.replace(/ /g, ' ').replace(/<br>/g, ' ');
```
Basically, use a non-breaking space to separate the words you don't want to break at.
... |
14,128,787 | I'm looking for a way to specify where a line should break ***if*** it cannot fit on its line in a way similar to `­` (soft/discretionary hyphen), but with a space. I tried googling it but didn't get many relevant hits (mostly for InDesign despite specifying "html"), and what I did get was a few people saying they ... | 2013/01/02 | [
"https://Stackoverflow.com/questions/14128787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/758177/"
] | You could use the [`<wbr>`](http://www.w3.org/TR/html5/text-level-semantics.html#the-wbr-element) tag.
EDIT: As mentioned in the comments, you could use a [zero-width space](http://en.wikipedia.org/wiki/Zero-width_space): `​` (See also: [What's the opposite of a nbsp?](https://stackoverflow.com/questions/2046530... | Here's a technique that still works: break text into groups using spans of `inline-block`.
<https://jsfiddle.net/mindplay/7aeyp3hs/>
[](https://i.stack.imgur.com/ojdKv.gif)
Note that I'm using an `@media` rule to turn off this effect on very small devices, where the tex... |
14,128,787 | I'm looking for a way to specify where a line should break ***if*** it cannot fit on its line in a way similar to `­` (soft/discretionary hyphen), but with a space. I tried googling it but didn't get many relevant hits (mostly for InDesign despite specifying "html"), and what I did get was a few people saying they ... | 2013/01/02 | [
"https://Stackoverflow.com/questions/14128787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/758177/"
] | To indicate where line break should *not* appear between words, use a NO-BREAK SPACE, or ' `, between words. Any normal space *is* breakable. So you can write e.g.
```
Hello, my name is foo.
```
If you would rather indicate the allowed breaks (as per your comment below), you can wrap the text inside ... | Here's a technique that still works: break text into groups using spans of `inline-block`.
<https://jsfiddle.net/mindplay/7aeyp3hs/>
[](https://i.stack.imgur.com/ojdKv.gif)
Note that I'm using an `@media` rule to turn off this effect on very small devices, where the tex... |
2,325,824 | Basically I'm modifying a parser to handle additional operators. Before my changes, one part of the parser looked like this:
```
parseExpRec e1 (op : ts) =
let (e2, ts') = parsePrimExp ts in
case op of
T_Plus -> parseExpRec (BinOpApp Plus e1 e2) ts'
T_Minus -> parseExpRec (BinOpApp Minus e1 e... | 2010/02/24 | [
"https://Stackoverflow.com/questions/2325824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49128/"
] | Have you indented the new line with the same space-delimiters as the previous ones? Or, has a tab character snuck in there? | Maybe you still need to setup T\_Power in the lexer? For example, what symbol are you using for exponentiation (e.g. ^), and where is that associated with T\_Power?
I don't know if [this](http://www.cs.nott.ac.uk/~nhn/G52CMP/LectureNotes-2009/lecture03+04-handout.pdf) (or something similar) is what you're working fro... |
2,325,824 | Basically I'm modifying a parser to handle additional operators. Before my changes, one part of the parser looked like this:
```
parseExpRec e1 (op : ts) =
let (e2, ts') = parsePrimExp ts in
case op of
T_Plus -> parseExpRec (BinOpApp Plus e1 e2) ts'
T_Minus -> parseExpRec (BinOpApp Minus e1 e... | 2010/02/24 | [
"https://Stackoverflow.com/questions/2325824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49128/"
] | This is almost with 100% certainty an indentation error. I've had similar problems in the past, also when writing a parser. What's probably happened is the lines before the problematic line are indented with tabs, and you've used spaces on the T\_Power line (or something similar). Can you turn on non-printed characters... | Maybe you still need to setup T\_Power in the lexer? For example, what symbol are you using for exponentiation (e.g. ^), and where is that associated with T\_Power?
I don't know if [this](http://www.cs.nott.ac.uk/~nhn/G52CMP/LectureNotes-2009/lecture03+04-handout.pdf) (or something similar) is what you're working fro... |
2,325,824 | Basically I'm modifying a parser to handle additional operators. Before my changes, one part of the parser looked like this:
```
parseExpRec e1 (op : ts) =
let (e2, ts') = parsePrimExp ts in
case op of
T_Plus -> parseExpRec (BinOpApp Plus e1 e2) ts'
T_Minus -> parseExpRec (BinOpApp Minus e1 e... | 2010/02/24 | [
"https://Stackoverflow.com/questions/2325824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/49128/"
] | Have you indented the new line with the same space-delimiters as the previous ones? Or, has a tab character snuck in there? | This is almost with 100% certainty an indentation error. I've had similar problems in the past, also when writing a parser. What's probably happened is the lines before the problematic line are indented with tabs, and you've used spaces on the T\_Power line (or something similar). Can you turn on non-printed characters... |
56,566,451 | I created string that contains numbers by calling string.Join on a byte array:
```
string str = string.Join(", ", arr);
```
(arr is a byte array).
How can I turn the string back to a byte array? | 2019/06/12 | [
"https://Stackoverflow.com/questions/56566451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11554082/"
] | You can use `String.Split` and then `Byte.Parse` to parse the string, eg :
```
var newArray = str.Split(',').Select(Byte.Parse).ToArray();
```
`Byte.Parse` ignores whitespace so there's no need to trim
If you create the array like this :
```
var str = String.Join(", ", new byte[]{0xFF,0x05,0x56});
```
The new ar... | Assuming your string looks like "1,2,3,4"
`var numArray = str.Split(',').Select(s => Byte.Parse(s)).ToArray();`
Runnable:
<https://rextester.com/XOMQ99840> |
34,809,053 | I have this query:
```
select
id,
count(1) as "visits",
count(distinct visitor_id) as "visitors"
from my_table
where timestamp > '2016-01-14'
group by id
order by "visits", "visitors"
```
It works.
If I change to this
```
select
id,
count(1) as "visits",
count(distinct visitor_id) as "vis... | 2016/01/15 | [
"https://Stackoverflow.com/questions/34809053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/504331/"
] | Expression evaluation order is not defined. If your `visits + visitors` expression is evaluated before aliases you will get the error shown here above. | Instead of using the alias try using the actual column also try change the type to varchar or nvarchar, and by that I mean the following:
```
select
id,
count(1) as "visits",
count(distinct visitor_id) as "visitors"
from my_table
where timestamp > '2016-01-14'
group by id
order by (CAST(count(1) AS VARCHA... |
22,416 | I need to delete 200 Drupal commerce orders. Is there any way to do this in a bulk action?
Orders are at: **/admin/commerce/orders**
Same with Customer profiles. I need to delete them with a bulk action. Can I accomplish with this?
Customer profiles are at: **/admin/commerce/customer-profiles/list** | 2012/02/13 | [
"https://drupal.stackexchange.com/questions/22416",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1352/"
] | There is a module for that™
With [Commerce VBO views](http://drupal.org/project/commerce_vbo_views) you can create a view where you can mass delete orders and products. I don't know about customer profiles, but that could be a feature request if it's not added yet. | [Commerce Order Cleanup](https://www.drupal.org/project/commerce_order_cleanup) is another attempt on this front:
>
> Allows to cleanup the orders by various order properties like last changed, status.
>
>
> |
22,416 | I need to delete 200 Drupal commerce orders. Is there any way to do this in a bulk action?
Orders are at: **/admin/commerce/orders**
Same with Customer profiles. I need to delete them with a bulk action. Can I accomplish with this?
Customer profiles are at: **/admin/commerce/customer-profiles/list** | 2012/02/13 | [
"https://drupal.stackexchange.com/questions/22416",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1352/"
] | If you've got 65,000 orders that you need to wipe, VBO isn't an option. You can try this:
```
TRUNCATE commerce_customer_profile;
TRUNCATE commerce_customer_profile_revision;
TRUNCATE commerce_funds_transactions;
TRUNCATE commerce_funds_user_funds;
TRUNCATE commerce_line_item;
TRUNCATE commerce_order;
TRUNCATE commerc... | [Commerce Order Cleanup](https://www.drupal.org/project/commerce_order_cleanup) is another attempt on this front:
>
> Allows to cleanup the orders by various order properties like last changed, status.
>
>
> |
26,635,976 | Imagine you have a product page. On this page there are two select inputs with options in them.
There is one for Size and Colour. This can change depending on the product, e.g. a curtain might have a size, length and colour (three select menus).
The array is created dynamically (based on each select menu and its opt... | 2014/10/29 | [
"https://Stackoverflow.com/questions/26635976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3397052/"
] | You can always use [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
```
dynamicArr.forEach(function(el){
console.log(el);
});
``` | I hope I didn't get you wrong, but here's a solution:
```
for(i = 0; i < dynamicArr.length; i++) {
for(j = 0; j < dynamicArr[i].length; j++) {
// do something here..
}
}
``` |
26,635,976 | Imagine you have a product page. On this page there are two select inputs with options in them.
There is one for Size and Colour. This can change depending on the product, e.g. a curtain might have a size, length and colour (three select menus).
The array is created dynamically (based on each select menu and its opt... | 2014/10/29 | [
"https://Stackoverflow.com/questions/26635976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3397052/"
] | You can always use [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)
```
dynamicArr.forEach(function(el){
console.log(el);
});
``` | you should try something like this: `dyn.forEach(function(el){//dyn is the dynamic array
console.log(el); //logs to console
});` |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | You can easily create it manually, writing a file with a chosen separator. You can also use [csv module](http://docs.python.org/library/csv.html).
If it's from database you can alo just use a query from your sqlite client :
```
sqlite <db params> < queryfile.sql > output.csv
```
Which will create a csv file with ta... | unless i'm missing something, you just want to do something like so...
```
f = open("somefile.csv")
f.writelines("header_row")
```
logic to write lines to file (you may need to organize values and add comms or pipes etc...)
```
f.close()
``` |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | ```
import csv
import sqlite3
from glob import glob; from os.path import expanduser
conn = sqlite3.connect( # open "places.sqlite" from one of the Firefox profiles
glob(expanduser('~/.mozilla/firefox/*/places.sqlite'))[0]
)
cursor = conn.cursor()
cursor.execute("select * from moz_places;")
with open("out.csv", "w"... | You can easily create it manually, writing a file with a chosen separator. You can also use [csv module](http://docs.python.org/library/csv.html).
If it's from database you can alo just use a query from your sqlite client :
```
sqlite <db params> < queryfile.sql > output.csv
```
Which will create a csv file with ta... |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | Using the [csv module](http://docs.python.org/library/csv.html) is very straight forward and made for this task.
```
import csv
writer = csv.writer(open("out.csv", 'w'))
writer.writerow(['name', 'address', 'phone', 'etc'])
writer.writerow(['bob', '2 main st', '703', 'yada'])
writer.writerow(['mary', '3 main st', '704'... | It can be easily done using pandas and sqlite3. In extension to the answer from Cristian Ciupitu.
```
import sqlite3
from glob import glob; from os.path import expanduser
conn = sqlite3.connect(glob(expanduser('data/clients_data.sqlite'))[0])
cursor = conn.cursor()
```
Now use pandas to read the table and write to c... |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | You can easily create it manually, writing a file with a chosen separator. You can also use [csv module](http://docs.python.org/library/csv.html).
If it's from database you can alo just use a query from your sqlite client :
```
sqlite <db params> < queryfile.sql > output.csv
```
Which will create a csv file with ta... | **How to extract the column headings from an existing table:**
*You don't need to parse an SQL "create table" statement.* This is fortunate, as the "create table" syntax is neither nice nor clean, it is warthog-ugly.
You can use the [`table_info`](http://www.sqlite.org/pragma.html#pragma_table_info) pragma. It gives ... |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | You can easily create it manually, writing a file with a chosen separator. You can also use [csv module](http://docs.python.org/library/csv.html).
If it's from database you can alo just use a query from your sqlite client :
```
sqlite <db params> < queryfile.sql > output.csv
```
Which will create a csv file with ta... | It can be easily done using pandas and sqlite3. In extension to the answer from Cristian Ciupitu.
```
import sqlite3
from glob import glob; from os.path import expanduser
conn = sqlite3.connect(glob(expanduser('data/clients_data.sqlite'))[0])
cursor = conn.cursor()
```
Now use pandas to read the table and write to c... |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | Using the [csv module](http://docs.python.org/library/csv.html) is very straight forward and made for this task.
```
import csv
writer = csv.writer(open("out.csv", 'w'))
writer.writerow(['name', 'address', 'phone', 'etc'])
writer.writerow(['bob', '2 main st', '703', 'yada'])
writer.writerow(['mary', '3 main st', '704'... | This is simple and works fine for me.
Lets say you have already connected to your database table and also got a cursor object. So following on on from that point.
```
import csv
curs = conn.cursor()
curs.execute("select * from oders")
m_dict = list(curs.fetchall())
with open("mycsvfile.csv", "wb") as f:
w = csv.... |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | ```
import csv
import sqlite3
from glob import glob; from os.path import expanduser
conn = sqlite3.connect( # open "places.sqlite" from one of the Firefox profiles
glob(expanduser('~/.mozilla/firefox/*/places.sqlite'))[0]
)
cursor = conn.cursor()
cursor.execute("select * from moz_places;")
with open("out.csv", "w"... | **How to extract the column headings from an existing table:**
*You don't need to parse an SQL "create table" statement.* This is fortunate, as the "create table" syntax is neither nice nor clean, it is warthog-ugly.
You can use the [`table_info`](http://www.sqlite.org/pragma.html#pragma_table_info) pragma. It gives ... |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | **How to extract the column headings from an existing table:**
*You don't need to parse an SQL "create table" statement.* This is fortunate, as the "create table" syntax is neither nice nor clean, it is warthog-ugly.
You can use the [`table_info`](http://www.sqlite.org/pragma.html#pragma_table_info) pragma. It gives ... | unless i'm missing something, you just want to do something like so...
```
f = open("somefile.csv")
f.writelines("header_row")
```
logic to write lines to file (you may need to organize values and add comms or pipes etc...)
```
f.close()
``` |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | This is simple and works fine for me.
Lets say you have already connected to your database table and also got a cursor object. So following on on from that point.
```
import csv
curs = conn.cursor()
curs.execute("select * from oders")
m_dict = list(curs.fetchall())
with open("mycsvfile.csv", "wb") as f:
w = csv.... | It can be easily done using pandas and sqlite3. In extension to the answer from Cristian Ciupitu.
```
import sqlite3
from glob import glob; from os.path import expanduser
conn = sqlite3.connect(glob(expanduser('data/clients_data.sqlite'))[0])
cursor = conn.cursor()
```
Now use pandas to read the table and write to c... |
3,710,263 | I have a Sqlite 3 and/or MySQL table named "clients"..
Using python 2.6, How do I create a csv file named Clients100914.csv with headers?
excel dialect...
The Sql execute: select \* only gives table data, but I would like complete table with headers.
How do I create a record set to get table headers. The table hea... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3710263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/428862/"
] | Using the [csv module](http://docs.python.org/library/csv.html) is very straight forward and made for this task.
```
import csv
writer = csv.writer(open("out.csv", 'w'))
writer.writerow(['name', 'address', 'phone', 'etc'])
writer.writerow(['bob', '2 main st', '703', 'yada'])
writer.writerow(['mary', '3 main st', '704'... | The below code works for Oracle with Python 3.6 :
```
import cx_Oracle
import csv
# Create tns
dsn_tns=cx_Oracle.makedsn('<host>', '<port>', service_name='<service_name>')
# Connect to DB using user, password and tns settings
conn=cx_Oracle.connect(user='<user>', password='<pass>',dsn=dsn_tns)
c=conn.cursor()
#Exec... |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I just chose Mongoid for a new Rails 3 project based on the argument that it has the best documentation.
Since I am new to MongoDB (with many years of MySQL and a little bit of CouchDB experience), I needed good guides that take me by the hand and help me deliver something working within a reasonable span of time.
AF... | While not a direct answer to your question, I would also consider using the basic ruby driver directly. Unlike the various SQL adapters out there Mongo's ruby class is easy to use and powerful. Because queries are hashes, composing queries is generally easy. The real advantage is access to the [Atomic Modifiers](http:/... |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I just chose Mongoid for a new Rails 3 project based on the argument that it has the best documentation.
Since I am new to MongoDB (with many years of MySQL and a little bit of CouchDB experience), I needed good guides that take me by the hand and help me deliver something working within a reasonable span of time.
AF... | Code Stats for Mongoid and MongoMapper

It looks like MongoMapper has much better code quality (if it does the same with less).
Here's the analyzer CodeStats <https://github.com/alexeypetrushin/code_stats> |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | Code Stats for Mongoid and MongoMapper

It looks like MongoMapper has much better code quality (if it does the same with less).
Here's the analyzer CodeStats <https://github.com/alexeypetrushin/code_stats> | There's also MongodbModel <http://alexeypetrushin.github.com/mongodb_model> |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I was trying MongoMapper, but I think I'll go with Mongoid, because after quick reading docs it seems to me somewhat easier. Plus, it's developed by guys from Hashrocket, so that's a good reason itself. | There's also MongodbModel <http://alexeypetrushin.github.com/mongodb_model> |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I was trying MongoMapper, but I think I'll go with Mongoid, because after quick reading docs it seems to me somewhat easier. Plus, it's developed by guys from Hashrocket, so that's a good reason itself. | I can recommend MongoMapper, since it also works with rails3 (beta and master). I personally didn't try the other 2 mappers you mentioned, since MM works great in my workflow and the mailinglist is very active. Furthermore the codebase is really stable and the only issue is with rails3 master, so you should use fredwu'... |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | In my opinion it's hard to say which is better, if you have DataMapper experience you'll like MongoMapper, but if you used ActiveRecord, Mongoid it's your preferred choice. I believe all of them worths a try concerning the context where you want to use them. | I can recommend MongoMapper, since it also works with rails3 (beta and master). I personally didn't try the other 2 mappers you mentioned, since MM works great in my workflow and the mailinglist is very active. Furthermore the codebase is really stable and the only issue is with rails3 master, so you should use fredwu'... |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I am using MongoMapper. It good except it is little slow with Time conversions.
And it loads all data as Array. `MyCollection.all` for example gives you huge array, not cursor.
while Mongoid says: - Optimized for use with extremely large datasets.
So I guess you could try MongoID if you need speed and have big record... | There's also MongodbModel <http://alexeypetrushin.github.com/mongodb_model> |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I just chose Mongoid for a new Rails 3 project based on the argument that it has the best documentation.
Since I am new to MongoDB (with many years of MySQL and a little bit of CouchDB experience), I needed good guides that take me by the hand and help me deliver something working within a reasonable span of time.
AF... | I was trying MongoMapper, but I think I'll go with Mongoid, because after quick reading docs it seems to me somewhat easier. Plus, it's developed by guys from Hashrocket, so that's a good reason itself. |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I am using MongoMapper. It good except it is little slow with Time conversions.
And it loads all data as Array. `MyCollection.all` for example gives you huge array, not cursor.
while Mongoid says: - Optimized for use with extremely large datasets.
So I guess you could try MongoID if you need speed and have big record... | I can recommend MongoMapper, since it also works with rails3 (beta and master). I personally didn't try the other 2 mappers you mentioned, since MM works great in my workflow and the mailinglist is very active. Furthermore the codebase is really stable and the only issue is with rails3 master, so you should use fredwu'... |
2,415,651 | In Ruby, there are currently 3 ODM (object data mappers) maintained:
* [MongoMapper](https://github.com/jnunemaker/mongomapper)
* [Mongoid](https://github.com/mongodb/mongoid)
* [MongoDoc](https://github.com/leshill/mongodoc)
Which is your preferred and why? | 2010/03/10 | [
"https://Stackoverflow.com/questions/2415651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/285289/"
] | I just chose Mongoid for a new Rails 3 project based on the argument that it has the best documentation.
Since I am new to MongoDB (with many years of MySQL and a little bit of CouchDB experience), I needed good guides that take me by the hand and help me deliver something working within a reasonable span of time.
AF... | I can recommend MongoMapper, since it also works with rails3 (beta and master). I personally didn't try the other 2 mappers you mentioned, since MM works great in my workflow and the mailinglist is very active. Furthermore the codebase is really stable and the only issue is with rails3 master, so you should use fredwu'... |
22,936 | >
> C'est **dans l'ordre des choses**.
>
>
>
As I understand it, the sentence above means "that is only natural". In the following sentence, however, this expression seems to carry a different meaning – which has me puzzled.
>
> Sache que **dans l'ordre des choses**, il nous est bien plus précieux que toi.
>
> ... | 2016/11/14 | [
"https://french.stackexchange.com/questions/22936",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/10416/"
] | You are right, in the first sentence “l'ordre des choses” expresses a natural consequence. “Ordre” has temporal and causative implications. Wiktionary provides the following definition:
>
> Ce qui arrive, ce qui se passe, sans qu’il soit possible de le discuter, de le refuser.
>
>
>
Quite surprisingly, in the sec... | ### meaning
[expressions-françaises](http://www.expressions-francaises.fr/expressions-c/2696-c-est-dans-l-ordre-des-choses.html) :
>
> Le dictionnaire des expressions et locutions définit l’expression française *c’est dans l’ordre des choses* comme **un événement normal, inévitable et prévisible**.
>
>
>
[wordre... |
53,948,704 | I am using Google Cloud Storage Java Api to manage my bucket on Firebase.
i have activated the versioning with gsutil using this command :
```
gsutil versioning set on gs://[BUCKET_NAME]
```
After that i tried to delete some files with this java code :
```
com.google.cloud.storage.Bucket bucket = com.google.fireb... | 2018/12/27 | [
"https://Stackoverflow.com/questions/53948704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6364177/"
] | In the [versioning docs](https://cloud.google.com/storage/docs/object-versioning) they say :
>
> If you send a delete request with a generation that corresponds to the currently live object, Cloud Storage deletes the object without making an archived copy.
>
>
>
So, using `bucket.get('test.pdf');` returns the doc... | You are turning versioning off. The correct command to [enable versioning](https://cloud.google.com/storage/docs/using-object-versioning#enable) is:
>
> gsutil versioning set **on** gs://[BUCKET\_NAME]
>
>
> |
17,809,377 | My Quest Spotlight Trial does not connect to DB. When I run the user wizard it always comes:
>
>
> ```
> Cannot load OCI DLL: oci.dll
>
> ```
>
>
It is a 64-bit Windows Server / 64 bit Oracle server.
I've already installed the 32 bit Oracle client and added the dict to path, but nothing worked.
Does someone ha... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17809377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591465/"
] | According to [Spotlight requirements](http://www.quest.com/spotlight-on-oracle/#requirements):
>
> Note: Spotlight will run on 64-bit versions of the client operating
> system with the use of a 32-bit Oracle client.
>
>
>
If you have 64-bit server and 32-bit client installed on the same computer it's possible t... | if you use 64-bit pc, oracle doesn't compatible with it. Oracle doesn't find oci.dll file in 64-bit.
Therefore, you can try to change oracle home on the top. As a result of that, home path will change. |
17,809,377 | My Quest Spotlight Trial does not connect to DB. When I run the user wizard it always comes:
>
>
> ```
> Cannot load OCI DLL: oci.dll
>
> ```
>
>
It is a 64-bit Windows Server / 64 bit Oracle server.
I've already installed the 32 bit Oracle client and added the dict to path, but nothing worked.
Does someone ha... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17809377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2591465/"
] | InstallClient does not configure environment variables.
Solution:
* download instantclient\_11\_2(remember you InstallClient path)
* PATH add :C:\ instantclient\_11\_2(OCI.DLL)
* New system environment variables:SQLPATH,LOCAL,TNS\_ADMIN,LD\_LIBRARY\_PATH;content:C:\ instantclient\_11\_2
To use English, my English is ... | if you use 64-bit pc, oracle doesn't compatible with it. Oracle doesn't find oci.dll file in 64-bit.
Therefore, you can try to change oracle home on the top. As a result of that, home path will change. |
10,546,388 | I have researched alot on google and also read the steps mentioned at www.dropbox.com, but I didn't found any way to list all the files and folders of dropbox in my application using dropbox API.. I know how to download a file from dropbox and also how to upload a file to dropbox.
But anyone pls suggest me that Is thi... | 2012/05/11 | [
"https://Stackoverflow.com/questions/10546388",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/960526/"
] | simple sample.
```
Entry entries = mApi.metadata(Path, 100, null, true, null);
for (Entry e : entries.contents) {
if (!e.isDeleted) {
Log.i("Is Folder",String.valueOf(e.isDir));
Log.i("Item Name",e.fileName);
}
}
``` | Use the [`/metadata`](https://www.dropbox.com/developers/reference/api#metadata) method with the `list` parameter set to `true` to get all the information about a folder and its contents. |
23,116,637 | I try to make regular expression which helps me filter strings like
```
blah_blah_suffix
```
where suffix is any string that has length from 2 to 5 characters. So I want accept strings
```
blah_blah_aa
blah_blah_abcd
```
but discard
```
blah_blah_a
blah_aaa
blah_blah_aaaaaaa
```
I use grepl in the following wa... | 2014/04/16 | [
"https://Stackoverflow.com/questions/23116637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2196184/"
] | You need to bound the expression to the start and end of the line:
```
^blah_blah_.{2,5}$
```
The `^` matches beginning of line and `$` matches end of line. See a working example here: [Regex101](http://regex101.com/r/zH8rR2)
If you want to bound the expression to the beginning and end of a string (not multi-line),... | ```
/^[\w]+_[\w]+_[\w]{2,5}$/
```
[DEMO](http://regex101.com/r/rE2vL8)
```
Options: dot matches newline; case insensitive; ^ and $ match at line breaks
Assert position at the beginning of a line (at beginning of the string or after a line break character) «^»
Match a single character that is a “word character” (let... |
70,500 | New here and I just wanna ask the question of what happens when your pre warping doesnt work on your bilinear transform?
I am assuming my isnt working as part of my research I have read that the higher the frequency is the more non linear it becomes, so I am assuming that my frequency I chose just has to many non line... | 2020/09/24 | [
"https://dsp.stackexchange.com/questions/70500",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/49496/"
] | **DFT vs DTFT, Fourier Transform**
The problem appears rooted in viewing DFT as a 'special case' of the continuous Fourier Transform, and of its input as some signal with legitimate frequency contents. *That's a fallacy*.
The DFT is a standalone mathematical transformation which does not condition itself upon anythin... | Yes.
All windows distort spectrum, whether they be due to the inherent length of the DFT, or a zero-padding rectangle. That's because nothing of finite length (e.g. of finite support) consists of a single frequency in the frequency domain (or is even bounded in bandwidth). So you choose your preferred distortion (or w... |
70,500 | New here and I just wanna ask the question of what happens when your pre warping doesnt work on your bilinear transform?
I am assuming my isnt working as part of my research I have read that the higher the frequency is the more non linear it becomes, so I am assuming that my frequency I chose just has to many non line... | 2020/09/24 | [
"https://dsp.stackexchange.com/questions/70500",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/49496/"
] | **DFT vs DTFT, Fourier Transform**
The problem appears rooted in viewing DFT as a 'special case' of the continuous Fourier Transform, and of its input as some signal with legitimate frequency contents. *That's a fallacy*.
The DFT is a standalone mathematical transformation which does not condition itself upon anythin... | Shorter version with more intuitive animation where original signal is fixed in frame, and alternate formulation: *zero-padding **extends** the spectrum*.
Here's `k=1` basis (sine omitted) over 1Hz signal, `N=128` points:

As we zero-pad the signal, this same `k=1` basis now sp... |
70,500 | New here and I just wanna ask the question of what happens when your pre warping doesnt work on your bilinear transform?
I am assuming my isnt working as part of my research I have read that the higher the frequency is the more non linear it becomes, so I am assuming that my frequency I chose just has to many non line... | 2020/09/24 | [
"https://dsp.stackexchange.com/questions/70500",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/49496/"
] | Shorter version with more intuitive animation where original signal is fixed in frame, and alternate formulation: *zero-padding **extends** the spectrum*.
Here's `k=1` basis (sine omitted) over 1Hz signal, `N=128` points:

As we zero-pad the signal, this same `k=1` basis now sp... | Yes.
All windows distort spectrum, whether they be due to the inherent length of the DFT, or a zero-padding rectangle. That's because nothing of finite length (e.g. of finite support) consists of a single frequency in the frequency domain (or is even bounded in bandwidth). So you choose your preferred distortion (or w... |
8,293,570 | I'm new to subversion. I've created a repository, and I want to make the first commit.
There are some files and folders that should not be checked in, such as `cache/` or `log/`. I've used `svn propset svn:ignore -F svn_ignore.txt`.
I want to have a simple way to add new files to svn. Is there a way to do this while ... | 2011/11/28 | [
"https://Stackoverflow.com/questions/8293570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113305/"
] | >
> The patterns are strictly for that directory—they do not carry
> recursively into subdirectories.
>
>
>
See [SVN documentation](http://svnbook.red-bean.com/en/1.1/ch07s02.html)
So you must apply your patterns on all the directories, or only on the directories where that ignore is necessary.
So the pattern ... | `svn status` should not display an ignored file.
But the issue might be in the way you do ignore a file: see "[Command Line svn:ignore a file](http://blog.bogojoker.com/2008/07/command-line-svnignore-a-file/)"
>
> You don’t `svn:ignore` a file.
>
>
> You put an `svn:ignore` property **on the directory** to ignor... |
7,220,737 | I'm trying to parse some HTML that includes some HTML entities, like ×
```
$str = '<a href="http://example.com/"> A × B</a>';
$dom = new DomDocument;
$dom -> substituteEntities = false;
$dom ->loadHTML($str);
$link = $dom ->getElementsByTagName('a') -> item(0);
$fullname = $link -> nodeValue;
$href = $link -> g... | 2011/08/28 | [
"https://Stackoverflow.com/questions/7220737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/889482/"
] | This is no direct answer to the question, but you may use UTF-8 instead, which allows you to save glyphs like ÷ or × directly. To use UTF-8 with PHP DOM on the other needs [a little hack](http://php.net/manual/en/domdocument.loadhtml.php#95251).
Also, if you are trying to display mathematical formulas (as A × B sugges... | Are you sure the & is being substituted to `&`? If that were the case, you'd see the exact entity, as text, not the garbled response you're getting.
My guess is that it is converted to the actual character, and you're viewing the page with a latin1 charset, which does not contain this character, hence the garbled... |
7,220,737 | I'm trying to parse some HTML that includes some HTML entities, like ×
```
$str = '<a href="http://example.com/"> A × B</a>';
$dom = new DomDocument;
$dom -> substituteEntities = false;
$dom ->loadHTML($str);
$link = $dom ->getElementsByTagName('a') -> item(0);
$fullname = $link -> nodeValue;
$href = $link -> g... | 2011/08/28 | [
"https://Stackoverflow.com/questions/7220737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/889482/"
] | From the docs:
*The DOM extension uses UTF-8 encoding.
Use utf8\_encode() and utf8\_decode() to work with texts in ISO-8859-1 encoding or Iconv for other encodings.*
Assuming you're using latin-1 try:
```
<?php
header('Content-type:text/html;charset=iso-8859-1');
$str = utf8_encode('<a href="http://example.com/... | Are you sure the & is being substituted to `&`? If that were the case, you'd see the exact entity, as text, not the garbled response you're getting.
My guess is that it is converted to the actual character, and you're viewing the page with a latin1 charset, which does not contain this character, hence the garbled... |
7,220,737 | I'm trying to parse some HTML that includes some HTML entities, like ×
```
$str = '<a href="http://example.com/"> A × B</a>';
$dom = new DomDocument;
$dom -> substituteEntities = false;
$dom ->loadHTML($str);
$link = $dom ->getElementsByTagName('a') -> item(0);
$fullname = $link -> nodeValue;
$href = $link -> g... | 2011/08/28 | [
"https://Stackoverflow.com/questions/7220737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/889482/"
] | Are you sure the & is being substituted to `&`? If that were the case, you'd see the exact entity, as text, not the garbled response you're getting.
My guess is that it is converted to the actual character, and you're viewing the page with a latin1 charset, which does not contain this character, hence the garbled... | I fixed my problem with broken entities by converting UTF-8 to UTF-8 with BOM. |
7,220,737 | I'm trying to parse some HTML that includes some HTML entities, like ×
```
$str = '<a href="http://example.com/"> A × B</a>';
$dom = new DomDocument;
$dom -> substituteEntities = false;
$dom ->loadHTML($str);
$link = $dom ->getElementsByTagName('a') -> item(0);
$fullname = $link -> nodeValue;
$href = $link -> g... | 2011/08/28 | [
"https://Stackoverflow.com/questions/7220737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/889482/"
] | This is no direct answer to the question, but you may use UTF-8 instead, which allows you to save glyphs like ÷ or × directly. To use UTF-8 with PHP DOM on the other needs [a little hack](http://php.net/manual/en/domdocument.loadhtml.php#95251).
Also, if you are trying to display mathematical formulas (as A × B sugges... | I fixed my problem with broken entities by converting UTF-8 to UTF-8 with BOM. |
7,220,737 | I'm trying to parse some HTML that includes some HTML entities, like ×
```
$str = '<a href="http://example.com/"> A × B</a>';
$dom = new DomDocument;
$dom -> substituteEntities = false;
$dom ->loadHTML($str);
$link = $dom ->getElementsByTagName('a') -> item(0);
$fullname = $link -> nodeValue;
$href = $link -> g... | 2011/08/28 | [
"https://Stackoverflow.com/questions/7220737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/889482/"
] | From the docs:
*The DOM extension uses UTF-8 encoding.
Use utf8\_encode() and utf8\_decode() to work with texts in ISO-8859-1 encoding or Iconv for other encodings.*
Assuming you're using latin-1 try:
```
<?php
header('Content-type:text/html;charset=iso-8859-1');
$str = utf8_encode('<a href="http://example.com/... | I fixed my problem with broken entities by converting UTF-8 to UTF-8 with BOM. |
22,662,559 | I have the following piece of Java code and while debugging in Eclipse, Windows 7, the variable 'xoredChar' shows no value at all, not null, not '', nothing.
```
char xoredChar = (char) (stringA.charAt(j)^stringB.charAt(j));
```
Why is that? I need to understand how can I do this xor operation between two characters... | 2014/03/26 | [
"https://Stackoverflow.com/questions/22662559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148175/"
] | Well, if the strings are equal you'll get back a `\0` which is not a printable character. Try something like this,
```
String stringA = "A";
String stringB = "A";
int j = 0;
char xoredChar = (char) (stringA.charAt(j) ^ stringB.charAt(j));
System.out.printf("'%c' = %d\n", xoredChar, (int) xoredChar);
```
Output is
`... | If `stringA` and `stringB` are identical, then the XOR operation will yield `xoredChar = 0`.
A 0 is probably showing in your IDE as nothing since 0 is used as a string terminator in most instances. |
22,662,559 | I have the following piece of Java code and while debugging in Eclipse, Windows 7, the variable 'xoredChar' shows no value at all, not null, not '', nothing.
```
char xoredChar = (char) (stringA.charAt(j)^stringB.charAt(j));
```
Why is that? I need to understand how can I do this xor operation between two characters... | 2014/03/26 | [
"https://Stackoverflow.com/questions/22662559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148175/"
] | Well, if the strings are equal you'll get back a `\0` which is not a printable character. Try something like this,
```
String stringA = "A";
String stringB = "A";
int j = 0;
char xoredChar = (char) (stringA.charAt(j) ^ stringB.charAt(j));
System.out.printf("'%c' = %d\n", xoredChar, (int) xoredChar);
```
Output is
`... | As mentioned by the other answers, xoring the same characters results in a `\0` value, which has no visual representation. Perhapse you are interested in a small application, which gives you and idea how XOR works on your strings:
```
public class Example {
public static void main(String[] args) {
String a... |
6,972,753 | Can somebody give a simple example for java code of a native app passing a string to a website?
For example: when a string has the value `Hello everybody`, the text `Hello everybody` should get pasted into the Google search field. | 2011/08/07 | [
"https://Stackoverflow.com/questions/6972753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/798536/"
] | For the most simple use, you can try:
```
public static void browseURL(Activity activity, String url)
{
try
{
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
activity.startActivity(intent);
}
catch (Exception e)
{
message(activity, "Sorry, failed to view the ... | Do you want to fill the fields and submit them? If so, just do the request with the request parameters filled, and parse the response given by the server. Look into Apache HttpClient. |
6,972,753 | Can somebody give a simple example for java code of a native app passing a string to a website?
For example: when a string has the value `Hello everybody`, the text `Hello everybody` should get pasted into the Google search field. | 2011/08/07 | [
"https://Stackoverflow.com/questions/6972753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/798536/"
] | For the most simple use, you can try:
```
public static void browseURL(Activity activity, String url)
{
try
{
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
activity.startActivity(intent);
}
catch (Exception e)
{
message(activity, "Sorry, failed to view the ... | You don't actually have to add text to the Google search field explicitly. You can send a URL with a query string.
Depending on the website the query string will always be different. For Google it is <http://www.google.ca/search?q=something> . Anything after a ? is considered a query string which any good web develope... |
711,709 | <https://what-if.xkcd.com/6/> has been mentioned here before, but I'm questioning whether or not the glass cup with the bottom half as a vacuum would rise at all.
To start with, a vacuum exerts no force. Any perceived "sucking" is actually external pressure pushing into the vacuum. So the only force that could be lift... | 2022/06/01 | [
"https://physics.stackexchange.com/questions/711709",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/79374/"
] | It's not just buoyancy because the slug of liquid can move. Your "force field" at the top of the glass modifies the premise of the XKCD scenario. If you look closely at the illustrations, his slug of liquid moves downward as the glass moves upward. The atmosphere pushes down on the slug of liquid and up on the glass, m... | Only if the cup is big enough and resistant to breaking, it will fly up. The volume, with zero mass inside, grows faster than the glass volume (assuming constant glass thickness). So the upward buoyancy force will exceed the total mass at some point.
I only now saw the real problem. If you pull a vacuum in a cylinder ... |
711,709 | <https://what-if.xkcd.com/6/> has been mentioned here before, but I'm questioning whether or not the glass cup with the bottom half as a vacuum would rise at all.
To start with, a vacuum exerts no force. Any perceived "sucking" is actually external pressure pushing into the vacuum. So the only force that could be lift... | 2022/06/01 | [
"https://physics.stackexchange.com/questions/711709",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/79374/"
] | For a glass of water, the buoyant force is a small correction to the gravitational force arising because the pressure is different at different altitudes. The timescales in this problem are short enough that we can neglect the center-of-mass motion due to gravity, so we can absolutely neglect the center-of-mass motion ... | Only if the cup is big enough and resistant to breaking, it will fly up. The volume, with zero mass inside, grows faster than the glass volume (assuming constant glass thickness). So the upward buoyancy force will exceed the total mass at some point.
I only now saw the real problem. If you pull a vacuum in a cylinder ... |
711,709 | <https://what-if.xkcd.com/6/> has been mentioned here before, but I'm questioning whether or not the glass cup with the bottom half as a vacuum would rise at all.
To start with, a vacuum exerts no force. Any perceived "sucking" is actually external pressure pushing into the vacuum. So the only force that could be lift... | 2022/06/01 | [
"https://physics.stackexchange.com/questions/711709",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/79374/"
] | For a glass of water, the buoyant force is a small correction to the gravitational force arising because the pressure is different at different altitudes. The timescales in this problem are short enough that we can neglect the center-of-mass motion due to gravity, so we can absolutely neglect the center-of-mass motion ... | It's not just buoyancy because the slug of liquid can move. Your "force field" at the top of the glass modifies the premise of the XKCD scenario. If you look closely at the illustrations, his slug of liquid moves downward as the glass moves upward. The atmosphere pushes down on the slug of liquid and up on the glass, m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.