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
54,910,839
I am using cryptography to load a new certificate and retrieve its attributes. ``` from cryptography import x509 from cryptography.hazmat.backends import default_backend path = "mycert.crt" with open(path, 'rb') as cert_file: data = cert_file.read() cert = x509.load_pem_x509_certificate(data, default_backend()) s...
2019/02/27
[ "https://Stackoverflow.com/questions/54910839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5837280/" ]
If you want to inspect an object and find it's attributes, try the `dir()` function: ``` >>> dir(sign) >>> ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__',...
For the second part of the question, I am writing here the answer. ``` >>> cert.issuer >>> for attribute in cert.issuer: ... print(attribute.oid._name) ... print(attribute.value) countryName GR stateOrProvinceName Blah localityName Blah organizationName MyTrust organizationalUnitName MyTrust commonName MyTrust ``` ...
5,614,065
I am working on a project using Hibernate and Spring; single screen, one bean, but two tables. I wanted to know if Hibernate can update *two* MySQL tables within a single call? If so, how do I code the following bean (model) to update two tables! User name and password is in the user table. User name and enabled is i...
2011/04/10
[ "https://Stackoverflow.com/questions/5614065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2144370/" ]
You'll need to use a [@SecondaryTable](http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/#d0e2235) annotation and specify the name of that table in appropriate @Column annotations: ``` @Entity @Table(name="users") @SecondaryTable(name="rights", pkJoinColumns= @PrimaryKeyJoinColumn(name="user...
I'm pretty sure you cannot do this. In some sense, ORM is about mapping one row to one object. The best you can do is use a SQL view to create a read-only structure corresponding to this bean. That would allow you to query your data into the structure you've devised, but you would not be able to do updates.
5,614,065
I am working on a project using Hibernate and Spring; single screen, one bean, but two tables. I wanted to know if Hibernate can update *two* MySQL tables within a single call? If so, how do I code the following bean (model) to update two tables! User name and password is in the user table. User name and enabled is i...
2011/04/10
[ "https://Stackoverflow.com/questions/5614065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2144370/" ]
You'll need to use a [@SecondaryTable](http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/#d0e2235) annotation and specify the name of that table in appropriate @Column annotations: ``` @Entity @Table(name="users") @SecondaryTable(name="rights", pkJoinColumns= @PrimaryKeyJoinColumn(name="user...
IF you require it to be in a different table, do something like this ``` class User { Long userid; String username; // why both a userid and a username? String password; Rights rights; } class Rights { boolean enabled; boolean canModerate; int maxSomething; // other rights here } ```
3,450,513
I'm writing an NSIS installer for a project that requires the PyOpenGL package, however installation of this package fails because my system doesn't contain `mscvr71.dll` (VS C runtime lib). According to [KB326922](http://support.microsoft.com/kb/326922), this library should have been packaged with PyOpenGL. My questi...
2010/08/10
[ "https://Stackoverflow.com/questions/3450513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2567/" ]
It's easy to achieve, just don't use KeyBinding for this. Handle your TextBox's OnKeyDown event: ``` <TextBox KeyDown="UIElement_OnKeyDown" ... ``` Then on the code-behind, execute your command whenever Tab is pressed. Unlike KeyBinding, this won't swallow the TextInput event so it should work. ``` private void...
I cannot find a way to set focus to a control given your question as a purely XAML solution. I choose to create an attacted property and then through binding set the focus to next control from the Command associated with your KeyBinding in the ViewModel. Here is the View: ``` <Window x:Class="WarpTab.Views.MainVie...
3,450,513
I'm writing an NSIS installer for a project that requires the PyOpenGL package, however installation of this package fails because my system doesn't contain `mscvr71.dll` (VS C runtime lib). According to [KB326922](http://support.microsoft.com/kb/326922), this library should have been packaged with PyOpenGL. My questi...
2010/08/10
[ "https://Stackoverflow.com/questions/3450513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2567/" ]
It's easy to achieve, just don't use KeyBinding for this. Handle your TextBox's OnKeyDown event: ``` <TextBox KeyDown="UIElement_OnKeyDown" ... ``` Then on the code-behind, execute your command whenever Tab is pressed. Unlike KeyBinding, this won't swallow the TextInput event so it should work. ``` private void...
Why don't you just use this code in your command handler? ``` private void MyCommandHandler(){ // Do command's work here TraversalRequest request = new TraversalRequest(FocusNavigationDirection.Next); request.Wrapped = true; control.MoveFocus(request); } ``` That's basically what 'Tab' does, so if...
3,450,513
I'm writing an NSIS installer for a project that requires the PyOpenGL package, however installation of this package fails because my system doesn't contain `mscvr71.dll` (VS C runtime lib). According to [KB326922](http://support.microsoft.com/kb/326922), this library should have been packaged with PyOpenGL. My questi...
2010/08/10
[ "https://Stackoverflow.com/questions/3450513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2567/" ]
It's easy to achieve, just don't use KeyBinding for this. Handle your TextBox's OnKeyDown event: ``` <TextBox KeyDown="UIElement_OnKeyDown" ... ``` Then on the code-behind, execute your command whenever Tab is pressed. Unlike KeyBinding, this won't swallow the TextInput event so it should work. ``` private void...
Had the same problem, came across this thread and took me a while to find the best answer. Reference: [Use EventTrigger on a specific key](https://stackoverflow.com/questions/7798557/use-eventtrigger-on-a-specific-key) Define this class: ``` using System; using System.Windows.Input; using System.Windows.Interactivity;...
20,650,720
Daemon **X** spawns process **Y**. Sometimes daemon **X** could die abruptly and in that case it did not have a chance to properly terminate its child process **Y** (that is, process **Y** would remain running in the background). *How to make sure that **Y** gets always terminated whenever **X** abruptly died?* Curren...
2013/12/18
[ "https://Stackoverflow.com/questions/20650720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1730237/" ]
The process groups/sessions are probably the way to go. How about this: If **X** does `setsid()`, remove it from the code. Write a very simple wrapper shell script to run the daemon: ``` #!/bin/sh /usr/bin/xd || pkill -TERM -s 0 ``` and run it with `setsid` command. If the daemon process exits abnormally, `pkill` ...
For Linux **only**: Using the function [`prctl()`](http://man7.org/linux/man-pages/man2/prctl.2.html) with option `PR_SET_PDEATHSIG` allows the parent child to set a signal that is send to their children to it in case the parent dies. The applies only to children created after this option had been set. Verbatim from ...
25,167
I want to upgrade my harddrive to a SSD. Does apple offer this service? I was going to do it myself, since its easy. Does this void my warranty?
2011/09/16
[ "https://apple.stackexchange.com/questions/25167", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/2726/" ]
No, it will not void your warranty. If you refer to the [top of these instructions](http://manuals.info.apple.com/en_US/MacBook_Pro_17inch_Mid2010_Hard_Drive_DIY.pdf), they clearly state only a deviation of the steps outlined may void your warranty: > > Follow the instructions in this document carefully. Failure to f...
<http://blog.macsales.com/18244-owc-diys-wont-void-your-macs-warranty> The link above states the following: *"We address this topic directly with customers via our support portals and are happy to inform you here of the same fact: upgrading your Mac does not void its warranty. This consumer protection is owed to the ...
211,887
I searched for "or even like taking a" on [Google](https://www.google.com.tw/search?client=ubuntu&hs=9BP&ei=pjbmXLTQLZDQ8wWH9oOAAQ&q=%22or%20even%20like%20taking%20a%20%22&oq=%22or%20even%20like%20taking%20a%20%22&gs_l=psy-ab.3..0i71l7.988.988..1052...0.0..0.0.0.......0....1..gws-wiz.Fu_ZAHZM0xw), and I got results lik...
2019/05/23
[ "https://ell.stackexchange.com/questions/211887", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/1806/" ]
It was just a middle-of-lecture slip. I’d guess that in his head were two phrases, something like: > > ...today’s processor on your wrist... > > > and: > > ...today’s processor in your smart watch... > > > Then those two got stuck in the door, fighting with each other trying to get out at the same time, so ...
I think "in" is the more common usage. But "on" could be used and would not be wrong. When applied to a smaller, flatter device, such as a smartwatch, "on" might seem more natural than when applied to a desktop computer.
44,639
The oxidation potential which I found on the internet the following reaction $$\ce{Fe^{2+} -> Fe^{3+} + e^-}$$ is $\pu{-0.77 V}$. But how can it be negative? Negative oxidation potential means oxidation tendency is very less or we can say negative oxidation potential means $\ce{Fe^2+}$ has very less tendency to lose ...
2016/02/03
[ "https://chemistry.stackexchange.com/questions/44639", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/25369/" ]
As IanB2016 mentioned in his answer, the redox potential of a half-cell reaction is always in reference to another half cell. The usual "reference" half cell in electrochemistry and thermodynamics is the [standard hydrogen electrode](https://en.wikipedia.org/wiki/Standard_hydrogen_electrode) (SHE). Some key features of...
Redox (reduction - oxidation) Potentials are measured for a specific reaction half-cell [such as Fe2+/Fe3+] by comparing that half cell reaction to a Standard Reference Electrode potential, which is generally the Standard Hydrogen Electrode or cell (SHE) in [aqueous] solution. The SHE is the internationally accepted "S...
19,393,698
I have been reading a lot about this google endpoints and I have trying to something that is not quite easy to guess. After you create a google cloud endpoint server and you deploy it is open to any HTTP request (unauthenticated). In the cloud endpoint documentation (referring to using authentication) you can read abou...
2013/10/16
[ "https://Stackoverflow.com/questions/19393698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2884586/" ]
In order to restrict your Endpoint to a specific application you can use OAuth2. This is because the OAuth2 flow does user authentication and in-turn the OAuth2 flow inherently authenticates the application requesting the OAuth2 access. These two client samples detail how to enable authenticated calls on the client s...
During the setup of your endpoints API, in `clientIds` list you provide your `WEB_CLIENT_ID`, `ANDROID_CLIENT_ID`, and `IOS_CLIENT_ID` for example. These values tell the Google App Engine that your application will respond to HTTPS requests from web browsers and Android/iOS installed applications. When your clients fi...
58,358,088
in order to automize some tasks in the browser with Selenium I need to identify a certain field on a website and click it. Because the values I'm using to identify the correct field can be displayed multiple times I'm iterating through the findings including multiple conditions. Maybe the code is written ineffectivly, ...
2019/10/12
[ "https://Stackoverflow.com/questions/58358088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7535111/" ]
I've solved it on my own. Instead of going with the initial idea of modifying the coordinates (thanks to the answers - so thats not possible) I implemented an additional condition: ``` for i in tempOdds: if (i.location['y'] == tempmatchesyVal) and (i.location['x'] >= tempmatchesxVal): ``` So basically only allowing ...
It is not fully clear to me what are your conditions, and what some of the code's purpose it, but what seems very wrong is assigning new value to i.location[something]. `i` are html elements, you can get their location, but I don't think setting them is functioning. Update: element's location is the location in pixel...
46,535,294
The case is I have a google sheet, that has a column that gets edited and 3 columns next to it that include a check, an email body and an email subject. I made the following code so that when a certain cell is edited in the edit column, an email is sent for notification. I put the email in a column that is referred to ...
2017/10/02
[ "https://Stackoverflow.com/questions/46535294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5296567/" ]
Please confirm whether `onEdit(e)` is installed as a trigger. When you use `MailApp.sendEmail()`, it is required authorization. So `onEdit(e)` without Installable Triggers cannot run `MailApp.sendEmail()`. How to install `onEdit(e)` as a trigger is as follows. * On script editor * Edit -> Current project's triggers ->...
You are experiencing issues because your function name overlaps with the expected name of a [simple trigger](https://developers.google.com/apps-script/guides/triggers/) function - merely naming a function `onOpen` or `onEdit` is sufficient to make that function run under "simple trigger" environment. If you rename you...
1,323,697
My first attempt at installing Ubuntu 20.04 onto a Raspberry Pi 3 A+ has stalled unexpectedly. I'm following the process described [here](https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview). I'm using Raspberry Pi Imager for MacOS to create a boot image from ubuntu-20.04.2-preinstalled-...
2021/03/15
[ "https://askubuntu.com/questions/1323697", "https://askubuntu.com", "https://askubuntu.com/users/1169615/" ]
Disconnecting the serial connection to the Bittle Nyboard allowed the boot to finish normally. Not sure why? Edit: Suspect it's related to the RPi use of the serial port <https://elinux.org/RPi_Serial_Connection>
same issue with <https://www.dexterindustries.com/grovepi/> it seems that some add-on devices are preventing it from boot. Maybe related to undervoltage? <https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=58151>
47,723,945
I am trying to take out certain columns from a pdb file. I already have taken out all lines that start out with ATOM in my code. For some reason my sub functions are not working and I do not know where or how to call them. My code is: ``` open (FILE, $ARGV[0]) or die "Could not open file\n"; my @newlines; while...
2017/12/09
[ "https://Stackoverflow.com/questions/47723945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8773945/" ]
If you are both Project Administrators, you should check if the user has been set permission separately. In **Version control** Tab `https://account.visualstudio.com/project/_admin/_versioncontrol?`, check if the user has been set permission separately: * Check in the repo level: select the repo (such as Git2 in belo...
Check **Force push (rewrite history, delete branches and tags)** permission for repo under Settings > Version Control is set to **Allow**. Force push to a branch, which can rewrite history and this permission is also required to delete a branch.
47,723,945
I am trying to take out certain columns from a pdb file. I already have taken out all lines that start out with ATOM in my code. For some reason my sub functions are not working and I do not know where or how to call them. My code is: ``` open (FILE, $ARGV[0]) or die "Could not open file\n"; my @newlines; while...
2017/12/09
[ "https://Stackoverflow.com/questions/47723945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8773945/" ]
Check **Force push (rewrite history, delete branches and tags)** permission for repo under Settings > Version Control is set to **Allow**. Force push to a branch, which can rewrite history and this permission is also required to delete a branch.
Check your user access by going to /\_settings/repositories, then add a user and review your Access control summary. I was part of a group with an explicit "Deny" which overrode other groups. It should look something like this: [![enter image description here](https://i.stack.imgur.com/lPTBl.png)](https://i.stack.im...
47,723,945
I am trying to take out certain columns from a pdb file. I already have taken out all lines that start out with ATOM in my code. For some reason my sub functions are not working and I do not know where or how to call them. My code is: ``` open (FILE, $ARGV[0]) or die "Could not open file\n"; my @newlines; while...
2017/12/09
[ "https://Stackoverflow.com/questions/47723945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8773945/" ]
Check **Force push (rewrite history, delete branches and tags)** permission for repo under Settings > Version Control is set to **Allow**. Force push to a branch, which can rewrite history and this permission is also required to delete a branch.
It seems, for those using Azure DevOps 2019, that you need the `"Bypass policies when pushing"` permission as well. At least it was needed today.
47,723,945
I am trying to take out certain columns from a pdb file. I already have taken out all lines that start out with ATOM in my code. For some reason my sub functions are not working and I do not know where or how to call them. My code is: ``` open (FILE, $ARGV[0]) or die "Could not open file\n"; my @newlines; while...
2017/12/09
[ "https://Stackoverflow.com/questions/47723945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8773945/" ]
If you are both Project Administrators, you should check if the user has been set permission separately. In **Version control** Tab `https://account.visualstudio.com/project/_admin/_versioncontrol?`, check if the user has been set permission separately: * Check in the repo level: select the repo (such as Git2 in belo...
Check your user access by going to /\_settings/repositories, then add a user and review your Access control summary. I was part of a group with an explicit "Deny" which overrode other groups. It should look something like this: [![enter image description here](https://i.stack.imgur.com/lPTBl.png)](https://i.stack.im...
47,723,945
I am trying to take out certain columns from a pdb file. I already have taken out all lines that start out with ATOM in my code. For some reason my sub functions are not working and I do not know where or how to call them. My code is: ``` open (FILE, $ARGV[0]) or die "Could not open file\n"; my @newlines; while...
2017/12/09
[ "https://Stackoverflow.com/questions/47723945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8773945/" ]
If you are both Project Administrators, you should check if the user has been set permission separately. In **Version control** Tab `https://account.visualstudio.com/project/_admin/_versioncontrol?`, check if the user has been set permission separately: * Check in the repo level: select the repo (such as Git2 in belo...
It seems, for those using Azure DevOps 2019, that you need the `"Bypass policies when pushing"` permission as well. At least it was needed today.
47,723,945
I am trying to take out certain columns from a pdb file. I already have taken out all lines that start out with ATOM in my code. For some reason my sub functions are not working and I do not know where or how to call them. My code is: ``` open (FILE, $ARGV[0]) or die "Could not open file\n"; my @newlines; while...
2017/12/09
[ "https://Stackoverflow.com/questions/47723945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8773945/" ]
Check your user access by going to /\_settings/repositories, then add a user and review your Access control summary. I was part of a group with an explicit "Deny" which overrode other groups. It should look something like this: [![enter image description here](https://i.stack.imgur.com/lPTBl.png)](https://i.stack.im...
It seems, for those using Azure DevOps 2019, that you need the `"Bypass policies when pushing"` permission as well. At least it was needed today.
17,809,967
Hi I am trying to pass a regex expression in zf2 routing, My router looks like this : ``` 'exampleroute' => array( 'type' => 'segment', 'options' => array( 'route' => '/exampleroute/[:regexparameter]', 'constraints' => array( ...
2013/07/23
[ "https://Stackoverflow.com/questions/17809967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2055227/" ]
`[a-zA-Z][a-zA-Z0-9_-][$.]*` means: 1. First symbol must be `a-zA-Z` 2. Second symbol must be `a-zA-Z0-9_-` 3. Followed by any number of `$` or `.` symbols I guess you need this: `[a-zA-Z0-9_-$.]*`
Its Working like this now: ``` 'exampleroute' => array( 'type' => 'segment', 'options' => array( 'route' => '/exampleroute/[:regexparameter]', 'constraints' => array( 'regexparameter' => '[$.a-zA-z0-9_-]*', ), ...
30,115,283
I have created my own root page (`/`) as well as my register page (`/cadastrar`). My next step was to allow the user to login and update their information. For that I just used laravel's login page (`/auth/login`). It works fine and when I login I get redirected to `/home`. At this point my problem arises: I can not go...
2015/05/08
[ "https://Stackoverflow.com/questions/30115283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3433315/" ]
In `app/Http/Middleware/RedirectIfAuthenticated.php` on line 38 change: ``` return new RedirectResponse(url('/home')); ``` to ``` return new RedirectResponse(url('/')); ```
I noticed that when I went into my `WelcomeController` and commented out the line in the `__construct` function that assigned this page only to guests the redirection problem was gone: ``` //$this->middleware('guest'); ```
9,323,018
I was assigned to convert some .Net projects in old version to to .net 4.0 version. I used ODAC driver replacing ODBC driver. Everything went fine until I found a problem with a gridview were I get illegal character Oracle exception when I try to delete a row. The gridview is inside an update panel. The exception I rec...
2012/02/17
[ "https://Stackoverflow.com/questions/9323018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1215371/" ]
To pass a pointer to a value type into a P/Invoke function just declare the parameter as a `ref` or `out`. This implicitly takes a reference to the parameter and passes that: ``` [DllImport("C:\\CTestDLL.dll")] private static extern void helloWorld(ref Sample sample); ``` Since your structure has an array in it, you...
This works for me: DLL: ``` typedef struct { int length; unsigned char *value; } Sample; extern "C" __declspec(dllexport) void __stdcall helloWorld( Sample *sample ) { MessageBoxA(NULL, (LPCSTR) sample->value, (LPCSTR) sample->value, 0); } ``` C#: ``` class Program { [StructLayout(LayoutKind.Seque...
9,323,018
I was assigned to convert some .Net projects in old version to to .net 4.0 version. I used ODAC driver replacing ODBC driver. Everything went fine until I found a problem with a gridview were I get illegal character Oracle exception when I try to delete a row. The gridview is inside an update panel. The exception I rec...
2012/02/17
[ "https://Stackoverflow.com/questions/9323018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1215371/" ]
[Default Marshaling for Value Types](http://msdn.microsoft.com/en-us/library/0t2cwe11.aspx#cpcondefaultmarshalingforvaluetypesanchor2) - gives some information on marshalling structs. [Calling Win32 DLLs in C# with P/Invoke](http://msdn.microsoft.com/en-us/magazine/cc164123.aspx) - a little over half way down the pa...
This works for me: DLL: ``` typedef struct { int length; unsigned char *value; } Sample; extern "C" __declspec(dllexport) void __stdcall helloWorld( Sample *sample ) { MessageBoxA(NULL, (LPCSTR) sample->value, (LPCSTR) sample->value, 0); } ``` C#: ``` class Program { [StructLayout(LayoutKind.Seque...
31,712,542
This is the first time I ask a question here. Anyway, as the title says, I'm trying to put my application on the market. When I try to upload the signed apk, I get the error: > > Upload failed Duplicate declarations of permission android.permission.READ\_EXTERNAL\_STORAGE with different maxSdkVersions. > > > ...
2015/07/29
[ "https://Stackoverflow.com/questions/31712542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5171242/" ]
I still don't know why it is happening, but it looks like that there was something inside a library (even if i checked their manifest). Anyway the solution for me was to delete the permission of the library declaring in my manifest: ``` <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" ...
Including android.permission.READ\_EXTERNAL\_STORAGE resolves the problem
30,198,620
I am working on a simple 2D game with Java, swing and no framework. I have a rectangular player that the user can move around. On the map are few obstacles which the player should not be able to go through. I did this by making a new Rectangle Object for the player and each obstacle with their bounds. But I’m not reall...
2015/05/12
[ "https://Stackoverflow.com/questions/30198620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4659285/" ]
Move the declaration before try block ``` public String[] first() { String[] heading = new String[10]; try { int value = 10; for (int i = 0; i < value; i++) { heading[i] = ""; } } catch (Exception e) { e.printStackTrace(); } return heading; ``` W...
Since you need the array outside from the try block, there is no need to declare the array in the try block. Just declare the array outside of the try block so that the scope of the array remains - ``` int value=10; String[] heading = new String[10]; try{ for(int i=0 ; i<value ;i++) { heading[i] =""; ...
7,975
I have a paragraph like below: > > A hypothetical solution is like this: first, we can use a table to record entries. These entries are imported from a library. . ..... > > > Basically, this paragraph is to talk about a solution. After the colon `:`, I have several sentences, and I'm at a loss on how to choose pu...
2013/05/29
[ "https://writers.stackexchange.com/questions/7975", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/5264/" ]
I haven't checked what the classic style guides say on this, but my personal practice is that in such cases, I capitalize what comes after the colon. If each "point" is long enough to be its own paragraph, then I make the first one its own paragraph also. Like: > > A hypothetical solution might be set up like this: >...
There is no question here. You are setting out to describe a solution or process in steps. A series of sentences ending with periods is a perfectly legitimate way to do that. There will be no confusion where the process ends because the reader will continue until the content suggests the solution is complete. Also, you...
7,975
I have a paragraph like below: > > A hypothetical solution is like this: first, we can use a table to record entries. These entries are imported from a library. . ..... > > > Basically, this paragraph is to talk about a solution. After the colon `:`, I have several sentences, and I'm at a loss on how to choose pu...
2013/05/29
[ "https://writers.stackexchange.com/questions/7975", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/5264/" ]
I haven't checked what the classic style guides say on this, but my personal practice is that in such cases, I capitalize what comes after the colon. If each "point" is long enough to be its own paragraph, then I make the first one its own paragraph also. Like: > > A hypothetical solution might be set up like this: >...
This is fine as written, so long as later in the section you have *Second* and *Third* or *Last* and so forth. I'd make each numbered item a separate paragraph, regardless of length, so it's easier to follow the steps. > > A hypothetical solution might be set up like this: first, we can use a table to record entries....
226,349
Suppose $\Delta$ is some nice topological space, say compact, and Hausdorff. Let $A:\Delta \rightarrow \mathbb{R}^{m\times n}$ be a continuous $m\times n$ matrix valued map. Let $b\in \mathbb{R}^{m}$ be a fixed vector that belongs to the range of $A(\delta)$ for all $\delta\in \Delta$. Then we know that there is a uni...
2015/12/17
[ "https://mathoverflow.net/questions/226349", "https://mathoverflow.net", "https://mathoverflow.net/users/84259/" ]
For a counterexample with $m=n=2$, consider the case $$ A(\delta) = \pmatrix{\delta - 1 & 1\cr -1 & 1\cr},\ b = \pmatrix{1\cr 1\cr}$$ For $\delta \ne 0$, $Ax = b$ has the unique solution $x(\delta) = \pmatrix{0\cr 1\cr}$. For $\delta = 0$, the solutions are $\pmatrix{t\cr t+1}$, whose norm is minimized at $t = -1/2$, ...
Yes *if* all matrices have the same rank. Your $x\_\*(\delta)$ is $A(\delta)^+b$ where $A^+$ is the *Moore-Penrose pseudoinverse* of $A$, which depends continuously on $A$ if (and only if) restricted to matrices of the same rank. For the more general case, I don't know.
70,685
1 Thessalonians 4:16 YLT because the Lord himself, in a shout, in the voice of a chief-messenger, and in the trump of God, shall come down from heaven, and the dead in Christ shall rise first, Who is the chief-messenger/archangel in this verse? Are there more than one archangel or is there only one archangel? ἀρχαγγέ...
2021/10/31
[ "https://hermeneutics.stackexchange.com/questions/70685", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/42310/" ]
Two angels are named in scripture - Gabriel, twice, and Michael, five times - a total of seven times. Gabriel stands in the presence of God, Luke 1:19, and was sent from God, Luke 1:26. *Thus he stands and is sent to enunciate.* He also has the power at his disposal to respond to inappropriate enunciation (by unbeli...
The archangel is mentioned just twice in the Bible: * Jude 9 - Yet **Michael the archangel**, in contending with the devil, when he disputed about the body of Moses, dared not bring against him a reviling accusation, but said, “The Lord rebuke you!” * 1 Thess 4:16 - For the Lord Himself will descend from heaven with a...
70,685
1 Thessalonians 4:16 YLT because the Lord himself, in a shout, in the voice of a chief-messenger, and in the trump of God, shall come down from heaven, and the dead in Christ shall rise first, Who is the chief-messenger/archangel in this verse? Are there more than one archangel or is there only one archangel? ἀρχαγγέ...
2021/10/31
[ "https://hermeneutics.stackexchange.com/questions/70685", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/42310/" ]
Two angels are named in scripture - Gabriel, twice, and Michael, five times - a total of seven times. Gabriel stands in the presence of God, Luke 1:19, and was sent from God, Luke 1:26. *Thus he stands and is sent to enunciate.* He also has the power at his disposal to respond to inappropriate enunciation (by unbeli...
Are there more than one archangel or is there only one archangel? Daniel 10: > > 13 > But the prince of the Persian kingdom resisted me twenty-one days. Then **Michael, one of the chief princes**, came to help me, because I was detained there with the king of Persia. > > > Jude 1: > > 9 But even **the** archan...
45,125,656
I'm using a service that gives you a `wav` file. this service gives me base64 binary code as a result. I want to convert it to a wav file. I've been googling for it and couldn't find anything. here is my code : ``` $wsdl=' < url > ';//url to WSDL $client = new SoapClient($wsdl); $param=array( 'use...
2017/07/16
[ "https://Stackoverflow.com/questions/45125656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5661319/" ]
The string you're echoing looks like a plain wav stream. Just write it to a file without any decoding and you'll end up with a wav file. Be sure to use binary mode when writing the file. ``` $ptr = fopen("file.wav", 'wb'); fwrite($ptr, $e->getMessage()); fclose($ptr); ``` Wav header info: <https://en.wikipedia.org/w...
If the base64 encoded data already represents an MP3 file, it should be as easy as decoding the base64 data and storing it in a file: ``` file_put_contents('audio.mp3', base64_decode($base64Binary)); ```
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
Just add: ``` $("#add_fields_placeholderValue").hide(); ``` After your change event declaration on page load. *i.e.* ``` $(document).ready(function() { $("#add_fields_placeholder").change(function() { if($(this).val() == "Other") { $("#add_fields_placeholderValue").show(); } else { $("#add_fields...
I typically factor out the hide/show logic: ``` function foobar(){ if($(this).val() == "Other"){ $("#add_fields_placeholderValue").show(); } else{ $("#add_fields_placeholderValue").hide(); } } ``` and call it when the page loads. ``` $(document).ready(function(){ foobar(); $(...
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
Just add: ``` $("#add_fields_placeholderValue").hide(); ``` After your change event declaration on page load. *i.e.* ``` $(document).ready(function() { $("#add_fields_placeholder").change(function() { if($(this).val() == "Other") { $("#add_fields_placeholderValue").show(); } else { $("#add_fields...
You can use css to hide it initially ```css #add_fields_placeholderValue{display:none;} ``` <http://jsfiddle.net/FarVX/20/> Also you have multiple elements with the same id(pointed out by Brandon), which is not valid
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
Just add: ``` $("#add_fields_placeholderValue").hide(); ``` After your change event declaration on page load. *i.e.* ``` $(document).ready(function() { $("#add_fields_placeholder").change(function() { if($(this).val() == "Other") { $("#add_fields_placeholderValue").show(); } else { $("#add_fields...
You could simply do it with CSS: Change the ID here: ``` <input type="text" name="add_fields_placeholderValue" id="add_fields_placeholderValue"> ``` since you already use it here ``` <div id="add_fields_placeholderValue"> ``` and then add this css: ``` #add_fields_placeholderValue { display: none; }​ ...
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
Just add: ``` $("#add_fields_placeholderValue").hide(); ``` After your change event declaration on page load. *i.e.* ``` $(document).ready(function() { $("#add_fields_placeholder").change(function() { if($(this).val() == "Other") { $("#add_fields_placeholderValue").show(); } else { $("#add_fields...
if you change the anonymous method into a callable function, you should be able to call it on Ready() e.g. ``` $(document).ready(function () { $("#add_fields_placeholder").change(ShowIfOther); ShowIfOther(); }); function ShowIfOther() { if ($("#add_fields_placeholder").val() == "Other") { $("#add...
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
Just add: ``` $("#add_fields_placeholderValue").hide(); ``` After your change event declaration on page load. *i.e.* ``` $(document).ready(function() { $("#add_fields_placeholder").change(function() { if($(this).val() == "Other") { $("#add_fields_placeholderValue").show(); } else { $("#add_fields...
Place the following code beneath the placeholder elements: ``` <script>$('#add_fields_placeholderValue').hide();</script> ``` Doing it in the ready handler may induce 'flashing' of the element in certain circumstances: [Twinkling when call hide() on document ready](https://stackoverflow.com/questions/8688363/twinkl...
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
You can use css to hide it initially ```css #add_fields_placeholderValue{display:none;} ``` <http://jsfiddle.net/FarVX/20/> Also you have multiple elements with the same id(pointed out by Brandon), which is not valid
I typically factor out the hide/show logic: ``` function foobar(){ if($(this).val() == "Other"){ $("#add_fields_placeholderValue").show(); } else{ $("#add_fields_placeholderValue").hide(); } } ``` and call it when the page loads. ``` $(document).ready(function(){ foobar(); $(...
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
You can use css to hide it initially ```css #add_fields_placeholderValue{display:none;} ``` <http://jsfiddle.net/FarVX/20/> Also you have multiple elements with the same id(pointed out by Brandon), which is not valid
You could simply do it with CSS: Change the ID here: ``` <input type="text" name="add_fields_placeholderValue" id="add_fields_placeholderValue"> ``` since you already use it here ``` <div id="add_fields_placeholderValue"> ``` and then add this css: ``` #add_fields_placeholderValue { display: none; }​ ...
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
You can use css to hide it initially ```css #add_fields_placeholderValue{display:none;} ``` <http://jsfiddle.net/FarVX/20/> Also you have multiple elements with the same id(pointed out by Brandon), which is not valid
if you change the anonymous method into a callable function, you should be able to call it on Ready() e.g. ``` $(document).ready(function () { $("#add_fields_placeholder").change(ShowIfOther); ShowIfOther(); }); function ShowIfOther() { if ($("#add_fields_placeholder").val() == "Other") { $("#add...
11,918,397
I'm trying to do is hiding/showing a certain input object if a select value is checked. [Code in JSFiddle](http://jsfiddle.net/FarVX/17/) The HTML part of the code is here: ``` <label for="add_fields_placeholder">Placeholder: </label> <select name="add_fields_placeholder" id="add_fields_placeholder"> <option val...
2012/08/11
[ "https://Stackoverflow.com/questions/11918397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1381947/" ]
You can use css to hide it initially ```css #add_fields_placeholderValue{display:none;} ``` <http://jsfiddle.net/FarVX/20/> Also you have multiple elements with the same id(pointed out by Brandon), which is not valid
Place the following code beneath the placeholder elements: ``` <script>$('#add_fields_placeholderValue').hide();</script> ``` Doing it in the ready handler may induce 'flashing' of the element in certain circumstances: [Twinkling when call hide() on document ready](https://stackoverflow.com/questions/8688363/twinkl...
66,166,662
In a broad sense, I'm trying to calculate how much of the red path/trajectory falls in-between the black paths for many different trials (see plot below). I circled a couple examples, where for (0, 1, 3) approx 30-40% of the red path falls in-between the two black paths, but for (2, 1, 3) only about 1-2% of the red pat...
2021/02/12
[ "https://Stackoverflow.com/questions/66166662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2159140/" ]
* This solution implements the code from the OP in a more efficient manner, and does what is **asked** for, but not what is **wanted**. * While the solution doesn't provide the desired result, after discussion with the OP, we decided to leave this answer, because it helps to clarify the desired outcome. + Maybe someon...
### I'm going to take a slightly different route. This is still rough, so criticism/suggestions are welcome! (Why am I yelling?!) If possible, get all your tuples into an iterable: ``` a_rng = range(3) b_rng = range(1, 3) c_rng = range(1, 4) all_my_tuples = [(a, b, c) for a in a_rng for b in b_rng for c in c_rng] ``...
66,166,662
In a broad sense, I'm trying to calculate how much of the red path/trajectory falls in-between the black paths for many different trials (see plot below). I circled a couple examples, where for (0, 1, 3) approx 30-40% of the red path falls in-between the two black paths, but for (2, 1, 3) only about 1-2% of the red pat...
2021/02/12
[ "https://Stackoverflow.com/questions/66166662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2159140/" ]
**Just a idea** If i understand the discussion right, the problem is that the data was sampled at different points. So you can't just compare the value of each row. And sometimes the buttom line is switched with the top line. My idea would be now to interpolate the black trajectories at the same x-values as the red t...
* This solution implements the code from the OP in a more efficient manner, and does what is **asked** for, but not what is **wanted**. * While the solution doesn't provide the desired result, after discussion with the OP, we decided to leave this answer, because it helps to clarify the desired outcome. + Maybe someon...
66,166,662
In a broad sense, I'm trying to calculate how much of the red path/trajectory falls in-between the black paths for many different trials (see plot below). I circled a couple examples, where for (0, 1, 3) approx 30-40% of the red path falls in-between the two black paths, but for (2, 1, 3) only about 1-2% of the red pat...
2021/02/12
[ "https://Stackoverflow.com/questions/66166662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2159140/" ]
**Just a idea** If i understand the discussion right, the problem is that the data was sampled at different points. So you can't just compare the value of each row. And sometimes the buttom line is switched with the top line. My idea would be now to interpolate the black trajectories at the same x-values as the red t...
### I'm going to take a slightly different route. This is still rough, so criticism/suggestions are welcome! (Why am I yelling?!) If possible, get all your tuples into an iterable: ``` a_rng = range(3) b_rng = range(1, 3) c_rng = range(1, 4) all_my_tuples = [(a, b, c) for a in a_rng for b in b_rng for c in c_rng] ``...
31,775,162
I have been searching for Paypal person to person Payment integration code with PHP I hope you can help me what PayPal Code that I can use.I already tried with normal paypal integration(transfer from personal to business) by assigning receiver paypal personal account email id as the business id. ``` <input type="hidd...
2015/08/02
[ "https://Stackoverflow.com/questions/31775162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912191/" ]
When you do `new Product()`, a new `_id` is generated, along with other things. Try this: ``` items.forEach(function (product) { //update or create new products // Es6 assign var productToUpdate = {}; productToUpdate = Object.assign(productToUpdate, product._doc); delete productToUpdate._id; Product.findOn...
You can use this: ``` Product.replaceOne({ _id: 55be3c8f79bae4f80c6b17f8}, { product_id: parseInt(product.id), parent_id: parseInt(product.parent_id), sku: product.sku, title: product.title, pricenormal: parseFloat(product.price_normal), pricewholesale: parseFloat(product.pri...
31,775,162
I have been searching for Paypal person to person Payment integration code with PHP I hope you can help me what PayPal Code that I can use.I already tried with normal paypal integration(transfer from personal to business) by assigning receiver paypal personal account email id as the business id. ``` <input type="hidd...
2015/08/02
[ "https://Stackoverflow.com/questions/31775162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912191/" ]
When you do `new Product()`, a new `_id` is generated, along with other things. Try this: ``` items.forEach(function (product) { //update or create new products // Es6 assign var productToUpdate = {}; productToUpdate = Object.assign(productToUpdate, product._doc); delete productToUpdate._id; Product.findOn...
try to use ``` const product = productEntity.toObject(); ... delete product._id; ... Product.findOneAndUpdate({product_id: product.product_id}, product) ```
31,775,162
I have been searching for Paypal person to person Payment integration code with PHP I hope you can help me what PayPal Code that I can use.I already tried with normal paypal integration(transfer from personal to business) by assigning receiver paypal personal account email id as the business id. ``` <input type="hidd...
2015/08/02
[ "https://Stackoverflow.com/questions/31775162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912191/" ]
When you do `new Product()`, a new `_id` is generated, along with other things. Try this: ``` items.forEach(function (product) { //update or create new products // Es6 assign var productToUpdate = {}; productToUpdate = Object.assign(productToUpdate, product._doc); delete productToUpdate._id; Product.findOn...
I got this error (in the Java driver) when my check for an `_id` was a `String` instead of an `ObjectId`. Wrap your query appropriately: ``` myCoolCollection.findOneAndUpdate(Filters.eq("_id", new ObjectId(e.id)), ... ```
31,775,162
I have been searching for Paypal person to person Payment integration code with PHP I hope you can help me what PayPal Code that I can use.I already tried with normal paypal integration(transfer from personal to business) by assigning receiver paypal personal account email id as the business id. ``` <input type="hidd...
2015/08/02
[ "https://Stackoverflow.com/questions/31775162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912191/" ]
You can use this: ``` Product.replaceOne({ _id: 55be3c8f79bae4f80c6b17f8}, { product_id: parseInt(product.id), parent_id: parseInt(product.parent_id), sku: product.sku, title: product.title, pricenormal: parseFloat(product.price_normal), pricewholesale: parseFloat(product.pri...
I got this error (in the Java driver) when my check for an `_id` was a `String` instead of an `ObjectId`. Wrap your query appropriately: ``` myCoolCollection.findOneAndUpdate(Filters.eq("_id", new ObjectId(e.id)), ... ```
31,775,162
I have been searching for Paypal person to person Payment integration code with PHP I hope you can help me what PayPal Code that I can use.I already tried with normal paypal integration(transfer from personal to business) by assigning receiver paypal personal account email id as the business id. ``` <input type="hidd...
2015/08/02
[ "https://Stackoverflow.com/questions/31775162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912191/" ]
try to use ``` const product = productEntity.toObject(); ... delete product._id; ... Product.findOneAndUpdate({product_id: product.product_id}, product) ```
I got this error (in the Java driver) when my check for an `_id` was a `String` instead of an `ObjectId`. Wrap your query appropriately: ``` myCoolCollection.findOneAndUpdate(Filters.eq("_id", new ObjectId(e.id)), ... ```
3,021,620
I create an array, similar to classic C (not NSArray or one of it's children) - something like `BOOL i[5];`. And I want to make all its values to be equal to NO. First of all, I didn't found any information about initial values of such arrays (I know that in classic C they will be undefined, but don't know exactly abo...
2010/06/11
[ "https://Stackoverflow.com/questions/3021620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286872/" ]
If that `BOOL i[5]` is an ivar of an ObjC class, its content will be initialized (`memset`-ed) to 0. As described in the [`+alloc` method](http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/clm/NSObject/alloc): > > ... me...
Even if it is 0-ed instead of undef like in C, a proper initialization should set all values explicitly since you can't know if NO is 0 (it is, but hypotethically...!), so simply: ``` for(j = 0; j < 5; j++) i[j] = NO; ``` could do the job.
20,907,826
Lets say we have the architecture model of web application where we have 1 database per 1 account. Database structure is the same for these accounts and differs only on data with in. How can i configurate a migrations in code first model.
2014/01/03
[ "https://Stackoverflow.com/questions/20907826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3157849/" ]
Now I have next solution. In the main method or in global.asax something like this: ``` var migration_config = new Configuration(); migration_config.TargetDatabase = new DbConnectionInfo("BlogContext"); var migrator = new DbMigrator(migration_config); migrator.Update(); migration_config.TargetDatab...
See [the page on automatic migrations during application startup](http://msdn.microsoft.com/en-us/data/jj591621#initializer). If you use this method to apply your migrations, you can use any connection string (or whatever method you have to identify exactly which database to connect to) and upon connection, the migrat...
20,907,826
Lets say we have the architecture model of web application where we have 1 database per 1 account. Database structure is the same for these accounts and differs only on data with in. How can i configurate a migrations in code first model.
2014/01/03
[ "https://Stackoverflow.com/questions/20907826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3157849/" ]
In addition to your excellent answer, you can use an external config file (i.e. "clients.json") instead of hardcoding them, put all the database infos in key-value pairs into the json file and load it during startup. Then, by iterating over the key-value pairs, you can do the initialization. The `clients.json`: ``` ...
See [the page on automatic migrations during application startup](http://msdn.microsoft.com/en-us/data/jj591621#initializer). If you use this method to apply your migrations, you can use any connection string (or whatever method you have to identify exactly which database to connect to) and upon connection, the migrat...
20,907,826
Lets say we have the architecture model of web application where we have 1 database per 1 account. Database structure is the same for these accounts and differs only on data with in. How can i configurate a migrations in code first model.
2014/01/03
[ "https://Stackoverflow.com/questions/20907826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3157849/" ]
Now I have next solution. In the main method or in global.asax something like this: ``` var migration_config = new Configuration(); migration_config.TargetDatabase = new DbConnectionInfo("BlogContext"); var migrator = new DbMigrator(migration_config); migrator.Update(); migration_config.TargetDatab...
In addition to your excellent answer, you can use an external config file (i.e. "clients.json") instead of hardcoding them, put all the database infos in key-value pairs into the json file and load it during startup. Then, by iterating over the key-value pairs, you can do the initialization. The `clients.json`: ``` ...
63,368,911
I have read some code about Switch statement in Java Language. I noted that written the next code, I have this output: > > FEBO SERR **JANUO** **January** 2 > > > Code: ``` int month = 2; String monthString = ""; switch (month) { case 2: monthString = "FEB"; System.out...
2020/08/12
[ "https://Stackoverflow.com/questions/63368911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3926106/" ]
This appears to be a simple permission problem here: > > ld: can't open output file for writing > > > The linker cannot write to the file specified. **Edit**: As correctly pointed to by molbdnilo, the `error 21` is `EISDIR`, which means the *file* you are trying to write to already exists as a *directory*. So .....
Did you brew install any c++ tools? Sometimes that is the source of these issues. The program is trying to use native OS versions of things when it should use Homebrew's or vice versa.
495,629
I have a wide table, which I want to put in landscape, like in the example below. But it overlaps with the page header! ``` \documentclass[a4paper,12pt]{scrbook} \usepackage[pass]{geometry} \usepackage{pdflscape} \usepackage[automark]{scrpage2} \pagestyle{scrheadings} \setheadsepline{1pt} \usepackage{lipsum} \begi...
2019/06/13
[ "https://tex.stackexchange.com/questions/495629", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/132493/" ]
Some of your X-columns are too narrow. I converted them to `c` and then removed `multicolumn` two places as unnecessary. In addition, I added an additional empty column as a new fourth column to balance white space. Annother possibility is to remove the two empty columns and replace them with a fixed width space using ...
I would spread the columns and their width differently: ``` \documentclass{article} \usepackage[margin=3cm]{geometry} \usepackage{booktabs,tabularx} \begin{document} \begin{table}\centering \scriptsize \setlength\cmidrulekern{0.25em} \begin{tabularx}{\linewidth}{@{} l >{\raggedleft\hsize=1.2\hsize...
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
Curiously, the OED says: > > **half-dozen** | **half-a-dozen** > > > The half of a dozen; six (**or about six**). > > > In its quotes, it does not distinguish when it means 6 and when it means ~6. But for *dozen*, the OED does not depart from 12. > > **dozen** > > > A **group or set of twelve**. Originally...
As Mauli Davidson said, it is an absolute quantity. However, "dozen" is sometimes generalised. I think it is quite common that people use it flexibly.
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
It depends on the context. If I'm buying eggs from a supermarket then I assume they're selling an exact quantity (i.e. 6). In that context the reason for saying "a half dozen" is that eggs are traditionally sold by the dozen. --- You quoted it being used in the following context: > > Story goes, he made thirteen ...
As Mauli Davidson said, it is an absolute quantity. However, "dozen" is sometimes generalised. I think it is quite common that people use it flexibly.
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
Curiously, the OED says: > > **half-dozen** | **half-a-dozen** > > > The half of a dozen; six (**or about six**). > > > In its quotes, it does not distinguish when it means 6 and when it means ~6. But for *dozen*, the OED does not depart from 12. > > **dozen** > > > A **group or set of twelve**. Originally...
A 'dozen' is absolute. It means **twelve**. No generalities apply.
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
A gross is always 144, a score is always 20, a bakers dozen is always 13, a dozen is always 12, and half a dozen is always six, and so on and so forth, but . . . We do not always use numbers precisely, leaving aside errors (including fencepost errors like the mentioned supermarket line) there are three ways that numbe...
As Mauli Davidson said, it is an absolute quantity. However, "dozen" is sometimes generalised. I think it is quite common that people use it flexibly.
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
It depends on the context. If I'm buying eggs from a supermarket then I assume they're selling an exact quantity (i.e. 6). In that context the reason for saying "a half dozen" is that eggs are traditionally sold by the dozen. --- You quoted it being used in the following context: > > Story goes, he made thirteen ...
A gross is always 144, a score is always 20, a bakers dozen is always 13, a dozen is always 12, and half a dozen is always six, and so on and so forth, but . . . We do not always use numbers precisely, leaving aside errors (including fencepost errors like the mentioned supermarket line) there are three ways that numbe...
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
It depends on the context. If I'm buying eggs from a supermarket then I assume they're selling an exact quantity (i.e. 6). In that context the reason for saying "a half dozen" is that eggs are traditionally sold by the dozen. --- You quoted it being used in the following context: > > Story goes, he made thirteen ...
A 'dozen' is absolute. It means **twelve**. No generalities apply.
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
The most likely answer is: It Depends. If I go to the store and buy half a dozen eggs, half a dozen donuts, and half a dozen muffins, I'm going to be extremely annoyed if when I get home I find only 5 eggs, 5 donuts, and 5 muffins in the packages. On the other hand, if I am complaining about the length of the checkou...
A 'dozen' is absolute. It means **twelve**. No generalities apply.
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
The most likely answer is: It Depends. If I go to the store and buy half a dozen eggs, half a dozen donuts, and half a dozen muffins, I'm going to be extremely annoyed if when I get home I find only 5 eggs, 5 donuts, and 5 muffins in the packages. On the other hand, if I am complaining about the length of the checkou...
Curiously, the OED says: > > **half-dozen** | **half-a-dozen** > > > The half of a dozen; six (**or about six**). > > > In its quotes, it does not distinguish when it means 6 and when it means ~6. But for *dozen*, the OED does not depart from 12. > > **dozen** > > > A **group or set of twelve**. Originally...
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
Curiously, the OED says: > > **half-dozen** | **half-a-dozen** > > > The half of a dozen; six (**or about six**). > > > In its quotes, it does not distinguish when it means 6 and when it means ~6. But for *dozen*, the OED does not depart from 12. > > **dozen** > > > A **group or set of twelve**. Originally...
It depends on the context. If I'm buying eggs from a supermarket then I assume they're selling an exact quantity (i.e. 6). In that context the reason for saying "a half dozen" is that eggs are traditionally sold by the dozen. --- You quoted it being used in the following context: > > Story goes, he made thirteen ...
225,968
In [my answer](https://scifi.stackexchange.com/a/53787/19561) to a question on the SF & Fantasy stack, I assumed that "half a dozen" is imprecise enough to mean anywhere from 5 to 7. Another user challenged that assumption and stated that since a dozen is 12, a half dozen is necessarily 6 and nothing else. In [the ans...
2015/02/06
[ "https://english.stackexchange.com/questions/225968", "https://english.stackexchange.com", "https://english.stackexchange.com/users/59244/" ]
A 'dozen' is absolute. It means **twelve**. No generalities apply.
A gross is always 144, a score is always 20, a bakers dozen is always 13, a dozen is always 12, and half a dozen is always six, and so on and so forth, but . . . We do not always use numbers precisely, leaving aside errors (including fencepost errors like the mentioned supermarket line) there are three ways that numbe...
72,784
I want to create with TikZ a yellow arrow with black margin (border, edge). I thought I could do this by using two arrows which lie on the top of each other, e.g. with: ``` \documentclass[12pt,twoside, a4paper]{report} \usepackage{tikz} \begin{document} \begin{tikzpicture}[yscale=0.25]% \draw[->,black,very thick](-19...
2012/09/16
[ "https://tex.stackexchange.com/questions/72784", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/18314/" ]
**Edit 1:** the new version of `double arrow` style requires three parameters: the *global width* and the *two colors*. Here is a solution using `postaction` to define the new style `double arrow` (I use `stealth` arrows because doubled default arrows are not beautiful). The `postaction` option allows to redraw the ar...
It is not so beautiful but it works. ``` \documentclass[12pt,twoside,a4paper]{report} \usepackage{tikz} \newcommand{\darrow}[2]{% \draw[->,black,line width=1.6pt] #1 -- #2; \draw[->,yellow,line width=1pt,scale=0.98] #1 -- #2; } \begin{document} \begin{tikzpicture}[yscale=0.25]% \darrow{(0,0)}{(1,1)} \end{tikzpictu...
72,784
I want to create with TikZ a yellow arrow with black margin (border, edge). I thought I could do this by using two arrows which lie on the top of each other, e.g. with: ``` \documentclass[12pt,twoside, a4paper]{report} \usepackage{tikz} \begin{document} \begin{tikzpicture}[yscale=0.25]% \draw[->,black,very thick](-19...
2012/09/16
[ "https://tex.stackexchange.com/questions/72784", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/18314/" ]
**Edit 1:** the new version of `double arrow` style requires three parameters: the *global width* and the *two colors*. Here is a solution using `postaction` to define the new style `double arrow` (I use `stealth` arrows because doubled default arrows are not beautiful). The `postaction` option allows to redraw the ar...
One way would be to use `draw=black, double=yellow, double distance=2pt, ->` which draws two lines, but the result is not quite what is desired as the arrow does not get the double line: ![enter image description here](https://i.stack.imgur.com/l02Cv.png) The second uses the `bad to` style as discussed in [meta arrow...
54,078,140
Say I have this code ``` String age = "My name is John and I am 18 years old"; ``` Is there a way to parse only "18" into a integer and leave rest of it as a string? thanks
2019/01/07
[ "https://Stackoverflow.com/questions/54078140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10876868/" ]
``` String age = "My name is John and I am 18 years old"; Integer.parseInt(age.replaceAll("\\D", "")); ``` This will also remove non-digits in-between digits, so "`2k4t1`" becomes `241`. If you need to confirm that the string consists of a sequence of digits (at least one) possibly followed a letter, then use this:...
The most elegant way would be to use a Scanner to extract the first occurrence of an Integer in a given String: ``` int res = new Scanner("My name is John and I am 18 years old").useDelimiter("\\D+").nextInt(); ``` Remember to call the method hasNextInt() before calling nextInt() to make sure it doesn't throw except...
54,078,140
Say I have this code ``` String age = "My name is John and I am 18 years old"; ``` Is there a way to parse only "18" into a integer and leave rest of it as a string? thanks
2019/01/07
[ "https://Stackoverflow.com/questions/54078140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10876868/" ]
``` String age = "My name is John and I am 18 years old"; Integer.parseInt(age.replaceAll("\\D", "")); ``` This will also remove non-digits in-between digits, so "`2k4t1`" becomes `241`. If you need to confirm that the string consists of a sequence of digits (at least one) possibly followed a letter, then use this:...
``` String age = "Mon nom est John et j'ai 18 ans"; age = age.replaceAll("\\D+",""); System.out.print(Integer.parseInt(age)); ```
54,078,140
Say I have this code ``` String age = "My name is John and I am 18 years old"; ``` Is there a way to parse only "18" into a integer and leave rest of it as a string? thanks
2019/01/07
[ "https://Stackoverflow.com/questions/54078140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10876868/" ]
``` String age = "My name is John and I am 18 years old"; Integer.parseInt(age.replaceAll("\\D", "")); ``` This will also remove non-digits in-between digits, so "`2k4t1`" becomes `241`. If you need to confirm that the string consists of a sequence of digits (at least one) possibly followed a letter, then use this:...
``` String age = "My name is John and I am 18 years old"; Matcher matcher = Pattern.compile("My name is John and I am ([\\w]*) years old").matcher(age); if (matcher.matches()) { System.out.println(Integer.parseInt(matcher.group(1))); } ```
54,078,140
Say I have this code ``` String age = "My name is John and I am 18 years old"; ``` Is there a way to parse only "18" into a integer and leave rest of it as a string? thanks
2019/01/07
[ "https://Stackoverflow.com/questions/54078140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10876868/" ]
``` String age = "My name is John and I am 18 years old"; Integer.parseInt(age.replaceAll("\\D", "")); ``` This will also remove non-digits in-between digits, so "`2k4t1`" becomes `241`. If you need to confirm that the string consists of a sequence of digits (at least one) possibly followed a letter, then use this:...
yes it is ``` String s = ""; for (int i = 0; i<age.length; i++){ if (Character.isLetter(age.charAt(i) s+=age.charAt(i); } int number = Integer.parseInt(s); ```
71,194,887
I have an issue with the [Live Sass compiler](https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass) in VS Code, namely when working with lists. None of the usual operations work. In the following example, it's `list.nth(list,index)`. The following works fine in a [Codepen](https://codepen.io/script...
2022/02/20
[ "https://Stackoverflow.com/questions/71194887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17214759/" ]
The extension you are using [does not seem to be maintained anymore](https://github.com/ritwickdey/vscode-live-sass-compiler/issues/486), you can try to use [this one](https://marketplace.visualstudio.com/items?itemName=glenn2223.live-sass) instead.
Use Live Sass Compiler by Glenn Marks ===================================== I had exactly the same problem. You read the SASS official website, follow the instructions, write the code in Visual Studio Code, and then you get this strange `Compilation Error` when saving the SASS or SCSS file. You double-check everything...
60,442,446
I am trying to code a regular expression to capture a pattern that doesnt starts with the string '`value="`'. Already tested with negative lookaheads, but unsucessfull. Wondered if it is even possible with RE... any help is welcome. The expression is `^(?!value=")([M|A|S|R]+\d+[M|S|A|R|a|b|c|d|e|f|x|\d|\s]+)\b` ``` s...
2020/02/27
[ "https://Stackoverflow.com/questions/60442446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289414/" ]
You can simplify it a bit: ``` ^"[MASR]+[\d]+[MSAa-fx\d]+" ``` <https://regex101.com/r/cVWlQp/2> Since you're starting from the beginning of the string using `^`, you can ignore a string that begins with something other than your quoted value. If you're trying to grab the value inside the quotation marks, you can ...
If you are in a JavaScript environment that supports lookbehinds you can do it like this: ``` (?<!value=")(?<=")([MASR]+[\d]+[MSAa-fx\d]+)(?=") ``` Surprisingly, many current browsers [support](https://caniuse.com/#feat=js-regexp-lookbehind) this feature (notable exception: Firefox) and node.js as well. [Demo](http...
60,442,446
I am trying to code a regular expression to capture a pattern that doesnt starts with the string '`value="`'. Already tested with negative lookaheads, but unsucessfull. Wondered if it is even possible with RE... any help is welcome. The expression is `^(?!value=")([M|A|S|R]+\d+[M|S|A|R|a|b|c|d|e|f|x|\d|\s]+)\b` ``` s...
2020/02/27
[ "https://Stackoverflow.com/questions/60442446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289414/" ]
You can simplify it a bit: ``` ^"[MASR]+[\d]+[MSAa-fx\d]+" ``` <https://regex101.com/r/cVWlQp/2> Since you're starting from the beginning of the string using `^`, you can ignore a string that begins with something other than your quoted value. If you're trying to grab the value inside the quotation marks, you can ...
You might use a negative lookbehind, but it is not yet widely supported. ``` (?<!value=")\b[MASR]+\d+[MSAabcdefx\d]+\b ``` * `(?<!value=")` Negative lookbehind, assert what is on the left is not `value="` * `\b[MASR]+\d+` Word boundary, match any char of MASR and 1+ digits * `[MSAabcdefx\d]+\b` Match 1+ times any of...
12,444,142
``` SELECT commandid FROM results WHERE NOT EXISTS ( SELECT * FROM generate_series(0,119999) WHERE generate_series = results.commandid ); ``` I have a column in `results` of type `int` but various tests failed and were not added to the table. I would like to create a query that returns a list of ...
2012/09/16
[ "https://Stackoverflow.com/questions/12444142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265051/" ]
Given sample data: ``` create table results ( commandid integer primary key); insert into results (commandid) select * from generate_series(1,1000); delete from results where random() < 0.20; ``` This works: ``` SELECT s.i AS missing_cmd FROM generate_series(0,1000) s(i) WHERE NOT EXISTS (SELECT 1 FROM results WHER...
As I mentioned in the comment, you need to do the reverse of the above query. ``` SELECT generate_series FROM generate_series(0, 119999) WHERE NOT generate_series IN (SELECT commandid FROM results); ``` At that point, you should find values that do not exist within the `commandid` column within the selec...
12,444,142
``` SELECT commandid FROM results WHERE NOT EXISTS ( SELECT * FROM generate_series(0,119999) WHERE generate_series = results.commandid ); ``` I have a column in `results` of type `int` but various tests failed and were not added to the table. I would like to create a query that returns a list of ...
2012/09/16
[ "https://Stackoverflow.com/questions/12444142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265051/" ]
As I mentioned in the comment, you need to do the reverse of the above query. ``` SELECT generate_series FROM generate_series(0, 119999) WHERE NOT generate_series IN (SELECT commandid FROM results); ``` At that point, you should find values that do not exist within the `commandid` column within the selec...
I am not so experienced SQL guru, but I like other ways to solve problem. Just today I had similar problem - to find unused numbers in one character column. I have solved my problem by using pl/pgsql and was very interested in what will be speed of my procedure. I used @Craig Ringer's way to generate table with serial ...
12,444,142
``` SELECT commandid FROM results WHERE NOT EXISTS ( SELECT * FROM generate_series(0,119999) WHERE generate_series = results.commandid ); ``` I have a column in `results` of type `int` but various tests failed and were not added to the table. I would like to create a query that returns a list of ...
2012/09/16
[ "https://Stackoverflow.com/questions/12444142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265051/" ]
As I mentioned in the comment, you need to do the reverse of the above query. ``` SELECT generate_series FROM generate_series(0, 119999) WHERE NOT generate_series IN (SELECT commandid FROM results); ``` At that point, you should find values that do not exist within the `commandid` column within the selec...
If you're on AWS redshift, you might end up needing to defy the question, since it doesn't support `generate_series`. You'll end up with something like this: ``` select startpoints.id gapstart, min(endpoints.id) resume from ( select id+1 id from yourtable outer_series where not exists ...
12,444,142
``` SELECT commandid FROM results WHERE NOT EXISTS ( SELECT * FROM generate_series(0,119999) WHERE generate_series = results.commandid ); ``` I have a column in `results` of type `int` but various tests failed and were not added to the table. I would like to create a query that returns a list of ...
2012/09/16
[ "https://Stackoverflow.com/questions/12444142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265051/" ]
Given sample data: ``` create table results ( commandid integer primary key); insert into results (commandid) select * from generate_series(1,1000); delete from results where random() < 0.20; ``` This works: ``` SELECT s.i AS missing_cmd FROM generate_series(0,1000) s(i) WHERE NOT EXISTS (SELECT 1 FROM results WHER...
I am not so experienced SQL guru, but I like other ways to solve problem. Just today I had similar problem - to find unused numbers in one character column. I have solved my problem by using pl/pgsql and was very interested in what will be speed of my procedure. I used @Craig Ringer's way to generate table with serial ...
12,444,142
``` SELECT commandid FROM results WHERE NOT EXISTS ( SELECT * FROM generate_series(0,119999) WHERE generate_series = results.commandid ); ``` I have a column in `results` of type `int` but various tests failed and were not added to the table. I would like to create a query that returns a list of ...
2012/09/16
[ "https://Stackoverflow.com/questions/12444142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265051/" ]
Given sample data: ``` create table results ( commandid integer primary key); insert into results (commandid) select * from generate_series(1,1000); delete from results where random() < 0.20; ``` This works: ``` SELECT s.i AS missing_cmd FROM generate_series(0,1000) s(i) WHERE NOT EXISTS (SELECT 1 FROM results WHER...
If you're on AWS redshift, you might end up needing to defy the question, since it doesn't support `generate_series`. You'll end up with something like this: ``` select startpoints.id gapstart, min(endpoints.id) resume from ( select id+1 id from yourtable outer_series where not exists ...
12,444,142
``` SELECT commandid FROM results WHERE NOT EXISTS ( SELECT * FROM generate_series(0,119999) WHERE generate_series = results.commandid ); ``` I have a column in `results` of type `int` but various tests failed and were not added to the table. I would like to create a query that returns a list of ...
2012/09/16
[ "https://Stackoverflow.com/questions/12444142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265051/" ]
I am not so experienced SQL guru, but I like other ways to solve problem. Just today I had similar problem - to find unused numbers in one character column. I have solved my problem by using pl/pgsql and was very interested in what will be speed of my procedure. I used @Craig Ringer's way to generate table with serial ...
If you're on AWS redshift, you might end up needing to defy the question, since it doesn't support `generate_series`. You'll end up with something like this: ``` select startpoints.id gapstart, min(endpoints.id) resume from ( select id+1 id from yourtable outer_series where not exists ...
9,512,674
How can I get iso code language in WordPress? This function : ``` get_bloginfo('language'); ``` return me the languge like this : en-EN I create a function like this : ``` <?php function pr_language() { $lang = get_bloginfo('language'); $pos = stripos($lang, '-'); $lang = substr(get_bloginfo('language...
2012/03/01
[ "https://Stackoverflow.com/questions/9512674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/838050/" ]
I hope I understood your question. It seems like all you want to display is en-US. According to [WordPress](http://codex.wordpress.org/Template_Tags/bloginfo), **Usage:** `<?php bloginfo( $show ); ?>` **Parameters:** `language` So, **EXACT CODE:** `<?php bloginfo('language'); ?>` **Will output:** > > en-US > ...
There are language codes with 3 letters rather than 2, so you shouldn't use `substr`. I did: ``` $lang = explode('-', get_bloginfo('language')); $lang = $lang[0]; ```
32,053,362
I have 3 objects, Users, Recipes, and Tasks. Tasks are nested inside Recipes, and Recipes are nested inside Users. I am able to save/add/delete Recipes just fine, and I can add Tasks in the HTML form, but when I go to save, the Tasks do not show up as part of a Recipe, even when I go back to the form. I have been worki...
2015/08/17
[ "https://Stackoverflow.com/questions/32053362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4624291/" ]
From [dcl.init]: > > Otherwise (i.e., for the remaining copy-initialization cases), user-defined conversion sequences > that can convert **from the source type to the destination type** or (when a conversion function > is used) to a derived class thereof are enumerated as described in 13.3.1.4, and the best one is ...
The second type of initialization is called copy-initialization and uses copy constructor. Therefore, this type of initialization expects the right side is convertible to Bar.
48,311,071
I have a serious problem: I have a bootstrap page with 5 full-page div and I need auto-scrolling: If you scrolled down on first div 30%, auto scroll to the second div. If you scrolled down on second div 30%, scroll down to third div, etc. I can't find a good method and I am not good at jquery. :/ This code is okay, b...
2018/01/17
[ "https://Stackoverflow.com/questions/48311071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3063902/" ]
You do not configure the keep alive on the broker, it is configured on the client side. The value is pass in the connect packet from the client to the broker (<http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Keep_Alive>) How you configure this will depend on which client library you are using, but...
yes, 60 seconds is a default keepalive time for the clients. But there did exists a keepalive\_interval in mosquitto.conf, that is for Mosquitto bridge mode, which is used to connect more than one mosquitto broker together.
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
First the array should be of NSMutableArray type, then check if the object to be inserted exists or not ``` if([yourMutableArray containsObject:valueToBeStored]){ NSLog(@"do not add"); } else{ [yourMutableArray addObject:valueToBeStored]; } ```
Use following code in where you call your method... ``` [yourArray removeAllObjects]; ``` I think it will be helpful to you.
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
``` NSMutableArray *add= [[NSMutableArray alloc]init]; for (Item *item in addList){ if ([add containsObject:item]) { // Do not add } else [add addObject:item]; } ``` Here addList is list of objects
Use following code in where you call your method... ``` [yourArray removeAllObjects]; ``` I think it will be helpful to you.
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
Just change your `NSMutableArray` to a `NSMutableSet`. Make sure your answer's `isEqual:` considers only the question number that is being answered. Also implement `- (NSUInteger)hash`, but it might work without.
Use following code in where you call your method... ``` [yourArray removeAllObjects]; ``` I think it will be helpful to you.
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
I've made the assumption that in going back, the only way a user can go forward is to answer the question again and that the selections (answers) are stored in the array in the order they are answered. In that case, all you need to do it remove the last object in the array each time you step back. ``` [selections rem...
Use following code in where you call your method... ``` [yourArray removeAllObjects]; ``` I think it will be helpful to you.
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
Change your array to a `NSMutableSet` or, if you need the sorting, use `NSMutableOrderedSet`. This basically behaves like a `NSMutableArray` but checks for double entries with `isEqual:`.
Use following code in where you call your method... ``` [yourArray removeAllObjects]; ``` I think it will be helpful to you.
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
``` NSMutableArray *add= [[NSMutableArray alloc]init]; for (Item *item in addList){ if ([add containsObject:item]) { // Do not add } else [add addObject:item]; } ``` Here addList is list of objects
First the array should be of NSMutableArray type, then check if the object to be inserted exists or not ``` if([yourMutableArray containsObject:valueToBeStored]){ NSLog(@"do not add"); } else{ [yourMutableArray addObject:valueToBeStored]; } ```
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
``` NSMutableArray *add= [[NSMutableArray alloc]init]; for (Item *item in addList){ if ([add containsObject:item]) { // Do not add } else [add addObject:item]; } ``` Here addList is list of objects
Just change your `NSMutableArray` to a `NSMutableSet`. Make sure your answer's `isEqual:` considers only the question number that is being answered. Also implement `- (NSUInteger)hash`, but it might work without.
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
``` NSMutableArray *add= [[NSMutableArray alloc]init]; for (Item *item in addList){ if ([add containsObject:item]) { // Do not add } else [add addObject:item]; } ``` Here addList is list of objects
I've made the assumption that in going back, the only way a user can go forward is to answer the question again and that the selections (answers) are stored in the array in the order they are answered. In that case, all you need to do it remove the last object in the array each time you step back. ``` [selections rem...
12,932,542
I have a simple questionnaire app that uses tableview. When users answers questions they have option to step back and change the selection they made. That causes doubling answers in results (the selections are stored in NSmutableArray) How to escape storing "double" results in the array?
2012/10/17
[ "https://Stackoverflow.com/questions/12932542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711746/" ]
``` NSMutableArray *add= [[NSMutableArray alloc]init]; for (Item *item in addList){ if ([add containsObject:item]) { // Do not add } else [add addObject:item]; } ``` Here addList is list of objects
Change your array to a `NSMutableSet` or, if you need the sorting, use `NSMutableOrderedSet`. This basically behaves like a `NSMutableArray` but checks for double entries with `isEqual:`.
10,032,265
How do I make git automatically run `git mergetool` for any merge conflict? This should apply for all merges, using `merge`, `rebase`, `pull`, etc.
2012/04/05
[ "https://Stackoverflow.com/questions/10032265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47773/" ]
You cannot (yet) make git do this. --- This may or may not be an acceptable workaround. Create a function in your `~/.bashrc`: ``` git() { if [[ $1 == "merge" ]] || [[ $1 == "rebase" ]] || [[ $1 == "pull" ]]; then command git "$@" rc=$? if [[ $rc == 1 ]]; then echo "There are conflicts, bet...
You could always use alias ``` alias 'git-merge'='git merge && git mergetool' alias 'git-rebase'='git rebase && git mergetool' alias 'git-pull'='git pull && git mergetool' ``` And/or write a helper script along these lines ``` #/bin/bash git $* [ "$(git ls-files –abbrev –unmerged | wc -l)" -gt 0 ] && git mergetool ...
10,032,265
How do I make git automatically run `git mergetool` for any merge conflict? This should apply for all merges, using `merge`, `rebase`, `pull`, etc.
2012/04/05
[ "https://Stackoverflow.com/questions/10032265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47773/" ]
You cannot (yet) make git do this. --- This may or may not be an acceptable workaround. Create a function in your `~/.bashrc`: ``` git() { if [[ $1 == "merge" ]] || [[ $1 == "rebase" ]] || [[ $1 == "pull" ]]; then command git "$@" rc=$? if [[ $rc == 1 ]]; then echo "There are conflicts, bet...
As far as I know, there is no porcelain way to do it. You can have a wrapper around git like this (file `git_mergetool.sh`, on your path, `+x`): ``` #!/bin/bash SEARCH="CONFLICT" OUTPUT=$(git "$@" 2>&1 | tee /dev/tty) if `echo ${OUTPUT} | grep -i "${SEARCH}" 1>/dev/null 2>&1` then git mergetool fi ``` Then add a...
65,708,618
I have an array of car objects (sorted in ascending order by start) expressed as follows: ``` var cars = [ {"name": "car0blue", "start": 0, "end": 3}, {"name": "car1red", "start": 1, "end": 4}, {"name": "car2yellow", "start": 3, "end": 7}, {"name": "car3green", "start": 3, "end": 6}, {"name": "car4purple", "...
2021/01/13
[ "https://Stackoverflow.com/questions/65708618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13673943/" ]
Fun problem. This algorithm should work in all cases. ```js const cars = [ { name: "car0blue", start: 0, end: 3 }, { name: "car1red", start: 1, end: 4 }, { name: "car2yellow", start: 3, end: 7 }, { name: "car3green", start: 3, end: 6 }, { name: "car4purple", start: 4, end: 7 }, { name: "car5gre...
You need to check each lane if the last `end` is smaller or equal to the current car `start`. If you find a lane then you can add the car, if not you create a new lane. ```js var cars = [ {"name": "car0blue", "start": 0, "end": 3}, {"name": "car1red", "start": 1, "end": 4}, {"name": "car2yellow", "start": 3, "e...
65,708,618
I have an array of car objects (sorted in ascending order by start) expressed as follows: ``` var cars = [ {"name": "car0blue", "start": 0, "end": 3}, {"name": "car1red", "start": 1, "end": 4}, {"name": "car2yellow", "start": 3, "end": 7}, {"name": "car3green", "start": 3, "end": 6}, {"name": "car4purple", "...
2021/01/13
[ "https://Stackoverflow.com/questions/65708618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13673943/" ]
You need to check each lane if the last `end` is smaller or equal to the current car `start`. If you find a lane then you can add the car, if not you create a new lane. ```js var cars = [ {"name": "car0blue", "start": 0, "end": 3}, {"name": "car1red", "start": 1, "end": 4}, {"name": "car2yellow", "start": 3, "e...
You need to convert `cars` into `lanes` e.g. ``` [ car0 car1 car2 car3 car4 car5 ] ``` ``` [ [car0, car2] // lane 0 [car1, car4] // lane 1 [car3] // lane 2 [car5] // lane 3 ] ``` This allows us to find a free lane simply by checking the last car of each lane. When you add a car to a lan...
65,708,618
I have an array of car objects (sorted in ascending order by start) expressed as follows: ``` var cars = [ {"name": "car0blue", "start": 0, "end": 3}, {"name": "car1red", "start": 1, "end": 4}, {"name": "car2yellow", "start": 3, "end": 7}, {"name": "car3green", "start": 3, "end": 6}, {"name": "car4purple", "...
2021/01/13
[ "https://Stackoverflow.com/questions/65708618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13673943/" ]
Fun problem. This algorithm should work in all cases. ```js const cars = [ { name: "car0blue", start: 0, end: 3 }, { name: "car1red", start: 1, end: 4 }, { name: "car2yellow", start: 3, end: 7 }, { name: "car3green", start: 3, end: 6 }, { name: "car4purple", start: 4, end: 7 }, { name: "car5gre...
You need to convert `cars` into `lanes` e.g. ``` [ car0 car1 car2 car3 car4 car5 ] ``` ``` [ [car0, car2] // lane 0 [car1, car4] // lane 1 [car3] // lane 2 [car5] // lane 3 ] ``` This allows us to find a free lane simply by checking the last car of each lane. When you add a car to a lan...
14,298,852
Let's say I have a table named *members* with this structure: ``` member_id, col1, col2, number ``` Now, if I run this query: ``` SELECT @rownum:=@rownum+1 number, member_id FROM members, (SELECT @rownum:=0) r ORDER BY col1 DESC, col2 DESC ``` I get a number for each row. Is it possible to assign this number to ...
2013/01/12
[ "https://Stackoverflow.com/questions/14298852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008798/" ]
You may use a temporary table to store the values and `UPDATE` from it with a join. ``` /* Store query result in a temporary table */ CREATE TEMPORARY TABLE ranks AS SELECT @rownum:=@rownum+1 number, member_id FROM members, (SELECT @rownum:=0) r ORDER BY col1 DESC, col2 DESC; /* And join against it to update your m...
You can try this ``` update members A INNER JOIN ( SELECT @rownum:=@rownum+1 number, member_id FROM members, (SELECT @rownum:=0) r ORDER BY col1 DESC, col2 DESC ) B ON A.member_id = B.member_id SET A.number = B.number; ```
80,121
> > **Possible Duplicate:** > > [Add cstheory.stackexchange.com to the list of site for “off-topic” questions](https://meta.stackexchange.com/questions/77074/add-cstheory-stackexchange-com-to-the-list-of-site-for-off-topic-questions) > > > Currently when voting to close a question and choose the "off-topic" as...
2011/02/21
[ "https://meta.stackexchange.com/questions/80121", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/142006/" ]
I think that would be a mistake: * Some (new?) users upvote any and all answers to their questions. * Just because something is popular, it does not mean that it's helpful, on-topic or not offensive. * If such an option was available, many (most?) reviewers would enable it and lots of posts would slip through the crac...
[This is now the default](https://meta.stackexchange.com/questions/89189/remove-accepted-answers-and-answers-with-many-upvotes-from-the-low-quality-list/164223#164223). It's possible that we'll some day improve the heuristics enough to be confident that some subset of up-voted posts have sufficiently serious quality ...
355,398
A syncing issue with Outlook left me with hundreds, if not thousands of duplicate contacts. After managing to merge duplicates without Contacts crashing, I was left with 177 contacts, most of which with many repeat homepage entries. Rather than dying of boredom removing these by hand, I put together some AppleScript to...
2019/04/01
[ "https://apple.stackexchange.com/questions/355398", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/326301/" ]
I have exactly the same problem. I follow the exact step described here: <http://blog.grapii.com/2015/06/keep-network-drives-mounted-on-mac-os-x-using-autofs/> ``` /Users/username/Desktop/Synology auto_nas ``` Then I created the `/etc/auto_nas` with entry like the following ``` DSVideo -fstype=smbfs ://username:p...
Try this: ``` /- auto_smb -soft,noowners,nobrowse,rw,nofail ```