qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
44,811,928
I'm looking to make a method which detects if the following value in an array is a duplicate, and deletes it if so. It should work for both strings and integers. For example, given the Array: ``` arr = ["A", "B", "B", "C", "c", "A", "D", "D"] ``` Return: ``` arr = ["A", "B", "C", "c", "A", "D"] ``` I tried crea...
2017/06/28
[ "https://Stackoverflow.com/questions/44811928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6831572/" ]
First at all, here is simpler solution: ``` > arr.delete_if.with_index { |e, ind| e == arr[ind+1] } #=> ["A", "B", "C", "c", "A", "D"] ``` But, this solution will mutate `arr`. Here are one-line solutions without mutates: ``` arr.each_with_index.with_object([]) { |(e, ind), res| res << e if e != arr[ind+1] } arr.ea...
Here's a succinct alternative: ``` arr = ["A", "B", "B", "C", "c", "A", "D", "D"] arr.chunk(&:itself).map(&:first) # => ["A", "B", "C", "c", "A", "D"] ``` See it on repl.it: <https://repl.it/JGV4/1>
44,811,928
I'm looking to make a method which detects if the following value in an array is a duplicate, and deletes it if so. It should work for both strings and integers. For example, given the Array: ``` arr = ["A", "B", "B", "C", "c", "A", "D", "D"] ``` Return: ``` arr = ["A", "B", "C", "c", "A", "D"] ``` I tried crea...
2017/06/28
[ "https://Stackoverflow.com/questions/44811928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6831572/" ]
First at all, here is simpler solution: ``` > arr.delete_if.with_index { |e, ind| e == arr[ind+1] } #=> ["A", "B", "C", "c", "A", "D"] ``` But, this solution will mutate `arr`. Here are one-line solutions without mutates: ``` arr.each_with_index.with_object([]) { |(e, ind), res| res << e if e != arr[ind+1] } arr.ea...
Derived from [this](https://stackoverflow.com/a/44788219/5101493 "How do I find the first two consecutive elements in my array of numbers?") answer by [Cary Swoveland](https://stackoverflow.com/users/256970, "The Legend"): ``` def remove_consecs ar enum = ar.each loop.with_object([]) do |_, arr| curr = enum.ne...
44,811,928
I'm looking to make a method which detects if the following value in an array is a duplicate, and deletes it if so. It should work for both strings and integers. For example, given the Array: ``` arr = ["A", "B", "B", "C", "c", "A", "D", "D"] ``` Return: ``` arr = ["A", "B", "C", "c", "A", "D"] ``` I tried crea...
2017/06/28
[ "https://Stackoverflow.com/questions/44811928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6831572/" ]
I would use [select](https://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-select), so you could do something like: ``` a = ["A", "B", "B", "C", "c", "A", "D", "D"] # without mutation b = a.select.with_index { |e, i| a[i+1] != e } a #=> ["A", "B", "B", "C", "c", "A", "D", "D"] b #=> ["A", "B", "C", "c", "A", "D"] ...
Here's a succinct alternative: ``` arr = ["A", "B", "B", "C", "c", "A", "D", "D"] arr.chunk(&:itself).map(&:first) # => ["A", "B", "C", "c", "A", "D"] ``` See it on repl.it: <https://repl.it/JGV4/1>
44,811,928
I'm looking to make a method which detects if the following value in an array is a duplicate, and deletes it if so. It should work for both strings and integers. For example, given the Array: ``` arr = ["A", "B", "B", "C", "c", "A", "D", "D"] ``` Return: ``` arr = ["A", "B", "C", "c", "A", "D"] ``` I tried crea...
2017/06/28
[ "https://Stackoverflow.com/questions/44811928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6831572/" ]
I would use [select](https://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-select), so you could do something like: ``` a = ["A", "B", "B", "C", "c", "A", "D", "D"] # without mutation b = a.select.with_index { |e, i| a[i+1] != e } a #=> ["A", "B", "B", "C", "c", "A", "D", "D"] b #=> ["A", "B", "C", "c", "A", "D"] ...
Derived from [this](https://stackoverflow.com/a/44788219/5101493 "How do I find the first two consecutive elements in my array of numbers?") answer by [Cary Swoveland](https://stackoverflow.com/users/256970, "The Legend"): ``` def remove_consecs ar enum = ar.each loop.with_object([]) do |_, arr| curr = enum.ne...
44,000,699
In Wordpress editor (TinyMCE), whenever I switch between 'Visual' and 'Text' mode, all my HTML formatting gets removed. That includes tabs (indents) and line breaks. Sometimes, even elements and elements attributes are removed. I searched a lot about this issue, wich is actually a pretty common problem for many users,...
2017/05/16
[ "https://Stackoverflow.com/questions/44000699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1301123/" ]
You should try TinyMCE Advanced Plugin. [TinyMCE Advanced](https://wordpress.org/plugins/tinymce-advanced/) have set to Stop removing the `<p> and <br /> tags` when saving and show them in the HTML editor. Try it after removing another editor plugin which you have installed to prevent conflict with other. The seco...
Wordperss has **wp\_kses** function that only allow certain html tag in post content. If you want to certain html tag / attributes allowed in your post content , you need to remove kses filter ( **kses\_remove\_filter** ) functions added in your theme / plugin. **Reference** <https://codex.wordpress.org/Function_...
26,225,066
I have tried many options both in Mac and in Ubuntu. I read the Rserve documentation ``` http://rforge.net/Rserve/doc.html ``` and that for the Rserve and RSclient packages: <http://cran.r-project.org/web/packages/RSclient/RSclient.pdf> <http://cran.r-project.org/web/packages/Rserve/Rserve.pdf> I cannot figure ou...
2014/10/06
[ "https://Stackoverflow.com/questions/26225066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3570398/" ]
Load Rserve and RSclient packages, then connect to the instances. ``` > library(Rserve) > library(RSclient) > Rserve(port = 6311, debug = FALSE) > Rserve(port = 6312, debug = TRUE) Starting Rserve... "C:\..\Rserve.exe" --RS-port 6311 Starting Rserve... "C:\..\Rserve_d.exe" --RS-port 6312 > rsc <- RSconnect(port ...
On a Windows system, if you want to close an `RServe` instance, you can use the `system` function in `R` to close it down. For example in `R`: ``` library(Rserve) Rserve() # run without any arguments or ports specified system('tasklist /FI "IMAGENAME eq Rserve.exe"') # run this to see RServe instances and their PIDs s...
26,225,066
I have tried many options both in Mac and in Ubuntu. I read the Rserve documentation ``` http://rforge.net/Rserve/doc.html ``` and that for the Rserve and RSclient packages: <http://cran.r-project.org/web/packages/RSclient/RSclient.pdf> <http://cran.r-project.org/web/packages/Rserve/Rserve.pdf> I cannot figure ou...
2014/10/06
[ "https://Stackoverflow.com/questions/26225066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3570398/" ]
Load Rserve and RSclient packages, then connect to the instances. ``` > library(Rserve) > library(RSclient) > Rserve(port = 6311, debug = FALSE) > Rserve(port = 6312, debug = TRUE) Starting Rserve... "C:\..\Rserve.exe" --RS-port 6311 Starting Rserve... "C:\..\Rserve_d.exe" --RS-port 6312 > rsc <- RSconnect(port ...
If you are not able to shut it down within R, run the codes below to kill it in terminal. These codes work on Mac. ``` $ ps ax | grep Rserve # get active Rserve sessions ``` You will see outputs like below. 29155 is job id of the active Rserve session. ``` 29155 /Users/userid/Library/R/3.5/library/Rserve/libs/Rs...
26,225,066
I have tried many options both in Mac and in Ubuntu. I read the Rserve documentation ``` http://rforge.net/Rserve/doc.html ``` and that for the Rserve and RSclient packages: <http://cran.r-project.org/web/packages/RSclient/RSclient.pdf> <http://cran.r-project.org/web/packages/Rserve/Rserve.pdf> I cannot figure ou...
2014/10/06
[ "https://Stackoverflow.com/questions/26225066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3570398/" ]
On a Windows system, if you want to close an `RServe` instance, you can use the `system` function in `R` to close it down. For example in `R`: ``` library(Rserve) Rserve() # run without any arguments or ports specified system('tasklist /FI "IMAGENAME eq Rserve.exe"') # run this to see RServe instances and their PIDs s...
If you are not able to shut it down within R, run the codes below to kill it in terminal. These codes work on Mac. ``` $ ps ax | grep Rserve # get active Rserve sessions ``` You will see outputs like below. 29155 is job id of the active Rserve session. ``` 29155 /Users/userid/Library/R/3.5/library/Rserve/libs/Rs...
14,016,192
> > **Possible Duplicate:** > > [Ideal way to cancel an executing AsyncTask](https://stackoverflow.com/questions/2735102/ideal-way-to-cancel-an-executing-asynctask) > > > When I developed an Android application, I used an `AsyncTask` to download something, I used a `progressDialog` to show the progress of this...
2012/12/24
[ "https://Stackoverflow.com/questions/14016192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1685245/" ]
The most correct way to do it would be to check periodically inside `doInBackground` if the task was cancelled (i.e. by calling `isCancelled`). From <http://developer.android.com/reference/android/os/AsyncTask.html>: **Cancelling a task :** A task can be cancelled at any time by invoking `cancel(boolean)`. Invoking ...
do the following on click of back button: declare your Aynctask as global variable like this: ``` //AysncTask class private contactListAsync async; if(async != null){ async.cancel(true); async= null; } ```
14,016,192
> > **Possible Duplicate:** > > [Ideal way to cancel an executing AsyncTask](https://stackoverflow.com/questions/2735102/ideal-way-to-cancel-an-executing-asynctask) > > > When I developed an Android application, I used an `AsyncTask` to download something, I used a `progressDialog` to show the progress of this...
2012/12/24
[ "https://Stackoverflow.com/questions/14016192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1685245/" ]
``` class ImplementAsynctask extends AsyncTask implements OnDismissListener{ ProgressDialog dialog = new ProgressDialog(ActivityName.this); protected onPreExecute() { //do something and show progress dialog } protected onPostExecute() { //cancel dialog after completion...
do the following on click of back button: declare your Aynctask as global variable like this: ``` //AysncTask class private contactListAsync async; if(async != null){ async.cancel(true); async= null; } ```
23,309,861
I'm new to android and am not familiar with using asynctask, I am performing login into my webservice but it fails on trying to read the inputstream on the line ``` InputStream in = urlConnection.getInputStream(); ``` here's my code: ``` package com.test.connector; import java.io.BufferedReader; import java.io.IO...
2014/04/26
[ "https://Stackoverflow.com/questions/23309861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3556095/" ]
Try this.. ``` new TestConnection().execute(); ```
``` new TestConnection().execute(params); ``` and in extend line, ``` AsyncTask<String[],Void,String> ```
23,309,861
I'm new to android and am not familiar with using asynctask, I am performing login into my webservice but it fails on trying to read the inputstream on the line ``` InputStream in = urlConnection.getInputStream(); ``` here's my code: ``` package com.test.connector; import java.io.BufferedReader; import java.io.IO...
2014/04/26
[ "https://Stackoverflow.com/questions/23309861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3556095/" ]
Overload `onPostExecute` method of `AsyncTask`. And call `tc.execute()` instead of `tc.doInBackground()`: ``` @Override protected void onPostExecute(Void result) { //Move your code of reading inputStream here } ``` `execute()` calls `doInBackground` and the `onPostEcecute` gets called.
``` new TestConnection().execute(params); ``` and in extend line, ``` AsyncTask<String[],Void,String> ```
42,540,991
I'm trying to make a shell "bosh>" which takes in Unix commands and keep getting a bad address error. I know my code reads in the commands and parses them but for some reason, I cannot get them to execute, instead, I get a "bad address" error. ``` #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sy...
2017/03/01
[ "https://Stackoverflow.com/questions/42540991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7643500/" ]
These two lines are the culprit: ``` commandArgs[0]=malloc(strlen(command)+1); strcpy(commandArgs[0],command); ``` First of all, `malloc(strlen(...))` followed by `strcpy` is what the POSIX function [`strdup`](https://stackoverflow.com/questions/252782/strdup-what-does-it-do-in-c) already does. But then, you don't n...
You initialize `sPtr` in its declaration, which you do not need to do because you never use the initial value. But the initialization produces undefined behavior because it depends on the contents of the `command` array, which at that point are indeterminate. The array passed as the second argument to `execvp()` is ex...
19,461,360
I am a complete Haskell n00b, but I would like to define a new data type that is simple a list of numbers. How would I go about doing this? I've read Haskell wikibook on type declarations, as well as other online resources, but I cannot seem to figure it out. Here is, in essence, what I've tried: ``` type NumList = [N...
2013/10/19
[ "https://Stackoverflow.com/questions/19461360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/887128/" ]
`Num` is a class, not a type. Choose a type instead; e.g. `Integer` or `Rational` are probably good choices. ``` type NumList = [Integer] ``` However, this does *not* create a new type; it just creates a new name for an old type. If you actually want a new type, you can use `newtype`, as in ``` newtype NumList = Mk...
There is several answers depending on your exact need. If you just want a list of number for specific applications you probably know what exact type of numbers you'll use in this case and should just use : ``` type DoubleList = [Double] ``` (With a more explicit name I hope since DoubleList presents no advantage wh...
19,461,360
I am a complete Haskell n00b, but I would like to define a new data type that is simple a list of numbers. How would I go about doing this? I've read Haskell wikibook on type declarations, as well as other online resources, but I cannot seem to figure it out. Here is, in essence, what I've tried: ``` type NumList = [N...
2013/10/19
[ "https://Stackoverflow.com/questions/19461360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/887128/" ]
The `type` keyword is just for type synonyms (new names of types that already exist), so you can't use a class like `Num`. Instead, you might use the `data` keyword together with Haskell's context notation: ``` data Num a => NumList a = NumList [a] ``` Except when I try that in ghci, it scolds me because [datatype ...
There is several answers depending on your exact need. If you just want a list of number for specific applications you probably know what exact type of numbers you'll use in this case and should just use : ``` type DoubleList = [Double] ``` (With a more explicit name I hope since DoubleList presents no advantage wh...
184,785
I'm new to Drupal Commerce. I have created new product type and added custom fields everything and it's working fine. I want to theme the Add a Product (form page). Please suggest me how to do that. Thanks, Selva
2015/12/23
[ "https://drupal.stackexchange.com/questions/184785", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/55616/" ]
It depends what part of the page you want to theme, simple CSS, change the layout, or adjust the form. To add CSS, you could attach your CSS file in `hook_page_build` for that path. To change the page template, you could override the `page.tpl.php` file as `page--node--add--product.tpl.php` You could also set a cust...
If you are afraid of codes, download the module "themekey" and install . then download the theme you want to use for the path. After that, go to the themekey admin link to set the theme for the specific path.
65,477,452
When I click text fields on the main page (main.dart) which is the default dart given by the flutter. I can see a glitch when soft keyboard appears and there is no delay when soft keyboard disappears.I have attached a gif below for this case. ``` void main() { SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle...
2020/12/28
[ "https://Stackoverflow.com/questions/65477452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11779017/" ]
The reason of this so called `Glitch` is that the default behaviour of the flutter `scaffold` widget is to resize it's body when soft keyboard opens up or closes down. While the flutter scaffold is notified of any of the above two events, it will start resizing the widgets under its `body` to match the new state. The ...
Your keyboard is producing that effect because of the `ListView.builder`. Add extra properties to your `ListView` like this ``` Widget _PageListView(){ return new Container( child: ListView.builder( addAutomaticKeepAlives: true, // Add this property cacheExtent: double.infinity, // And this one ...
28,193,935
I see this examples: <https://openui5.hana.ondemand.com/#docs/guide/25ab54b0113c4914999c43d07d3b71fe.html> I have this my formatter function: ``` rowVisibility: function (oRow, sGrid) { var oModel = new sap.ui.model.json.JSONModel(); oModel.loadData("model/file/mapping/map.json", "", false); v...
2015/01/28
[ "https://Stackoverflow.com/questions/28193935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3224058/" ]
You're mixing iteration with recursion, which is usually not a good idea. (Your compiler should have warned about possibly not returning a value from the function. ) You're also possibly dereferencing a null pointer here: ``` int current = p->age; ``` and comparing the wrong thing here: ``` if (p->age == NULL) ...
First of all, you should `return -1` at the end of your function to inform that nothing was found. Then secondly, you are sending the `p->next` as the parameter of `findLargest` function without checking `NULL` in following code: ``` //Recur to find the highest value from the rest of the LinkedList next = findLargest...
21,140,683
In iOS 7, when navigating back using the new swipe-from-edge-of-screen gesture, the title of the Back button ("Artists") fades from being pink (in the example below) and having regular font weight to being black and having bold font weight. ![enter image description here](https://i.stack.imgur.com/N1Xuo.png) It seems...
2014/01/15
[ "https://Stackoverflow.com/questions/21140683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381416/" ]
You can adjust letter spacing like this, using `NSAttributedString`. In Objective-C: ```objectivec NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"The Clash"]; [attributedString addAttribute:NSKernAttributeName value:@(1.4) ...
With Swift 5.3 and iOS 14, `NSAttributedString.Key` has a static property called `kern`. `kern` has the following [declaration](https://developer.apple.com/documentation/foundation/nsattributedstring/key/1527891-kern): ``` static let kern: NSAttributedString.Key ``` > > The value of this attribute is an `NSNumber` ...
21,140,683
In iOS 7, when navigating back using the new swipe-from-edge-of-screen gesture, the title of the Back button ("Artists") fades from being pink (in the example below) and having regular font weight to being black and having bold font weight. ![enter image description here](https://i.stack.imgur.com/N1Xuo.png) It seems...
2014/01/15
[ "https://Stackoverflow.com/questions/21140683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381416/" ]
You can adjust letter spacing like this, using `NSAttributedString`. In Objective-C: ```objectivec NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"The Clash"]; [attributedString addAttribute:NSKernAttributeName value:@(1.4) ...
For **Swift** 4+ the syntax is as simple as: ``` let text = NSAttributedString(string: "text", attributes: [.kern: 1.4]) ```
21,140,683
In iOS 7, when navigating back using the new swipe-from-edge-of-screen gesture, the title of the Back button ("Artists") fades from being pink (in the example below) and having regular font weight to being black and having bold font weight. ![enter image description here](https://i.stack.imgur.com/N1Xuo.png) It seems...
2014/01/15
[ "https://Stackoverflow.com/questions/21140683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381416/" ]
For **Swift** 4+ the syntax is as simple as: ``` let text = NSAttributedString(string: "text", attributes: [.kern: 1.4]) ```
With Swift 5.3 and iOS 14, `NSAttributedString.Key` has a static property called `kern`. `kern` has the following [declaration](https://developer.apple.com/documentation/foundation/nsattributedstring/key/1527891-kern): ``` static let kern: NSAttributedString.Key ``` > > The value of this attribute is an `NSNumber` ...
95,387
I have changed the language from my MacOS system and now it won't save the screenshots anymore. Is there a way to fix it? Thanks.
2013/07/02
[ "https://apple.stackexchange.com/questions/95387", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/48696/" ]
I found this, and it works: Say you restore your iPhone with a full wipe and restore. Then you choose a previous backup to restore all of your settings and applications. When your iPhone is done restoring to your backup, all your icons are mixed up on the SpringBoard.... what the heck? You want to get them back don't ...
The arrangement of icons and folders is backed up to iTunes and iCloud, so unless you are doing something out of the normal, a simple restore from the backup will restore the position of the icons, the user data and allow all of the apps to download from the store once your settings are restored.
31,494,101
We have a optimized Apache 2.2 setting which works fine, but after upgrading to Apache 2.4 it seems not reflecting. Both Apache were enabled with worker module, have shared the details below. > > Apache 2.2 Settings > ------------------- > > > > ``` > <IfModule worker.c> > ServerLimit 40 > StartServers ...
2015/07/18
[ "https://Stackoverflow.com/questions/31494101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4943986/" ]
Thanks Daniel for your response. I just found the issue few hours back. The conf '00-mpm.conf' (which has the modules to enable prefork / worker / event) was called below the worker.c module setting which seems to have caused the issue. Moving it above the worker setting made apache to pick up the worker setting menti...
First off, **if** you need IfModule, you should use as that is the actual name of the module. Secondly, you should not be using IfModule *if you know that module is going to be there*. Just use the configuration options, don't sugarcoat it with IfModule. Secondly, I would recommend you switch from the worker mpm to th...
9,750,355
I have an object with a Flag enum with several possible "uses". The flag enum uses the proper power of 2. Checking if a variable has a certain flag on, I can do it using the .NET 4 `HasFlag()` BUT: If I store that flag combination as a int in database... how can I retrive the objects that have certain flag on using ...
2012/03/17
[ "https://Stackoverflow.com/questions/9750355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7720/" ]
I doubt any ORM is going to have a way to adapt the HasFlags down to the appropriate SQL code for your DBMS. What you are likely going to need to do is either write a stored procedure, or hand-crank the SQL Statement to be executed for this. You don't mention what DBMS you're using - but if I assume you're using SQ...
``` db.Contacts.Where(c => (c.Flag & MyEnum.Flag3) != 0).ToList(); ```
9,750,355
I have an object with a Flag enum with several possible "uses". The flag enum uses the proper power of 2. Checking if a variable has a certain flag on, I can do it using the .NET 4 `HasFlag()` BUT: If I store that flag combination as a int in database... how can I retrive the objects that have certain flag on using ...
2012/03/17
[ "https://Stackoverflow.com/questions/9750355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7720/" ]
I doubt any ORM is going to have a way to adapt the HasFlags down to the appropriate SQL code for your DBMS. What you are likely going to need to do is either write a stored procedure, or hand-crank the SQL Statement to be executed for this. You don't mention what DBMS you're using - but if I assume you're using SQ...
You can get the combined bit value as int and store that value in the db as a column here is a sample: ``` public enum MessagingProperties { // No options selected (value is 0) None = 0x00, // messages are not discarded if subscriber is slow (value is 1) Durable = 0x01, // messages are saved to dis...
76,999
apache ask for passphrase redirects to plymouth even when I'm remoted in using SSH and away from console. How can I disabled plymouth? Update: I did learn that I can `sudo plymouth --quit` and that will shutdown plymouth. I would like to know the recommended way to disable plymouth on boot.
2011/11/08
[ "https://askubuntu.com/questions/76999", "https://askubuntu.com", "https://askubuntu.com/users/1668/" ]
plymouth should be stopping on its own when the boot is finished.. on a GUI that is when kdm/xdm/gdm/lxdm start. On servers, that is when runlevel 2 is finished (ls /etc/rc2.d). If it is not stopped, this is likely a bug in the bootup, and should be reported with ``` apport-bug plymouth ``` Additional Resources: * ...
The [How can I disable the purple splash screen at boot?](https://askubuntu.com/questions/5065/how-can-i-disable-the-purple-splash-screen-at-boot) has been mentioned. You could also edit the plymouth /1/ upstart /2/ config files and prevent the plymouth start-up. I think that the /etc/init/plymouth.conf will do the tr...
12,473,821
What is difference between. what is best? Do you **drain** same **release** but different in drain don't save **retain**, while release save retain? **autorelease** save object in memory some time.
2012/09/18
[ "https://Stackoverflow.com/questions/12473821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1667650/" ]
What is best? The answer, of course, is 'it depends'. For most newcomers to Cocoa, my opinion is 'none of the above' - it is ARC. Although even with ARC, some understanding of reference-counted memory management is important, you need not worry about missing a `release` or `autorelease`, over over-releasing. In the s...
**release**: In a reference-counted environment, since an autorelease pool cannot be retained , this method decrements the retain count. When an autorelease pool is deallocated, it sends a 'release' message to all its autoreleased objects. Also, In a garbage-collected environment, this method is a no no. ``` - (void)r...
12,473,821
What is difference between. what is best? Do you **drain** same **release** but different in drain don't save **retain**, while release save retain? **autorelease** save object in memory some time.
2012/09/18
[ "https://Stackoverflow.com/questions/12473821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1667650/" ]
drain same release but different in drain don't save retain, while release save retain,, autorelease save object in memory some time.
**release**: In a reference-counted environment, since an autorelease pool cannot be retained , this method decrements the retain count. When an autorelease pool is deallocated, it sends a 'release' message to all its autoreleased objects. Also, In a garbage-collected environment, this method is a no no. ``` - (void)r...
370,830
I just realized that the directions in "UPload" and "DOWNload" seem arbitrary to me as a non-native English speaker. I took a look at a couple of dictionaries and they said that this word is a result of merging "down" and "load", which doesn't seem to explain anything. Where could those two directions come from?
2017/01/29
[ "https://english.stackexchange.com/questions/370830", "https://english.stackexchange.com", "https://english.stackexchange.com/users/53295/" ]
OED noticed the word for the first time in 1976, it seems. 1976 was very early in the development of computers. FTP (File Transfer Protocol) was designed 1971 and TCP/ IP followed in 1973. These two protocols made any transfer of data possible for the first time. Servers or internet wasn't something anyone could imag...
Looking at the OED first use, "1976 [Science 7 May 518/1](http://science.sciencemag.org/content/192/4239/511) Software at any level can be developed on a host minicomputer and ‘down-loaded’ without code conversion", it appears to be talking about loading code from a host to a microprocessor. No real help there but I wo...
370,830
I just realized that the directions in "UPload" and "DOWNload" seem arbitrary to me as a non-native English speaker. I took a look at a couple of dictionaries and they said that this word is a result of merging "down" and "load", which doesn't seem to explain anything. Where could those two directions come from?
2017/01/29
[ "https://english.stackexchange.com/questions/370830", "https://english.stackexchange.com", "https://english.stackexchange.com/users/53295/" ]
Initially, "download" and "upload" were used in aviation, especially by the US military. "Download" meant to remove items such as weapons from the aircraft, while "upload" meant to load items onto the aircraft. For example, the [August 1963 *Aerospace Maintenance Safety*](https://books.google.com/books?id=SNvGD-_SKL0...
Looking at the OED first use, "1976 [Science 7 May 518/1](http://science.sciencemag.org/content/192/4239/511) Software at any level can be developed on a host minicomputer and ‘down-loaded’ without code conversion", it appears to be talking about loading code from a host to a microprocessor. No real help there but I wo...
370,830
I just realized that the directions in "UPload" and "DOWNload" seem arbitrary to me as a non-native English speaker. I took a look at a couple of dictionaries and they said that this word is a result of merging "down" and "load", which doesn't seem to explain anything. Where could those two directions come from?
2017/01/29
[ "https://english.stackexchange.com/questions/370830", "https://english.stackexchange.com", "https://english.stackexchange.com/users/53295/" ]
Looking at the OED first use, "1976 [Science 7 May 518/1](http://science.sciencemag.org/content/192/4239/511) Software at any level can be developed on a host minicomputer and ‘down-loaded’ without code conversion", it appears to be talking about loading code from a host to a microprocessor. No real help there but I wo...
Download and Upload are far from arbitrary, they are entirely rational: A **[Download](https://en.wikipedia.org/wiki/Download)** refers to data that is brought '**down**' from a network, the World Wide Web (Or Cloud) to reside on a local drive / computer. **Upload** is data that is sent '**up**' to the World Wide Web...
370,830
I just realized that the directions in "UPload" and "DOWNload" seem arbitrary to me as a non-native English speaker. I took a look at a couple of dictionaries and they said that this word is a result of merging "down" and "load", which doesn't seem to explain anything. Where could those two directions come from?
2017/01/29
[ "https://english.stackexchange.com/questions/370830", "https://english.stackexchange.com", "https://english.stackexchange.com/users/53295/" ]
Initially, "download" and "upload" were used in aviation, especially by the US military. "Download" meant to remove items such as weapons from the aircraft, while "upload" meant to load items onto the aircraft. For example, the [August 1963 *Aerospace Maintenance Safety*](https://books.google.com/books?id=SNvGD-_SKL0...
OED noticed the word for the first time in 1976, it seems. 1976 was very early in the development of computers. FTP (File Transfer Protocol) was designed 1971 and TCP/ IP followed in 1973. These two protocols made any transfer of data possible for the first time. Servers or internet wasn't something anyone could imag...
370,830
I just realized that the directions in "UPload" and "DOWNload" seem arbitrary to me as a non-native English speaker. I took a look at a couple of dictionaries and they said that this word is a result of merging "down" and "load", which doesn't seem to explain anything. Where could those two directions come from?
2017/01/29
[ "https://english.stackexchange.com/questions/370830", "https://english.stackexchange.com", "https://english.stackexchange.com/users/53295/" ]
OED noticed the word for the first time in 1976, it seems. 1976 was very early in the development of computers. FTP (File Transfer Protocol) was designed 1971 and TCP/ IP followed in 1973. These two protocols made any transfer of data possible for the first time. Servers or internet wasn't something anyone could imag...
Download and Upload are far from arbitrary, they are entirely rational: A **[Download](https://en.wikipedia.org/wiki/Download)** refers to data that is brought '**down**' from a network, the World Wide Web (Or Cloud) to reside on a local drive / computer. **Upload** is data that is sent '**up**' to the World Wide Web...
370,830
I just realized that the directions in "UPload" and "DOWNload" seem arbitrary to me as a non-native English speaker. I took a look at a couple of dictionaries and they said that this word is a result of merging "down" and "load", which doesn't seem to explain anything. Where could those two directions come from?
2017/01/29
[ "https://english.stackexchange.com/questions/370830", "https://english.stackexchange.com", "https://english.stackexchange.com/users/53295/" ]
Initially, "download" and "upload" were used in aviation, especially by the US military. "Download" meant to remove items such as weapons from the aircraft, while "upload" meant to load items onto the aircraft. For example, the [August 1963 *Aerospace Maintenance Safety*](https://books.google.com/books?id=SNvGD-_SKL0...
Download and Upload are far from arbitrary, they are entirely rational: A **[Download](https://en.wikipedia.org/wiki/Download)** refers to data that is brought '**down**' from a network, the World Wide Web (Or Cloud) to reside on a local drive / computer. **Upload** is data that is sent '**up**' to the World Wide Web...
43,578,466
So I got this ``` itemIds1 = ('2394328') itemIds2 = ('6546345') count2 = 1 itemIdsCount = ('itemIds' + count2) while (count2 < 2): #Do stuff count2 = count2 + 1 ``` I'm not sure if I explained this correct. But in line 4 I want to make the string to equal...
2017/04/24
[ "https://Stackoverflow.com/questions/43578466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7147212/" ]
Here are possible options: 1. Use `%s` > > itemIdsCount = 'itemIds%s' + count > > > 2. Cast integer to string first > > itemIdsCount = 'itemIds' + str(count) > > > 3. Use `.format()` method > > itemIdsCount = 'itemIds{}'.format(count) > > > 4. If you have python 3.6, you can use F-string (Literal String I...
The following will create the string you need: ``` itemIdsCount = "itemIds%d" % count2 ``` so you can look up python for strings, and see how you can use %s,%d and others to inject what comes after. As an additionalNote, if you need to append multiple items you would need to say something like this: ``` itemIdsCou...
43,578,466
So I got this ``` itemIds1 = ('2394328') itemIds2 = ('6546345') count2 = 1 itemIdsCount = ('itemIds' + count2) while (count2 < 2): #Do stuff count2 = count2 + 1 ``` I'm not sure if I explained this correct. But in line 4 I want to make the string to equal...
2017/04/24
[ "https://Stackoverflow.com/questions/43578466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7147212/" ]
The following will create the string you need: ``` itemIdsCount = "itemIds%d" % count2 ``` so you can look up python for strings, and see how you can use %s,%d and others to inject what comes after. As an additionalNote, if you need to append multiple items you would need to say something like this: ``` itemIdsCou...
if you need to equal string and integer maybe you should use str(x) or int(x). in this case itemIdsCount = ('itemIds' + str(count2))
43,578,466
So I got this ``` itemIds1 = ('2394328') itemIds2 = ('6546345') count2 = 1 itemIdsCount = ('itemIds' + count2) while (count2 < 2): #Do stuff count2 = count2 + 1 ``` I'm not sure if I explained this correct. But in line 4 I want to make the string to equal...
2017/04/24
[ "https://Stackoverflow.com/questions/43578466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7147212/" ]
You can use `format`, i.e.: ``` count2 = 1 itemIdsCount = ('itemIds{}'.format(count2)) while (count2 < 2): #Do stuff count2 += 1 # it's simpler like this ```
The following will create the string you need: ``` itemIdsCount = "itemIds%d" % count2 ``` so you can look up python for strings, and see how you can use %s,%d and others to inject what comes after. As an additionalNote, if you need to append multiple items you would need to say something like this: ``` itemIdsCou...
43,578,466
So I got this ``` itemIds1 = ('2394328') itemIds2 = ('6546345') count2 = 1 itemIdsCount = ('itemIds' + count2) while (count2 < 2): #Do stuff count2 = count2 + 1 ``` I'm not sure if I explained this correct. But in line 4 I want to make the string to equal...
2017/04/24
[ "https://Stackoverflow.com/questions/43578466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7147212/" ]
Here are possible options: 1. Use `%s` > > itemIdsCount = 'itemIds%s' + count > > > 2. Cast integer to string first > > itemIdsCount = 'itemIds' + str(count) > > > 3. Use `.format()` method > > itemIdsCount = 'itemIds{}'.format(count) > > > 4. If you have python 3.6, you can use F-string (Literal String I...
if you need to equal string and integer maybe you should use str(x) or int(x). in this case itemIdsCount = ('itemIds' + str(count2))
43,578,466
So I got this ``` itemIds1 = ('2394328') itemIds2 = ('6546345') count2 = 1 itemIdsCount = ('itemIds' + count2) while (count2 < 2): #Do stuff count2 = count2 + 1 ``` I'm not sure if I explained this correct. But in line 4 I want to make the string to equal...
2017/04/24
[ "https://Stackoverflow.com/questions/43578466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7147212/" ]
Here are possible options: 1. Use `%s` > > itemIdsCount = 'itemIds%s' + count > > > 2. Cast integer to string first > > itemIdsCount = 'itemIds' + str(count) > > > 3. Use `.format()` method > > itemIdsCount = 'itemIds{}'.format(count) > > > 4. If you have python 3.6, you can use F-string (Literal String I...
You can use `format`, i.e.: ``` count2 = 1 itemIdsCount = ('itemIds{}'.format(count2)) while (count2 < 2): #Do stuff count2 += 1 # it's simpler like this ```
43,578,466
So I got this ``` itemIds1 = ('2394328') itemIds2 = ('6546345') count2 = 1 itemIdsCount = ('itemIds' + count2) while (count2 < 2): #Do stuff count2 = count2 + 1 ``` I'm not sure if I explained this correct. But in line 4 I want to make the string to equal...
2017/04/24
[ "https://Stackoverflow.com/questions/43578466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7147212/" ]
You can use `format`, i.e.: ``` count2 = 1 itemIdsCount = ('itemIds{}'.format(count2)) while (count2 < 2): #Do stuff count2 += 1 # it's simpler like this ```
if you need to equal string and integer maybe you should use str(x) or int(x). in this case itemIdsCount = ('itemIds' + str(count2))
18,879
I want to be able to grab multiple media clips from my project window all at once, then drag and drop them to a timeline stacked on top of each other as opposed to side by side. Each track would take its own track in the timeline. Sort of like keyframe assisting in after effects. Is there a way for this to be done, m...
2016/07/11
[ "https://avp.stackexchange.com/questions/18879", "https://avp.stackexchange.com", "https://avp.stackexchange.com/users/16118/" ]
I dont believe there is any native built in way to do this. The easiest way would likely to build a simple keyboard mouse macro which can be run to repeat the action of selecting the next clip down, and adding to a new track at the start of the sequence.
Adobe Premiere Pro CC 2015 has a thing called a Multi-Camera Source Sequence. This is kind of a combination of both a multicam clip and a sequence. I believe it is enough of a sequence that it can behave like a sequence, meaning that if you were to composite the layers together instead of switching between them, you'd ...
59,955,394
I got somme issue with Symfony to convert a DateTime into string. I use a DataTransformer to format my Datetime but in the form, there is an error that say : "This value should be of type string". Here is my code: My Entity : Shift.php (only the necessary) ```php /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Colu...
2020/01/28
[ "https://Stackoverflow.com/questions/59955394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11013169/" ]
You can group by product and use conditional aggregation: ``` SELECT [Product_ID/No], [Product_Name], SUM(IIF(DATESERIAL(YEAR(DATE()), MONTH(DATE()), 1) = DATESERIAL(YEAR([Date]), MONTH([Date]), 1), Revenue, NULL)) AS Current_Month, SUM(IIF(DATESERIAL(YEAR(DATEADD("m", -1, DATE())), MONTH(DATEADD("m", -1, DATE...
this query is for SQL Server : ``` WITH Temp AS (SELECT [Product_ID/No], [Product_Name], ISNULL(SUM(IIF(DATEPART(MONTH, GETDATE()) = DATEPART(MONTH, [Date]), Revenue, NULL)), 0) AS Current_Month, ISNULL(SUM(IIF(DATEPART(MONTH, DATEADD(MONTH, -1, GETDATE())) = DATEPART(MONTH, [Date]), R...
132,170
So, every time I switch to orthographic mode in Blender 2.8 (Didn't use to happen in 2.79) my model starts clipping (as shown in the video). I've tried changing the "clip start" value, but that just ruins it when I switch back over to the dynamic view. Any ideas? Video: <https://youtu.be/EuOuOvNPw78>
2019/02/18
[ "https://blender.stackexchange.com/questions/132170", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/69387/" ]
I've been having the same problem and fortunately we are not alone and somebody has already reported this bug. You can find the current state of it at the link below. It looks like it's been resolved and we're just waiting on an update now. Bug report <https://developer.blender.org/T61632> Specific commit with the fi...
set it up like in this capture, thats its the right values [![enter image description here](https://i.stack.imgur.com/NTHDG.png)](https://i.stack.imgur.com/NTHDG.png)
66,190,751
Problem Description: -------------------- I am looking for a way to access the `li`-elements between two specific heading-tags only (e.g.from 2nd `h3` to 3rd `h3` or from 3rd `h3` to next `h4`) in order to create a table of historical events listed on <https://de.wikipedia.org/wiki/1._Januar> structured along the crit...
2021/02/13
[ "https://Stackoverflow.com/questions/66190751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11779702/" ]
Please verify your cproj file and check if they're being excluded. You can add this to your csproj file to have the content of `wwwroot` copied over: ``` <ItemGroup> <None Include="wwwroot\**"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> ```
I had the same/similar issue which was resolved by deleting the folders projectroot/bin projectroot/obj please also set the file properties in solution explorer to "copy if newer" as shown in the image below [![file properties](https://i.stack.imgur.com/voPzG.png)](https://i.stack.imgur.com/voPzG.png)
41,655,412
What I'm trying to do is to center the text (and image that will be side by side or on top of the text) but the command justify-content:center doesn't work for me. It centers horizontally but not vertically. Could you tell me what went wrong? I'm actually a beginner and that's my first website. Here's the code: ```cs...
2017/01/14
[ "https://Stackoverflow.com/questions/41655412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7419823/" ]
This JS Bin is a working example of converting a File to base64: <http://jsbin.com/piqiqecuxo/1/edit?js,console,output> . The main addition seems to be reading the file using a `FileReader`, where `FileReader.readAsDataURL()` returns a base64 encoded string ``` document.getElementById('button').addEventListener('click...
If you want it in a neat method that works with async / await, you can do it this way ``` const getBase64 = async (file: Blob): Promise<string | undefined> => { var reader = new FileReader(); reader.readAsDataURL(file as Blob); return new Promise((reslove, reject) => { reader.onload = () => reslove(reader.r...
29,934,126
sorry, I need some help finding the right regular expression for this. Basically I want to recognize via regex if the following format is in a string: artist - title (something) examples: ``` "ellie goulding - good gracious (the chainsmokers remix)" "the xx - you got the love (florence and the machine cover)" "neneh...
2015/04/29
[ "https://Stackoverflow.com/questions/29934126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4844612/" ]
Well for storing images you can try this * If you want to save images which are not coming from server and are stored in drawable/mipmap folder just store their id like initialValues.put(COLUMN\_IMAGE, R.mipmap.demp); * And if they are coming from server or api call just save their url and load them using any library...
Convert your image into base64 encoded string and then insert that string into database: ``` Bitmap bm = BitmapFactory.decodeFile("<path to your image>"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); String encodedStri...
29,934,126
sorry, I need some help finding the right regular expression for this. Basically I want to recognize via regex if the following format is in a string: artist - title (something) examples: ``` "ellie goulding - good gracious (the chainsmokers remix)" "the xx - you got the love (florence and the machine cover)" "neneh...
2015/04/29
[ "https://Stackoverflow.com/questions/29934126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4844612/" ]
Well for storing images you can try this * If you want to save images which are not coming from server and are stored in drawable/mipmap folder just store their id like initialValues.put(COLUMN\_IMAGE, R.mipmap.demp); * And if they are coming from server or api call just save their url and load them using any library...
This is a method to store your bitmap image into database, you need to assign a type of column as Blob for image in database table ``` protected long saveBitmap(SQLiteDatabase database, Bitmap bmp) { Log.d("ImageDatabase", ":: Method Called"); int bytes = bmp.getByteCount(); ByteBuffer buffer ...
29,934,126
sorry, I need some help finding the right regular expression for this. Basically I want to recognize via regex if the following format is in a string: artist - title (something) examples: ``` "ellie goulding - good gracious (the chainsmokers remix)" "the xx - you got the love (florence and the machine cover)" "neneh...
2015/04/29
[ "https://Stackoverflow.com/questions/29934126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4844612/" ]
The simplest technique you can follow is to store your Image path in the database table as a String and then you can get it back whenever you need that image and decode it using `BitmapFactory.decodeFile`. Storing Base64String is fine but the string will have too large so, if you will see the path of image it is compar...
Convert your image into base64 encoded string and then insert that string into database: ``` Bitmap bm = BitmapFactory.decodeFile("<path to your image>"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); String encodedStri...
29,934,126
sorry, I need some help finding the right regular expression for this. Basically I want to recognize via regex if the following format is in a string: artist - title (something) examples: ``` "ellie goulding - good gracious (the chainsmokers remix)" "the xx - you got the love (florence and the machine cover)" "neneh...
2015/04/29
[ "https://Stackoverflow.com/questions/29934126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4844612/" ]
The simplest technique you can follow is to store your Image path in the database table as a String and then you can get it back whenever you need that image and decode it using `BitmapFactory.decodeFile`. Storing Base64String is fine but the string will have too large so, if you will see the path of image it is compar...
This is a method to store your bitmap image into database, you need to assign a type of column as Blob for image in database table ``` protected long saveBitmap(SQLiteDatabase database, Bitmap bmp) { Log.d("ImageDatabase", ":: Method Called"); int bytes = bmp.getByteCount(); ByteBuffer buffer ...
597,089
I dual booted windows 8.0 x86 with ubuntu 14.04. Then tried accessing the volume containing windows but I got this error message: ``` Error mounting /dev/sda2 at /media/van/BE96C17E96C13823: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda2" "/media/van/...
2015/03/15
[ "https://askubuntu.com/questions/597089", "https://askubuntu.com", "https://askubuntu.com/users/388274/" ]
two things can cause this problem: 1. dont start Ubuntu after you hibernate windows. Always do proper shutdown before you start Ubuntu. 2. Disable *Hybird Shutdown* in windows. [Here](http://www.maketecheasier.com/disable-hybrid-boot-and-shutdown-in-windows-8/) is how you can do that. now all you can do is shutdown U...
You ***must*** shutdown Windows completely - not just hibernate - before you try to mount it in Ubuntu.
21,004,823
I would like to know how can I send a swipe gesture programmatically without actually swiping the phone. For instance, I have button that in the `onClick` event I would call `swipeGestureRecognizer`? Is this possible?
2014/01/08
[ "https://Stackoverflow.com/questions/21004823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2823451/" ]
You can call the method you are calling on Swipe, when user taps on button. For examaple, you have a method for swipe gesture, call it `onSwipe` . Now call onSwipe methos when user taps on the button. Thats it **EDIT** Here is the code for you: ``` -(void)myMethod{ //Write the logic you want to implement for swipe ...
If you need to pass the gesture event to the handler, then ``` UISwipeGestureRecognizer *gesture = [[UISwipeGestureRecognizer alloc] init]; gesture.direction = UISwipeGestureRecognizerDirectionLeft; [self handleSwipe:gesture]; ```
49,689,536
I have an overlay `(UIImageView)` which should have a transparent background and alpha. How can I set the `imageview` such that it covers the entire screen? Currently, it covers the screen but not the `UIStatusBar`. I am adding the view in `AppDelegate's` main `window` as a `subview`. The code: ``` let overlay1...
2018/04/06
[ "https://Stackoverflow.com/questions/49689536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8403513/" ]
After discussion in comments found that changing the `backgroundColor` of `statusBar` is the reason why your code is not working properly. By printing the `superView` of `statusBar` I found that `statusBar` is not added on `UIWindow` instead it is on `UIStatusBarWindow` which is probably above the `mainWindow`. Also ...
Okay I just tried with something and it worked. Just use it in your `ViewController` like: ``` // You should be using viewDidAppear(_:) override func viewDidAppear(_ animated: Bool) { if let appDelegate = UIApplication.shared.delegate as? AppDelegate, let window = appDelegate.window { let windowFrame = win...
65,971,168
I have some lines of text, and then their relevance weight. ``` Weight, Text 10, "I like apples" 20, "Someone needs apples" ``` Is it possible to get the combinations, keeping the values in the weights column? Something like: ``` weight, combinations 10, [I like] 10, [I apples] 10, [like apples] 20, [someone needs]...
2021/01/30
[ "https://Stackoverflow.com/questions/65971168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14395605/" ]
To fill the first row in 2D array, use `Arrays.fill`, to fill the rest of the rows, use [`Arrays.copyOf`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#copyOf(T%5B%5D,int)). Next, it's better to implement separate methods to perform different tasks: 1. Create and fill the grid 2. ...
The "import java.util.arrays" needs to be above the class definition at the top of the file.
65,971,168
I have some lines of text, and then their relevance weight. ``` Weight, Text 10, "I like apples" 20, "Someone needs apples" ``` Is it possible to get the combinations, keeping the values in the weights column? Something like: ``` weight, combinations 10, [I like] 10, [I apples] 10, [like apples] 20, [someone needs]...
2021/01/30
[ "https://Stackoverflow.com/questions/65971168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14395605/" ]
To fill the first row in 2D array, use `Arrays.fill`, to fill the rest of the rows, use [`Arrays.copyOf`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#copyOf(T%5B%5D,int)). Next, it's better to implement separate methods to perform different tasks: 1. Create and fill the grid 2. ...
The import statement is always defined above the whole program so as to import the prebuild functions and classes hence ```java import java.util.Arrays; ``` This will be the first line of the program before Main class is defined. ```java arrays.fill(grid1[0],so); ``` Here since **so** is not a variable, it seems ...
65,971,168
I have some lines of text, and then their relevance weight. ``` Weight, Text 10, "I like apples" 20, "Someone needs apples" ``` Is it possible to get the combinations, keeping the values in the weights column? Something like: ``` weight, combinations 10, [I like] 10, [I apples] 10, [like apples] 20, [someone needs]...
2021/01/30
[ "https://Stackoverflow.com/questions/65971168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14395605/" ]
To fill the first row in 2D array, use `Arrays.fill`, to fill the rest of the rows, use [`Arrays.copyOf`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#copyOf(T%5B%5D,int)). Next, it's better to implement separate methods to perform different tasks: 1. Create and fill the grid 2. ...
Ok, firstly all imports need to be typed at the very top aka beginning of the program so place `import java.util.Arrays;` above `class Main`. ``` import java.util.Arrays; class Main { public static void main(String[] args) { String[][] grid1=new String[8][8]; for (int n=0; n<=grid1.length; n+...
65,971,168
I have some lines of text, and then their relevance weight. ``` Weight, Text 10, "I like apples" 20, "Someone needs apples" ``` Is it possible to get the combinations, keeping the values in the weights column? Something like: ``` weight, combinations 10, [I like] 10, [I apples] 10, [like apples] 20, [someone needs]...
2021/01/30
[ "https://Stackoverflow.com/questions/65971168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14395605/" ]
To fill the first row in 2D array, use `Arrays.fill`, to fill the rest of the rows, use [`Arrays.copyOf`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#copyOf(T%5B%5D,int)). Next, it's better to implement separate methods to perform different tasks: 1. Create and fill the grid 2. ...
You can use [`Arrays#setAll`](https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#setAll-T:A-java.util.function.IntFunction-) method to fill a *multidimensional array* and [`Arrays#fill`](https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#fill-java.lang.Object:A-java.lang.Object-) method inside...
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
I couldn't find a way to do it or an app that would do it. There were a couple out there that claimed to have manual focus but basically just did what you described as "assisted auto focus." I found this thread at XDA where some people have been looking through the code to find a way to add the manual focus. From what...
The new API for full control of the camera on android had been added to android version 5. Google added these features like iso ,manual focus and etc in android lollipop. I personally think to use this new API the camera hardware must support this features, However I didn't find any reference to claim this, but it make...
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
I couldn't find a way to do it or an app that would do it. There were a couple out there that claimed to have manual focus but basically just did what you described as "assisted auto focus." I found this thread at XDA where some people have been looking through the code to find a way to add the manual focus. From what...
Only 8 years later, the Moment Pro Photo app can now do this. May not be available for every phone, but it works as advertised on mine, specifically the manual focus. <https://play.google.com/store/apps/details?id=com.shopmoment.momentprocamera>
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
I couldn't find a way to do it or an app that would do it. There were a couple out there that claimed to have manual focus but basically just did what you described as "assisted auto focus." I found this thread at XDA where some people have been looking through the code to find a way to add the manual focus. From what...
There is a free android app that allows you to manually adjust focus (and more camera technical stuff for photographers) Its called open camera and can be found on playstore. (the one by mark harman) NOTE: it will only work if your device supports it. (aka if possible) To get straight to using manual focous: inst...
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
I couldn't find a way to do it or an app that would do it. There were a couple out there that claimed to have manual focus but basically just did what you described as "assisted auto focus." I found this thread at XDA where some people have been looking through the code to find a way to add the manual focus. From what...
My Hauwei Mate 9 has manual focus, ISO, and shutter speed options. I use it frequently for sunsets and stage lighting.
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
The new API for full control of the camera on android had been added to android version 5. Google added these features like iso ,manual focus and etc in android lollipop. I personally think to use this new API the camera hardware must support this features, However I didn't find any reference to claim this, but it make...
Only 8 years later, the Moment Pro Photo app can now do this. May not be available for every phone, but it works as advertised on mine, specifically the manual focus. <https://play.google.com/store/apps/details?id=com.shopmoment.momentprocamera>
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
The new API for full control of the camera on android had been added to android version 5. Google added these features like iso ,manual focus and etc in android lollipop. I personally think to use this new API the camera hardware must support this features, However I didn't find any reference to claim this, but it make...
My Hauwei Mate 9 has manual focus, ISO, and shutter speed options. I use it frequently for sunsets and stage lighting.
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
There is a free android app that allows you to manually adjust focus (and more camera technical stuff for photographers) Its called open camera and can be found on playstore. (the one by mark harman) NOTE: it will only work if your device supports it. (aka if possible) To get straight to using manual focous: inst...
Only 8 years later, the Moment Pro Photo app can now do this. May not be available for every phone, but it works as advertised on mine, specifically the manual focus. <https://play.google.com/store/apps/details?id=com.shopmoment.momentprocamera>
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
My Hauwei Mate 9 has manual focus, ISO, and shutter speed options. I use it frequently for sunsets and stage lighting.
Only 8 years later, the Moment Pro Photo app can now do this. May not be available for every phone, but it works as advertised on mine, specifically the manual focus. <https://play.google.com/store/apps/details?id=com.shopmoment.momentprocamera>
2,042
Is there any way to manually focus the camera on my Android phone? I know that you can tap on where to focus, but that's just assisted auto focus. What I want is to be able to manually adjust the focus.
2010/10/09
[ "https://android.stackexchange.com/questions/2042", "https://android.stackexchange.com", "https://android.stackexchange.com/users/113/" ]
There is a free android app that allows you to manually adjust focus (and more camera technical stuff for photographers) Its called open camera and can be found on playstore. (the one by mark harman) NOTE: it will only work if your device supports it. (aka if possible) To get straight to using manual focous: inst...
My Hauwei Mate 9 has manual focus, ISO, and shutter speed options. I use it frequently for sunsets and stage lighting.
30,937,236
i have a problem.. i have an app that connects with a database with jSON, now the problem is that he cannot find the element in the response of the database. This is the code : ``` func uploadtoDB(){ var SelectVehicle = save.stringForKey("SelectVehicleChoosed") if SelectVehicle == nil { var alertVi...
2015/06/19
[ "https://Stackoverflow.com/questions/30937236", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5028072/" ]
``` // serviceHistory is an Array var serviceHistoryArray = jsonData["serviceHistory"] as! NSArray // fetch the first item... var serviceHistoryItem = serviceHistoryArray[0] as! NSDictionary var serviceDate = serviceHistoryItem["serviceDate"] var serviceType = serviceHistoryItem["serviceType"] var kms = serviceHistory...
As a side note: parsing JSON has become sort of a popular playground for swift developers, since it's a nuanced problem that can be difficult in strongly typed languages. A bunch of people have written libraries for addressing this 'swiftily', and there have been a lot of interesting discussions on the topic. Some exam...
44,682,639
I'm currently developing my own calculator and I'm getting an `NumberFormatException` when I press the plus button inside it:- ``` if(e.getSource() == p) { String a[] = new String[2]; double d[] = new double[2]; for(int i =0; i<2; i++) { a[i] = tf.getText(); d[i] = Double.parseDouble(a[i])...
2017/06/21
[ "https://Stackoverflow.com/questions/44682639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7911099/" ]
You can't parse `+` inside `Double.parseDouble(String string)` If the string does not contain a parsable double it throw `NumberFormatException`.
I am assuming that you are entering the input as 1+2, so when you click plus, the second number which you are storing is null hence the error
44,682,639
I'm currently developing my own calculator and I'm getting an `NumberFormatException` when I press the plus button inside it:- ``` if(e.getSource() == p) { String a[] = new String[2]; double d[] = new double[2]; for(int i =0; i<2; i++) { a[i] = tf.getText(); d[i] = Double.parseDouble(a[i])...
2017/06/21
[ "https://Stackoverflow.com/questions/44682639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7911099/" ]
You can't parse `+` inside `Double.parseDouble(String string)` If the string does not contain a parsable double it throw `NumberFormatException`.
This will resolve your problem ``` if(e.getSource() == p) { String a[] = new String[2]; double d[] = new double[2]; for(int i =0; i<2; i++) { a[i] = tf.getText(); if(a[i].contains("[a-zA-Z]+") == false){ d[i] = Double.parseDouble(a[i]); System.out.println("First arra...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
Here's one way to do it, using `IO#read_nonblock`: ``` def quit? begin # See if a 'Q' has been typed yet while c = STDIN.read_nonblock(1) puts "I found a #{c}" return true if c == 'Q' end # No 'Q' found false rescue Errno::EINTR puts "Well, your device seems a little slow..." ...
You can also do this without the buffer. In unix based systems it is easy: ``` system("stty raw -echo") #=> Raw mode, no echo char = STDIN.getc system("stty -raw echo") #=> Reset terminal mode puts char ``` This will wait for a key to be pressed and return the char code. No need to press . Put the `char = STDIN.get...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
A combination of the other answers gets the desired behavior. Tested in ruby 1.9.3 on OSX and Linux. ``` loop do puts 'foo' system("stty raw -echo") char = STDIN.read_nonblock(1) rescue nil system("stty -raw echo") break if /q/i =~ char sleep(2) end ```
You may also want to investigate the 'io/wait' library for Ruby which provides the `ready?` method to all IO objects. I haven't tested your situation specifically, but am using it in a socket based library I'm working on. In your case, provided STDIN is just a standard IO object, you could probably quit the moment `rea...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
By combinig the various solutions I just read, I came up with a cross-platform way to solve that problem. [Details here](http://blog.x-aeon.com/2014/03/26/how-to-read-one-non-blocking-key-press-in-ruby/), but here is the relevant piece of code: a `GetKey.getkey` method returning the ASCII code or `nil` if none was pres...
Now use this ``` require 'Win32API' VK_SHIFT = 0x10 VK_ESC = 0x1B def check_shifts() $listener.call(VK_SHIFT) != 0 ? true : false end # create empty Hash of key codes keys = Hash.new # create empty Hash for shift characters uppercase = Hash.new # add letters (0x41..0x5A).each { |code| keys[code.chr.downcase] ...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
Here's one way to do it, using `IO#read_nonblock`: ``` def quit? begin # See if a 'Q' has been typed yet while c = STDIN.read_nonblock(1) puts "I found a #{c}" return true if c == 'Q' end # No 'Q' found false rescue Errno::EINTR puts "Well, your device seems a little slow..." ...
A combination of the other answers gets the desired behavior. Tested in ruby 1.9.3 on OSX and Linux. ``` loop do puts 'foo' system("stty raw -echo") char = STDIN.read_nonblock(1) rescue nil system("stty -raw echo") break if /q/i =~ char sleep(2) end ```
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
You can also do this without the buffer. In unix based systems it is easy: ``` system("stty raw -echo") #=> Raw mode, no echo char = STDIN.getc system("stty -raw echo") #=> Reset terminal mode puts char ``` This will wait for a key to be pressed and return the char code. No need to press . Put the `char = STDIN.get...
Now use this ``` require 'Win32API' VK_SHIFT = 0x10 VK_ESC = 0x1B def check_shifts() $listener.call(VK_SHIFT) != 0 ? true : false end # create empty Hash of key codes keys = Hash.new # create empty Hash for shift characters uppercase = Hash.new # add letters (0x41..0x5A).each { |code| keys[code.chr.downcase] ...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
A combination of the other answers gets the desired behavior. Tested in ruby 1.9.3 on OSX and Linux. ``` loop do puts 'foo' system("stty raw -echo") char = STDIN.read_nonblock(1) rescue nil system("stty -raw echo") break if /q/i =~ char sleep(2) end ```
Now use this ``` require 'Win32API' VK_SHIFT = 0x10 VK_ESC = 0x1B def check_shifts() $listener.call(VK_SHIFT) != 0 ? true : false end # create empty Hash of key codes keys = Hash.new # create empty Hash for shift characters uppercase = Hash.new # add letters (0x41..0x5A).each { |code| keys[code.chr.downcase] ...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
Here's one way to do it, using `IO#read_nonblock`: ``` def quit? begin # See if a 'Q' has been typed yet while c = STDIN.read_nonblock(1) puts "I found a #{c}" return true if c == 'Q' end # No 'Q' found false rescue Errno::EINTR puts "Well, your device seems a little slow..." ...
Now use this ``` require 'Win32API' VK_SHIFT = 0x10 VK_ESC = 0x1B def check_shifts() $listener.call(VK_SHIFT) != 0 ? true : false end # create empty Hash of key codes keys = Hash.new # create empty Hash for shift characters uppercase = Hash.new # add letters (0x41..0x5A).each { |code| keys[code.chr.downcase] ...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
You may also want to investigate the 'io/wait' library for Ruby which provides the `ready?` method to all IO objects. I haven't tested your situation specifically, but am using it in a socket based library I'm working on. In your case, provided STDIN is just a standard IO object, you could probably quit the moment `rea...
Now use this ``` require 'Win32API' VK_SHIFT = 0x10 VK_ESC = 0x1B def check_shifts() $listener.call(VK_SHIFT) != 0 ? true : false end # create empty Hash of key codes keys = Hash.new # create empty Hash for shift characters uppercase = Hash.new # add letters (0x41..0x5A).each { |code| keys[code.chr.downcase] ...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
By combinig the various solutions I just read, I came up with a cross-platform way to solve that problem. [Details here](http://blog.x-aeon.com/2014/03/26/how-to-read-one-non-blocking-key-press-in-ruby/), but here is the relevant piece of code: a `GetKey.getkey` method returning the ASCII code or `nil` if none was pres...
You may also want to investigate the 'io/wait' library for Ruby which provides the `ready?` method to all IO objects. I haven't tested your situation specifically, but am using it in a socket based library I'm working on. In your case, provided STDIN is just a standard IO object, you could probably quit the moment `rea...
946,739
I have a WCF web service that I am hosting in IIS (actually running within the Visual Studio web host i.e. Cassini). I have a file that I have to access in the root of the web directory from the service, and am having trouble figuring out the user identity that the service accesses the directory as. I've given permiss...
2009/06/03
[ "https://Stackoverflow.com/questions/946739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146/" ]
You can also do this without the buffer. In unix based systems it is easy: ``` system("stty raw -echo") #=> Raw mode, no echo char = STDIN.getc system("stty -raw echo") #=> Reset terminal mode puts char ``` This will wait for a key to be pressed and return the char code. No need to press . Put the `char = STDIN.get...
You may also want to investigate the 'io/wait' library for Ruby which provides the `ready?` method to all IO objects. I haven't tested your situation specifically, but am using it in a socket based library I'm working on. In your case, provided STDIN is just a standard IO object, you could probably quit the moment `rea...
352,121
I'm trying to understand how to solve this differential equation: $ [z^2(1-z)\dfrac{d^2}{dz} - z^2 \dfrac{d}{dz} - \lambda] f(z) = 0 $ I know the solution is related to the hypergeometric function $\_2F^1$, but as I recall from many sources: this functions satisfies another differential equation: $ [z(1-z)\dfrac{...
2020/02/07
[ "https://mathoverflow.net/questions/352121", "https://mathoverflow.net", "https://mathoverflow.net/users/152035/" ]
Let $\alpha$ be a root of $\alpha^2-\alpha-\lambda=0$. The change of the dependent variable $f(z)=z^\alpha w(z)$ reduces to the hypergeometric equation in $w$: $$z(1-z)w''+(2\alpha(1-z)-z)w'-\alpha^2 w=0.$$
The transformation $x = (z-2)/z$ takes your differential equation to $$ (x^2-1) f'' + 2 x f' - \lambda f = 0$$ which is a Gegenbauer differential equation. Its solutions can be written using Legendre P and Q functions: $$f \left( x \right) =c\_1 \,{\it LegendreP} \left( {\frac {1}{2} \sqrt {1+4\,\lambda}}-{\frac{1}{...
46,682,841
I get this error when I try to execute my first Selenium/python code. > > selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions. > > > My code : ``` from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary if __name...
2017/10/11
[ "https://Stackoverflow.com/questions/46682841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8757346/" ]
Path for driver is not set correctly, you need to set path till the .exe as shown below ``` driver = webdriver.Firefox(firefox_binary=binary, executable_path="C:\\Users\\mohammed.asif\\Geckodriver\\geckodriver.exe") ```
First as per @shohib your are path is wrong, it is correct ``` driver = webdriver.Firefox(firefox_binary=binary, executable_path="C:\\Users\\mohammed.asif\\Geckodriver\\geckodriver.exe") ``` For this error > > error selenium.common.exceptions.WebDriverException: Message: Unable > to...
46,682,841
I get this error when I try to execute my first Selenium/python code. > > selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions. > > > My code : ``` from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary if __name...
2017/10/11
[ "https://Stackoverflow.com/questions/46682841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8757346/" ]
Path for driver is not set correctly, you need to set path till the .exe as shown below ``` driver = webdriver.Firefox(firefox_binary=binary, executable_path="C:\\Users\\mohammed.asif\\Geckodriver\\geckodriver.exe") ```
While working with *Selenium v3.6.0*, *geckodriver* and *Mozilla Firefox* through *Selenium-Python* clients, you need to download the **geckodriver.exe** from [the repository](https://github.com/mozilla/geckodriver/releases) and place it anywhere with in your system and provide the reference of the **geckodriver.exe** ...
46,682,841
I get this error when I try to execute my first Selenium/python code. > > selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions. > > > My code : ``` from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary if __name...
2017/10/11
[ "https://Stackoverflow.com/questions/46682841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8757346/" ]
While working with *Selenium v3.6.0*, *geckodriver* and *Mozilla Firefox* through *Selenium-Python* clients, you need to download the **geckodriver.exe** from [the repository](https://github.com/mozilla/geckodriver/releases) and place it anywhere with in your system and provide the reference of the **geckodriver.exe** ...
First as per @shohib your are path is wrong, it is correct ``` driver = webdriver.Firefox(firefox_binary=binary, executable_path="C:\\Users\\mohammed.asif\\Geckodriver\\geckodriver.exe") ``` For this error > > error selenium.common.exceptions.WebDriverException: Message: Unable > to...
46,682,841
I get this error when I try to execute my first Selenium/python code. > > selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions. > > > My code : ``` from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary if __name...
2017/10/11
[ "https://Stackoverflow.com/questions/46682841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8757346/" ]
make your geckodriver executable: `sudo chmod +x geckodriver`
First as per @shohib your are path is wrong, it is correct ``` driver = webdriver.Firefox(firefox_binary=binary, executable_path="C:\\Users\\mohammed.asif\\Geckodriver\\geckodriver.exe") ``` For this error > > error selenium.common.exceptions.WebDriverException: Message: Unable > to...
46,682,841
I get this error when I try to execute my first Selenium/python code. > > selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions. > > > My code : ``` from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary if __name...
2017/10/11
[ "https://Stackoverflow.com/questions/46682841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8757346/" ]
make your geckodriver executable: `sudo chmod +x geckodriver`
While working with *Selenium v3.6.0*, *geckodriver* and *Mozilla Firefox* through *Selenium-Python* clients, you need to download the **geckodriver.exe** from [the repository](https://github.com/mozilla/geckodriver/releases) and place it anywhere with in your system and provide the reference of the **geckodriver.exe** ...
48,494
I'm a very new player to the Pokemon TCG, and have picked up two themed decks to play with ([Ultra Prism](https://www.pokemon.com/us/pokemon-tcg/sun-moon-ultra-prism/theme-decks/)). So far in my experience however it seems that if one player gets their active Pokemon to its final evolution (for example [Empoleon](http...
2019/09/02
[ "https://boardgames.stackexchange.com/questions/48494", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/28305/" ]
Which is one of the main concepts to win a game, prepare your pokemon so that they can do massive damage and dominate the scenario (either by evolving it or get it ready with necessary energy cards). Since we are talking about theme decks here, cards and scenarios are limited which is really beginner-friendly. Each e...
Overall, strategies include a switch, sleep stun or paralyze, and energy discard. Look through your decks carefully. Many pokemon as well as trainer cards can use one of these techniques. Theme decks usually have some decent trainer cards. It's your job to decide when to use them. In a little more detail: **Switch:** ...
48,494
I'm a very new player to the Pokemon TCG, and have picked up two themed decks to play with ([Ultra Prism](https://www.pokemon.com/us/pokemon-tcg/sun-moon-ultra-prism/theme-decks/)). So far in my experience however it seems that if one player gets their active Pokemon to its final evolution (for example [Empoleon](http...
2019/09/02
[ "https://boardgames.stackexchange.com/questions/48494", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/28305/" ]
Which is one of the main concepts to win a game, prepare your pokemon so that they can do massive damage and dominate the scenario (either by evolving it or get it ready with necessary energy cards). Since we are talking about theme decks here, cards and scenarios are limited which is really beginner-friendly. Each e...
Other answers provide good strategies. I will try to provide additional info and some other strategies and cards that can help with that. 1. As [@TomYumGuy wrote](https://boardgames.stackexchange.com/a/48534/22542) you could **sacrifice** some pokemon while preparing your defeater on bench. There are trainer cards tha...
48,494
I'm a very new player to the Pokemon TCG, and have picked up two themed decks to play with ([Ultra Prism](https://www.pokemon.com/us/pokemon-tcg/sun-moon-ultra-prism/theme-decks/)). So far in my experience however it seems that if one player gets their active Pokemon to its final evolution (for example [Empoleon](http...
2019/09/02
[ "https://boardgames.stackexchange.com/questions/48494", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/28305/" ]
Overall, strategies include a switch, sleep stun or paralyze, and energy discard. Look through your decks carefully. Many pokemon as well as trainer cards can use one of these techniques. Theme decks usually have some decent trainer cards. It's your job to decide when to use them. In a little more detail: **Switch:** ...
Other answers provide good strategies. I will try to provide additional info and some other strategies and cards that can help with that. 1. As [@TomYumGuy wrote](https://boardgames.stackexchange.com/a/48534/22542) you could **sacrifice** some pokemon while preparing your defeater on bench. There are trainer cards tha...
64,176,841
I need to add days to a date in Javascript inside of a loop. Currently, I have this - ``` var occurences = 2; var start_date = "10/2/2020"; for(i=0; i < occurences; i++){ var repeat_every = 2; //repeat every number of days/weeks/months var last = new Date(start_date); var day =last.getDate() + repeat_every; v...
2020/10/02
[ "https://Stackoverflow.com/questions/64176841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4256916/" ]
You can use a multiple of your interval and then use `last.setDate( last.getDate() + repeat_every )` to add days and get the correct month and year: ```js var occurences = 20; var start_date = "10/2/2020"; for(i=1; i <= occurences; i++){ var repeat_every = 2*i; //repeat every number of days/weeks/months var last =...
Make counter `i` a multiple of `repeat_every`: ```js /*<ignore>*/console.config({maximize:true,timeStamps:false,autoScroll:false});/*</ignore>*/ var occurences = 2; var start_date = "10/2/2020"; for(i=1; i <= occurences; i++){ var repeat_every = 2*i; //repeat every number of days/weeks/months var last = new Date(s...
64,176,841
I need to add days to a date in Javascript inside of a loop. Currently, I have this - ``` var occurences = 2; var start_date = "10/2/2020"; for(i=0; i < occurences; i++){ var repeat_every = 2; //repeat every number of days/weeks/months var last = new Date(start_date); var day =last.getDate() + repeat_every; v...
2020/10/02
[ "https://Stackoverflow.com/questions/64176841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4256916/" ]
You can use a multiple of your interval and then use `last.setDate( last.getDate() + repeat_every )` to add days and get the correct month and year: ```js var occurences = 20; var start_date = "10/2/2020"; for(i=1; i <= occurences; i++){ var repeat_every = 2*i; //repeat every number of days/weeks/months var last =...
I would separate the generation of the days from their formatting / logging. Here we have a function that collects `count` instances of incrementally adding `n` days to a date, returning a collection of `Date` objects: ```js const everyNDays = (n, count, start = new Date()) => { const y = start.getFullYear(), m = st...
10,929,506
I save a bool value in NSUserDefaults like this: ``` [[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"]; ``` And then I synchronize defaults like this: ``` [[NSUserDefaults standardUserDefaults]synchronize]; ``` But when my app enters background and then enters foreground my bool changes value t...
2012/06/07
[ "https://Stackoverflow.com/questions/10929506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1088286/" ]
Your retrieval code should look something like this. ``` if(![[NSUserDefaults standardUserDefaults] boolForKey:@"password"]) { //False } else {   //True } ```
Make sure you have the right key string (`@"password"` in your case) when you retrieve the boolean value. It is case sensitive. ``` [[NSUserDefaults standardUserDefaults] boolForKey:@"password"]; ``` Do a text search in your whole project for this key and you will find the offending code.
10,929,506
I save a bool value in NSUserDefaults like this: ``` [[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"]; ``` And then I synchronize defaults like this: ``` [[NSUserDefaults standardUserDefaults]synchronize]; ``` But when my app enters background and then enters foreground my bool changes value t...
2012/06/07
[ "https://Stackoverflow.com/questions/10929506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1088286/" ]
Just perform a simple test where you are saving your bool as ``` [[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"]; [[NSUserDefaults standardUserDefaults]synchronize]; NSLog(@"%d",[[NSUserDefaults standardUserDefaults] boolForKey:@"password"]); ``` see what's the value..
Make sure you have the right key string (`@"password"` in your case) when you retrieve the boolean value. It is case sensitive. ``` [[NSUserDefaults standardUserDefaults] boolForKey:@"password"]; ``` Do a text search in your whole project for this key and you will find the offending code.
10,929,506
I save a bool value in NSUserDefaults like this: ``` [[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"]; ``` And then I synchronize defaults like this: ``` [[NSUserDefaults standardUserDefaults]synchronize]; ``` But when my app enters background and then enters foreground my bool changes value t...
2012/06/07
[ "https://Stackoverflow.com/questions/10929506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1088286/" ]
Just perform a simple test where you are saving your bool as ``` [[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"]; [[NSUserDefaults standardUserDefaults]synchronize]; NSLog(@"%d",[[NSUserDefaults standardUserDefaults] boolForKey:@"password"]); ``` see what's the value..
Your retrieval code should look something like this. ``` if(![[NSUserDefaults standardUserDefaults] boolForKey:@"password"]) { //False } else {   //True } ```
6,096,654
I have a table with columns `user_id`, `time_stamp` and `activity` which I use for recoding user actions for an audit trail. Now, I would just like to get the most recent timestamp for each unique `user_id`. How do I do that?
2011/05/23
[ "https://Stackoverflow.com/questions/6096654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
`SELECT MAX(time_stamp), user_id FROM table GROUP BY user_id;`
The following query should be what you want... ``` select user_id,max(time_stamp) from yourtable group by user_id order by user_id, time_stamp desc ```
70,672,530
I have to create a route that uploads 1 audio file and 1 image (resized) to Cloudinary using Multer Storage Cloudinary, and save the url and name in my mongo database. I get the error "Invalid image file" when I try to upload the audio file (even if I delete `transformation` and add "mp3" in `allowedFormats`. Cloudina...
2022/01/11
[ "https://Stackoverflow.com/questions/70672530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14882708/" ]
What they mean is that `BankDataWriterImpl` should inherit from `BankDataWriterBase` like so : ```py class BankDataWriterBase(): ... class BankDataWriterImpl(BankDataWriterBase): # this class inherit from parent class BankDataWriterBase # when a `BankDataWriterBase` object is created, parent.__init__ meth...
the structure without implementations: ``` class Task: def __init__(self): # initialise all the instance variables (None in this case) pass # this this might need to be empty def run(self) -> None: pass class BankDataWriterBase: def __init__(self, file_name: str, out_path: str, bank_id: st...
14,372,385
I have a UITextView that is being edited and I want to add a custom keyboard... is there any way to dismiss the keyboard but leave the textView in edit mode so the blue cursor keeps flashing? Or better yet is there any way to put a view ontop of the keyboard?
2013/01/17
[ "https://Stackoverflow.com/questions/14372385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2057171/" ]
You should register for notification `UIKeyboardWillShowNotification`. It will hit the registered function before displaying keyboard. Here you can iterate through all Windows and can identify keyboard by below way: ``` for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows]) { for (UIView *...
try this `uitextfieldView.inputView = [[UIView new] autorelease];` the system keyboard view not shows and it keeps the cursor as you editing. or you can hide keyboard by sliding it off-screen ``` frame.origin.y = (keyboard.frame.origin.y - 264); keyboard.frame = frame; ```
6,457,699
I am having some issues with the following query, the issue is that I need it so it displays the courses for the current day until the end of the day not just till the start of the day like it does currently. Basically users cannot access the course if they are trying to access the course on its enddate so i need to so...
2011/06/23
[ "https://Stackoverflow.com/questions/6457699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/487003/" ]
I think you need to modify it like this ``` enddate + INTERVAL 1 DAY >= NOW() ``` Ofcourse this adds 24 hours, for 23:59:59 just change >= to >
Try replacing: ``` AND `WorkshopUserSessions`.`enddate` >= NOW() ``` with ``` AND DATE(`WorkshopUserSessions`.`enddate`) = CURDATE() ``` Hope it helps.
6,457,699
I am having some issues with the following query, the issue is that I need it so it displays the courses for the current day until the end of the day not just till the start of the day like it does currently. Basically users cannot access the course if they are trying to access the course on its enddate so i need to so...
2011/06/23
[ "https://Stackoverflow.com/questions/6457699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/487003/" ]
It sounds like you just need to use date\_add ``` DATE_ADD(`WorkshopUserSessions`.`enddate`, INTERVAL 1 DAY) > NOW() ```
Try replacing: ``` AND `WorkshopUserSessions`.`enddate` >= NOW() ``` with ``` AND DATE(`WorkshopUserSessions`.`enddate`) = CURDATE() ``` Hope it helps.
133,380
As the sole product designer in my past two startups I have been an essential piece towards bringing the product to reality (user research, ux, visual design, qa). However, in both situations I found myself not sitting at the leadership table when discussing the future of the product. Marketing, sales, support, devel...
2020/06/05
[ "https://ux.stackexchange.com/questions/133380", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/103302/" ]
Unless you want to spend more time convincing and showing the value of UX through its impact on revenue, I suggest you to move on. Otherwise, treat it like a project. Understand what the heads really care about and show how UX can help.
A lot of this is determined by the structure and the nature of the company, and it is not always something that you can control unless you are prepared to spend a lot of time and effort into 'educating' the stakeholders. For example, a company that focuses on sales and is a startup will probably use UX to tick a box f...
133,380
As the sole product designer in my past two startups I have been an essential piece towards bringing the product to reality (user research, ux, visual design, qa). However, in both situations I found myself not sitting at the leadership table when discussing the future of the product. Marketing, sales, support, devel...
2020/06/05
[ "https://ux.stackexchange.com/questions/133380", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/103302/" ]
You Can Sit at My Table When You Improve the Things I Care About ---------------------------------------------------------------- Your owners (like the users you research) have goals, needs, tasks to accomplish, and metrics to improve so they and their business can succeed. If you want a seat at the table you will nee...
Unless you want to spend more time convincing and showing the value of UX through its impact on revenue, I suggest you to move on. Otherwise, treat it like a project. Understand what the heads really care about and show how UX can help.
133,380
As the sole product designer in my past two startups I have been an essential piece towards bringing the product to reality (user research, ux, visual design, qa). However, in both situations I found myself not sitting at the leadership table when discussing the future of the product. Marketing, sales, support, devel...
2020/06/05
[ "https://ux.stackexchange.com/questions/133380", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/103302/" ]
You Can Sit at My Table When You Improve the Things I Care About ---------------------------------------------------------------- Your owners (like the users you research) have goals, needs, tasks to accomplish, and metrics to improve so they and their business can succeed. If you want a seat at the table you will nee...
A lot of this is determined by the structure and the nature of the company, and it is not always something that you can control unless you are prepared to spend a lot of time and effort into 'educating' the stakeholders. For example, a company that focuses on sales and is a startup will probably use UX to tick a box f...