qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
In my humble opinion with Phonegap you can just develope simple apps, nothing more. The documentation is not enough and like others have said you will spend much more time fixing bugs and finding plugins than building your app. I would make the effort to learn Android or iOS or whatever, look at it as an **investment**...
check out using [ionic](http://ionicframework.com/), backed by angular.js to offset some of the cons mentioned in the accepted answer. Tutorial for launching an employee directory app: <http://coenraets.org/blog/2014/02/sample-mobile-application-with-ionic-and-angularjs/>
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
@Gajotres wrote a great response, but hybrid app performance has come a long way since 2012. I answered a [related question](https://stackoverflow.com/q/43551246/3305145) that covers the difference between hybrid and native app development in 2017. The moral of the story is that hybrid app development has improved tre...
I also find a every good article here <http://www.comentum.com/phonegap-vs-native-app-development.html>, it compares these two ways in different categories. The summary is as below: 1. **Design of Interfaces** (Same) 2. **Cost** (Hybrid has Advantage) 3. **Development Timeline** (Hybrid has Advantage) 4. **User Expe...
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
Last I looked into it PhoneGap was all html,css, and javascript. So, you may feel right at home. PhoneGap can handle GPS location, see [this article from PhoneGap's documentation.](http://docs.phonegap.com/en/1.0.0/phonegap_geolocation_geolocation.md.html) Whether or not you want to pick up Objective C would depend on ...
@Gajotres wrote a great response, but hybrid app performance has come a long way since 2012. I answered a [related question](https://stackoverflow.com/q/43551246/3305145) that covers the difference between hybrid and native app development in 2017. The moral of the story is that hybrid app development has improved tre...
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
In my humble opinion with Phonegap you can just develope simple apps, nothing more. The documentation is not enough and like others have said you will spend much more time fixing bugs and finding plugins than building your app. I would make the effort to learn Android or iOS or whatever, look at it as an **investment**...
Last I looked into it PhoneGap was all html,css, and javascript. So, you may feel right at home. PhoneGap can handle GPS location, see [this article from PhoneGap's documentation.](http://docs.phonegap.com/en/1.0.0/phonegap_geolocation_geolocation.md.html) Whether or not you want to pick up Objective C would depend on ...
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
@Gajotres wrote a great response, but hybrid app performance has come a long way since 2012. I answered a [related question](https://stackoverflow.com/q/43551246/3305145) that covers the difference between hybrid and native app development in 2017. The moral of the story is that hybrid app development has improved tre...
One overlooked of the great options here is development with **Xamarin**. Though it doesn't help to utilize OP's web developer skills, it has many pros compared to PhoneGap and almost no cons. Xamarin vs PhoneGap Pros: ------------------------- * Mature framework providing access to the most (if not all) native feat...
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
@Gajotres wrote a great response, but hybrid app performance has come a long way since 2012. I answered a [related question](https://stackoverflow.com/q/43551246/3305145) that covers the difference between hybrid and native app development in 2017. The moral of the story is that hybrid app development has improved tre...
There's also AppGyver Steroids that unites PhoneGap and Native UI very well. With Steroids you can add things like native tabs, native navigation bar, native animations and transitions, native modal windows, native drawer/panel (facebooks side menu) etc. to your PhoneGap app. Basically, anywhere CSS + JS don't cut it,...
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
In my humble opinion with Phonegap you can just develope simple apps, nothing more. The documentation is not enough and like others have said you will spend much more time fixing bugs and finding plugins than building your app. I would make the effort to learn Android or iOS or whatever, look at it as an **investment**...
I also find a every good article here <http://www.comentum.com/phonegap-vs-native-app-development.html>, it compares these two ways in different categories. The summary is as below: 1. **Design of Interfaces** (Same) 2. **Cost** (Hybrid has Advantage) 3. **Development Timeline** (Hybrid has Advantage) 4. **User Expe...
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
In my humble opinion with Phonegap you can just develope simple apps, nothing more. The documentation is not enough and like others have said you will spend much more time fixing bugs and finding plugins than building your app. I would make the effort to learn Android or iOS or whatever, look at it as an **investment**...
@Gajotres wrote a great response, but hybrid app performance has come a long way since 2012. I answered a [related question](https://stackoverflow.com/q/43551246/3305145) that covers the difference between hybrid and native app development in 2017. The moral of the story is that hybrid app development has improved tre...
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
if your application does't have animation effects and simple i prefer to create in a web(Phonegap) cz at less amount of time we can launch in multiple types of mobile OS. if your app contain more UI effects and animation then it is best to go with native.. even though you develop in webview(Phonegap) you need learn s...
check out using [ionic](http://ionicframework.com/), backed by angular.js to offset some of the cons mentioned in the accepted answer. Tutorial for launching an employee directory app: <http://coenraets.org/blog/2014/02/sample-mobile-application-with-ionic-and-angularjs/>
14,065,610
I'm going to make a native (meaning; *not* in the browser) mobile app. Since I'm a web-developer I'm struggling to decide whether or not I should try Phonegap or just build an native app in java or objective-c. The app requirements are simple. GPS/wifi location, Facebook integration and I guess I'll need a database to...
2012/12/28
[ "https://Stackoverflow.com/questions/14065610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549320/" ]
Related: ======== Larger version of this article can also be found **[HERE](http://www.gajotres.net/hybrid-vs-native-apps/)**, to be transparent it is my personal blog. Hybrid vs Native apps ===================== Hybrid apps: **Pro:** * Quicker development, especially if you're a a longtime web developer. * 1 lang...
check out using [ionic](http://ionicframework.com/), backed by angular.js to offset some of the cons mentioned in the accepted answer. Tutorial for launching an employee directory app: <http://coenraets.org/blog/2014/02/sample-mobile-application-with-ionic-and-angularjs/>
10,247,440
I want to do like 'a' + 2 = 'c', so I wrote: ``` ('a'.ord + 2).chr ``` And yes I get 'c'. But it looks so redundant. Is there any better straight way to do it? Using 1.9.3
2012/04/20
[ "https://Stackoverflow.com/questions/10247440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1270003/" ]
Well a *really, really bad* way to do it would be like this: ``` class String alias_method :original_plus, :+ def +(other) if self.length == 1 and other.is_a?(Fixnum) (self.ord + other).chr else original_plus(other) end end end puts 'a' + 2 => c ```
There is not a universally 'better' way to do it (given some random definition of 'better'; mine may not match yours). That's my real answer: **do what you are doing**. For fun, however, you could do this *inefficient* monkeypatch that does not step through integer land: ``` class String alias_method :__succ,:succ ...
51,196,657
How to do to select items that have certain criteria and soon after convert to queue? ``` public class Assinante { public int ID { get; set; } public string Nome { get; set; } public string Email { get; set; } public string CPF { get; set; } public string NossoNumero { get; ...
2018/07/05
[ "https://Stackoverflow.com/questions/51196657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9382248/" ]
This is almost certainly a case of logical operator precedence. In C#, the Logical AND (`&&`) takes precedence over Logical OR (`||`). This should help you understand: ``` bool result = true || true && false; // --> true bool result = (true || true) && false; // --> false bool result = true || (true && false); //...
The use of logical operators seems to be incorrect, you can try this revised query. ``` return new Queue<Assinante>(assinantes.Where(x => !(x.Pendente = Status.Sent || x.Pendente = Status.NotFound || string.IsNullOrEmpty(x.Email) || string.IsNullOrEmpty(x.NossoNumero)))); ``` If y...
60,525,277
I have a valid Here licence and I have been using it for long time. Suddenly I had the above response from server. The url is: <http://pde.api.here.com/2/matchroute.json?app_id=xxxxxxxxxxxxxxx&app_code=xxxxxxxxxxxx&routemode=car&file=&regions=WEU&release=LATEST> ``` def connectPost(self, url, data, headers=None): ...
2020/03/04
[ "https://Stackoverflow.com/questions/60525277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12159543/" ]
As per the licensing, and delivery back-end system The account has expired that's why. Cheers, WaliedCheetos
Try please this python code(it works properly for me) ``` # Hello World program in Python import requests import json data = bytes("\n".join([ 'LATITUDE,LONGITUDE', '50.875182,4.499943', '50.875240,4.499935', '50.875302,4.499920', '50.875375,4.499893', '50.875450,4.499854', '50.875527,4.499799', '50.8...
5,555
I'm trying to add code to my themes functions.php to display fields created with the Cimy user extra fields plugin in the dashboard users.php. I know that I need to use manage\_users\_columns, but beyond that I'm stuck. Anyone familiar enough with the plugin to help me get the proper fields to display?
2010/12/17
[ "https://wordpress.stackexchange.com/questions/5555", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/2041/" ]
You might be probably looking for a plugin that offer's groupon-like functionality ([“Groupon 1.0 started on a WordPress blog.”](http://www.tomloverro.com/2010/08/19/groupon-1-0-started-on-a-wordpress-blog/)). By googling I learned that there is a plugin called [WP Coupon (Wordpress Plugin)](http://www.wpcoupon.com/) ...
First figure out how you want your coupons displayed. For simple printouts you can apply a css style-sheet for a printer friendly version, but I'm assuming you want a better coupon maybe with an actual bar code in it. In that case you want to have a pdf printer friendly coupon, since it the most popular format for pri...
5,555
I'm trying to add code to my themes functions.php to display fields created with the Cimy user extra fields plugin in the dashboard users.php. I know that I need to use manage\_users\_columns, but beyond that I'm stuck. Anyone familiar enough with the plugin to help me get the proper fields to display?
2010/12/17
[ "https://wordpress.stackexchange.com/questions/5555", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/2041/" ]
You might be probably looking for a plugin that offer's groupon-like functionality ([“Groupon 1.0 started on a WordPress blog.”](http://www.tomloverro.com/2010/08/19/groupon-1-0-started-on-a-wordpress-blog/)). By googling I learned that there is a plugin called [WP Coupon (Wordpress Plugin)](http://www.wpcoupon.com/) ...
I used [this](http://lesterchan.net/wordpress/readme/wp-print.html) plugin in a similar situation. It auto generats a printable version of your content and add a click-to-print link to it.
1,512,616
On Windows 10 1909 enterprise, I have a process "Antimalware Service executable", within which the service: "Windows defender antivirus service"; which takes 115BM of memory. However, in group policy, "Windows defender antivirus" I have "Turn off Windows defender antivirus" enabled, which help says: > > This policy ...
2019/12/26
[ "https://superuser.com/questions/1512616", "https://superuser.com", "https://superuser.com/users/907728/" ]
The correct action is to disable the `Tamper protection` in `Windows security`/`virus&threat protection settings`. Even without the key `HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\DisableAntiSpyware = 1` the group policy `Turn off Windows defender antivirus` to `enabled` will have effect. Registry...
Another method. Go to Settings, Security, Virus & threat protection, Manage settings, Tamper protection. Set to Off. Then add this: ``` Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection] "DisableRealtimeMonitoring"=dword:00000001 ```
4,538,313
I would like to create a simple application accessing a database. Does **PhoneGap** has this feature in its framework? Which database technology does it use? MySQL? Any database? What are the requirements for developing a PhoneGap database application for IPhone?
2010/12/27
[ "https://Stackoverflow.com/questions/4538313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66708/" ]
Database (the Sqlite database) is baked right into Webkit (and Safari), though you do get some added functionality from Phonegap (the ability to [pre-populate a Database](http://groups.google.com/group/phonegap/browse_thread/thread/ca6c85f7d6c3976c)). But you can just develop in HTML5 and Javascript to start. Apple pro...
Though PhoneGap recommends using the websql as a means of data storage, it should be mentioned (but its not) that the responses from queries are not instantaneously returned. This is just simply a limitation of using Phonegap. Here is a function I've used to tie a websql database query with a particular action. <http:...
23,148,556
How to get the date trimmed of exactly in the format of (dd/mm/yyyy) in the following implementation of my code using JavaScript ``` <script type="text/javascript" language="javascript"> function disptextbox() { var d = new Date(); var x = document.getElementById("ddlweeklist").value; swi...
2014/04/18
[ "https://Stackoverflow.com/questions/23148556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3336047/" ]
Considering it is really only useful for clipping... you need to write it in the last stage of ***vertex processing*** in your GLSL program. Currently there is only one stage that does not fall under the category of vertex processing, so whatever comes immediately before the fragment shader needs to output this. If yo...
As long as you only work with vertex and fragment shaders, you write it in the vertex shader. According to the GLSL spec, geometry and tessellation shaders can write it as well. The fragment shader can read the value. Based on the way I read the documentation, it would give you the interpolated value of the clip dista...
5,550
Quando ho scritto la prima frase di [questo post](https://italian.stackexchange.com/a/5548/707) ho avuto il dubbio su quale fosse la posizione giusta dell'avverbio "qui": > > * Cerco di fare *qui* un riassunto di tutto quello che ho ricavato dai vostri commenti. > * *Qui* cerco di fare un riassunto di tutto quello ch...
2015/05/26
[ "https://italian.stackexchange.com/questions/5550", "https://italian.stackexchange.com", "https://italian.stackexchange.com/users/707/" ]
Ti posso dire, da italiano, come interpreto quelle quattro frasi. > > Cerco di fare qui un riassunto di tutto quello che ho ricavato dai vostri commenti. > > > "Qui", "in questo articolo/post". > > Qui cerco di fare un riassunto di tutto quello che ho ricavato dai vostri commenti. > > > Come sopra, però que...
Secondo me vanno bene tutte e quattro, a "orecchio" io userei la prima e la quarta che mi piacciono di più. La seconda andrebbe bene come conclusione di un testo svolto nelle righe precedenti perché dà molto risalto alla parola "qui"...La terza risulta un po' strana, il "qui" risulta un po' slegato, meglio evitarla.
49,055
I'm considering designing/building a fairly basic electronic load (constant current, but possibly also constant power and resistance). However, after drawing up a few ideas for the basic operation, I got stuck. My first idea was to go the digital route, using a MOSFET driven by a DAC as the power dissipator, and a sen...
2012/11/15
[ "https://electronics.stackexchange.com/questions/49055", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/7918/" ]
It might work, but I would suggest another approach that is open loop and has 8 bit accuracy. ![enter image description here](https://i.stack.imgur.com/gMxz0.gif) You can implement a discrete version or buy the chip and R/3R precision component.
Unless you really want to start doing fancy stuff like transients, a slowly-changing active load is ideal, as the low control frequency would avoid interacting with the loop of the power supply under test. If you go closed-loop around a current sensor, the exact gate voltage needed to get to that current becomes moot ...
10,428,904
I need query which will check user supplied date range is in between the existing table startdate and enddate. if any of the date of user supplied date range is in between the tables start date and end date,it should retrun that record from table. for example user supply date range is from 1 may 2012 to 5 may 2012. th...
2012/05/03
[ "https://Stackoverflow.com/questions/10428904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439618/" ]
Overlaps test for two intervals: ``` ( '2012-05-01' <= enddate AND startdate <= '2012-05-05' ) ```
``` Select * from table where datecolumn between @date1 and @date2 ```
4,230,208
I am passing an integer value to the NSUserDefault object to store for use when my app loads up. I ***HAD*** it working perfectly until I tried to switch that integer value to a float. It caused a whole bunch of problems, so I re-adjusted my approach, and command-z'd my way back to the safety of integers...or so I thou...
2010/11/19
[ "https://Stackoverflow.com/questions/4230208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439358/" ]
Did you make sure to `-synchronize` the NSUserDefaults?
I've never noticed that behavior - and I don't think it is the case that there is a delay involved. So the most obvious question is: If you do a: ``` [[NSUserDefaults standardUserDefaults] setInteger:value ForKey:@"myInteger"]; NSLog(@"It is %d",[[NSUserDefaults standardUserDefaults] integerForKey:@"myInteger"]); `...
4,230,208
I am passing an integer value to the NSUserDefault object to store for use when my app loads up. I ***HAD*** it working perfectly until I tried to switch that integer value to a float. It caused a whole bunch of problems, so I re-adjusted my approach, and command-z'd my way back to the safety of integers...or so I thou...
2010/11/19
[ "https://Stackoverflow.com/questions/4230208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439358/" ]
Did you make sure to `-synchronize` the NSUserDefaults?
I believe this is a simulator bug. With your application on the simulated device, open up Settings.app. Now exit Settings.app. Your defaults settings will suddenly begin working. See also this thread on the Apple discussion forums about the [non-sticky `NSUserDefaults` issue](http://discussions.apple.com/message.jspa?...
6,296,626
I want to get an unknown (*changing*) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: ``` $("#parent table:first tr").each(function(i){ var goodlng = $(this).parent().children("tr").length ...
2011/06/09
[ "https://Stackoverflow.com/questions/6296626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763116/" ]
Actually, this `$(this).parent().children("tr").length` is the correct way of handling things. `this`, in the context above is a reference to the `tr` node itself. `tr`.length = the length of the `tr`. `tr.parent().children("tr")`, on the other hand is a list of the node's siblings, so `tr.parent().children("tr").lengt...
The each() function is unaware of the collection of elements that it is working on. It is dealing with a single element at all times. Thats why when you go to the parent and ask for all children you get the right answer. ``` $(this) ``` simply refers to the current tr element that you are dealing with, not a colle...
6,296,626
I want to get an unknown (*changing*) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: ``` $("#parent table:first tr").each(function(i){ var goodlng = $(this).parent().children("tr").length ...
2011/06/09
[ "https://Stackoverflow.com/questions/6296626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763116/" ]
This is the context of EACH element, not all of them. Therefore, `this` is only ONE `tr` at a time. That is why the length does not have all the elements.
The each() function is unaware of the collection of elements that it is working on. It is dealing with a single element at all times. Thats why when you go to the parent and ask for all children you get the right answer. ``` $(this) ``` simply refers to the current tr element that you are dealing with, not a colle...
6,296,626
I want to get an unknown (*changing*) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: ``` $("#parent table:first tr").each(function(i){ var goodlng = $(this).parent().children("tr").length ...
2011/06/09
[ "https://Stackoverflow.com/questions/6296626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763116/" ]
Your question says "cells", but it seems like you're trying to get the number of rows. If you really want it inside the `.each()`, you could use the [`siblings()`*[docs]*](http://api.jquery.com/siblings/) method and the [`andSelf()`*[docs]*](http://api.jquery.com/andSelf/) method. ``` $(this).siblings().andSelf().len...
The each() function is unaware of the collection of elements that it is working on. It is dealing with a single element at all times. Thats why when you go to the parent and ask for all children you get the right answer. ``` $(this) ``` simply refers to the current tr element that you are dealing with, not a colle...
6,296,626
I want to get an unknown (*changing*) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: ``` $("#parent table:first tr").each(function(i){ var goodlng = $(this).parent().children("tr").length ...
2011/06/09
[ "https://Stackoverflow.com/questions/6296626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763116/" ]
Your question says "cells", but it seems like you're trying to get the number of rows. If you really want it inside the `.each()`, you could use the [`siblings()`*[docs]*](http://api.jquery.com/siblings/) method and the [`andSelf()`*[docs]*](http://api.jquery.com/andSelf/) method. ``` $(this).siblings().andSelf().len...
Actually, this `$(this).parent().children("tr").length` is the correct way of handling things. `this`, in the context above is a reference to the `tr` node itself. `tr`.length = the length of the `tr`. `tr.parent().children("tr")`, on the other hand is a list of the node's siblings, so `tr.parent().children("tr").lengt...
6,296,626
I want to get an unknown (*changing*) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: ``` $("#parent table:first tr").each(function(i){ var goodlng = $(this).parent().children("tr").length ...
2011/06/09
[ "https://Stackoverflow.com/questions/6296626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/763116/" ]
Your question says "cells", but it seems like you're trying to get the number of rows. If you really want it inside the `.each()`, you could use the [`siblings()`*[docs]*](http://api.jquery.com/siblings/) method and the [`andSelf()`*[docs]*](http://api.jquery.com/andSelf/) method. ``` $(this).siblings().andSelf().len...
This is the context of EACH element, not all of them. Therefore, `this` is only ONE `tr` at a time. That is why the length does not have all the elements.
2,981,827
On the heels of [a specific problem](https://stackoverflow.com/questions/2980920/strict-pointer-aliasing-any-solution-for-a-specific-problem/2981505#2981505), a self-answer and comments to it, I'd like to understand if it is a proper solution, workaround/hack or just plain wrong. Specifically, I rewrote code: ``` T x...
2010/06/05
[ "https://Stackoverflow.com/questions/2981827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Volatile can't help you avoid undefined behaviour here. So, if it works for you with GCC it's luck. Let's assume T is a POD. Then, the proper way to do this is ``` T x = …; int i; memcpy(&i,&x,sizeof i); if (i==0) … ``` There! No strict aliasing problem and no memory alignment problem. GCC even handles memcpy as ...
> > Volatile can't help you avoid undefined behaviour here. > > > Well, anything regarding `volatile` is somewhat unclear in the standard. I mostly agreed with your answer, but now I would like to slightly disagree. In order to understand what `volatile` means, the standard is not clear for most people, notably ...
5,486,514
Ok, my problem is that whenever i collect data from the parser into an array where the string contains Swedish ÅÄÖ characters. In my example the ``` [schemaInfoArray objectAtIndex:3] ``` is supposed to be @"Lördag" but is saved as @"L" and the ``` [schemaInfoArray objectAtIndex:4] ``` contains the rest of the ...
2011/03/30
[ "https://Stackoverflow.com/questions/5486514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/679954/" ]
This is a [documented design choice from Apple](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSXMLParserDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSXMLParserDelegate), and has nothing to do with Swedish characters: > > Because *string* may be only part of > the total ch...
`-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string` is not guaranteed to contain the complete contents of the string. You need to have a class instance variable that is a NSMutableString that can append all of foundCharacters between the calls to didStartElement and didEndElement. Inside of didEndE...
42,327,113
PHP contact form sends email every time the page is refreshed. If user sends his message once and refreshes again, the same message is sent again. This happens every time the page is refreshed. Here is my code form the form: ``` if (isset($_POST['submit'])) { if ($_POST['email'] == '' || $_FILES['file_upload'] ==...
2017/02/19
[ "https://Stackoverflow.com/questions/42327113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6921262/" ]
`$sender_lname = filter_var($_POST["fname"], FILTER_SANITIZE_STRING);` Should be, `$sender_lname = filter_var($_POST["lname"], FILTER_SANITIZE_STRING);` If you are refreshing a browser, they tend to cache the last POST request. You may be asked if you want to re-submit form data. Try adding a hidden field with a hash ...
It sends form every time because you didn't follow some of the good practices of web programming. First of all, after receiving data from submitted form you should redirect user to the new page to change request type to `GET` and to prevent next submission. The next thing is that you should use `CSRF token` to preven...
73,042,985
I have 64 divs created dynamically for a checker game. When I jump a checker, I need to be able to delete the jumped checker. How would I track the checkers to be able to delete a jumped checker? All of the divs and images have ids. Since I'm using the Angular cdkDragDrop, event.target.id and event.target.value are not...
2022/07/19
[ "https://Stackoverflow.com/questions/73042985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8022873/" ]
```py def reduce(num): if num == 0: return 0 if num < 0: return -reduce(-num) if num % 10 == 0: return reduce(num // 10) else: return num % 10 + 10 * reduce(num // 10) ```
String version of recursive function: ```py def reduce(n): return int(reduce_recursive(str(n), '')) def reduce_recursive(num, res): if not num: # if we've recursed on the whole input, nothing left to do return res if num[0] == '0': # if the character is '0', ignore it and recurse on the next cha...
25,910,495
I'm using Cytoscape JS to create a network. This is a large network and I need to hide some nodes to be more readable, but I can't redraw my network not including the hiding nodes. How can I redraw using auto-layout after hiding some nodes?
2014/09/18
[ "https://Stackoverflow.com/questions/25910495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4054059/" ]
If the nodes are objects, You could cast them to an `ObjectNode` and use the `put` method to add desired key/value pairs. ``` JSON = // stuff you have in example ObjectMapper mapper = new ObjectMapper(); JsonNode jsonNode = mapper.readTree(JSON); // using root node for this example if (jsonNode.isObject()) { ((Obj...
This is my code of putting the classnames in the generated schema. This code handles the case when the an array or a non-array parameter is provided. i.e. Person.class and Person[].class can be handled successfully. This code cannot handle the self reference issue which is still open on Jackson - <https://github.com/Fa...
26,460,593
Im trying to calculate the angle between two edges in a graph, in order to do that I transfer both edges to origin and then used dot product to calculate the angle. my problem is that for some edges like `e1` and `e2` the output of `angle(e1,e2)` is `-1.#INDOO`. what is this output? is it an error? Here is my code: `...
2014/10/20
[ "https://Stackoverflow.com/questions/26460593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4160904/" ]
It seems like dividing by zero. Make sure that your vectors always have `0<` length.
A recommended way to compute angles is by means of the `atan2` function, taking two arguments. It returns the angle on four quadrants. You can use it in two ways: * compute the angles of `u` and `v` separately and subtract: `atan2(Vy, Vx) - atan2(Uy, Ux)`. * compute the cross- and dot-products: `atan2(Ux.Vy - Uy.Vx, ...
26,460,593
Im trying to calculate the angle between two edges in a graph, in order to do that I transfer both edges to origin and then used dot product to calculate the angle. my problem is that for some edges like `e1` and `e2` the output of `angle(e1,e2)` is `-1.#INDOO`. what is this output? is it an error? Here is my code: `...
2014/10/20
[ "https://Stackoverflow.com/questions/26460593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4160904/" ]
You want the projection and you go via all this trig? You just need to dot b with the unit vector in the direction of a. So the final answer is ``` (Xa.Xb + Ya.Yb) / square_root(Xa^2 + Ya^2) ``` Did you check that cosAlpha doesn't reach 1.000000000000000000000001? That would explain the results, and provide another...
A recommended way to compute angles is by means of the `atan2` function, taking two arguments. It returns the angle on four quadrants. You can use it in two ways: * compute the angles of `u` and `v` separately and subtract: `atan2(Vy, Vx) - atan2(Uy, Ux)`. * compute the cross- and dot-products: `atan2(Ux.Vy - Uy.Vx, ...
26,460,593
Im trying to calculate the angle between two edges in a graph, in order to do that I transfer both edges to origin and then used dot product to calculate the angle. my problem is that for some edges like `e1` and `e2` the output of `angle(e1,e2)` is `-1.#INDOO`. what is this output? is it an error? Here is my code: `...
2014/10/20
[ "https://Stackoverflow.com/questions/26460593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4160904/" ]
Answer moved from mine comment check if your dot product is in `<-1,+1>` range ... * due to float rounding it can be for example 1.000002045 which will cause `acos` to fail. * so add two `if`s and clamp to this range. * or use faster way: `acos(0.99999*dot)` * but that lowers the precision for all angles * and also ...
A recommended way to compute angles is by means of the `atan2` function, taking two arguments. It returns the angle on four quadrants. You can use it in two ways: * compute the angles of `u` and `v` separately and subtract: `atan2(Vy, Vx) - atan2(Uy, Ux)`. * compute the cross- and dot-products: `atan2(Ux.Vy - Uy.Vx, ...
1,650,844
Whenever I leave Firefox on, with a bunch of tabs, for more than a few hours, its memory use balloons, and everything else seems to be swapped out, so my system becomes highly non-responsive. In a typical case, it will have a child process named WebExtensions which takes up 27 GB of virtual memory. I think it might be ...
2021/05/22
[ "https://superuser.com/questions/1650844", "https://superuser.com", "https://superuser.com/users/122798/" ]
I'd probably say to use an addon to unload the tabs after an amount of time. I have been using [Auto Tab Discard](https://addons.mozilla.org/en-GB/firefox/addon/auto-tab-discard/) to "sleep" tabs and reduce memory usage. It will simply unload the tabs, free up memory and halt any scripts that may be using memory or th...
The memory leak might be in some extension, rather than in Firefox itself. To check, start Firefox in Troubleshoot/Safe mode, by the menu entry Help, then "Troubleshoot Mode…" and click "Restart". If the problem disappears, locate the troublesome extension by selectively disabling extensions in `about:addons`.
45,058,346
Say I want to scrape the following url: <https://soundcloud.com/search/sounds?q=edm&filter.created_at=last_week> I have the following python code: ``` import requests from lxml import html urlToSearch = 'https://soundcloud.com/search/sounds?q=edm&filter.created_at=last_week' page = requests.get(urlToSearch) ...
2017/07/12
[ "https://Stackoverflow.com/questions/45058346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6539531/" ]
The problem is that requests does not generate dynamic content. Right click on the page and view the page source, you'll see that the static content does not include any of the content that you see after the dynamic content has loaded. However, (using Chrome) open dev tools, click on network and XHR. It looks like y...
Problem is that with modern websites almost all web pages will change quite a lot after its been loaded with JavaScript, css etc. You will fetch the basic html before any DOM updates etc been made and will look differently to actually visiting the page with a browser. Use the Selenium WebDriver framework (mostly used ...
28,129,399
I have animation of images and some images are different widths and heights. What I am looking to do is set the width and height to each of theses images. ``` jumperguy.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"jumperguy_a_1.png"], [UI...
2015/01/24
[ "https://Stackoverflow.com/questions/28129399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3814273/" ]
You have some problems you aren't aware of. Primarily, you shouldn't be storing passwords in core data because it isn't secure. Also, when you set a predicate on a fetch request it replaces any existing predicate so your login check only looks at the password, not the email address (because that predicate is replaced)....
You can add a property to your `AppDelegate` class to store the Account object for the logged in user - AppDelegate.h ``` @property (strong,nonatomic) Account *currentUser; ``` Then you can set this when you have authenticated the user - ``` - (IBAction)processLogin:(id)sender { NSManagedObjectContext *conte...
11,843,453
I have seen a few questions talk around this topic, but I think I'm having a more fundamental lack of how to best use try/catch blocks beyond the most basic examples. In this specific case, I have a series of techniques to solve a problem, going from simple to fairly complicated, and what I have in mind is something ...
2012/08/07
[ "https://Stackoverflow.com/questions/11843453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49478/" ]
It is *possible* in Tomcat 6 and earlier, but not **recommended**. Refer this [Link](http://tomcat.apache.org/tomcat-6.0-doc/config/context.html) from apache documentation. Search for `caseSensitive`. By default it is `true`
A lot depends on whether you use Tomcat or Apache for HTML rendering. You can configure Apache 2.4 to render HTML and delegate JSP to Tomcat. In this scenario, you can configure Apache to be case insensitive. See this [link:](https://stackoverflow.com/questions/14814419/how-do-i-make-urls-case-insensitive-in-linux-serv...
74,496,521
I've have seen some answers to similar questions, but I haven't seen one touching multiple conditions and I couldn't adapt any to this need. Basically, `ar1` should have its labels replaced by the urls. Here is the function beating me: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022",...
2022/11/19
[ "https://Stackoverflow.com/questions/74496521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11832197/" ]
You should really check for spelling mistakes - having "Labe2" in ar2 will make indexOf("Label2") return -1. And btw. 2nd loop is useless (and will most likely cause bugs when your links are not all the same) Below the fixed code: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022", "Lab...
You have a typo in `ar2` ["Client", "Date", "Labe2", "Label1",], missing the `L` in Label2
74,496,521
I've have seen some answers to similar questions, but I haven't seen one touching multiple conditions and I couldn't adapt any to this need. Basically, `ar1` should have its labels replaced by the urls. Here is the function beating me: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022",...
2022/11/19
[ "https://Stackoverflow.com/questions/74496521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11832197/" ]
You have a typo in `ar2` ["Client", "Date", "Labe2", "Label1",], missing the `L` in Label2
For unordered arrays (/arrays with different orders) just check with an if condition if Date and Client are equal (and string the conditions with &&s together) - see code below: but at that point you should really think about, if arrays are still the data type you want to work with. This would be way easier with objec...
74,496,521
I've have seen some answers to similar questions, but I haven't seen one touching multiple conditions and I couldn't adapt any to this need. Basically, `ar1` should have its labels replaced by the urls. Here is the function beating me: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022",...
2022/11/19
[ "https://Stackoverflow.com/questions/74496521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11832197/" ]
You should really check for spelling mistakes - having "Labe2" in ar2 will make indexOf("Label2") return -1. And btw. 2nd loop is useless (and will most likely cause bugs when your links are not all the same) Below the fixed code: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022", "Lab...
Typo in your ar2. specifically ar2[0][2] is labe2 and not label2 (:
74,496,521
I've have seen some answers to similar questions, but I haven't seen one touching multiple conditions and I couldn't adapt any to this need. Basically, `ar1` should have its labels replaced by the urls. Here is the function beating me: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022",...
2022/11/19
[ "https://Stackoverflow.com/questions/74496521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11832197/" ]
Typo in your ar2. specifically ar2[0][2] is labe2 and not label2 (:
For unordered arrays (/arrays with different orders) just check with an if condition if Date and Client are equal (and string the conditions with &&s together) - see code below: but at that point you should really think about, if arrays are still the data type you want to work with. This would be way easier with objec...
74,496,521
I've have seen some answers to similar questions, but I haven't seen one touching multiple conditions and I couldn't adapt any to this need. Basically, `ar1` should have its labels replaced by the urls. Here is the function beating me: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022",...
2022/11/19
[ "https://Stackoverflow.com/questions/74496521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11832197/" ]
You should really check for spelling mistakes - having "Labe2" in ar2 will make indexOf("Label2") return -1. And btw. 2nd loop is useless (and will most likely cause bugs when your links are not all the same) Below the fixed code: ```js let ar1 = [ ["Client", "Date", "Label1", "Label2"], ["A", "11/15/2022", "Lab...
For unordered arrays (/arrays with different orders) just check with an if condition if Date and Client are equal (and string the conditions with &&s together) - see code below: but at that point you should really think about, if arrays are still the data type you want to work with. This would be way easier with objec...
62,175,971
When I try to access the header of a request in a function adnotated with @app.before\_request, it is always None. Anyone had this problem before? Here is the function: ``` @app.before_request def verifyToken(): if request.endpoint in ['myEndpoint'] auth = request.headers.get('Authorization') if au...
2020/06/03
[ "https://Stackoverflow.com/questions/62175971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9178191/" ]
I was being 5 months in `Flask`, I discover Flask Embeded Middleware fires up 2 times, the first one got None value and the second one is the client request and each fire up has different `request.method`, the `OPTIONS` and `<DEFAULT METHOD>` of the client, why there is an `OPTIONS` method first in `before...request` a...
The OPTIONS method could have been triggered by the browser due to request being preflighted. This is done to determine if the actual request is safe to send. Refer [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#preflighted_requests)
67,511
So, the first warm-ish day of summer finally showed up in the Black Hills yesterday and I noticed that our central air conditioning was not really keeping up... the thermostat was set at 72, but the interior temperature was 76 and didn't drop a degree after several hours of continuous operation of the A/C. Troubleshoo...
2015/06/10
[ "https://diy.stackexchange.com/questions/67511", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2110/" ]
There is some additional easy trouble-shooting you can do yourself. **Check temperature at the vents:** Get a little thermometer. Put it right on or just inside one of the air vents so that it's getting the full effect of the air temp coming out of the vents. The air should be about 20 degrees cooler than ambient in ...
If you have a set of gauges, you should connect them at the condensing unit and measure the pressures in the refrigerant lines. If you don't have a set of gauges, you should contact somebody who does. Troubleshooting and repairing A/C units requires special tools, without them you can only speculate as to what the pr...
67,511
So, the first warm-ish day of summer finally showed up in the Black Hills yesterday and I noticed that our central air conditioning was not really keeping up... the thermostat was set at 72, but the interior temperature was 76 and didn't drop a degree after several hours of continuous operation of the A/C. Troubleshoo...
2015/06/10
[ "https://diy.stackexchange.com/questions/67511", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2110/" ]
If you have a set of gauges, you should connect them at the condensing unit and measure the pressures in the refrigerant lines. If you don't have a set of gauges, you should contact somebody who does. Troubleshooting and repairing A/C units requires special tools, without them you can only speculate as to what the pr...
One day several years ago it was 118° here, and our A/C couldn't get the house any cooler than 87°. Eventually I discovered there wasn't enough aluminum tape around the return air duct, so I was just blowing a lot of cool air into the attic. Taping it up solved the problem. I don't know if that even applies in your cas...
67,511
So, the first warm-ish day of summer finally showed up in the Black Hills yesterday and I noticed that our central air conditioning was not really keeping up... the thermostat was set at 72, but the interior temperature was 76 and didn't drop a degree after several hours of continuous operation of the A/C. Troubleshoo...
2015/06/10
[ "https://diy.stackexchange.com/questions/67511", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/2110/" ]
There is some additional easy trouble-shooting you can do yourself. **Check temperature at the vents:** Get a little thermometer. Put it right on or just inside one of the air vents so that it's getting the full effect of the air temp coming out of the vents. The air should be about 20 degrees cooler than ambient in ...
One day several years ago it was 118° here, and our A/C couldn't get the house any cooler than 87°. Eventually I discovered there wasn't enough aluminum tape around the return air duct, so I was just blowing a lot of cool air into the attic. Taping it up solved the problem. I don't know if that even applies in your cas...
29,895,633
I have a class which behavior I would like to change. I need to replace private method with another realization. Common reflection techniques allow to modify private variable or to invoke private methods. But I find little information about replacing entire methods. I presume that there are advanced techniques to do s...
2015/04/27
[ "https://Stackoverflow.com/questions/29895633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837133/" ]
**Modify & replace:** One option is to mask the class with a modified copy (modify code, recompile code, add modified classes to the classpath *before* patched classes), similar to the approach [used here](https://stackoverflow.com/a/22098863/15472) to inspect how a normally unavailable method works. If you do not ha...
Instead of going for advanced techniques, there is a simple trick to achieve this. If you class is part of an open-source jar, get source code of this class file from grepcode.com. Change the method that you want to change and compile it. And update your jar file/classpath with this updated class file.
29,895,633
I have a class which behavior I would like to change. I need to replace private method with another realization. Common reflection techniques allow to modify private variable or to invoke private methods. But I find little information about replacing entire methods. I presume that there are advanced techniques to do s...
2015/04/27
[ "https://Stackoverflow.com/questions/29895633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837133/" ]
You can't replace method in runtime (at least without hack into JVM). But you can replace whole class. There are several way to do it. For example you can use thing called "aspect". But from my experience I can say that if you need to do this you have wrong turn somewhere in beginning of you way. Maybe you better mak...
Instead of going for advanced techniques, there is a simple trick to achieve this. If you class is part of an open-source jar, get source code of this class file from grepcode.com. Change the method that you want to change and compile it. And update your jar file/classpath with this updated class file.
29,895,633
I have a class which behavior I would like to change. I need to replace private method with another realization. Common reflection techniques allow to modify private variable or to invoke private methods. But I find little information about replacing entire methods. I presume that there are advanced techniques to do s...
2015/04/27
[ "https://Stackoverflow.com/questions/29895633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837133/" ]
**Modify & replace:** One option is to mask the class with a modified copy (modify code, recompile code, add modified classes to the classpath *before* patched classes), similar to the approach [used here](https://stackoverflow.com/a/22098863/15472) to inspect how a normally unavailable method works. If you do not ha...
You can't replace method in runtime (at least without hack into JVM). But you can replace whole class. There are several way to do it. For example you can use thing called "aspect". But from my experience I can say that if you need to do this you have wrong turn somewhere in beginning of you way. Maybe you better mak...
14,188,948
> > **Possible Duplicate:** > > [Setting JVM heap size at runtime](https://stackoverflow.com/questions/763295/setting-jvm-heap-size-at-runtime) > > > Is it possible to prevent a program from crashing when it encounters a `OutOfMemoryError` by increasing the memory allowed to the program? Can it be done at r...
2013/01/07
[ "https://Stackoverflow.com/questions/14188948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1894684/" ]
You may need to think of other solutions other than dynamically changing memory size including * allocating a reasonable amount of memory to start with. * decreasing the resolution of your captured images (which is what I did for a similar problem by decreasing image size) * caching your images to disk when not immed...
Short answer - No. Or at least, not with Hotspot JVMs. References: * [Setting JVM heap size at runtime](https://stackoverflow.com/questions/763295/setting-jvm-heap-size-at-runtime) * [Why do we have to increase the Java Heap?](https://stackoverflow.com/questions/852781/why-do-we-have-to-increase-the-java-heap) ... wh...
14,188,948
> > **Possible Duplicate:** > > [Setting JVM heap size at runtime](https://stackoverflow.com/questions/763295/setting-jvm-heap-size-at-runtime) > > > Is it possible to prevent a program from crashing when it encounters a `OutOfMemoryError` by increasing the memory allowed to the program? Can it be done at r...
2013/01/07
[ "https://Stackoverflow.com/questions/14188948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1894684/" ]
You may need to think of other solutions other than dynamically changing memory size including * allocating a reasonable amount of memory to start with. * decreasing the resolution of your captured images (which is what I did for a similar problem by decreasing image size) * caching your images to disk when not immed...
Ok well you can't actually increase the heapsize, but you could spawn another process with a new heapsize. Have a play with this: ``` public class SpawnAndChangeHeap { public static void main(String[] args){ //Get the jvm heap size. long heapSize = Runtime.getRuntime().totalMemory(); JO...
14,188,948
> > **Possible Duplicate:** > > [Setting JVM heap size at runtime](https://stackoverflow.com/questions/763295/setting-jvm-heap-size-at-runtime) > > > Is it possible to prevent a program from crashing when it encounters a `OutOfMemoryError` by increasing the memory allowed to the program? Can it be done at r...
2013/01/07
[ "https://Stackoverflow.com/questions/14188948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1894684/" ]
You may need to think of other solutions other than dynamically changing memory size including * allocating a reasonable amount of memory to start with. * decreasing the resolution of your captured images (which is what I did for a similar problem by decreasing image size) * caching your images to disk when not immed...
> > I was talking a lot of screen shots using `java.awt.Robot` and after some time my `Vector` ran out of memory. > > > Don't put them in a `Vector`. There is no need to store them in memory at all. Instead save each image to either of: 1. A Zip archive (this gets around creating '1000s of files' - which is its...
54,270,126
I am trying to observe a time in the timeline of my AVPlayer. I tried this on the main queue; which did not work. I then switched to a background queue, as advised from [this stack overflow post](https://stackoverflow.com/questions/15771549/avplayer-boundary-time-observer-fails-to-fire-occasionally); which did not wi...
2019/01/19
[ "https://Stackoverflow.com/questions/54270126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5886281/" ]
There may be two problems: 1. As the documentation for `addBoundaryTimeObserver` states: > > You must maintain a strong reference to the returned value as long as you want the time observer to be invoked by the player > > > As your initial code does not keep a reference to the returned internal opaque time obse...
2019 simple example .. ====================== ``` var player = AVPlayer() var token: Any? override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let u = "https... " let playerItem = AVPlayerItem(url: URL(string: u)!) player = AVPlayer(playerItem: playerItem) player.play() ...
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
They are located at /System/Library/Frameworks/OpenGL.framework/Headers. To include them, just use: ``` #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <OpenGL/glext.h> #include <GLUT/glut.h> ``` etc. Make sure to link against the appropriate frameworks, eg) ``` cc <your_file.c> -framework GLUT ...
XCode automatically exposes all header files from a framework added to a project via the framework's name. So, `"cocoa.h"` is part of `"cocoa.framework"` - hence `#include <cocoa/cocoa.h>` OpenGl is included `<OpenGL/gl.h>` rather than the more expected `<GL/gl.h>` on other platforms.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
They are located at /System/Library/Frameworks/OpenGL.framework/Headers. To include them, just use: ``` #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <OpenGL/glext.h> #include <GLUT/glut.h> ``` etc. Make sure to link against the appropriate frameworks, eg) ``` cc <your_file.c> -framework GLUT ...
It's worth noting that one also needs to have XCode itself set up (not just installed), as well as the XCode Command-Line Tools, even if one is not building the application in XCode.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
They are located at /System/Library/Frameworks/OpenGL.framework/Headers. To include them, just use: ``` #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <OpenGL/glext.h> #include <GLUT/glut.h> ``` etc. Make sure to link against the appropriate frameworks, eg) ``` cc <your_file.c> -framework GLUT ...
This is a good old thread to revive, because the correct answer changed. The accepted answer of `/System/Library/Frameworks/OpenGL.framework/Headers` was totally correct when it was written. But with Xcode 5 (I believe it changed with Xcode 4 already), this is not the case anymore. All SDK files are now installed into...
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
They are located at /System/Library/Frameworks/OpenGL.framework/Headers. To include them, just use: ``` #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <OpenGL/glext.h> #include <GLUT/glut.h> ``` etc. Make sure to link against the appropriate frameworks, eg) ``` cc <your_file.c> -framework GLUT ...
In MacOS 10.12.6, they're under `/opt/X11/include`, e.g. `/opt/X11/include/GL/gl.h`.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
It's worth noting that one also needs to have XCode itself set up (not just installed), as well as the XCode Command-Line Tools, even if one is not building the application in XCode.
XCode automatically exposes all header files from a framework added to a project via the framework's name. So, `"cocoa.h"` is part of `"cocoa.framework"` - hence `#include <cocoa/cocoa.h>` OpenGl is included `<OpenGL/gl.h>` rather than the more expected `<GL/gl.h>` on other platforms.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
This is a good old thread to revive, because the correct answer changed. The accepted answer of `/System/Library/Frameworks/OpenGL.framework/Headers` was totally correct when it was written. But with Xcode 5 (I believe it changed with Xcode 4 already), this is not the case anymore. All SDK files are now installed into...
XCode automatically exposes all header files from a framework added to a project via the framework's name. So, `"cocoa.h"` is part of `"cocoa.framework"` - hence `#include <cocoa/cocoa.h>` OpenGl is included `<OpenGL/gl.h>` rather than the more expected `<GL/gl.h>` on other platforms.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
XCode automatically exposes all header files from a framework added to a project via the framework's name. So, `"cocoa.h"` is part of `"cocoa.framework"` - hence `#include <cocoa/cocoa.h>` OpenGl is included `<OpenGL/gl.h>` rather than the more expected `<GL/gl.h>` on other platforms.
In MacOS 10.12.6, they're under `/opt/X11/include`, e.g. `/opt/X11/include/GL/gl.h`.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
This is a good old thread to revive, because the correct answer changed. The accepted answer of `/System/Library/Frameworks/OpenGL.framework/Headers` was totally correct when it was written. But with Xcode 5 (I believe it changed with Xcode 4 already), this is not the case anymore. All SDK files are now installed into...
It's worth noting that one also needs to have XCode itself set up (not just installed), as well as the XCode Command-Line Tools, even if one is not building the application in XCode.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
It's worth noting that one also needs to have XCode itself set up (not just installed), as well as the XCode Command-Line Tools, even if one is not building the application in XCode.
In MacOS 10.12.6, they're under `/opt/X11/include`, e.g. `/opt/X11/include/GL/gl.h`.
2,197,223
In /usr/include , I tried grepping for GL gl and OpenGL .. .but can't find it. Where are these header files located?
2010/02/04
[ "https://Stackoverflow.com/questions/2197223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
This is a good old thread to revive, because the correct answer changed. The accepted answer of `/System/Library/Frameworks/OpenGL.framework/Headers` was totally correct when it was written. But with Xcode 5 (I believe it changed with Xcode 4 already), this is not the case anymore. All SDK files are now installed into...
In MacOS 10.12.6, they're under `/opt/X11/include`, e.g. `/opt/X11/include/GL/gl.h`.
20,108
Source: p 599. *L'être et le néant* (original de 1943; éd Gallimard de 1976) par J-P Sartre. > > N'est-ce pas moi qui décide du coefficient d'adversité des > choses et > > jusque **de** leur imprévisibilité en décidant de moi-même ? > > > [ [jusque :](https://fr.wiktionary.org/wiki/jusque) ] 1. Marque un certa...
2016/07/12
[ "https://french.stackexchange.com/questions/20108", "https://french.stackexchange.com", "https://french.stackexchange.com/users/-1/" ]
Dans cette phrase, *jusque* est utilisé comme un synonyme de *même*, c'est-à-dire avec un sens un peu différent de l'indication d'une simple limite — il s'agit en effet de mettre l'accent sur cette limite et de souligner qu'on peut l'atteindre. Pour cet exemple, > > N'est-ce pas moi qui décide du coefficient d'adver...
Le "de" provient ici de **décider + de**. Le jusque se rapporte à l'action de décider, insistant sur le fait que l'imprévisibilité est à la limite du "décidable". Bref, je vote pour la décomposition de la ligne numérotée 3.
19,843,296
I have a directory structure like this ``` # Server A Dir_A : file, file2, file3, file4, file5 Dir_A/Dir_AA : file_aa1, file_aa2, file_aa3,file_aa4 Dir_A/Dir_AB: file_ab1,file_ab2 Server B ? likewise ``` so i just want the unmodified files from only Dir\_A not from internal directories of Dir\_A i use below comma...
2013/11/07
[ "https://Stackoverflow.com/questions/19843296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2957637/" ]
The way it is written, `getJson()` will return immediately without giving time for the thread to run completely, so the returned value will not be what you want. Use an [AsyncTask](http://developer.android.com/reference/android/os/AsyncTask.html) so you can run your thread code in the AsyncTask's `doInBackground()` met...
When you spawn a thread, code execution splits into different time frames, so even though global scope is shared, you won't get objects populated in a timely fashion for your UI update task if you don't implement some logic to prevent inconsistencies. Android provides multiple flow control and inter-thread communicati...
19,843,296
I have a directory structure like this ``` # Server A Dir_A : file, file2, file3, file4, file5 Dir_A/Dir_AA : file_aa1, file_aa2, file_aa3,file_aa4 Dir_A/Dir_AB: file_ab1,file_ab2 Server B ? likewise ``` so i just want the unmodified files from only Dir\_A not from internal directories of Dir\_A i use below comma...
2013/11/07
[ "https://Stackoverflow.com/questions/19843296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2957637/" ]
The way it is written, `getJson()` will return immediately without giving time for the thread to run completely, so the returned value will not be what you want. Use an [AsyncTask](http://developer.android.com/reference/android/os/AsyncTask.html) so you can run your thread code in the AsyncTask's `doInBackground()` met...
I solved it, I just added t.join after the thread declaration :)
19,843,296
I have a directory structure like this ``` # Server A Dir_A : file, file2, file3, file4, file5 Dir_A/Dir_AA : file_aa1, file_aa2, file_aa3,file_aa4 Dir_A/Dir_AB: file_ab1,file_ab2 Server B ? likewise ``` so i just want the unmodified files from only Dir\_A not from internal directories of Dir\_A i use below comma...
2013/11/07
[ "https://Stackoverflow.com/questions/19843296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2957637/" ]
When you spawn a thread, code execution splits into different time frames, so even though global scope is shared, you won't get objects populated in a timely fashion for your UI update task if you don't implement some logic to prevent inconsistencies. Android provides multiple flow control and inter-thread communicati...
I solved it, I just added t.join after the thread declaration :)
36,264,377
I am using two different methods to achieve responsive design in android devices **Method 1.** I used different **dimens.xml** in different folders like ``` values-hdpi values-ldpi values-mdpi values-xhdpi values-xxhdpi ``` --- **Method 2.** I copied all my layouts to ``` layout layout-large layout-small layou...
2016/03/28
[ "https://Stackoverflow.com/questions/36264377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3142611/" ]
I usually go for the `values`, `values-large`, ... folders and put `dimens.xml` files there, where I specify the sizes for each screen size category. The `values` is the "fallback", it contains the default value if I don't specify any for a specific size category. In the layouts I use it like this: ``` android:width="...
You can use google library `PercentRelativeLayout` with this library you can set **width**, **height** and **margin** of your `views` by **percentage** which is great because in all screen they look the same and of course it is not hard to code it. Here example: ``` <android.support.percent.PercentRelativeLayout ...
17,033,438
I have a lot of objects to create on c++ and send it to java, I'm using the `env->DeleteLocalRef(obj);` but I'm getting the following error: ``` 06-10 18:43:56.976: E/dalvikvm(11536): JNI ERROR (app bug): local reference table overflow (max=512) 06-10 18:43:56.980: W/dalvikvm(11536): JNI local reference table (0x4d9c0...
2013/06/10
[ "https://Stackoverflow.com/questions/17033438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794365/" ]
You need to delete local references to classes as well as to objects.
It looks like you're getting lots of instances of `java.lang.Class`. The most common way to get these is by calling `FindClass`. The name in the <> angle brackets is the name of the class that was looked up, so you should be looking for places where you do a lookup on `RoutePoint` or `BikeRoute`. `FindClass` can be fa...
17,033,438
I have a lot of objects to create on c++ and send it to java, I'm using the `env->DeleteLocalRef(obj);` but I'm getting the following error: ``` 06-10 18:43:56.976: E/dalvikvm(11536): JNI ERROR (app bug): local reference table overflow (max=512) 06-10 18:43:56.980: W/dalvikvm(11536): JNI local reference table (0x4d9c0...
2013/06/10
[ "https://Stackoverflow.com/questions/17033438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794365/" ]
You need to delete local references to classes as well as to objects.
I found the following technique useful if not horribly verbose, I created a class called Guardian as follows: ``` /* * Guardian.h * * Created on: Jul 14, 2014 * Author: yaturner */ #ifndef GUARDIAN_H_ #define GUARDIAN_H_ #define GLOGD(...) __android_log_print(ANDROID_LOG_DEBUG, tagName, __VA_ARGS__ ) { c...
17,033,438
I have a lot of objects to create on c++ and send it to java, I'm using the `env->DeleteLocalRef(obj);` but I'm getting the following error: ``` 06-10 18:43:56.976: E/dalvikvm(11536): JNI ERROR (app bug): local reference table overflow (max=512) 06-10 18:43:56.980: W/dalvikvm(11536): JNI local reference table (0x4d9c0...
2013/06/10
[ "https://Stackoverflow.com/questions/17033438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794365/" ]
It looks like you're getting lots of instances of `java.lang.Class`. The most common way to get these is by calling `FindClass`. The name in the <> angle brackets is the name of the class that was looked up, so you should be looking for places where you do a lookup on `RoutePoint` or `BikeRoute`. `FindClass` can be fa...
I found the following technique useful if not horribly verbose, I created a class called Guardian as follows: ``` /* * Guardian.h * * Created on: Jul 14, 2014 * Author: yaturner */ #ifndef GUARDIAN_H_ #define GUARDIAN_H_ #define GLOGD(...) __android_log_print(ANDROID_LOG_DEBUG, tagName, __VA_ARGS__ ) { c...
22,185,092
Given: ``` function a() { return 1; } a()++; ``` I get an error, is this just not going to be possible in JS? ![enter image description here](https://i.stack.imgur.com/i1JqN.png) What I want is to get the value 2.
2014/03/04
[ "https://Stackoverflow.com/questions/22185092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/654953/" ]
You're attempting to increment a constant, which makes no sense. In essence, you've written this: ``` 1++; ``` or ``` 1 = 1 + 1 ``` This doesn't work in JavaScript or *any* language, as far as I know. Certainly Ruby, PHP and C++ will all similarly die if you attempt to do this. If you want to arrive at the valu...
*No.* The issue is that `++` (like `+=`) only applies to expressions of the [Reference Specification Type](http://es5.github.io/#x8.7). That is, `++` is *only* valid when used with "a variable or property expression". > > The Reference type is used to explain the behaviour of such operators as delete, typeof, and th...
21,651,133
I'm trying to setup a server to server link using socket.io over ssl connection. This is my example: ``` /** * Server */ var app = require('express')(); var config = require('./config'); var https = require('https'); var http = require('http'); var fs = require('fs'); var server = https.createServer({key: fs.readFi...
2014/02/08
[ "https://Stackoverflow.com/questions/21651133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1906344/" ]
After some more searching, adding this in the client makes it work: require('https').globalAgent.options.rejectUnauthorized = false; ``` /** * Client */ var io = require('socket.io-client'); //var socket = io.connect('http://localhost', {port: 8088}); require('https').globalAgent.options.rejectUnauthorized = fal...
The previous answers didn't do it for me. `require('https').globalAgent` is always `undefined`. Did some seaching and found the `rejectUnauthorized` parameter in the docs (<https://nodejs.org/api/tls.html>). Not sure if it's related to SocketIO, but it somehow seems to work with self-signed certificates: `var socket ...
21,651,133
I'm trying to setup a server to server link using socket.io over ssl connection. This is my example: ``` /** * Server */ var app = require('express')(); var config = require('./config'); var https = require('https'); var http = require('http'); var fs = require('fs'); var server = https.createServer({key: fs.readFi...
2014/02/08
[ "https://Stackoverflow.com/questions/21651133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1906344/" ]
After some more searching, adding this in the client makes it work: require('https').globalAgent.options.rejectUnauthorized = false; ``` /** * Client */ var io = require('socket.io-client'); //var socket = io.connect('http://localhost', {port: 8088}); require('https').globalAgent.options.rejectUnauthorized = fal...
While all the above solutions focus on `rejectUnauthorized=false`, I'd like to suggest an alternative. ``` const https = require('https'); const rootCas = require('ssl-root-cas').create(); rootCas.addFile('cert/ca.crt'); https.globalAgent.options.ca = rootCas; // optional const io = require("socket.io-client"); var s...
21,651,133
I'm trying to setup a server to server link using socket.io over ssl connection. This is my example: ``` /** * Server */ var app = require('express')(); var config = require('./config'); var https = require('https'); var http = require('http'); var fs = require('fs'); var server = https.createServer({key: fs.readFi...
2014/02/08
[ "https://Stackoverflow.com/questions/21651133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1906344/" ]
I've had to do things a little differently on the client to get this to work, by manually telling socket.io to use that Agent as well (and the `secure: true` is implied by `https:`). Here it is: ``` // Client var io = require('socket.io-client'); var https = require('https'); https.globalAgent.options.rejectUnauthoriz...
The previous answers didn't do it for me. `require('https').globalAgent` is always `undefined`. Did some seaching and found the `rejectUnauthorized` parameter in the docs (<https://nodejs.org/api/tls.html>). Not sure if it's related to SocketIO, but it somehow seems to work with self-signed certificates: `var socket ...
21,651,133
I'm trying to setup a server to server link using socket.io over ssl connection. This is my example: ``` /** * Server */ var app = require('express')(); var config = require('./config'); var https = require('https'); var http = require('http'); var fs = require('fs'); var server = https.createServer({key: fs.readFi...
2014/02/08
[ "https://Stackoverflow.com/questions/21651133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1906344/" ]
I've had to do things a little differently on the client to get this to work, by manually telling socket.io to use that Agent as well (and the `secure: true` is implied by `https:`). Here it is: ``` // Client var io = require('socket.io-client'); var https = require('https'); https.globalAgent.options.rejectUnauthoriz...
While all the above solutions focus on `rejectUnauthorized=false`, I'd like to suggest an alternative. ``` const https = require('https'); const rootCas = require('ssl-root-cas').create(); rootCas.addFile('cert/ca.crt'); https.globalAgent.options.ca = rootCas; // optional const io = require("socket.io-client"); var s...
21,651,133
I'm trying to setup a server to server link using socket.io over ssl connection. This is my example: ``` /** * Server */ var app = require('express')(); var config = require('./config'); var https = require('https'); var http = require('http'); var fs = require('fs'); var server = https.createServer({key: fs.readFi...
2014/02/08
[ "https://Stackoverflow.com/questions/21651133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1906344/" ]
The previous answers didn't do it for me. `require('https').globalAgent` is always `undefined`. Did some seaching and found the `rejectUnauthorized` parameter in the docs (<https://nodejs.org/api/tls.html>). Not sure if it's related to SocketIO, but it somehow seems to work with self-signed certificates: `var socket ...
While all the above solutions focus on `rejectUnauthorized=false`, I'd like to suggest an alternative. ``` const https = require('https'); const rootCas = require('ssl-root-cas').create(); rootCas.addFile('cert/ca.crt'); https.globalAgent.options.ca = rootCas; // optional const io = require("socket.io-client"); var s...
66,317,605
\*\*I use the CharField for the image url in the django model bt can't retrieve image in the detail page of food , this app is food app and i use default parameter as a food a placeholder image : ``` from django.db import models # Create your models here class Item(models.Model): def __str__(self): ...
2021/02/22
[ "https://Stackoverflow.com/questions/66317605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14608793/" ]
`Window` logic does not belong to the view model. View model does not care about UI. You must always implement the view model pretending like there is no UI, only a model. Therefore having a reference of `MainWindow` in you view model will lead to a tight coupling of the application to the view/UI. The goal of MVVM i...
1. In `AppManagerViewModel`, add a property of `ControlButtonsViewModel`. `public ControlButtonsViewModel ControlButtonsViewModel {get; set;}` 2. In the constructor of `AppManagerViewModel`, add `ControlButtonsViewModel = new ControlButtonsViewModel();` 3. In Xaml of `AppManagerView`, <ControlButtonsView DataContext=...
927,297
I couldn't find this on the interwebs and it seems like a obvious use case to me **Is it possible run Windows Desired State Configuration / DSC on a Windows 10 workstation?** For example, setting up IIS websites on development machines using DSC in "Push" mode against localhost
2018/08/21
[ "https://serverfault.com/questions/927297", "https://serverfault.com", "https://serverfault.com/users/76757/" ]
**No.** The internet implies it might be so trying it out, but boy there is a lack of good simple quick start guides so here is what I tried: ``` # TestDSC.ps1 Configuration TestDSC { Import-DscResource -Module PSDesiredStateConfiguration, xWebAdministration WindowsFeature IIS { Ensure =...
I know I'm incredibly late to the game, but I stumbled across this while looking into IIS with DSC and felt that the answer provided was pretty misleading. As someone who built a career out of using DSC to manage Windows Desktops and Servers, I can comfortably say DSC is supported on all Windows SKUs after Win8/Server ...
376,467
Today my manager said: 'Amir, don't mix the business logic with data in database'. I surprisingly shocked! I said 'Where?'. According to **wikipedia** business logic is: > > In computer software, business logic or domain logic is the part of > the program that encodes the real-world business rules that determine > ...
2018/08/06
[ "https://softwareengineering.stackexchange.com/questions/376467", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/295701/" ]
There are many schools of thought regarding what logic & rules you can put in the database, and this will vary somewhat on the capabilities and type of the database. One thing for sure, though, is that if you don't put sufficient domain logic in your database to maintain your data's integrity, then you should wrap you...
In your example case I understand category to be just a label that is structurally identical to subcategory: a string, possibly with a maximum length. According to your manager, the meaning assigned to that label is business logic. This would imply that the choice of deeming something a category or a sub category is n...
11,442,101
I'm getting a weird warning, and as a result my regex search isn't working. Here's the line: ``` NSRange r = [HTML rangeOfString:@"\|(.*)\|" options:NSRegularExpressionSearch]; ``` Where `HTML` is a string that I'm sure contains a single match for the above regex. The warning is only on the first occurrence of "\|"...
2012/07/11
[ "https://Stackoverflow.com/questions/11442101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781303/" ]
You're getting the warning because `\|` is not a valid escape sequence in Objective-C (or C or C++ for that matter). The compiler is ignoring that and just using a raw `|` character instead, so the string you're actually passing in is `@"|(.*)|"`. To get the behavior you want, you have to escape the backslash in your ...
Just to add up, if you are dealing with special character sequences in unicode format, you can use something like this: ``` const unichar specialCharSequence='some special character'; if(specialCharSequence==L'\uxxxx') { //handle the occurence of this special character } ```
34,717,383
Such a new and awesome security functionality is **RUN-TIME Permission** I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle "**Never ask Again**" [![enter image description here](https://i.stack.imgur.com/pAi5e...
2016/01/11
[ "https://Stackoverflow.com/questions/34717383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3513479/" ]
First you need to implement `OnRequestPermissionsResultCallback` `Listener` of `ActivityCompat` class in your `Activity` and override `void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)` Method to check whether User is allowing or denying the permission You can...
open your app setting when user chose "Nerver ask again" ``` Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); Uri uri = Uri.fromParts("package", getPackageName(), null); intent.setData(uri); startActivityForResult(intent, REQUEST_PERMISSION_SETTING); ``` my example to handle RuntimePermissio...
34,717,383
Such a new and awesome security functionality is **RUN-TIME Permission** I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle "**Never ask Again**" [![enter image description here](https://i.stack.imgur.com/pAi5e...
2016/01/11
[ "https://Stackoverflow.com/questions/34717383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3513479/" ]
First you need to implement `OnRequestPermissionsResultCallback` `Listener` of `ActivityCompat` class in your `Activity` and override `void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)` Method to check whether User is allowing or denying the permission You can...
I have created a `library` that handle all the `permissions` for you. you can find it in here: [PermissionHelper](https://github.com/k0shk0sh/PermissionHelper) --- To answer your question: in order for you to know if the user `checked` never show again you'll have to check against two things, if the permission is...
34,717,383
Such a new and awesome security functionality is **RUN-TIME Permission** I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle "**Never ask Again**" [![enter image description here](https://i.stack.imgur.com/pAi5e...
2016/01/11
[ "https://Stackoverflow.com/questions/34717383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3513479/" ]
First you need to implement `OnRequestPermissionsResultCallback` `Listener` of `ActivityCompat` class in your `Activity` and override `void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)` Method to check whether User is allowing or denying the permission You can...
Use [Dexter](https://github.com/Karumi/Dexter) library ------------------------------------------------------ or -- Use PermissionsDispatcher: -------------------------- Step 1 : use [PermissionsDispatcher](http://hotchemi.github.io/PermissionsDispatcher/) library by [hotchemi](https://github.com/hotchemi/) (the lib...
34,717,383
Such a new and awesome security functionality is **RUN-TIME Permission** I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle "**Never ask Again**" [![enter image description here](https://i.stack.imgur.com/pAi5e...
2016/01/11
[ "https://Stackoverflow.com/questions/34717383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3513479/" ]
I have created a `library` that handle all the `permissions` for you. you can find it in here: [PermissionHelper](https://github.com/k0shk0sh/PermissionHelper) --- To answer your question: in order for you to know if the user `checked` never show again you'll have to check against two things, if the permission is...
open your app setting when user chose "Nerver ask again" ``` Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); Uri uri = Uri.fromParts("package", getPackageName(), null); intent.setData(uri); startActivityForResult(intent, REQUEST_PERMISSION_SETTING); ``` my example to handle RuntimePermissio...
34,717,383
Such a new and awesome security functionality is **RUN-TIME Permission** I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle "**Never ask Again**" [![enter image description here](https://i.stack.imgur.com/pAi5e...
2016/01/11
[ "https://Stackoverflow.com/questions/34717383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3513479/" ]
open your app setting when user chose "Nerver ask again" ``` Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); Uri uri = Uri.fromParts("package", getPackageName(), null); intent.setData(uri); startActivityForResult(intent, REQUEST_PERMISSION_SETTING); ``` my example to handle RuntimePermissio...
Use [Dexter](https://github.com/Karumi/Dexter) library ------------------------------------------------------ or -- Use PermissionsDispatcher: -------------------------- Step 1 : use [PermissionsDispatcher](http://hotchemi.github.io/PermissionsDispatcher/) library by [hotchemi](https://github.com/hotchemi/) (the lib...
34,717,383
Such a new and awesome security functionality is **RUN-TIME Permission** I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle "**Never ask Again**" [![enter image description here](https://i.stack.imgur.com/pAi5e...
2016/01/11
[ "https://Stackoverflow.com/questions/34717383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3513479/" ]
I have created a `library` that handle all the `permissions` for you. you can find it in here: [PermissionHelper](https://github.com/k0shk0sh/PermissionHelper) --- To answer your question: in order for you to know if the user `checked` never show again you'll have to check against two things, if the permission is...
Use [Dexter](https://github.com/Karumi/Dexter) library ------------------------------------------------------ or -- Use PermissionsDispatcher: -------------------------- Step 1 : use [PermissionsDispatcher](http://hotchemi.github.io/PermissionsDispatcher/) library by [hotchemi](https://github.com/hotchemi/) (the lib...
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can try to make your navigation bar always `light` ``` if #available(iOS 13.0, *) { navigationController?.navigationBar.overrideUserInterfaceStyle = .light } ```
If anyone else finds that neither of the above answers work (as I did), there's a very specific edge-case if you have multiple windows within a `UIWindowScene` where it will use the topmost window rather than the key window to determine status bar appearance. So for example, if you have your key window with a `windowL...
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can write extension to `UIStatusBarStyle`: ``` extension UIStatusBarStyle { static var black: UIStatusBarStyle { if #available(iOS 13.0, *) { return .darkContent } return .default } } ``` And then you can easily use in your ViewControllers: ``` override var preferredS...
You can try to make your navigation bar always `light` ``` if #available(iOS 13.0, *) { navigationController?.navigationBar.overrideUserInterfaceStyle = .light } ```
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
If you set the `UIViewControllerBasedStatusBarAppearance` key in your app's `info.plist` to `YES`, you can override the status bar style in your currently presented view controller: ``` override var preferredStatusBarStyle: UIStatusBarStyle { if #available(iOS 13, *) { return .darkContent } else { ...
There are two ways to solve this problem. Define the childViewControllerForStatusBarStyle function in the UINavigationController descendant class: ``` @interface MyNavigationController : UINavigationController ... @end @implementation MyNavigationController ... - (UIViewController *)childViewControllerForStatusBarSty...
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can write extension to `UIStatusBarStyle`: ``` extension UIStatusBarStyle { static var black: UIStatusBarStyle { if #available(iOS 13.0, *) { return .darkContent } return .default } } ``` And then you can easily use in your ViewControllers: ``` override var preferredS...
This extension helps you to change the status bar text color and support also iOS 13 <https://stackoverflow.com/a/59767435/10512612>
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can try to make your navigation bar always `light` ``` if #available(iOS 13.0, *) { navigationController?.navigationBar.overrideUserInterfaceStyle = .light } ```
This extension helps you to change the status bar text color and support also iOS 13 <https://stackoverflow.com/a/59767435/10512612>
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can write extension to `UIStatusBarStyle`: ``` extension UIStatusBarStyle { static var black: UIStatusBarStyle { if #available(iOS 13.0, *) { return .darkContent } return .default } } ``` And then you can easily use in your ViewControllers: ``` override var preferredS...
There are two ways to solve this problem. Define the childViewControllerForStatusBarStyle function in the UINavigationController descendant class: ``` @interface MyNavigationController : UINavigationController ... @end @implementation MyNavigationController ... - (UIViewController *)childViewControllerForStatusBarSty...
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can try to make your navigation bar always `light` ``` if #available(iOS 13.0, *) { navigationController?.navigationBar.overrideUserInterfaceStyle = .light } ```
**If you're using a `UINavigationController`**, override the `preferredStatusBarStyle` in an extension (or your own subclass) like this (just overriding `preferredStatusBarStyle` in your view controllers won't work): ```swift extension UINavigationController { override open var preferredStatusBarStyle: UIStatusBarSt...
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can write extension to `UIStatusBarStyle`: ``` extension UIStatusBarStyle { static var black: UIStatusBarStyle { if #available(iOS 13.0, *) { return .darkContent } return .default } } ``` And then you can easily use in your ViewControllers: ``` override var preferredS...
**If you're using a `UINavigationController`**, override the `preferredStatusBarStyle` in an extension (or your own subclass) like this (just overriding `preferredStatusBarStyle` in your view controllers won't work): ```swift extension UINavigationController { override open var preferredStatusBarStyle: UIStatusBarSt...
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
If you set the `UIViewControllerBasedStatusBarAppearance` key in your app's `info.plist` to `YES`, you can override the status bar style in your currently presented view controller: ``` override var preferredStatusBarStyle: UIStatusBarStyle { if #available(iOS 13, *) { return .darkContent } else { ...
**If you're using a `UINavigationController`**, override the `preferredStatusBarStyle` in an extension (or your own subclass) like this (just overriding `preferredStatusBarStyle` in your view controllers won't work): ```swift extension UINavigationController { override open var preferredStatusBarStyle: UIStatusBarSt...
57,517,264
My navigation bar has a `white` `backgroundColor` and my status bar uses the `dark` `textColor`. When a user changes the iOS theme to Dark Mode, the status bar changes to `white` text on a `white` background. As a result, I can't see anything. How can I disable this change for my app?
2019/08/15
[ "https://Stackoverflow.com/questions/57517264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2903695/" ]
You can try to make your navigation bar always `light` ``` if #available(iOS 13.0, *) { navigationController?.navigationBar.overrideUserInterfaceStyle = .light } ```
I have done something like this. I have toggler function wich toggles Status bar style depending on View Controller displayed ``` func toggleLight() { self.navigationBar.barTintColor = AppColors.White isDarkStyle = false setNeedsStatusBarAppearanceUpdate() } ``` and here is most impo...