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
39,373,872
Having inserted a MySQL table values to a `JTable` and previewing this `JTable`, I noticed that the "BIT" column is returning a "1" as a strange box which I am unable to paste into here, and it returns 0's as blanks. I'll leave a screenshot of the bit error display: [![enter image description here](https://i.stack.img...
2016/09/07
[ "https://Stackoverflow.com/questions/39373872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6078955/" ]
Here's one of the zillion possible ways to code your problem: ``` import json import random import names random.seed(1) data = [ { "name": "Tamara", "results": "434.545.234.664" }, { "name": "Ted", "results": "434.545.234.664" } ] def foo(lst, name): some_number =...
You can [parse your json](https://docs.python.org/3.5/library/json.html) like this ``` import json with open('yourJsonFile.json') as example_data: data = json.load(example_data) ``` And now it's a matter of working with `data` to find whatever you need. For example, to access the first name you could do ``` da...
5,074,127
I've been trying to implement this for a long time and I have gotten no favorable results. Say I have a method in the which an HTTP request is performed (specifically, a twitter update), and say I want to display a `UIActivityIndicatorView` while the HTTP request is in progress (I know when it is done because there ar...
2011/02/22
[ "https://Stackoverflow.com/questions/5074127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614563/" ]
Threading is absolutely forbidden when working with UIKit subclasses. You may have seen reports that UIActivityIndicatorView uses threading internally, but in no way does that mean you can access the object from multiple threads. All UIView subclasses (including UIActivityIndicatorView) must only be accessed from the m...
You cannot perform UI stuff in a secondary thread. You should perform your HTTP request in a secondary thread, while calling the activity view from the main thread. I recommend using [DSActivityView](http://www.dejal.com/developer/dsactivityview) which is so much easier to use. Just 1 line to show an activity view,...
5,074,127
I've been trying to implement this for a long time and I have gotten no favorable results. Say I have a method in the which an HTTP request is performed (specifically, a twitter update), and say I want to display a `UIActivityIndicatorView` while the HTTP request is in progress (I know when it is done because there ar...
2011/02/22
[ "https://Stackoverflow.com/questions/5074127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614563/" ]
Threading is absolutely forbidden when working with UIKit subclasses. You may have seen reports that UIActivityIndicatorView uses threading internally, but in no way does that mean you can access the object from multiple threads. All UIView subclasses (including UIActivityIndicatorView) must only be accessed from the m...
MBProgressHUD it's also easy and shows and hides itself when the secondary thread has started/finished. Something like this: ``` [HUD showhileexecuting:"yourstuff" animated:YES] ``` "Yourstuff" will run on a separate thread. You should not perform UI activities in a secondary thread.
982,174
Windows 10 crashed on my Dell Vostro 260. It froze up and then just crashed, I have no suspects. I was just web browsing and checking mail. Norton and Malware bytes are up to date, so I do not suspect a virus. I haven't downloaded anything suspicious. Upon reboot I get an error > > Windows could not start because ...
2015/10/04
[ "https://superuser.com/questions/982174", "https://superuser.com", "https://superuser.com/users/500205/" ]
Did you delete any system files, like ones directly stored in the root directory of the main hard drive (`C:`)? I had this problem before, although the problem wasn't with `hal.dll`, it was with `boot.ini`. I was using Win XP, though; it is different with Win 10. The story of how stupid I was to create this error is ...
If you're using Windows Backup, be sure you have a "system restore" CD/DVD [which the backup program can create]. Then, backup all data to a USB hard drive [specify that you want a system image and files on all drives]. Other backup programs usually have something similar. The restore CD can be booted from and can res...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
``` @Query("SELECT * FROM pojo WHERE pojo.id = :id") Maybe<POJO> checkPOJO(String id); ``` you can insertOrUpdate like this: ``` checkPOJO(id).toSingle().concatMapCompletable(pojo->update(pojo)) .onErrorResumeNext(t -> t instanceof NoSuchElementException ? insert(...): Completable.error(t)); ```
You should use Rx Android ***Single*** to solve this problem. Example: ``` @Query("SELECT * FROM subjectFormTable WHERE study_subject_id ==:subjectFormId") fun getSubjectForm(subjectFormId: Int): Single<SubjectFormEntity> ``` We use ``` val compositeDisposable = CompositeDisposable() ``` And ``` compositeDispos...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
You can check your database if there is already item with specific field, for exmaple: ``` @Query("SELECT id FROM items WHERE id = :id LIMIT 1") fun getItemId(id: String): String? @Insert fun insert(item: Item): Long @Update(onConflict = OnConflictStrategy.REPLACE) fun update(item: Item): Int ``` Item is Your obje...
You should use Rx Android ***Single*** to solve this problem. Example: ``` @Query("SELECT * FROM subjectFormTable WHERE study_subject_id ==:subjectFormId") fun getSubjectForm(subjectFormId: Int): Single<SubjectFormEntity> ``` We use ``` val compositeDisposable = CompositeDisposable() ``` And ``` compositeDispos...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
You can do with @Upsert ``` @Upsert(entity = Show::class) fun updateOrInsert(shows: List<ShowUpdate>) ``` with ``` def room_version = "2.5.0-beta01" implementation "androidx.room:room-runtime:$room_version" implementation "androidx.room:room-ktx:$room_version" ``` This updates only some fields of Show. Does not u...
You should use Rx Android ***Single*** to solve this problem. Example: ``` @Query("SELECT * FROM subjectFormTable WHERE study_subject_id ==:subjectFormId") fun getSubjectForm(subjectFormId: Int): Single<SubjectFormEntity> ``` We use ``` val compositeDisposable = CompositeDisposable() ``` And ``` compositeDispos...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
You can check your database if there is already item with specific field, for exmaple: ``` @Query("SELECT id FROM items WHERE id = :id LIMIT 1") fun getItemId(id: String): String? @Insert fun insert(item: Item): Long @Update(onConflict = OnConflictStrategy.REPLACE) fun update(item: Item): Int ``` Item is Your obje...
``` @Query("SELECT * FROM pojo WHERE pojo.id = :id") Maybe<POJO> checkPOJO(String id); ``` you can insertOrUpdate like this: ``` checkPOJO(id).toSingle().concatMapCompletable(pojo->update(pojo)) .onErrorResumeNext(t -> t instanceof NoSuchElementException ? insert(...): Completable.error(t)); ```
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
As `@Danail Alexiev` said `@Insert` can return a `long`. `@Update` can return an `int`. But for what purpose are you using update? If you just want the whole object to be replaced by the new one then just specify the `OnConflictStrategy` ``` @Insert(onConflict = OnConflictStrategy.REPLACE) void insert(Product product...
UPDATE. @Upsert added to Room 2.5.0-alpha03. No need for reinventing the wheel) Thanks to @Ashwini for great idea. ``` @Dao interface SendDao { @Insert(onConflict = OnConflictStrategy.IGNORE) suspend fun insert(model: DataModel): Long @Update suspend fun update(model: DataModel): Int @Transacti...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
1. A method, annotated with `@Insert` can return a `long`. This is the newly generated ID for the inserted row. A method, annotated with `@Update` can return an `int`. This is the number of updated rows. 2. `update` will try to update all your fields using the value of the primary key in a `where` clause. If your entit...
You can check below method insertModel() where you can get onComplete() and onError() method: ``` val db: AppDatabase = Room.databaseBuilder(mCtx, AppDatabase::class.java, "db_nam.sqlite").build() companion object { @SuppressLint("StaticFieldLeak") private var mInstance: DatabaseClient? = null...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
You can check your database if there is already item with specific field, for exmaple: ``` @Query("SELECT id FROM items WHERE id = :id LIMIT 1") fun getItemId(id: String): String? @Insert fun insert(item: Item): Long @Update(onConflict = OnConflictStrategy.REPLACE) fun update(item: Item): Int ``` Item is Your obje...
You can do with @Upsert ``` @Upsert(entity = Show::class) fun updateOrInsert(shows: List<ShowUpdate>) ``` with ``` def room_version = "2.5.0-beta01" implementation "androidx.room:room-runtime:$room_version" implementation "androidx.room:room-ktx:$room_version" ``` This updates only some fields of Show. Does not u...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
You can check below method insertModel() where you can get onComplete() and onError() method: ``` val db: AppDatabase = Room.databaseBuilder(mCtx, AppDatabase::class.java, "db_nam.sqlite").build() companion object { @SuppressLint("StaticFieldLeak") private var mInstance: DatabaseClient? = null...
You also can check if the entry exists in the database or not you can make your logic accordingly **Kotlin** ``` @Query("SELECT * FROM Product WHERE productId == :id") fun isProductExist(id: Int): Boolean ``` **Java** ``` @Query("SELECT * FROM Product WHERE productId == :id") public boolean isExist(int id); ```
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
1. A method, annotated with `@Insert` can return a `long`. This is the newly generated ID for the inserted row. A method, annotated with `@Update` can return an `int`. This is the number of updated rows. 2. `update` will try to update all your fields using the value of the primary key in a `where` clause. If your entit...
You can check your database if there is already item with specific field, for exmaple: ``` @Query("SELECT id FROM items WHERE id = :id LIMIT 1") fun getItemId(id: String): String? @Insert fun insert(item: Item): Long @Update(onConflict = OnConflictStrategy.REPLACE) fun update(item: Item): Int ``` Item is Your obje...
48,519,896
I need update and if not exist insert row to ROOM DB. I make this: `productRepository.updateProducts(productsResponse.getProductItems());` And: ``` @Override public void updateProducts(final List<ProductItem> products) { new Thread(() -> { for (ProductItem item : products) { Product product =...
2018/01/30
[ "https://Stackoverflow.com/questions/48519896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4781349/" ]
1. A method, annotated with `@Insert` can return a `long`. This is the newly generated ID for the inserted row. A method, annotated with `@Update` can return an `int`. This is the number of updated rows. 2. `update` will try to update all your fields using the value of the primary key in a `where` clause. If your entit...
UPDATE. @Upsert added to Room 2.5.0-alpha03. No need for reinventing the wheel) Thanks to @Ashwini for great idea. ``` @Dao interface SendDao { @Insert(onConflict = OnConflictStrategy.IGNORE) suspend fun insert(model: DataModel): Long @Update suspend fun update(model: DataModel): Int @Transacti...
8,074,615
I use fancybox as image holder, it works all fine in all browsers except all versions of IE. I have viewed all the similar questions, but they didn't help. My Doctype is `<!DOCTYPE html>`.I've included the latest jQuery before the fancybox plugin in the header and I have no error warnings in firebug. One of the p...
2011/11/10
[ "https://Stackoverflow.com/questions/8074615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798042/" ]
For Honeycomb+ targets, you can add calls to the WebView's `onPause()` and `onResume()` in your activity's `onPause()` and `onResume()`: ``` // assuming mWebView is assigned in onCreate() .. @Override public void onPause() { super.onPause(); mWebView.onPause(); } @Override public void onResume() { super....
Above methods didn't work for me, I came across another post that did the business [here](https://stackoverflow.com/questions/5946698/how-to-stop-youtube-video-playing-in-android-webview). ``` try { Class.forName("android.webkit.WebView") .getMethod("onPause", (Class[]) null) .i...
6,569,696
I have this line of Javascript which runs a function I sourced online. However it turns out to not be ie compatible so I'm looking to convert it to a Jquery call. I have absolutely no Jquery experience and while the documentation is good, I need a hand understanding how to get it to gel with pre-existing Javascipt. ...
2011/07/04
[ "https://Stackoverflow.com/questions/6569696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233615/" ]
Yes, `$(".foo")` will return all nodes having the class `foo`, but wrapped in a jQuery object. If you just want a plain array of DOM elements, you'll need to do `$(".foo").get()`.
``` $('.className') ``` That will return a list of all elements with class of "className". Also: ``` $('.className').show() $('.className').hide() $('.className').toggle() ``` Will show all those elements // hide them // and toggle between.
6,569,696
I have this line of Javascript which runs a function I sourced online. However it turns out to not be ie compatible so I'm looking to convert it to a Jquery call. I have absolutely no Jquery experience and while the documentation is good, I need a hand understanding how to get it to gel with pre-existing Javascipt. ...
2011/07/04
[ "https://Stackoverflow.com/questions/6569696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233615/" ]
Yes, `$(".foo")` will return all nodes having the class `foo`, but wrapped in a jQuery object. If you just want a plain array of DOM elements, you'll need to do `$(".foo").get()`.
What you need is: ``` classElements[i] = []; $("." + show_hide_class_selectors[i]).each(function(index) { classElements[i].push(this); }); ``` After this, `classElements[i]` will contain all elements having the class defined in `show_hide_class_selectors` array - same result as in your non cross browser code.
68,804,357
We currently have a React Web app. We'd like to be able to add WordPress in a subdirectory of the application. So for example: * The react app lives on <https://examplesite.com> * We would like WordPress installed on <https://examplesite.com/blog> Currently our app is containerized on AWS. How would we go about doin...
2021/08/16
[ "https://Stackoverflow.com/questions/68804357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5038220/" ]
First of all, client-side form validation is the greatest feature coming with the HTML5. Client-side form validation helps you to ensure data submitted matches the requirements. To get more detail about it you can visit [here](https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation). Important Note ------...
Usually, to check inputs from html tags, you can create a javascript function to check your needs which is called everytime the user type in your input with the "onkeyup()" function. The "onkeyup" keyword will trigger the function everytime user type in your field ``` <input type="text" onkeyup="myFunctionToCheck()">...
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
**[MercurialEclipse](https://bitbucket.org/mercurialeclipse/main/)** Update site: <https://bitbucket.org/mercurialeclipse/update-site/raw/default/> [Installation manual](https://bitbucket.org/mercurialeclipse/main/wiki/Installation%20and%20Configuration) As stated below (in comments) the name is MercurialEclipse. Th...
Here is the web-site: <http://www.vectrace.com/mercurialeclipse/> The update site is: <http://www.vectrace.com/eclipse-update/>
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
Vectrace is dead. They say you need to go to javaforge ( <http://cbes.javaforge.com/update> ). WARNING: plugin on javaforge is unsigned and cannot be verified.
Here is the web-site: <http://www.vectrace.com/mercurialeclipse/> The update site is: <http://www.vectrace.com/eclipse-update/>
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
**Update 2017-May-6:** the below is no longer applicable, the accepted answer has been updated. I think the accepted answer is now outdated, what's available in the 'Market Place' does not work when adding a repository with latest Java 1.8 x64 ([Issue #60](https://code.google.com/a/eclipselabs.org/p/mercurialeclipse/...
Here is the web-site: <http://www.vectrace.com/mercurialeclipse/> The update site is: <http://www.vectrace.com/eclipse-update/>
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
Now that **Bitbucket is dead**, the new location of *MercurialEclipse* is: * <https://foss.heptapod.net/mercurial/mercurialeclipse/-/wikis/home> And the update site is: * <https://foss.heptapod.net/mercurial/mercurialeclipse-updatesite/-/raw/branch/default/p2>
Here is the web-site: <http://www.vectrace.com/mercurialeclipse/> The update site is: <http://www.vectrace.com/eclipse-update/>
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
**[MercurialEclipse](https://bitbucket.org/mercurialeclipse/main/)** Update site: <https://bitbucket.org/mercurialeclipse/update-site/raw/default/> [Installation manual](https://bitbucket.org/mercurialeclipse/main/wiki/Installation%20and%20Configuration) As stated below (in comments) the name is MercurialEclipse. Th...
Vectrace is dead. They say you need to go to javaforge ( <http://cbes.javaforge.com/update> ). WARNING: plugin on javaforge is unsigned and cannot be verified.
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
**[MercurialEclipse](https://bitbucket.org/mercurialeclipse/main/)** Update site: <https://bitbucket.org/mercurialeclipse/update-site/raw/default/> [Installation manual](https://bitbucket.org/mercurialeclipse/main/wiki/Installation%20and%20Configuration) As stated below (in comments) the name is MercurialEclipse. Th...
**Update 2017-May-6:** the below is no longer applicable, the accepted answer has been updated. I think the accepted answer is now outdated, what's available in the 'Market Place' does not work when adding a repository with latest Java 1.8 x64 ([Issue #60](https://code.google.com/a/eclipselabs.org/p/mercurialeclipse/...
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
**[MercurialEclipse](https://bitbucket.org/mercurialeclipse/main/)** Update site: <https://bitbucket.org/mercurialeclipse/update-site/raw/default/> [Installation manual](https://bitbucket.org/mercurialeclipse/main/wiki/Installation%20and%20Configuration) As stated below (in comments) the name is MercurialEclipse. Th...
Now that **Bitbucket is dead**, the new location of *MercurialEclipse* is: * <https://foss.heptapod.net/mercurial/mercurialeclipse/-/wikis/home> And the update site is: * <https://foss.heptapod.net/mercurial/mercurialeclipse-updatesite/-/raw/branch/default/p2>
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
Vectrace is dead. They say you need to go to javaforge ( <http://cbes.javaforge.com/update> ). WARNING: plugin on javaforge is unsigned and cannot be verified.
**Update 2017-May-6:** the below is no longer applicable, the accepted answer has been updated. I think the accepted answer is now outdated, what's available in the 'Market Place' does not work when adding a repository with latest Java 1.8 x64 ([Issue #60](https://code.google.com/a/eclipselabs.org/p/mercurialeclipse/...
1,629,058
Where can I find a good Eclipse Mercurial Plugin?
2009/10/27
[ "https://Stackoverflow.com/questions/1629058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58800/" ]
Now that **Bitbucket is dead**, the new location of *MercurialEclipse* is: * <https://foss.heptapod.net/mercurial/mercurialeclipse/-/wikis/home> And the update site is: * <https://foss.heptapod.net/mercurial/mercurialeclipse-updatesite/-/raw/branch/default/p2>
**Update 2017-May-6:** the below is no longer applicable, the accepted answer has been updated. I think the accepted answer is now outdated, what's available in the 'Market Place' does not work when adding a repository with latest Java 1.8 x64 ([Issue #60](https://code.google.com/a/eclipselabs.org/p/mercurialeclipse/...
6,832,640
How can I send an SMS message programatically from an iPhone app? I'm using Twilio right now, and can correctly set up a HTTP Request, authenticate with the server, and get a response. There must be some misconfiguration of the HTTP Headers as I can get a response from the Twilio servers but never passes the right dat...
2011/07/26
[ "https://Stackoverflow.com/questions/6832640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98855/" ]
If you are just looking to send an SMS message in iOS you can use the `MFMessageComposeViewController` inside of the `MessageUI.framework`. As you know though, this requires user-interaction. As you had requested, you can use Twilio to send SMS directly using almost any platform. For iOS you can use the following Swif...
It could be this: The number +YOURNUMBER is unverified. Trial accounts cannot send messages to unverified numbers; verify +YOURNUMBER at [twilio.com/user/account/phone-numbers/verified](https://www.twilio.com/user/account/phone-numbers/verified), or purchase a Twilio number to send messages to unverified numbers.
6,832,640
How can I send an SMS message programatically from an iPhone app? I'm using Twilio right now, and can correctly set up a HTTP Request, authenticate with the server, and get a response. There must be some misconfiguration of the HTTP Headers as I can get a response from the Twilio servers but never passes the right dat...
2011/07/26
[ "https://Stackoverflow.com/questions/6832640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98855/" ]
If you are just looking to send an SMS message in iOS you can use the `MFMessageComposeViewController` inside of the `MessageUI.framework`. As you know though, this requires user-interaction. As you had requested, you can use Twilio to send SMS directly using almost any platform. For iOS you can use the following Swif...
Use AFNetworking to send request. ``` NSString *kTwilioSID = @"AC73bb270.......4d418cb8"; NSString *kTwilioSecret = @"335199.....9"; NSString *kFromNumber = @"+1......1"; NSString *kToNumber = @"+91.......8"; NSString *kMessage = @"Hi"; NSString *urlString = [NSString stringWithFormat:@"https://%@:%@@api.twilio.com/2...
6,832,640
How can I send an SMS message programatically from an iPhone app? I'm using Twilio right now, and can correctly set up a HTTP Request, authenticate with the server, and get a response. There must be some misconfiguration of the HTTP Headers as I can get a response from the Twilio servers but never passes the right dat...
2011/07/26
[ "https://Stackoverflow.com/questions/6832640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98855/" ]
If you are just looking to send an SMS message in iOS you can use the `MFMessageComposeViewController` inside of the `MessageUI.framework`. As you know though, this requires user-interaction. As you had requested, you can use Twilio to send SMS directly using almost any platform. For iOS you can use the following Swif...
Twilio with **Swift 2.2+**, **Alamofire**, **SwiftyJSON** -> answer: ``` import Alamofire import SwiftyJSON ........ ........ //twillio config private static let TWILIO_ACCOUNT_SID = "A...7" private static let TWILIO_AUTH_TOKEN = "6...5" //end url string is .json,to get response as JSON static let URL_TWILIO_SMS = "ht...
6,832,640
How can I send an SMS message programatically from an iPhone app? I'm using Twilio right now, and can correctly set up a HTTP Request, authenticate with the server, and get a response. There must be some misconfiguration of the HTTP Headers as I can get a response from the Twilio servers but never passes the right dat...
2011/07/26
[ "https://Stackoverflow.com/questions/6832640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98855/" ]
If you are just looking to send an SMS message in iOS you can use the `MFMessageComposeViewController` inside of the `MessageUI.framework`. As you know though, this requires user-interaction. As you had requested, you can use Twilio to send SMS directly using almost any platform. For iOS you can use the following Swif...
An example (updated) for Xcode 8 and **Swift 3**. <https://www.twilio.com/blog/2016/11/how-to-send-an-sms-from-ios-in-swift.html> We don't recommend storing your credentials client side and so the post shows you how to avoid a potential vulnerability using a server-side language of your choosing and **Alamofire** for...
6,832,640
How can I send an SMS message programatically from an iPhone app? I'm using Twilio right now, and can correctly set up a HTTP Request, authenticate with the server, and get a response. There must be some misconfiguration of the HTTP Headers as I can get a response from the Twilio servers but never passes the right dat...
2011/07/26
[ "https://Stackoverflow.com/questions/6832640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98855/" ]
Use AFNetworking to send request. ``` NSString *kTwilioSID = @"AC73bb270.......4d418cb8"; NSString *kTwilioSecret = @"335199.....9"; NSString *kFromNumber = @"+1......1"; NSString *kToNumber = @"+91.......8"; NSString *kMessage = @"Hi"; NSString *urlString = [NSString stringWithFormat:@"https://%@:%@@api.twilio.com/2...
It could be this: The number +YOURNUMBER is unverified. Trial accounts cannot send messages to unverified numbers; verify +YOURNUMBER at [twilio.com/user/account/phone-numbers/verified](https://www.twilio.com/user/account/phone-numbers/verified), or purchase a Twilio number to send messages to unverified numbers.
6,832,640
How can I send an SMS message programatically from an iPhone app? I'm using Twilio right now, and can correctly set up a HTTP Request, authenticate with the server, and get a response. There must be some misconfiguration of the HTTP Headers as I can get a response from the Twilio servers but never passes the right dat...
2011/07/26
[ "https://Stackoverflow.com/questions/6832640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98855/" ]
Use AFNetworking to send request. ``` NSString *kTwilioSID = @"AC73bb270.......4d418cb8"; NSString *kTwilioSecret = @"335199.....9"; NSString *kFromNumber = @"+1......1"; NSString *kToNumber = @"+91.......8"; NSString *kMessage = @"Hi"; NSString *urlString = [NSString stringWithFormat:@"https://%@:%@@api.twilio.com/2...
Twilio with **Swift 2.2+**, **Alamofire**, **SwiftyJSON** -> answer: ``` import Alamofire import SwiftyJSON ........ ........ //twillio config private static let TWILIO_ACCOUNT_SID = "A...7" private static let TWILIO_AUTH_TOKEN = "6...5" //end url string is .json,to get response as JSON static let URL_TWILIO_SMS = "ht...
6,832,640
How can I send an SMS message programatically from an iPhone app? I'm using Twilio right now, and can correctly set up a HTTP Request, authenticate with the server, and get a response. There must be some misconfiguration of the HTTP Headers as I can get a response from the Twilio servers but never passes the right dat...
2011/07/26
[ "https://Stackoverflow.com/questions/6832640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98855/" ]
Use AFNetworking to send request. ``` NSString *kTwilioSID = @"AC73bb270.......4d418cb8"; NSString *kTwilioSecret = @"335199.....9"; NSString *kFromNumber = @"+1......1"; NSString *kToNumber = @"+91.......8"; NSString *kMessage = @"Hi"; NSString *urlString = [NSString stringWithFormat:@"https://%@:%@@api.twilio.com/2...
An example (updated) for Xcode 8 and **Swift 3**. <https://www.twilio.com/blog/2016/11/how-to-send-an-sms-from-ios-in-swift.html> We don't recommend storing your credentials client side and so the post shows you how to avoid a potential vulnerability using a server-side language of your choosing and **Alamofire** for...
55,088,159
Android Studio 3.2.1 In my build.gradle: ``` android { dataBinding { enabled = true } compileSdkVersion 28 defaultConfig { minSdkVersion 18 targetSdkVersion 28 versionCode 6 versionName "0.0.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnit...
2019/03/10
[ "https://Stackoverflow.com/questions/55088159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6813231/" ]
You have the elevation of the progress bar set to `10dp` and that is getting to the right answer but, because the progress bar is embedded in a `ConstraintLayout` and the `ConstraintLayout` is included in another layout, it is the `ConstraintLayout` that needs the elevation. Simply move `android:elevation="10dp"` from...
To make the button, unelevated button you can add the style attribute as below:- ``` style="@style/Widget.MaterialComponents.Button.UnelevatedButton" ```
13,008,583
I have this JavaScript code: ``` var r = { a1:function() { alert('hey!'); }, a2:this.a1 /*, a3:r.a1, //<--Make an error when running a4:a1 //<--Make an error when running */ }; ``` When executing `r.a1()` I get an alert but when executing `r.a2()` I get message: ``` TypeError: r...
2012/10/22
[ "https://Stackoverflow.com/questions/13008583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289246/" ]
`this`, in your definition does not refer to r, but to the actual context (probably `window`) you should define it like this: ``` var r = { a1: function() {} /* a3: r, // Here r is not yet assigned. First the object is created, then its value // is assigned to r. */ }; r.a2 = r.a1; r.a3 = r.a1; ...
If you want to use just the object literal, you can do it like this: ``` var r = { a1:function() { alert('hey!'); }, a2:function () { this.a1(); } }; ``` The explanation is: in the object declaration, `this` refers to your current context - that is, the value of `this` in the function...
49,654,051
I am trying to measure some event in an input video file: "test.mp4". This is done by processing the video in several steps, where each step performs some operations on the video data and writes the intermediate results to a new video file. The fps of the input video is: 29.42346629489295 fps Below I have written a ...
2018/04/04
[ "https://Stackoverflow.com/questions/49654051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742575/" ]
Set `spark.driver.bindAddress` to your local IP like `127.0.0.1`. ``` pyspark -c spark.driver.bindAddress=127.0.0.1 ```
While creating spark session set the below configurations ``` spark =SparkSession.builder.appName(str(name))\ .master("local[*]").config("spark.driver.memory","5g")\ .config("spark.driver.host","10.51.4.110")\ #Machine ip .config("spark.driver.bindAddress","10.51.4.110")\ #Machine ip .getOrCrea...
49,654,051
I am trying to measure some event in an input video file: "test.mp4". This is done by processing the video in several steps, where each step performs some operations on the video data and writes the intermediate results to a new video file. The fps of the input video is: 29.42346629489295 fps Below I have written a ...
2018/04/04
[ "https://Stackoverflow.com/questions/49654051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742575/" ]
Set `spark.driver.bindAddress` to your local IP like `127.0.0.1`. ``` pyspark -c spark.driver.bindAddress=127.0.0.1 ```
I had a similar issue on Windows 10 recently. Resolved it by following below steps: * Fixed it by setting a user environment variable SPARK\_LOCAL\_IP = 127.0.0.1 * Restart the command line as an admin
49,654,051
I am trying to measure some event in an input video file: "test.mp4". This is done by processing the video in several steps, where each step performs some operations on the video data and writes the intermediate results to a new video file. The fps of the input video is: 29.42346629489295 fps Below I have written a ...
2018/04/04
[ "https://Stackoverflow.com/questions/49654051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742575/" ]
Set `spark.driver.bindAddress` to your local IP like `127.0.0.1`. ``` pyspark -c spark.driver.bindAddress=127.0.0.1 ```
On a MacOS, with a standalone spark cluster, setting `SPARK_MASTER_HOST` to 'localhost' instead of '127.0.0.1' solved to problem for me. `export SPARK_MASTER_HOST='localhost'`
49,654,051
I am trying to measure some event in an input video file: "test.mp4". This is done by processing the video in several steps, where each step performs some operations on the video data and writes the intermediate results to a new video file. The fps of the input video is: 29.42346629489295 fps Below I have written a ...
2018/04/04
[ "https://Stackoverflow.com/questions/49654051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742575/" ]
While creating spark session set the below configurations ``` spark =SparkSession.builder.appName(str(name))\ .master("local[*]").config("spark.driver.memory","5g")\ .config("spark.driver.host","10.51.4.110")\ #Machine ip .config("spark.driver.bindAddress","10.51.4.110")\ #Machine ip .getOrCrea...
I had a similar issue on Windows 10 recently. Resolved it by following below steps: * Fixed it by setting a user environment variable SPARK\_LOCAL\_IP = 127.0.0.1 * Restart the command line as an admin
49,654,051
I am trying to measure some event in an input video file: "test.mp4". This is done by processing the video in several steps, where each step performs some operations on the video data and writes the intermediate results to a new video file. The fps of the input video is: 29.42346629489295 fps Below I have written a ...
2018/04/04
[ "https://Stackoverflow.com/questions/49654051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742575/" ]
While creating spark session set the below configurations ``` spark =SparkSession.builder.appName(str(name))\ .master("local[*]").config("spark.driver.memory","5g")\ .config("spark.driver.host","10.51.4.110")\ #Machine ip .config("spark.driver.bindAddress","10.51.4.110")\ #Machine ip .getOrCrea...
On a MacOS, with a standalone spark cluster, setting `SPARK_MASTER_HOST` to 'localhost' instead of '127.0.0.1' solved to problem for me. `export SPARK_MASTER_HOST='localhost'`
49,654,051
I am trying to measure some event in an input video file: "test.mp4". This is done by processing the video in several steps, where each step performs some operations on the video data and writes the intermediate results to a new video file. The fps of the input video is: 29.42346629489295 fps Below I have written a ...
2018/04/04
[ "https://Stackoverflow.com/questions/49654051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2742575/" ]
I had a similar issue on Windows 10 recently. Resolved it by following below steps: * Fixed it by setting a user environment variable SPARK\_LOCAL\_IP = 127.0.0.1 * Restart the command line as an admin
On a MacOS, with a standalone spark cluster, setting `SPARK_MASTER_HOST` to 'localhost' instead of '127.0.0.1' solved to problem for me. `export SPARK_MASTER_HOST='localhost'`
14,808,849
I am trying to create a reusable template class for my unit test cases. Suppose classes Sample, and SampleTest belong to the same package, while Template belongs to a different package. I get error instantiating Sample class. I expect the method will be executed as if it were a method of the SampleTest class that have ...
2013/02/11
[ "https://Stackoverflow.com/questions/14808849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1945342/" ]
You can use [CSS Pseudo classes](http://css-tricks.com/pseudo-class-selectors/) to do this, therefore you won't need an "arrow" element: ```css div.error-label { padding: 10px; color: #fff; background-color: #DA362A; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; width: 1...
Here is the solution ```css div.error-label{ padding: 7px 10px 0 4px; color: #fff; background-color: #DA362A; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; width: 150px; margin-left: 5px; } div.error-label-arrow{ border-top: 10px solid transp...
14,808,849
I am trying to create a reusable template class for my unit test cases. Suppose classes Sample, and SampleTest belong to the same package, while Template belongs to a different package. I get error instantiating Sample class. I expect the method will be executed as if it were a method of the SampleTest class that have ...
2013/02/11
[ "https://Stackoverflow.com/questions/14808849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1945342/" ]
You can use [CSS Pseudo classes](http://css-tricks.com/pseudo-class-selectors/) to do this, therefore you won't need an "arrow" element: ```css div.error-label { padding: 10px; color: #fff; background-color: #DA362A; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; width: 1...
> > You can achieve this by using `Pseudo elements` check below answer > > > ```css .error{ position: relative; background: red; padding: 10px; color: #fff; margin:0 0 0 12px; width:auto; display:inline-block; } .error::before { content: ""; width: 0; height: 0; border-styl...
48,648,317
I get some data from the database, which is saved in "$Data". $Data looks like this: ``` [Data] => Array ( [0] => Array ( [PrinterID] => 3 [PrinterName] => PRT03_EDV [isDefaultPrinter] => 1 ...
2018/02/06
[ "https://Stackoverflow.com/questions/48648317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9128685/" ]
for your requirement, just match all 4 digit numbers ```python import re s = '''1970 - 1980 January 1920 - Feb 1930 May 1920 to September 1930 July 1945''' p = re.compile(r'\b\d{4}\b') s = s.splitlines() for x in s: result = p.findall(x) print(result) ``` output ```python ['1970', '1980'] ['1920', '1930'...
**Regex**: [`.*?([0-9]{4})(?:.*?([0-9]{4}))?`](https://regex101.com/r/dWTulg/2) or `.*?(\d{4})(?:.*?(\d{4}))?` Details: * `()` Capturing group * `(?:)` Non capturing group * `{n}` Matches exactly `n` times * `.*?` Matches any char between zero and unlimited times (lazy) **Python code**: ``` def Years(text): ...
121,973
I want to place two pictures side by side as subfigures, rotated 90 degrees and those two pictuers filling a whole page. While this works from the looks I have some issues, with the hyperref package and its targets. The issues are: 1. The links from hyperref link to the bottom of the page, I would like them to link ...
2013/07/01
[ "https://tex.stackexchange.com/questions/121973", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/19326/" ]
You need to include your biblography file as follows: ``` \bibliography{yourBibtexFile} \bibliographystyle{apalike} %or any other style you like ``` And then cite your reference using `\cite{hermanss2012}` See the example below: ``` \documentclass[11pt,a4paper]{article} \begin{document} \noindent This is the pla...
Here is how it worked for me. I wanted to be able to use citation inside the text for example using `\citet{Jones_2008}` for Jones et al., (2008) and `\citep{Jones_2008}` for (Jones et al 2000) and no numbers or brackets (brackets ex.[1] are the default for any style you use from the plain Latex bibliography system to ...
136,636
In a level of a 3D FPS I'm making, I have several floating pillars that move up and down (the x and z positions are always the same). When the player stands on one of the pillars, the motion is incredibly jerky going up, but smooth going down. I think the player is sinking into the pillar slightly and then catching up....
2017/02/01
[ "https://gamedev.stackexchange.com/questions/136636", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/97158/" ]
My suggestion is to have a variable in your character class that holds a reference to whatever object the character is on and then have all of the characters movement be relative to that object as long as he is on that surface.
From the code it looks like you're probably right: The player is sinking into the collider and then bouncing back up again. It looks like this may be because you're moving the player too far down when you set you're `moveDirection.y`. Instead, I'd use [RayCasting](https://docs.unity3d.com/ScriptReference/Physics.Rayca...
3,884,658
On the upcoming test I will be given a problem of type: > > Find all normal subgroups $H$ in $F\_n$ such that $F\_n/H \cong G$. > > > Here $n$ is a small integer, likely 2 or 3, and $G$ is an Abelian group given as product of some cyclic groups. **Question**: is there a more-or-less **routine algorithm** for suc...
2020/10/28
[ "https://math.stackexchange.com/questions/3884658", "https://math.stackexchange.com", "https://math.stackexchange.com/users/729889/" ]
To justify your approach you need one more fact: * 4: the stabilizer of an epimorpism $F\_n \to G$ with respect to the action of $\text{Aut}(G)$ is trivial. All the groups $G$ are abelian, and to my mind the cleanest way to work with a finite abelian group is to factor it as the product of its $p$-torsion subgroups ...
Of the problems that you mention, I think that only the first two, which you can do in your head, are suitable for an exam. As I said in my comment, Example 4 is relatively easy, but even then there are $72$ distinct subgroups $H$, and it would not be reasonable to expect you to enumerate them by hand in a test. Magma...
29,279,250
I've been trying to re-size a text to fix a fixed size div and I found the textfill plugin that seemed perfect for it, except that I can't get it to work for some reason: html: ``` <script src="Scripts\jquery-1.11.2.min.js"></script> <script src="Scripts\jquery.textfill.min.js"></script> <div id="textfilltest"> ...
2015/03/26
[ "https://Stackoverflow.com/questions/29279250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3379200/" ]
``` for i in */*.tar ; do pushd `dirname $i` ; tar xf `basename $i` && rm `basename $i` ; popd ; done ``` Edit: this is probably a better way: ``` find . -type f -iname "*.tar" -print0 -execdir tar xf {} \; -delete ```
``` for file in */*.tar; do (cd `dirname $file`; tar xvf `basename $file`) unlink $file done ```
344,954
I'm trying to switch over from USB power to external power if it's present. (External power is 6V to 13V). The current is 2A. To do this I'm using diodes 1 and 3. See image below. ("OR" configuration.) ![](https://istherecake.com/IMG_20171214_092901.jpg) I'm then using diode 2 as reverse voltage protection in case t...
2017/12/14
[ "https://electronics.stackexchange.com/questions/344954", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/122765/" ]
That's right, your reverse protection chip uses an internal MOSFET to achieve lossless switching. I seem to recall seeing a "drop-in replacement for a diode" kind of FET-based device, but I can't seem to find it now. MOSFET's with dedicated secondary-side controllers are used for synchronous rectification in higher-e...
For D2 and D3, you should consider Schottky diodes. These have a significantly lower voltage drop than standard diodes, maybe 400 mV instead of 1 V at typical load current, so you'll lose a lot less power. For D1, if the drop of a Schottky diode is still too high, the part you've linked to looks like a valid option - ...
540,574
Many people have asked online why does a person float on a free falling elevator in earth. But my question is why doesn't a person just stay in the elevator's floor when the elevator is in a free fall? Why do they float like this: 1. [Albert Einstein's Elevator Thought Experiment](https://youtu.be/jx3wcdCtL58) 2. [Zer...
2020/03/31
[ "https://physics.stackexchange.com/questions/540574", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/167103/" ]
When we analyse the situation from a freely falling elevator, an non-inertial frame of reference, we need to apply inertial (pseudo or fictious) force in order to apply the familiar Newton's laws of motion. Here, the pseudo force acts in the upward direction and cancels the weight of the person. The net force on the pe...
Yes, they would stay in the same place... Except for the fact that from the elevator's frame any slight push upwards will propel you and you can't stop that... Like if you were in a space station. In the second example you gave you can clearly see that all the people push upwards which causes them to float.. if you sta...
540,574
Many people have asked online why does a person float on a free falling elevator in earth. But my question is why doesn't a person just stay in the elevator's floor when the elevator is in a free fall? Why do they float like this: 1. [Albert Einstein's Elevator Thought Experiment](https://youtu.be/jx3wcdCtL58) 2. [Zer...
2020/03/31
[ "https://physics.stackexchange.com/questions/540574", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/167103/" ]
When we analyse the situation from a freely falling elevator, an non-inertial frame of reference, we need to apply inertial (pseudo or fictious) force in order to apply the familiar Newton's laws of motion. Here, the pseudo force acts in the upward direction and cancels the weight of the person. The net force on the pe...
While other answers are not wrong, I'd like to add that the main reason why someone's feet can't stay on the ground in free fall is that any time there is a **slight pressure or bump between feet and floor due to body movement**, the contact force will push the feet upwards. Since no other forces are involved, the feet...
74,553,277
how I can run this command in powershell to all users in the server? ``` powerShell -sta -file 'E:\Script-Popup\Popup-Message - Done.ps1' ``` that on every user who is currently connected to the server, this command will run.
2022/11/23
[ "https://Stackoverflow.com/questions/74553277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20111374/" ]
The other answer does work. It also requires you to change your mapping every time the record or class changes their structure/constructors. If you want to create the map once, and never touch it again even when your entities change, I can think of two alternatives: 1. Match the properties in your `record` with the n...
I tried the following code, and it seems to work, ``` IConfigurationProvider configuration = new MapperConfiguration(cfg => cfg.CreateMap<AuthResult, AuthResponse>() .ForCtorParam(ctorParamName: nameof(AuthResponse.Id), m => m.MapFrom(s => s.User.Id)) .ForCtorParam(ctorParamNa...
10,834,297
i am develop the iOS web app using php and mysql database and my problem is nsurl request get to values to php file not response and not working but,i am printing in command prompt url and copy the url paste and go to browser sucessfully updated.but, not updated and no response nsurl request what's wrong in my code?can...
2012/05/31
[ "https://Stackoverflow.com/questions/10834297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269086/" ]
Object properties (JavaScript does not have true multidimensional or associate arrays) have no defined order, and can only be accessed via their string key. The order of iterating over keys with a `for ( in )` is implementation specific as no order is specified in the specification. For example, Chrome orders numeric ...
`Object.keys()` isn't cross-browser unfortunately. To be safe, just do this: ``` var firstKey=""; for(firstKey in object) break; ``` That's it - firstKey has the firstKey value. so: ``` var firstKey=""; for(firstKey in myArray[0]) break; ``` then access via: ``` myArray[0][firstKey] ```
118,717
I've searched for an answer to this one and I haven't found one yet. How do i remove a single item from Windows' System tray? I'm targeting Windows XP. **Edit:** This is not about preventing items from starting up. I *want* the program to keep running, I just need another script/program to remove the first one's entry...
2010/03/11
[ "https://superuser.com/questions/118717", "https://superuser.com", "https://superuser.com/users/30399/" ]
Just click `Start Menu > Run`, and type `msconfig`. On the `Startup` tab, you can see the programs which start together with Windows. You can clear ticks of programs that you don't want to run in system tray. Another way to remove the programs from system tray is, you can go to Options of the relevant program and find...
Icons in the notification area always belong to a window. This may be hidden but in any case it belongs to a single process. So closing the related process also removes the notification icon. If you want it permanently removed, just don't start the respective program.
118,717
I've searched for an answer to this one and I haven't found one yet. How do i remove a single item from Windows' System tray? I'm targeting Windows XP. **Edit:** This is not about preventing items from starting up. I *want* the program to keep running, I just need another script/program to remove the first one's entry...
2010/03/11
[ "https://superuser.com/questions/118717", "https://superuser.com", "https://superuser.com/users/30399/" ]
From a similar [question](https://superuser.com/questions/105922/remove-the-microsoft-security-essentials-icon) on SU. [PS Tray Factory](http://www.pssoftlab.com/pstf_info.phtml) may be of some use: > > PS Tray Factory is a powerful and > handy tool meant to flexibly control > ALL the other icons in the system tra...
Just click `Start Menu > Run`, and type `msconfig`. On the `Startup` tab, you can see the programs which start together with Windows. You can clear ticks of programs that you don't want to run in system tray. Another way to remove the programs from system tray is, you can go to Options of the relevant program and find...
118,717
I've searched for an answer to this one and I haven't found one yet. How do i remove a single item from Windows' System tray? I'm targeting Windows XP. **Edit:** This is not about preventing items from starting up. I *want* the program to keep running, I just need another script/program to remove the first one's entry...
2010/03/11
[ "https://superuser.com/questions/118717", "https://superuser.com", "https://superuser.com/users/30399/" ]
From a similar [question](https://superuser.com/questions/105922/remove-the-microsoft-security-essentials-icon) on SU. [PS Tray Factory](http://www.pssoftlab.com/pstf_info.phtml) may be of some use: > > PS Tray Factory is a powerful and > handy tool meant to flexibly control > ALL the other icons in the system tra...
Icons in the notification area always belong to a window. This may be hidden but in any case it belongs to a single process. So closing the related process also removes the notification icon. If you want it permanently removed, just don't start the respective program.
118,717
I've searched for an answer to this one and I haven't found one yet. How do i remove a single item from Windows' System tray? I'm targeting Windows XP. **Edit:** This is not about preventing items from starting up. I *want* the program to keep running, I just need another script/program to remove the first one's entry...
2010/03/11
[ "https://superuser.com/questions/118717", "https://superuser.com", "https://superuser.com/users/30399/" ]
Right-click on Start button >> Properties >> Taskbar tab >> Customize. Select the Tray icon you don't like. Under Behavior set to "Always hide". Repeat as needed. The icons will still be visible if you expand the Tray but hidden for 99% of your usage.
Icons in the notification area always belong to a window. This may be hidden but in any case it belongs to a single process. So closing the related process also removes the notification icon. If you want it permanently removed, just don't start the respective program.
118,717
I've searched for an answer to this one and I haven't found one yet. How do i remove a single item from Windows' System tray? I'm targeting Windows XP. **Edit:** This is not about preventing items from starting up. I *want* the program to keep running, I just need another script/program to remove the first one's entry...
2010/03/11
[ "https://superuser.com/questions/118717", "https://superuser.com", "https://superuser.com/users/30399/" ]
From a similar [question](https://superuser.com/questions/105922/remove-the-microsoft-security-essentials-icon) on SU. [PS Tray Factory](http://www.pssoftlab.com/pstf_info.phtml) may be of some use: > > PS Tray Factory is a powerful and > handy tool meant to flexibly control > ALL the other icons in the system tra...
Right-click on Start button >> Properties >> Taskbar tab >> Customize. Select the Tray icon you don't like. Under Behavior set to "Always hide". Repeat as needed. The icons will still be visible if you expand the Tray but hidden for 99% of your usage.
35,120,686
I'm a newbie linux developer, so I don't know exactly how to solve a problem. In my main I spawn many worker threads, each one executes its task and sleeps for a few seconds. In some circumstances I have to terminate. I need to avoid to wait for each sleep termination, so I want to send a signal to each thread to int...
2016/01/31
[ "https://Stackoverflow.com/questions/35120686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418599/" ]
I don't know the details of your code but it sounds like a job for condition variables: [cs.nmsu.edu/~jcook/Tools/pthreads/pthread\_cond.html](http://www.cs.nmsu.edu/~jcook/Tools/pthreads/pthread_cond.html) – Galik I've just implemented the solution based upon the `pthread_cond_signal` and `pthread_cond_timedwait` and...
In sending a signal, you're doing the right thing. The only thing that is missing is catching that signal. You have to replace the signal action with your own one. In the signal handler you can set a variable and check for it after sleep returns. Look into `sigaction`
70,538,916
I have multiple tags for a scenario and trying to execute the scenario with Cypress run -env TAGS command and it is not working using Cypress-Cucumber-Preprocess. @Tag1 @Tag2 @Tag3 Scenario : First Scenario @Tag1 @Tag2 @Tag3 @Tag4 Scenario : Second Scenario cypress run -e TAGS='@Tag4' - not working Both the scenari...
2021/12/31
[ "https://Stackoverflow.com/questions/70538916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17801527/" ]
Consider the following code which will produce the output you want: ``` import pandas as pd response = [ {'duration': 0, 'phase': { 'name': 'Start form' } }, {'duration': 441, 'phase': { 'name': 'Análise do SAC - Mesas' } }, ...
Use: ``` df = pd.json_normalize(l) df = df.set_index('phase.name').T.reset_index(drop=True) ``` `OUTPUT` ``` phase.name Start form Análise do SAC - Mesas Análise do SAC - Industrial 0 0 441 126057 ``` If want to rename axis you can then use: ``` df....
54,680,331
I'm importing Svg.js into my typescript project. When I call SVG I receive the following error. `Uncaught (in promise) TypeError: SVG is not a function` I've tried to import Svg.js in different ways, but that doesn't seem to be the issue. I also tried to call on 'SVG' in different ways as well. Using Svg.js version `...
2019/02/13
[ "https://Stackoverflow.com/questions/54680331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9146428/" ]
``` import SVG from "@svgdotjs/svg.js/src/svg" //v3.0 let draw = SVG().addTo('#drawing').viewbox(0, 0, 300, 140) let rect = draw.rect(100, 100).attr({fill: "#f06"}) ```
It may depend on your Babel configuration, but in my experience, `import * as X` creates an object that wraps up all the exports of a module. So you'd have to call: ``` let draw = SVG.default('drawing'); ``` Or better, convert the import to `import X`: ``` import SVG from "@svgdotjs/svg.js"; ... let draw = SVG('dra...
54,680,331
I'm importing Svg.js into my typescript project. When I call SVG I receive the following error. `Uncaught (in promise) TypeError: SVG is not a function` I've tried to import Svg.js in different ways, but that doesn't seem to be the issue. I also tried to call on 'SVG' in different ways as well. Using Svg.js version `...
2019/02/13
[ "https://Stackoverflow.com/questions/54680331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9146428/" ]
``` import SVG from "@svgdotjs/svg.js/src/svg" //v3.0 let draw = SVG().addTo('#drawing').viewbox(0, 0, 300, 140) let rect = draw.rect(100, 100).attr({fill: "#f06"}) ```
SVG() should now work correctly in 3.0.12
2,075,717
Is there a way in CSS to select `label`s bound to `input` fields (via the `for` attribute) having the `required` attribute set? Something like: ``` label:input[required] { ... } ``` Currently, I'm adding `class="required"` to labels and inputs for styling. I now have the HTML5 attribute `required="required"` in th...
2010/01/16
[ "https://Stackoverflow.com/questions/2075717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251966/" ]
How about [CSS 2 Attribute Selectors](http://www.w3.org/TR/CSS2/selector.html) It is pretty compatible amongst browsers. Example: ``` <style> label[required=required] { color: blue; } </style> <label required="required" for="one">Label:</label><input name="one" id="one" /> ``` Also check [this](http://www.andybudd....
I don't think this can really be accomplished through CSS in the way that the OP wants. CSS just doesn't work that way. A better approach in my opinion is to step back and look at the big picture. You have a form where some fields are required and some are not. It is a good approach to give the user all the required f...
2,075,717
Is there a way in CSS to select `label`s bound to `input` fields (via the `for` attribute) having the `required` attribute set? Something like: ``` label:input[required] { ... } ``` Currently, I'm adding `class="required"` to labels and inputs for styling. I now have the HTML5 attribute `required="required"` in th...
2010/01/16
[ "https://Stackoverflow.com/questions/2075717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251966/" ]
How about [CSS 2 Attribute Selectors](http://www.w3.org/TR/CSS2/selector.html) It is pretty compatible amongst browsers. Example: ``` <style> label[required=required] { color: blue; } </style> <label required="required" for="one">Label:</label><input name="one" id="one" /> ``` Also check [this](http://www.andybudd....
Well it's not possible in CSS (as I tried) you can easily do it in JS: ``` let l = document.querySelectorAll('input[required]') l.forEach(e => { e ? e.parentElement.classList.add('required-input') : null; }) ``` ```js let l = document.querySelectorAll('input[required]') l.forEach(e => { e ? e.parentElement.class...
2,075,717
Is there a way in CSS to select `label`s bound to `input` fields (via the `for` attribute) having the `required` attribute set? Something like: ``` label:input[required] { ... } ``` Currently, I'm adding `class="required"` to labels and inputs for styling. I now have the HTML5 attribute `required="required"` in th...
2010/01/16
[ "https://Stackoverflow.com/questions/2075717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251966/" ]
This solution works in most modern browsers: ``` <style> label > input[required="required"] { background: red; } </style> <label for="myField"><input required="required" id="myField" /></label> ```
I don't think this can really be accomplished through CSS in the way that the OP wants. CSS just doesn't work that way. A better approach in my opinion is to step back and look at the big picture. You have a form where some fields are required and some are not. It is a good approach to give the user all the required f...
2,075,717
Is there a way in CSS to select `label`s bound to `input` fields (via the `for` attribute) having the `required` attribute set? Something like: ``` label:input[required] { ... } ``` Currently, I'm adding `class="required"` to labels and inputs for styling. I now have the HTML5 attribute `required="required"` in th...
2010/01/16
[ "https://Stackoverflow.com/questions/2075717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251966/" ]
This solution works in most modern browsers: ``` <style> label > input[required="required"] { background: red; } </style> <label for="myField"><input required="required" id="myField" /></label> ```
Well it's not possible in CSS (as I tried) you can easily do it in JS: ``` let l = document.querySelectorAll('input[required]') l.forEach(e => { e ? e.parentElement.classList.add('required-input') : null; }) ``` ```js let l = document.querySelectorAll('input[required]') l.forEach(e => { e ? e.parentElement.class...
2,075,717
Is there a way in CSS to select `label`s bound to `input` fields (via the `for` attribute) having the `required` attribute set? Something like: ``` label:input[required] { ... } ``` Currently, I'm adding `class="required"` to labels and inputs for styling. I now have the HTML5 attribute `required="required"` in th...
2010/01/16
[ "https://Stackoverflow.com/questions/2075717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251966/" ]
you can use `label[for="title"]` where "title" is the ID of your input. Example: ``` <label for="title">Title</label> <input type="text" id="title" name="title"> ``` css: ``` label[for="title"] { color: blue; } ```
I don't think this can really be accomplished through CSS in the way that the OP wants. CSS just doesn't work that way. A better approach in my opinion is to step back and look at the big picture. You have a form where some fields are required and some are not. It is a good approach to give the user all the required f...
2,075,717
Is there a way in CSS to select `label`s bound to `input` fields (via the `for` attribute) having the `required` attribute set? Something like: ``` label:input[required] { ... } ``` Currently, I'm adding `class="required"` to labels and inputs for styling. I now have the HTML5 attribute `required="required"` in th...
2010/01/16
[ "https://Stackoverflow.com/questions/2075717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251966/" ]
you can use `label[for="title"]` where "title" is the ID of your input. Example: ``` <label for="title">Title</label> <input type="text" id="title" name="title"> ``` css: ``` label[for="title"] { color: blue; } ```
Well it's not possible in CSS (as I tried) you can easily do it in JS: ``` let l = document.querySelectorAll('input[required]') l.forEach(e => { e ? e.parentElement.classList.add('required-input') : null; }) ``` ```js let l = document.querySelectorAll('input[required]') l.forEach(e => { e ? e.parentElement.class...
11,938,852
I'm having trouble finding the command that would match `%` in normal mode. Or any command for that matter, i.e. `yy` to `:yank`. Basically what I'm trying to do is make a oneliner like so, `:s/this/that/g | yank | undo | /* Move down one line */ | /* % */ | paste`
2012/08/13
[ "https://Stackoverflow.com/questions/11938852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/315903/" ]
You can do normal mode operations in command mode with normal/norm. For example, to yank the current line, you'd want `:norm yy`.
You can move to the next `%` character in normal mode with `f%`, and just before it with `t%`
33,901,839
I'm wondering if there is a way to fix an element inside a visible area of the `div` as I've described in the image below. [![Position of fixed element inside div](https://i.stack.imgur.com/7YXQI.png)](https://i.stack.imgur.com/7YXQI.png) Here is an example of my problem ([jsfiddle](https://jsfiddle.net/o5Lb6qyw/6/))...
2015/11/24
[ "https://Stackoverflow.com/questions/33901839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2758359/" ]
As far as I know, FAKE does not have any built-in configuration system, but you can use any of the F# libraries for working with XML to read the configuration file. One nice option would be to use the XML type provider from [F# Data](http://fsharp.github.io/FSharp.Data/). You'd need to make sure the `FSharp.Data` pack...
Put the values for these custom paths in a .fsx file Include this .fsx file in your main build script
265,028
I'm currently learning how to discover web applications running on a machine using port scanning, vhost bruteforcing and directory fuzzing. When it comes to port scanning, there is one thing I can't wrap my head around. Let's say I have scanned all ports on a host and discovered a HTTP service exposed. To validate it'...
2022/09/24
[ "https://security.stackexchange.com/questions/265028", "https://security.stackexchange.com", "https://security.stackexchange.com/users/282742/" ]
I will use another *principle* to answer your question: use more than one defence line in case one gets broken. If you can be sure that your login protection is 100% secure, both ways are stricly equivalent: only users from TeamAlice can access machines from TeamAlice\_Computers and only those having the admin privile...
It depends. Each approach in this case has own pros and cons. You don't describe how is the login permissions are given. One approach can be to define 2 groups: * "AliceAdmins": This group would contain permissions "AliceLogin" and "admin\_command" * "BobAdmins": This group would contain permissions "BobLogin" and "...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
As most of all answers covered Q1, Here i would like to concentrate on Q2 which is " If at all we did start a new thread on the same instance, what harm it would do ?" first point to consider is when do you want want to call the thread start method second time,is it when the first thread is executing(case:1) or else a...
And here we see why the Executors make so much sense. Typical idiomatic Java would say that you shouldn't run your own threads much at all; create an executor service, and let it manage the threads. You just create Runnable instances and pass those to the executor service; you can call Runnable's run() method as ofte...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
You are NOT calling start() on the same instance. Everytime you use new you are creating a distinct instance. Hence no problem calling start(). If you did this: ``` Thread t = new Thread(thread); t.start(); t.start(); ``` Then you may have a problem.
As most of all answers covered Q1, Here i would like to concentrate on Q2 which is " If at all we did start a new thread on the same instance, what harm it would do ?" first point to consider is when do you want want to call the thread start method second time,is it when the first thread is executing(case:1) or else a...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
> > Q.1) I ran the above code in Eclipse. Here, since I am trying to start a new thread on the same instance, a IllegalThreadStateException is expected to be thrown. But it doesn't. > > > You are not caling start() on same instance. ``` new Thread(thread).start(); ``` the above statement is same as ``` new Th...
And here we see why the Executors make so much sense. Typical idiomatic Java would say that you shouldn't run your own threads much at all; create an executor service, and let it manage the threads. You just create Runnable instances and pass those to the executor service; you can call Runnable's run() method as ofte...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
Firstly, you are invoking on two different thread objects ie: ``` new Thread(thread).start(); new Thread(thread).start(); ``` you are calling start method on two different instances. for which reason you are not getting the exception. try with following to get the exception ``` thread.start(); thread.start(); ...
You are NOT calling start() on the same instance. Everytime you use new you are creating a distinct instance. Hence no problem calling start(). If you did this: ``` Thread t = new Thread(thread); t.start(); t.start(); ``` Then you may have a problem.
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
Firstly, you are invoking on two different thread objects ie: ``` new Thread(thread).start(); new Thread(thread).start(); ``` you are calling start method on two different instances. for which reason you are not getting the exception. try with following to get the exception ``` thread.start(); thread.start(); ...
> > Q.1) I ran the above code in Eclipse. Here, since I am trying to start a new thread on the same instance, a IllegalThreadStateException is expected to be thrown. But it doesn't. > > > You are not caling start() on same instance. ``` new Thread(thread).start(); ``` the above statement is same as ``` new Th...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
You are NOT calling start() on the same instance. Everytime you use new you are creating a distinct instance. Hence no problem calling start(). If you did this: ``` Thread t = new Thread(thread); t.start(); t.start(); ``` Then you may have a problem.
> > Can java thread invoke start more than once ? > > > You can involve start() as often as you like. However you will get an IllegalThreadStateException if you call it more than once on the **same** Thread. > > Q.1) I ran the above code in Eclipse. Here, since I am trying to start a new thread on the same insta...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
You are NOT calling start() on the same instance. Everytime you use new you are creating a distinct instance. Hence no problem calling start(). If you did this: ``` Thread t = new Thread(thread); t.start(); t.start(); ``` Then you may have a problem.
And here we see why the Executors make so much sense. Typical idiomatic Java would say that you shouldn't run your own threads much at all; create an executor service, and let it manage the threads. You just create Runnable instances and pass those to the executor service; you can call Runnable's run() method as ofte...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
> > Can java thread invoke start more than once ? > > > You can involve start() as often as you like. However you will get an IllegalThreadStateException if you call it more than once on the **same** Thread. > > Q.1) I ran the above code in Eclipse. Here, since I am trying to start a new thread on the same insta...
And here we see why the Executors make so much sense. Typical idiomatic Java would say that you shouldn't run your own threads much at all; create an executor service, and let it manage the threads. You just create Runnable instances and pass those to the executor service; you can call Runnable's run() method as ofte...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
You are NOT calling start() on the same instance. Everytime you use new you are creating a distinct instance. Hence no problem calling start(). If you did this: ``` Thread t = new Thread(thread); t.start(); t.start(); ``` Then you may have a problem.
> > Q.1) I ran the above code in Eclipse. Here, since I am trying to start a new thread on the same instance, a IllegalThreadStateException is expected to be thrown. But it doesn't. > > > You are not caling start() on same instance. ``` new Thread(thread).start(); ``` the above statement is same as ``` new Th...
5,501,109
Folks, I know this question has been asked before here, **though indirectly**. But it didn't answer my doubt. Question : [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) From the [spec](http...
2011/03/31
[ "https://Stackoverflow.com/questions/5501109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202375/" ]
Firstly, you are invoking on two different thread objects ie: ``` new Thread(thread).start(); new Thread(thread).start(); ``` you are calling start method on two different instances. for which reason you are not getting the exception. try with following to get the exception ``` thread.start(); thread.start(); ...
As most of all answers covered Q1, Here i would like to concentrate on Q2 which is " If at all we did start a new thread on the same instance, what harm it would do ?" first point to consider is when do you want want to call the thread start method second time,is it when the first thread is executing(case:1) or else a...
20,088,061
I have an API which returns `System.Collections.Generic.IEnumerable<t>`, if I import(`using`) `System.Linq`. I am able to do `Count()` / `ToList()` on the returned object. What would be the relation between those two(`System.Collections.Generic`, `System.Linq`), packages ? Thanks Pavan
2013/11/20
[ "https://Stackoverflow.com/questions/20088061", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1003086/" ]
IEnumerable<> is that relationship. Those methods (Count(), ToList()) are [extension methods](http://msdn.microsoft.com/en-us/library/vstudio/bb383977.aspx) on IEnumerable<> This means that anything that implements IEnumerable (IList, ICollection, Arrays) they all will have those methods. To use them you need to "impo...
There is a static class `Enumerable` in the `System.Linq` namespace which provides the most of extension methods you use with `IEnumerable<T>` types.
33,240
I was reading New Practical Chinese Reader Chpater 27 and stumbled upon the following sentence: 我把你们带到茶馆来。 While the meaning of the sentence is pretty clear, I have trouble understanding its underlying structure and hope someone can help me. Thus far I figured out: You use 把 together with 带到 that something has been mo...
2019/03/14
[ "https://chinese.stackexchange.com/questions/33240", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/9323/" ]
bkrs: (Ru) after VP 4) -lai, lái indicates completion (result) of action by main verb 信笔写来,一觉醒来,这人看来年纪不小, 你且听我道来, 屈指算来, 已经十五年了,说来话长 "现代汉语词典"(1983年 北京)来(2)用在动词后,表示动作的结果:examples 1-3 as above|看来今年超产没有问题|想来你是早有准备的
汉语博大精深。"来"表示意愿和热情。。。。。。。。。。。。。。。。。。。。。。。。。。。。
33,240
I was reading New Practical Chinese Reader Chpater 27 and stumbled upon the following sentence: 我把你们带到茶馆来。 While the meaning of the sentence is pretty clear, I have trouble understanding its underlying structure and hope someone can help me. Thus far I figured out: You use 把 together with 带到 that something has been mo...
2019/03/14
[ "https://chinese.stackexchange.com/questions/33240", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/9323/" ]
Here unfortunately, 来 doesn't indicate completion. Instead, it indicates direction of an action. 我把你们带到茶馆来=我把你们带来茶馆(indicating that the speaker's location is (or was, depending on context) 茶馆) Comparison: 我把你们带到茶馆去=我把你们带去茶馆(indicating that the speaker is not at 茶馆)
bkrs: (Ru) after VP 4) -lai, lái indicates completion (result) of action by main verb 信笔写来,一觉醒来,这人看来年纪不小, 你且听我道来, 屈指算来, 已经十五年了,说来话长 "现代汉语词典"(1983年 北京)来(2)用在动词后,表示动作的结果:examples 1-3 as above|看来今年超产没有问题|想来你是早有准备的
33,240
I was reading New Practical Chinese Reader Chpater 27 and stumbled upon the following sentence: 我把你们带到茶馆来。 While the meaning of the sentence is pretty clear, I have trouble understanding its underlying structure and hope someone can help me. Thus far I figured out: You use 把 together with 带到 that something has been mo...
2019/03/14
[ "https://chinese.stackexchange.com/questions/33240", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/9323/" ]
Here unfortunately, 来 doesn't indicate completion. Instead, it indicates direction of an action. 我把你们带到茶馆来=我把你们带来茶馆(indicating that the speaker's location is (or was, depending on context) 茶馆) Comparison: 我把你们带到茶馆去=我把你们带去茶馆(indicating that the speaker is not at 茶馆)
汉语博大精深。"来"表示意愿和热情。。。。。。。。。。。。。。。。。。。。。。。。。。。。
33,240
I was reading New Practical Chinese Reader Chpater 27 and stumbled upon the following sentence: 我把你们带到茶馆来。 While the meaning of the sentence is pretty clear, I have trouble understanding its underlying structure and hope someone can help me. Thus far I figured out: You use 把 together with 带到 that something has been mo...
2019/03/14
[ "https://chinese.stackexchange.com/questions/33240", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/9323/" ]
If you are following NPCR, I suggest you take a look at lesson 16 on book 2. You should first understand 我把照片带来了. 带 (carry) + 来 ("here") = 带来 (bring) 我把照片带来了。I brought the photo. Compare: 我把照片带去了。I took the photo there. 带 (carry) + 去 ("there") = 带去 (take "there") The translations "take/bring" to the word 带 don't ...
汉语博大精深。"来"表示意愿和热情。。。。。。。。。。。。。。。。。。。。。。。。。。。。
33,240
I was reading New Practical Chinese Reader Chpater 27 and stumbled upon the following sentence: 我把你们带到茶馆来。 While the meaning of the sentence is pretty clear, I have trouble understanding its underlying structure and hope someone can help me. Thus far I figured out: You use 把 together with 带到 that something has been mo...
2019/03/14
[ "https://chinese.stackexchange.com/questions/33240", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/9323/" ]
Here unfortunately, 来 doesn't indicate completion. Instead, it indicates direction of an action. 我把你们带到茶馆来=我把你们带来茶馆(indicating that the speaker's location is (or was, depending on context) 茶馆) Comparison: 我把你们带到茶馆去=我把你们带去茶馆(indicating that the speaker is not at 茶馆)
If you are following NPCR, I suggest you take a look at lesson 16 on book 2. You should first understand 我把照片带来了. 带 (carry) + 来 ("here") = 带来 (bring) 我把照片带来了。I brought the photo. Compare: 我把照片带去了。I took the photo there. 带 (carry) + 去 ("there") = 带去 (take "there") The translations "take/bring" to the word 带 don't ...
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
I assume this is a data cache problem. Storing data in static class is not guaranteed to work when user swap apps often. Android system will reclaim any background activity when memory is low. Static class is definitely among this category. The proper way to do it is to use [sharedPreference](http://developer.android...
I store a `User` object and a `Client` object in my static scope. I have noticed from time to time the reference becomes null. So now in my getters I check to see if this value is null and if so I restart the app. ``` Intent i = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); ...
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
1. You can't. Android needs to free up memory from time to time. Imagine if all applications had a ton of static data that is supposed to be resident forever - how would you fit that in memory? It's a mobile phone. It doesn't have virtual memory. 2. (and 3): Anything that is intended to be persistent needs to be stored...
I assume this is a data cache problem. Storing data in static class is not guaranteed to work when user swap apps often. Android system will reclaim any background activity when memory is low. Static class is definitely among this category. The proper way to do it is to use [sharedPreference](http://developer.android...
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
Most likely the issue is that your application is being killed while it is in the background, and then recreated when you come back to it. Check out the [Activity Lifecycle](http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle) documentation on when this might occur for a single activity. ...
I store a `User` object and a `Client` object in my static scope. I have noticed from time to time the reference becomes null. So now in my getters I check to see if this value is null and if so I restart the app. ``` Intent i = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); ...
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
If you weren't using raw files, I'd advise initializing when the class is loaded. For instance, ``` public static Map<?,?> myStaticMap = new HashMap<?,?>(); static { //fill myStaticMap } ``` You do have some bigger concerns to worry about if you are loading files that way. For instance, what about I/O errors, or la...
I store a `User` object and a `Client` object in my static scope. I have noticed from time to time the reference becomes null. So now in my getters I check to see if this value is null and if so I restart the app. ``` Intent i = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); ...
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
If you weren't using raw files, I'd advise initializing when the class is loaded. For instance, ``` public static Map<?,?> myStaticMap = new HashMap<?,?>(); static { //fill myStaticMap } ``` You do have some bigger concerns to worry about if you are loading files that way. For instance, what about I/O errors, or la...
In your `onResume()` method you could query the static data to see if it is present and if not, load it back in again.
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
I assume this is a data cache problem. Storing data in static class is not guaranteed to work when user swap apps often. Android system will reclaim any background activity when memory is low. Static class is definitely among this category. The proper way to do it is to use [sharedPreference](http://developer.android...
In your `onResume()` method you could query the static data to see if it is present and if not, load it back in again.
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
Most likely the issue is that your application is being killed while it is in the background, and then recreated when you come back to it. Check out the [Activity Lifecycle](http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle) documentation on when this might occur for a single activity. ...
Instead of using the static variable u can use the shared preference for storing the value. Note: for shared preference also you should not give heavy load. I have solved this problem by having the super class with getter and setter function for storing and retrieving shared preference variable. All class in my appl...
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
I assume this is a data cache problem. Storing data in static class is not guaranteed to work when user swap apps often. Android system will reclaim any background activity when memory is low. Static class is definitely among this category. The proper way to do it is to use [sharedPreference](http://developer.android...
Instead of using the static variable u can use the shared preference for storing the value. Note: for shared preference also you should not give heavy load. I have solved this problem by having the super class with getter and setter function for storing and retrieving shared preference variable. All class in my appl...
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
1. You can't. Android needs to free up memory from time to time. Imagine if all applications had a ton of static data that is supposed to be resident forever - how would you fit that in memory? It's a mobile phone. It doesn't have virtual memory. 2. (and 3): Anything that is intended to be persistent needs to be stored...
In your `onResume()` method you could query the static data to see if it is present and if not, load it back in again.
4,797,187
I have an application which has some static variables. These variables are stored in an independent Class named DataContext. These variables are initialized from raw files at the application start (a method named DataContext.initConstant() is called in the onCreate() of MyApplication which extends Application). (EDIT ...
2011/01/25
[ "https://Stackoverflow.com/questions/4797187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/589413/" ]
Most likely the issue is that your application is being killed while it is in the background, and then recreated when you come back to it. Check out the [Activity Lifecycle](http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle) documentation on when this might occur for a single activity. ...
In your `onResume()` method you could query the static data to see if it is present and if not, load it back in again.
52,702,067
My goal is to export a large (~300GB) table to a csv/tsv in S3 for long term storage (basically, if someone WANTS to look at it in years to come, they can, but it is not required to be available online). I need to copy JUST THIS ONE TABLE, not the whole db. After some quick googling, it seemed like Data Pipeline was t...
2018/10/08
[ "https://Stackoverflow.com/questions/52702067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2057955/" ]
I will suggest you to start a Micro EC2 instance with huge EBS volume like 400 GB. Then write a simple shell script (2 lines of code ) to export (using mysqldump) each table and then use `aws s3 cp` command to copy it to S3. You need to be aware that if tables are getting updated realtime; then using this method can le...
We should avoid exporting and uploading to s3 in 2 steps. For larger DB, I would suggest using the below command to upload file to S3 directly without occupying the local space ``` mysqldump -h [db_hostname] -u [db_user] -p[db_passwd] [databasename] | aws s3 cp - s3://[s3_bucketname]/[mysqldump_filename] ``` e.g. ...
11,582,988
I have a file uploader that works, in that the file and variable are getting uploaded, and the complete handler is getting triggered, when the upload is complete.. however the progress handler is not.. any ideas why not?... regards J ``` function uploadFile_function(){ var formData = new FormData(); formDa...
2012/07/20
[ "https://Stackoverflow.com/questions/11582988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850360/" ]
Check out my answer to this [our.umbraco.org forum post](http://our.umbraco.org/forum/developers/razor/33050-IngroupsOf?p=0#comment121481). Basically, depending on whether the MNTP is using XML or CSV, you can do one of the following: **CSV:** ``` @using umbraco.MacroEngines @inherits DynamicNodeContext @if (Model.Ha...
You can use uQuery.getNodesByCSV or uQuery.getMediaByCSV too. uQuery was added to Umbraco core in 4.9 I think, otherwise you can install uComponents package so for example I have something like this in 4.9.1 to loop through some media ``` @using umbraco.MacroEngines @using umbraco.cms.businesslogic.media @inherits um...