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
406,667
I was wondering if there is a word to describe a person who always is really quick at looking things up on etc. his phone. E.g when you just can't remember the characters name in the film you just saw and this guy quickly pulls his phone out and looks it up. I am looking for an adjective to fit: I was not sure about...
2017/08/20
[ "https://english.stackexchange.com/questions/406667", "https://english.stackexchange.com", "https://english.stackexchange.com/users/254135/" ]
The skill is known as [Google-fu](http://www.urbandictionary.com/define.php?term=google-fu), and is a [noun](https://en.wiktionary.org/wiki/Google-fu). So although you can't use it as a straight adjective (ie 'he is Google-fu'), you can say 'his Google-fu is very impressive'. In terms of your sample sentence, you cou...
I wasn't sure about the meaning of the word, but my ***google-master*** friend quickly found the answer with his phone. I can't give you a definition or a source because I made it up.
2,306
I'm trying to write something sort of poetic sounding. > > Instead of memories let's discover the > present that we wanted to search for. > > > I'm thinking that maybe I should write the word "moment" after "present" to make it unambiguous. I would rather not though, because I don't want to limit the meaning of ...
2011/03/29
[ "https://writers.stackexchange.com/questions/2306", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/1671/" ]
From a strictly grammatical point of view, I think the context of "memories" establishes the expected temporal sense of "present" rather than leaving any reasonable possibility that it could be interpreted as a gift; so you shouldn't run into any difficulties due to ambiguity. (Although this is technically off-topic, ...
You could replace "present" with "now" (or something similar) and remove the potential for ambiguity.
10,628,177
I have to read a text file line by line and extract some part of each line. I have a working code if the line I am reading is in the expected format but this is not always the case. There are errors in the file, i.e. some missing information or characters. So I want to skip these faulty lines. For this, I want to utili...
2012/05/16
[ "https://Stackoverflow.com/questions/10628177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/659401/" ]
The documentation for match objects is [a little further down](http://docs.python.org/library/re.html#match-objects).
`re.match()` should return a match object, unless there is no match, in which case it returns `None`: <http://docs.python.org/library/re.html#re.match>
10,628,177
I have to read a text file line by line and extract some part of each line. I have a working code if the line I am reading is in the expected format but this is not always the case. There are errors in the file, i.e. some missing information or characters. So I want to skip these faulty lines. For this, I want to utili...
2012/05/16
[ "https://Stackoverflow.com/questions/10628177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/659401/" ]
The documentation for match objects is [a little further down](http://docs.python.org/library/re.html#match-objects).
As documented in <http://docs.python.org/library/re.html>, match() will return a MatchObject is a match is found, None otherwise. So, simply say: ``` for line in ... : m = your_regexp.match(line) if m: process(line) ```
10,628,177
I have to read a text file line by line and extract some part of each line. I have a working code if the line I am reading is in the expected format but this is not always the case. There are errors in the file, i.e. some missing information or characters. So I want to skip these faulty lines. For this, I want to utili...
2012/05/16
[ "https://Stackoverflow.com/questions/10628177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/659401/" ]
As mentioned in the [documentation](http://docs.python.org/library/re.html#regular-expression-syntax), `$` matches the end of a string. You can modify your regular expression to include `$` at the end. Example: ``` match_this = "abc12a" #expression you would like to match dont_match_this = "abc12a9" #expression that r...
The documentation for match objects is [a little further down](http://docs.python.org/library/re.html#match-objects).
10,628,177
I have to read a text file line by line and extract some part of each line. I have a working code if the line I am reading is in the expected format but this is not always the case. There are errors in the file, i.e. some missing information or characters. So I want to skip these faulty lines. For this, I want to utili...
2012/05/16
[ "https://Stackoverflow.com/questions/10628177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/659401/" ]
As mentioned in the [documentation](http://docs.python.org/library/re.html#regular-expression-syntax), `$` matches the end of a string. You can modify your regular expression to include `$` at the end. Example: ``` match_this = "abc12a" #expression you would like to match dont_match_this = "abc12a9" #expression that r...
`re.match()` should return a match object, unless there is no match, in which case it returns `None`: <http://docs.python.org/library/re.html#re.match>
10,628,177
I have to read a text file line by line and extract some part of each line. I have a working code if the line I am reading is in the expected format but this is not always the case. There are errors in the file, i.e. some missing information or characters. So I want to skip these faulty lines. For this, I want to utili...
2012/05/16
[ "https://Stackoverflow.com/questions/10628177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/659401/" ]
As mentioned in the [documentation](http://docs.python.org/library/re.html#regular-expression-syntax), `$` matches the end of a string. You can modify your regular expression to include `$` at the end. Example: ``` match_this = "abc12a" #expression you would like to match dont_match_this = "abc12a9" #expression that r...
As documented in <http://docs.python.org/library/re.html>, match() will return a MatchObject is a match is found, None otherwise. So, simply say: ``` for line in ... : m = your_regexp.match(line) if m: process(line) ```
65,260,809
Let's say I have a JSON array like this: ```json [ { "name": "alpha", "value": 1 }, { "name": "beta", "value": 2 }, ... ] ``` (It contains about 50-100 items; this is a simplified example.) I want to produce a JSON object from it like this: ```json { "alpha": 1...
2020/12/12
[ "https://Stackoverflow.com/questions/65260809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278800/" ]
The jq-esque solution to the problem is illustrated by: ``` jq 'from_entries | {alpha, beta, gamma}' input.json ``` This will convert the array to an object, and then select the values corresponding to the specified keys if present, while also ensuring all the specified keys are present. Keylist ------- If you hav...
Of course right after posting this, I figure it out. The solution I came up with is to flatten the array of objects into a single object, using the `add()` function. So this filter: ``` [.[] | { (.name): .value }] | add ``` produces: ```json { "alpha": 1, "beta": 2 } ``` And then to select the individual fie...
339,657
How can I find two concatenated repeated lines in files? For example, in this file we have only two concatenated repeated lines: ``` OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05 OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05.ear OQ-63/ECC/Global/M...
2017/01/23
[ "https://unix.stackexchange.com/questions/339657", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/153544/" ]
Uniq should be enough: ``` $ cat c.txt OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05 OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05.ear OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/E...
Another option: ``` grep -zPo '\n(.+)\n\1\n' ``` This way we may add extra tuning (example accept extra spaces, etc) Upgrade: as @thor pointed out this is not capturing repetitions at the begining of the file. To cover this situation use ``` grep -zPo '(?<!.)(.+\n)\1' ```
339,657
How can I find two concatenated repeated lines in files? For example, in this file we have only two concatenated repeated lines: ``` OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05 OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05.ear OQ-63/ECC/Global/M...
2017/01/23
[ "https://unix.stackexchange.com/questions/339657", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/153544/" ]
Uniq should be enough: ``` $ cat c.txt OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05 OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05.ear OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/E...
Yet another option with AWK: `awk 'x !~ $0; {x=$0}'` This way you can get the same behavior as uniq, but can also do per column. `awk -F/ 'x !~ $2; {x=$2}'` `-F` sets the field separator. This way you remove lines where the second field is consecutively equal to the previous line's second field. ``` $ cat c.txt...
339,657
How can I find two concatenated repeated lines in files? For example, in this file we have only two concatenated repeated lines: ``` OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05 OQ-63/ECC/Global/MES/CZ/adWerum-CZ-Adapter OQ-63/ECC/Global/MES/54/ECC-MRP-S05.ear OQ-63/ECC/Global/M...
2017/01/23
[ "https://unix.stackexchange.com/questions/339657", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/153544/" ]
Another option: ``` grep -zPo '\n(.+)\n\1\n' ``` This way we may add extra tuning (example accept extra spaces, etc) Upgrade: as @thor pointed out this is not capturing repetitions at the begining of the file. To cover this situation use ``` grep -zPo '(?<!.)(.+\n)\1' ```
Yet another option with AWK: `awk 'x !~ $0; {x=$0}'` This way you can get the same behavior as uniq, but can also do per column. `awk -F/ 'x !~ $2; {x=$2}'` `-F` sets the field separator. This way you remove lines where the second field is consecutively equal to the previous line's second field. ``` $ cat c.txt...
22,684,314
I build a sql query as: ``` declare @query1 varchar(1000) declare @results varchar(4000) set @results = '' WHILE (condition) BEGIN set @query1 = 'SELECT column FROM table' set @results = @results + ", " + (select @query1) END print @results ``` So, for example after 2 iterations, I would like to have: ``` c...
2014/03/27
[ "https://Stackoverflow.com/questions/22684314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/524861/" ]
Ok, because I led you up the garden path with my previous answer, I ported [this](https://stackoverflow.com/a/27943/14357) to give you an algorithm that works: ``` void Main() { double lat1=12.916933d, lon1=77.562658d, lat2=12.930140d, lon2=77.587732d; double dist = GetDistanc...
Check if decimal delimiter is valid. It has to be comma or dot, depending on your regional settings.
24,153,554
When starting a PowerShell host (powershell.exe, PowerShellISE, NuGet Package Manager Console etc) I was getting the following error message. > > File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 > cannot be loaded because its operation is blocked by software > restriction policies. For more informat...
2014/06/11
[ "https://Stackoverflow.com/questions/24153554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29491/" ]
If I **delete or move** the problem profile script then all of my PowerShell hosts start without errors, including the PowerShell ISE which was using it's own *Current User Current Host* script C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE\_profile.ps1 It turns out that the problem with my Al...
Actually, that looks like AppLocker error message. Some information about it can be found [here](http://jamessql.blogspot.nl/2013/04/limit-running-powershell-script-under.html) (however author is doing reverse - he tries to limit script usage). If other profiles work (other than profile.ps1) that it may be just a deny...
24,153,554
When starting a PowerShell host (powershell.exe, PowerShellISE, NuGet Package Manager Console etc) I was getting the following error message. > > File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 > cannot be loaded because its operation is blocked by software > restriction policies. For more informat...
2014/06/11
[ "https://Stackoverflow.com/questions/24153554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29491/" ]
If I **delete or move** the problem profile script then all of my PowerShell hosts start without errors, including the PowerShell ISE which was using it's own *Current User Current Host* script C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE\_profile.ps1 It turns out that the problem with my Al...
Delete both files ``` C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1 C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 ```
24,153,554
When starting a PowerShell host (powershell.exe, PowerShellISE, NuGet Package Manager Console etc) I was getting the following error message. > > File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 > cannot be loaded because its operation is blocked by software > restriction policies. For more informat...
2014/06/11
[ "https://Stackoverflow.com/questions/24153554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29491/" ]
If I **delete or move** the problem profile script then all of my PowerShell hosts start without errors, including the PowerShell ISE which was using it's own *Current User Current Host* script C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE\_profile.ps1 It turns out that the problem with my Al...
I want to use the defualt profile, but I got a same question. I have changed the executionplicy to solve the problem. ``` Set-ExecutionPolicy Unrestricted ``` [link] <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.2> <https://learn.microsoft....
24,153,554
When starting a PowerShell host (powershell.exe, PowerShellISE, NuGet Package Manager Console etc) I was getting the following error message. > > File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 > cannot be loaded because its operation is blocked by software > restriction policies. For more informat...
2014/06/11
[ "https://Stackoverflow.com/questions/24153554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29491/" ]
Delete both files ``` C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1 C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 ```
Actually, that looks like AppLocker error message. Some information about it can be found [here](http://jamessql.blogspot.nl/2013/04/limit-running-powershell-script-under.html) (however author is doing reverse - he tries to limit script usage). If other profiles work (other than profile.ps1) that it may be just a deny...
24,153,554
When starting a PowerShell host (powershell.exe, PowerShellISE, NuGet Package Manager Console etc) I was getting the following error message. > > File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 > cannot be loaded because its operation is blocked by software > restriction policies. For more informat...
2014/06/11
[ "https://Stackoverflow.com/questions/24153554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29491/" ]
I want to use the defualt profile, but I got a same question. I have changed the executionplicy to solve the problem. ``` Set-ExecutionPolicy Unrestricted ``` [link] <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.2> <https://learn.microsoft....
Actually, that looks like AppLocker error message. Some information about it can be found [here](http://jamessql.blogspot.nl/2013/04/limit-running-powershell-script-under.html) (however author is doing reverse - he tries to limit script usage). If other profiles work (other than profile.ps1) that it may be just a deny...
24,153,554
When starting a PowerShell host (powershell.exe, PowerShellISE, NuGet Package Manager Console etc) I was getting the following error message. > > File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 > cannot be loaded because its operation is blocked by software > restriction policies. For more informat...
2014/06/11
[ "https://Stackoverflow.com/questions/24153554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29491/" ]
Delete both files ``` C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1 C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1 ```
I want to use the defualt profile, but I got a same question. I have changed the executionplicy to solve the problem. ``` Set-ExecutionPolicy Unrestricted ``` [link] <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.2> <https://learn.microsoft....
9,590,317
Is it possible do something like this ? When I click on the button I need the following animation: button to set some alpha filter and starts to fall down as indicated by the arrow, it will disappear on tab. Can you tell me how to do this ? Thanks a lot ... Here is image url: <http://img534.imageshack.us/img534/8149...
2012/03/06
[ "https://Stackoverflow.com/questions/9590317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1006835/" ]
It's definitely possible, but there are some issues you have to overcome. One is that UIBarButtonItem isn't a UIView. One way is to loop through the subviews of the UIToolbar or UINavigationBar. Another way is to figure out the position of the button. Another is to get the view using private api if you're not submittin...
You can't really move it from view to view, as your views could clip and then you'd get frames with only a partial image. Probably the best thing to do is to create a view on the fly which covers the whole screen, copy the button image into the view at the original point, remove the button from the original view, then ...
62,417,198
I am having trouble understanding the concept of static and dynamic sites within the context of a React app. I am reading about how you can deploy React apps to Netlify which is known for hosting static sites. But all the React apps I've made make requests to Node/Express backends and shows the data that gets returned ...
2020/06/16
[ "https://Stackoverflow.com/questions/62417198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10085548/" ]
Actually, I am quite sure your Logger is being updated correctly. The problem is that both application instances are going to use the same Logging configuration. If you look at [Log4j's architecture](http://logging.apache.org/log4j/2.x/manual/architecture.html) you will see that the Loggers and the configuration are ...
As per observation, your logger is updated with the last initialization so after `app2.initializeYourLogger()` your object-level `logger` object updated with App2 configuration. You need to return the logger object from `initializeYourLogger()` and also create separate Logger object.
59,780,850
I'm using redis with k8s 1.15.0, istio 1.4.3, it works well inside the network. However when I tryed to use the istio gateway and sidecar to expose it to outside network, it failed. Then I removed the istio sidecar and just started the redis server in k8s, it worked. After searching I added DestinationRule to the co...
2020/01/17
[ "https://Stackoverflow.com/questions/59780850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7537990/" ]
There are few thing that need to be different in case of exposing TCP application with istio. 1. The `hosts:` needs to be `"*"` as `TCP` protocol works only with `IP:PORT`. There are no headers in L4. 2. There needs to be `TCP` port `match` Your `VirtualService` that matches `GateWay`. I suggest to name it in a unique...
Thanks for suren's answer. But i think `redis.basic.svc.cluster.local` is outside DNS host to match by VirtualService, and `VirtualService`.`host` is route to service `redis-svc` with full namespace path. Maybe not for that reason.
64,237,775
I'm getting an error says `Unexpected char 0x0a at 18 in header value` when I add a custom header to my `Volley` String request. Here is my code. ``` stringRequest = new StringRequest(Request.Method.GET, URL, string -> { try { JSONObject jsonObject = new JSONObject(string); ...
2020/10/07
[ "https://Stackoverflow.com/questions/64237775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You have to use `json.loads` not `json.dumps`. Try this: ``` import json event = { "Records":[ { "messageId":"916f5e95-b2f6-4148-9c62-2ac8e764f06c", "receiptHandle":"AQEBmLuoGWtLtFFgvyCFdSPMJh2HKgHOIPWNUq22EOwCzGT8iILZm97CE6j4J6oR71ZpDr3sgxQcJyVZ+dmmvGl+fFftT9GCJqZYrjMGsR2Q6WsMd8ciI8bTtDXy...
Try using json.loads(string) to deserialize the json. Also, I don't believe you need to specify the index [0] since 'body' is an object and not an array.
72,087,458
I've working on this code for quite a while and I can't find how to make this case insensitive ``` #include <iostream> #include <string> #include <sstream> using namespace std; int findCountry(string arr[], int len, string seek) { for (int i = 0; i < len; ++i) { if (arr[i] == seek) return i; } ...
2022/05/02
[ "https://Stackoverflow.com/questions/72087458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19009496/" ]
It appears that each `ptm` is a scalar array. To obtain the scalar equivalent of a scalar array `ptm`, use `ptm.item()` ([documentation](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.item.html)). So instead of appending `ptm` to `inside`, try appending `ptm.item()`. Alternatively, appending `float(p...
If I understand properly what you are trying to do, you just need to append `ptm[0]` (i.e the first - and only - integer of the array `ptm`) instead of `ptm`.
51,975,828
Is there an option to use gcloud commands programmatically via - Java? I see not all of the google provided libraries have all the functionalities that are present as part of gcloud command.
2018/08/22
[ "https://Stackoverflow.com/questions/51975828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9481677/" ]
Ugh :-( You're correct but there's a better solution. Please see this explanation: <https://cloud.google.com/apis/docs/client-libraries-explained> I discourage you from shelling out to calling the gcloud commands from Java to solve your problem *and* from attempting to make the calls directly. In summary: All of G...
url : cloud.google.com/compute/docs/containers/deploying-containers I found below description "You can only use this feature through the Google Cloud Platform Console or the gcloud command-line tool, not the API." here its not possible using api but only possible use gcloud command line. so using gcloud command fr...
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
you should be able to remove or add PivotItems dynamically in your Pivot by using the respective collection methods on Pivot.Items . Let me know if this doesn't work for your scenario.
I've modified the Bajena behavior to improve it, solving the issue with losing the original position of the PivotItem when showing/hiding repeteadly and the issue when parentpivot control is null (not initialized yet). Notice that this behavior must be attached to the Pivot, not to the PivotItem. Code: ``` public ...
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
You can remove the pivot item from the parent pivot control ``` parentPivotControl.Items.Remove(pivotItemToBeRemoved); ```
Removing PivotItems is easy, but if you want to put them back afterwards I've found that the headers get messed up and start overlapping each other. This also happens if you set the Visibility of a header to Collapsed and then later make it Visible again. So I solved my particular problem by setting the opacity of eac...
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
You can remove the pivot item from the parent pivot control ``` parentPivotControl.Items.Remove(pivotItemToBeRemoved); ```
``` foreach (PivotItem item in MyPivot.Items.ToList()) { if (item.Visibility == Visibility.Collapsed) MyPivot.Items.Remove(item); } ```
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
I've created a custom behavior for showing/hiding pivot item Usage: ``` < i:Interaction.Behaviors> < common:HideablePivotItemBehavior Visible="{Binding variable}" /> </ i:Interaction.Behaviors > ``` Code: ``` /// <summary> /// Behavior which enables showing/hiding of a pivot item` /// </summary> public class H...
You can remove the pivot item from the parent pivot control ``` parentPivotControl.Items.Remove(pivotItemToBeRemoved); ```
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
you should be able to remove or add PivotItems dynamically in your Pivot by using the respective collection methods on Pivot.Items . Let me know if this doesn't work for your scenario.
Setting `IsLocked` property to true will make all other Pivot items to disappear except the current pivot item. But this will not hide one particular pivot item of our choice.
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
Removing PivotItems is easy, but if you want to put them back afterwards I've found that the headers get messed up and start overlapping each other. This also happens if you set the Visibility of a header to Collapsed and then later make it Visible again. So I solved my particular problem by setting the opacity of eac...
I've modified the Bajena behavior to improve it, solving the issue with losing the original position of the PivotItem when showing/hiding repeteadly and the issue when parentpivot control is null (not initialized yet). Notice that this behavior must be attached to the Pivot, not to the PivotItem. Code: ``` public ...
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
you should be able to remove or add PivotItems dynamically in your Pivot by using the respective collection methods on Pivot.Items . Let me know if this doesn't work for your scenario.
To elaborate on the solution of adding/removing pivotItems, rather than hiding them. Let's say we want the pivotItem to be initially invisible, and appear only on a certain event. ``` mainPivot.Items.Remove(someTab); ``` Then to add it again, ``` if (!mainPivot.Items.Cast<PivotItem>().Any(p => p.Name == "someTab...
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
I've created a custom behavior for showing/hiding pivot item Usage: ``` < i:Interaction.Behaviors> < common:HideablePivotItemBehavior Visible="{Binding variable}" /> </ i:Interaction.Behaviors > ``` Code: ``` /// <summary> /// Behavior which enables showing/hiding of a pivot item` /// </summary> public class H...
``` foreach (PivotItem item in MyPivot.Items.ToList()) { if (item.Visibility == Visibility.Collapsed) MyPivot.Items.Remove(item); } ```
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
Removing PivotItems is easy, but if you want to put them back afterwards I've found that the headers get messed up and start overlapping each other. This also happens if you set the Visibility of a header to Collapsed and then later make it Visible again. So I solved my particular problem by setting the opacity of eac...
To elaborate on the solution of adding/removing pivotItems, rather than hiding them. Let's say we want the pivotItem to be initially invisible, and appear only on a certain event. ``` mainPivot.Items.Remove(someTab); ``` Then to add it again, ``` if (!mainPivot.Items.Cast<PivotItem>().Any(p => p.Name == "someTab...
5,531,566
When I try input new value OR change value OR delete value(nothing) to products 1 or products 2 I don't wanna insert NULL value into DB. products TABLE ``` +-------------+--------------+---------------+ | products_id | categories_id| products_name | +-------------+--------------+---------------+ | 1 | 1 ...
2011/04/03
[ "https://Stackoverflow.com/questions/5531566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649239/" ]
you should be able to remove or add PivotItems dynamically in your Pivot by using the respective collection methods on Pivot.Items . Let me know if this doesn't work for your scenario.
You can remove the pivot item from the parent pivot control ``` parentPivotControl.Items.Remove(pivotItemToBeRemoved); ```
74,019,097
I need to convert the posters object below to the normal array of objects but my code is not looking best any way to convert it proper in TypeScript. and I don't know what a poster's object structure is called? ``` const posters = { facebook: ['aaa', 'bbb', 'ccc'], twitter: ['aaa', 'bbb', 'ccc'], instagram: ['a...
2022/10/10
[ "https://Stackoverflow.com/questions/74019097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11581715/" ]
Here's a functional approach for transforming the entries which have a non-null value: [TS Playground](https://www.typescriptlang.org/play?noUncheckedIndexedAccess=true&target=99&jsx=4&useUnknownInCatchVariables=true&exactOptionalPropertyTypes=true#code/C4TwDgpgBACg9gZ2BATgg8gIwFZQLxQBKEAxnCgCYA8SKAlgHYDmANFLY0wNoC6UA...
I like to use [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) when I need to loop over something and omit some values in the result. I might try something like this: ``` const transformedPosters = Object.keys(posters).reduce((acc, currentKey) => { const value =...
2,575
My Australian friend says yes. I'm not so sure, considering the monarchy collects no taxes from England, much less a country in the commonwealth. What's the verdict? Can she say "you're fired" and Tony Abbot is out?
2012/07/12
[ "https://history.stackexchange.com/questions/2575", "https://history.stackexchange.com", "https://history.stackexchange.com/users/282/" ]
*Theoretically*, yes. The prime minister is appointed by the governor-general, who is the representative of the Australian monarch (currently Queen Elizabeth II). The queen could instruct her representative to appoint a new prime minister at any time. (If the governor-general refused, the queen could appoint a new gov...
The Queen (or King) of England is a constitutional monarch, a ceremonial figure whose powers are strictly circumscribed by the constitutions of England (or other Commonwealth countries). In THEORY, the "chain of command" goes from the queen, to the governor-general of the Commonwealth, to the Prime Minister of Austral...
2,575
My Australian friend says yes. I'm not so sure, considering the monarchy collects no taxes from England, much less a country in the commonwealth. What's the verdict? Can she say "you're fired" and Tony Abbot is out?
2012/07/12
[ "https://history.stackexchange.com/questions/2575", "https://history.stackexchange.com", "https://history.stackexchange.com/users/282/" ]
*Theoretically*, yes. The prime minister is appointed by the governor-general, who is the representative of the Australian monarch (currently Queen Elizabeth II). The queen could instruct her representative to appoint a new prime minister at any time. (If the governor-general refused, the queen could appoint a new gov...
Section 61 of the Constitution says "The executive power of the Commonwealth is vested in the Queen and **is exercisable by the Governor-General** as the Queen’s representative [...]". Prime Minister Robert Menzies had to pass a Parliamentary standing order specially for Queen Elizabeth to be able to open Parliament ...
2,575
My Australian friend says yes. I'm not so sure, considering the monarchy collects no taxes from England, much less a country in the commonwealth. What's the verdict? Can she say "you're fired" and Tony Abbot is out?
2012/07/12
[ "https://history.stackexchange.com/questions/2575", "https://history.stackexchange.com", "https://history.stackexchange.com/users/282/" ]
*Theoretically*, yes. The prime minister is appointed by the governor-general, who is the representative of the Australian monarch (currently Queen Elizabeth II). The queen could instruct her representative to appoint a new prime minister at any time. (If the governor-general refused, the queen could appoint a new gov...
1. The Queen Cannot sack the Prime Minister of Australia. 2. In 1975, (I was there) the Governor General did NOT sack the Prime Minister, he has no power to sack the Prime Minister. 3. What can happen is this. If the Parliament cannot get legislature through parliament, due to blockage of the other side. Again and agai...
2,575
My Australian friend says yes. I'm not so sure, considering the monarchy collects no taxes from England, much less a country in the commonwealth. What's the verdict? Can she say "you're fired" and Tony Abbot is out?
2012/07/12
[ "https://history.stackexchange.com/questions/2575", "https://history.stackexchange.com", "https://history.stackexchange.com/users/282/" ]
Section 61 of the Constitution says "The executive power of the Commonwealth is vested in the Queen and **is exercisable by the Governor-General** as the Queen’s representative [...]". Prime Minister Robert Menzies had to pass a Parliamentary standing order specially for Queen Elizabeth to be able to open Parliament ...
The Queen (or King) of England is a constitutional monarch, a ceremonial figure whose powers are strictly circumscribed by the constitutions of England (or other Commonwealth countries). In THEORY, the "chain of command" goes from the queen, to the governor-general of the Commonwealth, to the Prime Minister of Austral...
2,575
My Australian friend says yes. I'm not so sure, considering the monarchy collects no taxes from England, much less a country in the commonwealth. What's the verdict? Can she say "you're fired" and Tony Abbot is out?
2012/07/12
[ "https://history.stackexchange.com/questions/2575", "https://history.stackexchange.com", "https://history.stackexchange.com/users/282/" ]
The Queen (or King) of England is a constitutional monarch, a ceremonial figure whose powers are strictly circumscribed by the constitutions of England (or other Commonwealth countries). In THEORY, the "chain of command" goes from the queen, to the governor-general of the Commonwealth, to the Prime Minister of Austral...
1. The Queen Cannot sack the Prime Minister of Australia. 2. In 1975, (I was there) the Governor General did NOT sack the Prime Minister, he has no power to sack the Prime Minister. 3. What can happen is this. If the Parliament cannot get legislature through parliament, due to blockage of the other side. Again and agai...
2,575
My Australian friend says yes. I'm not so sure, considering the monarchy collects no taxes from England, much less a country in the commonwealth. What's the verdict? Can she say "you're fired" and Tony Abbot is out?
2012/07/12
[ "https://history.stackexchange.com/questions/2575", "https://history.stackexchange.com", "https://history.stackexchange.com/users/282/" ]
Section 61 of the Constitution says "The executive power of the Commonwealth is vested in the Queen and **is exercisable by the Governor-General** as the Queen’s representative [...]". Prime Minister Robert Menzies had to pass a Parliamentary standing order specially for Queen Elizabeth to be able to open Parliament ...
1. The Queen Cannot sack the Prime Minister of Australia. 2. In 1975, (I was there) the Governor General did NOT sack the Prime Minister, he has no power to sack the Prime Minister. 3. What can happen is this. If the Parliament cannot get legislature through parliament, due to blockage of the other side. Again and agai...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
please try to use FragmentTransaction instead of FragmentManager. I think the below code will solve your problem. If not, Please let me know. ``` FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); SnoozeDialog snoozeDialog = new SnoozeDialog(); snoozeDialog.show(ft, "snooze_dialog"); ``` EDIT: ...
Though it's not officially mentioned anywhere but I faced this problem couple of times. In my experience there is something wrong in compatibility library supporting fragments on older platforms which causes this problem. You use test this by using normal fragment manager API. If nothing works then you can use the norm...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
I have found an elegant solution for this problem by using reflection. Problem of all above solutions is that fields **mDismissed** and **mShownByMe** do not change their state. Just override method "show" in your own custom bottom sheet dialog fragment like sample below (Kotlin) ``` override fun show(manager: Fragme...
This error appears to be occurring because input events (such as key down or onclick events) are getting delivered after `onSaveInstanceState` is called. The solution is to override `onSaveInstanceState` in your Activity and cancel any pending events. ``` @Override protected void onSaveInstanceState(Bundle outState) ...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
Though it's not officially mentioned anywhere but I faced this problem couple of times. In my experience there is something wrong in compatibility library supporting fragments on older platforms which causes this problem. You use test this by using normal fragment manager API. If nothing works then you can use the norm...
The following implementation can be used to solve the problem of performing safely state changes during the `Activity` lifecycle, in particular for showing dialogs: if the instance state has already been saved (e.g. due to a configuration change), it postpones them until the resumed state has been performed. ``` publi...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
That mean you `commit()` (`show()` in case of DialogFragment) fragment after `onSaveInstanceState()`. Android will save your fragment state at `onSaveInstanceState()`. So, if you `commit()` fragment after `onSaveInstanceState()` fragment state will be lost. As a result, if Activity get killed and recreate later the f...
Make your dialog fragment object global and call dismissAllowingStateLoss() in onPause() method ``` @Override protected void onPause() { super.onPause(); if (dialogFragment != null) { dialogFragment.dismissAllowingStateLoss(); } } ``` Don't forget to assign value in fragment and call show() on b...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
I have run in to this problem for years. The Internets are littered with scores (hundreds? thousands?) of discussions about this, and confusion and disinformation in them seems aplenty. To make the situation worse, and in the spirit of the xkcd "14 standards" comic, I am throwing in my answer in to the ring. [...
Many views post high-level events such as click handlers to the event queue to run deferred. So the problem is that "onSaveInstanceState" has already been called for the Activity but the event queue contains deferred "click event". Hence when this event is dispatched to your handler ``` at android.os.Handler.handleCa...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
``` private void showSnoozeDialog() { FragmentManager fm = getSupportFragmentManager(); SnoozeDialog snoozeDialog = new SnoozeDialog(); // snoozeDialog.show(fm, "snooze_dialog"); FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.add(snoozeDialog, "snooze_dialog"); ft.co...
I have run in to this problem for years. The Internets are littered with scores (hundreds? thousands?) of discussions about this, and confusion and disinformation in them seems aplenty. To make the situation worse, and in the spirit of the xkcd "14 standards" comic, I am throwing in my answer in to the ring. [...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
Make your dialog fragment object global and call dismissAllowingStateLoss() in onPause() method ``` @Override protected void onPause() { super.onPause(); if (dialogFragment != null) { dialogFragment.dismissAllowingStateLoss(); } } ``` Don't forget to assign value in fragment and call show() on b...
Many views post high-level events such as click handlers to the event queue to run deferred. So the problem is that "onSaveInstanceState" has already been called for the Activity but the event queue contains deferred "click event". Hence when this event is dispatched to your handler ``` at android.os.Handler.handleCa...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
After few days I want share my solution how I've fixed it, to show DialogFragment you should to override `show()` method of it and call `commitAllowingStateLoss()` on `Transaction` object. Here is example in Kotlin: ``` override fun show(manager: FragmentManager?, tag: String?) { try { val ft = man...
This error appears to be occurring because input events (such as key down or onclick events) are getting delivered after `onSaveInstanceState` is called. The solution is to override `onSaveInstanceState` in your Activity and cancel any pending events. ``` @Override protected void onSaveInstanceState(Bundle outState) ...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
That mean you `commit()` (`show()` in case of DialogFragment) fragment after `onSaveInstanceState()`. Android will save your fragment state at `onSaveInstanceState()`. So, if you `commit()` fragment after `onSaveInstanceState()` fragment state will be lost. As a result, if Activity get killed and recreate later the f...
Many views post high-level events such as click handlers to the event queue to run deferred. So the problem is that "onSaveInstanceState" has already been called for the Activity but the event queue contains deferred "click event". Hence when this event is dispatched to your handler ``` at android.os.Handler.handleCa...
15,729,138
Some users are reporting, if they use the quick action in the notification bar, they are getting a force close. I show a quick action in the notification who calls the **"TestDialog"** class. In the TestDialog class after pressing the button "snooze", I will show the SnoozeDialog. ``` private View.OnClickListener btn...
2013/03/31
[ "https://Stackoverflow.com/questions/15729138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242070/" ]
This is common [issue](https://code.google.com/p/android/issues/detail?id=23761). We solved this issue by overriding show() and handling exception in DialogFragment extended class ``` public class CustomDialogFragment extends DialogFragment { @Override public void show(FragmentManager manager, String tag) { ...
1. Add this class to your project: (must be in **android.support.v4.app** package) ``` package android.support.v4.app; /** * Created by Gil on 8/16/2017. */ public class StatelessDialogFragment extends DialogFragment { /** * Display the dialog, adding the fragment using an existing transaction and then c...
17,876
While installing Elementary OS for my Acer Spin 1 SP111-32N, it keeps on giving me this error at the very end of the installation. I know my computer uses an eMMC SSD drive, so maybe that is the issue.
2019/01/10
[ "https://elementaryos.stackexchange.com/questions/17876", "https://elementaryos.stackexchange.com", "https://elementaryos.stackexchange.com/users/16991/" ]
I have a laptop that utilizes an eMMC card as well and was able to get elementaryOS installed on it, but I did have to fiddle with some BIOS settings before any distro would install. Disabling SecureBoot as well as disabling firmware TPM. After that, choose the "try elementaryOS without installing option" instead of th...
I had the same problem and after a while I found an easy solution. Press fn+F2 key to enter BIOS: Enable F12 Boot Menu Set Supervisor Password Disable Secure Boot Press F10 to save and exit, then press F12 to enter boot menu, and start live session. Open your terminal and follow these steps to **install ...
7,566,785
I have a text file with the name textfile1.txt in C: location and this file conatains in a server machine and the machine ip is 1.127.0.0, I want to read this text file in my java application and display the content, Please help me in this, Thanks in Advance, Thanks, Kiran
2011/09/27
[ "https://Stackoverflow.com/questions/7566785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/954657/" ]
Put the file in a shared folder on the server, and use standard java IO to reference that filepath, e.g. `\\<your server ip>\shared\textfile1.txt`.
You could copy the file to your local machine and read it from there. [This answer](https://stackoverflow.com/questions/995944/ssh-library-for-java/996415#996415) could help you do it.
33,228,076
``` <div class="form-inline"> <div class="form-group col-lg-4"> <label>Select Item:</label> <div id="field1"> <select class="form-control" name="item_1"> <?php if($item !=0){foreach ($item as $list_item){?> <option value="<?php echo $list_item['item'];?>"> <?php echo $list_i...
2015/10/20
[ "https://Stackoverflow.com/questions/33228076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4988791/" ]
There are several issues: * Avoid putting blobs of HTML in your javascript, put your HTML in the HTML file. * Avoid IDs, particularly when they will certainly be duplicated. Duplicate IDs are illegal. Only the first one can be found with a lookup. * Avoid concatenating together strings of text to generate your HTML. I...
You can remove elements with a reference to the parent using similar syntax with the following: ``` var childElement = document.getElementById("myChildElement"); document.getElementById("myElement").removeChild(childElement); ``` Similar to what is described here: <http://www.w3schools.com/js/js_htmldom_nodes.asp> ...
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE Mem_DOB >= Cast(current_timestamp As Date) AND Mem_DOB < DATEADD(d, 30, Cast(current_timestamp As Date)); ```
Try this... ~~SELECT Mem\_FirstNA, Mem\_LastNA, Mem\_DOB FROM MemberDetails WHERE ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) >= getdate() - 1 AND ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) <= getdate...
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE Mem_DOB >= Cast(current_timestamp As Date) AND Mem_DOB < DATEADD(d, 30, Cast(current_timestamp As Date)); ```
why not use this where clause: ``` WHERE MEM_DOB BETWEEN GETDATE()-1 AND GETDATE()+30 ```
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
Updated ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE DATEDIFF(DAY, GETDATE(), DATEADD(YEAR, DATEDIFF(YEAR, Mem_DOB, GETDATE()), Mem_DOB)) BETWEEN 0 AND 30 ```
Try this ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE WHERE DATEPART(mm,Mem_DOB) BETWEEN DATEPART(mm,getDate()) AND DATEPART(mm,getDate())+1; ```
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
try this ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE DAYOFYEAR(Mem_DOB)-DAYOFYEAR(getdate())<=30 ```
Try this ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE WHERE DATEPART(mm,Mem_DOB) BETWEEN DATEPART(mm,getDate()) AND DATEPART(mm,getDate())+1; ```
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE Mem_DOB >= Cast(current_timestamp As Date) AND Mem_DOB < DATEADD(d, 30, Cast(current_timestamp As Date)); ```
Should work. Between usage was removed based on comments. Will work for January birth dates as well ``` DECLARE @now DATETIME SET @now = GETDATE() SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE CASE WHEN month(Mem_DOB) = 1 THEN DATEADD(YY, YEAR(DATEADD(DAY, 30, DATEADD(m, month(@n...
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
Should work. Between usage was removed based on comments. Will work for January birth dates as well ``` DECLARE @now DATETIME SET @now = GETDATE() SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE CASE WHEN month(Mem_DOB) = 1 THEN DATEADD(YY, YEAR(DATEADD(DAY, 30, DATEADD(m, month(@n...
Try this... ~~SELECT Mem\_FirstNA, Mem\_LastNA, Mem\_DOB FROM MemberDetails WHERE ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) >= getdate() - 1 AND ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) <= getdate...
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
try this ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE DAYOFYEAR(Mem_DOB)-DAYOFYEAR(getdate())<=30 ```
Try this... ~~SELECT Mem\_FirstNA, Mem\_LastNA, Mem\_DOB FROM MemberDetails WHERE ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) >= getdate() - 1 AND ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) <= getdate...
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
Updated ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE DATEDIFF(DAY, GETDATE(), DATEADD(YEAR, DATEDIFF(YEAR, Mem_DOB, GETDATE()), Mem_DOB)) BETWEEN 0 AND 30 ```
why not use this where clause: ``` WHERE MEM_DOB BETWEEN GETDATE()-1 AND GETDATE()+30 ```
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
Updated ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE DATEDIFF(DAY, GETDATE(), DATEADD(YEAR, DATEDIFF(YEAR, Mem_DOB, GETDATE()), Mem_DOB)) BETWEEN 0 AND 30 ```
Try this... ~~SELECT Mem\_FirstNA, Mem\_LastNA, Mem\_DOB FROM MemberDetails WHERE ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) >= getdate() - 1 AND ltrim(str(year(GETDATE()))) + '-' + ltrim(str(month(Mem\_DOB))) + '-' + ltrim(str(day(Mem\_DOB))) <= getdate...
19,441,808
I am doing my project in MVC4 using c# and sql.. I have a table `MemberDetails` which contain table ``` CREATE TABLE [dbo].[MemberDetails] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Mem_FirstNA] VARCHAR (100) NOT NULL, [Mem_LastNA] VARCHAR (100) NOT NULL, [Mem_Occ] VARCHAR (100) NOT NULL, [Mem_DOB]...
2013/10/18
[ "https://Stackoverflow.com/questions/19441808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2677745/" ]
``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE Mem_DOB >= Cast(current_timestamp As Date) AND Mem_DOB < DATEADD(d, 30, Cast(current_timestamp As Date)); ```
Try this ``` SELECT Mem_FirstNA, Mem_LastNA, Mem_DOB FROM MemberDetails WHERE WHERE DATEPART(mm,Mem_DOB) BETWEEN DATEPART(mm,getDate()) AND DATEPART(mm,getDate())+1; ```
23,638,850
I am using this code to create a JCheckBox ``` private final JCheckBox cbDisplayMessage = new JCheckBox("Display"); cbDisplayMessage.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if(e.getItemSelectable() == cbDisplayMessage) { ...
2014/05/13
[ "https://Stackoverflow.com/questions/23638850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1028276/" ]
You can try with `ActionListener` instead of `ItemListener` as shown below without causing `StackOverflow` error. ``` cbDisplayMessage.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (cbDisplayMessage.isSelected()) { cbDisplayMessage.setSe...
Your listener is called every time the state changes, but you trigger a new state change from within that listener, so each state change results in that listener being called over and over again until your stack is full. Your setup has to be a bit more complicated to do something like that - if you want to change the s...
25,293,606
How to get Distinct Count of First Name, Last Name based on DOB. Assuming that Two persons can share same name but not DOB. ``` SELECT COUNT((DISTINCT [First Name], [Last Name], [DOB])) AS TotalCount FROM MyTable ```
2014/08/13
[ "https://Stackoverflow.com/questions/25293606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/620720/" ]
You can, but you have to duplicate the layers ``` // add an OpenStreetMap tile layer L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' }).addTo(map); // add the same OpenStreetMap tile layer to the second map L.tileLaye...
The solution of copying the hard code is not satisfactory, you must of course go through a forEach loop. Here is a complete example (using CDN files): ``` 'use strict' const getLeaflet = (() => { const script = document.createElement('script') script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/lea...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
1. Compile your application with `-g`, then you'll have debug symbols in the binary file. 2. Use `gdb` to open the gdb console. 3. Use `file` and pass it your application's binary file in the console. 4. Use `run` and pass in any arguments your application needs to start. 5. Do something to cause a *Segmentation Fault*...
Yes, there is a problem with pointers. Very likely you're using one that's not initialized properly, but it's also possible that you're messing up your memory management with double frees or some such. To avoid uninitialized pointers as local variables, try declaring them as late as possible, preferably (and this isn'...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
Before the problem arises, try to avoid it as much as possible: * Compile and run your code as often as you can. It will be easier to locate the faulty part. * Try to encapsulate low-level / error prone routines so that you rarely have to work directly with memory (pay attention to the modelization of your program) * ...
Yes, there is a problem with pointers. Very likely you're using one that's not initialized properly, but it's also possible that you're messing up your memory management with double frees or some such. To avoid uninitialized pointers as local variables, try declaring them as late as possible, preferably (and this isn'...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
On Unix you can use `valgrind` to find issues. It's free and powerful. If you'd rather do it yourself you can overload the `new` and `delete` operators to set up a configuration where you have 1 byte with `0xDEADBEEF` before and after each new object. Then track what happens at each iteration. This can fail to catch ev...
Yes, there is a problem with pointers. Very likely you're using one that's not initialized properly, but it's also possible that you're messing up your memory management with double frees or some such. To avoid uninitialized pointers as local variables, try declaring them as late as possible, preferably (and this isn'...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
Sometimes the crash itself isn't the real cause of the problem-- perhaps the memory got smashed at an earlier point but it took a while for the corruption to show itself. Check out [valgrind](http://valgrind.org/), which has lots of checks for pointer problems (including array bounds checking). It'll tell you where the...
I don't know of any methodology to use to fix things like this. I don't think it would be possible to come up with one either for the very issue at hand is that your program's behavior is undefined (I don't know of any case when SEGFAULT hasn't been caused by some sort of UB). There are all kinds of "methodologies" to...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
Before the problem arises, try to avoid it as much as possible: * Compile and run your code as often as you can. It will be easier to locate the faulty part. * Try to encapsulate low-level / error prone routines so that you rarely have to work directly with memory (pay attention to the modelization of your program) * ...
I don't know of any methodology to use to fix things like this. I don't think it would be possible to come up with one either for the very issue at hand is that your program's behavior is undefined (I don't know of any case when SEGFAULT hasn't been caused by some sort of UB). There are all kinds of "methodologies" to...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
1. Compile your application with `-g`, then you'll have debug symbols in the binary file. 2. Use `gdb` to open the gdb console. 3. Use `file` and pass it your application's binary file in the console. 4. Use `run` and pass in any arguments your application needs to start. 5. Do something to cause a *Segmentation Fault*...
I don't know of any methodology to use to fix things like this. I don't think it would be possible to come up with one either for the very issue at hand is that your program's behavior is undefined (I don't know of any case when SEGFAULT hasn't been caused by some sort of UB). There are all kinds of "methodologies" to...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
Before the problem arises, try to avoid it as much as possible: * Compile and run your code as often as you can. It will be easier to locate the faulty part. * Try to encapsulate low-level / error prone routines so that you rarely have to work directly with memory (pay attention to the modelization of your program) * ...
On Unix you can use `valgrind` to find issues. It's free and powerful. If you'd rather do it yourself you can overload the `new` and `delete` operators to set up a configuration where you have 1 byte with `0xDEADBEEF` before and after each new object. Then track what happens at each iteration. This can fail to catch ev...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
1. Compile your application with `-g`, then you'll have debug symbols in the binary file. 2. Use `gdb` to open the gdb console. 3. Use `file` and pass it your application's binary file in the console. 4. Use `run` and pass in any arguments your application needs to start. 5. Do something to cause a *Segmentation Fault*...
Sometimes the crash itself isn't the real cause of the problem-- perhaps the memory got smashed at an earlier point but it took a while for the corruption to show itself. Check out [valgrind](http://valgrind.org/), which has lots of checks for pointer problems (including array bounds checking). It'll tell you where the...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
Sometimes the crash itself isn't the real cause of the problem-- perhaps the memory got smashed at an earlier point but it took a while for the corruption to show itself. Check out [valgrind](http://valgrind.org/), which has lots of checks for pointer problems (including array bounds checking). It'll tell you where the...
Yes, there is a problem with pointers. Very likely you're using one that's not initialized properly, but it's also possible that you're messing up your memory management with double frees or some such. To avoid uninitialized pointers as local variables, try declaring them as late as possible, preferably (and this isn'...
3,719,014
This function was written to create a Lotus email, populate it, save it to the Drafts section, and then open it for the user to edit. However, it has 2 problems: 1. It doesn't always open the right draft email for editing. 2. It sometimes produces a "Notes Error - Specified command is not available from the workspace....
2010/09/15
[ "https://Stackoverflow.com/questions/3719014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124367/" ]
1. Compile your application with `-g`, then you'll have debug symbols in the binary file. 2. Use `gdb` to open the gdb console. 3. Use `file` and pass it your application's binary file in the console. 4. Use `run` and pass in any arguments your application needs to start. 5. Do something to cause a *Segmentation Fault*...
Before the problem arises, try to avoid it as much as possible: * Compile and run your code as often as you can. It will be easier to locate the faulty part. * Try to encapsulate low-level / error prone routines so that you rarely have to work directly with memory (pay attention to the modelization of your program) * ...
10,017,943
I'm trying to test a presenter method using a Capybara RSpec matcher. Lets say I have a method that renders a button. This would be the test I would write if I wasn't using capybara rspec matchers: ``` it "should generate a button" do template.should_receive(:button_to).with("Vote"). and_return("THE_HTML") su...
2012/04/04
[ "https://Stackoverflow.com/questions/10017943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/562692/" ]
Check out `Capybara.string` method: <http://rubydoc.info/github/jnicklas/capybara/master/Capybara#string-class_method> With this method you should be able to write something like that: ``` subject { Capybara.string(presenter.render_controls } it { should have_button('Vote') } ```
Even though luacassus's answer is correct, I found what the problem was. I wasn't including capybara rspec matchers in the test. If you don't include Capybara rspec matchers, you will an error like this: **undefined method has\_selector? for ActiveSupport::SafeBuffer:0x9449590**. When you include the rspec matchers, ...
42,844,023
so I have this code ``` int main() { int n, c, k; printf("Enter an integer\n"); scanf("%d", &n); printf("%d in binary is:\n", n); for (c = 31; c >= 0; c--) { k = n >> c; if (k & 1) printf("1"); else printf("0"); } printf("\n"); return 0; } ``` It converts decimal into...
2017/03/16
[ "https://Stackoverflow.com/questions/42844023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7170005/" ]
> > *It converts decimal into binary but only in 32 bits. When I change it into 64 bits it doesn't work (it seems like it just doubles the result from 32 bits).* > > > The problem is here. ``` int n, c, k; printf("Enter an integer\n"); scanf("%d", &n); ``` `n` is an `int` which can be as small as 16 bits...
The problem is your n & k variables' data type. They are integer. Check your platform's data type size using sizeof(int). When you change to 64-bits, these variables can't hold 64-bit values. HTH!
42,844,023
so I have this code ``` int main() { int n, c, k; printf("Enter an integer\n"); scanf("%d", &n); printf("%d in binary is:\n", n); for (c = 31; c >= 0; c--) { k = n >> c; if (k & 1) printf("1"); else printf("0"); } printf("\n"); return 0; } ``` It converts decimal into...
2017/03/16
[ "https://Stackoverflow.com/questions/42844023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7170005/" ]
> > *It converts decimal into binary but only in 32 bits. When I change it into 64 bits it doesn't work (it seems like it just doubles the result from 32 bits).* > > > The problem is here. ``` int n, c, k; printf("Enter an integer\n"); scanf("%d", &n); ``` `n` is an `int` which can be as small as 16 bits...
the following code is one way to handle the problem: ``` #include <stdio.h> #include <stdlib.h> int main( void ) { long long unsigned int n; long long int c; long long unsigned int k; printf("Enter an integer\n"); if( 1 != scanf("%llu", &n) ) { perror( "scanf for 64 bit numbe...
59,055,737
I have the following url: <http://10.11.100.163:1080/v1/publish/?category=conf&product=UFED_INFIELD&serial=123&productGUIDs%5B0%5D%5Bproduct%5D=GLOBAL&productGUIDs%5B0%5D%5Bguid%5D=undefinedblabla&productGUIDs%5B1%5D%5Bproduct%5D=UFED_INFIELD&productGUIDs%5B1%5D%5Bguid%5D=undefinedblabla> As you can see there are sev...
2019/11/26
[ "https://Stackoverflow.com/questions/59055737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3151659/" ]
The correct `queryStringParameters` syntax is an array of objects with `name`/`values` keys, like this: ``` "queryStringParameters": [ { "name": "category", "values": ["conf"] }, { "name": "product", "values": ["UFED_INFIELD"] }, { "name": "productGUIDs%5B0%5...
Here an example of an expectation in a file.yaml for a POST request with queryStringParameters. To adapt it to the GET method just **delete the body** and change "POST" by "GET" : ``` times: remainingTimes: 1 unlimited: false httpRequest: method: POST path: /accounts/login queryStringParameters: urlparam...
4,081,442
I'm trying to select a block of code between 2 comment tags like this: ``` <!-- begin answers --> ...[code] <!-- end answers --> ``` I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very...
2010/11/02
[ "https://Stackoverflow.com/questions/4081442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396956/" ]
The regular expression you tried should work but unfortunately, the regex engine that Notepad++ uses (Scintilla) cannot match across new lines. So there is no way of doing it. This limitation is documented [here](http://www.scintilla.org/SciTEDoc.html). Also it only supports very basic expressions. And you cannot sele...
You can write a small application to read the file as a long string. Then determine the index of the first comment using something like... ``` xml.IndexOfAny("<!-- begin answers -->".ToCharArray(), 0, xml.Count()); xml.IndexOfAny("<!-- end answers -->".ToCharArray(), 0, xml.Count()); ``` Once you know the indexes, y...
4,081,442
I'm trying to select a block of code between 2 comment tags like this: ``` <!-- begin answers --> ...[code] <!-- end answers --> ``` I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very...
2010/11/02
[ "https://Stackoverflow.com/questions/4081442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396956/" ]
You could use since Notepad++ v~ 6.0+: search what: `(?<=<!-- begin answers -->\r?\n).*?(?=<!-- end answers -->)` This will highlight all code that is between `<!-- begin answers -->\r?\n` and `<!-- end answers -->` Be sure you have tick `Regular Expression` and `dot match newline`
You can write a small application to read the file as a long string. Then determine the index of the first comment using something like... ``` xml.IndexOfAny("<!-- begin answers -->".ToCharArray(), 0, xml.Count()); xml.IndexOfAny("<!-- end answers -->".ToCharArray(), 0, xml.Count()); ``` Once you know the indexes, y...
4,081,442
I'm trying to select a block of code between 2 comment tags like this: ``` <!-- begin answers --> ...[code] <!-- end answers --> ``` I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very...
2010/11/02
[ "https://Stackoverflow.com/questions/4081442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396956/" ]
The regular expression you tried should work but unfortunately, the regex engine that Notepad++ uses (Scintilla) cannot match across new lines. So there is no way of doing it. This limitation is documented [here](http://www.scintilla.org/SciTEDoc.html). Also it only supports very basic expressions. And you cannot sele...
[YWE](https://stackoverflow.com/questions/4081442/how-do-i-select-all-code-inbetween-comments-with-notepad-regex/4081850#4081850) is exactly right about why your regex isn't functioning properly; +1 to him. See code below to get an idea of how easy it is to do something like this in Python. Please note that this opera...
4,081,442
I'm trying to select a block of code between 2 comment tags like this: ``` <!-- begin answers --> ...[code] <!-- end answers --> ``` I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very...
2010/11/02
[ "https://Stackoverflow.com/questions/4081442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396956/" ]
The regular expression you tried should work but unfortunately, the regex engine that Notepad++ uses (Scintilla) cannot match across new lines. So there is no way of doing it. This limitation is documented [here](http://www.scintilla.org/SciTEDoc.html). Also it only supports very basic expressions. And you cannot sele...
You could use since Notepad++ v~ 6.0+: search what: `(?<=<!-- begin answers -->\r?\n).*?(?=<!-- end answers -->)` This will highlight all code that is between `<!-- begin answers -->\r?\n` and `<!-- end answers -->` Be sure you have tick `Regular Expression` and `dot match newline`
4,081,442
I'm trying to select a block of code between 2 comment tags like this: ``` <!-- begin answers --> ...[code] <!-- end answers --> ``` I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very...
2010/11/02
[ "https://Stackoverflow.com/questions/4081442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396956/" ]
The regular expression you tried should work but unfortunately, the regex engine that Notepad++ uses (Scintilla) cannot match across new lines. So there is no way of doing it. This limitation is documented [here](http://www.scintilla.org/SciTEDoc.html). Also it only supports very basic expressions. And you cannot sele...
Using the below in Find & Replace (***Regular expression*** and ***.matches newline*** selected) works for me: ``` <!-- begin answers -->(.*?)<!-- end answers --> ```
4,081,442
I'm trying to select a block of code between 2 comment tags like this: ``` <!-- begin answers --> ...[code] <!-- end answers --> ``` I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very...
2010/11/02
[ "https://Stackoverflow.com/questions/4081442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396956/" ]
You could use since Notepad++ v~ 6.0+: search what: `(?<=<!-- begin answers -->\r?\n).*?(?=<!-- end answers -->)` This will highlight all code that is between `<!-- begin answers -->\r?\n` and `<!-- end answers -->` Be sure you have tick `Regular Expression` and `dot match newline`
[YWE](https://stackoverflow.com/questions/4081442/how-do-i-select-all-code-inbetween-comments-with-notepad-regex/4081850#4081850) is exactly right about why your regex isn't functioning properly; +1 to him. See code below to get an idea of how easy it is to do something like this in Python. Please note that this opera...
4,081,442
I'm trying to select a block of code between 2 comment tags like this: ``` <!-- begin answers --> ...[code] <!-- end answers --> ``` I've tried something along the lines of `<!-- begin answers -->.*<!-- end answers -->` but my regex knowledge is fairly limited. My knowledge of Notepad++'s find and replace is very...
2010/11/02
[ "https://Stackoverflow.com/questions/4081442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396956/" ]
You could use since Notepad++ v~ 6.0+: search what: `(?<=<!-- begin answers -->\r?\n).*?(?=<!-- end answers -->)` This will highlight all code that is between `<!-- begin answers -->\r?\n` and `<!-- end answers -->` Be sure you have tick `Regular Expression` and `dot match newline`
Using the below in Find & Replace (***Regular expression*** and ***.matches newline*** selected) works for me: ``` <!-- begin answers -->(.*?)<!-- end answers --> ```
53,214,221
I have an algorithm, which after each iteration creates a matrix. After some operations on matrix it is plotted to the user. if I run program 6 times I will get: [![a bunch of images](https://i.stack.imgur.com/9Rcc7.jpg)](https://i.stack.imgur.com/9Rcc7.jpg) My goal is to changing image dynamically, like a movie. I...
2018/11/08
[ "https://Stackoverflow.com/questions/53214221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5504461/" ]
You can use [FFMPEG](https://www.ffmpeg.org/) ``` def convert(): os.system("ffmpeg -r 1 -i img%01d.png -vcodec mpeg4 -y movie.mp4") ``` Alternatively, you can use [ImageIO](http://imageio.github.io/) to generate a GIF. You can set the parameters for duration of each frame. ``` import imageio with imageio.get_wr...
Video Data Generation code from scratch in Python (use Jupyter): ``` import numpy as np import skvideo.io as sk # creating sample video data num_vids = 5 num_imgs = 100 img_size = 50 min_object_size = 1 max_object_size = 5 for i_vid in range(num_vids): imgs = np.zeros((num_imgs, img_size, img_size)) # set background...
26,224,548
I've searched a lot in the forum, but haven't found anything about regarding this issue. I have 2 properties in the EntityFramework Code First: ``` [Column(TypeName = "Money")] public decimal? Debit { get; set; } [Column(TypeName = "Money")] public decimal? Credit { get; set; } ``` One of them shoul...
2014/10/06
[ "https://Stackoverflow.com/questions/26224548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4114784/" ]
I don't see how you can do this with the [available Code First Data Annotations.](http://msdn.microsoft.com/en-gb/data/jj591583.aspx) You could override the `ValidateEntity` method of the `DbContext` class and add validation logic for that type of entity. Or you could add argument validation logic to you properties....
In SQL Server, a database field is either nullable or not nullable. Your design requires columns to be null sometimes which means both must be nullable alternatives include Use zero instead of null. Or have one column Amount and another column IsDebit You could also write properties for your class such as ``` [N...
26,224,548
I've searched a lot in the forum, but haven't found anything about regarding this issue. I have 2 properties in the EntityFramework Code First: ``` [Column(TypeName = "Money")] public decimal? Debit { get; set; } [Column(TypeName = "Money")] public decimal? Credit { get; set; } ``` One of them shoul...
2014/10/06
[ "https://Stackoverflow.com/questions/26224548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4114784/" ]
You could always do the validation on the database side with a constraint, ``` ALTER TABLE TableName ADD CONSTRAINT OneColumnNull CHECK ((Debit IS NULL AND Credit IS NOT NULL) OR (Debit IS NOT NULL AND Credit IS NULL) ) ``` does exactly what you are looking for. You could just put that query as ...
In SQL Server, a database field is either nullable or not nullable. Your design requires columns to be null sometimes which means both must be nullable alternatives include Use zero instead of null. Or have one column Amount and another column IsDebit You could also write properties for your class such as ``` [N...
26,224,548
I've searched a lot in the forum, but haven't found anything about regarding this issue. I have 2 properties in the EntityFramework Code First: ``` [Column(TypeName = "Money")] public decimal? Debit { get; set; } [Column(TypeName = "Money")] public decimal? Credit { get; set; } ``` One of them shoul...
2014/10/06
[ "https://Stackoverflow.com/questions/26224548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4114784/" ]
You could always do the validation on the database side with a constraint, ``` ALTER TABLE TableName ADD CONSTRAINT OneColumnNull CHECK ((Debit IS NULL AND Credit IS NOT NULL) OR (Debit IS NOT NULL AND Credit IS NULL) ) ``` does exactly what you are looking for. You could just put that query as ...
I don't see how you can do this with the [available Code First Data Annotations.](http://msdn.microsoft.com/en-gb/data/jj591583.aspx) You could override the `ValidateEntity` method of the `DbContext` class and add validation logic for that type of entity. Or you could add argument validation logic to you properties....
29,608,709
I need help with reading the folder and opening / outputting the csv data, I have used examples other people have written but none of them have worked for me. What I currently have is this, but it doesn't output the files: ``` $files = scandir($PathToCreate.$version."/"); //scan the folder foreach($files as $file) { ...
2015/04/13
[ "https://Stackoverflow.com/questions/29608709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4783486/" ]
This should work for you: (Here I first grab all files out of the directory which have the extension `*.csv` with [`glob()`](http://php.net/manual/en/function.glob.php). After this I loop through each file and read it with [`fopen()`](http://php.net/manual/en/function.fopen.php) and [`fgetcsv()`](http://php.net/manual...
The first issue probably is that you have to ignore the two directory entries `.` and `..` which have special meaning and are not useful for you: ``` $files = scandir($PathToCreate.$version."/"); //scan the folder foreach($files as $file) { //for each file in the folder if ( ! in_array($file, ['.','..'])) { $lin...
45,262,945
product model : ``` public class product { private String productName; private String productCategory; private String productDescription; private double productPrice; private String productCondition; private String productStatus; private int unitInStatus; private String productManufactu...
2017/07/23
[ "https://Stackoverflow.com/questions/45262945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7919727/" ]
`sorted` can provide a custom sort condition for example (assuming that all strings are not empty) ``` let array = ["c_572A267C-DAC8-487D-B1AF-719FE8E3A6AB_FF6E00_2", "b_69E21DC6-431C-4373-B4F1-90BF7FB5462B_FFC000_1"] let sortedArray = array.sorted { $0.substring(from: $0.index(before: $0.endIndex)) < $1.substring(fro...
No doubt it is. By using [sorted(by:)](https://developer.apple.com/documentation/swift/array/2296815-sorted), you could do it like this: ``` let myArray = ["c_572A267C-DAC8-487D-B1AF-719FE8E3A6AB_FF6E00_2", "b_69E21DC6-431C-4373-B4F1-90BF7FB5462B_FFC000_1"] let sortedArray = myArray.sorted { guard ...
45,262,945
product model : ``` public class product { private String productName; private String productCategory; private String productDescription; private double productPrice; private String productCondition; private String productStatus; private int unitInStatus; private String productManufactu...
2017/07/23
[ "https://Stackoverflow.com/questions/45262945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7919727/" ]
`sorted` can provide a custom sort condition for example (assuming that all strings are not empty) ``` let array = ["c_572A267C-DAC8-487D-B1AF-719FE8E3A6AB_FF6E00_2", "b_69E21DC6-431C-4373-B4F1-90BF7FB5462B_FFC000_1"] let sortedArray = array.sorted { $0.substring(from: $0.index(before: $0.endIndex)) < $1.substring(fro...
One more answer with `Higher Order Function`: > > 1. Reverse Each word in an `Array` > 2. Then, Sort > > > ``` let arr = ["c_572A267C-DAC8-487D-B1AF-719FE8E3A6AB_FF6E00_2", "b_69E21DC6-431C-4373-B4F1-90BF7FB5462B_FFC000_1"] ``` **One Line:** ``` let returnValue = arr.map({String($0.reversed())})...
16,406,489
I've got a working migration on dev and I'm trying to migrate in test. `rake:migrate` works up until the latest migration that I added today. I was running `db:migrate` and it the output was inclusive of the latest migration. I have also confirmed that the table in question exists in my local DB. When I tried to run `...
2013/05/06
[ "https://Stackoverflow.com/questions/16406489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1810434/" ]
Usually you don't have to migrate your test database. It sounds like the development database is not migrated yet. Every time you are running your tests, the development schema is used as a basis for testing db. Try migrating your development database before running tests: ``` rake db:migrate ``` Maybe that's it.
Make sure your migrations are up : `rake db:migrate:status` and try `rake db:test:prepare`. Some useful info from [Rails Guides](http://guides.rubyonrails.org/testing.html#preparing-your-application-for-testing).
2,907,197
> > Suppose in an urn there are $20$ black balls labelled $1,2, \ldots , 20$ and $10$ white balls labelled $1,2, \ldots ,10$. Balls are drawn one by one without replacement. Find the probability that the white ball labelled $1$ is drawn before all the black balls. > > > **My attempt** $:$ If we want to draw the ...
2018/09/06
[ "https://math.stackexchange.com/questions/2907197", "https://math.stackexchange.com", "https://math.stackexchange.com/users/543867/" ]
The question is rather badly posed. "The first white ball" sounds as if it refers to the first white ball drawn, but apparently it's intended to refer to the white ball with the number $1$. There's indeed a much simpler way to show that the probability of drawing the white ball with the number $1$ before all black bal...
Your expression $\sum\_{k=1}^{10}\frac{9!(30-k)!}{30!(10-k)!}$ can be rewritten as $\frac{9!20!}{30!}\sum\_{k=1}^{10}\binom{30-k}{20}$. Now $\binom{30-k}{20}$ is the number of ways to choose $21$ numbers from $\{1,\ldots,30\}$ with the first being $k$ (because the remaining $20$ numbers must be chosen from the $30-k$ n...
2,907,197
> > Suppose in an urn there are $20$ black balls labelled $1,2, \ldots , 20$ and $10$ white balls labelled $1,2, \ldots ,10$. Balls are drawn one by one without replacement. Find the probability that the white ball labelled $1$ is drawn before all the black balls. > > > **My attempt** $:$ If we want to draw the ...
2018/09/06
[ "https://math.stackexchange.com/questions/2907197", "https://math.stackexchange.com", "https://math.stackexchange.com/users/543867/" ]
The question is rather badly posed. "The first white ball" sounds as if it refers to the first white ball drawn, but apparently it's intended to refer to the white ball with the number $1$. There's indeed a much simpler way to show that the probability of drawing the white ball with the number $1$ before all black bal...
To evaluate $\sum\_{k=1}^{10}\frac{9!}{30!}\frac{(30-k)!}{(10-k)!}$: \begin{align} \sum\_{k=1}^{10}\frac{9!}{30!}\frac{(30-k)!}{(10-k)!}&=\frac{9!\cdot 20!}{30!}\sum\_{k=1}^{10}\frac{(30-k)!}{20!(10-k)!} \\ &=\frac{9!\cdot 20!}{30!}\sum\_{k=1}^{10}\binom{30-k}{20} \\ &=\frac{9!\cdot 20!}{30!}\left[\binom{20}{20}+\bino...
2,907,197
> > Suppose in an urn there are $20$ black balls labelled $1,2, \ldots , 20$ and $10$ white balls labelled $1,2, \ldots ,10$. Balls are drawn one by one without replacement. Find the probability that the white ball labelled $1$ is drawn before all the black balls. > > > **My attempt** $:$ If we want to draw the ...
2018/09/06
[ "https://math.stackexchange.com/questions/2907197", "https://math.stackexchange.com", "https://math.stackexchange.com/users/543867/" ]
The question is rather badly posed. "The first white ball" sounds as if it refers to the first white ball drawn, but apparently it's intended to refer to the white ball with the number $1$. There's indeed a much simpler way to show that the probability of drawing the white ball with the number $1$ before all black bal...
If Balls are drawn one by one out of an Urn containing w White balls and b Black balls. Then the number of Black balls, before the 1st White ball is given by :$ \frac{1}{Total White Balls + B\_{special} }(Total Black balls)$. $B\_{special}$ which will break the chain of Black balls. Then we can say, The expected number...
2,907,197
> > Suppose in an urn there are $20$ black balls labelled $1,2, \ldots , 20$ and $10$ white balls labelled $1,2, \ldots ,10$. Balls are drawn one by one without replacement. Find the probability that the white ball labelled $1$ is drawn before all the black balls. > > > **My attempt** $:$ If we want to draw the ...
2018/09/06
[ "https://math.stackexchange.com/questions/2907197", "https://math.stackexchange.com", "https://math.stackexchange.com/users/543867/" ]
To evaluate $\sum\_{k=1}^{10}\frac{9!}{30!}\frac{(30-k)!}{(10-k)!}$: \begin{align} \sum\_{k=1}^{10}\frac{9!}{30!}\frac{(30-k)!}{(10-k)!}&=\frac{9!\cdot 20!}{30!}\sum\_{k=1}^{10}\frac{(30-k)!}{20!(10-k)!} \\ &=\frac{9!\cdot 20!}{30!}\sum\_{k=1}^{10}\binom{30-k}{20} \\ &=\frac{9!\cdot 20!}{30!}\left[\binom{20}{20}+\bino...
Your expression $\sum\_{k=1}^{10}\frac{9!(30-k)!}{30!(10-k)!}$ can be rewritten as $\frac{9!20!}{30!}\sum\_{k=1}^{10}\binom{30-k}{20}$. Now $\binom{30-k}{20}$ is the number of ways to choose $21$ numbers from $\{1,\ldots,30\}$ with the first being $k$ (because the remaining $20$ numbers must be chosen from the $30-k$ n...
2,907,197
> > Suppose in an urn there are $20$ black balls labelled $1,2, \ldots , 20$ and $10$ white balls labelled $1,2, \ldots ,10$. Balls are drawn one by one without replacement. Find the probability that the white ball labelled $1$ is drawn before all the black balls. > > > **My attempt** $:$ If we want to draw the ...
2018/09/06
[ "https://math.stackexchange.com/questions/2907197", "https://math.stackexchange.com", "https://math.stackexchange.com/users/543867/" ]
Your expression $\sum\_{k=1}^{10}\frac{9!(30-k)!}{30!(10-k)!}$ can be rewritten as $\frac{9!20!}{30!}\sum\_{k=1}^{10}\binom{30-k}{20}$. Now $\binom{30-k}{20}$ is the number of ways to choose $21$ numbers from $\{1,\ldots,30\}$ with the first being $k$ (because the remaining $20$ numbers must be chosen from the $30-k$ n...
If Balls are drawn one by one out of an Urn containing w White balls and b Black balls. Then the number of Black balls, before the 1st White ball is given by :$ \frac{1}{Total White Balls + B\_{special} }(Total Black balls)$. $B\_{special}$ which will break the chain of Black balls. Then we can say, The expected number...