qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
32,591,069
I am am googling around the whole day for a probably simple question but I do not get it right. Hopefully someone can help me. I have a tableview controller with one prototype cell containing three custom labels. When I run the app the table view controller will generate about 150 tableview cells with content parsed f...
2015/09/15
[ "https://Stackoverflow.com/questions/32591069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5338758/" ]
You'll want to put something in `prepareForSegue` as well as a variable in your second view controller. So in your table view controller: ``` var variableToPass: String! override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { variableToPass = rowOfItems[indexPath.row].cus...
Good question if you want sort this problem plz follow below code: ``` class ViewController { var cvDataArray = cells = NSMutableArray.new() func viewDidLoad() { super.viewDidLoad() cvDataArray.enumerateObjectsUsingBlock({(obj: AnyObject, idx: Int, stop: Bool) in var cell: UITableV...
32,591,069
I am am googling around the whole day for a probably simple question but I do not get it right. Hopefully someone can help me. I have a tableview controller with one prototype cell containing three custom labels. When I run the app the table view controller will generate about 150 tableview cells with content parsed f...
2015/09/15
[ "https://Stackoverflow.com/questions/32591069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5338758/" ]
You can add your custom logic in `prepareForSegue` like this: ``` override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if let controller = segue.destinationViewController as? YourSecondController, indexPath = tableView.indexPathForSelectedRow() { controller.someVariable...
Good question if you want sort this problem plz follow below code: ``` class ViewController { var cvDataArray = cells = NSMutableArray.new() func viewDidLoad() { super.viewDidLoad() cvDataArray.enumerateObjectsUsingBlock({(obj: AnyObject, idx: Int, stop: Bool) in var cell: UITableV...
32,591,069
I am am googling around the whole day for a probably simple question but I do not get it right. Hopefully someone can help me. I have a tableview controller with one prototype cell containing three custom labels. When I run the app the table view controller will generate about 150 tableview cells with content parsed f...
2015/09/15
[ "https://Stackoverflow.com/questions/32591069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5338758/" ]
The code which is working for me is a mixture Phoen1xUK and glyuck answers. I put both together and ended up with this working version: For the FirstViewController: ``` override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "SecondControllerSegue" { if let ind...
Good question if you want sort this problem plz follow below code: ``` class ViewController { var cvDataArray = cells = NSMutableArray.new() func viewDidLoad() { super.viewDidLoad() cvDataArray.enumerateObjectsUsingBlock({(obj: AnyObject, idx: Int, stop: Bool) in var cell: UITableV...
36,803,289
I have a robot stock trading program that I've been working on for a few months. The other day though I added a 2nd condition to the code that determines when the trade gets exited. Condition as follows: ``` decimal entryPrice; decimal CurrentPrice; decimal openShares; if ((1st condition) && (((entryPrice - CurrentPr...
2016/04/22
[ "https://Stackoverflow.com/questions/36803289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5940882/" ]
Actually your code is right till the last line of javascript code which is:- ``` document.getElementById("demo").innerHTML = result.hotels[0].codigo + " " + result.hotels[0].estado; ``` Change it to:- ``` document.getElementById("demo").innerHTML = result.hotels.codigo+ " " + result.hotels.estado; ``` Example:- ...
This bit is pointless: ``` var result = JSON.parse( '<?php echo json_encode($result) ?>' ); ``` JSON is already valid javascript, so there's **NO** need to parse it. All you need to do is dump it out directly into the code block: ``` var result = <?php echo json_encode($result); ?>; ```
6,083,853
I'm trying to write a response into a variable, and I can't figure out how to do it. This doesn't work - screws up memory, but no protection errors: ``` for (int i = 0; i < 20; i++) { list[i] = 'a'; } ``` Same with this - memory screwed up: ``` for (int i = 0; i < 20; i++) { *(((int*)(list))+i) = 'a'; } //...
2011/05/21
[ "https://Stackoverflow.com/questions/6083853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160868/" ]
Since you want an array of bytes then `char**` is wrong – that's a pointer to a pointer to `char`. You want `char*` for an array, but if it's fixed length I'd declare it as `char list[20]`. It seems like you want to write something like this: ``` char list[20]; for (int i = 0; i < 20; i++) { list[i] = 'a'; } ```...
How did you initialize your `list`? ``` char** list; ``` doesn't work in this case you'll have to have something like ``` char* list[20]; ``` or dynamically allocated.
6,083,853
I'm trying to write a response into a variable, and I can't figure out how to do it. This doesn't work - screws up memory, but no protection errors: ``` for (int i = 0; i < 20; i++) { list[i] = 'a'; } ``` Same with this - memory screwed up: ``` for (int i = 0; i < 20; i++) { *(((int*)(list))+i) = 'a'; } //...
2011/05/21
[ "https://Stackoverflow.com/questions/6083853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160868/" ]
In C, a pointer can be used to represent an array, and a single string is an array of `char`, or in other words, a `char *`. This means that a `char **` is an array of strings. So if you want to put characters into the first string (assuming that memory has already been allocated to it), you should use `list[0][i] = 'a...
Since you want an array of bytes then `char**` is wrong – that's a pointer to a pointer to `char`. You want `char*` for an array, but if it's fixed length I'd declare it as `char list[20]`. It seems like you want to write something like this: ``` char list[20]; for (int i = 0; i < 20; i++) { list[i] = 'a'; } ```...
6,083,853
I'm trying to write a response into a variable, and I can't figure out how to do it. This doesn't work - screws up memory, but no protection errors: ``` for (int i = 0; i < 20; i++) { list[i] = 'a'; } ``` Same with this - memory screwed up: ``` for (int i = 0; i < 20; i++) { *(((int*)(list))+i) = 'a'; } //...
2011/05/21
[ "https://Stackoverflow.com/questions/6083853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160868/" ]
In C, a pointer can be used to represent an array, and a single string is an array of `char`, or in other words, a `char *`. This means that a `char **` is an array of strings. So if you want to put characters into the first string (assuming that memory has already been allocated to it), you should use `list[0][i] = 'a...
How did you initialize your `list`? ``` char** list; ``` doesn't work in this case you'll have to have something like ``` char* list[20]; ``` or dynamically allocated.
6,083,853
I'm trying to write a response into a variable, and I can't figure out how to do it. This doesn't work - screws up memory, but no protection errors: ``` for (int i = 0; i < 20; i++) { list[i] = 'a'; } ``` Same with this - memory screwed up: ``` for (int i = 0; i < 20; i++) { *(((int*)(list))+i) = 'a'; } //...
2011/05/21
[ "https://Stackoverflow.com/questions/6083853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160868/" ]
``` char** list ``` Isn't a 'array of bytes' its a 'pointer to a pointer pointing to char' which you can think of as a 'list of lists of char'. Also if you define it this way, you need to malloc enough memory to hold the data. When you write: ``` list[i] = 'a'; ``` Its messing up memory because your placing a cha...
How did you initialize your `list`? ``` char** list; ``` doesn't work in this case you'll have to have something like ``` char* list[20]; ``` or dynamically allocated.
6,083,853
I'm trying to write a response into a variable, and I can't figure out how to do it. This doesn't work - screws up memory, but no protection errors: ``` for (int i = 0; i < 20; i++) { list[i] = 'a'; } ``` Same with this - memory screwed up: ``` for (int i = 0; i < 20; i++) { *(((int*)(list))+i) = 'a'; } //...
2011/05/21
[ "https://Stackoverflow.com/questions/6083853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160868/" ]
In C, a pointer can be used to represent an array, and a single string is an array of `char`, or in other words, a `char *`. This means that a `char **` is an array of strings. So if you want to put characters into the first string (assuming that memory has already been allocated to it), you should use `list[0][i] = 'a...
``` char** list ``` Isn't a 'array of bytes' its a 'pointer to a pointer pointing to char' which you can think of as a 'list of lists of char'. Also if you define it this way, you need to malloc enough memory to hold the data. When you write: ``` list[i] = 'a'; ``` Its messing up memory because your placing a cha...
34,735,778
I can't seem to think of the word for this, but images in the iPhone simulator appear as though they were of a far lower resolution than they are. At 50% view, the simulator is already larger than the screen, but it is seen even worse at zoom level 25% and, strangely, it appears better in the 100% view, but still pixel...
2016/01/12
[ "https://Stackoverflow.com/questions/34735778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1122069/" ]
The issue was solved by going to Debug menu -> Graphics Quality Override -> High Quality and then restarting the simulator. On 50% it looks fine now. It did not fix the 25% zoom issue, but I don't use that mode anyway.
The reason why the 50% and 25% images look bad is because you're missing a lot of pixels. The simulator is always run at 100% and if you scale it they will just show every other pixel of every other row, or every fourth pixel of every fourth row. That's 75% or 94% of pixels just thrown away. You can easily see this e...
67,629,804
``` GameObject parent = GameObject.Find("Moving Object Parent"); for (int i = 0; i < numberOfObjectsToMove; i++) { var objectToMove = Instantiate(objectToMovePrefab, parent.transform); objectToMove.name = "Platfrom"; foreach (Transform g in objectToMove.GetComponent...
2021/05/21
[ "https://Stackoverflow.com/questions/67629804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15966271/" ]
The problem is that you aren't checking the right object for null. You need to do a null check on the `g.GetComponent<WaypointsFollower>()` ```cs foreach (Transform g in objectToMove.GetComponentsInChildren<Transform>()) { if (g.GetComponent<WaypointsFollower>() != null) { waypointsFollowers.Add(g.Get...
As was stated before that check ``` if (g != null) ``` doesn't make much sense. This will always be the case anyway since ``` objectToMove.GetComponentsInChildren<Transform>() ``` will never return any `null` entry. You rather want to check if the `WaypointsFollower` component was found on that object. --- The...
67,629,804
``` GameObject parent = GameObject.Find("Moving Object Parent"); for (int i = 0; i < numberOfObjectsToMove; i++) { var objectToMove = Instantiate(objectToMovePrefab, parent.transform); objectToMove.name = "Platfrom"; foreach (Transform g in objectToMove.GetComponent...
2021/05/21
[ "https://Stackoverflow.com/questions/67629804", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15966271/" ]
You're comparing `g` to `null`, which won't happen unless something go very wrong. You probably want to compare `WaypointsFollower` component to null. ``` WaypointsFollower f = g.GetComponent<WaypointsFollower>(); if (f != null) { waypointsFollowers.Add(f); } ```
As was stated before that check ``` if (g != null) ``` doesn't make much sense. This will always be the case anyway since ``` objectToMove.GetComponentsInChildren<Transform>() ``` will never return any `null` entry. You rather want to check if the `WaypointsFollower` component was found on that object. --- The...
9,637,722
my app crashes when the user tries to delete a row from the UITableView and in the debugger I get the SIGABRT error. Here is my code for deletion: ``` - (void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingSty...
2012/03/09
[ "https://Stackoverflow.com/questions/9637722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850350/" ]
I got help in another question. And the problem is that the object would be deleted from the array but then before deleting the row from the table view , the numberOfRowsInSection is called again which then loads the array from disk again and give the number before the deletion due to a problem in my loading of the arr...
Does your `[self displayedObjects]`'s item count cover `[indexPath row]`? For example, your `[self displayedObjects]` only has 5 item but you want to `removeObjectAtIndex:6`.
9,637,722
my app crashes when the user tries to delete a row from the UITableView and in the debugger I get the SIGABRT error. Here is my code for deletion: ``` - (void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingSty...
2012/03/09
[ "https://Stackoverflow.com/questions/9637722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850350/" ]
I got help in another question. And the problem is that the object would be deleted from the array but then before deleting the row from the table view , the numberOfRowsInSection is called again which then loads the array from disk again and give the number before the deletion due to a problem in my loading of the arr...
I compared with my code to see where you went wrong. ``` //Removes From Table [favorites removeObjectAtIndex:indexPath.row]; [tableView deleteRowsAtIndexPaths:[NSMutableArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft]; ``` Favorites is my array. What I think you're going...
9,637,722
my app crashes when the user tries to delete a row from the UITableView and in the debugger I get the SIGABRT error. Here is my code for deletion: ``` - (void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingSty...
2012/03/09
[ "https://Stackoverflow.com/questions/9637722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/850350/" ]
I got help in another question. And the problem is that the object would be deleted from the array but then before deleting the row from the table view , the numberOfRowsInSection is called again which then loads the array from disk again and give the number before the deletion due to a problem in my loading of the arr...
If I'm not mistaken, you're calling this code: ``` [[self tableView] deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade]; ``` from within a committed delete event. I believe all you need to do is update your backing store from the "tableView:commitEditingStyle...
31,046,549
I'm looking for a regular expression to exclude the URLs from an extension I don't like. For example resources ending with: `.css`, `.js`, `.font`, `.png`, `.jpg` etc. should be excluded. However, I can put all resources to the same folder and try to exclude URLs to this folder, like: ``` .*\/(?!content\/media)\/.* ...
2015/06/25
[ "https://Stackoverflow.com/questions/31046549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/597624/" ]
The correct solution is: ``` ^((?!\/content\/media\/).)*$ ``` see: <https://regex101.com/r/bD0iD9/4> Inspirit by [Regular expression to match a line that doesn't contain a word?](https://stackoverflow.com/questions/406230/regular-expression-to-match-text-that-doesnt-contain-a-word)
Two things: First, the `?!` negative lookahead doesn't remove any characters from the input. Add `[^\/]+` before the trailing slash. Right now it is trying to match two consecutive slashes. For example: ``` .*\/(?!content\/media)[^\/]+\/.* ``` (**edit**) Second, the `.*`s at the beginning and end match too much. Tr...
3,950,620
I have this very simple Javascript to write on a text area when the link is clicked: ``` <head> <script language="javascript" type="text/javascript"> function addtext(text) {document.form.textarea.value = document.form.textarea.value+= text;} </script> </head> <body> <form action="" method="" name="form"> ...
2010/10/16
[ "https://Stackoverflow.com/questions/3950620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/463065/" ]
Ok, I wrote you a sample you can check at <http://jsfiddle.net/zzdAL/> ``` $(document).ready(function() { popup = window.open("http://fiddle.jshell.net"); $("#input1").click(function() { try { popup....
Take a look to greasemonkey, it's an addon for your browser. You can choose on which page(s) the script will works. <http://wiki.greasespot.net/Main_Page>
3,950,620
I have this very simple Javascript to write on a text area when the link is clicked: ``` <head> <script language="javascript" type="text/javascript"> function addtext(text) {document.form.textarea.value = document.form.textarea.value+= text;} </script> </head> <body> <form action="" method="" name="form"> ...
2010/10/16
[ "https://Stackoverflow.com/questions/3950620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/463065/" ]
Probably it's too late, but here is an example of interaction: [window interaction](http://theopensourcery.com/jswin.htm)
Take a look to greasemonkey, it's an addon for your browser. You can choose on which page(s) the script will works. <http://wiki.greasespot.net/Main_Page>
3,950,620
I have this very simple Javascript to write on a text area when the link is clicked: ``` <head> <script language="javascript" type="text/javascript"> function addtext(text) {document.form.textarea.value = document.form.textarea.value+= text;} </script> </head> <body> <form action="" method="" name="form"> ...
2010/10/16
[ "https://Stackoverflow.com/questions/3950620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/463065/" ]
Ok, I wrote you a sample you can check at <http://jsfiddle.net/zzdAL/> ``` $(document).ready(function() { popup = window.open("http://fiddle.jshell.net"); $("#input1").click(function() { try { popup....
Probably it's too late, but here is an example of interaction: [window interaction](http://theopensourcery.com/jswin.htm)
773,149
I have some trouble with languages in my Windows 8.1. I can't tell when it happened (what could i do in this time), but right after installing os and maybe a few week after it was okay. But not now. So, my problem is: I use two language Russian and English (US) (US by default). And after rebooting computer I saw ...
2014/06/25
[ "https://superuser.com/questions/773149", "https://superuser.com", "https://superuser.com/users/318678/" ]
First, [import the key](https://www.gnupg.org/gph/en/manual/x56.html#AEN83) with: ``` gpg --import pubring.asc gpg --list-keys ``` Now you can [verify this signature](https://www.gnupg.org/gph/en/manual/x135.html#AEN160) against your list of public keys: ``` gpg --verify setup-x86_64.exe.sig setup-x86_64.exe ```
`gpg --import pubring.asc` (as in [@elsamuko](https://superuser.com/a/773170/1687279)'s answer) searches for the key in the **hkp://keys.gnupg.net** *keyserver* (the default in the `~/.gnupg/gpg.conf` file). sometimes that server+key combo doesn't seem to work though. hence, as suggested by [unSpawn](https://www.linux...
2,885,393
In a paper I came across an expansion like this: $$\cos(m\theta) = C\_m^0\cos^m(\theta) - C\_m^2\cos^{m-2}(\theta)(1-\cos^2(\theta)) + C\_m^4\cos^{m-4}(\theta)(1-\cos^2(\theta))^2 + ... (-1)^nC\_m^{2n}\cos^{m-2n}(\theta)(1-\cos^2(\theta))^n + ...$$ What kind of expansion is this and how do you calculate those $C\_m^...
2018/08/17
[ "https://math.stackexchange.com/questions/2885393", "https://math.stackexchange.com", "https://math.stackexchange.com/users/275447/" ]
The coefficients are binomial coefficients $$C^k\_m=\frac{m!}{k!\,(m-k)!}\ ,$$ though you should **note** that the notation used is slightly unusual, many people (AFAIK most people) write $$C^m\_k\quad\hbox{or}\quad {}^mC\_k\quad\hbox{or}\quad \binom mk\ .$$ The formula comes from de Moivre's Theorem and the binomial e...
**Hint:** Use [De Moivre's formula](https://en.wikipedia.org/wiki/De_Moivre%27s_formula) $$(\cos\theta+i\sin\theta)^m=\cos m\theta+i\sin m\theta$$ write the expansion of the left side and then pick up the real part of both sides. You will find the desired formula.
10,141,793
In Android App, I am using a TabBar which consists of 4 tabs. I have a requirement to get all objects of 4 Tabs. How can achieve this, any suggestions.
2012/04/13
[ "https://Stackoverflow.com/questions/10141793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1331691/" ]
There's many ways to do it, one of which is to have a column in the table titled `new_notification` that will tell you if the notification is new(read by the user or not). So, for example, if a person likes another persons picture, in the table that column will have `new_notification` set to `Y`. When the user who's pi...
Yes I agree with @Interstellar\_Coder, you could have your post page info stored in one line in a database table, and your like info stored in another table. Reference which picture the person likes by ID. Table 1 (picture posts): ``` ID | Picture | Comments | who 1 | (pic data) | my picture | user.name_1 ``` ...
5,857,820
How to get camera serial number from EXIF ? --- Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"
2011/05/02
[ "https://Stackoverflow.com/questions/5857820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
First the camera would have to write its serial number to the EXIF data. I don't know of any that do. But in any event, you'll have to check with the documentation of the specific camera in question to see if it writes this value and where it writes it. There's no standard place for it, since it's not a standard thing...
You can use [`exif_read_data`](http://www.php.net/manual/en/function.exif-read-data.php) to access EXIF information in php. A good code sample on how to use this command is shown in the manual within the link below. <http://www.php.net/manual/en/function.exif-read-data.php> But afaik currently not many cameras code t...
5,857,820
How to get camera serial number from EXIF ? --- Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"
2011/05/02
[ "https://Stackoverflow.com/questions/5857820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
As has been mentioned, not all cameras store the serial number. However, most of the DSLRs do. The serial number is actually stored in the MakerNotes section of the EXIF. This is a proprietary section for manufacturers to write in whatever format they like. I've extended the great work by [Jacob Seidelin](http://blog...
First the camera would have to write its serial number to the EXIF data. I don't know of any that do. But in any event, you'll have to check with the documentation of the specific camera in question to see if it writes this value and where it writes it. There's no standard place for it, since it's not a standard thing...
5,857,820
How to get camera serial number from EXIF ? --- Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"
2011/05/02
[ "https://Stackoverflow.com/questions/5857820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
First the camera would have to write its serial number to the EXIF data. I don't know of any that do. But in any event, you'll have to check with the documentation of the specific camera in question to see if it writes this value and where it writes it. There's no standard place for it, since it's not a standard thing...
Almost all DSLR cameras code the serial number into the EXIF info in the maker notes section. The reason most people don't see it in the EXIF info is that Adobe products all but ignore the maker notes section of the EXIF info. So if you are viewing the EXIF info using an Adobe product you won't see the serial number. B...
5,857,820
How to get camera serial number from EXIF ? --- Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"
2011/05/02
[ "https://Stackoverflow.com/questions/5857820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
As has been mentioned, not all cameras store the serial number. However, most of the DSLRs do. The serial number is actually stored in the MakerNotes section of the EXIF. This is a proprietary section for manufacturers to write in whatever format they like. I've extended the great work by [Jacob Seidelin](http://blog...
You can use [`exif_read_data`](http://www.php.net/manual/en/function.exif-read-data.php) to access EXIF information in php. A good code sample on how to use this command is shown in the manual within the link below. <http://www.php.net/manual/en/function.exif-read-data.php> But afaik currently not many cameras code t...
5,857,820
How to get camera serial number from EXIF ? --- Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"
2011/05/02
[ "https://Stackoverflow.com/questions/5857820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
Almost all DSLR cameras code the serial number into the EXIF info in the maker notes section. The reason most people don't see it in the EXIF info is that Adobe products all but ignore the maker notes section of the EXIF info. So if you are viewing the EXIF info using an Adobe product you won't see the serial number. B...
You can use [`exif_read_data`](http://www.php.net/manual/en/function.exif-read-data.php) to access EXIF information in php. A good code sample on how to use this command is shown in the manual within the link below. <http://www.php.net/manual/en/function.exif-read-data.php> But afaik currently not many cameras code t...
5,857,820
How to get camera serial number from EXIF ? --- Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"
2011/05/02
[ "https://Stackoverflow.com/questions/5857820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192910/" ]
As has been mentioned, not all cameras store the serial number. However, most of the DSLRs do. The serial number is actually stored in the MakerNotes section of the EXIF. This is a proprietary section for manufacturers to write in whatever format they like. I've extended the great work by [Jacob Seidelin](http://blog...
Almost all DSLR cameras code the serial number into the EXIF info in the maker notes section. The reason most people don't see it in the EXIF info is that Adobe products all but ignore the maker notes section of the EXIF info. So if you are viewing the EXIF info using an Adobe product you won't see the serial number. B...
41,955,243
I have an object like this, ``` { "Distrubutor":"DISTRIBUTOR1", "INCLUDE":"INDIA,United States", "EXCLUDE":"KARNATAKA-INDIA,CHENNAI-TAMILNADU-INDIA", "PARENT-ID":"" } ``` i want to Generate the Multiple objecs By using the INCLUDE Property in the Main object, can anybody help me on this ``` { "p...
2017/01/31
[ "https://Stackoverflow.com/questions/41955243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4431509/" ]
You could split the included countries and map new objects. ```js var data = {"Distrubutor":"DISTRIBUTOR1","INCLUDE":"INDIA,United States","EXCLUDE":"KARNATAKA-INDIA,CHENNAI-TAMILNADU-INDIA","PARENT-ID":""}, include = data.INCLUDE.split(',').map(function (a) { return { parent_id: "", ...
You can try something like this: ```js var obj = {"Distrubutor":"DISTRIBUTOR1","INCLUDE":"INDIA,United States","EXCLUDE":"KARNATAKA-INDIA,CHENNAI-TAMILNADU-INDIA","PARENT-ID":""} // Keys that does not need to be in returned object var ignoreKeys = ["EXCLUDE", "INCLUDE"]; var tmp = Object.assign({}, obj) // Dele...
41,955,243
I have an object like this, ``` { "Distrubutor":"DISTRIBUTOR1", "INCLUDE":"INDIA,United States", "EXCLUDE":"KARNATAKA-INDIA,CHENNAI-TAMILNADU-INDIA", "PARENT-ID":"" } ``` i want to Generate the Multiple objecs By using the INCLUDE Property in the Main object, can anybody help me on this ``` { "p...
2017/01/31
[ "https://Stackoverflow.com/questions/41955243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4431509/" ]
You could split the included countries and map new objects. ```js var data = {"Distrubutor":"DISTRIBUTOR1","INCLUDE":"INDIA,United States","EXCLUDE":"KARNATAKA-INDIA,CHENNAI-TAMILNADU-INDIA","PARENT-ID":""}, include = data.INCLUDE.split(',').map(function (a) { return { parent_id: "", ...
This is another approach to solve current problem what could also be answer for possible new question "How could you make it more complex" ```js class PropertyAdapter { *populate(target, option){} } class DistrubutorAdapter extends PropertyAdapter { *populate(target, option){ target.id = option; yie...
27,786,287
I have an String array called `data` which contains : ``` data: [Solaergy, 3255, Solagy, 3635, Soly, 36235, Solar energy, 54128, Solar energy, 54665, Solar energy, 563265] ``` Now i want to split `data` into two arrays `title` and `isbn` (of books): ``` String[] titles = new String[data.length]; String[] isbnS = ne...
2015/01/05
[ "https://Stackoverflow.com/questions/27786287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You got the indices wrong : ``` String[] titles = new String[data.length/2]; String[] isbnS = new String[data.length/2]; int count = 0; for (int i = 0; i < data.length; i += 2) { titles[count] = data[i]; isbnS[count] = data[i + 1]; count++; } ```
``` for (int i = 0, j=0; i < data.length; i += 2, j++) { titles[j] = data[i]; isbnS[j] = data[i + 1]; } ```
27,786,287
I have an String array called `data` which contains : ``` data: [Solaergy, 3255, Solagy, 3635, Soly, 36235, Solar energy, 54128, Solar energy, 54665, Solar energy, 563265] ``` Now i want to split `data` into two arrays `title` and `isbn` (of books): ``` String[] titles = new String[data.length]; String[] isbnS = ne...
2015/01/05
[ "https://Stackoverflow.com/questions/27786287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You got the indices wrong : ``` String[] titles = new String[data.length/2]; String[] isbnS = new String[data.length/2]; int count = 0; for (int i = 0; i < data.length; i += 2) { titles[count] = data[i]; isbnS[count] = data[i + 1]; count++; } ```
I think what you're trying to do is put one element n one array and the next one in the other. However, you're trying to store integers in a string array. This is what I would do: ``` String[] titles = new String[data.length/2]; int[] isbnS = new int[data.length/2]; int j=0; for(int i=0; i<data.length; i+=2) { t...
27,786,287
I have an String array called `data` which contains : ``` data: [Solaergy, 3255, Solagy, 3635, Soly, 36235, Solar energy, 54128, Solar energy, 54665, Solar energy, 563265] ``` Now i want to split `data` into two arrays `title` and `isbn` (of books): ``` String[] titles = new String[data.length]; String[] isbnS = ne...
2015/01/05
[ "https://Stackoverflow.com/questions/27786287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` for (int i = 0, j=0; i < data.length; i += 2, j++) { titles[j] = data[i]; isbnS[j] = data[i + 1]; } ```
I think what you're trying to do is put one element n one array and the next one in the other. However, you're trying to store integers in a string array. This is what I would do: ``` String[] titles = new String[data.length/2]; int[] isbnS = new int[data.length/2]; int j=0; for(int i=0; i<data.length; i+=2) { t...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
Yet another way with [*reduce*](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) and [*map*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [*concat*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obje...
Since this is not built into the language, here's a simple function with a similar signature to the built-in `zip`: ``` func cartesianProduct<Sequence1, Sequence2>(_ sequence1: Sequence1, _ sequence2: Sequence2) -> [(Sequence1.Element, Sequence2.Element)] where Sequence1 : Sequence, Sequence2 : Sequence { var ...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
You can use [`Array.prototype.forEach()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) for the iteration over the arrays. > > The `forEach()` method executes a provided function once per array element. > > > ```js var array1 = [1, 2, 3, 4, 5], array2 = ["one...
You can use this method when `array1.length` and `array2.length` are equal. ```js var array1 = [1, 2, 3, 4, 5]; var array2 = ["one", "two", "three", "four", "five"]; var length = array1.length; var array3 = new Array(Math.pow(length, 2)).fill(0).map((v, i) => array2[i % length] + ' ' + array1[i / length << 0]); d...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
You can use two for-loops: ``` var array1 = [1,2,3,4,5]; var array2 = ["one","two","three","four","five"]; var array3 = []; for (var i = 0; i < array1.length; i++) { for (var j = 0; j < array2.length; j++) { array3.push(array2[j] + ' ' + array1[i]); } } console.log(array3); ```
Yet another way with [*reduce*](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) and [*map*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [*concat*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obje...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
You can use this method when `array1.length` and `array2.length` are equal. ```js var array1 = [1, 2, 3, 4, 5]; var array2 = ["one", "two", "three", "four", "five"]; var length = array1.length; var array3 = new Array(Math.pow(length, 2)).fill(0).map((v, i) => array2[i % length] + ' ' + array1[i / length << 0]); d...
Since this is not built into the language, here's a simple function with a similar signature to the built-in `zip`: ``` func cartesianProduct<Sequence1, Sequence2>(_ sequence1: Sequence1, _ sequence2: Sequence2) -> [(Sequence1.Element, Sequence2.Element)] where Sequence1 : Sequence, Sequence2 : Sequence { var ...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
You can use this method when `array1.length` and `array2.length` are equal. ```js var array1 = [1, 2, 3, 4, 5]; var array2 = ["one", "two", "three", "four", "five"]; var length = array1.length; var array3 = new Array(Math.pow(length, 2)).fill(0).map((v, i) => array2[i % length] + ' ' + array1[i / length << 0]); d...
Try (JS) ``` function myFunction(){ var F = [1, 2, 3, 4,5]; var S = ["one", "two", "three", "four", "five"]; var Result = []; var k=0; for (var i = 0; i < F.length; i++) { for (var j = 0; j < S.length; j++) { Result[k++] = ...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
You can use two for-loops: ``` var array1 = [1,2,3,4,5]; var array2 = ["one","two","three","four","five"]; var array3 = []; for (var i = 0; i < array1.length; i++) { for (var j = 0; j < array2.length; j++) { array3.push(array2[j] + ' ' + array1[i]); } } console.log(array3); ```
There is still the option with loops: ``` var array2 = [1,2,3,4,5], array1 = ["one","two","three","four","five"], m = []; for(var a1 in array1){ for(var a2 in array2){ m.push( array1[a1]+ array2[a2] ); } } console.log(m); ```
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
There is still the option with loops: ``` var array2 = [1,2,3,4,5], array1 = ["one","two","three","four","five"], m = []; for(var a1 in array1){ for(var a2 in array2){ m.push( array1[a1]+ array2[a2] ); } } console.log(m); ```
Try (JS) ``` function myFunction(){ var F = [1, 2, 3, 4,5]; var S = ["one", "two", "three", "four", "five"]; var Result = []; var k=0; for (var i = 0; i < F.length; i++) { for (var j = 0; j < S.length; j++) { Result[k++] = ...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
You can use two for-loops: ``` var array1 = [1,2,3,4,5]; var array2 = ["one","two","three","four","five"]; var array3 = []; for (var i = 0; i < array1.length; i++) { for (var j = 0; j < array2.length; j++) { array3.push(array2[j] + ' ' + array1[i]); } } console.log(array3); ```
You can use [`Array.prototype.forEach()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) for the iteration over the arrays. > > The `forEach()` method executes a provided function once per array element. > > > ```js var array1 = [1, 2, 3, 4, 5], array2 = ["one...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
Yet another way with [*reduce*](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) and [*map*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [*concat*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obje...
You can use this method when `array1.length` and `array2.length` are equal. ```js var array1 = [1, 2, 3, 4, 5]; var array2 = ["one", "two", "three", "four", "five"]; var length = array1.length; var array3 = new Array(Math.pow(length, 2)).fill(0).map((v, i) => array2[i % length] + ' ' + array1[i / length << 0]); d...
34,826,075
I have ``` array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; ``` I want to get `array3` where all elements of `array1` with first (and others) element of `array2` and etc. For example: ``` array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2".....
2016/01/16
[ "https://Stackoverflow.com/questions/34826075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5625598/" ]
You can use [`Array.prototype.forEach()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) for the iteration over the arrays. > > The `forEach()` method executes a provided function once per array element. > > > ```js var array1 = [1, 2, 3, 4, 5], array2 = ["one...
There is still the option with loops: ``` var array2 = [1,2,3,4,5], array1 = ["one","two","three","four","five"], m = []; for(var a1 in array1){ for(var a2 in array2){ m.push( array1[a1]+ array2[a2] ); } } console.log(m); ```
42,224,448
I'm having some trouble trying to create a vertical line through multiple `<li>`'s, while having some text and an image above it. What I would like to achieve is something like the image below. [![enter image description here](https://i.stack.imgur.com/j0ie7.png)](https://i.stack.imgur.com/j0ie7.png) I already found ...
2017/02/14
[ "https://Stackoverflow.com/questions/42224448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1569782/" ]
You could use first `li` for image and text and position it with `position: absolute` so it is aligned with the line. Also you need to add `padding-top` on `ul` and subtract same amount from height of the red line. ```css ul { position: relative; list-style: none; padding-top: 80px; } li:first-child { po...
It would be better if you use the `::before` (or `::after`) pseudo element on each `<li>` for the line so you can save the `<ul>` pseudo elements for the text and image, like this: ```css ul { list-style: none; padding: 0; padding-top: 40px; position: relative; } ul::before { content: ""; display: ...
42,224,448
I'm having some trouble trying to create a vertical line through multiple `<li>`'s, while having some text and an image above it. What I would like to achieve is something like the image below. [![enter image description here](https://i.stack.imgur.com/j0ie7.png)](https://i.stack.imgur.com/j0ie7.png) I already found ...
2017/02/14
[ "https://Stackoverflow.com/questions/42224448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1569782/" ]
You could use first `li` for image and text and position it with `position: absolute` so it is aligned with the line. Also you need to add `padding-top` on `ul` and subtract same amount from height of the red line. ```css ul { position: relative; list-style: none; padding-top: 80px; } li:first-child { po...
```css .wrap { position: relative; width: 30%; background: lightgreen; z-index: 1; } .header { width: 100%; } .header img { width: 100%; margin: 0; float: left; } .header p { background: tomato; text-align: center; } .header p:after { content: ' '; width: 4px; height: 100%...
42,224,448
I'm having some trouble trying to create a vertical line through multiple `<li>`'s, while having some text and an image above it. What I would like to achieve is something like the image below. [![enter image description here](https://i.stack.imgur.com/j0ie7.png)](https://i.stack.imgur.com/j0ie7.png) I already found ...
2017/02/14
[ "https://Stackoverflow.com/questions/42224448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1569782/" ]
It would be better if you use the `::before` (or `::after`) pseudo element on each `<li>` for the line so you can save the `<ul>` pseudo elements for the text and image, like this: ```css ul { list-style: none; padding: 0; padding-top: 40px; position: relative; } ul::before { content: ""; display: ...
```css .wrap { position: relative; width: 30%; background: lightgreen; z-index: 1; } .header { width: 100%; } .header img { width: 100%; margin: 0; float: left; } .header p { background: tomato; text-align: center; } .header p:after { content: ' '; width: 4px; height: 100%...
56,628,779
I am trying to create `UICollectionView` *Horizontal scrolling* (like a top menu single row) with `cell label`. Here, I need to implement my label content different length so based on different length cell label should auto adjust Its width. I am using storyboard for my design. **Below my code** ``` extension Camer...
2019/06/17
[ "https://Stackoverflow.com/questions/56628779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11658199/" ]
Implement `UICollectionViewDelegateFlowLayout's` method `collectionView(_:layout:sizeForItemAt)` and calculate the `width` of `collectionViewCell` based the `width` of `text` that you're populating the `label` with. ``` func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionVi...
Step 1 : Find the width of the text that has to be placed in each cell. This can be found using below function `string.size(withAttributes:[.font: UIFont.systemFont(ofSize: 14.0)]).width` Using this function we can find width of dynamic text during run time. Step 2: Set the size of each cell using the width that we ...
1,055,457
I'm trying to troubleshoot connectivity issues for one of our employees who's using a OpenVPN client to connect to our office infrastructure. AFAIK, he's the only one affected by this issue which basically lets him connect fine but after a few minutes up to one or two hours disconnects him. He's using W10 via wifi wit...
2021/03/01
[ "https://serverfault.com/questions/1055457", "https://serverfault.com", "https://serverfault.com/users/556261/" ]
Sounds like you have enabled deletion protection in Google Cloud Platform. To check this go to; Computer Engine > [VM instances](https://console.cloud.google.com/compute/instances), and then click on the instance you are having the issue with. Up the top click the edit button > scroll down the page a little bit to Del...
Here is a link to the answer from google cloud documentation in case you would like to see it. <https://cloud.google.com/compute/docs/instances/preventing-accidental-vm-deletion#toggling_deletion_protection_for_existing_instances>
38,018,716
Let's say a have a pointer as a parameter, why doesn't it's value remain modified after the and of a function, and i have to use this syntax : ``` void function_name (int **p) { // code } ``` and in main() : ``` int *v; function name (&v); ``` I want to specify that i use a pointer to a struct type as a paramet...
2016/06/24
[ "https://Stackoverflow.com/questions/38018716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5915857/" ]
C passes arguments by value. If you want to modify something in a function and make the modification take effect in the calling function, a pointer to the variable in the calling function has to be passed. Otherwise, any changes made to the variable in a function are only local changes and does not affect the value of ...
In C, arguments are passed by value. This means that when you pass an argument to a function, a copy of that variable is made. For example ``` int main() { int x = 6; repchar(x, 'r'); printf("%d\n", x); return 0; } void repchar(int n, char c) { while (--n >= 0) putchar(c); } ``` This pro...
6,593,081
I have something like this ``` <c:forEach var="authority" items="#{SPRING_SECURITY_CONTEXT.authentication.principal.authorities}"> <c:if test="${fn:contains( ${authority} , ROLE_ADMIN) }"> </c:if> </c:forEach> ``` but it does not working, any ide how can I make this? Maybe there is some other way? ...
2011/07/06
[ "https://Stackoverflow.com/questions/6593081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644401/" ]
There are 2 problems: 1. You should not nest EL expressions. Just reference the EL variable the usual way. ``` <c:if test="${fn:contains(authority, ROLE_ADMIN)}"> ``` 2. It's not clear from the question context if `ROLE_ADMIN` is already in the EL scope. But you need to know that you cannot reference constants in EL...
You're missing a closing ")" in your if test: ``` <c:forEach var="authority" items="#{SPRING_SECURITY_CONTEXT.authentication.principal.authorities}"> <c:if test="${fn:contains( {$authority} , ROLE_ADMIN ) }"> </c:if> </c:forEach> ```
55,066,290
This program prints out "Nobody is busy its just a matter of PRIORITIES". If the user answers "no" to the time question, I want it to say that if you answered "no" to the time question and yes to at least one other question. If you answer "no" to all the questions, it should instead say "You are not from us". I'm unsur...
2019/03/08
[ "https://Stackoverflow.com/questions/55066290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10869513/" ]
This is not valid c# code: ========================== ``` //get cariables from other script DragonAncors.cs.GetComponent.<DragonTracker>() GoldDragonInit = GoldDragonSpawn; ``` Why? Because it isn't inside a method. Also, the comment is wrong. It isn't *getting* a variable (typo, too), its *setting* a variable in a...
There are a lot of errors there and they may take some steps to go through, but first things first you should clear up the issue with the code you're trying to use being unsupported. Go into the project settings and change the compiler language version as it notes on the 5th error down. This should allow you to use the...
55,066,290
This program prints out "Nobody is busy its just a matter of PRIORITIES". If the user answers "no" to the time question, I want it to say that if you answered "no" to the time question and yes to at least one other question. If you answer "no" to all the questions, it should instead say "You are not from us". I'm unsur...
2019/03/08
[ "https://Stackoverflow.com/questions/55066290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10869513/" ]
This is how you can get to DragonTracker: ``` DragonTracker dt = GameObject.Find("DragonAncores").GetComponent<DragonTracker>() Debug.Log(dt.DragonCount); ```
There are a lot of errors there and they may take some steps to go through, but first things first you should clear up the issue with the code you're trying to use being unsupported. Go into the project settings and change the compiler language version as it notes on the 5th error down. This should allow you to use the...
55,066,290
This program prints out "Nobody is busy its just a matter of PRIORITIES". If the user answers "no" to the time question, I want it to say that if you answered "no" to the time question and yes to at least one other question. If you answer "no" to all the questions, it should instead say "You are not from us". I'm unsur...
2019/03/08
[ "https://Stackoverflow.com/questions/55066290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10869513/" ]
There are a few errors in your code here. The following is incorrect. ``` //get cariables from other script DragonAncors.cs.GetComponent.<DragonTracker>() GoldDragonInit = GoldDragonSpawn; ``` The correct way to access this, seeing as you said DragonAncors is the parent would be: ``` GetComponentInParent<Dragon...
There are a lot of errors there and they may take some steps to go through, but first things first you should clear up the issue with the code you're trying to use being unsupported. Go into the project settings and change the compiler language version as it notes on the 5th error down. This should allow you to use the...
55,066,290
This program prints out "Nobody is busy its just a matter of PRIORITIES". If the user answers "no" to the time question, I want it to say that if you answered "no" to the time question and yes to at least one other question. If you answer "no" to all the questions, it should instead say "You are not from us". I'm unsur...
2019/03/08
[ "https://Stackoverflow.com/questions/55066290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10869513/" ]
There are a few errors in your code here. The following is incorrect. ``` //get cariables from other script DragonAncors.cs.GetComponent.<DragonTracker>() GoldDragonInit = GoldDragonSpawn; ``` The correct way to access this, seeing as you said DragonAncors is the parent would be: ``` GetComponentInParent<Dragon...
This is not valid c# code: ========================== ``` //get cariables from other script DragonAncors.cs.GetComponent.<DragonTracker>() GoldDragonInit = GoldDragonSpawn; ``` Why? Because it isn't inside a method. Also, the comment is wrong. It isn't *getting* a variable (typo, too), its *setting* a variable in a...
55,066,290
This program prints out "Nobody is busy its just a matter of PRIORITIES". If the user answers "no" to the time question, I want it to say that if you answered "no" to the time question and yes to at least one other question. If you answer "no" to all the questions, it should instead say "You are not from us". I'm unsur...
2019/03/08
[ "https://Stackoverflow.com/questions/55066290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10869513/" ]
There are a few errors in your code here. The following is incorrect. ``` //get cariables from other script DragonAncors.cs.GetComponent.<DragonTracker>() GoldDragonInit = GoldDragonSpawn; ``` The correct way to access this, seeing as you said DragonAncors is the parent would be: ``` GetComponentInParent<Dragon...
This is how you can get to DragonTracker: ``` DragonTracker dt = GameObject.Find("DragonAncores").GetComponent<DragonTracker>() Debug.Log(dt.DragonCount); ```
39,552,827
I'm using the [jQuery flip plugin](https://nnattawat.github.io/flip/#Options) to flip images in an ejs file in node. The flip animation works, but any element below the flip element overlaps with the flip element. Simple code that illustrates my issue: ``` <head> <title>James Riley</title> <script src="h...
2016/09/17
[ "https://Stackoverflow.com/questions/39552827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6263989/" ]
If you look at the source they are absolute positioning the front and back elements. It may be a bit hacky but you could set the height when your calling the flip function: ``` var height = $("#flipImage").outerHeight(); $("#flipImage").flip().height(height); ``` and add this style to the container: ``` display:fl...
It looks like this is a known issue with the plugin: > > "When I flip it to the back, which is the long sidebar, it doesn't > expand the container to fill the sidebar. Instead it just overlaps the > content..." > > > You can follow the status on the [github issue page.](https://github.com/nnattawat/flip/issues/...
421,451
What is the literary device used in “She’s not just showing you what *she made*. She’s showing you what *she’s made of*” At first, I thought it was chiasmus, but it does not really fit. Certain that it is a type of repetition, but I do not know what it would be specifically called.
2017/12/07
[ "https://english.stackexchange.com/questions/421451", "https://english.stackexchange.com", "https://english.stackexchange.com/users/270700/" ]
Examples of the rhetorical figures of speech called zeugma or syllepsis are relatively easy to spot but more difficult to analyze. Even the definitions of these two figures can be difficult to understand! Nevertheless, syllepsis and zeugma can be effective and even memorable ways of phrasing words and are worthwhile s...
We did this in our English lesson yesterday so I'm pretty sure this is right. I believe the term you're looking for is '**anaphora**'. It's basically when you have sentences that are comprised of the same words/phrases (which I think is the case here).
339,844
The script I use for select\_analysis is no longer working. I believe part of the problem is the source data I use (and I'm not the administrator of) has changed the field properties of the attribute I use in my where\_clause to string. What I need my script to do is extract each polygon and export it to another shape...
2019/10/25
[ "https://gis.stackexchange.com/questions/339844", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/152516/" ]
You have to use: `QgsCoordinateTransform(src_crs,dest_crs, QgsProject.instance())` where src\_crs is the `QgsCoordinateReferenceSystem` of you layer and dest\_crs the `QgsCoordinateReferenceSystem` of WGS84.
Hope this helps: ``` prj = QgsProject.instance() dest_crs= QgsCoordinateReferenceSystem("EPSG:4326")#WGS84 src_crs= prj.crs() transformation = QgsCoordinateTransform(src_crs, dest_crs, prj) yourPoint = QgsPoint(QgsPoint(994369,515288))#example coords yourPoint.transform(transformation) print(yourPoint.x(), "/", yourP...
55,412,328
I am trying to use a GitHub library (MeowBottomNavigation)in Android Studio.But its written in kotlin and i cant use the listeners in it. The only thing which is given is this ``` bottomNavigation.setOnShowListener { } bottomNavigation.setOnClickMenuListener { } ``` the suggestions shows to use (Function1) i a...
2019/03/29
[ "https://Stackoverflow.com/questions/55412328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10950977/" ]
Function0, Function1, Function2, ... FunctionN are higher-order functions in kotlin. After converting to java, your click listeners become something like below. ``` // Set Menu Click Listener bottomNavigation.setOnClickMenuListener(new Function1<MeowBottomNavigation.Model, Unit>() { @Override public ...
something like This:: ``` bottomNavigation.setOnShowListener( new IBottomNavigationListener(Model model) { } ); ```
55,412,328
I am trying to use a GitHub library (MeowBottomNavigation)in Android Studio.But its written in kotlin and i cant use the listeners in it. The only thing which is given is this ``` bottomNavigation.setOnShowListener { } bottomNavigation.setOnClickMenuListener { } ``` the suggestions shows to use (Function1) i a...
2019/03/29
[ "https://Stackoverflow.com/questions/55412328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10950977/" ]
Function0, Function1, Function2, ... FunctionN are higher-order functions in kotlin. After converting to java, your click listeners become something like below. ``` // Set Menu Click Listener bottomNavigation.setOnClickMenuListener(new Function1<MeowBottomNavigation.Model, Unit>() { @Override public ...
**if you are using fragments** //1.-declare fragments globally in your activity ``` private HomeFragment homeFragment = new HomeFragment(); ``` //2.- declare a method to switch between fragments ``` public void loadFragment(Fragment fragment){ FragmentTransaction transaction = getSupportFragmentManager().b...
55,412,328
I am trying to use a GitHub library (MeowBottomNavigation)in Android Studio.But its written in kotlin and i cant use the listeners in it. The only thing which is given is this ``` bottomNavigation.setOnShowListener { } bottomNavigation.setOnClickMenuListener { } ``` the suggestions shows to use (Function1) i a...
2019/03/29
[ "https://Stackoverflow.com/questions/55412328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10950977/" ]
Function0, Function1, Function2, ... FunctionN are higher-order functions in kotlin. After converting to java, your click listeners become something like below. ``` // Set Menu Click Listener bottomNavigation.setOnClickMenuListener(new Function1<MeowBottomNavigation.Model, Unit>() { @Override public ...
use implementation 'com.etebarian:meow-bottom-navigation-java:1.2.0' for details watch <https://www.youtube.com/watch?v=MiphbOtSyWY>
61,825,176
Vim autoindents too far (more than 4 spaces) for the following R code: ``` lapply(1:10, function(x){ Something here }) ``` How can I fix this? Here is a picture: [![Vim autoindents too far with an lapply](https://i.stack.imgur.com/Ilm8A.png)](https://i.stack.imgur.com/Ilm8A.png) Here is a minimal .vimrc w...
2020/05/15
[ "https://Stackoverflow.com/questions/61825176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5946924/" ]
I've found the solution: Adding ``` let r_indent_align_args = 0 ``` to my .vimrc fixed the problem. See :h ft-r-indent for further information.
Just use .vimrc option shiftwidth (for 2 spaces): `set shiftwidth=2` Source: <http://vimdoc.sourceforge.net/htmldoc/options.html#'shiftwidth'>
44,615,091
I'm trying to implement performance logging based off of this post: <http://www.baeldung.com/spring-performance-logging>. I'd like to log each controller endpoint and every database request. If you would like to see the full project, you can find it [here](https://github.com/ndrone/phonebook-example/tree/feature/aopPer...
2017/06/18
[ "https://Stackoverflow.com/questions/44615091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2980345/" ]
`AbstractTraceInterceptor` implements `MethodInterceptor` and has its `invoke()` method implemented as follows: ``` public Object invoke(MethodInvocation invocation) throws Throwable { Log logger = getLoggerForInvocation(invocation); if (isInterceptorEnabled(invocation, logger)) { return invokeUnderTra...
I never understood the importance of `AbstractTraceInterceptor` if you are going to customize it. I always felt too much code for me which can be achieved by a simple `@Around` advice if you already have `@Aspect` in place. ``` @Around("execution(* com..*.*(..))") public Object logStartAndEnd(ProceedingJoin...
60,320,983
I have the following `typedef`: ``` typedef struct cell_t { int x; // x coord of this cell int y; // y coord of this cell int neighbour_count; //...
2020/02/20
[ "https://Stackoverflow.com/questions/60320983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816721/" ]
The type of the first function parameter ``` int myfun(cell_t ***cells, int width, int height){ ``` and the type of the supplied argument ``` myfun(cells, width, height); ``` do not correspond each other. The function argument declared like ``` cell_t *cells[width][height]; ``` is implicitly converted to point...
One thing is not correct in your code that i recognize is the definition of pointer. ``` cell_t *cells[width][height]; ``` This defifnition is not for pointer that points to an array 2D. Like @Lundin commented above, it is not compatible with `cell_t ***cells`. If you want to define a pointer that points to an array...
16,930,074
I'm hoping someone can help me out here. I'm building a WPF imaging application that takes live images from a camera allowing users to view the image, and subsequently highlight regions of interest (ROI) on that image. Information about the ROIs (width, height, location relative to a point on the image, etc) is then se...
2013/06/05
[ "https://Stackoverflow.com/questions/16930074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/507731/" ]
Ok. This is my take on what you described. It looks like this: ![enter image description here](https://i.stack.imgur.com/HAJUb.png) * Since I'm not applying any `RenderTransforms`, I get the desired Scrollbar / ScrollViewer functionality. * MVVM, which is THE way to go in WPF. UI and data are independent thus the Da...
In order to transform shapes without changing their stroke thickness, you may use `Path` objects with transformed geometries. The following XAML puts an Image and two Paths on a Canvas. The Image is scaled and translated by a RenderTransform. The same transform is also used for the [`Transform`](http://msdn.microsoft....
16,930,074
I'm hoping someone can help me out here. I'm building a WPF imaging application that takes live images from a camera allowing users to view the image, and subsequently highlight regions of interest (ROI) on that image. Information about the ROIs (width, height, location relative to a point on the image, etc) is then se...
2013/06/05
[ "https://Stackoverflow.com/questions/16930074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/507731/" ]
Ok. This is my take on what you described. It looks like this: ![enter image description here](https://i.stack.imgur.com/HAJUb.png) * Since I'm not applying any `RenderTransforms`, I get the desired Scrollbar / ScrollViewer functionality. * MVVM, which is THE way to go in WPF. UI and data are independent thus the Da...
Well this answer doesn't really help OP with his more specified issue but in general, camera panning, zooming in and out, and looking around (using the mouse) is quite difficult and so I just wanted to give some insight on how I implemented camera movement into my viewport scene (like Blender or Unity etc.) This is th...
222,205
In the Site, product URL is like this: `http://www.test.com/product-url-key` But when I searching the product then some product URLs are showing like this: ``` http://www.test.com/catalog/product/view/id/2221/product-url-key ``` This is not for all products. i want to url like this type `http://www.test.com/produc...
2018/04/13
[ "https://magento.stackexchange.com/questions/222205", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/44608/" ]
You can try/use [Regenerate a Url](https://github.com/olegkoval/magento2-regenerate_url_rewrites) rewrites extension. The extension allows you to regenerate a Url rewrites of products and categories. 1 > Run command to re-generate Url rewrites for all categories/products for all stores: ``` php bin/magento ok:urlrew...
Try this Marketing > url rewrite > new url rewirte Request Path "product-url-key" Target Path "catalog/product/view/id/2221" Redirect Type "no" Save and flush cache Or Marketing > url rewrite search with the "product-url-key" in Request path there you will get some idea. Hope it might help
222,205
In the Site, product URL is like this: `http://www.test.com/product-url-key` But when I searching the product then some product URLs are showing like this: ``` http://www.test.com/catalog/product/view/id/2221/product-url-key ``` This is not for all products. i want to url like this type `http://www.test.com/produc...
2018/04/13
[ "https://magento.stackexchange.com/questions/222205", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/44608/" ]
> > **Note: Please take a backup of the database** > > > To resolve this issue first delete the rows from the "url\_rewrite" table which has 'product' as 'entity\_type'. You can use below query ``` DELETE FROM `url_rewrite` where entity_type='product' ``` Then install below the extension > > <https://github.c...
Try this Marketing > url rewrite > new url rewirte Request Path "product-url-key" Target Path "catalog/product/view/id/2221" Redirect Type "no" Save and flush cache Or Marketing > url rewrite search with the "product-url-key" in Request path there you will get some idea. Hope it might help
222,205
In the Site, product URL is like this: `http://www.test.com/product-url-key` But when I searching the product then some product URLs are showing like this: ``` http://www.test.com/catalog/product/view/id/2221/product-url-key ``` This is not for all products. i want to url like this type `http://www.test.com/produc...
2018/04/13
[ "https://magento.stackexchange.com/questions/222205", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/44608/" ]
You can try/use [Regenerate a Url](https://github.com/olegkoval/magento2-regenerate_url_rewrites) rewrites extension. The extension allows you to regenerate a Url rewrites of products and categories. 1 > Run command to re-generate Url rewrites for all categories/products for all stores: ``` php bin/magento ok:urlrew...
Try this:- **Solution 1-** * **Marketing->URL Rewrite** search the URL and edit the **Request Path**. OR you also can do this from database * Go to the database select the **url\_rewrite** table search with the **"product-url-key"** in and change the **request\_path** of the product. **Solution 2-** * Go to the d...
222,205
In the Site, product URL is like this: `http://www.test.com/product-url-key` But when I searching the product then some product URLs are showing like this: ``` http://www.test.com/catalog/product/view/id/2221/product-url-key ``` This is not for all products. i want to url like this type `http://www.test.com/produc...
2018/04/13
[ "https://magento.stackexchange.com/questions/222205", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/44608/" ]
> > **Note: Please take a backup of the database** > > > To resolve this issue first delete the rows from the "url\_rewrite" table which has 'product' as 'entity\_type'. You can use below query ``` DELETE FROM `url_rewrite` where entity_type='product' ``` Then install below the extension > > <https://github.c...
Try this:- **Solution 1-** * **Marketing->URL Rewrite** search the URL and edit the **Request Path**. OR you also can do this from database * Go to the database select the **url\_rewrite** table search with the **"product-url-key"** in and change the **request\_path** of the product. **Solution 2-** * Go to the d...
222,205
In the Site, product URL is like this: `http://www.test.com/product-url-key` But when I searching the product then some product URLs are showing like this: ``` http://www.test.com/catalog/product/view/id/2221/product-url-key ``` This is not for all products. i want to url like this type `http://www.test.com/produc...
2018/04/13
[ "https://magento.stackexchange.com/questions/222205", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/44608/" ]
> > **Note: Please take a backup of the database** > > > To resolve this issue first delete the rows from the "url\_rewrite" table which has 'product' as 'entity\_type'. You can use below query ``` DELETE FROM `url_rewrite` where entity_type='product' ``` Then install below the extension > > <https://github.c...
You can try/use [Regenerate a Url](https://github.com/olegkoval/magento2-regenerate_url_rewrites) rewrites extension. The extension allows you to regenerate a Url rewrites of products and categories. 1 > Run command to re-generate Url rewrites for all categories/products for all stores: ``` php bin/magento ok:urlrew...
222,205
In the Site, product URL is like this: `http://www.test.com/product-url-key` But when I searching the product then some product URLs are showing like this: ``` http://www.test.com/catalog/product/view/id/2221/product-url-key ``` This is not for all products. i want to url like this type `http://www.test.com/produc...
2018/04/13
[ "https://magento.stackexchange.com/questions/222205", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/44608/" ]
You can try/use [Regenerate a Url](https://github.com/olegkoval/magento2-regenerate_url_rewrites) rewrites extension. The extension allows you to regenerate a Url rewrites of products and categories. 1 > Run command to re-generate Url rewrites for all categories/products for all stores: ``` php bin/magento ok:urlrew...
You can just use default magento feature URL rewrites for your concern **Marketing->SEO & Search->URL rewite** here you can create new rule for your particular URL. eg: 1. request path->http://www.test.com/product-url-key.html 2. target path->http://www.test.com/catalog/product/view/id/2221/product-url-key and you ...
222,205
In the Site, product URL is like this: `http://www.test.com/product-url-key` But when I searching the product then some product URLs are showing like this: ``` http://www.test.com/catalog/product/view/id/2221/product-url-key ``` This is not for all products. i want to url like this type `http://www.test.com/produc...
2018/04/13
[ "https://magento.stackexchange.com/questions/222205", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/44608/" ]
> > **Note: Please take a backup of the database** > > > To resolve this issue first delete the rows from the "url\_rewrite" table which has 'product' as 'entity\_type'. You can use below query ``` DELETE FROM `url_rewrite` where entity_type='product' ``` Then install below the extension > > <https://github.c...
You can just use default magento feature URL rewrites for your concern **Marketing->SEO & Search->URL rewite** here you can create new rule for your particular URL. eg: 1. request path->http://www.test.com/product-url-key.html 2. target path->http://www.test.com/catalog/product/view/id/2221/product-url-key and you ...
17,739,262
We have software that builds a sqlite database regularly (outside of Jenkins). I would like to run some tests to see if any tables in the current build are significantly smaller than in the previous build. I think that I will simply need to serialize a result to disk (or database) and manually check for differences. Is...
2013/07/19
[ "https://Stackoverflow.com/questions/17739262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/459633/" ]
The easiest way would be to add a simple script to be executed by Jenkins or embed one in your build process to export a file that later can be used by [Measurement Plots Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Measurement+Plots+Plugin). This plugin can parse an XML file with your data, keep the history for...
As of 2019 I still did not found a plugin that makes such a task easy Here a rather pragmatic approach: Usually buildlogs can be accessed view web with the pattern JENKINSHOST:8080/job/%JOBNAME%/%BUILDNR1%/consoleText With Powershell you can do something like ``` mkdir LOGS powershell.exe (new-object System.Net.We...
73,997,083
I want to run the following code, but Python gives me an error code : ``` select = input("ENTER USER FOR PASS RECOVERY : ") cursor.execute("SELECT COUNT(*) FROM user_stat WHERE usr=(%s)",(select)) ``` [python code](https://i.stack.imgur.com/cCQDw.png) error : ``` mysql.connector.errors.ProgrammingError: 1064 (4200...
2022/10/08
[ "https://Stackoverflow.com/questions/73997083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20191375/" ]
The second argument to `cursor.execute` must be an iterable of params, So you should pass them as: 1. A list: `[select]` 2. A tuple: `(select,` ). Note that passing `(select)` does not make it a tuple. And another question, which client do you use to connect to MySQL? Some clients use `?` as param placeholders and no...
You have to use {} instead of () select = input("ENTER USER FOR PASS RECOVERY : ") cursor.execute("SELECT COUNT(\*) FROM user\_stat WHERE usr={%s}",(select))
73,997,083
I want to run the following code, but Python gives me an error code : ``` select = input("ENTER USER FOR PASS RECOVERY : ") cursor.execute("SELECT COUNT(*) FROM user_stat WHERE usr=(%s)",(select)) ``` [python code](https://i.stack.imgur.com/cCQDw.png) error : ``` mysql.connector.errors.ProgrammingError: 1064 (4200...
2022/10/08
[ "https://Stackoverflow.com/questions/73997083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20191375/" ]
if you need more examples or more help similar post is here -> [How to use variables in SQL statement in Python?](https://stackoverflow.com/questions/902408/how-to-use-variables-in-sql-statement-in-python) Also take a look at Kashyap (<https://stackoverflow.com/a/21734918/2561174>) comment with a good/bad query practi...
You have to use {} instead of () select = input("ENTER USER FOR PASS RECOVERY : ") cursor.execute("SELECT COUNT(\*) FROM user\_stat WHERE usr={%s}",(select))
308,361
I have a running site (Site A). I want to re-write the site fully to improve everything but, when I'm finished, I don't want to have to get everyone to sign up to the new site. I wondered if I could create an entirely new site on a different domain (Site B) with a clean install of Wordpress - and then when I'm finish...
2018/07/12
[ "https://wordpress.stackexchange.com/questions/308361", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/39292/" ]
Of course there’s a function for that ([Codex](https://codex.wordpress.org/Function_Reference/switch_theme)): ``` switch_theme( $stylesheet ) ``` It: > > Switches current theme to new template and stylesheet names. Accepts > one argument: $stylesheet of the theme. ($stylesheet is the name of > your folder slug. ...
The only thing that comes to my mind is to do it from the database, so basically after you check the checkbox status, you will have to select the `wp_options` table, you will need to locate two rows **template** and **stylesheet**. [![enter image description here](https://i.stack.imgur.com/ohCUL.png)](https://i.stack....
20,312,512
I'm using Titanium Studio. All I want are some icons in my iphone app. In my tiapp.xml is this section: ``` <ios> <plist> <dict> <key>CFBundleIconFiles</key> <array> <string>appicon.png</string> <string>appicon@2x.png</string> <string>appicon76.png</string> <string>appicon76@2x.png</string> <string>appicon72@2x.png<...
2013/12/01
[ "https://Stackoverflow.com/questions/20312512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3054424/" ]
You have a `while` loop that closes `readr` on every pass. The next time it gets to the `try` block, `readr` is closed. Perhaps you intended to put the `try/catch` block around the `while` loop?
You are closing the reader inside the loop that reads from it. You need to close it outside of the loop: ``` try { String line; while (data.serverStarted() && ((line = readr.readLine()) != null)) { try { data.updateConsole(line); } catch (IOException e) { e.print...
20,312,512
I'm using Titanium Studio. All I want are some icons in my iphone app. In my tiapp.xml is this section: ``` <ios> <plist> <dict> <key>CFBundleIconFiles</key> <array> <string>appicon.png</string> <string>appicon@2x.png</string> <string>appicon76.png</string> <string>appicon76@2x.png</string> <string>appicon72@2x.png<...
2013/12/01
[ "https://Stackoverflow.com/questions/20312512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3054424/" ]
You have a `while` loop that closes `readr` on every pass. The next time it gets to the `try` block, `readr` is closed. Perhaps you intended to put the `try/catch` block around the `while` loop?
I am surprised that this code even compiles. You declare the actual InputStream `is` inside the try/catch at the beginning, but that makes it only visible inside that block. So whatever you give to the BufferedReader a few lines below is something else and most likely not what you think it is. In addition your `while...
26,722,279
I want to do something like this: ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" ``` when I try: ``` print app.static_url_path ``` I get the correct `static_url_path` But in my templates when I use `url_for('static')`, The html file generat...
2014/11/03
[ "https://Stackoverflow.com/questions/26722279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3873617/" ]
Flask creates the URL route *when you create the `Flask()` object*. You'll need to re-add that route: ``` # remove old static map url_map = app.url_map try: for rule in url_map.iter_rules('static'): url_map._rules.remove(rule) except ValueError; # no static view was created yet pass # register new...
The accepted answer is correct, but slightly incomplete. It is true that in order to change the `static_url_path` one must also update the app's `url_map` by removing the existing `Rule` for the `static` endpoint and adding a new `Rule` with the modified url path. However, one must also update the [`_rules_by_endpoint`...
26,722,279
I want to do something like this: ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" ``` when I try: ``` print app.static_url_path ``` I get the correct `static_url_path` But in my templates when I use `url_for('static')`, The html file generat...
2014/11/03
[ "https://Stackoverflow.com/questions/26722279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3873617/" ]
Flask creates the URL route *when you create the `Flask()` object*. You'll need to re-add that route: ``` # remove old static map url_map = app.url_map try: for rule in url_map.iter_rules('static'): url_map._rules.remove(rule) except ValueError; # no static view was created yet pass # register new...
Just to complete the answer above, we also need to clear the view\_functions that maps the endpoint with the delegate: ``` app.view_functions["static"] = None ```
26,722,279
I want to do something like this: ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" ``` when I try: ``` print app.static_url_path ``` I get the correct `static_url_path` But in my templates when I use `url_for('static')`, The html file generat...
2014/11/03
[ "https://Stackoverflow.com/questions/26722279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3873617/" ]
Flask creates the URL route *when you create the `Flask()` object*. You'll need to re-add that route: ``` # remove old static map url_map = app.url_map try: for rule in url_map.iter_rules('static'): url_map._rules.remove(rule) except ValueError; # no static view was created yet pass # register new...
I think you missed `static_folder` ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" app.static_folder = app.config['PREFIX']+"/static" ```
26,722,279
I want to do something like this: ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" ``` when I try: ``` print app.static_url_path ``` I get the correct `static_url_path` But in my templates when I use `url_for('static')`, The html file generat...
2014/11/03
[ "https://Stackoverflow.com/questions/26722279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3873617/" ]
The accepted answer is correct, but slightly incomplete. It is true that in order to change the `static_url_path` one must also update the app's `url_map` by removing the existing `Rule` for the `static` endpoint and adding a new `Rule` with the modified url path. However, one must also update the [`_rules_by_endpoint`...
Just to complete the answer above, we also need to clear the view\_functions that maps the endpoint with the delegate: ``` app.view_functions["static"] = None ```
26,722,279
I want to do something like this: ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" ``` when I try: ``` print app.static_url_path ``` I get the correct `static_url_path` But in my templates when I use `url_for('static')`, The html file generat...
2014/11/03
[ "https://Stackoverflow.com/questions/26722279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3873617/" ]
The accepted answer is correct, but slightly incomplete. It is true that in order to change the `static_url_path` one must also update the app's `url_map` by removing the existing `Rule` for the `static` endpoint and adding a new `Rule` with the modified url path. However, one must also update the [`_rules_by_endpoint`...
I think you missed `static_folder` ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" app.static_folder = app.config['PREFIX']+"/static" ```
26,722,279
I want to do something like this: ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" ``` when I try: ``` print app.static_url_path ``` I get the correct `static_url_path` But in my templates when I use `url_for('static')`, The html file generat...
2014/11/03
[ "https://Stackoverflow.com/questions/26722279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3873617/" ]
Just to complete the answer above, we also need to clear the view\_functions that maps the endpoint with the delegate: ``` app.view_functions["static"] = None ```
I think you missed `static_folder` ``` app = Flask(__name__) app.config.from_object(mypackage.config) app.static_url_path = app.config['PREFIX']+"/static" app.static_folder = app.config['PREFIX']+"/static" ```
36,512,852
I have PGP key that let's me sign the commits via `git commit -S`. To sign my last commit I did a `git commit -S --amend --no-edit` and it signed my commit. Now, I want to sign all the commits that are there in the branch `filtered`. I tried: `git filter-branch --commit-filter 'git commit -S --amend --no-edit'` and...
2016/04/09
[ "https://Stackoverflow.com/questions/36512852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Consider that rewriting history to sign all the commits in a branch may be overkill. Because of the git object model, a commit exists in context. Signing the head commit alone also imputes your blessing to its immediate parent (or parents if it is a merge commit) as well as their parents in turn all the way back to da...
probably you should setup a [gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html) with a decent timeout for passphrase validity (enough to run the whole sequence of rewrites). See this Arch [wiki page](https://wiki.archlinux.org/index.php/GnuPG#gpg-agent) for help. Thus, can enter the passph...
36,512,852
I have PGP key that let's me sign the commits via `git commit -S`. To sign my last commit I did a `git commit -S --amend --no-edit` and it signed my commit. Now, I want to sign all the commits that are there in the branch `filtered`. I tried: `git filter-branch --commit-filter 'git commit -S --amend --no-edit'` and...
2016/04/09
[ "https://Stackoverflow.com/questions/36512852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Make a backup of your repository before you get started: ``` tar czf my-repo-backup-2022-03-04.tar.gz ./my-repo ``` Sign all commits in since first commit without modifying commit date: ``` FIRST_COMMIT="$(git rev-list --max-parents=0 HEAD)" git filter-branch --commit-filter 'git commit-tree -S "$@";' "${FIRST_COMM...
probably you should setup a [gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html) with a decent timeout for passphrase validity (enough to run the whole sequence of rewrites). See this Arch [wiki page](https://wiki.archlinux.org/index.php/GnuPG#gpg-agent) for help. Thus, can enter the passph...
36,512,852
I have PGP key that let's me sign the commits via `git commit -S`. To sign my last commit I did a `git commit -S --amend --no-edit` and it signed my commit. Now, I want to sign all the commits that are there in the branch `filtered`. I tried: `git filter-branch --commit-filter 'git commit -S --amend --no-edit'` and...
2016/04/09
[ "https://Stackoverflow.com/questions/36512852", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Consider that rewriting history to sign all the commits in a branch may be overkill. Because of the git object model, a commit exists in context. Signing the head commit alone also imputes your blessing to its immediate parent (or parents if it is a merge commit) as well as their parents in turn all the way back to da...
Make a backup of your repository before you get started: ``` tar czf my-repo-backup-2022-03-04.tar.gz ./my-repo ``` Sign all commits in since first commit without modifying commit date: ``` FIRST_COMMIT="$(git rev-list --max-parents=0 HEAD)" git filter-branch --commit-filter 'git commit-tree -S "$@";' "${FIRST_COMM...
50,383,799
Basically ProductOffer table. Migration ``` $this->createTable('product_offer', [ 'id' => $this->primaryKey(), 'product_id' => $this->bigInteger(20) . ' NOT NULL', 'customer_id' => $this->bigInteger(20), 'coupon_code' => $this->string(), 'offer' => $this->string(), 'cu...
2018/05/17
[ "https://Stackoverflow.com/questions/50383799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3721154/" ]
You may use raw SQL content with a `WHERE` call in string format, and it is also possible to and together two `WHERE` calls. Putting this together, we can try the following: ``` $testQuery = self::find()->where([ 'and', ['=', 'status', self::STATUS_REJECTED], ['=', 'product_id', $this->product_id], ['=...
You're using incorrect format for date. It should be `date('Y-m-d H:i:s', $stamp)` for passed stamp or `date('Y-m-d 00:00:00', $stamp)` to force midnight. ``` $testQuery = self::find()->where([ 'and', ['=', 'status', self::STATUS_REJECTED], ['=', 'product_id', $this->product_id], ['=', 'email_address',...
32,766,541
I try to store **JSON** data into data model to make it easy to use but it store only one data which are `NSString` \*status" it doesn't store the other two ("`NSArray` \* content" and "`NSString` \* serverTime"). This is the second time that i use **JSON** so I don't know much about it. This is from the NSLog(@"item...
2015/09/24
[ "https://Stackoverflow.com/questions/32766541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5303954/" ]
Sounds like you'd benefit from trying out JSONModel <http://www.jsonmodel.com/> Import the framework, modify your models to match the JSON exactly, JSONModel will do the rest for you
I also recommend Jsonformatter <https://jsonformatter.curiousconcept.com> to you. This site can help with debugging of your JSON data.
59,482,037
Can you please explain to me how this loop works? What is going on after first loop and after second etc. ``` def sum(n): s = 0 while n: s += n % 10 n /= 10 return s >>> print sum(123) 6 ```
2019/12/25
[ "https://Stackoverflow.com/questions/59482037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10902220/" ]
``` def sum(n): s = 0 while n: s += n % 10 n /= 10 return s ``` Better rewrite this way (easier to understand): ``` def sum(n): s = 0 // start with s = 0 while n > 0: // while our number is bigger than 0 s += n % 10 // add the last digit to s, for example 54%10 = 4 n /= 10 // integer divis...
so basically, what we are doing in this algorithm is that we are taking one digit at a time from least significant digit of the number and adding that in our s (which is sum variable), and once we have added the least significant digit, we are then removing it and doing the above thing again and again till the numbers ...
59,482,037
Can you please explain to me how this loop works? What is going on after first loop and after second etc. ``` def sum(n): s = 0 while n: s += n % 10 n /= 10 return s >>> print sum(123) 6 ```
2019/12/25
[ "https://Stackoverflow.com/questions/59482037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10902220/" ]
so basically, what we are doing in this algorithm is that we are taking one digit at a time from least significant digit of the number and adding that in our s (which is sum variable), and once we have added the least significant digit, we are then removing it and doing the above thing again and again till the numbers ...
``` int main() { int t; cin>>t; cout<<floor(log10(t)+1); return 0; } ``` Output ``` 254 3 ```
59,482,037
Can you please explain to me how this loop works? What is going on after first loop and after second etc. ``` def sum(n): s = 0 while n: s += n % 10 n /= 10 return s >>> print sum(123) 6 ```
2019/12/25
[ "https://Stackoverflow.com/questions/59482037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10902220/" ]
``` def sum(n): s = 0 while n: s += n % 10 n /= 10 return s ``` Better rewrite this way (easier to understand): ``` def sum(n): s = 0 // start with s = 0 while n > 0: // while our number is bigger than 0 s += n % 10 // add the last digit to s, for example 54%10 = 4 n /= 10 // integer divis...
``` int main() { int t; cin>>t; cout<<floor(log10(t)+1); return 0; } ``` Output ``` 254 3 ```
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
There is significant, recent research into detection of pornography using conventional classification methods. Examples are available [here](http://thomas.deselaers.de/publications/papers/deselaers_icpr08_porn.pdf), and [here](http://portal.acm.org/citation.cfm?id=1631490&dl=ACM&coll=DL&CFID=11052561&CFTOKEN=69356871).
Such things never work reliably. You can use a blocklist to block domains either on name or on being included on some list (a common practice). But those lists are never complete, and blocking on name based on criteria can lead to many false positives. You can block on words appearing in the text of sites, but again t...
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
You can do this with 90% [Headology](http://wiki.lspace.org/mediawiki/index.php/Headology), 10% software. Firstly, quietly scan employees computers, build a database of files and sizes for each employee. Then leak a memo that all PC's will be scanned for questionable content, i.e. The bosses have a [Shazam](http://it...
I don't know, there has to be a middle answer, that isn't as invasive, but solves the real issue, LIABILITY. Have them sign a waiver, that releases the company of any liability for illegal stuff found on work pc's, that is not work related.
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
There are a number of products in the marketplace that perform "content filtering" of various forms. (A Google search on some obvious terms throws up some obvious candidates.) It is probably a better idea to use one of these products than building a lot of scanning / filtering software from scratch. Another option is t...
Image and content analysis to determine the differences between a tasteful photograph of a person, a swimsuit photograph, a nude photograph, depictions of pornography... as far as I know is nowhere near sophisticated enough to do in software alone. Fortunately crowdsourcing should be useful here, as @ammoQ suggested i...
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
You can do this with 90% [Headology](http://wiki.lspace.org/mediawiki/index.php/Headology), 10% software. Firstly, quietly scan employees computers, build a database of files and sizes for each employee. Then leak a memo that all PC's will be scanned for questionable content, i.e. The bosses have a [Shazam](http://it...
This is an obvious neural network task. First you need a large training set of images selected by experts in your company..... A more effective solution is to announce that you will be checking everyones machine for porn NEXT week/month/whatever, then write a simple app that just exercises the disk. I guarantee that t...
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
You can do this with 90% [Headology](http://wiki.lspace.org/mediawiki/index.php/Headology), 10% software. Firstly, quietly scan employees computers, build a database of files and sizes for each employee. Then leak a memo that all PC's will be scanned for questionable content, i.e. The bosses have a [Shazam](http://it...
About legal aspects, in France: The boss owns the computers and the internet connection: He can do whatever pleases him. BUT, employee privacy cannot be violated. If a directory on the computer is labelled PERSONAL, the boss is not allowed to scan it. The only way to bypass that is to get elements of evidence that e...
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
> > * Is this ethical? > > > Depends on the implementation and reasonable expectations of the employees. For example, if your software scans any machine *connected to* the network, then there's an additional requirement that infra needs to prevent unauthorized machines from plugging in. (Maybe that should be obvio...
Such things never work reliably. You can use a blocklist to block domains either on name or on being included on some list (a common practice). But those lists are never complete, and blocking on name based on criteria can lead to many false positives. You can block on words appearing in the text of sites, but again t...
54,155
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
2011/03/03
[ "https://softwareengineering.stackexchange.com/questions/54155", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/17429/" ]
This approach of controlling is certainly painful for both employees and IT people. Once anything enters inside the employee machine, there is no sure way of detecting it. You need to stop it entering in the machine at the first place. The best known practice for this is obviously control over the sites/domain which...
Image and content analysis to determine the differences between a tasteful photograph of a person, a swimsuit photograph, a nude photograph, depictions of pornography... as far as I know is nowhere near sophisticated enough to do in software alone. Fortunately crowdsourcing should be useful here, as @ammoQ suggested i...