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
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
So I just came across this same problem, and I came up with a solution. Basically, if you pull your tableView down far enough and hold it, the ValueChanged control event will fire before the user releases the touch. If you refresh your data and reload the tableView at this point, the table will jump up. To combat this...
Just add `tableView.alwaysBounceVertical = YES` after your `[refresh endRefreshing]` so table will bounce to top after the refresh control ended its animation.
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
So I just came across this same problem, and I came up with a solution. Basically, if you pull your tableView down far enough and hold it, the ValueChanged control event will fire before the user releases the touch. If you refresh your data and reload the tableView at this point, the table will jump up. To combat this...
**SWIFT 4:** In ViewdidLoad() someCollectionView or someTableView ``` someCollectionView.refreshControl?.addSubview(refreshControl) someCollectionView.refreshControl?.sendSubview(toBack: refreshControl) ``` Worked perfectly for me.
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
My solution is similar to the accepted solution. The idea is to update your table view only after the view is at the right place. Therefore, we can add a variable to track if we need to update the view when the scroll view is completely bounced back (don't update it while decelerating). Also, always update your table ...
Usually you use UIRefreshControl to trigger an asynchronous reload operation, and endAnimating should be called after a certain period of time has elapsed. It looks here like the moment the refresh control begins animating, you're ending it immediately. This is probably confusing UIRefreshControl. Try calling endAnima...
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
try changing ``` self.refreshControl = refresh; ``` for ``` [self.tableView addSubview:refresh]; [self.tableView sendSubviewToBack:refresh]; ``` +++++++++ if u have problem with attributedString layout with first refreshControl triggered - add this after adding refreshControl as subview ``` dispatch_async(dispat...
**SWIFT 4:** In ViewdidLoad() someCollectionView or someTableView ``` someCollectionView.refreshControl?.addSubview(refreshControl) someCollectionView.refreshControl?.sendSubview(toBack: refreshControl) ``` Worked perfectly for me.
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
Just add `tableView.alwaysBounceVertical = YES` after your `[refresh endRefreshing]` so table will bounce to top after the refresh control ended its animation.
**SWIFT 4:** In ViewdidLoad() someCollectionView or someTableView ``` someCollectionView.refreshControl?.addSubview(refreshControl) someCollectionView.refreshControl?.sendSubview(toBack: refreshControl) ``` Worked perfectly for me.
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
My solution is similar to the accepted solution. The idea is to update your table view only after the view is at the right place. Therefore, we can add a variable to track if we need to update the view when the scroll view is completely bounced back (don't update it while decelerating). Also, always update your table ...
@Devin's answer did help but what completely fixed the issue for me was to make my NavigationBar "Translucent". <https://i.stack.imgur.com/TKcdH.png> Using non translucent NavigationBar causes the tableview to jump up slightly when UIControlEventValueChanged is fired for some reason. XCode 10.1
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
Usually you use UIRefreshControl to trigger an asynchronous reload operation, and endAnimating should be called after a certain period of time has elapsed. It looks here like the moment the refresh control begins animating, you're ending it immediately. This is probably confusing UIRefreshControl. Try calling endAnima...
@Devin's answer did help but what completely fixed the issue for me was to make my NavigationBar "Translucent". <https://i.stack.imgur.com/TKcdH.png> Using non translucent NavigationBar causes the tableview to jump up slightly when UIControlEventValueChanged is fired for some reason. XCode 10.1
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
Just add `tableView.alwaysBounceVertical = YES` after your `[refresh endRefreshing]` so table will bounce to top after the refresh control ended its animation.
@Devin's answer did help but what completely fixed the issue for me was to make my NavigationBar "Translucent". <https://i.stack.imgur.com/TKcdH.png> Using non translucent NavigationBar causes the tableview to jump up slightly when UIControlEventValueChanged is fired for some reason. XCode 10.1
22,225,207
I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : ``` refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; [refresh addTarget:self action:@selector(refreshChatsTableView) forContro...
2014/03/06
[ "https://Stackoverflow.com/questions/22225207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388233/" ]
My solution is similar to the accepted solution. The idea is to update your table view only after the view is at the right place. Therefore, we can add a variable to track if we need to update the view when the scroll view is completely bounced back (don't update it while decelerating). Also, always update your table ...
**SWIFT 4:** In ViewdidLoad() someCollectionView or someTableView ``` someCollectionView.refreshControl?.addSubview(refreshControl) someCollectionView.refreshControl?.sendSubview(toBack: refreshControl) ``` Worked perfectly for me.
26,067,781
I have a thread. At a certain point, what I want to do is check if a certain lock is free. If it is free, I want the thread to continue on its merry way. If it is not free, I want to wait until it is free, but then not actually acquire the lock. Here is my code so far: ``` private object LockObject = new Object(); a...
2014/09/26
[ "https://Stackoverflow.com/questions/26067781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/246568/" ]
I think you have classical XY problem. I guess what you want is start a Task with you `SlowMethod` and then Continue it with the `UIThreadStartupStuff` is UI thread. ``` Task.Factory.StartNew(()=>SlowMethod()) .ContinueWith(t=>UIThreadStartupStuff(), TaskScheduler.FromCurrentSynchronizationContext()); ``` or wi...
I might not get what you want to achieve, but why not wait on the lock "properly"? After all, it is a clear sign of the lock being free if you can take it. Also, you can release it immediately if it is important. ``` void AppStartup() { this.SlowMethod(); UIThreadStartupStuff(); // now, I want to wait on ...
26,067,781
I have a thread. At a certain point, what I want to do is check if a certain lock is free. If it is free, I want the thread to continue on its merry way. If it is not free, I want to wait until it is free, but then not actually acquire the lock. Here is my code so far: ``` private object LockObject = new Object(); a...
2014/09/26
[ "https://Stackoverflow.com/questions/26067781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/246568/" ]
You don't want to use a lock here. You need an event. Either [ManualResetEvent](http://msdn.microsoft.com/en-us/library/system.threading.manualresetevent(v=vs.110).aspx) or [AutoResetEvent](http://msdn.microsoft.com/en-us/library/system.threading.autoresetevent(v=vs.110).aspx). Remember, locks are used for mutual excl...
I might not get what you want to achieve, but why not wait on the lock "properly"? After all, it is a clear sign of the lock being free if you can take it. Also, you can release it immediately if it is important. ``` void AppStartup() { this.SlowMethod(); UIThreadStartupStuff(); // now, I want to wait on ...
35,035,240
I have a column which states month and year `YYYY MM`. I've separated those into two columns (`Year` and `Month`). The problem is, the year is the calendar year whereas ideally I need the fiscal year I use (`Apr 01` to `Mar 31` - This will never change). Other solutions I've seen are based on date format, whereas my o...
2016/01/27
[ "https://Stackoverflow.com/questions/35035240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5846237/" ]
for something as simple as this you don't actually need threading, just use the `after` function: ``` import Tkinter as tk root = tk.Tk() root.after(1000, root.destroy) root.mainloop() ```
Use `__init__` to create `self.x` outside `det`: ``` import Tkinter as tk from threading import Thread as thread import time class T(): def __init__(self): self.x = tk.Tk() def det(self): self.x.mainloop() def det2(self): self.x.destroy() k = T() ts = thread(target=k.det, args=...
35,035,240
I have a column which states month and year `YYYY MM`. I've separated those into two columns (`Year` and `Month`). The problem is, the year is the calendar year whereas ideally I need the fiscal year I use (`Apr 01` to `Mar 31` - This will never change). Other solutions I've seen are based on date format, whereas my o...
2016/01/27
[ "https://Stackoverflow.com/questions/35035240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5846237/" ]
Use `__init__` to create `self.x` outside `det`: ``` import Tkinter as tk from threading import Thread as thread import time class T(): def __init__(self): self.x = tk.Tk() def det(self): self.x.mainloop() def det2(self): self.x.destroy() k = T() ts = thread(target=k.det, args=...
After many searchs, I found this solution. Tk instance should not be created in the thread (`mainloop` sholud be outside of thread), but it can close in thread: ``` import Tkinter as tk from threading import Thread as thread import time class T(): def det2(self,x): time.sleep(2) x.destroy() x = ...
35,035,240
I have a column which states month and year `YYYY MM`. I've separated those into two columns (`Year` and `Month`). The problem is, the year is the calendar year whereas ideally I need the fiscal year I use (`Apr 01` to `Mar 31` - This will never change). Other solutions I've seen are based on date format, whereas my o...
2016/01/27
[ "https://Stackoverflow.com/questions/35035240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5846237/" ]
for something as simple as this you don't actually need threading, just use the `after` function: ``` import Tkinter as tk root = tk.Tk() root.after(1000, root.destroy) root.mainloop() ```
After many searchs, I found this solution. Tk instance should not be created in the thread (`mainloop` sholud be outside of thread), but it can close in thread: ``` import Tkinter as tk from threading import Thread as thread import time class T(): def det2(self,x): time.sleep(2) x.destroy() x = ...
22,756,986
Looking for best way to implement basic authentication where user needs to enter username and password and I can control the database of users. This is for c# and MCV application. Just looking for a pointer or sample for best way to implement this in MVC.
2014/03/31
[ "https://Stackoverflow.com/questions/22756986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/215541/" ]
background is added to `label` within a div `ui-checkbox` wrapping checkbox itself. You need to override `label`'s background with class `ui-checkbox-off`. Use `!important` to force override. ``` /* un-checked */ .ui-checkbox label.ui-checkbox-off { background: white !important; } /* checked */ .ui-checkbox label....
``` Why can't you use custom checkbox.. <!DOCTYPE html> <html> <head> <style> .checkbox { display: inline-block !important; cursor: pointer; font-size: 25px !important; margin: 0px !important; } input[type=checkbox] {...
12,498
I'm building classrooms in the large basement of our home; we're in Spain and have an English school we're expanding. Room to room sound insulation and resonance are the major concerns I have to consider, as well as costs. The actual ceiling is over three metres high and I plan on using acoustic ceiling tiles to help...
2012/02/25
[ "https://diy.stackexchange.com/questions/12498", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/5370/" ]
If sound proofing is your primary concern then you should build the walls all the way up to the roof, past the suspended ceiling. You should insulate the walls with sound-dampening insulation. If you are willing to spend more money and time, you should look into isolating channels that the drywall attaches to. This pre...
In general this is valid. I've done industrial networking, and this design is pretty prevalent. What I'm not sure about it where you are putting the "glass wool" insulation? Are you insulating the unfinished walls above the ceiling? Or were you putting the insulation flat on top of the acoustic tile? It the latter, th...
123,562
This is similar to this question: [How can I determine a reasonable salary to ask for?](https://workplace.stackexchange.com/questions/896/how-can-i-determine-a-reasonable-salary-to-ask-for), but I think it's asking different questions. I'm still in college and applying to jobs, so I'm a little thrown off when job appl...
2018/11/28
[ "https://workplace.stackexchange.com/questions/123562", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/91151/" ]
As you identified, there are lots of questions on here already about what number to put when an employer asks, or even whether or not you should fill that field in at all. Your question seems different, since you seem focused on understanding *why* employers ask this. It's hard to answer this broadly because different...
Employers will want to get a 'good deal' out of hiring someone; stating a fixed salary on the job advertisement reduces the chance of that happening for them. If two equally skilled and likeable candidates are being considered for a role, they will likely *want to* go for the one that is prepared to work for less mone...
123,562
This is similar to this question: [How can I determine a reasonable salary to ask for?](https://workplace.stackexchange.com/questions/896/how-can-i-determine-a-reasonable-salary-to-ask-for), but I think it's asking different questions. I'm still in college and applying to jobs, so I'm a little thrown off when job appl...
2018/11/28
[ "https://workplace.stackexchange.com/questions/123562", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/91151/" ]
As you identified, there are lots of questions on here already about what number to put when an employer asks, or even whether or not you should fill that field in at all. Your question seems different, since you seem focused on understanding *why* employers ask this. It's hard to answer this broadly because different...
If you give a salary that is too low: Either the company concludes from your salary that you cannot be qualified for the job, or will quickly leave for a better paying job, and not hire you. Or they do hire you, and pay less than you deserve. In any case bidding too low is always bad for you. If you give a salary tha...
12,504,490
I am in the middle of writing a page that does some reporting on a database. For simplicities sake everything I am including only uses one field. Once I get the concept of what I have to do I can the apply it to the full version, which is a much larger database. Here is an idea of my structure and what I would like it...
2012/09/20
[ "https://Stackoverflow.com/questions/12504490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939697/" ]
App Engine 1.7.2, released just a few hours ago, now supports PyCrypto 2.6, the most recent version. The linked doc is likely outdated and will be updated soon. You can use it by [instructing app engine to include it](https://developers.google.com/appengine/docs/python/python25/migrate27#Configuring_Libraries).
GAP will not let you use the full version of pycrypto as it has lot of C so you can't deploy it and they will have to cut it down to what they can allow. You have to use `from google.appengine.dist import use_library` and then `use_library('lib', 'version.')`. Hopefully it is somewhat helpful.
12,504,490
I am in the middle of writing a page that does some reporting on a database. For simplicities sake everything I am including only uses one field. Once I get the concept of what I have to do I can the apply it to the full version, which is a much larger database. Here is an idea of my structure and what I would like it...
2012/09/20
[ "https://Stackoverflow.com/questions/12504490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939697/" ]
To make GAE use pycrypto, you have to add the following to your app.yaml file: ``` libraries: - name: pycrypto version: "2.6" ``` Like a charm, [code like](https://www.dlitz.net/software/pycrypto/api/current/Crypto.Cipher.AES-module.html) ``` from Crypto.Cipher import AES from Crypto import Random class MainPage(...
GAP will not let you use the full version of pycrypto as it has lot of C so you can't deploy it and they will have to cut it down to what they can allow. You have to use `from google.appengine.dist import use_library` and then `use_library('lib', 'version.')`. Hopefully it is somewhat helpful.
12,504,490
I am in the middle of writing a page that does some reporting on a database. For simplicities sake everything I am including only uses one field. Once I get the concept of what I have to do I can the apply it to the full version, which is a much larger database. Here is an idea of my structure and what I would like it...
2012/09/20
[ "https://Stackoverflow.com/questions/12504490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939697/" ]
App Engine 1.7.2, released just a few hours ago, now supports PyCrypto 2.6, the most recent version. The linked doc is likely outdated and will be updated soon. You can use it by [instructing app engine to include it](https://developers.google.com/appengine/docs/python/python25/migrate27#Configuring_Libraries).
To make GAE use pycrypto, you have to add the following to your app.yaml file: ``` libraries: - name: pycrypto version: "2.6" ``` Like a charm, [code like](https://www.dlitz.net/software/pycrypto/api/current/Crypto.Cipher.AES-module.html) ``` from Crypto.Cipher import AES from Crypto import Random class MainPage(...
37,848,180
I'm trying to connect my html/css/js web app on my localhost to a separate redshift database. I don't have access to the key/secret, so the [SDK for PHP](http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/basic-usage.html) won't work for me. Are there alternative options? I feel like I'm on the wrong trac...
2016/06/16
[ "https://Stackoverflow.com/questions/37848180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3175088/" ]
you can use `try` to do the `nil` judge: `<%= ride.pickup_at.try(:strftime, '%x') %>` .Or I think you should figure out what to do if `ride.pickup_at` is `nil`
You can add a if condition like this before your code like this. <%if !ride.pickup\_at.nil? %> <%= ride.pickup\_at.strftime('%x') %> <% end %> This might be because of some record having nil value for pickup\_at
21,166,542
I want to run HBase. I have installed hadoop completely and when I run `start-all.sh` , it works fine and gives me this output: ``` hduser@CSLAP106:/usr/local/hadoop/bin$ jps 11956 SecondaryNameNode 12046 JobTracker 12193 TaskTracker 11800 DataNode 11656 NameNode 12254 Jps ``` But when I want to run `start-hbase.sh`...
2014/01/16
[ "https://Stackoverflow.com/questions/21166542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3021702/" ]
you say the output of ls -l start-hbase.sh is : ``` -rwxr-xr-x 1 root root 1872 huhti 4 2013 start-hbase.sh ``` if you want to know what user and group you are logging with , there us simple way: ``` touch test ls -l test ``` and check user:group ... the problem is user owner and group owner of script.. you have...
If you still have problem after changing the permission of start-hbase.sh then run following command ``` sudo chown -R hduser:hadoop /usr/local/hbase ``` Give permission to 'hbase' directory to write log file.. I hope this will help to other folks...
15,642,131
I have a SQL Server 2008 installation on my local system, and the following code in C#, in .NET 4.5. ``` private Boolean ConnectDatabase() { if( !this.IsInitialized()) { return false; } else { try { String ConnectionStr...
2013/03/26
[ "https://Stackoverflow.com/questions/15642131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1002010/" ]
``` string locationToSavePdf = Path.Combine(Path.GetTempPath(), "file name for your pdf file.pdf"); // select other location if you want File.WriteAllBytes(locationToSavePdf,Properties.Resources.nameOfFile); // write the file from the resources to the location you want Process.Start(locationToSavePdf); // run th...
Try this (you need just a path to the PDF file, no need to add it to the resource): ``` using System.Diagnostics; Process.Start(“Path_of_PDFFile”) ```
15,642,131
I have a SQL Server 2008 installation on my local system, and the following code in C#, in .NET 4.5. ``` private Boolean ConnectDatabase() { if( !this.IsInitialized()) { return false; } else { try { String ConnectionStr...
2013/03/26
[ "https://Stackoverflow.com/questions/15642131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1002010/" ]
``` string locationToSavePdf = Path.Combine(Path.GetTempPath(), "file name for your pdf file.pdf"); // select other location if you want File.WriteAllBytes(locationToSavePdf,Properties.Resources.nameOfFile); // write the file from the resources to the location you want Process.Start(locationToSavePdf); // run th...
Add `using System.Diagnostics;` to your using, and then call: `Process.Start("path to pdf")` You won't need to find the PDF Reader exe or anything. Just call the path of the file you want.
33,361,670
On click of button, I need to make an ajax request to the back-end to persist the current time and some more details in the database. So, if the user clicks the button multiple times continuously, multiple ajax requests will be fired to the back-end. I want these requests to be executed in a sequential way one after th...
2015/10/27
[ "https://Stackoverflow.com/questions/33361670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3044493/" ]
you can use promises to trigger a particular function on the fulfillment of an async request. <https://docs.angularjs.org/api/ng/service/>$q
When you call ajax call just add > > async: false > or async: true > > > in function, the call will synchronise or not
578,892
This question, unlike potential duplicates, does not concern nonclassical theories such as general relativity or the standard model. Many sources found by a simple google search say that there is a common misconception that gravity is force. Instead, weight is a force caused by gravity. Gravity is a phenomena that cau...
2020/09/10
[ "https://physics.stackexchange.com/questions/578892", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/274371/" ]
Raising this to the level of a misconception is unnecessarily pedantic in my opinion. If Alice were to say, "the planets are held in orbit around the sun by gravity" and Bob were to reply, "don't you mean the **force** due to gravity?" then Alice should banish him to Antarctica. Both parties knew perfectly well what sh...
Gravity is not a force, but rather the mechanism responsible for physical phenomena such as planetary orbits and apples falling off trees. Forces are mathematical objects used in the [Newtonian formalism](https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion) of classical mechanics to give a mathematical description ...
578,892
This question, unlike potential duplicates, does not concern nonclassical theories such as general relativity or the standard model. Many sources found by a simple google search say that there is a common misconception that gravity is force. Instead, weight is a force caused by gravity. Gravity is a phenomena that cau...
2020/09/10
[ "https://physics.stackexchange.com/questions/578892", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/274371/" ]
Raising this to the level of a misconception is unnecessarily pedantic in my opinion. If Alice were to say, "the planets are held in orbit around the sun by gravity" and Bob were to reply, "don't you mean the **force** due to gravity?" then Alice should banish him to Antarctica. Both parties knew perfectly well what sh...
At first it is not necessary to postulate a force, just a field of accelerations to explain the movements of planets or falling apples. But force can be related to elastic deformation, and if an object is pulled by a spring horizontally and without friction, it can be shown that $\mathbf F = m\mathbf a$. If gravity i...
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
example: ``` var jsonObj = { members: { host: "hostName" } } var i; for(i=4; i<=8; i++){ var newUser = "user" + i; var newValue = "value" + i; jsonObj.members[newUser] = newValue ; } var str =JSON.stringify(jsonObj); console.log(str); console.log(jsonObj); ``` in your case: request.ru...
You're almost there. ``` request.rules[0].tags[1].variables['value'] = 'some value'; ```
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
``` request.rules[0].tags[0].variables[0].value = "some value"; ``` If you want to understand why it works like that then you have to what `{}` and `[]` means in json. 1st one is for object and later is used for array. So you can see that your `request` object has a property named `rules` which is an array of object....
You're almost there. ``` request.rules[0].tags[1].variables['value'] = 'some value'; ```
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
`0` is to select the index of the array. Hope this will be useful ``` var _pushKey = request.rules[0].tags[0].variables[0].value="some value" ``` [`JSFIDDLE`](https://jsfiddle.net/vasi_32/y5wcwh57/)
You're almost there. ``` request.rules[0].tags[1].variables['value'] = 'some value'; ```
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
you should do this. ``` request.rules[0].tags[0].variables[0]['value'] = 'some value'; ``` The object you want add property to is in an array, it's the array's first element. you can achieve this object by `request.rules[0].tags[0].variables[0]`.
You're almost there. ``` request.rules[0].tags[1].variables['value'] = 'some value'; ```
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
``` request.rules[0].tags[0].variables[0].value = "some value"; ``` Or if you want to append this new property in all variables: ``` var target = 'value'; for (var i = 0; i < request.rules[0].tags[0].variables.length; i++) { if (request.rules[0].tags[0].variables[i][target]) { break; } } request.rules[0]...
``` request.rules[0].tags[0].variables[0].value = "some value"; ``` If you want to understand why it works like that then you have to what `{}` and `[]` means in json. 1st one is for object and later is used for array. So you can see that your `request` object has a property named `rules` which is an array of object....
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
``` request.rules[0].tags[0].variables[0].value = "some value"; ``` Or if you want to append this new property in all variables: ``` var target = 'value'; for (var i = 0; i < request.rules[0].tags[0].variables.length; i++) { if (request.rules[0].tags[0].variables[i][target]) { break; } } request.rules[0]...
example: ``` var jsonObj = { members: { host: "hostName" } } var i; for(i=4; i<=8; i++){ var newUser = "user" + i; var newValue = "value" + i; jsonObj.members[newUser] = newValue ; } var str =JSON.stringify(jsonObj); console.log(str); console.log(jsonObj); ``` in your case: request.ru...
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
``` request.rules[0].tags[0].variables[0].value = "some value"; ``` Or if you want to append this new property in all variables: ``` var target = 'value'; for (var i = 0; i < request.rules[0].tags[0].variables.length; i++) { if (request.rules[0].tags[0].variables[i][target]) { break; } } request.rules[0]...
Like this? ``` request.rules[0].tags[0].variables[0].value = "some value"; ```
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
``` request.rules[0].tags[0].variables[0].value = "some value"; ``` Or if you want to append this new property in all variables: ``` var target = 'value'; for (var i = 0; i < request.rules[0].tags[0].variables.length; i++) { if (request.rules[0].tags[0].variables[i][target]) { break; } } request.rules[0]...
You're almost there. ``` request.rules[0].tags[1].variables['value'] = 'some value'; ```
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
You can write like this: request.rules[0].tags[0].variables[0]["value"] = "some value";
You're almost there. ``` request.rules[0].tags[1].variables['value'] = 'some value'; ```
38,140,708
Here is my JS object: ``` var request = { "name": "Name", "id": 3, "rules":[ { "name": "Rule name", "tags": [ { "tagId": 1, "variables":[ { "variable": "var1", "matchType": "Regex" } ...
2016/07/01
[ "https://Stackoverflow.com/questions/38140708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4737546/" ]
``` request.rules[0].tags[0].variables[0].value = "some value"; ``` Or if you want to append this new property in all variables: ``` var target = 'value'; for (var i = 0; i < request.rules[0].tags[0].variables.length; i++) { if (request.rules[0].tags[0].variables[i][target]) { break; } } request.rules[0]...
you should do this. ``` request.rules[0].tags[0].variables[0]['value'] = 'some value'; ``` The object you want add property to is in an array, it's the array's first element. you can achieve this object by `request.rules[0].tags[0].variables[0]`.
33,090,622
I am looking at a netcdf file through Python and the date on the netcdf file is 138276, which is the number of hours since 2000-01-01 00:00:00. This date corresponds to October 7. How I can convert this date of 138276 hours since 2000-01-01 00:00:00 into the format of 2015-10-07 00:00:00?
2015/10/12
[ "https://Stackoverflow.com/questions/33090622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3586305/" ]
Since the start date is constant, create a datetime object and just add whatever hours you want [using datetime.timedelta](https://docs.python.org/2/library/datetime.html#datetime.timedelta): ``` from datetime import datetime, timedelta start = datetime(2000,1,1,0,0,0) new = start + timedelta(hours=138276) print(ne...
You can use [`dt.strptime`](https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior) to parse your string into a datetime object and then construct a [`dt.timedelta`](https://docs.python.org/2/library/datetime.html#timedelta-objects) object and set param `hours=your_val` to add the required numbe...
33,090,622
I am looking at a netcdf file through Python and the date on the netcdf file is 138276, which is the number of hours since 2000-01-01 00:00:00. This date corresponds to October 7. How I can convert this date of 138276 hours since 2000-01-01 00:00:00 into the format of 2015-10-07 00:00:00?
2015/10/12
[ "https://Stackoverflow.com/questions/33090622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3586305/" ]
Since the start date is constant, create a datetime object and just add whatever hours you want [using datetime.timedelta](https://docs.python.org/2/library/datetime.html#datetime.timedelta): ``` from datetime import datetime, timedelta start = datetime(2000,1,1,0,0,0) new = start + timedelta(hours=138276) print(ne...
Have `timedelta` increment the hours properly. Your date calculation is a little off tho. ``` from datetime import datetime, timedelta old_date = '2000-01-01' curr_date = datetime.strptime(old_date, '%Y-%m-%d') + timedelta(hours=138276 ) print(curr_date) 2015-10-10 12:00:00 ``` To change output format, change `c...
33,090,622
I am looking at a netcdf file through Python and the date on the netcdf file is 138276, which is the number of hours since 2000-01-01 00:00:00. This date corresponds to October 7. How I can convert this date of 138276 hours since 2000-01-01 00:00:00 into the format of 2015-10-07 00:00:00?
2015/10/12
[ "https://Stackoverflow.com/questions/33090622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3586305/" ]
Since the start date is constant, create a datetime object and just add whatever hours you want [using datetime.timedelta](https://docs.python.org/2/library/datetime.html#datetime.timedelta): ``` from datetime import datetime, timedelta start = datetime(2000,1,1,0,0,0) new = start + timedelta(hours=138276) print(ne...
If you are using the netCDF4 package, you should use the [`num2date`](http://unidata.github.io/netcdf4-python/#section7) function. ``` In [1]: from netCDF4 import num2date In [2]: date = num2date(138276, 'hours since 2000-01-01 00:00:00', calendar='standard') In [3]: date Out[3]: datetime.datetime(2015, 10, 10, 12, ...
31,927,621
I am fairly new to git. I created a branch. That branch shows up in BitBucket, where the remote repo resides. But shouldn't I be seeing a separate development path for my changes? My changes seem to be on the main line. Below on the right you can see my branch tag for each check-in. [![enter image description here](h...
2015/08/10
[ "https://Stackoverflow.com/questions/31927621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4694781/" ]
Regular expressions describe a finite-state automaton. Since the late 1960's, the "bread and butter" of parsing (though not necessarily the "state of the art") has been push-down automata generated by parser generators according to "LR" algorithms like LALR(1). The connection to regular expressions is this: the parsi...
Parser generators like Yacc, Bison, and derivatives are what you're after. They aren't as widespread as regular expressions because they generate actual C code. There are translations like Jison for example which implement the Yacc/Bison syntax using javascript. I know there are similar tools for other languages. I g...
547
The tag wiki is an important part of the information architecture of a SE site. It provides a dimension of navigation, and makes information about a specific topic findable by searching for the tag. I've noticed several instances if unilateral and arbitrary retagging of this site, all of them carried out by the same i...
2015/08/15
[ "https://opensource.meta.stackexchange.com/questions/547", "https://opensource.meta.stackexchange.com", "https://opensource.meta.stackexchange.com/users/606/" ]
On this particular example ========================== I've rolled the edit back. The [licensing](https://opensource.stackexchange.com/questions/tagged/licensing "show questions tagged 'licensing'") tag was on the fence there: it's valid to think either it should be there *or* it shouldn't. Since that's the case, side...
Wow. Are you for real? > > I've noticed several instances if unilateral and arbitrary retagging > > > Retagging is unilateral by definition, unless it's done via a suggested edit. Arbitrary is an accusation against the retagger's motives for which you state no justification altogether. > > As an example of this...
58,870,129
How Would I change this function from changing only the letters to change the entire word? I believe I have to change the ch in the code (for ch in newString: ) but I don't know what to. ``` replacements = { 'TOMORROW': 'TMR', 'ABOUT': 'BOUT', 'PLEASE': 'PLZ', 'BEFORE': 'B4' } def replace(newString): old,new = [],[] ...
2019/11/15
[ "https://Stackoverflow.com/questions/58870129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12370584/" ]
I'm not sure the exact syntax/functions in Snowflake but generally speaking there's a few different ways of achieving this. I guess the general approach that would work universally is using the SUBSTRING function that's available in any database. Assuming you have a table called Table1 with the following data: ``` +-...
You didn't try this? ``` UPDATE tableX SET columnY = substr(columnY, 2, 10 ) ; ``` -Paul-
58,870,129
How Would I change this function from changing only the letters to change the entire word? I believe I have to change the ch in the code (for ch in newString: ) but I don't know what to. ``` replacements = { 'TOMORROW': 'TMR', 'ABOUT': 'BOUT', 'PLEASE': 'PLZ', 'BEFORE': 'B4' } def replace(newString): old,new = [],[] ...
2019/11/15
[ "https://Stackoverflow.com/questions/58870129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12370584/" ]
You didn't try this? ``` UPDATE tableX SET columnY = substr(columnY, 2, 10 ) ; ``` -Paul-
There is no need to specify the length, as is evidenced from the following simple test harness: `SELECT $1 ,SUBSTR($1, 2) ,RIGHT($1, -2) FROM VALUES ('abcde') ,('bcd') ,('cdef') ,('defghi') ,('e') ,('fg') ,('') ;` Both expressions here - **SUBSTR(<col>, 2)** and **RIGHT(<col>, -2)** - effectively remove the...
58,870,129
How Would I change this function from changing only the letters to change the entire word? I believe I have to change the ch in the code (for ch in newString: ) but I don't know what to. ``` replacements = { 'TOMORROW': 'TMR', 'ABOUT': 'BOUT', 'PLEASE': 'PLZ', 'BEFORE': 'B4' } def replace(newString): old,new = [],[] ...
2019/11/15
[ "https://Stackoverflow.com/questions/58870129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12370584/" ]
I'm not sure the exact syntax/functions in Snowflake but generally speaking there's a few different ways of achieving this. I guess the general approach that would work universally is using the SUBSTRING function that's available in any database. Assuming you have a table called Table1 with the following data: ``` +-...
There is no need to specify the length, as is evidenced from the following simple test harness: `SELECT $1 ,SUBSTR($1, 2) ,RIGHT($1, -2) FROM VALUES ('abcde') ,('bcd') ,('cdef') ,('defghi') ,('e') ,('fg') ,('') ;` Both expressions here - **SUBSTR(<col>, 2)** and **RIGHT(<col>, -2)** - effectively remove the...
58,663,551
In the code below i have two microsoft sql server queries included in a stored procedure, the first query is executing like a charm but the second query never get executed , i make sure that both table have data inside and matches the condition i put ,the code is executing and returning success ``` create procedure s...
2019/11/01
[ "https://Stackoverflow.com/questions/58663551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7940462/" ]
I wouldn't use MERGE for just an update. The MERGE statement has some issues (<https://www.mssqltips.com/sqlservertip/3074/use-caution-with-sql-servers-merge-statement/>) and really isn't needed here. Using joins this is a lot simpler. ``` UPDATE a SET Reaudit = 0 , Id = c.id , status = 6 , closed = 1 from...
Finally i am able to find the error that the second defined table type has reversed order between AppId and Id column ,though they have the same names on c# snippet that send the params to sql , i reordered the column on sql defined table type as they are sent from c# data table and i have it worked, and the above answ...
22,886,736
I have a thread from which I need to send a signal with a parameter to a pointer like the following: ``` connect(insThread, SIGNAL(sgGetCurrentElement(QWebElement&)), this, SIGNAL(sgGetCurrentElement(QWebElement&))); ``` where insThread is the thred. However I got error: ``` QObject::connect: Cannot queue arguments...
2014/04/05
[ "https://Stackoverflow.com/questions/22886736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1838569/" ]
I assume you are trying to register the QWebElement with a reference (&) because have prototyped the slot to take QWebElement as a reference, but this is not a very good idea if you're posting the signal from one thread to another, see [here](http://www.qtcentre.org/threads/17660-Slots-amp-Signals-w-parameters-passed-b...
I am not sure why you are trying to register it with `&`, but do it without that as follows: ``` qRegisterMetaType<QWebElement>("myElement"); ```
21,021,565
I'm using eneter framework to process communication in my android application; the problem is when **I'm trying to populate a spinner, setting the adapter to the spinner cause an undefined exception** Here the code ``` public void populateSpinner(TypedResponseReceivedEventArgs<String> arg1){ List<String> list = n...
2014/01/09
[ "https://Stackoverflow.com/questions/21021565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3177678/" ]
you are passing `this` in the following piece of code, ``` ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,list); ``` Not sure in which block this code lies or which class, but ensure that **`this`** refers to `ActivityName.class` or `the contex...
It is most likely because you are using an `ArrayAdapter` rather than a `SpinnerAdapter`. `ArrayAdapter` is an indirect implementer of the `SpinnerAdapter` interface rather than one which declares that it implements the interface. Check the undefined exception. It is likely telling you that `setAdapter(ArrayAdapter)` i...
12,250,940
I am making simple storyboard application which has 2 UIViewControllers and I am switching between them by using modal segue. Each UIViewController has one UIButton which is used to perform segue to another UIViewController. In viewDidLoad method I animate appearance of that UIButton on each UIViewController. I am usin...
2012/09/03
[ "https://Stackoverflow.com/questions/12250940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1498352/" ]
I do not know the answer to the first part of your question, but once you learn the answer to the second part, I am sure that you would go with a different solution anyway. > > `viewDidLoad` method is called every time. So, does that mean I created new object instance each time `viewDidLoad` method was executed? > >...
I hit a similar issue where I had a complex VC navigation web, and the resulting use of segues (no UINavigationController) was sucking up too much memory. You may want to take a look at this question/answer to see my final solution. The conversation here between uerceg and dasblinkenlight helped me in finding this solu...
1,517,329
I would like to prove that $$\lim\_{n\to\infty} \sqrt[3]{(n+1)(n+2)(n+3)}-n = 2,$$ but have no ideas on how to proceed with this limit. Any hint? Thanks in advance
2015/11/07
[ "https://math.stackexchange.com/questions/1517329", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Here is a hint. $$a-b=\frac{a^3-b^3}{a^2+ab+b^2}$$
Hint : factorize by $n$ and use a Taylor expansion of $f(t)=(1+t)^\frac{1}{3}$ when $t$ is near zero.
1,517,329
I would like to prove that $$\lim\_{n\to\infty} \sqrt[3]{(n+1)(n+2)(n+3)}-n = 2,$$ but have no ideas on how to proceed with this limit. Any hint? Thanks in advance
2015/11/07
[ "https://math.stackexchange.com/questions/1517329", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Here is a hint. $$a-b=\frac{a^3-b^3}{a^2+ab+b^2}$$
$$\lim\_{n\to\infty} \sqrt[3]{(n+1)(n+2)(n+3)}-n$$ Using $\bf{A.M\geq G.M}\;,$ $$\lim\_{n\rightarrow \infty}\frac{(n+1)+(n+2)+(n+3)}{3}\geq \lim\_{n\rightarrow \infty}\sqrt[3]{(n+1)(n+2)(n+3)}$$ So we get $$\lim\_{n\rightarrow \infty} n+2\geq\lim\_{n\rightarrow \infty} \sqrt[3]{(n+1)(n+2)(n+3)}$$ and equality will ...
1,517,329
I would like to prove that $$\lim\_{n\to\infty} \sqrt[3]{(n+1)(n+2)(n+3)}-n = 2,$$ but have no ideas on how to proceed with this limit. Any hint? Thanks in advance
2015/11/07
[ "https://math.stackexchange.com/questions/1517329", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Hint : factorize by $n$ and use a Taylor expansion of $f(t)=(1+t)^\frac{1}{3}$ when $t$ is near zero.
$$\lim\_{n\to\infty} \sqrt[3]{(n+1)(n+2)(n+3)}-n$$ Using $\bf{A.M\geq G.M}\;,$ $$\lim\_{n\rightarrow \infty}\frac{(n+1)+(n+2)+(n+3)}{3}\geq \lim\_{n\rightarrow \infty}\sqrt[3]{(n+1)(n+2)(n+3)}$$ So we get $$\lim\_{n\rightarrow \infty} n+2\geq\lim\_{n\rightarrow \infty} \sqrt[3]{(n+1)(n+2)(n+3)}$$ and equality will ...
55,703,090
I am trying to parse csv file. All is fine when there is delimiter ",". But in original file is delimiter ";" And I get error "Undefined offset" This is my working code with: ``` $CSV = '"id","email",name,google.com,google.com 1,email1@email.com,jack,,+ 2,email2@email.com,jack,+, 3,email3@email.com,jack,,'; ``` <h...
2019/04/16
[ "https://Stackoverflow.com/questions/55703090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3514052/" ]
``` $csv = array_map('str_getcsv', $lines); ``` You are not passing any extra parameters into `str_getcsv` with this call here, so it will use the default value for all of them. A small anonymous function that calls `str_getcsv` inside with the extra parameters you want should to the trick: ``` $csv = array_map(fun...
In ``` $csv = array_map('str_getcsv', $lines); ``` you apply `str_getcsv` with **default** arguments, second argument by default is `,`. To use `;` you should set it explicitly, for example: ``` $csv = array_map(function($v) { return str_getcsv($v, ';'); }, $lines); ```
55,703,090
I am trying to parse csv file. All is fine when there is delimiter ",". But in original file is delimiter ";" And I get error "Undefined offset" This is my working code with: ``` $CSV = '"id","email",name,google.com,google.com 1,email1@email.com,jack,,+ 2,email2@email.com,jack,+, 3,email3@email.com,jack,,'; ``` <h...
2019/04/16
[ "https://Stackoverflow.com/questions/55703090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3514052/" ]
``` $csv = array_map('str_getcsv', $lines); ``` You are not passing any extra parameters into `str_getcsv` with this call here, so it will use the default value for all of them. A small anonymous function that calls `str_getcsv` inside with the extra parameters you want should to the trick: ``` $csv = array_map(fun...
There are a lot of examples on <https://www.php.net/manual/en/function.str-getcsv.php> Ex: ``` function csv_to_array($string='', $row_delimiter=PHP_EOL, $delimiter = "," , $enclosure = '"' , $escape = "\\" ) { $rows = array_filter(explode($row_delimiter, $string)); $header = NULL; $data = array(); for...
62,148,218
In CSS, if a child of a child is set to `width: 100%` and the wrapping div has `display: flex` set, the content does not expand to 100% it only uses the space of the content. How would one make it expand to the size the grandchild sets itself but still use flex? flex-grow is probably not the answer since this will a...
2020/06/02
[ "https://Stackoverflow.com/questions/62148218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1087372/" ]
The dependency injection system doesn't register `ILogger`. Instead it registers `ILogger<T>`. If you need an instance of a logger, you will need to accept `ILogger<MyService>`. The reason behind this is that the generic argument is used to build the logger's category name--something which all loggers require. With a...
In order for MS.DI to be able to do a mapping from `ILogger` to `ILogger<T>` where the `T` becomes the consumer, it must support context-based injection. This means that when building an application using MS.DI, you will have to let your classes depend on `ILogger<T>`. There are multiple reasons why MS.DI lacks this f...
63,288,746
So I've this admin-dashboard where I want to click on the options link which will take me to another page or show a modal of that particular person's details. So basically, I want to get the ID of one particular person and send it to backend for query and display the details. [![image](https://i.stack.imgur.com/ogL9Q....
2020/08/06
[ "https://Stackoverflow.com/questions/63288746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` window.addEventListener('load', function() { var trs = document.getElementById('response-doctor').querySelectorAll('tr'); for (var i = 0; i < trs.length; i++) { var tds = trs[i].querySelectorAll('td'); tds[tds.length-1].querySelector('a').setAttribute('href', '/user/'+tds[0].innerHTML); } }); ``` M...
You can make entire table row as link For example: ``` <tr a="profile.php?id=<?php echo $rows['id'?];"> ... <tr> ``` This is how you can add link on every row which leads you to profile.php file where you can show personal information. When you are in profile.php you can access person's id with $\_GET['id'] and ...
58,132,297
I want to add tabs on my website which load when users click on them not when the page is loading. When I open the website the whole tab content load at once. I want to load the contents of another tab when users like on them something like Youtube. When you open a channel on your you got tabs like videos, playlist, co...
2019/09/27
[ "https://Stackoverflow.com/questions/58132297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12098882/" ]
There are multiple ways to solve this: -------------------------------------- From the top of my head, here are a few ways: 1. Use bootstrap toggleable tabs. This would be the easiest solution. However all the code would live on the same page. (Source: <https://www.w3schools.com/bootstrap/bootstrap_tabs_pills.asp>) ...
What you aim to achieve is called lazy-loading. Basically you load your main content and avoid loading some content until it's needed. To achieve this, you will have to generate the HTML for what you want to load at once on the server and some containers for things that you aim to lazy-load. Let's assume that the conte...
52,380,971
I am using Flutter to develop a webview with menu, and the menu will trigger the drawer, but the `flutterWebviewPlugin` draw the UI on top of everything, that's cover the drawer as well, is this possible to move the drawer upper or let the webview put lower? Thanks.
2018/09/18
[ "https://Stackoverflow.com/questions/52380971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148978/" ]
From the package description > > **Warning:** The webview is not integrated in the widget tree, it is a > native view on top of the flutter view. you won't be able to use > snackbars, dialogs... > > > <https://pub.dartlang.org/packages/flutter_webview_plugin>
Use [fluter\_inappwebview](https://pub.dev/packages/flutter_inappwebview) as it have much better features than official and other plugins.
52,113,424
I write `A` object to a file `f`. ``` a := A{42} bytes, _ := json.MarshalIndent(a, "", "\t") f.Write(bytes) ``` Where `A` looks like: ``` type A struct { A int `json:"a"` } ``` Then I change field of this object and write it to the file: ``` a.A = 666 f.Write(bytes) ``` As a result, I see only ``` { ...
2018/08/31
[ "https://Stackoverflow.com/questions/52113424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5537840/" ]
You have no choice but to marshal repeatedly. Use a [\*json.Encoder](https://golang.org/pkg/encoding/json/#Encoder) for improved ergonomics and efficiency: ``` package main import ( "encoding/json" "log" "os" ) type A struct { A int `json:"a"` } func main() { f, err := os.Create("foo.json") ...
you can use the standard library to replace bytes within the given bytes slice. <https://golang.org/pkg/bytes/#Replace> ``` package main import ( "bufio" "bytes" "encoding/json" "os" ) type A struct { A int `json:"a"` } func main() { out := bufio.NewWriterSize(os.Stdout, 20) // defer ou...
8,896,751
I need to store an object content in Sqlite. I was wondering which was the best way to do it with a serialization of the object or with Parcelable. Is it possible to store it as Parcelable? How can I do it?
2012/01/17
[ "https://Stackoverflow.com/questions/8896751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/737636/" ]
You are welcome to convert your object into some sort of persistable data structure (XML, JSON, `Serializable`) and stuff it in some database column. Bear in mind that you will still need to deal with compatibility issues (e.g., Version 2 of your app changes a class, which now needs to deal with both Version 1 and Vers...
If you need to persist data, use `Serializable`. `Parcelable` is meant for IPC use. It is a binary format and not recommended for persistence.
26,188,221
I'm a Java programmer and recently started studying C++. I'm confused by something. I understand that in C++, to achieve polymorphic behavior you have to use either pointers or references. For example, consider a class `Shape` with an implemented method `getArea()`. It has several subclasses, each overriding getArea()...
2014/10/03
[ "https://Stackoverflow.com/questions/26188221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3284878/" ]
The answer is copy semantics. When you pass an object by value in C++, e.g. `printArea(Shape shape)` a copy is made of the object you pass. And if you pass a derived class to this function, all that's copied is the base class `Shape`. If you think about it, there's no way the compiler could do anything else. ``` Shap...
When `void printArea(Shape shape)` is called, your object is copied into a brand new `Shape` on the stack. The subclass parts are not copied. This is known as [object slicing](http://en.wikipedia.org/wiki/Object_slicing). If the base-class object is not legit (e.g. it has pure virtual functions in it), you can't even d...
26,188,221
I'm a Java programmer and recently started studying C++. I'm confused by something. I understand that in C++, to achieve polymorphic behavior you have to use either pointers or references. For example, consider a class `Shape` with an implemented method `getArea()`. It has several subclasses, each overriding getArea()...
2014/10/03
[ "https://Stackoverflow.com/questions/26188221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3284878/" ]
When `void printArea(Shape shape)` is called, your object is copied into a brand new `Shape` on the stack. The subclass parts are not copied. This is known as [object slicing](http://en.wikipedia.org/wiki/Object_slicing). If the base-class object is not legit (e.g. it has pure virtual functions in it), you can't even d...
Basically, when you pass an object by value it's copied to an object of the destination type - at that point it *is* an object of the destination type, so there's nothing to polymorph (is that even a word?). To use your example, `void printArea(Shape shape);`, inside the `printArea()` function the parameter `shape` *i...
26,188,221
I'm a Java programmer and recently started studying C++. I'm confused by something. I understand that in C++, to achieve polymorphic behavior you have to use either pointers or references. For example, consider a class `Shape` with an implemented method `getArea()`. It has several subclasses, each overriding getArea()...
2014/10/03
[ "https://Stackoverflow.com/questions/26188221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3284878/" ]
The answer is copy semantics. When you pass an object by value in C++, e.g. `printArea(Shape shape)` a copy is made of the object you pass. And if you pass a derived class to this function, all that's copied is the base class `Shape`. If you think about it, there's no way the compiler could do anything else. ``` Shap...
You're talking about run-time polymorphism. This is the idea that an object can be of a class derived from the \*statically known class, so that calls to virtual member functions in the statically known class, end up in derived class implementations. With a pointer or reference the most derived class can be different...
26,188,221
I'm a Java programmer and recently started studying C++. I'm confused by something. I understand that in C++, to achieve polymorphic behavior you have to use either pointers or references. For example, consider a class `Shape` with an implemented method `getArea()`. It has several subclasses, each overriding getArea()...
2014/10/03
[ "https://Stackoverflow.com/questions/26188221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3284878/" ]
You're talking about run-time polymorphism. This is the idea that an object can be of a class derived from the \*statically known class, so that calls to virtual member functions in the statically known class, end up in derived class implementations. With a pointer or reference the most derived class can be different...
Basically, when you pass an object by value it's copied to an object of the destination type - at that point it *is* an object of the destination type, so there's nothing to polymorph (is that even a word?). To use your example, `void printArea(Shape shape);`, inside the `printArea()` function the parameter `shape` *i...
26,188,221
I'm a Java programmer and recently started studying C++. I'm confused by something. I understand that in C++, to achieve polymorphic behavior you have to use either pointers or references. For example, consider a class `Shape` with an implemented method `getArea()`. It has several subclasses, each overriding getArea()...
2014/10/03
[ "https://Stackoverflow.com/questions/26188221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3284878/" ]
The answer is copy semantics. When you pass an object by value in C++, e.g. `printArea(Shape shape)` a copy is made of the object you pass. And if you pass a derived class to this function, all that's copied is the base class `Shape`. If you think about it, there's no way the compiler could do anything else. ``` Shap...
Basically, when you pass an object by value it's copied to an object of the destination type - at that point it *is* an object of the destination type, so there's nothing to polymorph (is that even a word?). To use your example, `void printArea(Shape shape);`, inside the `printArea()` function the parameter `shape` *i...
64,536
I'm in Western Europe doing a Master's degree, and I expected the education quality to be much higher then what I've seen in my previous school which was in the Middle East, but some professors here still do this (taking exam and exercise questions from the internet) and they don't seem to understand the subject very w...
2016/03/04
[ "https://academia.stackexchange.com/questions/64536", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/50258/" ]
*they don't seem to understand the subject very well.* You sound like you are in a level of expertise that you could judge the quality of the lectures. You may then ideally speak to the professor about your allegation *they still do this.* I am ignoring the regional limitations and considering the question in a general...
You get questions (and ideas for questions) from many places. Some you cook up yourself, others you water down from a step in a paper (even a very old one), or filch from a published exam, or a textbook, or even adapted from StackExchange. It varies. One of the selling points of textbooks is precisely that they provide...
16,771
How can I approach this? Could you help me? The format of the text file is not very important. An possible format would be: ``` Email 1;Involved contact(s);Subject and preview;Date or time Email 2;Involved contact(s);Subject and preview;Date or time ... ```
2011/07/02
[ "https://webapps.stackexchange.com/questions/16771", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/11898/" ]
[GMail offers a RSS feed](http://mail.google.com/support/bin/answer.py?answer=13474) with the basic details of each mail. I used this [XSL file](http://snippets.dzone.com/posts/show/1162) to transform that feed to a more readable format ![enter image description here](https://i.stack.imgur.com/kr05b.jpg) You can twea...
Have a look at [Context.IO](http://context.io), it will let you script that sort of things. If you have any questions or problems, let us know <http://support.context.io>, we'll be happy to help.
16,771
How can I approach this? Could you help me? The format of the text file is not very important. An possible format would be: ``` Email 1;Involved contact(s);Subject and preview;Date or time Email 2;Involved contact(s);Subject and preview;Date or time ... ```
2011/07/02
[ "https://webapps.stackexchange.com/questions/16771", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/11898/" ]
[GMail offers a RSS feed](http://mail.google.com/support/bin/answer.py?answer=13474) with the basic details of each mail. I used this [XSL file](http://snippets.dzone.com/posts/show/1162) to transform that feed to a more readable format ![enter image description here](https://i.stack.imgur.com/kr05b.jpg) You can twea...
You could enable POP downloading and move/copy your inbox to a local client like Thunderbird. From there the messages will be stored in a flat file that you can access.
21,347,105
I'm been looking for some tutorials or atleast a guide how to load an image from url. Well locally it's quite pretty easy.. So if anyone has suggestions or an idea where I can start, please share. I tried the SmartImageView and followed in the documentation but still failed...:( ``` protected void onCreate(Bu...
2014/01/25
[ "https://Stackoverflow.com/questions/21347105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138962/" ]
A slight variant of your answer: ``` class Array def **(n) product( *([self]*(n-1)) ) end end [1,2]**3 # => [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], # [2, 1, 1], [2, 1, 2], [2, 2, 1], [2, 2, 2]] ```
Because I like monkeypatching, I put this on the array itself: ``` class Array def **(n) self.product( *(n-1).times.map{ self } ) end end ``` I'm not sure if there's a more elegant way to pass *n-1* copies of yourself to the method, though.
21,347,105
I'm been looking for some tutorials or atleast a guide how to load an image from url. Well locally it's quite pretty easy.. So if anyone has suggestions or an idea where I can start, please share. I tried the SmartImageView and followed in the documentation but still failed...:( ``` protected void onCreate(Bu...
2014/01/25
[ "https://Stackoverflow.com/questions/21347105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138962/" ]
You are probably looking for permutation with repetition and Ruby's `Array` from standard library luckily [implements this](http://www.ruby-doc.org/core-2.1.0/Array.html#method-i-repeated_permutation): ``` [1,2].repeated_permutation(3).to_a # [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], [2, 1, 1], [2, 1, 2], [2, 2, 1]...
Because I like monkeypatching, I put this on the array itself: ``` class Array def **(n) self.product( *(n-1).times.map{ self } ) end end ``` I'm not sure if there's a more elegant way to pass *n-1* copies of yourself to the method, though.
21,347,105
I'm been looking for some tutorials or atleast a guide how to load an image from url. Well locally it's quite pretty easy.. So if anyone has suggestions or an idea where I can start, please share. I tried the SmartImageView and followed in the documentation but still failed...:( ``` protected void onCreate(Bu...
2014/01/25
[ "https://Stackoverflow.com/questions/21347105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138962/" ]
You are probably looking for permutation with repetition and Ruby's `Array` from standard library luckily [implements this](http://www.ruby-doc.org/core-2.1.0/Array.html#method-i-repeated_permutation): ``` [1,2].repeated_permutation(3).to_a # [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], [2, 1, 1], [2, 1, 2], [2, 2, 1]...
A slight variant of your answer: ``` class Array def **(n) product( *([self]*(n-1)) ) end end [1,2]**3 # => [[1, 1, 1], [1, 1, 2], [1, 2, 1], [1, 2, 2], # [2, 1, 1], [2, 1, 2], [2, 2, 1], [2, 2, 2]] ```
65,331,522
Primer ------ I have a `Vector` class that does some math. Among other things, it has a `mean()` function that calculates the mean of all values inside the vector. It uses a `sum()` function that i added here just for completeness. `Vector` ``` template <std::size_t N, typename T> class Vector{ public: // ......
2020/12/16
[ "https://Stackoverflow.com/questions/65331522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4059407/" ]
> > I understand that template argument deduction does not work in function prototypes... And that there is likely no way of deducting the parameter N somehow without specifying it exactly. > > > What? > > But maybe there is a completely unrelated workaround to remove the need of having to write out the N value ...
Thanks to @Jarod42 and @HTNW i was able to hack it into a single function. With `class U = void` and `std::conditional` it is possible to make the specification of `U` optional for the caller. ``` template <class U = void, std::size_t N, typename T> auto mean(const Vector<N, T> &v) { return v.template mean<std::con...
65,331,522
Primer ------ I have a `Vector` class that does some math. Among other things, it has a `mean()` function that calculates the mean of all values inside the vector. It uses a `sum()` function that i added here just for completeness. `Vector` ``` template <std::size_t N, typename T> class Vector{ public: // ......
2020/12/16
[ "https://Stackoverflow.com/questions/65331522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4059407/" ]
You might do the following to have both syntax: ``` template <class U, std::size_t N, typename T> U mean(const Vector<N, T> &v) { return v.template mean<U>(); } template <std::size_t N, typename T> T mean(const Vector<N, T> &v) { return mean<T>(v); } ``` [Demo](http://coliru.stacked-crooked.com/a/5f4ce8cd6b5dce...
Thanks to @Jarod42 and @HTNW i was able to hack it into a single function. With `class U = void` and `std::conditional` it is possible to make the specification of `U` optional for the caller. ``` template <class U = void, std::size_t N, typename T> auto mean(const Vector<N, T> &v) { return v.template mean<std::con...
15,755,760
I've been trying out things on my own now that my second java course is done. It's been difficult going back to the beginning and remembering how to work with everything I've learned over the past months, so I'm trying to make a program that asks the user what shape they want to draw (based on basic shapes made with fo...
2013/04/02
[ "https://Stackoverflow.com/questions/15755760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2093132/" ]
You can pass the size variable to the drawing methods like this: ``` public class Practice { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Choose a shape!"); String shape = input.nextLine(); System.out.println("Choose a size!"); int size ...
You need to declare your variables at the class level. Also, because you're using all `static` methods, these variables need to declared as `static` as well ``` public class Practice { private static String shape; private static int size; public static void main(String[] args) { Scanner input = n...
32,891,719
Please, I don't need no solution, just a few hints on how-tos. Anyhow, here is the problem I am tackeling with: I have a file (bloomberg answer file) which is built as follows: * we have a header part (I am only interested in the START-OF-FIELDS[...]END-OF-FIELDS; varying amount of fields!) * then there is the data p...
2015/10/01
[ "https://Stackoverflow.com/questions/32891719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5398196/" ]
Implicit controller routing needs the HTTP verb in the method name: ```php public function postNsano(NsanoRequest $request) { // } ```
Your request validates do not correct so it jumps to an url to prompt error but not found. If you add some parameters like this and than OK. ![enter image description here](https://i.stack.imgur.com/Xk3zy.png)
7,068
In this transcript of a conversation between Simon Critchley & Badiou on Badiou's book *Being and Event*, Badiou states: > > And after that, I have also to understand why there is in modern times a clear relationship between poetry and philosophy. As you know, it’s a Heideggerian idea: this renewal of a philosophical...
2013/05/30
[ "https://philosophy.stackexchange.com/questions/7068", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/933/" ]
Maybe that for Heidegger poetry is the peak of language. That is: poetry can say something other forms of language (for example theoretical statements) cannot. For example, it can designate, circumscribe, reveal, speak of what is not obvious or in plain view.
I don't know what Heidegger thought. But it should be clear that philosophy has this in common with poetry : both are about using innovation in language and imagery to try to capture and describe new ways of experiencing and thinking about the world. The poet crafts new metaphors and turns of phrase which can give you...
7,068
In this transcript of a conversation between Simon Critchley & Badiou on Badiou's book *Being and Event*, Badiou states: > > And after that, I have also to understand why there is in modern times a clear relationship between poetry and philosophy. As you know, it’s a Heideggerian idea: this renewal of a philosophical...
2013/05/30
[ "https://philosophy.stackexchange.com/questions/7068", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/933/" ]
Maybe that for Heidegger poetry is the peak of language. That is: poetry can say something other forms of language (for example theoretical statements) cannot. For example, it can designate, circumscribe, reveal, speak of what is not obvious or in plain view.
'Rediscovery' I think clearly applies to: from Romanticism - which was far more dominant and lasting in philosophy in Germany than in England. John Vervaeke has [a great lecture on Romanticism in the context of the history of philosophy](https://youtu.be/Noc1OH0CUBc), which was all news to me. I can't think of a figure...
7,068
In this transcript of a conversation between Simon Critchley & Badiou on Badiou's book *Being and Event*, Badiou states: > > And after that, I have also to understand why there is in modern times a clear relationship between poetry and philosophy. As you know, it’s a Heideggerian idea: this renewal of a philosophical...
2013/05/30
[ "https://philosophy.stackexchange.com/questions/7068", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/933/" ]
Maybe that for Heidegger poetry is the peak of language. That is: poetry can say something other forms of language (for example theoretical statements) cannot. For example, it can designate, circumscribe, reveal, speak of what is not obvious or in plain view.
### Philosophy can learn how to reach the heart of people It is basically about how to write truth in a way that reaches and permeates the public sphere, connecting reason with aesthetics. Heidegger is deeply indebted to Hölderlin here and I'm surprised Badiou does not offer this obvious link himself. The main idea h...
7,068
In this transcript of a conversation between Simon Critchley & Badiou on Badiou's book *Being and Event*, Badiou states: > > And after that, I have also to understand why there is in modern times a clear relationship between poetry and philosophy. As you know, it’s a Heideggerian idea: this renewal of a philosophical...
2013/05/30
[ "https://philosophy.stackexchange.com/questions/7068", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/933/" ]
I don't know what Heidegger thought. But it should be clear that philosophy has this in common with poetry : both are about using innovation in language and imagery to try to capture and describe new ways of experiencing and thinking about the world. The poet crafts new metaphors and turns of phrase which can give you...
'Rediscovery' I think clearly applies to: from Romanticism - which was far more dominant and lasting in philosophy in Germany than in England. John Vervaeke has [a great lecture on Romanticism in the context of the history of philosophy](https://youtu.be/Noc1OH0CUBc), which was all news to me. I can't think of a figure...
7,068
In this transcript of a conversation between Simon Critchley & Badiou on Badiou's book *Being and Event*, Badiou states: > > And after that, I have also to understand why there is in modern times a clear relationship between poetry and philosophy. As you know, it’s a Heideggerian idea: this renewal of a philosophical...
2013/05/30
[ "https://philosophy.stackexchange.com/questions/7068", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/933/" ]
I don't know what Heidegger thought. But it should be clear that philosophy has this in common with poetry : both are about using innovation in language and imagery to try to capture and describe new ways of experiencing and thinking about the world. The poet crafts new metaphors and turns of phrase which can give you...
### Philosophy can learn how to reach the heart of people It is basically about how to write truth in a way that reaches and permeates the public sphere, connecting reason with aesthetics. Heidegger is deeply indebted to Hölderlin here and I'm surprised Badiou does not offer this obvious link himself. The main idea h...
7,988
``` require_once('../app/Mage.php'); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $collection = Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('status', array('neq' => 'complete')) ->addAttributeToFilter('status', array('neq' => 'canceled')) ...
2013/09/14
[ "https://magento.stackexchange.com/questions/7988", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/2325/" ]
The following code will give you an array starting with the root category (id: 1), then the stores root category and then the path down to the category your product is in. ``` $category = Mage::getModel('catalog/product')->load([id])->getCategory(); $path = explode('/', $category->getPath()); ``` How ever, this is q...
To get path from Root catalog ``` public function getCategoryPath($sku) { $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku); $pathArray = array(); $collection1 = $product->getCategoryCollection() ->setStoreId(Mage::app()->getStore()->getId()) ->addAttributeToSelect(...
7,988
``` require_once('../app/Mage.php'); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $collection = Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('status', array('neq' => 'complete')) ->addAttributeToFilter('status', array('neq' => 'canceled')) ...
2013/09/14
[ "https://magento.stackexchange.com/questions/7988", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/2325/" ]
The following code will give you an array starting with the root category (id: 1), then the stores root category and then the path down to the category your product is in. ``` $category = Mage::getModel('catalog/product')->load([id])->getCategory(); $path = explode('/', $category->getPath()); ``` How ever, this is q...
I used following code to find product categories for breadcrumbs when landing to product page outside site. (when `if ($category = $this->getCategory())` fails) `$cate` is last category product was found in and you can use category functions to get path. > > magento/app/code/core/Mage/Catalog/Helper/Data.php > > >...
7,988
``` require_once('../app/Mage.php'); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $collection = Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('status', array('neq' => 'complete')) ->addAttributeToFilter('status', array('neq' => 'canceled')) ...
2013/09/14
[ "https://magento.stackexchange.com/questions/7988", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/2325/" ]
To get path from Root catalog ``` public function getCategoryPath($sku) { $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku); $pathArray = array(); $collection1 = $product->getCategoryCollection() ->setStoreId(Mage::app()->getStore()->getId()) ->addAttributeToSelect(...
I used following code to find product categories for breadcrumbs when landing to product page outside site. (when `if ($category = $this->getCategory())` fails) `$cate` is last category product was found in and you can use category functions to get path. > > magento/app/code/core/Mage/Catalog/Helper/Data.php > > >...
16,149,178
I'm aware this is similar to numerous existing posts but after looking at a number of others I wasn't able to solve my problem. I'm attempting to load a folder full of html files I've been supplied with. I didn't write them but I have been modifying them to integrate them into an existing system. I've tried three ways...
2013/04/22
[ "https://Stackoverflow.com/questions/16149178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1854034/" ]
Try the following: ``` <link type="text/css" href="<?php echo base_url('css/cat/style.css') ?>" rel="stylesheet" /> ``` base\_url() functon simply return value, you should take a care for displaying returned value to output! :-)
Have you correctly configure you config file in codeIgniter ?
16,149,178
I'm aware this is similar to numerous existing posts but after looking at a number of others I wasn't able to solve my problem. I'm attempting to load a folder full of html files I've been supplied with. I didn't write them but I have been modifying them to integrate them into an existing system. I've tried three ways...
2013/04/22
[ "https://Stackoverflow.com/questions/16149178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1854034/" ]
Try the following: ``` <link type="text/css" href="<?php echo base_url('css/cat/style.css') ?>" rel="stylesheet" /> ``` base\_url() functon simply return value, you should take a care for displaying returned value to output! :-)
Or shorthand ``` <link type="text/css" href="<?=base_url('css/cat/style.css') ?>" rel="stylesheet" /> ``` Then view your page source and copy the link from there to your browser, see if you can access it.
16,149,178
I'm aware this is similar to numerous existing posts but after looking at a number of others I wasn't able to solve my problem. I'm attempting to load a folder full of html files I've been supplied with. I didn't write them but I have been modifying them to integrate them into an existing system. I've tried three ways...
2013/04/22
[ "https://Stackoverflow.com/questions/16149178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1854034/" ]
Try the following: ``` <link type="text/css" href="<?php echo base_url('css/cat/style.css') ?>" rel="stylesheet" /> ``` base\_url() functon simply return value, you should take a care for displaying returned value to output! :-)
Can try this code `<link type="text/css" href="<?=base_url('css/cat/style.css');?>" rel="stylesheet" />` if it doesn't work, you could try `<link type="text/css" href="<?=base_url('css/cat');?>/style.css" rel="stylesheet" />`
29,020,421
I want to show item based custom text in shopify cart page, please help me. Currently I've two different type of products but both of them showing the same informational text on cart.liquid and I want the text to be different based upon the product added to cart.
2015/03/12
[ "https://Stackoverflow.com/questions/29020421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2981097/" ]
you want to show the same product in the cart but with distinct text to differentiate them when add others in your shopify product page add this line in the form: ``` <input type="text" id="additional" name="properties[additional]" value="" /> ``` then at the front end add different texts to the same product, addin...
You can have a data-binding expression, ``` /Productinfo.aspx?ProductInformation=<%#Eval(productinfo)%> ``` Or in the most simplest way is ``` eval("productInfo" + PID + " = val[PId]"); ``` Hope this will give you a starting point. :)
8,534,981
I am using windows workflow 4.0 version in my project to manage workflow. One project gets created in the system which has 100 documents to be approved by users and each document should follow same workflow process. The document processing is parallel for 100 documents. Which ever finishes can go to the next workflow s...
2011/12/16
[ "https://Stackoverflow.com/questions/8534981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1095026/" ]
Your workflow steps (Document Created - Send for Review - Reviewed - Approved) sound like they involve human interactions, meaning they'll proceed at human time scales. Minutes at a minimum, more likely hours or days. Workflow 4.0 is designed with this use case in mind, as instances that are not actively progressing wi...
You could operate the items in a batch process or as you have in realtime. The issues to consider is how real-time does the process need to be. Can it be sufficient to execute a batch workflow every minute (*near realtime*) as opposed to the overhead of 100-1000 WF per second? You definitely need to consider the over...
8,534,981
I am using windows workflow 4.0 version in my project to manage workflow. One project gets created in the system which has 100 documents to be approved by users and each document should follow same workflow process. The document processing is parallel for 100 documents. Which ever finishes can go to the next workflow s...
2011/12/16
[ "https://Stackoverflow.com/questions/8534981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1095026/" ]
Your workflow steps (Document Created - Send for Review - Reviewed - Approved) sound like they involve human interactions, meaning they'll proceed at human time scales. Minutes at a minimum, more likely hours or days. Workflow 4.0 is designed with this use case in mind, as instances that are not actively progressing wi...
I cannot help you to optimize your scenario but you can optimize the performance by first caching the activities (instead of each time loading the xaml and creating an instance) and second by determining correctly when to unload the instances in memory.
8,534,981
I am using windows workflow 4.0 version in my project to manage workflow. One project gets created in the system which has 100 documents to be approved by users and each document should follow same workflow process. The document processing is parallel for 100 documents. Which ever finishes can go to the next workflow s...
2011/12/16
[ "https://Stackoverflow.com/questions/8534981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1095026/" ]
Your workflow steps (Document Created - Send for Review - Reviewed - Approved) sound like they involve human interactions, meaning they'll proceed at human time scales. Minutes at a minimum, more likely hours or days. Workflow 4.0 is designed with this use case in mind, as instances that are not actively progressing wi...
If you are hosting your WF using AppFabric (windows server) in IIS then this is not a problem. The steps you describe mean your WFs are waiting for time delays or messages resulting from some human interaction. The process will be idle until those events, which means after a small idle timeout, they will be unloaded fr...
10,743
I'm writing my bachelor-thesis and have a couple of small sub-sub-sections explaining conversions, like in the following ``` \subsubsection*{Assignment} This document only explains non-compound assignments. The other kind, i.e \texttt{a += b}, is supported by the language too, but is not yet implemented. \begin{ite...
2011/02/10
[ "https://tex.stackexchange.com/questions/10743", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/580/" ]
LaTeX uses `\flushbottom` for two-sided documents (`book` by default). Odd pages and even pages are forced to be aligned. In one-sided documents (`article`, `report` by default) LaTeX uses `\raggedbottom`, extra spaces will gone. cf. [`classes`](http://www.ctan.org/tex-archive/help/Catalogue/entries/classes.html) docum...
Then you have something on the same page which cannot be typeset in a good way, like large images or equations without a possibilty for a page break. However, write into the preamble ``` \raggedbottom ``` to allow ragged page bottoms
10,743
I'm writing my bachelor-thesis and have a couple of small sub-sub-sections explaining conversions, like in the following ``` \subsubsection*{Assignment} This document only explains non-compound assignments. The other kind, i.e \texttt{a += b}, is supported by the language too, but is not yet implemented. \begin{ite...
2011/02/10
[ "https://tex.stackexchange.com/questions/10743", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/580/" ]
LaTeX uses `\flushbottom` for two-sided documents (`book` by default). Odd pages and even pages are forced to be aligned. In one-sided documents (`article`, `report` by default) LaTeX uses `\raggedbottom`, extra spaces will gone. cf. [`classes`](http://www.ctan.org/tex-archive/help/Catalogue/entries/classes.html) docum...
End your section/paragraph with `\vfill`. This will "eat up" all the vertical whitespace after the text, making the text normally spaced. You will, however, get a (possibly big) area without anything, so use with caution. For some cases it works well.
56,792
My Pi camera will not work with the Pi zero using the same python code I use on my Pi 3 or Pi 2 Is there something I am missing?
2016/10/25
[ "https://raspberrypi.stackexchange.com/questions/56792", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/55554/" ]
Your log suggests that rasbpian server names (like `mirrordirector.raspbian.org`) are resolved to the IP address `10.0.0.1`, which is [private IP](https://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces). At the very least you don't seem to have a working DNS server, but it's entirely possible you hav...
Once you have followed Dmitry's advice regarding DNS, if you still have an issue... Check your etc/hosts file to see if you have domains pointed at 10.0.0.1. Unlikely but worth looking. or Ping google.com to see if you are getting out there
42,315,544
I'm trying to extract an IP address from a text, and don't understand the outcome according to the regex I write. Apparantly this: ``` echo '"IPAddress": "173.14.0.3",' | sed -n -r -e 's/"IPAddress": "(.*)"/\1/p' ``` returns ``` 173.14.0.3, ``` Why do I get the `,`at the end? Doesn't `"(.*)"` instruct the regex ...
2017/02/18
[ "https://Stackoverflow.com/questions/42315544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204289/" ]
Your input: ```none input: "IPAddress": "173.14.0.3", matched by regex: ^^^^^^^^^^^^^^^^^^^^^^^^^ (note: comma not matched) captured: ^^^^^^^^^^ ``` The matched part is replaced by the captured substring and substituted back into the original string, yielding: ```none result: ...
General advice: regex101.com does **not** support the regular expression languages supported by `sed`. These are explained in the [`POSIX`](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html) specification. While simple things *might* look similar, expressions **differ significantly** in detail. D...
35,753,511
I have been working on this project, and I have created a selection screen with functions and events so that when the mouse hovers over a button it turns orange. But it being a selection screen, once a button is clicked I want it to stay highlighted to show that that item has being selected but I can't seem to figure o...
2016/03/02
[ "https://Stackoverflow.com/questions/35753511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009065/" ]
How about this one: ``` #define S(str) { str, sizeof(str) - 1 } struct foo list[] = { S("The first entry"), ... }; #undef S ``` I `#undef`ed the macro right after the initialiser. Such short names should be used in a compact&short piece of code only. If you want to use it elsewhere, use a self-explanatory n...
Try ``` #define STR1 "The first entry" struct foo list[] = { {STR1, sizeof STR1}, ... ``` Please note that the size is set to `strlen(STR1) + 1`, due to the "string"'s `0`-terminator. To adjust this do ``` struct foo list[] = { {STR1, sizeof STR1 - 1}, ... ```
35,753,511
I have been working on this project, and I have created a selection screen with functions and events so that when the mouse hovers over a button it turns orange. But it being a selection screen, once a button is clicked I want it to stay highlighted to show that that item has being selected but I can't seem to figure o...
2016/03/02
[ "https://Stackoverflow.com/questions/35753511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009065/" ]
One alternative would be: ``` struct foo { char* buf; size_t buf_sz; }; ... struct foo list[] = { { "The first entry" }, { "The second entry" }, { "The third entry" } }; ... for ( int i = 0; i < sizeof(foo)/sizeof(foo[0]); i++ ) list[i].buf_sz = strlen(list[i].buf); // number of chars in st...
Try ``` #define STR1 "The first entry" struct foo list[] = { {STR1, sizeof STR1}, ... ``` Please note that the size is set to `strlen(STR1) + 1`, due to the "string"'s `0`-terminator. To adjust this do ``` struct foo list[] = { {STR1, sizeof STR1 - 1}, ... ```
35,753,511
I have been working on this project, and I have created a selection screen with functions and events so that when the mouse hovers over a button it turns orange. But it being a selection screen, once a button is clicked I want it to stay highlighted to show that that item has being selected but I can't seem to figure o...
2016/03/02
[ "https://Stackoverflow.com/questions/35753511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009065/" ]
How about this one: ``` #define S(str) { str, sizeof(str) - 1 } struct foo list[] = { S("The first entry"), ... }; #undef S ``` I `#undef`ed the macro right after the initialiser. Such short names should be used in a compact&short piece of code only. If you want to use it elsewhere, use a self-explanatory n...
You cannot use your second definition for a static duration `foo` array, because initializer lists for static duration objects are required to be constant. Draft n1256 for C99 states in 6.7.8 Initialization §4 > > 4 All the expressions in an initializer for an object that has static storage duration shall be constant...
35,753,511
I have been working on this project, and I have created a selection screen with functions and events so that when the mouse hovers over a button it turns orange. But it being a selection screen, once a button is clicked I want it to stay highlighted to show that that item has being selected but I can't seem to figure o...
2016/03/02
[ "https://Stackoverflow.com/questions/35753511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009065/" ]
One alternative would be: ``` struct foo { char* buf; size_t buf_sz; }; ... struct foo list[] = { { "The first entry" }, { "The second entry" }, { "The third entry" } }; ... for ( int i = 0; i < sizeof(foo)/sizeof(foo[0]); i++ ) list[i].buf_sz = strlen(list[i].buf); // number of chars in st...
You cannot use your second definition for a static duration `foo` array, because initializer lists for static duration objects are required to be constant. Draft n1256 for C99 states in 6.7.8 Initialization §4 > > 4 All the expressions in an initializer for an object that has static storage duration shall be constant...
26,426,689
I am using Spyder 2.3.1 and python(x, y). In the preferences of Spyder you can activate "Style analysis". This is quite nice, but I want to increase the max. tolerable line length. The standard setting for PEP8 is 79 characters. This can be changed through a setup.cfg with the content: ``` [pep8] max-line-length = 9...
2014/10/17
[ "https://Stackoverflow.com/questions/26426689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4153871/" ]
If you are user "myname" using conda, in environment "myenv" try to edit the file: /home/myname/miniconda3/envs/myenv/lib/python3.7/site-packages/pycodestyle.py and change MAX\_LINE\_LENGTH=79 to MAX\_LINE\_LENGTH=100, for example. Worked for my Spyder 3.3.6.
using the Spyder 4.0.0.dev0 went to my ~/.config/spyder.ini, ensured that my spyder application was not running change the dictionary value 'maxLineLength': 100 from 'maxLineLength': 79. Started my app and it worked now if you edit the file while your spyder app is running upon shutting down it will overwrite what eve...