qid int64 1 74.7M | question stringlengths 0 70k | date stringlengths 10 10 | metadata list | response stringlengths 0 115k |
|---|---|---|---|---|
7,377,628 | I have a table of 5700 records. The primary key is an integer. Now I noticed that some values are missing. Like this:
```
100 data
101 data
102 data
104 data
```
`103` is missing. How I can update all the rows so that the order becomes correct (`104` becomes `103` in my example) in one SQL command? | 2011/09/11 | [
"https://Stackoverflow.com/questions/7377628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616129/"
] | Try this:
```
SET @var:=0;
UPDATE `table` SET `id`=(@var:=@var+1);
ALTER TABLE `table` AUTO_INCREMENT=1;
``` |
45,876,099 | I'm programming an App for the Aldebaran's Pepper robot. I'm using Choregraphe and I made an html for displaying in robots tablet. I have made the boxes for displaying the web and I need to pass a variable from Python to the web Javascript.
Is there any way to do it?
The Python code is the same as the default of a Ra... | 2017/08/25 | [
"https://Stackoverflow.com/questions/45876099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1888372/"
] | I solved the problem. I put a **delay** box of 2 seconds between the **show HTML** box and the **sendImage** box like in the image below:
[](https://i.stack.imgur.com/ZWXjr.jpg)
I think the problem was that the string that is send to tabled was sent before th... |
44,811,928 | I'm looking to make a method which detects if the following value in an array is a duplicate, and deletes it if so. It should work for both strings and integers.
For example, given the Array:
```
arr = ["A", "B", "B", "C", "c", "A", "D", "D"]
```
Return:
```
arr = ["A", "B", "C", "c", "A", "D"]
```
I tried crea... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44811928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6831572/"
] | First at all, here is simpler solution:
```
> arr.delete_if.with_index { |e, ind| e == arr[ind+1] }
#=> ["A", "B", "C", "c", "A", "D"]
```
But, this solution will mutate `arr`.
Here are one-line solutions without mutates:
```
arr.each_with_index.with_object([]) { |(e, ind), res| res << e if e != arr[ind+1] }
arr.ea... |
44,000,699 | In Wordpress editor (TinyMCE), whenever I switch between 'Visual' and 'Text' mode, all my HTML formatting gets removed. That includes tabs (indents) and line breaks. Sometimes, even elements and elements attributes are removed.
I searched a lot about this issue, wich is actually a pretty common problem for many users,... | 2017/05/16 | [
"https://Stackoverflow.com/questions/44000699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1301123/"
] | You should try TinyMCE Advanced Plugin.
[TinyMCE Advanced](https://wordpress.org/plugins/tinymce-advanced/) have set to Stop removing the `<p> and <br /> tags` when saving and show them in the HTML editor.
Try it after removing another editor plugin which you have installed to prevent conflict with other.
The seco... |
26,225,066 | I have tried many options both in Mac and in Ubuntu.
I read the Rserve documentation
```
http://rforge.net/Rserve/doc.html
```
and that for the Rserve and RSclient packages:
<http://cran.r-project.org/web/packages/RSclient/RSclient.pdf>
<http://cran.r-project.org/web/packages/Rserve/Rserve.pdf>
I cannot figure ou... | 2014/10/06 | [
"https://Stackoverflow.com/questions/26225066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3570398/"
] | Load Rserve and RSclient packages, then connect to the instances.
```
> library(Rserve)
> library(RSclient)
> Rserve(port = 6311, debug = FALSE)
> Rserve(port = 6312, debug = TRUE)
Starting Rserve...
"C:\..\Rserve.exe" --RS-port 6311
Starting Rserve...
"C:\..\Rserve_d.exe" --RS-port 6312
> rsc <- RSconnect(port ... |
23,979,303 | I wonder if it's possible to call the python interpreter in such a way that the python statements are printed (echoed) to standard output instead of being just silently executed.
any ideas? | 2014/06/01 | [
"https://Stackoverflow.com/questions/23979303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/700023/"
] | First of all, with Python, you can use negative indexes:
```
mystr = "hello world"
mystr[0] # "h"
mystr[-1] # "d"
mystr[-2] # "r"
```
Do not hesitate to use them!
```
for i in range(0, len(word)):
if word[i] != s[-1 - i]:
return False
return True
```
Then, as I said in my previous comment, there are s... |
14,016,192 | >
> **Possible Duplicate:**
>
> [Ideal way to cancel an executing AsyncTask](https://stackoverflow.com/questions/2735102/ideal-way-to-cancel-an-executing-asynctask)
>
>
>
When I developed an Android application, I used an `AsyncTask` to download something, I used a `progressDialog` to show the progress of this... | 2012/12/24 | [
"https://Stackoverflow.com/questions/14016192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1685245/"
] | The most correct way to do it would be to check periodically inside `doInBackground` if the task was cancelled (i.e. by calling `isCancelled`). From <http://developer.android.com/reference/android/os/AsyncTask.html>:
**Cancelling a task :**
A task can be cancelled at any time by invoking
`cancel(boolean)`. Invoking ... |
23,309,861 | I'm new to android and am not familiar with using asynctask, I am performing login into my webservice but it fails on trying to read the inputstream on the line
```
InputStream in = urlConnection.getInputStream();
```
here's my code:
```
package com.test.connector;
import java.io.BufferedReader;
import java.io.IO... | 2014/04/26 | [
"https://Stackoverflow.com/questions/23309861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3556095/"
] | Try this..
```
new TestConnection().execute();
``` |
42,540,991 | I'm trying to make a shell "bosh>" which takes in Unix commands and keep getting a bad address error. I know my code reads in the commands and parses them but for some reason, I cannot get them to execute, instead, I get a "bad address" error.
```
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sy... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42540991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7643500/"
] | These two lines are the culprit:
```
commandArgs[0]=malloc(strlen(command)+1);
strcpy(commandArgs[0],command);
```
First of all, `malloc(strlen(...))` followed by `strcpy` is what the POSIX function [`strdup`](https://stackoverflow.com/questions/252782/strdup-what-does-it-do-in-c) already does. But then, you don't n... |
19,461,360 | I am a complete Haskell n00b, but I would like to define a new data type that is simple a list of numbers. How would I go about doing this? I've read Haskell wikibook on type declarations, as well as other online resources, but I cannot seem to figure it out. Here is, in essence, what I've tried:
```
type NumList = [N... | 2013/10/19 | [
"https://Stackoverflow.com/questions/19461360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/887128/"
] | `Num` is a class, not a type. Choose a type instead; e.g. `Integer` or `Rational` are probably good choices.
```
type NumList = [Integer]
```
However, this does *not* create a new type; it just creates a new name for an old type. If you actually want a new type, you can use `newtype`, as in
```
newtype NumList = Mk... |
184,785 | I'm new to Drupal Commerce.
I have created new product type and added custom fields everything and it's working fine.
I want to theme the Add a Product (form page). Please suggest me how to do that.
Thanks,
Selva | 2015/12/23 | [
"https://drupal.stackexchange.com/questions/184785",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/55616/"
] | It depends what part of the page you want to theme, simple CSS, change the layout, or adjust the form.
To add CSS, you could attach your CSS file in `hook_page_build` for that path.
To change the page template, you could override the `page.tpl.php` file as `page--node--add--product.tpl.php`
You could also set a cust... |
65,477,452 | When I click text fields on the main page (main.dart) which is the default dart given by the flutter. I can see a glitch when soft keyboard appears and there is no delay when soft keyboard disappears.I have attached a gif below for this case.
```
void main() {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle... | 2020/12/28 | [
"https://Stackoverflow.com/questions/65477452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11779017/"
] | The reason of this so called `Glitch` is that the default behaviour of the flutter `scaffold` widget is to resize it's body when soft keyboard opens up or closes down.
While the flutter scaffold is notified of any of the above two events, it will start resizing the widgets under its `body` to match the new state. The ... |
28,193,935 | I see this examples:
<https://openui5.hana.ondemand.com/#docs/guide/25ab54b0113c4914999c43d07d3b71fe.html>
I have this my formatter function:
```
rowVisibility: function (oRow, sGrid) {
var oModel = new sap.ui.model.json.JSONModel();
oModel.loadData("model/file/mapping/map.json", "", false);
v... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28193935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3224058/"
] | You're mixing iteration with recursion, which is usually not a good idea.
(Your compiler should have warned about possibly not returning a value from the function. )
You're also possibly dereferencing a null pointer here:
```
int current = p->age;
```
and comparing the wrong thing here:
```
if (p->age == NULL)
... |
21,140,683 | In iOS 7, when navigating back using the new swipe-from-edge-of-screen gesture, the title of the Back button ("Artists") fades from being pink (in the example below) and having regular font weight to being black and having bold font weight.

It seems... | 2014/01/15 | [
"https://Stackoverflow.com/questions/21140683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/381416/"
] | You can adjust letter spacing like this, using `NSAttributedString`.
In Objective-C:
```objectivec
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"The Clash"];
[attributedString addAttribute:NSKernAttributeName
value:@(1.4)
... |
95,387 | I have changed the language from my MacOS system and now it won't save the screenshots anymore. Is there a way to fix it?
Thanks. | 2013/07/02 | [
"https://apple.stackexchange.com/questions/95387",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/48696/"
] | I found this, and it works:
Say you restore your iPhone with a full wipe and restore. Then you choose a previous backup to restore all of your settings and applications. When your iPhone is done restoring to your backup, all your icons are mixed up on the SpringBoard.... what the heck? You want to get them back don't ... |
31,494,101 | We have a optimized Apache 2.2 setting which works fine, but after upgrading to Apache 2.4 it seems not reflecting. Both Apache were enabled with worker module, have shared the details below.
>
> Apache 2.2 Settings
> -------------------
>
>
>
> ```
> <IfModule worker.c>
> ServerLimit 40
> StartServers ... | 2015/07/18 | [
"https://Stackoverflow.com/questions/31494101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4943986/"
] | Thanks Daniel for your response.
I just found the issue few hours back. The conf '00-mpm.conf' (which has the modules to enable prefork / worker / event) was called below the worker.c module setting which seems to have caused the issue. Moving it above the worker setting made apache to pick up the worker setting menti... |
9,750,355 | I have an object with a Flag enum with several possible "uses". The flag enum uses the proper power of 2.
Checking if a variable has a certain flag on, I can do it using the .NET 4 `HasFlag()`
BUT:
If I store that flag combination as a int in database... how can I retrive the objects that have certain flag on using ... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9750355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7720/"
] | I doubt any ORM is going to have a way to adapt the HasFlags down to the appropriate SQL code for your DBMS.
What you are likely going to need to do is either write a stored procedure, or hand-crank the SQL Statement to be executed for this.
You don't mention what DBMS you're using - but if I assume you're using SQ... |
76,999 | apache ask for passphrase redirects to plymouth even when I'm remoted in using SSH and away from console.
How can I disabled plymouth?
Update: I did learn that I can `sudo plymouth --quit` and that will shutdown plymouth. I would like to know the recommended way to disable plymouth on boot. | 2011/11/08 | [
"https://askubuntu.com/questions/76999",
"https://askubuntu.com",
"https://askubuntu.com/users/1668/"
] | plymouth should be stopping on its own when the boot is finished.. on a GUI that is when kdm/xdm/gdm/lxdm start. On servers, that is when runlevel 2 is finished (ls /etc/rc2.d). If it is not stopped, this is likely a bug in the bootup, and should be reported with
```
apport-bug plymouth
```
Additional Resources:
* ... |
12,473,821 | What is difference between.
what is best?
Do you **drain** same **release** but different in drain don't save **retain**, while release save retain?
**autorelease** save object in memory some time. | 2012/09/18 | [
"https://Stackoverflow.com/questions/12473821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1667650/"
] | What is best? The answer, of course, is 'it depends'.
For most newcomers to Cocoa, my opinion is 'none of the above' - it is ARC. Although even with ARC, some understanding of reference-counted memory management is important, you need not worry about missing a `release` or `autorelease`, over over-releasing.
In the s... |
370,830 | I just realized that the directions in "UPload" and "DOWNload" seem arbitrary to me as a non-native English speaker. I took a look at a couple of dictionaries and they said that this word is a result of merging "down" and "load", which doesn't seem to explain anything. Where could those two directions come from? | 2017/01/29 | [
"https://english.stackexchange.com/questions/370830",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/53295/"
] | Initially, "download" and "upload" were used in aviation, especially by the US military. "Download" meant to remove items such as weapons from the aircraft, while "upload" meant to load items onto the aircraft.
For example, the [August 1963 *Aerospace Maintenance Safety*](https://books.google.com/books?id=SNvGD-_SKL0... |
43,578,466 | So I got this
```
itemIds1 = ('2394328')
itemIds2 = ('6546345')
count2 = 1
itemIdsCount = ('itemIds' + count2)
while (count2 < 2):
#Do stuff
count2 = count2 + 1
```
I'm not sure if I explained this correct. But in line 4 I want to make the string to equal... | 2017/04/24 | [
"https://Stackoverflow.com/questions/43578466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7147212/"
] | Here are possible options:
1. Use `%s`
>
> itemIdsCount = 'itemIds%s' + count
>
>
>
2. Cast integer to string first
>
> itemIdsCount = 'itemIds' + str(count)
>
>
>
3. Use `.format()` method
>
> itemIdsCount = 'itemIds{}'.format(count)
>
>
>
4. If you have python 3.6, you can use F-string (Literal String I... |
18,879 | I want to be able to grab multiple media clips from my project window all at once, then drag and drop them to a timeline stacked on top of each other as opposed to side by side. Each track would take its own track in the timeline.
Sort of like keyframe assisting in after effects.
Is there a way for this to be done, m... | 2016/07/11 | [
"https://avp.stackexchange.com/questions/18879",
"https://avp.stackexchange.com",
"https://avp.stackexchange.com/users/16118/"
] | I dont believe there is any native built in way to do this. The easiest way would likely to build a simple keyboard mouse macro which can be run to repeat the action of selecting the next clip down, and adding to a new track at the start of the sequence. |
59,955,394 | I got somme issue with Symfony to convert a DateTime into string. I use a DataTransformer to format my Datetime but in the form, there is an error that say : "This value should be of type string".
Here is my code:
My Entity : Shift.php (only the necessary)
```php
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Colu... | 2020/01/28 | [
"https://Stackoverflow.com/questions/59955394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11013169/"
] | You can group by product and use conditional aggregation:
```
SELECT
[Product_ID/No], [Product_Name],
SUM(IIF(DATESERIAL(YEAR(DATE()), MONTH(DATE()), 1) = DATESERIAL(YEAR([Date]), MONTH([Date]), 1), Revenue, NULL)) AS Current_Month,
SUM(IIF(DATESERIAL(YEAR(DATEADD("m", -1, DATE())), MONTH(DATEADD("m", -1, DATE... |
132,170 | So, every time I switch to orthographic mode in Blender 2.8 (Didn't use to happen in 2.79) my model starts clipping (as shown in the video). I've tried changing the "clip start" value, but that just ruins it when I switch back over to the dynamic view.
Any ideas?
Video: <https://youtu.be/EuOuOvNPw78> | 2019/02/18 | [
"https://blender.stackexchange.com/questions/132170",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/69387/"
] | I've been having the same problem and fortunately we are not alone and somebody has already reported this bug. You can find the current state of it at the link below. It looks like it's been resolved and we're just waiting on an update now.
Bug report
<https://developer.blender.org/T61632>
Specific commit with the fi... |
66,190,751 | Problem Description:
--------------------
I am looking for a way to access the `li`-elements between two specific heading-tags only (e.g.from 2nd `h3` to 3rd `h3` or from 3rd `h3` to next `h4`) in order to create a table of historical events listed on <https://de.wikipedia.org/wiki/1._Januar> structured along the crit... | 2021/02/13 | [
"https://Stackoverflow.com/questions/66190751",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11779702/"
] | Please verify your cproj file and check if they're being excluded. You can add this to your csproj file to have the content of `wwwroot` copied over:
```
<ItemGroup>
<None Include="wwwroot\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
``` |
41,655,412 | What I'm trying to do is to center the text (and image that will be side by side or on top of the text) but the command justify-content:center doesn't work for me. It centers horizontally but not vertically. Could you tell me what went wrong? I'm actually a beginner and that's my first website.
Here's the code:
```cs... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655412",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7419823/"
] | This JS Bin is a working example of converting a File to base64: <http://jsbin.com/piqiqecuxo/1/edit?js,console,output> . The main addition seems to be reading the file using a `FileReader`, where `FileReader.readAsDataURL()` returns a base64 encoded string
```
document.getElementById('button').addEventListener('click... |
29,934,126 | sorry, I need some help finding the right regular expression for this.
Basically I want to recognize via regex if the following format is in a string:
artist - title (something)
examples:
```
"ellie goulding - good gracious (the chainsmokers remix)"
"the xx - you got the love (florence and the machine cover)"
"neneh... | 2015/04/29 | [
"https://Stackoverflow.com/questions/29934126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4844612/"
] | Well for storing images you can try this
* If you want to save images which are not coming from server and are stored in drawable/mipmap folder just store their id like
initialValues.put(COLUMN\_IMAGE, R.mipmap.demp);
* And if they are coming from server or api call just save their url and load them using any library... |
597,089 | I dual booted windows 8.0 x86 with ubuntu 14.04. Then tried accessing the volume containing windows but I got this error message:
```
Error mounting /dev/sda2 at /media/van/BE96C17E96C13823: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda2" "/media/van/... | 2015/03/15 | [
"https://askubuntu.com/questions/597089",
"https://askubuntu.com",
"https://askubuntu.com/users/388274/"
] | two things can cause this problem:
1. dont start Ubuntu after you hibernate windows. Always do proper shutdown before you start Ubuntu.
2. Disable *Hybird Shutdown* in windows. [Here](http://www.maketecheasier.com/disable-hybrid-boot-and-shutdown-in-windows-8/) is how you can do that.
now all you can do is shutdown U... |
21,004,823 | I would like to know how can I send a swipe gesture programmatically without actually swiping the phone. For instance, I have button that in the `onClick` event I would call `swipeGestureRecognizer`? Is this possible? | 2014/01/08 | [
"https://Stackoverflow.com/questions/21004823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823451/"
] | You can call the method you are calling on Swipe, when user taps on button. For examaple, you have a method for swipe gesture, call it `onSwipe` . Now call onSwipe methos when user taps on the button. Thats it
**EDIT**
Here is the code for you:
```
-(void)myMethod{
//Write the logic you want to implement for swipe ... |
49,689,536 | I have an overlay `(UIImageView)` which should have a transparent background and alpha. How can I set the `imageview` such that it covers the entire screen? Currently, it covers the screen but not the `UIStatusBar`. I am adding the view in `AppDelegate's` main `window` as a `subview`.
The code:
```
let overlay1... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49689536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8403513/"
] | After discussion in comments found that changing the `backgroundColor` of `statusBar` is the reason why your code is not working properly.
By printing the `superView` of `statusBar` I found that `statusBar` is not added on `UIWindow` instead it is on `UIStatusBarWindow` which is probably above the `mainWindow`.
Also ... |
65,971,168 | I have some lines of text, and then their relevance weight.
```
Weight, Text
10, "I like apples"
20, "Someone needs apples"
```
Is it possible to get the combinations, keeping the values in the weights column? Something like:
```
weight, combinations
10, [I like]
10, [I apples]
10, [like apples]
20, [someone needs]... | 2021/01/30 | [
"https://Stackoverflow.com/questions/65971168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14395605/"
] | To fill the first row in 2D array, use `Arrays.fill`, to fill the rest of the rows, use [`Arrays.copyOf`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#copyOf(T%5B%5D,int)).
Next, it's better to implement separate methods to perform different tasks:
1. Create and fill the grid
2. ... |
2,042 | Is there any way to manually focus the camera on my Android phone?
I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus. | 2010/10/09 | [
"https://android.stackexchange.com/questions/2042",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/113/"
] | I couldn't find a way to do it or an app that would do it. There were a couple out there that claimed to have manual focus but basically just did what you described as "assisted auto focus."
I found this thread at XDA where some people have been looking through the code to find a way to add the manual focus. From what... |
30,937,236 | i have a problem.. i have an app that connects with a database with jSON, now the problem is that he cannot find the element in the response of the database.
This is the code :
```
func uploadtoDB(){
var SelectVehicle = save.stringForKey("SelectVehicleChoosed")
if SelectVehicle == nil {
var alertVi... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30937236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5028072/"
] | ```
// serviceHistory is an Array
var serviceHistoryArray = jsonData["serviceHistory"] as! NSArray
// fetch the first item...
var serviceHistoryItem = serviceHistoryArray[0] as! NSDictionary
var serviceDate = serviceHistoryItem["serviceDate"]
var serviceType = serviceHistoryItem["serviceType"]
var kms = serviceHistory... |
44,682,639 | I'm currently developing my own calculator and I'm getting an `NumberFormatException` when I press the plus button inside it:-
```
if(e.getSource() == p) {
String a[] = new String[2];
double d[] = new double[2];
for(int i =0; i<2; i++) {
a[i] = tf.getText();
d[i] = Double.parseDouble(a[i])... | 2017/06/21 | [
"https://Stackoverflow.com/questions/44682639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7911099/"
] | You can't parse `+` inside `Double.parseDouble(String string)`
If the string does not contain a parsable double it throw `NumberFormatException`. |
946,739 | I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini).
I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss... | 2009/06/03 | [
"https://Stackoverflow.com/questions/946739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146/"
] | Here's one way to do it, using `IO#read_nonblock`:
```
def quit?
begin
# See if a 'Q' has been typed yet
while c = STDIN.read_nonblock(1)
puts "I found a #{c}"
return true if c == 'Q'
end
# No 'Q' found
false
rescue Errno::EINTR
puts "Well, your device seems a little slow..."
... |
352,121 | I'm trying to understand how to solve this differential equation:
$ [z^2(1-z)\dfrac{d^2}{dz} - z^2 \dfrac{d}{dz} - \lambda] f(z) = 0 $
I know the solution is related to the hypergeometric function $\_2F^1$, but as I recall from many sources: this functions satisfies another differential equation:
$ [z(1-z)\dfrac{... | 2020/02/07 | [
"https://mathoverflow.net/questions/352121",
"https://mathoverflow.net",
"https://mathoverflow.net/users/152035/"
] | Let $\alpha$ be a root of $\alpha^2-\alpha-\lambda=0$. The change of the dependent
variable $f(z)=z^\alpha w(z)$ reduces to the hypergeometric equation in $w$:
$$z(1-z)w''+(2\alpha(1-z)-z)w'-\alpha^2 w=0.$$ |
46,682,841 | I get this error when I try to execute my first Selenium/python code.
>
> selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions.
>
>
>
My code :
```
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
if __name... | 2017/10/11 | [
"https://Stackoverflow.com/questions/46682841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8757346/"
] | Path for driver is not set correctly, you need to set path till the .exe as shown below
```
driver = webdriver.Firefox(firefox_binary=binary,
executable_path="C:\\Users\\mohammed.asif\\Geckodriver\\geckodriver.exe")
``` |
48,494 | I'm a very new player to the Pokemon TCG, and have picked up two themed decks to play with ([Ultra Prism](https://www.pokemon.com/us/pokemon-tcg/sun-moon-ultra-prism/theme-decks/)).
So far in my experience however it seems that if one player gets their active Pokemon to its final evolution (for example [Empoleon](http... | 2019/09/02 | [
"https://boardgames.stackexchange.com/questions/48494",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/28305/"
] | Which is one of the main concepts to win a game, prepare your pokemon so that they can do massive damage and dominate the scenario (either by evolving it or get it ready with necessary energy cards).
Since we are talking about theme decks here, cards and scenarios are limited which is really beginner-friendly. Each e... |
64,176,841 | I need to add days to a date in Javascript inside of a loop.
Currently, I have this -
```
var occurences = 2;
var start_date = "10/2/2020";
for(i=0; i < occurences; i++){
var repeat_every = 2; //repeat every number of days/weeks/months
var last = new Date(start_date);
var day =last.getDate() + repeat_every;
v... | 2020/10/02 | [
"https://Stackoverflow.com/questions/64176841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4256916/"
] | You can use a multiple of your interval and then use `last.setDate( last.getDate() + repeat_every )` to add days and get the correct month and year:
```js
var occurences = 20;
var start_date = "10/2/2020";
for(i=1; i <= occurences; i++){
var repeat_every = 2*i; //repeat every number of days/weeks/months
var last =... |
10,929,506 | I save a bool value in NSUserDefaults like this:
```
[[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"];
```
And then I synchronize defaults like this:
```
[[NSUserDefaults standardUserDefaults]synchronize];
```
But when my app enters background and then enters foreground my bool changes value t... | 2012/06/07 | [
"https://Stackoverflow.com/questions/10929506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1088286/"
] | Just perform a simple test where you are saving your bool as
```
[[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"];
[[NSUserDefaults standardUserDefaults]synchronize];
NSLog(@"%d",[[NSUserDefaults standardUserDefaults] boolForKey:@"password"]);
```
see what's the value.. |
6,096,654 | I have a table with columns `user_id`, `time_stamp` and `activity` which I use for recoding user actions for an audit trail.
Now, I would just like to get the most recent timestamp for each unique `user_id`. How do I do that? | 2011/05/23 | [
"https://Stackoverflow.com/questions/6096654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192910/"
] | `SELECT MAX(time_stamp), user_id FROM table GROUP BY user_id;` |
70,672,530 | I have to create a route that uploads 1 audio file and 1 image (resized) to Cloudinary using Multer Storage Cloudinary, and save the url and name in my mongo database.
I get the error "Invalid image file" when I try to upload the audio file (even if I delete `transformation` and add "mp3" in `allowedFormats`.
Cloudina... | 2022/01/11 | [
"https://Stackoverflow.com/questions/70672530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14882708/"
] | What they mean is that `BankDataWriterImpl` should inherit from `BankDataWriterBase` like so :
```py
class BankDataWriterBase():
...
class BankDataWriterImpl(BankDataWriterBase):
# this class inherit from parent class BankDataWriterBase
# when a `BankDataWriterBase` object is created, parent.__init__ meth... |
14,372,385 | I have a UITextView that is being edited and I want to add a custom keyboard... is there any way to dismiss the keyboard but leave the textView in edit mode so the blue cursor keeps flashing? Or better yet is there any way to put a view ontop of the keyboard? | 2013/01/17 | [
"https://Stackoverflow.com/questions/14372385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2057171/"
] | You should register for notification `UIKeyboardWillShowNotification`. It will hit the registered function before displaying keyboard.
Here you can iterate through all Windows and can identify keyboard by below way:
```
for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows])
{
for (UIView *... |
6,457,699 | I am having some issues with the following query, the issue is that I need it so it displays the courses for the current day until the end of the day not just till the start of the day like it does currently. Basically users cannot access the course if they are trying to access the course on its enddate so i need to so... | 2011/06/23 | [
"https://Stackoverflow.com/questions/6457699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/487003/"
] | I think you need to modify it like this
```
enddate + INTERVAL 1 DAY >= NOW()
```
Ofcourse this adds 24 hours, for 23:59:59 just change >= to > |
133,380 | As the sole product designer in my past two startups I have been an essential piece towards bringing the product to reality (user research, ux, visual design, qa). However, in both situations I found myself not sitting at the leadership table when discussing the future of the product.
Marketing, sales, support, devel... | 2020/06/05 | [
"https://ux.stackexchange.com/questions/133380",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/103302/"
] | You Can Sit at My Table When You Improve the Things I Care About
----------------------------------------------------------------
Your owners (like the users you research) have goals, needs, tasks to accomplish, and metrics to improve so they and their business can succeed. If you want a seat at the table you will nee... |
45,835,422 | I have the following code:
```
def getContentComponents: Action[AnyContent] = Action.async {
contentComponentDTO.list().map(contentComponentsFuture =>
contentComponentsFuture.foreach(contentComponentFuture =>
contentComponentFuture.typeOf match {
case 5 =>
... | 2017/08/23 | [
"https://Stackoverflow.com/questions/45835422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4367019/"
] | You could try using the SIM Card in a normal 3G USB Dongle and an application called "[Gammu](https://wammu.eu/docs/manual/gammu/)" which can answer a call and sendDTMF codes i.e. number presses. I have only used Gammu on linux systems but I believe it works on Windows as well. |
69,981,157 | I have a text in flexbox item `.learn--text` which needs to be vertically centered, but `word-break: break-word` rule doesn't work.
This is the current state
[](https://i.stack.imgur.com/tgQ3I.png)
and desired state
[![enter image description here]... | 2021/11/15 | [
"https://Stackoverflow.com/questions/69981157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/968379/"
] | Erase all the flex settings from `learn--text` - they "divide" its content into two parts, the link and the following text, treating them as flex items and therefore units. If you erase that, the result is as follows:
```css
.learn {
display: flex;
flex: 0 0 50px;
margin-top: auto;
align-items: center;
heigh... |
43,241,784 | I'm struggling with achieving following goal: I have the API requests typed in a manner that they return either a desired value, or an error when the status code wasn't indicating success, or when the auth token has been invalid etc: `Either String r`.
Now, I don't want to care about it when I'm `eval`ing my component... | 2017/04/05 | [
"https://Stackoverflow.com/questions/43241784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/590347/"
] | You have an exceptional case where the current thread can't continue, so the only thing to do would be to throw an exception in `Aff` using `throwError :: forall eff a. Error -> Aff eff a`. |
35,362,301 | I want to order list1 based on the strings in list2. Any elements in list1 that don't correspond to list2 should be placed at the end of the correctly ordered list1.
For example:
```
list1 = ['Title1-Apples', 'Title1-Oranges', 'Title1-Pear', 'Title1-Bananas']
list2 = ['Bananas', 'Oranges', 'Pear']
list1_reordered_co... | 2016/02/12 | [
"https://Stackoverflow.com/questions/35362301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5851615/"
] | Here's an idea:
```
>>> def keyfun(word, wordorder):
... try:
... return wordorder.index(word)
... except ValueError:
... return len(wordorder)
...
>>> sorted(list1, key=lambda x: keyfun(x.split('-')[1], list2))
['Title1-Bananas', 'Title1-Oranges', 'Title1-Pear', 'Title1-Apples']
```
To make... |
61,421,408 | I want to implement a profile popup like Books app on iOS. Do you know any package or something to make this? Thank a lot.
GIF below shows the behavior that I want to implement:
<https://gph.is/g/EvAxvVw> | 2020/04/25 | [
"https://Stackoverflow.com/questions/61421408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10398593/"
] | **You can't check both the conditions using `(a == ("A" or "U"))`** because when you execute `"A" or "U"` in python interpreter you will get `"A"` (the first truthy value) similarly when you execute `"A" and "U"` you will get `"U"` (the last truthy value).
If you want simplified expression, you can use,
```
if a in (... |
41,887,434 | I have a data file ( users.dat) with entries like:
```
user1
user2
user4
user1
user2
user1
user4
...
user3
user2
```
which command I should ( grep? wc?) use to count how many times each word repeats and output it to user\_total.dat like this:
```
user1 80
user2 35
user3 18
user4 120
```
the issue is that I cannot... | 2017/01/27 | [
"https://Stackoverflow.com/questions/41887434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3741790/"
] | Use the `uniq` command to count the repetitions of a line. It requires the input to be sorted, so use `sort` first.
```
sort users.dat | uniq -c > user_total.dat
``` |
25,259,336 | I am using this url to download the magento. I registered and login but nothing happening. Every time on download it shows me login popup.
```
http://www.magentocommerce.com/download
```
Please help to let me know if i am doing something wrong. | 2014/08/12 | [
"https://Stackoverflow.com/questions/25259336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1918324/"
] | The problem is apparently a local browser issue as I was able to log in, go to the downloads page, choose and be presented with the download popup.
If the downloads page is not working for you, you can always try the direct assets link with either a web browser or wget. For example, to get Magento 1.9.0.1:
<http://ww... |
1,052,600 | The solution of the following [Lorenz system](https://en.wikipedia.org/wiki/Lorenz_system)
```
s=10; r=28; b=8/3;
f = @(t,y) [-s*y(1)+s*y(2); -y(1)*y(3)+r*y(1)-y(2); y(1)*y(2)-b*y(3)];
```
in the interval $[0,8]$ with initial values $y\_1(0)=1$,$y\_2(0)=0$,$y\_3(0)=0$ using MATLAB `ode45()` function are
```
>> [t y... | 2014/12/05 | [
"https://math.stackexchange.com/questions/1052600",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/96402/"
] | Basically, if we can write one vector in our set as a linear combination of the others, then that initial vector is linearly dependent with the rest of the vectors.
Note that $v\_{4} = 0v\_{3} + v\_{2} + v\_{1}$ is a linear combination of $v\_{1}, v\_{2}, v\_{3}$. So if a vector in the set doesn't play a role in the ... |
55,485,823 | I have an array of objects like so:
```js
[
{
id: 'a',
name: 'Alan',
age: 10
},
{
id: 'ab'
name: 'alanis',
age: 15
},
{
id: 'b',
name: 'Alex',
age: 13
}
]
```
I need to pass an object like this `{ id: ... | 2019/04/03 | [
"https://Stackoverflow.com/questions/55485823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2183384/"
] | I *think* you're looking for something like this? Would basically be doing a string.includes match on the value of each key in your filter object--if one of the key values matches then it will be included in the result. If you wanted the entire filter object to match you could do `.every` instead of `.some`...
```
con... |
3,997,905 | I have a webpage having four Checkboxes as follows:
```
<p>Buy Samsung 2230<label>
<input type="checkbox" name="checkbox1" id="checkbox1" />
</label></p>
<div id="checkbox1_compare" style="display: none;"><a href="#">Compair</a></div>
<p>Buy Nokia N 95<label>
<input type="checkbox" name="checkbox2" id="checkbox2" /></... | 2010/10/22 | [
"https://Stackoverflow.com/questions/3997905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/484156/"
] | This might be what you want:
```
$(function() {
$('input:checkbox').change(function() {
var $ck = $('input:checkbox:checked');
$('input:checkbox').each(function() {
$('#' + this.id + '_compare').hide();
});
if ($ck.length > 1) {
$ck.each(function() {
$('#' + this.id + '_compare').... |
38,193,503 | I think I'm being dense here because I keep getting a `stack too deep` error...
I have a `Child` and a `Parent` relational objects. I want 2 things to happen:
* if you try to update the `Child`, you cannot update its `status_id` to `1` unless it has a `Parent` association
* if you create a `Parent` and then attach it... | 2016/07/04 | [
"https://Stackoverflow.com/questions/38193503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2731253/"
] | There's a lot that I find confusing here, but it seems to me that you call `:set_complete` after\_update and within `set_complete` you are updating attributes, thus you seem to have a perpetual loop there. There might be other loops that I can't see but that one stands out to me. |
207,586 | I would like to have the words 'to mean' and the following mathematical statement to be on the same straight line. Thank you very much!
```
\documentclass[11pt,a4paper]{article}
\usepackage{blindtext}
\usepackage{mathtools}
\DeclareMathOperator{\sgn}{sgn}
\begin{document}
\begin{flalign*}
... | 2014/10/17 | [
"https://tex.stackexchange.com/questions/207586",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/61127/"
] | Try this.
```
\documentclass[11pt,a4paper]{article}
\usepackage{mathtools}
\begin{document}
\begin{flalign*}
&3=+1+1+1 & \\
\intertext{to mean}
&(+1+1+1)=+1+1+1,&
\end{flalign*}
\end{document}
```
 |
12,419,812 | Is there any way to find the version of Jquery using normal plain javascript.
I know to do this using JQuery itself by using the following code.
```
jQuery.fn.jquery;
```
or
```
$().jquery;
```
But this wont works for me beacuse I am not allowed to use Jquery code. Please suggest any alternative methods using onl... | 2012/09/14 | [
"https://Stackoverflow.com/questions/12419812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1648144/"
] | ```
jQuery.fn.jquery
```
is a plain JavaScript property. This has nothing to do with 'using jQuery', so that's a proper 'JavaScript' way of getting jQuery's version.
*Edit:* If you just need to check, if a version of jQuery already exists, you can simply test for `window.jQuery`:
```
if ("jQuery" in window) {
/... |
599,960 | I guess `~/.config` (`XDG_CONFIG_HOME`) is not correct because that way users have to be constantly aware which files are safe to commit to their dotfiles repository. | 2020/07/23 | [
"https://unix.stackexchange.com/questions/599960",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/4393/"
] | You'd rather want:
```
grep -rilZ 'first_string' . | xargs -r0 grep -Hi 'second_string'
```
assuming GNU utilities (which you seem to be having as you're already using the `-r` GNU extension).
That is:
* use `-Z` and `xargs -0` to reliably pass the list of paths (which on Unix-like systems can contain any byte val... |
6,707,720 | I would like to know how I can change the date in my "selectedDate" with jquery datepick. Here's my HTML where I want the magic to show
```
<h3>Historique des tâches (<span class="selectedDate"><?= date("Y-m-d");?></span>) <span class="chooseDate">Choisir date</span> <span class="taskDate"></span></h3>
```
And the j... | 2011/07/15 | [
"https://Stackoverflow.com/questions/6707720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/845217/"
] | Usually the downgrade in performance is only when creating the connection to the database. That operation is intensive for all provider types.
Someone please correct me if I'm wrong, but as of .NET4 Microsoft has created an Oracle driver which I believe allows LINQ to SQL. I know it was in the works at one point and I... |
30,694,305 | This code gives me... array? with columns and data, as i understand
console.log
```
{ columns: [ 'n.name' ],
data: [ [ '(' ], [ 'node_name' ], [ ';' ], [ 'CREATE' ], [ ')' ] ] }
```
Code
```
function show() {
var cypher = [
'MATCH (n)-[r:CREATE_NODE_COMMAND]->(s)RETURN n.name'
].join('\n');
... | 2015/06/07 | [
"https://Stackoverflow.com/questions/30694305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4967368/"
] | If you want to return a map of `key : value` in the cypher result set you can change the return statement to something like this...
```
return { name : n.name }
``` |
34,490 | I'm new to the Raspberry Pi community and to working with electricity, so I'm looking for some advice.
I've brought the WS2801 LED strip from eBay (but I think it's the same as this: <https://www.sparkfun.com/products/retired/11272>). Using a computer PSU I've connected the LED strip power to my 5V molex rail and data... | 2015/08/16 | [
"https://raspberrypi.stackexchange.com/questions/34490",
"https://raspberrypi.stackexchange.com",
"https://raspberrypi.stackexchange.com/users/33814/"
] | What you are suggesting sounds fine to me (but I'm not an electronics type so treat anything I say with caution).
As the Pi and LED strip will have a common ground you don't need to connect a Pi ground to the LED strip ground. If you ever use a separate power supply for the Pi and the LED strip you will have to join t... |
14,286,230 | Is it possible to test two `EXISTS` conditions in a single `IF` SQL statement? I've tried the following.
```
IF EXIST (SELECT * FROM tblOne WHERE field1 = @parm1 AND field2 = @parm2)
OR
EXIST (SELECT * FROM tblTwo WHERE field1 = @parm5 AND field2 = @parm3)
```
I've tried playing with adding additional `IF` ... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1142433/"
] | If SQL Server
```
IF EXISTS (SELECT *
FROM tblOne
WHERE field1 = @parm1
AND field2 = @parm2)
OR EXISTS (SELECT *
FROM tblTwo
WHERE field1 = @parm5
AND field2 = @parm3)
PRINT 'YES'
```
Is fine, note the only thing... |
69,792,953 | I have Json Data through which I'm doing this .
```
fun getFact(context: Context) = viewModelScope.launch{
try {
val format = Json {
ignoreUnknownKeys = true
prettyPrint = true
isLenient = true
}
val factJson = context.assets.open("Facts.json").buffered... | 2021/11/01 | [
"https://Stackoverflow.com/questions/69792953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11630186/"
] | Composables can only recompose when you update state data. You aren't doing that. Your click event should return the new quote that you want to display. You then set `fact.value` to the new quote. Calling `fact.value` with a new value is what triggers a recompose:
```
when (val result = viewModel.uiState.collectAsStat... |
37,310,398 | I want to make the length of one of my divs longer on a button click, however the jquery doesn't seem to be working. Here's the script.
```
<script type="text/javascript">
$(document).ready(function(){
function extendContainer() {
$('#thisisabutton').click(function() {
$('#one').animate({
... | 2016/05/18 | [
"https://Stackoverflow.com/questions/37310398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6304516/"
] | The solution you came up with yourself for now is the best what you could do.
We discussed whether we should expose any other API for singular backlinks, but as there is no way to enforce their multiplicity on the data storage layer, it didn't made sense so far. In addition, you would still need a wrapper object, so t... |
18,561 | In the Pokemon School, you can create a group and other players can join. I created and some friends of mine joined. The NPC says something about syncing events.
What does being in a group do? What kind of things does it sync? | 2011/03/18 | [
"https://gaming.stackexchange.com/questions/18561",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/7902/"
] | >
> Joining a group is a feature introduced in Generation IV. Players in the same group encounter the same swarming Pokémon, weather conditions, changing Pokémon in the Great Marsh, Feebas location, and other things each day. Group members can compare records on the third floor of Jubilife TV.
>
>
>
Source: [Bulba... |
50,898,924 | I have coo\_matrix `X` and indexes `trn_idx` by which I would like to get access of that maxtrix
```
print (type(X ), X.shape)
print (type(trn_idx), trn_idx.shape)
<class 'scipy.sparse.coo.coo_matrix'> (1503424, 2795253)
<class 'numpy.ndarray'> (1202739,)
```
Calling this way:
```
X[trn_idx]
TypeError: only integ... | 2018/06/17 | [
"https://Stackoverflow.com/questions/50898924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1739325/"
] | The `coo_matrix` class does not support indexing. You'll have to convert it to a different sparse format.
Here's an example with a small `coo_matrix`:
```
In [19]: import numpy as np
In [20]: from scipy.sparse import coo_matrix
In [21]: m = coo_matrix([[0, 0, 0, 1], [2, 0, 0 ,0], [0, 0, 0, 0], [0, 3, 4, 0]])
```
... |
50,645,382 | I am creating several mobile applications in react-native that share common components. I have difficulties handling the dependencies. Here is what I do, which is tedious, is there a better way?
* A repository "common-modules" has shared components
* Several repositories include the common one as a dependency like thi... | 2018/06/01 | [
"https://Stackoverflow.com/questions/50645382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2197181/"
] | I've heard of projects that share code being managed in a monorepo. That may help managing shared code but won't solve the problem of linking native modules N times for N apps.
However, there is `react-native link` that should automate the process, and ease linking the native modules a lot. Note there is no need to re... |
28,249,388 | How to store the temporary data in Apache storm?
In storm topology, bolt needs to access the previously processed data.
```
Eg: if the bolt processes varaiable1 with result as 20 at 10:00 AM.
```
and again `varaiable1` is received as `50` at `10:15 AM` then the result should be `30 (50-20)`
later if varaiable1 re... | 2015/01/31 | [
"https://Stackoverflow.com/questions/28249388",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2431957/"
] | In short, you wanted to do micro-batching calculations with in storm’s running tuples.
First you need to define/find key in tuple set.
Do field grouping(don't use shuffle grouping) between bolts using that key. This will guarantee related tuples will always send to same task of downstream bolt for same key.
Define cla... |
67,723,390 | **I'm trying to predict probability of X\_test and getting 2 values in an array. I need to compare those 2 values and make it 1.**
when I write code
```
y_pred = classifier.predict_proba(X_test)
y_pred
```
It gives output like
```
array([[0.5, 0.5],
[0.6, 0.4],
[0.7, 0.3],
...,
[0.5, 0.... | 2021/05/27 | [
"https://Stackoverflow.com/questions/67723390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15224778/"
] | Try
```
"string0;string1;string2".split(';')
```
Further reading:
<https://python-reference.readthedocs.io/en/latest/docs/str/split.html> |
32,602,441 | I have 3 unread messages. For this reason, I have to show `3` at the top of a message like this picture:
[](https://i.stack.imgur.com/iSjcI.png)
How can I do this? PLease help me. | 2015/09/16 | [
"https://Stackoverflow.com/questions/32602441",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1282443/"
] | I think this repo will help you.
<https://github.com/jgilfelt/android-viewbadger>
[](https://i.stack.imgur.com/ZEyse.png) |
2,090,753 | I know that a symmetric tensor of symmetric rank $1$ can be viewed as a point on the so-called *Veronese variety*. A symmetric tensor of rank $r$ is then in the linear space spanned by $r$ points of the Veronese variety. My question is the following: can any given symmetric tensor of **rank $1$** ever reside in the lin... | 2017/01/09 | [
"https://math.stackexchange.com/questions/2090753",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/405499/"
] | Your question is: Can a given symmetric tensor of rank $1$ be written as a linear combination of other symmetric tensors of rank $1$? The answer is yes. Yes, a symmetric tensor of rank $1$ can be written as a linear combination of other symmetric tensors of rank $1$. This is true over the complex numbers, the real numb... |
308,615 | I am fairly new to JavaEE, so I have some concepts still missing.
I am learning Docker to use it in our DEV / CI Build environments. I could make it work on my machine. But for it to work in the CI server, my current approach would be to store the docker-compose.yml and dockerfiles in git and, in the CI server download... | 2016/01/28 | [
"https://softwareengineering.stackexchange.com/questions/308615",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/7764/"
] | For point 1. and 3. You could create private Ivy repository and fetch DB Drivers and Modules from it via your Build tool ( Mvn, Ant, Gradle support getting dependencies from Ivy repos ) when building your app.
And for `.xml` files - you can have git repository for your Test Environment config files. Or have them encry... |
35,214,887 | I have this call:
```
get_users('meta_key=main_feature&value=yes');
```
but the query is also returning users with the meta key 'featured' set to yes as well. I have a plugin that allows me to check all the user meta and have confirmed that the meta key for users that shouldn't be showing up is empty.
Is there som... | 2016/02/05 | [
"https://Stackoverflow.com/questions/35214887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
jQuery(document).ready(function($) {
var e = "mailto:jbob@live.com";
$("footer .copyright").append('<div> Website by <a href="' + e + '" target="_top">John Bob</a></div>');
});
```
Pretty close. |
65,044,704 | I am trying to write a test with the new cypress 6 interceptor method ([Cypress API Intercept](https://docs.cypress.io/api/commands/intercept.html)). For the test I am writing I need to change the reponse of one endpoint after some action was performed.
**Expectation:**
I am calling cy.intercept again with another fi... | 2020/11/27 | [
"https://Stackoverflow.com/questions/65044704",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2844348/"
] | Slightly clumsy, but you can use one `cy.intercept()` with a [Function routeHandler](https://docs.cypress.io/api/commands/intercept.html#Intercepting-a-response), and count the calls.
Something like,
```
let interceptCount = 0;
cy.intercept('http://localhost:4200/testcall', (req) => {
req.reply(res => {
... |
44,879,049 | I do not want to manually type in thousands of posts from my old website on the front end of my new website. I simply want to merge the database from the old into the new website in phpmyadmin. I'll tweak the tables to suit the new software afterwards.
1. I think there are only four tables that need to be merged for m... | 2017/07/03 | [
"https://Stackoverflow.com/questions/44879049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1069432/"
] | **Setup**
Consider the dataframes `inventory` and `replace_with`
```
inventory = pd.DataFrame(dict(Partnumbers=['123AAA', '123BBB', '123CCC']))
replace_with = pd.DataFrame(dict(
oldPartnumbers=['123AAA', '123BBB', '123CCC'],
newPartnumbers=['123ABC', '123DEF', '123GHI']
))
```
**Option 1**
... |
1,246,300 | So this is probably really simple but for some reason I can't figure it out. When I run the below code I can't get it to go into the `if` statement even though when I go into the debugger console in xcode and I execute `po [resultObject valueForKey:@"type"]` it returns `0`. What am I doing wrong? Thanks for your help!
... | 2009/08/07 | [
"https://Stackoverflow.com/questions/1246300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149839/"
] | The result of `valueForKey:` is always an object — and the only object equal to 0 is nil. In the case of a numerical value, it will be an NSNumber. At any rate, I think you want to ask for `[[resultObject valueForKey:@"type"] intValue]`. |
71,860,572 | ```
#include <string>
void foo(int x, short y, int z) { std::cout << "normal int" << std::endl; } //F1
void foo(double x, int y, double z) { std::cout << "normal double" << std::endl; } //F2
int main()
{
short x = 2;
foo(5.0, x, 8.0);
}
```
Based on function overloading rules,
F1( Exact = 1, Promote = 0, Con... | 2022/04/13 | [
"https://Stackoverflow.com/questions/71860572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14250223/"
] | Overload resolution can get complicated. But here it's fairly straightforward. I'll rewrite the function prototypes to remove the third argument, since it doesn't affect the analysis.
```
void foo(int, short);
void foo(double, int);
double d = 1.0;
short s = 2;
f(d, s); // ambiguous
```
The rule is that you look a... |
19,724,319 | In JavaScript, I have complex objects comprising functions, variables and closures.
These objects are very large, very complex and created and destroyed over and over again. I will be working on a very low-powered, very low-memory device, so it's important to me that when the objects are deleted that they are really g... | 2013/11/01 | [
"https://Stackoverflow.com/questions/19724319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/681800/"
] | You will have the best effect by doing this
```
window.obj = null;
delete window.obj;
```
Setting objects to null removes any references to it. Also remember that the delete command has no effect on regular variables, only properties.
To better ensure object destruction you may consider not using the global context... |
10,196,344 | Does any body know what I have to check if my app freezes? I mean, I can see the app in the iPad screen but no buttons respond. I have tried debugging the code when I click on the button, but I haven't seen anything yet. I was reading about the Instruments tools; specifically how do I use them?
Can anybody help me? I ... | 2012/04/17 | [
"https://Stackoverflow.com/questions/10196344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1013554/"
] | It sounds like you've blocked the main thread somehow. To debug, run the app in the debugger and when the app freezes, hit the pause button above the log area at the bottom of Xcode. Then on the left side, you'll be able to see exactly what each thread is doing, and you can see where it's getting stuck.
[![pause butto... |
71,198,618 | ```
const howLong = 5
```
```
let special = [
"!",
"@",
"#",
"$",
"%",
"+",
"&",];
let finalPassword = []
for (let i = 0; i < howLong; i++) {
finalPassword += special[Math.floor(Math.random() * howLong)].push
}
```
console prints undefined 5x, my goal is to make it copy 5 random ... | 2022/02/20 | [
"https://Stackoverflow.com/questions/71198618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17978619/"
] | you should remove the .push call
```
const howLong = 5;
let special = [
"!",
"@",
"#",
"$",
"%",
"+",
"&",];
let finalPassword = "";
for (let i = 0; i < howLong; i++) {
finalPassword += special[Math.floor(Math.random() * howLong)]
}
... |
519,113 | Why I can write formula derivative $$ f'(x) = \lim\_{h\rightarrow 0}\frac{f(x+h)-f(x)}{h}$$ in this form: $$ f'(x)=\frac{f(x+h)-f(h)}{h}+O(h)$$
I know, that it's easy but unfortunately I forgot. | 2013/10/08 | [
"https://math.stackexchange.com/questions/519113",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99324/"
] | The formula $f'(x) = \lim\_{h \to 0} \frac{f(x+h)-f(x)}{h}$ is equivalent to
$\lim\_{h \to 0} \frac{f(x+h)-f(x)-f'(x)h}{h} = 0$.
This in turn is equivalent to the function $g(h) = f(x+h)-f(x)-f'(x)h$ satisfying $\lim\_{h \to 0} \frac{g(h)}{h} = 0$.
Such a function is referred to as 'little o' or $o(h)$, and we say $... |
18,863 | I have this code
```
$collection = Mage::getModel("news/views");
->addFieldToSelect('post_id', array('eq' => $this->getRequest()->getParam("id")));
```
And when i'm trying to save my post i get en error:
>
> Invalid method Iv\_News\_Model\_Views::addFieldToSelect(Array ( [0] =>
> post\_id [1] => Array ( [eq] => ... | 2014/04/25 | [
"https://magento.stackexchange.com/questions/18863",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/6086/"
] | The `addFieldToSelect` is available for collection objects. It is defined in `Mage_Core_Model_Resource_Db_Collection_Abstract` so it is available in all its child classes.
You are calling it on a model object that most probably is a child of `Mage_Core_Model_Abstract`.
I think you meant to do this:
```
$collectio... |
46,303,233 | I cannot find a solution to this particular demand.
I have a mysql dump on my computer and I want to import it in a web server using SSH.
How do I do that ?
Can I add the ssh connection to the mysql command ?
Edit :
I did it with SCP
```
scp -r -p /Users/me/files/dump.sql user@server:/var/www/private
mysql -hxxx -u... | 2017/09/19 | [
"https://Stackoverflow.com/questions/46303233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1787994/"
] | As the comment above says, the simplest solution is to scp the whole dump file up to your server, and then restore it normally. But that means you have to have enough free disk space to store the dump file on your webserver. You might not.
An alternative is to set up a temporary ssh tunnel to your web server. Read <ht... |
17,058 | We have ants in our house, and nothing I've tried so far has been sufficiently successful. Now I'm considering using ant traps, but only under the kitchen cabinets behind the plinth, a place where neither my cats nor my kids (a baby and a toddler) would ever be able to reach them (no chance of them getting in there). W... | 2017/05/09 | [
"https://pets.stackexchange.com/questions/17058",
"https://pets.stackexchange.com",
"https://pets.stackexchange.com/users/2554/"
] | I don't think it is overstocked at the moment.
But these are all schooling fish and they might be happier if the schools are a bit bigger.
A better mix would be to remove 2 species (eg the tetra's and the barbs) and replace them with the other species (more corys and rainbows for example).
6-7 fish for a 's... |
5,058 | When running MSM add-on, how can I manage the file upload folders etc, via a config.php file?
Ideally I would want to use a hook to do it, but it doesn't seem to work.
Normally I would do this:
>
>
> ```
> $config['upload_preferences'] = array(
> 1 => array(
> 'name' => 'Images',
> ... | 2013/01/18 | [
"https://expressionengine.stackexchange.com/questions/5058",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/362/"
] | Actually, every upload location you create is going to have a different ID, be it one site or in multiple sites using MSM. You can thus safely keep everything in config.php becuse every upload location you define (even if you share physical folders) is going to have a different ID anyway.
Basically:
* Step 1: create ... |
71,595,153 | I made a simple 1 button LED dimmer and I would like to have the LED go back to full brightness after the button has not been touched for a set amount of time. But the code I came up with does not seem to be working as I cannot dim the LED
```
int buttonPin = 12;
int LEDPin = 3;
int buttonVal;
int LEDbright = 0;
int d... | 2022/03/23 | [
"https://Stackoverflow.com/questions/71595153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14318258/"
] | Your question doesn't seem to line up with how the code was written. It looks like you want to do the opposite (have the light get brighter when the button is held down, and then switch off 60 seconds after the button was released).
Here's the code I came up with to help with your stated problem:
```
int buttonPin = 1... |
6,542,566 | How do you get last 3 words from the string?
I managed to get working doing like this:
```
$statusMessage = explode(" ", str_replace(' '," ",$retStatus->plaintext));
$SliceDate = array_slice($statusMessage, -3, 3);
$date = implode(" ", $SliceDate);
echo $date;
```
Is there a shorter way? Maybe there is a PHP f... | 2011/07/01 | [
"https://Stackoverflow.com/questions/6542566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/622378/"
] | explode() is good, but once you've done that you can use
```
$size = sizeof($statusMessage);
```
and last 3 are
```
$statusmessage[$size-1];
$statusmessage[$size-2];
$statusmessage[$size-3];
``` |
64,037,433 | I have some code but I just found out it works on like 90% of the computers. Here is the distinguishedName:
*CN=2016-10-05T12:19:16-05:00{393DA5A5-4EEF-4394-90F7-CBD0D2F20CC9},CN=**Computer01-T2**,OU=Product,OU=Workstations,OU=KDUYA,DC=time,DC=local*
What I am trying to do is parse out just the ComputerName. 3 of the ... | 2020/09/23 | [
"https://Stackoverflow.com/questions/64037433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12201298/"
] | I don't think they have support for geometry buffers at this stage. ST\_AREA isn't going to help you. Last I heard they are working on improving their geospatial support.
That said, can you buffer your data somewhere else in your workflow? Such as using shapely buffer in python, or turf circle/buffer in javascript? |
26,830,227 | The following is my code for positioning text over image. The requirements are:
1. Image should be adapt to screen automatically. Even on smart phone, the image should be displayed completely. Only showing part of the image is not allowed.
2. Text should be accurately positioned anywhere I wish.
```css
.txtimg{
po... | 2014/11/09 | [
"https://Stackoverflow.com/questions/26830227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2336707/"
] | I can't reproduce the problem on this specific code, but i know the problem. Simply add a vertical-align on the image.
```
.txtimg img {
max-width: 100%;
height: auto;
vertical-align: bottom;
}
```
This also work like this :
```
.txtimg img {
max-width: 100%;
height: auto;
display: inline-block;
}
``` |
3,402,360 | Given any bounded set $E$ in $\mathbb{R}^{N}$, is there a general way to choose a sequence $(G\_{n})$ of open sets such that $\chi\_{G\_{n}}\downarrow\chi\_{E}$ pointwise?
Here $\chi$ denotes the characteristic/indicator function on $E$.
One may think of $G\_{n}:=E+B(0,1/n)$, but we have instead that $\chi\_{G\_{n}}\... | 2019/10/21 | [
"https://math.stackexchange.com/questions/3402360",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/284331/"
] | Let $\mu$ denote Lebesgue measure on $\Bbb R^N. $
If $E$ is $\mu$-measurable then there exists a sequence $(G\_n)\_n$ of open sets such that $E\subset \cap\_nG\_n$ and $\mu(\,(\cap\_nG\_n)\setminus E\,)=0.$
Let $H\_n=\cap \{G\_j:j\le n\}.$
If $p\in E$ then $\chi\_{H\_n}(p)=1=\chi\_E(p)$ for all $n.$
If $p\not \in ... |
42,653,910 | isInSet requires two arguments, but binds passes only theSet as first argument. I am not able to figure out how bind method works in this case
```
function isInSet(set , person) {
return set.indexOf(person.name) > -1;//checks for existence of person.name in theSet
}
console.log(ancestry .filter(function(person) {
retu... | 2017/03/07 | [
"https://Stackoverflow.com/questions/42653910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7659474/"
] | Read the text from the book a few times and compare the unbound and the bound version.
Calling `.bind()` on a function, return a new function, with some of the arguments already filled in. The isInSet function, expects two parameters: the set to filter, and a person having a name.
The `.filter()` method of an array, ... |
10,663 | I received a new iPhone yesterday and connected it to my home Wifi network.
On content heavy sites it runs perfectly fine, but if I use either the Youtube site or the Youtube app I can't watch anything. It takes forever to watch 5 seconds of video.
My first question is, how can I be sure that my phone is using local ... | 2011/03/22 | [
"https://apple.stackexchange.com/questions/10663",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/1434/"
] | Yes, you can have both versions. In fact you can install the new Firefox in your home directory's Application folder (and it will be only accessible with your account). If you don't have ~/Applications folder, you can create it (and Finder will mark it with the same icon as the /Applications one). Note that you cannot ... |
4,382 | I have seen one form of using *avoir*, recently, like this: **à avoir eu**.
I forgot the phrase itself, but, for example in this phrase I just found in Google:
>
> Les jeunes de l’OM sont 2 sur 14 à avoir eu le bac cette année.
>
>
>
What kind of form is it? When/Where it supposed to be used?.. | 2012/11/06 | [
"https://french.stackexchange.com/questions/4382",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/1606/"
] | This *à* is a preposition and is not part of the verb form. This sentence is based on the construction “***être*** [un certain nombre] **à**” like in:
>
> Ils **sont** 3 sur 4 **à** regarder la télé plus de trois heures par jour.
>
> Ils **sont** plus de la moitié **à** regretter son départ.
>
>
>
This prepos... |
10,234,208 | When I link a library such as libm in with ld, I need to drop the lib prefix. What if the file does not follow this naming convention? Is there a way to link it other than renaming the file? | 2012/04/19 | [
"https://Stackoverflow.com/questions/10234208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/445087/"
] | You can link against any library, e.g. `foo.a`, by specifying full path to it on the link line:
```
gcc main.o /path/to/foo.a
```
What you lose with non-standard library name is the ability for the linker to search for it, e.g. this will not work:
```
gcc main.o -L/path/to foo.a
```
You can avoid that lack of sea... |
17,630,368 | Will the contents and rendering output be indexed by Google and other search engines?
Code:
```
<script>
var html = '<!DOCTYPE html>';
html += '<html>';
html += '<head>';
html += '<meta charset="utf8" />';
html += '<title>This Is The Stacked Overflown Network</title>';
html += '<meta name="description" value="i, are... | 2013/07/13 | [
"https://Stackoverflow.com/questions/17630368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | That's *definitely* **not** a good style of writing Webpages.
Many crawlers *don't run* JavaScript at all.
Though it may be possible that JavaScript *source code* gets indexed to some extent, this content is very unlikely to get high rating.
The *result* of the script *may* be indexed by Google, but some crawlers ... |
19,001,457 | I have created one group of radio buttons in a table like
```
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td>
<input type="radio" name="radios" id="8-9" />
<label for="8-9">08-09 am</label>
</td>
</tr>
<tr>
... | 2013/09/25 | [
"https://Stackoverflow.com/questions/19001457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814574/"
] | Check this : <http://jsfiddle.net/ChaitanyaMunipalle/R4htK/>
First you have to reset css of parent of radio buttons and then set which ever is checked.
```
$('input[name=radios]').on('change', function() {
$('input[name=radios]').parent().css("background-color", "#ff0000");
$('input[name=radios]').parent().cs... |
44,541,048 | I have already done some searches, and this question is a duplicate of another post. I am posting this just for future reference.
Is it possible to define SUMPRODUCT without explicitly using variable names x, y?
Original Function:
```
let SUMPRODUCT x y = List.map2 (*) x y |> List.sum
SUMPRODUCT [1;4] [3;25] // R... | 2017/06/14 | [
"https://Stackoverflow.com/questions/44541048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7676509/"
] | Function composition only works when the input function takes a single argument. However, in your example, the result of `List.map2 (*)` is a function that takes two separate arguments and so it cannot be easily composed with `List.sum` using `>>`.
There are various ways to work around this if you really want, but I w... |
323,978 | how to prove $\forall n$ : $p\_1p\_2...p\_n +1$ isn't the perfect square. $p\_i$ is $i$th prime number. | 2013/03/07 | [
"https://math.stackexchange.com/questions/323978",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/48921/"
] | Let $n \ge 1$. Since $2$ is the first prime, our product is even. Thus $p\_1\cdots p\_n+1$ is odd. Suppose it is equal to the odd perfect square $m^2$.
Note that $m^2-1$ is divisible by $4$, indeed by $8$. But $p\_1\cdots p\_n$ is not divisible by $4$. Thus $p\_1\cdots p\_n+1$ cannot be a perfect square.
**Remark:**... |
133,767 | Inspired by [this](https://codegolf.stackexchange.com/questions/125470/multiply-two-strings) challenge (thanks @cairdcoinheringaahing for the title!), your task is to take two printable ASCII strings and multiply them element-wise with the following rules.
### How does it work?
Given two strings (for example `split` ... | 2017/07/21 | [
"https://codegolf.stackexchange.com/questions/133767",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/48198/"
] | [MATL](https://github.com/lmendo/MATL), 12 bytes
================================================
```
c32-p95\32+c
```
[**Try it online!**](https://tio.run/##y00syfn/P9nYSLfA0jTG2Eg7@f//avXigpzMEnUdBfXM4qQ89VoA "MATL – Try It Online")
### Explanation
```
c % Implicitly input cell array of 2 strings. Convert t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.