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
5,388,194
Is there a Java Web Framework, with mvc, thrid-party integration APIs, libraries and tools? Something like Zend Framework for PHP?
2011/03/22
[ "https://Stackoverflow.com/questions/5388194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268912/" ]
Using Zend for a while, I found the transition to Spring fairly easy. Spring does come with more bells and whistles (Dependancy injection, AOP etc)
There are a lot of Java web Frameworks, here you have a list with lots of them: <http://java-source.net/open-source/web-frameworks> The most "famous" would be Struts, JSF or Spring mvc framework (not in that particular order).
5,388,194
Is there a Java Web Framework, with mvc, thrid-party integration APIs, libraries and tools? Something like Zend Framework for PHP?
2011/03/22
[ "https://Stackoverflow.com/questions/5388194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268912/" ]
[Play Framework](http://www.playframework.org/) is more light weight compared to Spring , JSF or Struts. More close to Zend in some sense. and has scala support :)
You also have [AppFuse](http://appfuse.org/display/APF/Home) > > **AppFuse** is an open source project and > application that uses open source > tools built on the Java platform to > help you develop Web applications > quickly and efficiently. It was > originally developed to eliminate the > ramp-up time found...
5,388,194
Is there a Java Web Framework, with mvc, thrid-party integration APIs, libraries and tools? Something like Zend Framework for PHP?
2011/03/22
[ "https://Stackoverflow.com/questions/5388194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268912/" ]
Using Zend for a while, I found the transition to Spring fairly easy. Spring does come with more bells and whistles (Dependancy injection, AOP etc)
[Play Framework](http://www.playframework.org/) is more light weight compared to Spring , JSF or Struts. More close to Zend in some sense. and has scala support :)
5,388,194
Is there a Java Web Framework, with mvc, thrid-party integration APIs, libraries and tools? Something like Zend Framework for PHP?
2011/03/22
[ "https://Stackoverflow.com/questions/5388194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268912/" ]
Using Zend for a while, I found the transition to Spring fairly easy. Spring does come with more bells and whistles (Dependancy injection, AOP etc)
You also have [AppFuse](http://appfuse.org/display/APF/Home) > > **AppFuse** is an open source project and > application that uses open source > tools built on the Java platform to > help you develop Web applications > quickly and efficiently. It was > originally developed to eliminate the > ramp-up time found...
21,707,120
I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project). (I've attached the CocoaPods using the following tutorial: <http://www.raywenderlich.com/12139/introduction-to-cocoapods>) I've tried the standard renaming technique: <https://stackoverflow.com/a/19442868/173623> But it breaks the ...
2014/02/11
[ "https://Stackoverflow.com/questions/21707120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173623/" ]
After viewing your provided tutorial, I would like to suggest you the following: * First follow the standard renaming technique that you got in another post * Now if you have enough time and patience, then it'd be best to start over from the section `Installing Your First Dependency` If you don't do that, then you ma...
I had this issue and used Wassif's answer, however it didn't work until I also selected the new executable (.app) file in Products > Scheme > Edit Scheme > Info Also I couldn't find "Installing Your First Dependency" on CocoaPods.
21,707,120
I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project). (I've attached the CocoaPods using the following tutorial: <http://www.raywenderlich.com/12139/introduction-to-cocoapods>) I've tried the standard renaming technique: <https://stackoverflow.com/a/19442868/173623> But it breaks the ...
2014/02/11
[ "https://Stackoverflow.com/questions/21707120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173623/" ]
After viewing your provided tutorial, I would like to suggest you the following: * First follow the standard renaming technique that you got in another post * Now if you have enough time and patience, then it'd be best to start over from the section `Installing Your First Dependency` If you don't do that, then you ma...
I removed all cocoapods from my project with this GEM <https://github.com/kylef/cocoapods-deintegrate> then renamed my app in standard way and after fixing this issue with tests: <https://stackoverflow.com/a/27558736/1237542> everything worked OK.
21,707,120
I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project). (I've attached the CocoaPods using the following tutorial: <http://www.raywenderlich.com/12139/introduction-to-cocoapods>) I've tried the standard renaming technique: <https://stackoverflow.com/a/19442868/173623> But it breaks the ...
2014/02/11
[ "https://Stackoverflow.com/questions/21707120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173623/" ]
After viewing your provided tutorial, I would like to suggest you the following: * First follow the standard renaming technique that you got in another post * Now if you have enough time and patience, then it'd be best to start over from the section `Installing Your First Dependency` If you don't do that, then you ma...
I have just written a [blog post](http://h4ckish.com/2015/01/22/renaming-your-cocoapods-ios-project/) on how to go about this. The most sure-fire procedure looks like: 1. remove CocoaPods 2. rename project 3. re-add CocoaPods to your project Consult the post for details.
21,707,120
I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project). (I've attached the CocoaPods using the following tutorial: <http://www.raywenderlich.com/12139/introduction-to-cocoapods>) I've tried the standard renaming technique: <https://stackoverflow.com/a/19442868/173623> But it breaks the ...
2014/02/11
[ "https://Stackoverflow.com/questions/21707120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173623/" ]
After viewing your provided tutorial, I would like to suggest you the following: * First follow the standard renaming technique that you got in another post * Now if you have enough time and patience, then it'd be best to start over from the section `Installing Your First Dependency` If you don't do that, then you ma...
I found the easy way to do it: 1. change inside podfile project name. 2. pod install 3. open generated file xcworkspace reload red files Done!
21,707,120
I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project). (I've attached the CocoaPods using the following tutorial: <http://www.raywenderlich.com/12139/introduction-to-cocoapods>) I've tried the standard renaming technique: <https://stackoverflow.com/a/19442868/173623> But it breaks the ...
2014/02/11
[ "https://Stackoverflow.com/questions/21707120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173623/" ]
I removed all cocoapods from my project with this GEM <https://github.com/kylef/cocoapods-deintegrate> then renamed my app in standard way and after fixing this issue with tests: <https://stackoverflow.com/a/27558736/1237542> everything worked OK.
I had this issue and used Wassif's answer, however it didn't work until I also selected the new executable (.app) file in Products > Scheme > Edit Scheme > Info Also I couldn't find "Installing Your First Dependency" on CocoaPods.
21,707,120
I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project). (I've attached the CocoaPods using the following tutorial: <http://www.raywenderlich.com/12139/introduction-to-cocoapods>) I've tried the standard renaming technique: <https://stackoverflow.com/a/19442868/173623> But it breaks the ...
2014/02/11
[ "https://Stackoverflow.com/questions/21707120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173623/" ]
I have just written a [blog post](http://h4ckish.com/2015/01/22/renaming-your-cocoapods-ios-project/) on how to go about this. The most sure-fire procedure looks like: 1. remove CocoaPods 2. rename project 3. re-add CocoaPods to your project Consult the post for details.
I had this issue and used Wassif's answer, however it didn't work until I also selected the new executable (.app) file in Products > Scheme > Edit Scheme > Info Also I couldn't find "Installing Your First Dependency" on CocoaPods.
21,707,120
I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project). (I've attached the CocoaPods using the following tutorial: <http://www.raywenderlich.com/12139/introduction-to-cocoapods>) I've tried the standard renaming technique: <https://stackoverflow.com/a/19442868/173623> But it breaks the ...
2014/02/11
[ "https://Stackoverflow.com/questions/21707120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173623/" ]
I found the easy way to do it: 1. change inside podfile project name. 2. pod install 3. open generated file xcworkspace reload red files Done!
I had this issue and used Wassif's answer, however it didn't work until I also selected the new executable (.app) file in Products > Scheme > Edit Scheme > Info Also I couldn't find "Installing Your First Dependency" on CocoaPods.
21,916,516
I'm working on an AngularJS app that uses a custom directive. I'm also trying to use unit testing in my app. So, I'm trying to leverage Jasmine for that. Currently, My unit test is the problem. Currently, it looks like the following: **myDirective.spec.js** ``` describe('Directive: myDirective', function () { descr...
2014/02/20
[ "https://Stackoverflow.com/questions/21916516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3284007/" ]
First you must add angular mocks: ``` <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular-mocks.js"> </script> ``` then load the modules and inject $compile/$rootScope in `beforeEach` blocks: ``` describe('Directive: myDirective', function () { var $compile; var $rootScope; beforeEach(modul...
The it() function provided by jasmine won't do any injection for you, so you need to inject your angular components into your tests. Modify your test as follows: ``` describe('Directive: myDirective', function () { describe('Function: myProcedure', function () { it('should word', function () { inject(...
21,916,516
I'm working on an AngularJS app that uses a custom directive. I'm also trying to use unit testing in my app. So, I'm trying to leverage Jasmine for that. Currently, My unit test is the problem. Currently, it looks like the following: **myDirective.spec.js** ``` describe('Directive: myDirective', function () { descr...
2014/02/20
[ "https://Stackoverflow.com/questions/21916516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3284007/" ]
First you must add angular mocks: ``` <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular-mocks.js"> </script> ``` then load the modules and inject $compile/$rootScope in `beforeEach` blocks: ``` describe('Directive: myDirective', function () { var $compile; var $rootScope; beforeEach(modul...
I have come across this problem just now and this is what made my day (in the very end of it actually).just add "module('ng');" along with module('yourAppModule'). It should work.
6,275,246
I have two tables, Subject and Content, where Content references Subject with foreign key. I want to display how many times each subject appears in Content table (0, if it does not appear). But the query below only gives me the rows with count > 0 and ignores the others: ``` SELECT Subject.id, Subject.name, COUNT(Cont...
2011/06/08
[ "https://Stackoverflow.com/questions/6275246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/705972/" ]
Which table is `type` a column in? I'm supposing that it's Content - and by including the field in the WHERE clause, you're forcing the Content table on the right-hand side of the LEFT JOIN to have data in it (which means the LEFT JOIN is actually then just an INNER JOIN). Try: ``` SELECT Subject.id, Subject.name, CO...
Do an outer join instead. Replace the null with a 0. Replace non null with a 1. Instead of count, do a sum of this column. Hope this helps
6,275,246
I have two tables, Subject and Content, where Content references Subject with foreign key. I want to display how many times each subject appears in Content table (0, if it does not appear). But the query below only gives me the rows with count > 0 and ignores the others: ``` SELECT Subject.id, Subject.name, COUNT(Cont...
2011/06/08
[ "https://Stackoverflow.com/questions/6275246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/705972/" ]
Which table does column `type` belong to? If `type` is in `subject`, your left join should work. So I assume that `type` is in `Content`. Then the problem is that your WHERE clause won't match the cases where there are no matching lines in `Content`. Use ``` WHERE (type = @type) OR (type IS NULL) ```
Do an outer join instead. Replace the null with a 0. Replace non null with a 1. Instead of count, do a sum of this column. Hope this helps
6,275,246
I have two tables, Subject and Content, where Content references Subject with foreign key. I want to display how many times each subject appears in Content table (0, if it does not appear). But the query below only gives me the rows with count > 0 and ignores the others: ``` SELECT Subject.id, Subject.name, COUNT(Cont...
2011/06/08
[ "https://Stackoverflow.com/questions/6275246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/705972/" ]
Which table is `type` a column in? I'm supposing that it's Content - and by including the field in the WHERE clause, you're forcing the Content table on the right-hand side of the LEFT JOIN to have data in it (which means the LEFT JOIN is actually then just an INNER JOIN). Try: ``` SELECT Subject.id, Subject.name, CO...
Which table does column `type` belong to? If `type` is in `subject`, your left join should work. So I assume that `type` is in `Content`. Then the problem is that your WHERE clause won't match the cases where there are no matching lines in `Content`. Use ``` WHERE (type = @type) OR (type IS NULL) ```
54,403,960
I am trying to update room database want to add two columns with an existing database and don't want to lose the data. My existing table name WordTable ``` @Entity data class WordTable( @PrimaryKey(autoGenerate = true) var id: Int = 0, var word: String = "", var des: String = "", var bookmark: Boo...
2019/01/28
[ "https://Stackoverflow.com/questions/54403960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5935559/" ]
You can copy queries to create tables or modify tables from the generated room database file. Just double tap shift and look for \_Impl. Your problem is related to `NON NULL` data types in your tables you need to specify these fields as `NON NULL` and handle `DEFAULT` values that need to be assigned during your Room...
You dont need crate new table create an method like: ``` private static final Migration MIGRATION_1_2 = new Migration(1, 2) { @Override public void migrate(@NonNull SupportSQLiteDatabase database) { database.execSQL("ALTER TABLE `WordTable` ADD COLUMN ref STRING"); ...
54,403,960
I am trying to update room database want to add two columns with an existing database and don't want to lose the data. My existing table name WordTable ``` @Entity data class WordTable( @PrimaryKey(autoGenerate = true) var id: Int = 0, var word: String = "", var des: String = "", var bookmark: Boo...
2019/01/28
[ "https://Stackoverflow.com/questions/54403960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5935559/" ]
You can copy queries to create tables or modify tables from the generated room database file. Just double tap shift and look for \_Impl. Your problem is related to `NON NULL` data types in your tables you need to specify these fields as `NON NULL` and handle `DEFAULT` values that need to be assigned during your Room...
You can use the `ALTER TABLE` Query and simply provide migration ``` private static final Migration MIGRATION_1_2 = new Migration(1, 2) { @Override public void migrate(@NonNull SupportSQLiteDatabase database) { database.execSQL("ALTER TABLE `table_name` ADD COLUMN `column_name` {type} DEFA...
54,403,960
I am trying to update room database want to add two columns with an existing database and don't want to lose the data. My existing table name WordTable ``` @Entity data class WordTable( @PrimaryKey(autoGenerate = true) var id: Int = 0, var word: String = "", var des: String = "", var bookmark: Boo...
2019/01/28
[ "https://Stackoverflow.com/questions/54403960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5935559/" ]
You can copy queries to create tables or modify tables from the generated room database file. Just double tap shift and look for \_Impl. Your problem is related to `NON NULL` data types in your tables you need to specify these fields as `NON NULL` and handle `DEFAULT` values that need to be assigned during your Room...
The differences between Expected and Found in your error message are the not null constraints in your table. If you want the rows to be nullable, define their variables as objects without default values and make a constructor that defines the required rows. Do not instantiate row values at the same time as you instant...
54,403,960
I am trying to update room database want to add two columns with an existing database and don't want to lose the data. My existing table name WordTable ``` @Entity data class WordTable( @PrimaryKey(autoGenerate = true) var id: Int = 0, var word: String = "", var des: String = "", var bookmark: Boo...
2019/01/28
[ "https://Stackoverflow.com/questions/54403960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5935559/" ]
You can use the `ALTER TABLE` Query and simply provide migration ``` private static final Migration MIGRATION_1_2 = new Migration(1, 2) { @Override public void migrate(@NonNull SupportSQLiteDatabase database) { database.execSQL("ALTER TABLE `table_name` ADD COLUMN `column_name` {type} DEFA...
You dont need crate new table create an method like: ``` private static final Migration MIGRATION_1_2 = new Migration(1, 2) { @Override public void migrate(@NonNull SupportSQLiteDatabase database) { database.execSQL("ALTER TABLE `WordTable` ADD COLUMN ref STRING"); ...
54,403,960
I am trying to update room database want to add two columns with an existing database and don't want to lose the data. My existing table name WordTable ``` @Entity data class WordTable( @PrimaryKey(autoGenerate = true) var id: Int = 0, var word: String = "", var des: String = "", var bookmark: Boo...
2019/01/28
[ "https://Stackoverflow.com/questions/54403960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5935559/" ]
The differences between Expected and Found in your error message are the not null constraints in your table. If you want the rows to be nullable, define their variables as objects without default values and make a constructor that defines the required rows. Do not instantiate row values at the same time as you instant...
You dont need crate new table create an method like: ``` private static final Migration MIGRATION_1_2 = new Migration(1, 2) { @Override public void migrate(@NonNull SupportSQLiteDatabase database) { database.execSQL("ALTER TABLE `WordTable` ADD COLUMN ref STRING"); ...
3,472
I am working on [this code](https://github.com/nfmcclure/tensorflow_cookbook/blob/master/09_Recurrent_Neural_Networks/02_Implementing_RNN_for_Spam_Prediction/02_implementing_rnn.py) for spam detection using recurrent neural networks. Question 1. I am wondering whether this field (using RNNs for email spam detection) ...
2017/06/10
[ "https://ai.stackexchange.com/questions/3472", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/6050/" ]
There's a strong sentiment towards the idea that medical diagnosis is largely [Abductive Reasoning](https://en.wikipedia.org/wiki/Abductive_reasoning). See [this presentation](https://blogs.kent.ac.uk/jonw/files/2015/04/Aliseda2012.pdf) for additional details. One approach to automated abductive reasoning is [parsimoni...
You may infer some mental problems using text processing. Any text written by an individual contains a lot of clues about their mental state, probably including any health problems. However, I believe pursuing this would prove to be difficult due to lack of ground truth. Not many people makes it public that they have...
3,472
I am working on [this code](https://github.com/nfmcclure/tensorflow_cookbook/blob/master/09_Recurrent_Neural_Networks/02_Implementing_RNN_for_Spam_Prediction/02_implementing_rnn.py) for spam detection using recurrent neural networks. Question 1. I am wondering whether this field (using RNNs for email spam detection) ...
2017/06/10
[ "https://ai.stackexchange.com/questions/3472", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/6050/" ]
There's a strong sentiment towards the idea that medical diagnosis is largely [Abductive Reasoning](https://en.wikipedia.org/wiki/Abductive_reasoning). See [this presentation](https://blogs.kent.ac.uk/jonw/files/2015/04/Aliseda2012.pdf) for additional details. One approach to automated abductive reasoning is [parsimoni...
It's already being done, and apparently with very good results. See: [Predicting Risk of Suicide Attempts Over Time Through Machine Learning](http://journals.sagepub.com/doi/abs/10.1177/2167702617691560?journalCode=cpxa&), Walsh, Ribiero, Franklin Here is the abstract from the paper: > > Traditional approaches to t...
3,472
I am working on [this code](https://github.com/nfmcclure/tensorflow_cookbook/blob/master/09_Recurrent_Neural_Networks/02_Implementing_RNN_for_Spam_Prediction/02_implementing_rnn.py) for spam detection using recurrent neural networks. Question 1. I am wondering whether this field (using RNNs for email spam detection) ...
2017/06/10
[ "https://ai.stackexchange.com/questions/3472", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/6050/" ]
It's already being done, and apparently with very good results. See: [Predicting Risk of Suicide Attempts Over Time Through Machine Learning](http://journals.sagepub.com/doi/abs/10.1177/2167702617691560?journalCode=cpxa&), Walsh, Ribiero, Franklin Here is the abstract from the paper: > > Traditional approaches to t...
You may infer some mental problems using text processing. Any text written by an individual contains a lot of clues about their mental state, probably including any health problems. However, I believe pursuing this would prove to be difficult due to lack of ground truth. Not many people makes it public that they have...
33,170,820
I have x86 C++ application which using ImageMagic++ library. I also have machine with CentOS 7 x86\_64. I need to build my application on this machine. I have installed i686 ImageMagick library: ``` [dvoryankin@testsuitel]$ yum list installed | grep Magick ImageMagick.i686 6.7.8.9-10.el7 ...
2015/10/16
[ "https://Stackoverflow.com/questions/33170820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3844730/" ]
I added this : ``` // Add timeZone Date.prototype.addTimeZone = function () { if(this.getTimezoneOffset() > 0){ this.setMinutes(this.getTimezoneOffset()); } return this; }; ``` And this on my controller/model : ``` new Date(myDate).addTimeZone(); ``` **To resume :** **extend-date-prototy...
You can use [`getTimezoneOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset) to get the offset of the client, then simple math ``` var dateToTranslate = new Date("2015-10-16T00:00:00.000Z"); var timezoneOffset = dateToTranslate.getTimezoneOffset() * 60000; ...
57,927,197
I have a dictionary like below. ``` d = {'key1': {'match': '45.56', 'key12': '45.56'}, 'key2': {'key21': '45.56', 'match2': '45.56'}, 'key3': {'key31': '45.56', 'key32': '45.56'}, 'key4': ["key4", "key5"]} ``` I want to grab key names (where the value of the key is either match or match2) under heading "match" a...
2019/09/13
[ "https://Stackoverflow.com/questions/57927197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8340881/" ]
You can do a list comprehension to get the match using `any` and membership check and non-match using set difference: ``` d = {'key1': {'match': '45.56', 'key12': '45.56'}, 'key2': {'key21': '45.56', 'match2': '45.56'}, 'key3': {'key31': '45.56', 'key32': '45.56'}, 'key4': ["key4", "key5"]} to_look = ...
You can iterate through the dict items and test if `match` or `match2` is in any of the keys of the sub-dicts: ``` print(*(k for k, s in d.items() if any(w in s for w in ('match', 'match2'))), sep='\n') ``` This outputs: ``` key1 key2 ``` Similarly, you can get the non-matching keys by testing if both `match1` an...
22,184
Assuming that there are no known complete graph invariants in the spirit of [Harrsion's question](https://mathoverflow.net/questions/11631/complete-graph-invariants) that do not depend on any labelling (see [graph property](http://en.wikipedia.org/wiki/Graph_invariant) at Wikipedia), I wonder if there are graph invaria...
2010/04/22
[ "https://mathoverflow.net/questions/22184", "https://mathoverflow.net", "https://mathoverflow.net/users/2672/" ]
I'm not sure I understand the question well enough to know whether this is a reasonable answer. But a standard observation concerning the graph isomorphism problem is that there is an approach that feels as though it almost works: work out the eigenvalues and eigenvectors of the adjacency matrix. There is a small tec...
Though painfully slow to compute, I've yet to find a counterexample to the first invariant proposed in [this](http://arxiv.org/abs/math/0503316) paper by Mehendale: a vector of integers counting, for each n, the number of labeled subgraphs of G which are trees on n vertices. Update: I've since discovered several count...
16,454,723
How to Make a Game Like Cut the Rope using vrope class ??? my game is on cocos2d for iphone >> cut the rope
2013/05/09
[ "https://Stackoverflow.com/questions/16454723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2372875/" ]
Using **NSURLConnection** ,Try this ``` // Create the request. NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://cdn.cultofmac.com/wp-content/uploads/2013/03/colorware-iphone-5-xl.jpg"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutI...
Without using `NSURLConnection` you can easily download files, then no need to overhead delegate calls. Simply try this. ``` NSString *url = @"http://cdn.cultofmac.com/wp-content/uploads/2013/03/colorware-iphone-5-xl.jpg"; NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDom...
16,454,723
How to Make a Game Like Cut the Rope using vrope class ??? my game is on cocos2d for iphone >> cut the rope
2013/05/09
[ "https://Stackoverflow.com/questions/16454723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2372875/" ]
Using **NSURLConnection** ,Try this ``` // Create the request. NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://cdn.cultofmac.com/wp-content/uploads/2013/03/colorware-iphone-5-xl.jpg"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutI...
It would be good to do it asynchronously with NSURLConnection with blocks. ``` - (NSString *)documentsDirectoryPath{ NSArray *directories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, ...
74,556,541
i am not experienced working with docker and docker-compose, but atleast i know how to get a container running, below is my compose file of a simple react app boiler plate. my intention was to assign an IP to it so that i can ping it from the external network, and also to access it without any port mapping to the host ...
2022/11/24
[ "https://Stackoverflow.com/questions/74556541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20569584/" ]
Here is a one liner that will do the trick using `gsub()` ``` gsub(".*def.*(\\d+)\\)%ile.*%ile", "\\1", x, perl = TRUE) ``` Here's an approach that will work with any number of "%ile"s. Based on `str_split()` ``` x <- "abc(0)(1)%ile, def(2)(3)(4)%ile(5)%ile(9)%ile" x %>% str_split("def", simplify = TRUE) %>% ...
``` sub(".*?def.*?(\\d)\\)%ile.*", "\\1", x) [1] "4" ```
74,556,541
i am not experienced working with docker and docker-compose, but atleast i know how to get a container running, below is my compose file of a simple react app boiler plate. my intention was to assign an IP to it so that i can ping it from the external network, and also to access it without any port mapping to the host ...
2022/11/24
[ "https://Stackoverflow.com/questions/74556541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20569584/" ]
Here is a one liner that will do the trick using `gsub()` ``` gsub(".*def.*(\\d+)\\)%ile.*%ile", "\\1", x, perl = TRUE) ``` Here's an approach that will work with any number of "%ile"s. Based on `str_split()` ``` x <- "abc(0)(1)%ile, def(2)(3)(4)%ile(5)%ile(9)%ile" x %>% str_split("def", simplify = TRUE) %>% ...
You can use ```r x <- "abc(0)(1)%ile, def(2)(3)(4)%ile(5)%ile" library(stringr) result <- str_match(x, "\\bdef(?:\\((\\d+)\\))+%ile") result[,2] ``` See the [R demo online](https://ideone.com/lFnbgg) and the [regex demo](https://regex101.com/r/YBxCtZ/1). *Details*: * `\b` - word boundary * `def` - a `def` string *...
74,556,541
i am not experienced working with docker and docker-compose, but atleast i know how to get a container running, below is my compose file of a simple react app boiler plate. my intention was to assign an IP to it so that i can ping it from the external network, and also to access it without any port mapping to the host ...
2022/11/24
[ "https://Stackoverflow.com/questions/74556541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20569584/" ]
``` sub(".*?def.*?(\\d)\\)%ile.*", "\\1", x) [1] "4" ```
You can use ```r x <- "abc(0)(1)%ile, def(2)(3)(4)%ile(5)%ile" library(stringr) result <- str_match(x, "\\bdef(?:\\((\\d+)\\))+%ile") result[,2] ``` See the [R demo online](https://ideone.com/lFnbgg) and the [regex demo](https://regex101.com/r/YBxCtZ/1). *Details*: * `\b` - word boundary * `def` - a `def` string *...
473,455
Just wondering if there is any way to put emacs and shell in the same window. Like split the shell in to two parts, one for shell it self, the other one for emacs. Or is there any way to switch the shell window and emacs window quickly? The reason I am asking this is: sometimes I need to run my program with shell comm...
2012/09/11
[ "https://superuser.com/questions/473455", "https://superuser.com", "https://superuser.com/users/100570/" ]
Try enabling the `discard` mount option for an Ext4 filesystem and running a recent Linux kernel. This option is being used for SSDs mainly. At the same time it is being currently supported by [`zram`](https://www.kernel.org/doc/Documentation/blockdev/zram.txt) too.
Use fstrim command: `fstrim -v /tmp`
145,215
Which is the real one? What is the other one? How did I get it? ![screenshot](https://i.stack.imgur.com/rG0D8.jpg)
2014/09/14
[ "https://apple.stackexchange.com/questions/145215", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/3044/" ]
TL;DR: keep the one that looks like a bag, it is now a universal app. The cart one was the iPad specific one. Looks like the one of the left (with the shopping cart icon) is the old one. Launching it now directs me to the new one, but it didn't when I was trying to figure this out before. Here's what I get when launch...
The old iPad Store APP is obsolete and has been updated and replaced with this new one.
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
Your compassion is admirable but is not unique. Other answers have provided more detailed answers about grading, content prep and presentation, students 'earning' their grade and that is all true. Responsibility vs Accountability -------------------------------- With my answer I want to add to the discussion the poi...
I generally design my exams so that even a student with relatively limited understanding of the course can pass. I would really only consider a student who has achieved the highest grade (> 80%) to have a good understanding of the material, and I often see just-passing exams (50-60%) where I think that the student real...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
**You are responsible for teaching the students to the best of your ability, and to judge their capacities to use what they have learned**. That judgment is made based on their grades. So you have several things to think about here. 1. **Are you teaching the best you can?** Teaching does not mean "downloading facts", ...
Being put on academic probation was one of the best things that ever happened to me. I switched to community college, took art, music, and math classes, learned who I **really** was instead of who I **thought** I was, and eventually graduated with a Bachelor's and have had a lovely career doing things that are truly me...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
Being put on academic probation was one of the best things that ever happened to me. I switched to community college, took art, music, and math classes, learned who I **really** was instead of who I **thought** I was, and eventually graduated with a Bachelor's and have had a lovely career doing things that are truly me...
Here in Germany universities are quite strict. After my daughter failed the very last maths exam three times, she was out. However, strict does not mean heartless or planless. Her uni had an arrangement with the tech unis; one of them agreed to accept the exams she had already passed and enrol her in a similar course,...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
The other answers are great, but I want to stress one thing not really mentioned in other answers: **if you are concerned, talk to them before they fail**. Don't single them out for help because again it won't be fair, but still: tell them explicitly that if they continue performing as they have, they are going to fail...
Here in Germany universities are quite strict. After my daughter failed the very last maths exam three times, she was out. However, strict does not mean heartless or planless. Her uni had an arrangement with the tech unis; one of them agreed to accept the exams she had already passed and enrol her in a similar course,...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
Take the example of a medical student. Do you want to pass someone who does not have the necessary knowledge to treat patients correctly? It is your duty to make sure that only the ones who know what they are doing will pass. This may be less strict in other subjects but the principle is the same. --- EDIT --- Another...
Here's an added perspective: If you start passing students for non-academic reasons (or really even just start spending mental energy considering that), there is *no lower bound* to that concern. Wherever you decide to set your threshold, there will always be students further down academically. There will always be som...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
Take the example of a medical student. Do you want to pass someone who does not have the necessary knowledge to treat patients correctly? It is your duty to make sure that only the ones who know what they are doing will pass. This may be less strict in other subjects but the principle is the same. --- EDIT --- Another...
All things in life can cause you economic ruin these days. House mortgages, car loans, hacking, frauds. It is basically a society based on debt-based servitude where the banks are our overlords. You are likely just one well-meaning person in this huge mess and likely cannot affect this fact. As far as I know you also...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
Some of the discussion surrounding this question demonstrates that people are viewing it through two different implicit lenses, and I'd like to make them explicit. * **Considered as an act in isolation** A single decision to give a student a "kindly" mark has quite diffuse negative consequences. As long as we assume t...
Going to college in a country with high tuition fees is a risk. A potentially very huge risk. I think it is important to establish a scheme that makes sure that weak students notice this immediately. This means that in the very first year, it should become clear to the students whether they will make it or not.
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
I think you are trying to assume too much responsibility. The way you grade your students (assuming no malicious intent on your part) is not what is (possibly) causing their ruin. What might be causing it (besides, perhaps, some bad decisions of their own) is the system which forces them to go into debt or does not pr...
All things in life can cause you economic ruin these days. House mortgages, car loans, hacking, frauds. It is basically a society based on debt-based servitude where the banks are our overlords. You are likely just one well-meaning person in this huge mess and likely cannot affect this fact. As far as I know you also...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
Something other answers did not yet address - by giving unfairly good grades to undeserving students, ***you are dramatically, and unfairly, penalizing good students***. Students - in large part - choose to attend a university based on its academic reputation. Perhaps, paying premium. If your lax grading methods grad...
I generally design my exams so that even a student with relatively limited understanding of the course can pass. I would really only consider a student who has achieved the highest grade (> 80%) to have a good understanding of the material, and I often see just-passing exams (50-60%) where I think that the student real...
130,607
The issue has crept up on me slowly over the last several years. I am increasingly aware of the massive debt that many of my students are taking on, debt which is far beyond the sort of debt that I incurred as an undergraduate in the 1980s. Because of this, in recent semesters I have found it somewhat difficult to fail...
2019/05/15
[ "https://academia.stackexchange.com/questions/130607", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/72815/" ]
Take the example of a medical student. Do you want to pass someone who does not have the necessary knowledge to treat patients correctly? It is your duty to make sure that only the ones who know what they are doing will pass. This may be less strict in other subjects but the principle is the same. --- EDIT --- Another...
You're not failing the students. Assuming you performed your teaching job well, and you're grading them fairly, the students are failing themselves. They didn't study well enough to pass the class, or maybe they just don't have a talent for this material. Giving someone a passing grade when they haven't earned it is no...
8,411,466
I am using a way to insert some javascript code in the page which works with all browsers but not with IE. Here is a sample: <http://boxfly.free.fr/tmp/innerjs.html> The line which does not work properly with IE is: ``` ele.text = document.getElementById('DIV_js').innerHTML ; ``` If I change this line to: ``` ele....
2011/12/07
[ "https://Stackoverflow.com/questions/8411466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073500/" ]
The problem was that the example constructor needs this line at the top ``` parent::__construct ``` That should fix the issues you were having. So your constructor should look like: ``` public function __construct() { parent::__construct(); $this->load->library('session'); } ``` There is no need to store...
I had a very similar problem, you have to configure it as an object, in your \_construct as follow : ``` class Example extends CI_Controller { private $CI; public function __construct() { parent::__construct(); $this->CI =& get_instance(); $this->CI->load->library('session'); $oauth = array(); $oauth['oauth_to...
39,149,713
I'm writing a UI where the user can type in a search term and a list get continuously updated offering suggestions. My first though was that the Rx primitive Throttle was a perfect match but it gets me half there. The suggestions take a while to fetch so I get them asynchronously on not on the UI thread. The problem...
2016/08/25
[ "https://Stackoverflow.com/questions/39149713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381995/" ]
If you turn your async Task into an Observable, this looks like a classic use for `Switch`: ``` this.WhenAnyValue(x => x.FirstName, x => x.LastName ) .Throttle(TimeSpan.FromMilliseconds(100)) .Select(l => PopulateGrid().ToObservable()) .Switch() .Subscribe(vm => Results = vm); `...
If I understand what you want correctly, this can be done in a quite straight forward manner and clean if you refactor your code slightly. Firstly, make the first name and last name triggers into observables. In the code below, I have used subjects but it is better if you're able to use static Observable methods to 'c...
58,206,823
In my `ClientController@index`, I have a form with a select input to list every client in the database. After submitting the form to list detailed client information, the `URL` is like `/clients?client_id=id`. The routes are the defult with `route::resource()`. ``` <form name="show_client" id="show_client"> <d...
2019/10/02
[ "https://Stackoverflow.com/questions/58206823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1742421/" ]
Assuming `search` is in your `methods` it should not be using an arrow function as that will give you the wrong `this` binding. Instead use: ```js methods: { search: throttle(function (live) { // ... }, 500) } ``` Here I'm also assuming that `throttle` will preserve the `this` value, which would be typical...
Like I said in my comment, I suspect this is a scoping issue. Perhaps if you return the throttle function with the Vue component passed in, you might see better results: ``` search: function() { let vm = this; return throttle(live => { console.log("entered!!!"); console.log("this", this); console.lo...
401,773
Let $a\_1,\dots,a\_n$ be real numbers, and set $a\_{ij} = a\_ia\_j$. Consider the $n \times n$ matrix $A=(a\_{ij})$. Then 1. It is possible to choose $a\_1.\dots,a\_n$ such that $A$ is non-singular 2. matrix $A$ is positive definite if $(a\_1,\dots,a\_n)$ is nonzero vector 3. matrix $A$ is positive semi definite for a...
2013/05/25
[ "https://math.stackexchange.com/questions/401773", "https://math.stackexchange.com", "https://math.stackexchange.com/users/24690/" ]
It depends. With $a=(a\_1,\ldots,a\_n)$, we can more conveniently write $v\mapsto \langle a,v\rangle a$ instead of $v\mapsto Av$, which simplifies computations. 1. If $n=1$, then $a\_1=1$ is a valid choice and makes $A$ regular (the identity). For $n>1$, there exists nonzero $v$ with $\langle a,v\rangle = 0$, hence $A...
Here are a few comments: First, 4. implies that $A$ is always singular, answering 1. Follow Gerry Myerson's advice to prove 4 (basically, you are trying to show that the first two columns are linearly dependent). Now 2. cannot be true since 0 is an eigenvalue. Also, it may be helpful to think of $A$ as the product $...
5,371,869
**Please note:** While the bounty is no longer available, I'm still keen for anyone with an answer to this question to contribute; I'm still watching it, and I'm waiting to see if there is a better answer. Thanks, and please read on... --- I am looking for a way to convert an arbitrary set of [RCC](http://en.wikipedi...
2011/03/20
[ "https://Stackoverflow.com/questions/5371869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I don't know of any software that can generate such diagrams. However, If I had to tackle your problem I would probably explore the possibility of using [Scalable Vector Graphics (SVG)](http://en.wikipedia.org/wiki/Scalable_Vector_Graphics). I think you can translate your DSL for RCC into SVG XML, and then you can rend...
Have you evaluated antlr, You could define an EBNF grammar for RCC8. Use antlr to generate an item list. This item list can be used as an input to software like [VennMaster](http://www.informatik.uni-ulm.de/ni/mitarbeiter/HKestler/vennm/doc.html "VennMaster") for drawing diagrams. Other options are Goolge Charts , <...
5,371,869
**Please note:** While the bounty is no longer available, I'm still keen for anyone with an answer to this question to contribute; I'm still watching it, and I'm waiting to see if there is a better answer. Thanks, and please read on... --- I am looking for a way to convert an arbitrary set of [RCC](http://en.wikipedi...
2011/03/20
[ "https://Stackoverflow.com/questions/5371869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Who need's a backend? Here's a **working prototype** using HTML/CSS/JS: <http://jsfiddle.net/RuvE6/6/> Just enter the RCC8 code syntax in the field and hit the button! ![HTML/CSS/JS RCC8 Diagram Builder](https://i.stack.imgur.com/owghs.png) Some current limitations: * Doesn't handle ambiguity * There's no error ha...
Have you evaluated antlr, You could define an EBNF grammar for RCC8. Use antlr to generate an item list. This item list can be used as an input to software like [VennMaster](http://www.informatik.uni-ulm.de/ni/mitarbeiter/HKestler/vennm/doc.html "VennMaster") for drawing diagrams. Other options are Goolge Charts , <...
5,371,869
**Please note:** While the bounty is no longer available, I'm still keen for anyone with an answer to this question to contribute; I'm still watching it, and I'm waiting to see if there is a better answer. Thanks, and please read on... --- I am looking for a way to convert an arbitrary set of [RCC](http://en.wikipedi...
2011/03/20
[ "https://Stackoverflow.com/questions/5371869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Who need's a backend? Here's a **working prototype** using HTML/CSS/JS: <http://jsfiddle.net/RuvE6/6/> Just enter the RCC8 code syntax in the field and hit the button! ![HTML/CSS/JS RCC8 Diagram Builder](https://i.stack.imgur.com/owghs.png) Some current limitations: * Doesn't handle ambiguity * There's no error ha...
I don't know of any software that can generate such diagrams. However, If I had to tackle your problem I would probably explore the possibility of using [Scalable Vector Graphics (SVG)](http://en.wikipedia.org/wiki/Scalable_Vector_Graphics). I think you can translate your DSL for RCC into SVG XML, and then you can rend...
74,412,503
I don't know why when `a` is located in `def test()` it can not be found and gives the error > > UnboundLocalError: cannot access local variable 'a' where it is not associated with a value > > > ```py import keyboard import time a = 0 def test(): a+= 1 print("The number is now ", a) time.sleep(1) w...
2022/11/12
[ "https://Stackoverflow.com/questions/74412503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20485120/" ]
To access a global variable within a function you must specify it with global. Otherwise, the variable inside the function is a local variable that only has utility inside that function. That's why you get the error: "UnboundLocalError: local variable 'a' referenced before assignment". Inside the function you haven't d...
You need to pass a to the function test. Python thinks as the `a` in the function as a local variable. This will work: ``` import keyboard import time a = 0 def test(a=a): a+= 1 print("The number is now ", a) time.sleep(1) while keyboard.is_pressed('i') == False: test() ```
74,412,503
I don't know why when `a` is located in `def test()` it can not be found and gives the error > > UnboundLocalError: cannot access local variable 'a' where it is not associated with a value > > > ```py import keyboard import time a = 0 def test(): a+= 1 print("The number is now ", a) time.sleep(1) w...
2022/11/12
[ "https://Stackoverflow.com/questions/74412503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20485120/" ]
To access a global variable within a function you must specify it with global. Otherwise, the variable inside the function is a local variable that only has utility inside that function. That's why you get the error: "UnboundLocalError: local variable 'a' referenced before assignment". Inside the function you haven't d...
Python variables are scope based. This means one cannot access a value declared inside a function. But you can access a variable declared outside a function. This would fail: ``` def func(): a = 1 func() print(a) ``` this would print `1`: ``` def func(): print(a) a = 1 func() ``` Notice you can access ...
33,504,770
I have a `UIView` that contains buttons and labels. When these buttons are pressed, this `UIView` will become blur using the code below. ``` @IBOutlet weak var blurView: UIView! var blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark) var blurEffectView = UIVisualEffectView(effect: blurEffect) blurEffectView.fram...
2015/11/03
[ "https://Stackoverflow.com/questions/33504770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794575/" ]
It's hard to know exactly what is going on in your code, as you've clearly posted a cut up version (the last 4 lines are part of a method somewhere, presumably). You could do something like this to remove all `UIVisualEffectView` subviews from your `blurView`: ``` for subview in blurView.subviews { if subview is ...
``` func addBlurEffect(view: UIView, style: UIBlurEffect.Style) { view.backgroundColor = UIColor.clear let blurEffect = UIBlurEffect(style: style) let blurEffectView = UIVisualEffectView(effect: blurEffect) blurEffectView.frame = view.bounds blurEffectView.tag = 9 view.insertSubview(blurEffectV...
74,195,322
i have a quick question i'm trying to make an application but i've faced a problem, i want to assign data to a button then pass that data to datagridview when the button is clicked ex. [![enter image description here](https://i.stack.imgur.com/5T3di.png)](https://i.stack.imgur.com/5T3di.png) ``` private void TeaButto...
2022/10/25
[ "https://Stackoverflow.com/questions/74195322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20330704/" ]
Add the `max-width` property with the value of `{n}ch`. For example: `max-width: 100ch`. Then, apply `white-space: nowrap`, and `overflow: hidden` to remove the overflow characters. In order to add some dots at the end, add the `text-overflow: ellipsis` property. Any character after the value you defined will be remov...
Just do it with JS based on the value of the string. In base JS you can do something like this. In react you can do the same but in a useEffect, then store the string (truncated or not) as a state value. The example bellow will truncate a string that is > 20 characters long. To change that, just alter the two 20s to s...
160,224
I have a custom menu using `add_menu_page`: ``` add_menu_page('My menu' , 'Some text', 'read', 'nwcm'); ``` Under it, I show a custom post type menu item; ``` // Create the news custom post type register_post_type('nwcm_news', array( 'labels' => array( 'name' => __('News for clients', NWCM_TEXT_DOMAIN) ...
2014/09/04
[ "https://wordpress.stackexchange.com/questions/160224", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/7515/" ]
You have some messed up code. I have reformatted your code to code which actually works. The following solution allows you to give your Custom Post Type menu a menu name of what ever you want. Just change the label "menu\_name". **POST TYPE** ``` // Create the news custom post type register_post_type('nwcm_news', ...
Here is how i accomplished this: Inside of the admin\_menu action, I added a submenu item to the parent menu item ('nwcm') with the menu\_slug parameter set to the URL the taxonomy edit page. ``` add_submenu_page('nwcm', 'News categories', 'News categories', 'edit_posts', 'edit-tags.php?taxonomy=nwcm_news&post_type=nw...
64,127,599
So I've started learning vectors for the first time and wrote a simple program which goes like this: ``` #include <iostream> #include <vector> using namespace std; int main() { vector<int> g1; int n; cout<<"enter values"<<endl; do { cin>>n; g1.push_back(n); } while (n); ...
2020/09/29
[ "https://Stackoverflow.com/questions/64127599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12987935/" ]
That is the bad side of using `auto`. If you have no idea what the result of `auto` is, you get no idea why it is something totally different you expect! `std::vector::begin` delivers a `std::vector::iterator` and you can't compare it against an `size_type` value which is a result of `std::vector::size`. This type is ...
There are at least three ways to iterate through the contents of a vector. You can use an index: ``` for (int i = 0; i < vec.size(); ++i) std::cout << vec[i] << '\n'; ``` You can use iterators: ``` for (auto it = vec.begin(); it != vec.end(); ++it) std::cout << *it << '\n'; ``` You can use a range-based...
64,127,599
So I've started learning vectors for the first time and wrote a simple program which goes like this: ``` #include <iostream> #include <vector> using namespace std; int main() { vector<int> g1; int n; cout<<"enter values"<<endl; do { cin>>n; g1.push_back(n); } while (n); ...
2020/09/29
[ "https://Stackoverflow.com/questions/64127599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12987935/" ]
That is the bad side of using `auto`. If you have no idea what the result of `auto` is, you get no idea why it is something totally different you expect! `std::vector::begin` delivers a `std::vector::iterator` and you can't compare it against an `size_type` value which is a result of `std::vector::size`. This type is ...
`g1.begin()` returns an *iterator* to the 1st element, whereas `g1.size()` returns the *number* of elements. You can't compare an iterator to a size, which is why you are getting the error. It has nothing to do with your use of `auto`, it has to do with you comparing 2 different things that are unrelated to each other....
64,127,599
So I've started learning vectors for the first time and wrote a simple program which goes like this: ``` #include <iostream> #include <vector> using namespace std; int main() { vector<int> g1; int n; cout<<"enter values"<<endl; do { cin>>n; g1.push_back(n); } while (n); ...
2020/09/29
[ "https://Stackoverflow.com/questions/64127599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12987935/" ]
There are at least three ways to iterate through the contents of a vector. You can use an index: ``` for (int i = 0; i < vec.size(); ++i) std::cout << vec[i] << '\n'; ``` You can use iterators: ``` for (auto it = vec.begin(); it != vec.end(); ++it) std::cout << *it << '\n'; ``` You can use a range-based...
`g1.begin()` returns an *iterator* to the 1st element, whereas `g1.size()` returns the *number* of elements. You can't compare an iterator to a size, which is why you are getting the error. It has nothing to do with your use of `auto`, it has to do with you comparing 2 different things that are unrelated to each other....
58,479,855
``` dfs=[] for i in range(387): print(i) dfs.append(pd.DataFrame(0, index=range(121211), columns=range(31))) pd.concat(dfs,axis=1) #can only change this ``` In the code above, `pd.concat` is pretty slow, is there a way to make column join faster? assume I can only change the `pd.concat` part.
2019/10/21
[ "https://Stackoverflow.com/questions/58479855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497720/" ]
You are instantiating a very large dataframe all containing zero values. Rather than concatenate, just use the dataframe constructor with your desired index and columns. ``` dfs = pd.DataFrame( 0, index=range(121211), columns=list(range(31)) * 387 ) ``` For example (using a much smaller size dataframe)...
It seems that `generator` and `transposing` do the work faster. Beware that this code is RAM-hungry, so it is better to run both version separately. ``` import pandas as pd import timeit dfs=[] for i in range(387): print(i) dfs.append(pd.DataFrame(0, index=range(121211), columns=range(31))) #original start...
42,430,928
I did a lot of research before I post this question, but still cant figure out why I can't print a simple php value. My issue is that I'm trying to assign a value to an id, basically I want to assign the id that comes back from DataBase to button id. I'm able to print the values of id, name, email, but I can't assign t...
2017/02/24
[ "https://Stackoverflow.com/questions/42430928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5245070/" ]
You can't put `<?php` and `?>` inside of strings and then print them to execute their contents. Try this instead: ``` $table .= '<td><button id="' .$row['id'] . '" onclick="editUser()">Edit</button></td>'; ```
instead of line ``` $table .= '<td><button id = "<?php echo $row[\'id\']; ?>" onclick = "editUser()">Edit</button></td>'; ``` Try ``` $table .= '<td><button id = "' . $row['id'] . '" onclick = "editUser()">Edit</button></td>'; ```
42,430,928
I did a lot of research before I post this question, but still cant figure out why I can't print a simple php value. My issue is that I'm trying to assign a value to an id, basically I want to assign the id that comes back from DataBase to button id. I'm able to print the values of id, name, email, but I can't assign t...
2017/02/24
[ "https://Stackoverflow.com/questions/42430928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5245070/" ]
You can't put `<?php` and `?>` inside of strings and then print them to execute their contents. Try this instead: ``` $table .= '<td><button id="' .$row['id'] . '" onclick="editUser()">Edit</button></td>'; ```
Try this ``` $table .= '<td><button id ='. $row['id'] .' onclick = "editUser()">Edit</button></td>'; ```
42,430,928
I did a lot of research before I post this question, but still cant figure out why I can't print a simple php value. My issue is that I'm trying to assign a value to an id, basically I want to assign the id that comes back from DataBase to button id. I'm able to print the values of id, name, email, but I can't assign t...
2017/02/24
[ "https://Stackoverflow.com/questions/42430928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5245070/" ]
instead of line ``` $table .= '<td><button id = "<?php echo $row[\'id\']; ?>" onclick = "editUser()">Edit</button></td>'; ``` Try ``` $table .= '<td><button id = "' . $row['id'] . '" onclick = "editUser()">Edit</button></td>'; ```
Try this ``` $table .= '<td><button id ='. $row['id'] .' onclick = "editUser()">Edit</button></td>'; ```
46,622,473
i use [multer](/questions/tagged/multer "show questions tagged 'multer'") according to it's readme file in github it's readme said call multer in [middleware](/questions/tagged/middleware "show questions tagged 'middleware'") like this: **app.js** ``` var multer = require('multer') app.post('/upload', upload.sin...
2017/10/07
[ "https://Stackoverflow.com/questions/46622473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8455506/" ]
Since rails expects your module naming to follow your file structure, your concern should be named: ``` module Api::Concerns::ErrorSerializer ``` Since you're including it in `Api::TemplatesController`, I would do: ``` class Api::TemplatesController < ApiController include Api::Concerns::ErrorSerializer ... end...
Thanks to the answer from @jvillian and [this blog post](http://jordifierro.com/rails-apicontroller-and-concerns), I was able to figure out the 'Rails' way to do this (since actually I will need the concern in all Api controllers, and also my api controller was outside the api namespace). So I'm posting this solution a...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
There are no strong typedefs in C++11. There is support for units with `<chrono>` but that is a totally different thing. Nobody can agree on what behaviour strong typedefs should have, exactly, so there has never been a proposal for them that got anywhere, so not only are they in neither C++11 nor C++14, there is no re...
C++ compilers generally expect the command line option `-std=c++11` (or `-std=c++0x` for slightly older ones, respectively) to activate C++11-support. > > not supporting C++11 style at all. > > > No, it perfectly does. GCC 4.7.2's support can be [checked here](https://gcc.gnu.org/gcc-4.7/cxx0x_status.html). To ac...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
There are several ways to solve this, but since I was looking for a fix to Bjarne's code in the presentation slides, I'm accepting this answer which @robson3.14 left in comments to the question: ``` #include <iostream> template<int M, int K, int S> struct Unit { // a unit in the MKS system enum { m=M, kg=K, s=S }...
C++ compilers generally expect the command line option `-std=c++11` (or `-std=c++0x` for slightly older ones, respectively) to activate C++11-support. > > not supporting C++11 style at all. > > > No, it perfectly does. GCC 4.7.2's support can be [checked here](https://gcc.gnu.org/gcc-4.7/cxx0x_status.html). To ac...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
C++ compilers generally expect the command line option `-std=c++11` (or `-std=c++0x` for slightly older ones, respectively) to activate C++11-support. > > not supporting C++11 style at all. > > > No, it perfectly does. GCC 4.7.2's support can be [checked here](https://gcc.gnu.org/gcc-4.7/cxx0x_status.html). To ac...
One alternative that does not involve typedef and is not strongly enforced by the compiler but makes it very hard for the programmer to make mistakes it to encode the unit in question as a struct member. For my arduino project I have types like ``` template <typename T> struct millisecond { T millisecond; sta...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
There are no strong typedefs in C++11. There is support for units with `<chrono>` but that is a totally different thing. Nobody can agree on what behaviour strong typedefs should have, exactly, so there has never been a proposal for them that got anywhere, so not only are they in neither C++11 nor C++14, there is no re...
Not sure this is what you want, it is ugly, but it works :) You can wrap the type into a template class, ``` template <typename T, int N> // N is used for tagging struct strong_typedef { using strong_type = strong_typedef<T,N>; // typedef for the strong type using type = T; // the wrapped type T value; // ...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
There are no strong typedefs in C++11. There is support for units with `<chrono>` but that is a totally different thing. Nobody can agree on what behaviour strong typedefs should have, exactly, so there has never been a proposal for them that got anywhere, so not only are they in neither C++11 nor C++14, there is no re...
One alternative that does not involve typedef and is not strongly enforced by the compiler but makes it very hard for the programmer to make mistakes it to encode the unit in question as a struct member. For my arduino project I have types like ``` template <typename T> struct millisecond { T millisecond; sta...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
There are several ways to solve this, but since I was looking for a fix to Bjarne's code in the presentation slides, I'm accepting this answer which @robson3.14 left in comments to the question: ``` #include <iostream> template<int M, int K, int S> struct Unit { // a unit in the MKS system enum { m=M, kg=K, s=S }...
Not sure this is what you want, it is ugly, but it works :) You can wrap the type into a template class, ``` template <typename T, int N> // N is used for tagging struct strong_typedef { using strong_type = strong_typedef<T,N>; // typedef for the strong type using type = T; // the wrapped type T value; // ...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
Not sure this is what you want, it is ugly, but it works :) You can wrap the type into a template class, ``` template <typename T, int N> // N is used for tagging struct strong_typedef { using strong_type = strong_typedef<T,N>; // typedef for the strong type using type = T; // the wrapped type T value; // ...
One alternative that does not involve typedef and is not strongly enforced by the compiler but makes it very hard for the programmer to make mistakes it to encode the unit in question as a struct member. For my arduino project I have types like ``` template <typename T> struct millisecond { T millisecond; sta...
23,726,044
After being a MATLAB user for many years, I am now migrating to python. I try to find a concise manner to simply rewrite the following MATLAB code in python: ``` s = sum(Mtx); newMtx = Mtx(:, s>0); ``` where Mtx is a 2D sparse matrix My python solution is: ``` s = Mtx.sum(0) newMtx = Mtx[:, np.where((s>0).flat)[0...
2014/05/18
[ "https://Stackoverflow.com/questions/23726044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2476373/" ]
There are several ways to solve this, but since I was looking for a fix to Bjarne's code in the presentation slides, I'm accepting this answer which @robson3.14 left in comments to the question: ``` #include <iostream> template<int M, int K, int S> struct Unit { // a unit in the MKS system enum { m=M, kg=K, s=S }...
One alternative that does not involve typedef and is not strongly enforced by the compiler but makes it very hard for the programmer to make mistakes it to encode the unit in question as a struct member. For my arduino project I have types like ``` template <typename T> struct millisecond { T millisecond; sta...
12,243,560
I have tried the below program. It is working in eclipse -> if u give lattitude and longitude value through ddms means it displayed in emulator as current position.... but its not detecting current position in android phone. ``` private class mylocationlistener implements LocationListener { public void onLocatio...
2012/09/03
[ "https://Stackoverflow.com/questions/12243560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1642978/" ]
I made one service for that. It is easy for get Longitude / Latitude using it. Copy/paste this class in your project. ``` package com.sample; import com.sample.globalconstant; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Locatio...
If you want to overlay of your current location then it is better to use default method instead of custom overlay.. Here is default overlay method of current location. ``` MyLocationOverlay mMyLocationOverlay = new MyLocationOverlay(getApplicationContext(), Your_MapView); mMyLocationOverlay.enableMyLo...
12,243,560
I have tried the below program. It is working in eclipse -> if u give lattitude and longitude value through ddms means it displayed in emulator as current position.... but its not detecting current position in android phone. ``` private class mylocationlistener implements LocationListener { public void onLocatio...
2012/09/03
[ "https://Stackoverflow.com/questions/12243560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1642978/" ]
I made one service for that. It is easy for get Longitude / Latitude using it. Copy/paste this class in your project. ``` package com.sample; import com.sample.globalconstant; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Locatio...
you can use this [Example for Finding Location Periodically](https://github.com/commonsguy/cwac-locpoll)
12,243,560
I have tried the below program. It is working in eclipse -> if u give lattitude and longitude value through ddms means it displayed in emulator as current position.... but its not detecting current position in android phone. ``` private class mylocationlistener implements LocationListener { public void onLocatio...
2012/09/03
[ "https://Stackoverflow.com/questions/12243560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1642978/" ]
I made one service for that. It is easy for get Longitude / Latitude using it. Copy/paste this class in your project. ``` package com.sample; import com.sample.globalconstant; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Locatio...
Is it possible that your android phone is not getting a GPS signal? locationManager.getLastKnownLocation will return null if the GPS has not had time to get a fix yet. Android does not provide a 'give me the location now' method. When the GPS has got a fix, the onLocationChanged() will run. If it is fine with emulator,...
588,732
I am using OSX 10.7.5 and my OSX is becoming a bit unresponsive, comparing to what it was like before. Sometimes just opening new window of browser or terminal takes few seconds or the Dock hovering effect is not fluent. At these moments I watch system resources and I still have 3G of memory free and the processor is n...
2013/04/28
[ "https://superuser.com/questions/588732", "https://superuser.com", "https://superuser.com/users/128678/" ]
Use `top` to monitor system resources. As you mention issues with opening the browser possibly there is malware active or some other agent which is causing unwarranted network activity. To monitor this use-: ``` ifconfig -a # for the network interface name to monitor ``` then ``` tcpdump -i <interface> ``` An al...
Check the logs for clues. Even a high volume of relatively harmless error messages (itself an error!), could swamp your response time. Edit: /var/log/system.log and /var/log/kernel.log would be most likely. Or open the Console app in Utilities and show all messages.
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
I don't believe you *can* get that information directly from MATLAB, short of printing something with each iteration and counting these lines by hand. To see why, recall that each `parfor` iteration executes in its own workspace: while incrementing a counter within the loop is legal, accessing its "current" value is n...
Try this FEX file: <http://www.mathworks.com/matlabcentral/fileexchange/32101-progress-monitor--progress-bar--that-works-with-parfor> You can easily modify it to return the iteration number instead of displaying a progress bar.
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
With Matlab 2017a or later you can use a [data queue](https://se.mathworks.com/help/distcomp/parallel.pool.dataqueue.html) or a [pollable data queue](https://se.mathworks.com/help/distcomp/parallel.pool.pollabledataqueue.html) to achieve this. Here's the MathWorks documentation example of how to do a progress bar from ...
I created a utility to do this: <http://www.mathworks.com/matlabcentral/fileexchange/48705-drdan14-parforprogress>
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
I don't believe you *can* get that information directly from MATLAB, short of printing something with each iteration and counting these lines by hand. To see why, recall that each `parfor` iteration executes in its own workspace: while incrementing a counter within the loop is legal, accessing its "current" value is n...
I created a utility to do this: <http://www.mathworks.com/matlabcentral/fileexchange/48705-drdan14-parforprogress>
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
Something like a progress bar could be done similar to this... Before the `parfor` loop : ``` fprintf('Progress:\n'); fprintf(['\n' repmat('.',1,m) '\n\n']); ``` And during the loop: ``` fprintf('\b|\n'); ``` Here we have `m` is the total number of iterations, the `.` shows the total number of iterations and `|`...
If you just want to know how much time is left approximately, you can run the program once record the max time and then do this ``` tStart = tic; parfor i=1:n tElapsed = toc(tStart;) disp(['Time left in min ~ ', num2str( ( tMax - tElapsed ) / 60 ) ]); ... end ```
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
I don't believe you *can* get that information directly from MATLAB, short of printing something with each iteration and counting these lines by hand. To see why, recall that each `parfor` iteration executes in its own workspace: while incrementing a counter within the loop is legal, accessing its "current" value is n...
Something like a progress bar could be done similar to this... Before the `parfor` loop : ``` fprintf('Progress:\n'); fprintf(['\n' repmat('.',1,m) '\n\n']); ``` And during the loop: ``` fprintf('\b|\n'); ``` Here we have `m` is the total number of iterations, the `.` shows the total number of iterations and `|`...
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
Try this FEX file: <http://www.mathworks.com/matlabcentral/fileexchange/32101-progress-monitor--progress-bar--that-works-with-parfor> You can easily modify it to return the iteration number instead of displaying a progress bar.
If you just want to know how much time is left approximately, you can run the program once record the max time and then do this ``` tStart = tic; parfor i=1:n tElapsed = toc(tStart;) disp(['Time left in min ~ ', num2str( ( tMax - tElapsed ) / 60 ) ]); ... end ```
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
Try this FEX file: <http://www.mathworks.com/matlabcentral/fileexchange/32101-progress-monitor--progress-bar--that-works-with-parfor> You can easily modify it to return the iteration number instead of displaying a progress bar.
I created a utility to do this: <http://www.mathworks.com/matlabcentral/fileexchange/48705-drdan14-parforprogress>
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
With Matlab 2017a or later you can use a [data queue](https://se.mathworks.com/help/distcomp/parallel.pool.dataqueue.html) or a [pollable data queue](https://se.mathworks.com/help/distcomp/parallel.pool.pollabledataqueue.html) to achieve this. Here's the MathWorks documentation example of how to do a progress bar from ...
If you just want to know how much time is left approximately, you can run the program once record the max time and then do this ``` tStart = tic; parfor i=1:n tElapsed = toc(tStart;) disp(['Time left in min ~ ', num2str( ( tMax - tElapsed ) / 60 ) ]); ... end ```
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
I don't believe you *can* get that information directly from MATLAB, short of printing something with each iteration and counting these lines by hand. To see why, recall that each `parfor` iteration executes in its own workspace: while incrementing a counter within the loop is legal, accessing its "current" value is n...
If you just want to know how much time is left approximately, you can run the program once record the max time and then do this ``` tStart = tic; parfor i=1:n tElapsed = toc(tStart;) disp(['Time left in min ~ ', num2str( ( tMax - tElapsed ) / 60 ) ]); ... end ```
6,989,102
I am running a parfor loop in Matlab that takes a lot of time and I would like to know how many iterations are left. How can I get that info?
2011/08/08
[ "https://Stackoverflow.com/questions/6989102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27943/" ]
Something like a progress bar could be done similar to this... Before the `parfor` loop : ``` fprintf('Progress:\n'); fprintf(['\n' repmat('.',1,m) '\n\n']); ``` And during the loop: ``` fprintf('\b|\n'); ``` Here we have `m` is the total number of iterations, the `.` shows the total number of iterations and `|`...
I created a utility to do this: <http://www.mathworks.com/matlabcentral/fileexchange/48705-drdan14-parforprogress>
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
Since I didn't notice the "without jQuery" in the original question, here is a new answer: ``` var request = new XMLHttpRequest(); request.open('GET', './test.json', true); request.onload = function() { if (request.status >= 200 && request.status < 400) { // Success! var data = JSON.parse(request.responseTe...
Before you can even do anything with your JSON file, you need to load it. jQuery has a shortcut, which will even automatically parse the JSON-string into a native JS object for you: ``` $.getJSON('./test.json', function(data) { console.dir(data); }); ``` <https://api.jquery.com/jquery.getjson/>
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
I just need to fill my array "groups" like that : ``` [{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }] ``` with a json file and without jquery
Before you can even do anything with your JSON file, you need to load it. jQuery has a shortcut, which will even automatically parse the JSON-string into a native JS object for you: ``` $.getJSON('./test.json', function(data) { console.dir(data); }); ``` <https://api.jquery.com/jquery.getjson/>
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
The value of `groups` is not valid JSON: string values should be surrounded by double-quote marks, and so should keys. The file with valid JSON in that string would look like this: ``` { "groups": "[{ \"id\": 1, \"title\": \"group 1\" }, { \"id\": 2, \"title\": \"group 2\" }]" } ``` Of course if you have control o...
Since I didn't notice the "without jQuery" in the original question, here is a new answer: ``` var request = new XMLHttpRequest(); request.open('GET', './test.json', true); request.onload = function() { if (request.status >= 200 && request.status < 400) { // Success! var data = JSON.parse(request.responseTe...
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
I just need to fill my array "groups" like that : ``` [{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }] ``` with a json file and without jquery
if you can't edit original text, you need replace ' to " and then did `JSON.parse(json.groups)`; otherwise you can change a little your json like this: ``` JSON.parse('[{ "id": 1, "title": "group 1" }, { "id": 2, "title": "group 2" }]') ``` be careful with " and ' parentheses ``` { "key":"string" } ``` string ...
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
Since I didn't notice the "without jQuery" in the original question, here is a new answer: ``` var request = new XMLHttpRequest(); request.open('GET', './test.json', true); request.onload = function() { if (request.status >= 200 && request.status < 400) { // Success! var data = JSON.parse(request.responseTe...
You can parse the object to an array this way: `Object.values(YOUR_OBJECT)` docs: <https://developer.mozilla.org/es/docs/Web/JavaScript/Referencia/Objetos_globales/Object/values>
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
The value of `groups` is not valid JSON: string values should be surrounded by double-quote marks, and so should keys. The file with valid JSON in that string would look like this: ``` { "groups": "[{ \"id\": 1, \"title\": \"group 1\" }, { \"id\": 2, \"title\": \"group 2\" }]" } ``` Of course if you have control o...
Before you can even do anything with your JSON file, you need to load it. jQuery has a shortcut, which will even automatically parse the JSON-string into a native JS object for you: ``` $.getJSON('./test.json', function(data) { console.dir(data); }); ``` <https://api.jquery.com/jquery.getjson/>
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
The value of `groups` is not valid JSON: string values should be surrounded by double-quote marks, and so should keys. The file with valid JSON in that string would look like this: ``` { "groups": "[{ \"id\": 1, \"title\": \"group 1\" }, { \"id\": 2, \"title\": \"group 2\" }]" } ``` Of course if you have control o...
if you can't edit original text, you need replace ' to " and then did `JSON.parse(json.groups)`; otherwise you can change a little your json like this: ``` JSON.parse('[{ "id": 1, "title": "group 1" }, { "id": 2, "title": "group 2" }]') ``` be careful with " and ' parentheses ``` { "key":"string" } ``` string ...
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
The value of `groups` is not valid JSON: string values should be surrounded by double-quote marks, and so should keys. The file with valid JSON in that string would look like this: ``` { "groups": "[{ \"id\": 1, \"title\": \"group 1\" }, { \"id\": 2, \"title\": \"group 2\" }]" } ``` Of course if you have control o...
I just need to fill my array "groups" like that : ``` [{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }] ``` with a json file and without jquery
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
Since I didn't notice the "without jQuery" in the original question, here is a new answer: ``` var request = new XMLHttpRequest(); request.open('GET', './test.json', true); request.onload = function() { if (request.status >= 200 && request.status < 400) { // Success! var data = JSON.parse(request.responseTe...
if you can't edit original text, you need replace ' to " and then did `JSON.parse(json.groups)`; otherwise you can change a little your json like this: ``` JSON.parse('[{ "id": 1, "title": "group 1" }, { "id": 2, "title": "group 2" }]') ``` be careful with " and ' parentheses ``` { "key":"string" } ``` string ...
54,112,731
I very new to programming and I can't find the solution of my issue, can you give me the solution please? I have this JSON file: ``` { "groups": "[{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]" } ``` And I need something like this in my js (but i want import my JSON to get array like this) : ``` cons...
2019/01/09
[ "https://Stackoverflow.com/questions/54112731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10890347/" ]
The value of `groups` is not valid JSON: string values should be surrounded by double-quote marks, and so should keys. The file with valid JSON in that string would look like this: ``` { "groups": "[{ \"id\": 1, \"title\": \"group 1\" }, { \"id\": 2, \"title\": \"group 2\" }]" } ``` Of course if you have control o...
You can parse the object to an array this way: `Object.values(YOUR_OBJECT)` docs: <https://developer.mozilla.org/es/docs/Web/JavaScript/Referencia/Objetos_globales/Object/values>
3,214
For Category theory there is a well known and quite active research mailing list <https://www.mta.ca/~cat-dist/> Do similar mailing lists or usenet groups exist for other branches of mathematics? For example in metric geometry, conformal geometry,... Or do most research related discussions now take place on MO?
2017/04/18
[ "https://meta.mathoverflow.net/questions/3214", "https://meta.mathoverflow.net", "https://meta.mathoverflow.net/users/54495/" ]
Here is a list of some mailing list for specific areas of mathematics. (This is posted as a [community wiki](https://meta.mathoverflow.net/tags/community-wiki/info), if you are aware of some other mailings lists, do not hesitate to add them to the list. And also if you have some additional useful information related to...
Sci.math, sci.math.research, alt.sci.(whatever) are some of the newsgroups that dealt with mathematics and various branches. You can find histories of them and other information on them with web searches. The unmoderated groups became spam wastelands, especially after Google instituted their version called Google Grou...
9,439,136
I have set up the code to call a remote server from Android app to a remote server. Here is the code: ``` private class DownloadWebPageTask extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... theParams) { Log.d( "Inner class: " , "Doing st...
2012/02/24
[ "https://Stackoverflow.com/questions/9439136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/731255/" ]
This is **not** secure. Your URL is passed through the internet most likely through several hops unencrypted. It is trivially simple to sniff these requests. The simplest way is to send this data in the message body using HttpPost and use HTTPS. If you must use HTTP, try [digest authentication](http://en.wikipedia.org/...
Had to answer just to comment on Heesham Saeed's "answer" (which is actually a directive to screw any sense of security your App may ever have): A mobile phone (android included) might be a smokescreen to simple-minded people but it is NOT a black-box that someone with technical ability cannot see into. The URL sent b...
30,658,916
When I execute the following code, it returns non-standard characters, so how do we remove it or get original string? ``` header('Content-type: text/html; charset=utf-8'); $String = "à¸?่อตั้งเมื่อ"; echo $String; ``` Output : `�?่อตั้งเมื่อ` Need actual result : `ก่อตั้งเมื่อ`
2015/06/05
[ "https://Stackoverflow.com/questions/30658916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1979522/" ]
Your string, `�่อตั้งเมื่อ` is not valid utf-8. That is why the `�` shows up - the browser does not know how to interpret it. As others have indicated, the question mark on the third position likely is the problem. The first three bytes of the erroneous string are `e0 b8 3f` (`3f` being the a...
You mentioned character encdoing as utf-8, where as the string is not encoded as utf-8. That's the reason that "?" mark is appearing in the output instead of the intended one.
30,658,916
When I execute the following code, it returns non-standard characters, so how do we remove it or get original string? ``` header('Content-type: text/html; charset=utf-8'); $String = "à¸?่อตั้งเมื่อ"; echo $String; ``` Output : `�?่อตั้งเมื่อ` Need actual result : `ก่อตั้งเมื่อ`
2015/06/05
[ "https://Stackoverflow.com/questions/30658916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1979522/" ]
Your string, `�่อตั้งเมื่อ` is not valid utf-8. That is why the `�` shows up - the browser does not know how to interpret it. As others have indicated, the question mark on the third position likely is the problem. The first three bytes of the erroneous string are `e0 b8 3f` (`3f` being the a...
First of all, to not be confused by encodings problem, you really want to read the following article: <http://kunststube.net/encoding/> Second, I just have done the following: ``` $ vim ~/sandbox/php/encoding.php ( inserted your code verbatim ) $ cd ~/sandbox/php/ $ php -S localhost:1200 ``` After I opened in Firef...