qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
6,044,941
I'm trying to write a PHP script that sends a POST request to a remote server, then parses the XML response. I can do the POST request, but am having difficulty (from other SO questions) working out how to parse the XML response. My current code gives me: `Warning: simplexml_load_file() [function.simplexml-load-file]...
2011/05/18
[ "https://Stackoverflow.com/questions/6044941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693848/" ]
You have to set the cURL option to return the transfer ``` curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ```
Instead of loading a file, you want to load a string. ``` // Instead of $rxml = simplexml_load_file($response); // You want $rxml = simplexml_load_string($response); ```
6,044,941
I'm trying to write a PHP script that sends a POST request to a remote server, then parses the XML response. I can do the POST request, but am having difficulty (from other SO questions) working out how to parse the XML response. My current code gives me: `Warning: simplexml_load_file() [function.simplexml-load-file]...
2011/05/18
[ "https://Stackoverflow.com/questions/6044941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693848/" ]
use [simplexml\_load\_string](http://php.net/simplexml_load_string) instead of `simplexml_load_file`
Instead of loading a file, you want to load a string. ``` // Instead of $rxml = simplexml_load_file($response); // You want $rxml = simplexml_load_string($response); ```
29,821,446
I am trying to do an update only if the date is between two dates with the next sentence: ``` db.periodo.update( {"id_linea" : id_linea, "id_contexto" : id_contexto,$min: { "fecha_hora_inicio": fecha_desde }, $max: {"fecha_hora_inicio": fecha_hasta} }, { $set: { "id_fase": id_fase } ...
2015/04/23
[ "https://Stackoverflow.com/questions/29821446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2269200/" ]
Some major edits after my first answer. The structure of your document in the `grupo_periodo` collection is as follows: ``` { id_linea: 145, id_contexto: 151, periodo: [ { fecha_hora_inicio: new Date(2014, 10, 10), id_fase: 'f' }, { fecha_hora_inicio: new Date(2014, 9, 10), ...
``` if(collection !=null){ db.collection.update( {"id_linea" : id_linea, "id_contexto" : id_contexto , periodos: { $elemMatch: { "fecha_hora_inicio": { $lte: fecha_hasta }, fecha_hora_fin: { $gt: fecha_desde } }}} , { $set: { "periodos.$.id_fase": id_fase }}, { mul...
37,968,945
I want to know, according to WCAG 2.0, in which cases the spacebar is used to interact within the page. Is it use in the same cases as the enter key? Should I provide the same function to the enter key and the spacebar?
2016/06/22
[ "https://Stackoverflow.com/questions/37968945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5965022/" ]
As far as WCAG 2.0 it says specifically to use space bar only in 3 cases: <https://www.w3.org/TR/2009/WD-wai-aria-practices-20090224/> 1. Checks the radio button with keyboard focus (this is a special case when using tab and no radio buttons have been marked as checked (<https://www.w3.org/TR/2009/WD-wai-aria-practic...
Do not change the native behavior of controls. That can mess with users. A hyperlink can be fired by pressing the enter key. But a true button can be fired by pressing the enter key or the space bar. When a hyperlink has focus and the user presses the space bar, the page will scroll one screenful. If there isn’t more ...
28,235,162
I cannot seem to think of a way to correct the error mentioned in the title and was looking for some ideas on what should be done. I am trying to read the rows of a excel spreadsheet into an object. The first time it loops I have no problems because row 1, column 1 and row 1 column 2 have data in them. But when it g...
2015/01/30
[ "https://Stackoverflow.com/questions/28235162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1153795/" ]
Do not use `.ToString()` it will cause `null reference exception` when the value is null. Use `Convert.ToString()`, it will return empty string for the null value. ``` col1 = Convert.ToString(row.Cells[i + 1, 1].Value2); col2 = Convert.ToString(row.Cells[i + 1, 2].Value2); ```
You need them before the call to `ToString`. Maybe you can even move if before the adding, since I think it isn't useful to add empty rows, but that might nog be true in your scenario: ``` if (row.Cells[i + 1, 1].Value2 != null && row.Cells[i + 1, 2].Value2 != null) { spreadsheetrows.Add(new SPREADSHEETModel.sprea...
28,235,162
I cannot seem to think of a way to correct the error mentioned in the title and was looking for some ideas on what should be done. I am trying to read the rows of a excel spreadsheet into an object. The first time it loops I have no problems because row 1, column 1 and row 1 column 2 have data in them. But when it g...
2015/01/30
[ "https://Stackoverflow.com/questions/28235162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1153795/" ]
You need them before the call to `ToString`. Maybe you can even move if before the adding, since I think it isn't useful to add empty rows, but that might nog be true in your scenario: ``` if (row.Cells[i + 1, 1].Value2 != null && row.Cells[i + 1, 2].Value2 != null) { spreadsheetrows.Add(new SPREADSHEETModel.sprea...
You can check inside in for loop: ``` //Iterate the rows in the used range foreach (Excel.Range row in usedRange.Rows) { for (int i = 0; i < row.Columns.Count; i++) { spreadsheetrows.Add(new SPREADSHEETModel.spreadsheetRow() { if (row.Cells[i + 1, 1].Value2 !...
28,235,162
I cannot seem to think of a way to correct the error mentioned in the title and was looking for some ideas on what should be done. I am trying to read the rows of a excel spreadsheet into an object. The first time it loops I have no problems because row 1, column 1 and row 1 column 2 have data in them. But when it g...
2015/01/30
[ "https://Stackoverflow.com/questions/28235162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1153795/" ]
Do not use `.ToString()` it will cause `null reference exception` when the value is null. Use `Convert.ToString()`, it will return empty string for the null value. ``` col1 = Convert.ToString(row.Cells[i + 1, 1].Value2); col2 = Convert.ToString(row.Cells[i + 1, 2].Value2); ```
You can check inside in for loop: ``` //Iterate the rows in the used range foreach (Excel.Range row in usedRange.Rows) { for (int i = 0; i < row.Columns.Count; i++) { spreadsheetrows.Add(new SPREADSHEETModel.spreadsheetRow() { if (row.Cells[i + 1, 1].Value2 !...
65,197,321
splice function cant be written inside a console.log ?? I tried both here's what I tried - ``` const arr1 = ["a","b","c","d","e","f"]; console.log(arr1.splice(1,4,"HI")); ``` output for this code= [ 'a', 'HI', 'f' ] ``` const arr1 = ["a","b","c","d","e","f"]; arr1.splice(1,4,"HI");`enter code here` console.log(arr1...
2020/12/08
[ "https://Stackoverflow.com/questions/65197321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12080766/" ]
The command: ``` git merge foo ``` says to merge into the currently checked out branch the *local* branch called `foo`. By "local," I mean the local version of the `foo` branch on which you might have been doing your work. The command: ``` git merge origin/foo ``` says to merge into the currently checked out bra...
When you do `git merge foo`, you try to merge with your local branch, so it's already up-to-date. When you do `git merge origin/foo`, you try to merge from remote branch.
65,197,321
splice function cant be written inside a console.log ?? I tried both here's what I tried - ``` const arr1 = ["a","b","c","d","e","f"]; console.log(arr1.splice(1,4,"HI")); ``` output for this code= [ 'a', 'HI', 'f' ] ``` const arr1 = ["a","b","c","d","e","f"]; arr1.splice(1,4,"HI");`enter code here` console.log(arr1...
2020/12/08
[ "https://Stackoverflow.com/questions/65197321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12080766/" ]
When you do `git merge foo`, you try to merge with your local branch, so it's already up-to-date. When you do `git merge origin/foo`, you try to merge from remote branch.
`git merge origin/foo` will merge remote branch into your current local active branch. Usual workflow is that one merges local branches into local branches. So do the following: `git checkout foo` - it will switch to local `foo` branch; `git pull origin` - if `foo` branch tracks remote `origin/foo` branch - it will p...
65,197,321
splice function cant be written inside a console.log ?? I tried both here's what I tried - ``` const arr1 = ["a","b","c","d","e","f"]; console.log(arr1.splice(1,4,"HI")); ``` output for this code= [ 'a', 'HI', 'f' ] ``` const arr1 = ["a","b","c","d","e","f"]; arr1.splice(1,4,"HI");`enter code here` console.log(arr1...
2020/12/08
[ "https://Stackoverflow.com/questions/65197321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12080766/" ]
The command: ``` git merge foo ``` says to merge into the currently checked out branch the *local* branch called `foo`. By "local," I mean the local version of the `foo` branch on which you might have been doing your work. The command: ``` git merge origin/foo ``` says to merge into the currently checked out bra...
`git merge origin/foo` will merge remote branch into your current local active branch. Usual workflow is that one merges local branches into local branches. So do the following: `git checkout foo` - it will switch to local `foo` branch; `git pull origin` - if `foo` branch tracks remote `origin/foo` branch - it will p...
2,489,766
Can I use the MVC 2 DataAnnotations to specify a minimum length for a string field? Has anyone done this or have they created custom attributes and if so do you mind sharing the source?
2010/03/22
[ "https://Stackoverflow.com/questions/2489766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/129195/" ]
If you're using asp.net 4.0, you can use the StringLength attribute to specify a minimum length. Eg: ``` [StringLength(50, MinimumLength=1)] public string MyText { get; set; } ```
Use a regular expression attribute. These are interpreted on the client side as well. ``` [RegularExpression(Regexes.MinStringLength)] public string MyText { get; set; } ``` Where `Regexes.MinStringLength` is a static regular expression class. Inline would look like this: ``` [RegularExpression(@"^.{5,10}$")] // va...
14,056,945
I am doing a Model.load similar to this: ``` //get a reference to the User model class var User = Ext.ModelManager.getModel('User'); //Uses the configured RestProxy to make a GET request to /users/123 User.load(123, { success: function(user) { console.log(user.getId()); //logs 123 } }); ``` In the ...
2012/12/27
[ "https://Stackoverflow.com/questions/14056945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1922578/" ]
Putting a button and inside it a Hyperlink doesn't make much sense... What do you expect to happen when you click on the hyperlink? Anyways, the following code will cause your command to be called: ``` <ListView ItemsSource="{Binding Links}" x:Name="ListView1"> <ListView.ItemTemplate> <DataTempl...
It is because you are binding the command in a different data context. In the StackPanel, you are binding the command in the current data context which is probably your view model holding the command. In the ListView, you are binding the command on a different data context which is the current list item which I belie...
47,839,661
I wrote a shell script to copy current date's files and place them in target folder with current date name, target folder path contains variable. This path works fine when i manually run the cd or cp command, but in shell script, while copying through cp, directory with variable is not recognized. ``` d=`date +%b' '%d...
2017/12/15
[ "https://Stackoverflow.com/questions/47839661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9105232/" ]
A corrected version of this script may look more like the following: ``` #!/usr/bin/env bash # ^^^^- ksh93 also allowable; /bin/sh is not. d=$(date '+%b %d') || exit td=$(date '+%d%b%Y') || exit cd /filenet/shared/logs || exit mkdir -p -- "$td" || exit cd "$td" || exit mkdir...
I suggest to replace ``` $(td) ``` with ``` ${td} ```
746,079
In other words, if events a and b are time-like separated, and events b and c are time-like separated, does it follow that events a and c are time-like separated? Is there a straightforward proof of transitivity here? (Thanks a lot for the awesome explanations. I really appreciate them. Both the diagram-based explana...
2023/01/18
[ "https://physics.stackexchange.com/questions/746079", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/356083/" ]
A lot of questions in special relativity become surprisingly simple if you draw the correct diagram. Consider this: [![enter image description here](https://i.stack.imgur.com/BEMyr.png)](https://i.stack.imgur.com/BEMyr.png) All the events timelike connected to the point B lie in B's light cone i.e. in the pink triang...
No. Consider the following three events. $(c t\_a, x\_a) = (1, -0.9)$ $(c t\_b, x\_b) = (0, 0)$ $(c t\_c, x\_c) = (1, 0.9)$ Then using $$ \Delta\_{ij} = -(ct\_i - ct\_j)^2 + (x\_i-x\_j)^2 $$ We have $\Delta\_{ab}^2 = -0.19 < 0$ $\Delta\_{bc}^2 = -0.19 < 0$ $\Delta\_{ac}^2 = 3.24 > 0$ In other words, $b$ is tim...
15,445,973
I am trying to use scope in active admin for one of my model and I get this `error undefined method reorder' for array.` I have successfully used scope in another model with active admin, I am not able to debug why this issue is coming. Here is the code from active admin :- ``` ActiveAdmin.register Startup do ...
2013/03/16
[ "https://Stackoverflow.com/questions/15445973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927554/" ]
as workaround, is ping report same issue? <http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx> if you would accept workarounds, another possible solution would be searching for 3rd party library/code that resolve hostname Or invoke command line through [System.Diagnostics.Process();]. ho...
Are you running the same .Net environment on all machines, i.e. your code is compiled to the same target (x86 or x64 ) and same .Net framework 2.0 or 3.5 or 4.0
15,445,973
I am trying to use scope in active admin for one of my model and I get this `error undefined method reorder' for array.` I have successfully used scope in another model with active admin, I am not able to debug why this issue is coming. Here is the code from active admin :- ``` ActiveAdmin.register Startup do ...
2013/03/16
[ "https://Stackoverflow.com/questions/15445973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927554/" ]
as workaround, is ping report same issue? <http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx> if you would accept workarounds, another possible solution would be searching for 3rd party library/code that resolve hostname Or invoke command line through [System.Diagnostics.Process();]. ho...
Method `GetHostAddresses()` returns an array of type `IPAddress`. > > **Return Value** > > > Type: System.Net.IPAddress[] > > > An array of type IPAddress that holds the IP addresses for the host > that is specified by the hostNameOrAddress parameter. > > > Change your `var` to an IPAddress array. Here is ...
15,445,973
I am trying to use scope in active admin for one of my model and I get this `error undefined method reorder' for array.` I have successfully used scope in another model with active admin, I am not able to debug why this issue is coming. Here is the code from active admin :- ``` ActiveAdmin.register Startup do ...
2013/03/16
[ "https://Stackoverflow.com/questions/15445973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927554/" ]
as workaround, is ping report same issue? <http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx> if you would accept workarounds, another possible solution would be searching for 3rd party library/code that resolve hostname Or invoke command line through [System.Diagnostics.Process();]. ho...
You are making recursive queries. If you don't want the DNS server to cache any recursive queries create new DWORD "MaxCacheTTL" with value 0x0 at HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
15,445,973
I am trying to use scope in active admin for one of my model and I get this `error undefined method reorder' for array.` I have successfully used scope in another model with active admin, I am not able to debug why this issue is coming. Here is the code from active admin :- ``` ActiveAdmin.register Startup do ...
2013/03/16
[ "https://Stackoverflow.com/questions/15445973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927554/" ]
Method `GetHostAddresses()` returns an array of type `IPAddress`. > > **Return Value** > > > Type: System.Net.IPAddress[] > > > An array of type IPAddress that holds the IP addresses for the host > that is specified by the hostNameOrAddress parameter. > > > Change your `var` to an IPAddress array. Here is ...
Are you running the same .Net environment on all machines, i.e. your code is compiled to the same target (x86 or x64 ) and same .Net framework 2.0 or 3.5 or 4.0
15,445,973
I am trying to use scope in active admin for one of my model and I get this `error undefined method reorder' for array.` I have successfully used scope in another model with active admin, I am not able to debug why this issue is coming. Here is the code from active admin :- ``` ActiveAdmin.register Startup do ...
2013/03/16
[ "https://Stackoverflow.com/questions/15445973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927554/" ]
You are making recursive queries. If you don't want the DNS server to cache any recursive queries create new DWORD "MaxCacheTTL" with value 0x0 at HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
Are you running the same .Net environment on all machines, i.e. your code is compiled to the same target (x86 or x64 ) and same .Net framework 2.0 or 3.5 or 4.0
15,445,973
I am trying to use scope in active admin for one of my model and I get this `error undefined method reorder' for array.` I have successfully used scope in another model with active admin, I am not able to debug why this issue is coming. Here is the code from active admin :- ``` ActiveAdmin.register Startup do ...
2013/03/16
[ "https://Stackoverflow.com/questions/15445973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927554/" ]
Method `GetHostAddresses()` returns an array of type `IPAddress`. > > **Return Value** > > > Type: System.Net.IPAddress[] > > > An array of type IPAddress that holds the IP addresses for the host > that is specified by the hostNameOrAddress parameter. > > > Change your `var` to an IPAddress array. Here is ...
You are making recursive queries. If you don't want the DNS server to cache any recursive queries create new DWORD "MaxCacheTTL" with value 0x0 at HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
20,024,597
When you take a picture with the front facing camera in Android the preview is reflected along the Y axis to make the image seen appear as if the user was looking in the mirror. I want to undo this effect (apply a second reflection) or just stop the one thats done automatically. I though to use this: ``` Camera mCame...
2013/11/16
[ "https://Stackoverflow.com/questions/20024597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1461196/" ]
First when you open your camera instance with Camera.open() you should open front camera with Camera.open(getSpecialFacingCamera()) ``` private int getSpecialFacingCamera() { int cameraId = -1; // Search for the front facing camera int numberOfCameras = Camera.getNumberOfCameras(); for (int i = 0; i < ...
You can use Matrix to flip the image data, something like: ``` byte[] baImage = null; Size size = camera.getParameters().getPreviewSize(); ByteArrayOutputStream os = new ByteArrayOutputStream(); YuvImage yuv = new YuvImage(data, ImageFormat.NV21, size.width, size.height, null); yuv.compressToJpeg(new Rect(0, 0, size.w...
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
What API are you connecting to? Try adding a user-agent to the header: ``` r = requests.get(url, auth=HTTPBasicAuth(apiuser, apipass), headers={'User-Agent':'test'}) ```
If the request is empty, not even a status code I could suggest waiting some time between printing. Maybe the server is taking time to return the response to you. `import time time.sleep(5)` Not the nicest thing, but it's worth trying [How can I make a time delay in Python?](https://stackoverflow.com/questions/5103...
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
Run this and see what responses you get. ``` import requests url = "https://google.com" r = requests.get(url) print(r.status_code) print(r.json) print(r.text) ``` When you start having to pass things in your GET, PUT, DELETE, OR POST requests, you will add it in the request. ``` url = "https://google.com" heade...
If the request is empty, not even a status code I could suggest waiting some time between printing. Maybe the server is taking time to return the response to you. `import time time.sleep(5)` Not the nicest thing, but it's worth trying [How can I make a time delay in Python?](https://stackoverflow.com/questions/5103...
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
I have an empty response only when the authentication failed or is denied. The HTTP status is still ≤ 400. However, in the header you can find : ``` 'X-Seraph-LoginReason': 'AUTHENTICATED_FAILED' ``` or ``` 'X-Seraph-LoginReason': 'AUTHENTICATED_DENIED' ```
If the request is empty, not even a status code I could suggest waiting some time between printing. Maybe the server is taking time to return the response to you. `import time time.sleep(5)` Not the nicest thing, but it's worth trying [How can I make a time delay in Python?](https://stackoverflow.com/questions/5103...
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
**Although this is not an exact answer for the OP, it may solve the issue for someone having a `blank response` from `python-requests`**. I was getting a blank response because of the wrong content type. I was expecting an HTML rather than a JSON or a login success. The correct `content-type` for me was `application/x...
If the request is empty, not even a status code I could suggest waiting some time between printing. Maybe the server is taking time to return the response to you. `import time time.sleep(5)` Not the nicest thing, but it's worth trying [How can I make a time delay in Python?](https://stackoverflow.com/questions/5103...
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
What API are you connecting to? Try adding a user-agent to the header: ``` r = requests.get(url, auth=HTTPBasicAuth(apiuser, apipass), headers={'User-Agent':'test'}) ```
Run this and see what responses you get. ``` import requests url = "https://google.com" r = requests.get(url) print(r.status_code) print(r.json) print(r.text) ``` When you start having to pass things in your GET, PUT, DELETE, OR POST requests, you will add it in the request. ``` url = "https://google.com" heade...
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
What API are you connecting to? Try adding a user-agent to the header: ``` r = requests.get(url, auth=HTTPBasicAuth(apiuser, apipass), headers={'User-Agent':'test'}) ```
I have an empty response only when the authentication failed or is denied. The HTTP status is still ≤ 400. However, in the header you can find : ``` 'X-Seraph-LoginReason': 'AUTHENTICATED_FAILED' ``` or ``` 'X-Seraph-LoginReason': 'AUTHENTICATED_DENIED' ```
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
**Although this is not an exact answer for the OP, it may solve the issue for someone having a `blank response` from `python-requests`**. I was getting a blank response because of the wrong content type. I was expecting an HTML rather than a JSON or a login success. The correct `content-type` for me was `application/x...
Run this and see what responses you get. ``` import requests url = "https://google.com" r = requests.get(url) print(r.status_code) print(r.json) print(r.text) ``` When you start having to pass things in your GET, PUT, DELETE, OR POST requests, you will add it in the request. ``` url = "https://google.com" heade...
48,545,175
its my first question here and I hope I'm not stepping on anyone's tows :-) Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using ...
2018/01/31
[ "https://Stackoverflow.com/questions/48545175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9294770/" ]
**Although this is not an exact answer for the OP, it may solve the issue for someone having a `blank response` from `python-requests`**. I was getting a blank response because of the wrong content type. I was expecting an HTML rather than a JSON or a login success. The correct `content-type` for me was `application/x...
I have an empty response only when the authentication failed or is denied. The HTTP status is still ≤ 400. However, in the header you can find : ``` 'X-Seraph-LoginReason': 'AUTHENTICATED_FAILED' ``` or ``` 'X-Seraph-LoginReason': 'AUTHENTICATED_DENIED' ```
2,462,928
I need to find a hosting company that provides a LAMP stack, the P being PHP. Finding that is pretty easy, but I have a further requirement of unixODBC and FreeTDS or some equilant. The project will require a remote connection to a Microsoft SQL 2005 database. Most of the project will use a local MySQL database but...
2010/03/17
[ "https://Stackoverflow.com/questions/2462928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295715/" ]
I would say near 0 chance. The requirements are pretty unusual, so mass hosting will not fullfill them. Try going for a well priced virtual server... that gives you the option to install yourself. or go windows hosting (WAMP) - shoult not make a difference and the price may be better than the virtual hosting (plus over...
I was able to find a host that has unixODBC and freetds configured and installed with PHP in a shared host. The company is Modwest hosting.
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
No, there is nothing faster than a dictionary for this task and that’s because the complexity of its indexing (getting and setting item) and even membership checking is O(1) in average. (check the complexity of the rest of functionalities on Python doc <https://wiki.python.org/moin/TimeComplexity> ) Once you saved you...
You can think of storing them in Data structure like Trie given your key is string. Even to store and retrieve from Trie you need O(N) where N is maximum length of key. Same happen to hash calculation which computes hash for key. Hash is used to find and store in Hash Table. We often don't consider the hashing time or ...
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
No, there is nothing faster than a dictionary for this task and that’s because the complexity of its indexing (getting and setting item) and even membership checking is O(1) in average. (check the complexity of the rest of functionalities on Python doc <https://wiki.python.org/moin/TimeComplexity> ) Once you saved you...
No, I don't think there is anything faster than `dict`. The time complexity of its index checking is **`O(1)`**. ``` ------------------------------------------------------- Operation | Average Case | Amortized Worst Case | ------------------------------------------------------- Copy[2] | O(n) | ...
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
No, there is nothing faster than a dictionary for this task and that’s because the complexity of its indexing (getting and setting item) and even membership checking is O(1) in average. (check the complexity of the rest of functionalities on Python doc <https://wiki.python.org/moin/TimeComplexity> ) Once you saved you...
A numpy.array[] and simple dict = {} comparison: ```py import numpy from timeit import default_timer as timer my_array = numpy.ones([400,400]) def read_out_array_values(): cumsum = 0 for i in range(400): for j in range(400): cumsum += my_array[i,j] start = timer() read_out_array_values()...
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
No, there is nothing faster than a dictionary for this task and that’s because the complexity of its indexing (getting and setting item) and even membership checking is O(1) in average. (check the complexity of the rest of functionalities on Python doc <https://wiki.python.org/moin/TimeComplexity> ) Once you saved you...
One would think that array indexing is faster than hash lookup. So if we could store this data in a numpy array, and assume the keys are not strings, but numbers, would that be faster than a python a dictionary? Unfortunately not, because NumPy is optimized for vector operations, not for individual look up of values....
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
No, I don't think there is anything faster than `dict`. The time complexity of its index checking is **`O(1)`**. ``` ------------------------------------------------------- Operation | Average Case | Amortized Worst Case | ------------------------------------------------------- Copy[2] | O(n) | ...
You can think of storing them in Data structure like Trie given your key is string. Even to store and retrieve from Trie you need O(N) where N is maximum length of key. Same happen to hash calculation which computes hash for key. Hash is used to find and store in Hash Table. We often don't consider the hashing time or ...
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
A numpy.array[] and simple dict = {} comparison: ```py import numpy from timeit import default_timer as timer my_array = numpy.ones([400,400]) def read_out_array_values(): cumsum = 0 for i in range(400): for j in range(400): cumsum += my_array[i,j] start = timer() read_out_array_values()...
You can think of storing them in Data structure like Trie given your key is string. Even to store and retrieve from Trie you need O(N) where N is maximum length of key. Same happen to hash calculation which computes hash for key. Hash is used to find and store in Hash Table. We often don't consider the hashing time or ...
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
One would think that array indexing is faster than hash lookup. So if we could store this data in a numpy array, and assume the keys are not strings, but numbers, would that be faster than a python a dictionary? Unfortunately not, because NumPy is optimized for vector operations, not for individual look up of values....
You can think of storing them in Data structure like Trie given your key is string. Even to store and retrieve from Trie you need O(N) where N is maximum length of key. Same happen to hash calculation which computes hash for key. Hash is used to find and store in Hash Table. We often don't consider the hashing time or ...
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
No, I don't think there is anything faster than `dict`. The time complexity of its index checking is **`O(1)`**. ``` ------------------------------------------------------- Operation | Average Case | Amortized Worst Case | ------------------------------------------------------- Copy[2] | O(n) | ...
One would think that array indexing is faster than hash lookup. So if we could store this data in a numpy array, and assume the keys are not strings, but numbers, would that be faster than a python a dictionary? Unfortunately not, because NumPy is optimized for vector operations, not for individual look up of values....
40,694,470
I need a faster way to store and access around 3GB of `k:v` pairs. Where `k` is a string or an integer and `v` is an `np.array()` that can be of different shapes. Is there any object that is faster than the standard python dict in storing and accessing such a table? For example, a `pandas.DataFrame`? As far I have un...
2016/11/19
[ "https://Stackoverflow.com/questions/40694470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3190076/" ]
A numpy.array[] and simple dict = {} comparison: ```py import numpy from timeit import default_timer as timer my_array = numpy.ones([400,400]) def read_out_array_values(): cumsum = 0 for i in range(400): for j in range(400): cumsum += my_array[i,j] start = timer() read_out_array_values()...
One would think that array indexing is faster than hash lookup. So if we could store this data in a numpy array, and assume the keys are not strings, but numbers, would that be faster than a python a dictionary? Unfortunately not, because NumPy is optimized for vector operations, not for individual look up of values....
10,055,313
My question is: How can I get the locationManager coordinates to my viewDidLoad method to load my mapview with my previously checked position??? My locationManager lookin' like this (Strings for UIlabel): ``` - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocati...
2012/04/07
[ "https://Stackoverflow.com/questions/10055313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1228695/" ]
Make `CLLocationCoordinate2D loc` a property of whatever object your `didUpdateToLocation:` method is in. If it's the same object as the `viewDidLoad` code, then just use it directly. If it's in some other class, make a reference to that class available in your view controller and get the property that way.
Create a `CLLocationCoordinate2D` property and assign value to it.
1,479,958
We're writing an open source tool that is designed to work against multiple database products (really, it's designed to work with any database that has a JDBC driver available). However, because it does DDL (not DML), we need to test against different products. While MySQL, PostgreSQL and other open source db's are ea...
2009/09/25
[ "https://Stackoverflow.com/questions/1479958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61592/" ]
I don't know of such a service but it may well be worthwhile contacting some of commercial vendors as it is often in their interests to have interoperability with open source libraries. The other way to approach it would be to find a company that would like to use your tool with one of the commercial db's (because they...
You may want to use an ORM, such as Hibernate, or some other open-source ORM, as those will be tested on different databases, and you can then develop knowing that all you have to do is unit test the DAO, but not be so concerned about the different databases.
6,982,981
I Am trying to create eclipse projects programmatically for my plugin. I used this code to create the projects: ``` IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IProject project = workspaceRoot.getProject(projectName); project.create(null); project.open(null); IProjectDescr...
2011/08/08
[ "https://Stackoverflow.com/questions/6982981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884182/" ]
``` entries.add(JavaRuntime.getDefaultJREContainerEntry()); ```
``` IClasspathEntry[] jreClasspaths=org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary(); IClasspathEntry[] oldClasspathEntries=null; try{ oldClasspathEntries=javaProject.getRawClasspath(); }catch(JavaModelException e){ e.printStackTrace(); }...
6,982,981
I Am trying to create eclipse projects programmatically for my plugin. I used this code to create the projects: ``` IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IProject project = workspaceRoot.getProject(projectName); project.create(null); project.open(null); IProjectDescr...
2011/08/08
[ "https://Stackoverflow.com/questions/6982981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884182/" ]
PreferenceConstants.getDefaultJRELibrary(); The default JRE of an Eclipse is stored in the preferences, so the call above should provide you with the Java Runtime Environment Library. From a more extensive source with great info on creating a Project programmatically: <http://www.pushing-pixels.org/2008/11/18/extend...
``` IClasspathEntry[] jreClasspaths=org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary(); IClasspathEntry[] oldClasspathEntries=null; try{ oldClasspathEntries=javaProject.getRawClasspath(); }catch(JavaModelException e){ e.printStackTrace(); }...
6,982,981
I Am trying to create eclipse projects programmatically for my plugin. I used this code to create the projects: ``` IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IProject project = workspaceRoot.getProject(projectName); project.create(null); project.open(null); IProjectDescr...
2011/08/08
[ "https://Stackoverflow.com/questions/6982981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884182/" ]
Works for me. ``` IPath containerPath = new Path(JavaRuntime.JRE_CONTAINER); IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall(); IPath vmPath = containerPath .append(vmInstall.getVMInstallType().getId()) .append(vmInstall.getName()); IClasspathEntry jreEntry = JavaCore.newContainerEntry(vmP...
``` IClasspathEntry[] jreClasspaths=org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary(); IClasspathEntry[] oldClasspathEntries=null; try{ oldClasspathEntries=javaProject.getRawClasspath(); }catch(JavaModelException e){ e.printStackTrace(); }...
269,670
They are both adjectives related to feudalism. But what is the difference between the two in actual usage.
2015/08/28
[ "https://english.stackexchange.com/questions/269670", "https://english.stackexchange.com", "https://english.stackexchange.com/users/130844/" ]
[Feudal](http://www.oxforddictionaries.com/us/definition/american_english/feudal) also means, "Absurdly outdated or old-fashioned" while feudalistic refers exclusively to a feudal system of lords and serfdom
I'm going to try to explain the difference. *Feudal* refers to some well-known feudal system from historic times. *Feudalistic* would describe something else, which the author feels is similar to an established historic instance of feudalism. If you feel that a social system *amounts to* feudalism, then you could sa...
53,529,788
The following is the div in which my text is located, currently I cant make it come down from the top of the div. ``` <div class="caption"> <h1>About me</h1> <p>Lorem Ipsum In minim laboris dolor non incididunt nostrud amet dolor adipisicing consequat ut ex veniam cillum enim sint ut elit.</p> </div> .caption...
2018/11/28
[ "https://Stackoverflow.com/questions/53529788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10719777/" ]
I found what seems to be a good solution: ``` function update(data) { const s = myChart.series; for (let i = 0; i < s.length; i++) { console.log(i); s[i].setData(data[s[i].name], false); // add "redraw=false" argument } myChart.redraw(); // trigger redraw at end of loop } ``` Adding `false` to the `...
You can just do it like this: ```js const receivedData = { 'item1': [1, 2, 3], 'item2': [1, 2, 3], 'item3': [1, 2, 3] }; const update = data => Object.keys(data).map(key => ({ name: key, data: data[key] })); console.log(update(receivedData)); ```
15,758,413
I am using Liferay for developing my application and want to use freemarker to develop template. I was just testing freemarker. When I deploy my application, it says that Template cannot be found. I know that template file should be in the src folder. So I have created helloworld.ftl in docroot.WEB-INF/src folder and ...
2013/04/02
[ "https://Stackoverflow.com/questions/15758413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2114248/" ]
I have created a Java-based test server, implemented as a maven plugin, for the GCMUtils project: <https://code.google.com/p/gcmutils/wiki/MavenPlugin#Test_server> Here is the source code: <https://github.com/jarlehansen/gcmutils/tree/master/gcm-test-server> Source for the maven plugin: <https://github.com/jarlehanse...
> > Follow this URL > <https://firebase.google.com/docs/cloud-messaging/send-message> > > > **FCM URL** ``` private String ANDROID_NOTIFICATION_URL = "https://fcm.googleapis.com/fcm/send" ``` **Notification Key** ``` private String ANDROID_NOTIFICATION_KEY = "Your key"; ``` **Java Code** ``` private void s...
15,758,413
I am using Liferay for developing my application and want to use freemarker to develop template. I was just testing freemarker. When I deploy my application, it says that Template cannot be found. I know that template file should be in the src folder. So I have created helloworld.ftl in docroot.WEB-INF/src folder and ...
2013/04/02
[ "https://Stackoverflow.com/questions/15758413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2114248/" ]
I have created a Java-based test server, implemented as a maven plugin, for the GCMUtils project: <https://code.google.com/p/gcmutils/wiki/MavenPlugin#Test_server> Here is the source code: <https://github.com/jarlehansen/gcmutils/tree/master/gcm-test-server> Source for the maven plugin: <https://github.com/jarlehanse...
This is a function using to send notification from java to the app android. this code use JSONObject you must add this jar into project buildpath. note:I use fcm ``` import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import org.json.JSONObject; public class FcmNotif { pu...
15,758,413
I am using Liferay for developing my application and want to use freemarker to develop template. I was just testing freemarker. When I deploy my application, it says that Template cannot be found. I know that template file should be in the src folder. So I have created helloworld.ftl in docroot.WEB-INF/src folder and ...
2013/04/02
[ "https://Stackoverflow.com/questions/15758413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2114248/" ]
I have created a Java-based test server, implemented as a maven plugin, for the GCMUtils project: <https://code.google.com/p/gcmutils/wiki/MavenPlugin#Test_server> Here is the source code: <https://github.com/jarlehansen/gcmutils/tree/master/gcm-test-server> Source for the maven plugin: <https://github.com/jarlehanse...
1. package com.test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; public class Firebase { ``` public static void main(String[] args) throws IOException { final ``` String api...
15,758,413
I am using Liferay for developing my application and want to use freemarker to develop template. I was just testing freemarker. When I deploy my application, it says that Template cannot be found. I know that template file should be in the src folder. So I have created helloworld.ftl in docroot.WEB-INF/src folder and ...
2013/04/02
[ "https://Stackoverflow.com/questions/15758413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2114248/" ]
This is a function using to send notification from java to the app android. this code use JSONObject you must add this jar into project buildpath. note:I use fcm ``` import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import org.json.JSONObject; public class FcmNotif { pu...
> > Follow this URL > <https://firebase.google.com/docs/cloud-messaging/send-message> > > > **FCM URL** ``` private String ANDROID_NOTIFICATION_URL = "https://fcm.googleapis.com/fcm/send" ``` **Notification Key** ``` private String ANDROID_NOTIFICATION_KEY = "Your key"; ``` **Java Code** ``` private void s...
15,758,413
I am using Liferay for developing my application and want to use freemarker to develop template. I was just testing freemarker. When I deploy my application, it says that Template cannot be found. I know that template file should be in the src folder. So I have created helloworld.ftl in docroot.WEB-INF/src folder and ...
2013/04/02
[ "https://Stackoverflow.com/questions/15758413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2114248/" ]
This is a function using to send notification from java to the app android. this code use JSONObject you must add this jar into project buildpath. note:I use fcm ``` import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import org.json.JSONObject; public class FcmNotif { pu...
1. package com.test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; public class Firebase { ``` public static void main(String[] args) throws IOException { final ``` String api...
24,853,027
I have installed Django 1.6.5 with PIP and Python 2.7.8 from the website. I ran `django-admin.py startproject test123`, switched to `test123` directory, and ran the command `python manage.py runserver`, then i get this: ``` Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_...
2014/07/20
[ "https://Stackoverflow.com/questions/24853027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/637619/" ]
Followed this SO answer: [Uninstall python.org version of python2.7 in favor of default OS X python2.7](https://stackoverflow.com/questions/13538586/uninstall-python-org-version-of-python2-7-in-favor-of-default-os-x-python2-7) Then changed my `.bash_profile` Python path to `/usr/lib/python` for the default OSX python...
You most likely have another file named `operator.py` on your `PYTHONPATH` (probably in the current working directory), which shadows the standard library `operator` module.. Remove or rename the file.
24,853,027
I have installed Django 1.6.5 with PIP and Python 2.7.8 from the website. I ran `django-admin.py startproject test123`, switched to `test123` directory, and ran the command `python manage.py runserver`, then i get this: ``` Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_...
2014/07/20
[ "https://Stackoverflow.com/questions/24853027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/637619/" ]
I get this error with anaconda as my default python and django1.7 while trying to use startproject. I deleted the venv and recreated it with ``` virtualenv -p /usr/bin/python2.7 venv ``` startproject was working again.
You most likely have another file named `operator.py` on your `PYTHONPATH` (probably in the current working directory), which shadows the standard library `operator` module.. Remove or rename the file.
24,853,027
I have installed Django 1.6.5 with PIP and Python 2.7.8 from the website. I ran `django-admin.py startproject test123`, switched to `test123` directory, and ran the command `python manage.py runserver`, then i get this: ``` Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_...
2014/07/20
[ "https://Stackoverflow.com/questions/24853027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/637619/" ]
Followed this SO answer: [Uninstall python.org version of python2.7 in favor of default OS X python2.7](https://stackoverflow.com/questions/13538586/uninstall-python-org-version-of-python2-7-in-favor-of-default-os-x-python2-7) Then changed my `.bash_profile` Python path to `/usr/lib/python` for the default OSX python...
For those not wanting to switch to Apple's python, simply [deleting the virtualenv and rebuilding it](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749491#10) worked fine for me. Tip: Don't forget to `pip freeze > requirements.txt` first if you aren't already tracking your package requirements. That way you can `...
24,853,027
I have installed Django 1.6.5 with PIP and Python 2.7.8 from the website. I ran `django-admin.py startproject test123`, switched to `test123` directory, and ran the command `python manage.py runserver`, then i get this: ``` Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_...
2014/07/20
[ "https://Stackoverflow.com/questions/24853027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/637619/" ]
Followed this SO answer: [Uninstall python.org version of python2.7 in favor of default OS X python2.7](https://stackoverflow.com/questions/13538586/uninstall-python-org-version-of-python2-7-in-favor-of-default-os-x-python2-7) Then changed my `.bash_profile` Python path to `/usr/lib/python` for the default OSX python...
I get this error with anaconda as my default python and django1.7 while trying to use startproject. I deleted the venv and recreated it with ``` virtualenv -p /usr/bin/python2.7 venv ``` startproject was working again.
24,853,027
I have installed Django 1.6.5 with PIP and Python 2.7.8 from the website. I ran `django-admin.py startproject test123`, switched to `test123` directory, and ran the command `python manage.py runserver`, then i get this: ``` Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_...
2014/07/20
[ "https://Stackoverflow.com/questions/24853027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/637619/" ]
I get this error with anaconda as my default python and django1.7 while trying to use startproject. I deleted the venv and recreated it with ``` virtualenv -p /usr/bin/python2.7 venv ``` startproject was working again.
For those not wanting to switch to Apple's python, simply [deleting the virtualenv and rebuilding it](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749491#10) worked fine for me. Tip: Don't forget to `pip freeze > requirements.txt` first if you aren't already tracking your package requirements. That way you can `...
13,916,082
I have the following code that pulls a pdf document from a remote viewer to view: ``` package com.example.techvault; import java.io.File; import java.io.IOException; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; im...
2012/12/17
[ "https://Stackoverflow.com/questions/13916082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174496/" ]
It looks like you can use an aggregate function with a case statement to transform the data ``` SELECT t1.ID, t1.post_content AS product, max(case when meta_key = '_price' then t2.meta_value end) AS price, max(case when meta_key = '_sell' then t2.meta_value end) AS sell FROM wp_posts AS t1 INNER JOIN wp_po...
``` SELECT t1.ID, t1.post_content AS product, max(case when t2.meta_key='_price' then t2.meta_value end) AS price, max(case when t2.meta_key='_sell' then t2.meta_value end) AS sell FROM wp_posts AS t1 INNER JOIN wp_postmeta AS t2 ON ( t1.id = t2.post_id ) WHERE t1.post_type = 'product' GROUP BY t1.ID, t1....
13,916,082
I have the following code that pulls a pdf document from a remote viewer to view: ``` package com.example.techvault; import java.io.File; import java.io.IOException; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; im...
2012/12/17
[ "https://Stackoverflow.com/questions/13916082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174496/" ]
It looks like you can use an aggregate function with a case statement to transform the data ``` SELECT t1.ID, t1.post_content AS product, max(case when meta_key = '_price' then t2.meta_value end) AS price, max(case when meta_key = '_sell' then t2.meta_value end) AS sell FROM wp_posts AS t1 INNER JOIN wp_po...
Hope this helps you, ``` SELECT t1.ID, t1.post_content AS product,max(t2.meta_value) as price,min(t2.meta_value) as sell FROM wp_posts AS t1 INNER JOIN wp_postmeta AS t2 ON ( t1.id = t2.post_id ) WHERE t1.post_type = 'product' LIMIT 0 , 30 ```
13,916,082
I have the following code that pulls a pdf document from a remote viewer to view: ``` package com.example.techvault; import java.io.File; import java.io.IOException; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; im...
2012/12/17
[ "https://Stackoverflow.com/questions/13916082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174496/" ]
``` SELECT t1.ID, t1.post_content AS product, max(case when t2.meta_key='_price' then t2.meta_value end) AS price, max(case when t2.meta_key='_sell' then t2.meta_value end) AS sell FROM wp_posts AS t1 INNER JOIN wp_postmeta AS t2 ON ( t1.id = t2.post_id ) WHERE t1.post_type = 'product' GROUP BY t1.ID, t1....
Hope this helps you, ``` SELECT t1.ID, t1.post_content AS product,max(t2.meta_value) as price,min(t2.meta_value) as sell FROM wp_posts AS t1 INNER JOIN wp_postmeta AS t2 ON ( t1.id = t2.post_id ) WHERE t1.post_type = 'product' LIMIT 0 , 30 ```
434,435
Currently I have a logon.bat script that runs when users logon to a computer with their domain account. The problem is only users with the logon script specified in their profile (user's properties -> Profile -> Logon script) actually run the script. Needless to say, I forget to specify the logon and newly created user...
2012/06/08
[ "https://superuser.com/questions/434435", "https://superuser.com", "https://superuser.com/users/138991/" ]
It would probably be better to set it through group policy as a logon script in the user section of the GPO. You can set it at the domain level so everyone within the domain no matter what gets it.
For future use: Create one (or more) users in AD and fill in their generic values. Then copy that user when you create a new account. This will save you a lot of work if you need to create new accounts and makes it harder to forgot fields. As for the question: You can select multiple users in AD and add the login scri...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
I've been using Aqua Emacs off and on for a while over the standard Emacs. The things I liked were just slightly better system integration... it could be that an official Cocoa build of Emacs could provide enough standard system UI integration that it would make a good default choice. It may be worth trying the nightl...
For the subset of emacs that I use, there's very little difference between using Aquamacs and GNU emacs on a linux box. That's general text editing, lisp interaction, buffer commands, new frames, rectangular selection areas, standard emacs editing keybindings, &c. I edit my .emacs file to customize the configuration, a...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
I'm using Carbon Emacs myself and I'm moving to Cocoa port of GNU Emacs when it's released. I think that there isn't a big difference between them. I can think of some though: * "Cocoa" Emacs is "real" GNU Emacs instead of a fork like Carbon Emacs, so if you want to stay up to date and use the latest version, Cocoa ve...
* Carbon Emacs is emacs * Cocoa Emacs is emacs * X11 Emacs is emacs * emacs -nw (ie: command line only emacs) is also emacs * Even Xemacs is close enough to emacs for a beginner that you wouldn't notice the difference beyond the GUI :D I have only used the Carbon Emacs on the mac (\*), but I can not imagine there is a...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
I've been using Aqua Emacs off and on for a while over the standard Emacs. The things I liked were just slightly better system integration... it could be that an official Cocoa build of Emacs could provide enough standard system UI integration that it would make a good default choice. It may be worth trying the nightl...
* Carbon Emacs is emacs * Cocoa Emacs is emacs * X11 Emacs is emacs * emacs -nw (ie: command line only emacs) is also emacs * Even Xemacs is close enough to emacs for a beginner that you wouldn't notice the difference beyond the GUI :D I have only used the Carbon Emacs on the mac (\*), but I can not imagine there is a...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
As a long-time emacs user, I would recommand against "exotic" versions of emacs (aquamacs falls in this catagory, but this "starter kit" thing as well, and let me try to explain why), just for the sake of finger-training and brain-training also. My argument is that **you want to learn emacs once and for all**, regard...
* Carbon Emacs is emacs * Cocoa Emacs is emacs * X11 Emacs is emacs * emacs -nw (ie: command line only emacs) is also emacs * Even Xemacs is close enough to emacs for a beginner that you wouldn't notice the difference beyond the GUI :D I have only used the Carbon Emacs on the mac (\*), but I can not imagine there is a...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
I've been building Emacs 23 from source and using it with emacs-starter-kit for a while now, and I'm definitely finding it to be a good compromise. There's sane Mac Cmd shortcuts built into Emacs 23, and emacs-starter-kit makes it easy to customise them on a per os/machine/user basis. I'd advise against the idea that...
For the subset of emacs that I use, there's very little difference between using Aquamacs and GNU emacs on a linux box. That's general text editing, lisp interaction, buffer commands, new frames, rectangular selection areas, standard emacs editing keybindings, &c. I edit my .emacs file to customize the configuration, a...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
As a long-time emacs user, I would recommand against "exotic" versions of emacs (aquamacs falls in this catagory, but this "starter kit" thing as well, and let me try to explain why), just for the sake of finger-training and brain-training also. My argument is that **you want to learn emacs once and for all**, regard...
I've been using Aqua Emacs off and on for a while over the standard Emacs. The things I liked were just slightly better system integration... it could be that an official Cocoa build of Emacs could provide enough standard system UI integration that it would make a good default choice. It may be worth trying the nightl...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
As a long-time emacs user, I would recommand against "exotic" versions of emacs (aquamacs falls in this catagory, but this "starter kit" thing as well, and let me try to explain why), just for the sake of finger-training and brain-training also. My argument is that **you want to learn emacs once and for all**, regard...
I'm using Carbon Emacs myself and I'm moving to Cocoa port of GNU Emacs when it's released. I think that there isn't a big difference between them. I can think of some though: * "Cocoa" Emacs is "real" GNU Emacs instead of a fork like Carbon Emacs, so if you want to stay up to date and use the latest version, Cocoa ve...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
As a long-time emacs user, I would recommand against "exotic" versions of emacs (aquamacs falls in this catagory, but this "starter kit" thing as well, and let me try to explain why), just for the sake of finger-training and brain-training also. My argument is that **you want to learn emacs once and for all**, regard...
I've been building Emacs 23 from source and using it with emacs-starter-kit for a while now, and I'm definitely finding it to be a good compromise. There's sane Mac Cmd shortcuts built into Emacs 23, and emacs-starter-kit makes it easy to customise them on a per os/machine/user basis. I'd advise against the idea that...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
* Carbon Emacs is emacs * Cocoa Emacs is emacs * X11 Emacs is emacs * emacs -nw (ie: command line only emacs) is also emacs * Even Xemacs is close enough to emacs for a beginner that you wouldn't notice the difference beyond the GUI :D I have only used the Carbon Emacs on the mac (\*), but I can not imagine there is a...
For the subset of emacs that I use, there's very little difference between using Aquamacs and GNU emacs on a linux box. That's general text editing, lisp interaction, buffer commands, new frames, rectangular selection areas, standard emacs editing keybindings, &c. I edit my .emacs file to customize the configuration, a...
1,096,009
There seem to be a few camps when it comes to Emacs on OSX; Carbon versus Aqua Emacs. It seems the argument is that Aqua is a bit too far from standard Emacs and if you get too comfortable then you will have trouble using any other build of Emacs. As a developer who has been trying to get into Emacs for a few months n...
2009/07/08
[ "https://Stackoverflow.com/questions/1096009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23909/" ]
I'm using Carbon Emacs myself and I'm moving to Cocoa port of GNU Emacs when it's released. I think that there isn't a big difference between them. I can think of some though: * "Cocoa" Emacs is "real" GNU Emacs instead of a fork like Carbon Emacs, so if you want to stay up to date and use the latest version, Cocoa ve...
For the subset of emacs that I use, there's very little difference between using Aquamacs and GNU emacs on a linux box. That's general text editing, lisp interaction, buffer commands, new frames, rectangular selection areas, standard emacs editing keybindings, &c. I edit my .emacs file to customize the configuration, a...
2,571,098
Show that the following integral is convergent $ \int\_{0}^{∞} \log (1+2\operatorname{sech} x) dx $ I tried by replacing $\operatorname{sech}x$ with $ 2/ e^x + e^{-x} $ and then by using limit comparison test with $ g(x) = 1/x^2 $ But couldn't solve further.
2017/12/17
[ "https://math.stackexchange.com/questions/2571098", "https://math.stackexchange.com", "https://math.stackexchange.com/users/460401/" ]
$$ 0\leq\int\_{0}^{+\infty}\log\left(1+2\operatorname{sech}x\right)\,dx \leq 2\int\_{0}^{+\infty}\operatorname{sech}(x)\,dx =\pi $$ since $0\leq \log(1+z)\leq z$ for any $z\geq 0$. Actually $$ \int\_{0}^{+\infty}\log\left(1+2\operatorname{sech}x\right)\,dx =\frac{\pi^2+4\operatorname{arccosh}(2)^2}{8}\approx 2.1008896...
Quite simple with *equivalents*: the positive function $$\operatorname{sech}x\sim\_{+\infty}\frac 2{\mathrm{e}^x}$$ and the integral $\;\displaystyle\int\_0^{+\infty}\frac 2{\mathrm{e}^x}\,\mathrm d x$ is convergent.
37,494,360
I'm not sure I understand the difference between (quotes around function name): ``` Template.year.helpers({ 'QueryHeader': function() { return Session.get('keyQueryHeader') + ' Attendees'; } }); ``` and: ``` Template.year.helpers({ QueryHeader: function() { return Session.get('keyQueryHeader') + ' Att...
2016/05/28
[ "https://Stackoverflow.com/questions/37494360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2685995/" ]
The [Chrome Developer Tools](https://developer.chrome.com/devtools) timeline is a great way to test these kinds of questions, especially since "as horrible as I think it is" is fairly subjective. I ran a test of the code you posted in this [fiddle](https://jsfiddle.net/pmam1L2f/). Call this **Test 1**. * *Note that I...
For the code you show, No, it's not
26,443,490
After updating my SDK to all the latest Android 5.0 goodies I can't use progress bars built into the ActionBar in appcompat. I have done all the usual fixed (move supportRequestWindowFeature() call to before setContent() and before super call in oncreate) but nothing works. Here is what I'm doing: ``` public class Log...
2014/10/18
[ "https://Stackoverflow.com/questions/26443490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922339/" ]
A possible workaround for this would be to manually add a ProgressBar as a custom view and override **setSupportProgressBarIndeterminateVisibility** In onCreate: ``` ProgressBar progressBar = new ProgressBar(this); progressBar.setVisibility(View.GONE); progressBar.setIndeterminate(true); getSupportActionBar().setDisp...
**EDIT:** The below is does not work because `ProgressBarCompat` is a hidden class and cannot be added to your XML layout. It feels like a bug in the appcompat library. --- It is looking for a progress bar in `ActionBarActivityDelegateBase.java`: ``` private ProgressBarCompat getCircularProgressBar() { ProgressB...
26,443,490
After updating my SDK to all the latest Android 5.0 goodies I can't use progress bars built into the ActionBar in appcompat. I have done all the usual fixed (move supportRequestWindowFeature() call to before setContent() and before super call in oncreate) but nothing works. Here is what I'm doing: ``` public class Log...
2014/10/18
[ "https://Stackoverflow.com/questions/26443490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922339/" ]
A possible workaround for this would be to manually add a ProgressBar as a custom view and override **setSupportProgressBarIndeterminateVisibility** In onCreate: ``` ProgressBar progressBar = new ProgressBar(this); progressBar.setVisibility(View.GONE); progressBar.setIndeterminate(true); getSupportActionBar().setDisp...
It looks like indeterminate progress and horizontal progress bar are not supported in support library V21. From the android.support.v7.internal.widget.ToolbarWidgetWrapper: ``` @Override public void initIndeterminateProgress() { Log.i(TAG, "Progress display unsupported"); } ``` Chris Banes has confirmed this: <h...
26,443,490
After updating my SDK to all the latest Android 5.0 goodies I can't use progress bars built into the ActionBar in appcompat. I have done all the usual fixed (move supportRequestWindowFeature() call to before setContent() and before super call in oncreate) but nothing works. Here is what I'm doing: ``` public class Log...
2014/10/18
[ "https://Stackoverflow.com/questions/26443490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922339/" ]
A possible workaround for this would be to manually add a ProgressBar as a custom view and override **setSupportProgressBarIndeterminateVisibility** In onCreate: ``` ProgressBar progressBar = new ProgressBar(this); progressBar.setVisibility(View.GONE); progressBar.setIndeterminate(true); getSupportActionBar().setDisp...
For anyone else doing an upgrade of their app/libraries - they have dropped support for the progressbar in appsupport v7 library. <https://code.google.com/p/android/issues/detail?id=78310>
45,937,802
I have table Player and table Statistic and other tables that are not important in this question. Table Player has PK Player\_ID and it is FK in table Statistic. The relationship between these tables is one-to-many (one player can have more statistics). Here is the code: GenericRepository(I have created it to have uni...
2017/08/29
[ "https://Stackoverflow.com/questions/45937802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7479651/" ]
Try adding ``` <dependency> <groupId>org.eclipse.jdt.core.compiler</groupId> <artifactId>ecj</artifactId> <version>4.6.1</version> <scope>provided</scope> </dependency> ``` to maven pom.xml. Look at: <https://www.mkyong.com/spring-boot/spring-boot-web-jsp-no-java-compiler-available/>
Add the following dependency and save. You may need to restart the application. ``` <dependency> <groupId>org.eclipse.jdt.core.compiler</groupId> <artifactId>ecj</artifactId> <version>4.6.1</version> <scope>provided</scope> </dependency> ```
65,483,645
I need to replace in string `foo bar foo bar bar foo` all `foo` to `bar` and all `bar` to `foo`. So the result should look like `bar foo bar foo foo bar`. I have tried this way: ``` library(stringr) my_str <- "foo bar foo bar bar foo" rslt <- str_replace_all(my_str, c("foo", "bar"), c("bar", "foo")) print(rslt) ``...
2020/12/28
[ "https://Stackoverflow.com/questions/65483645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1601703/" ]
An option is to `split` and replace ``` str_c(setNames(v1, rpl)[str_split(my_str, "\\s+")[[1]]], collapse = ' ') #[1] "bar foo bar foo foo bar" ``` --- Or another option is `gsubfn` ``` library(gsubfn) gsubfn("(\\w+)", setNames(as.list(v1), rpl), my_str) #[1] "bar foo bar foo foo bar" ```
No real reason to do this unless you're unable to install extra packages, but just for fun here's a base R solution (following the "tmp" replacement method in @manotheshark's answer): ``` Reduce( function(prev, x) gsub(x[1], x[2], prev), list(c('foo', 'tmp'), c('bar', 'foo'), c('tmp', 'bar')), my_str) # [1] "bar...
65,483,645
I need to replace in string `foo bar foo bar bar foo` all `foo` to `bar` and all `bar` to `foo`. So the result should look like `bar foo bar foo foo bar`. I have tried this way: ``` library(stringr) my_str <- "foo bar foo bar bar foo" rslt <- str_replace_all(my_str, c("foo", "bar"), c("bar", "foo")) print(rslt) ``...
2020/12/28
[ "https://Stackoverflow.com/questions/65483645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1601703/" ]
Using `str_replace_all` multiple replacements and moving the first match to a temporary value. ``` library(stringr) str_replace_all(my_str, c("foo" = "tmp", "bar" = "foo", "tmp" = "bar")) [1] "bar foo bar foo foo bar" ```
No real reason to do this unless you're unable to install extra packages, but just for fun here's a base R solution (following the "tmp" replacement method in @manotheshark's answer): ``` Reduce( function(prev, x) gsub(x[1], x[2], prev), list(c('foo', 'tmp'), c('bar', 'foo'), c('tmp', 'bar')), my_str) # [1] "bar...
945,288
I know the following are true. 1) There is an inverse of a 2) There is an identity element (e\*a) = a In this case, e = 1 and the inverse of a is 1/|2|. However, if a is the only element in G and a is |2|, wouldn't that imply that x can only be x=|2|, for x ∈ G? I'm not quite sure how to begin the proof either, I'm ...
2014/09/25
[ "https://math.stackexchange.com/questions/945288", "https://math.stackexchange.com", "https://math.stackexchange.com/users/178641/" ]
Hint: what is the order of conjugate of a in G?
Conjugate also has same order as of a. Thus $xax^{-1}=a$, for all $x$ belongs to $G$ ,this implies $xa=ax$.
157,125
[![bulb](https://i.stack.imgur.com/zkGvH.jpg)](https://i.stack.imgur.com/zkGvH.jpg) I have a screw thread lightbulb where the thread is 11.5 mm across - would that be likely to be E11 or E12? Or something else? Thanks.
2019/02/09
[ "https://diy.stackexchange.com/questions/157125", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/54674/" ]
Epilogue: I ended up replacing a one foot section of the drain pipe below the T with a clear piece of PVC pipe. I drilled a hole in the PVC pipe and covered it with a sliding rubber coupling. I can now run a snake up the drain pipe to the T area without removing the drain pipe. I also tried a water jet, but it was diff...
Heavy duty professional drain snakes have a variety of attachments available for clearing all kinds of clogs but those are more of a pro tool than DIY. I would attach one of the inexpensive plastic barbed clog removers to a snake and very carefully run it up the diagonal to the tee. [![Cobra Drain Cleaner](https://...
157,125
[![bulb](https://i.stack.imgur.com/zkGvH.jpg)](https://i.stack.imgur.com/zkGvH.jpg) I have a screw thread lightbulb where the thread is 11.5 mm across - would that be likely to be E11 or E12? Or something else? Thanks.
2019/02/09
[ "https://diy.stackexchange.com/questions/157125", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/54674/" ]
Epilogue: I ended up replacing a one foot section of the drain pipe below the T with a clear piece of PVC pipe. I drilled a hole in the PVC pipe and covered it with a sliding rubber coupling. I can now run a snake up the drain pipe to the T area without removing the drain pipe. I also tried a water jet, but it was diff...
If there's a way to securely plug two of the three sinks, then you might find a toilet plunger in the third sink would help clear the clog. Or, you could use one of those expanding drain cleaner bladders.
4,285,075
I met with such question about **msgget** recently. ``` while(1) { msqid = msgget(IPC_PRIVATE,IPC_CREAT); if(msqid<0) break; printf("msqid=%d\n",msqid); } ``` Soonly, it consumes all the msqid in the kernel. Because the msgget is kernel-persistant, next time, the process run and quit with ...
2010/11/26
[ "https://Stackoverflow.com/questions/4285075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316224/" ]
All of the SysV IPC interfaces (shared memory, semaphores, etc.) have this same problem, among many other problems, the worst of which is atrocious performance due to bad design where every operation requires a call into kernelspace. If you can, abandon these interfaces and use the equivalent POSIX replacements (`mq_*`...
Use top and strace to find the process that keeps creating message queues and kill that process. (this assumes linux; other unixes have equivalent tools)
66,161,789
I have the following matrix `A = matrix(c(10,20,30,40,50,0,60,0,0),3,3,byrow=TRUE)` My goal is with the use of a generic function to take the Left Upper Triangular, i.e. the result should be `res = c(10,20,30,40,50,60)`
2021/02/11
[ "https://Stackoverflow.com/questions/66161789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7764533/" ]
An option is ``` a1 <- t(apply(A, 1, rev)) a1[upper.tri(a1, diag = TRUE)] ``` --- Or if the intention is to get rid of 0s ``` as.vector(na.omit(c(t(replace(A, A == 0, NA))))) #[1] 10 20 30 40 50 60 ```
A detour using the data frame format could look as follows. ``` library(dplyr) library(stringr) A %>% as_tibble() %>% stack() %>% group_by(ind) %>% slice(1:(n()+1-as.integer(str_sub(ind, -1)))) %>% pull(values) # [1] 10 40 60 20 50 30 ```
46,976,200
I am working with specific program. It has "main window" (a.k.a. "form") where another extensions(protected dll, without access to their source code) can add some objects (texts, labels and etc..) in that window. How can I access all the objects which is added on that "form" ? here i example of typical extension: ``...
2017/10/27
[ "https://Stackoverflow.com/questions/46976200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2377343/" ]
Adding some objects on a form using a dll requires that the form itself be referenced as an accessible member using something [like:](https://stackoverflow.com/a/1088363/3408531) ``` Assembly assembly = Assembly.LoadFile("C:\\test.dll"); Type type = assembly.GetType("test.dllTest"); Form form = (Form)Activator.Create...
You can try this ``` foreach (Control ctrl in this.Controls) { if (ctrl .GetType().GetProperty("Text") != null) { // code here } } ```
46,976,200
I am working with specific program. It has "main window" (a.k.a. "form") where another extensions(protected dll, without access to their source code) can add some objects (texts, labels and etc..) in that window. How can I access all the objects which is added on that "form" ? here i example of typical extension: ``...
2017/10/27
[ "https://Stackoverflow.com/questions/46976200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2377343/" ]
Adding some objects on a form using a dll requires that the form itself be referenced as an accessible member using something [like:](https://stackoverflow.com/a/1088363/3408531) ``` Assembly assembly = Assembly.LoadFile("C:\\test.dll"); Type type = assembly.GetType("test.dllTest"); Form form = (Form)Activator.Create...
> > protected dll, without access to their source code > > > * These controls sound like COM/OLE/ActiveX: * You can access them, as long as you find the code wherein the Main form(The host program) they are maintained. * You can try search those controls' keywords in your project code to locate the relevant codes....
14,790,177
when you go to <http://4shared.com> and click on log in button it shows a small window under the button and you can fill that boxes. I am new to `asp.net` and I do not know how I should do this for my website ? is it an `AJAX` technique ? if yes how should I add this effect to my sites ? can I do it by `Ajax Control To...
2013/02/09
[ "https://Stackoverflow.com/questions/14790177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1274875/" ]
You can use jQuery. Go through this awesome tutorial for beginners. <http://www.w3schools.com/jquery/default.asp> The trick is to show a `div` on click which is set to `display: none` as default.
There are many plugins that could assist you in this task. For example if you are using jQuery you may take a look at the [`jQuery UI dialog`](http://jqueryui.com/dialog/) which is just one of the many plugins that could be used to achieve that. In this particular example AJAX is used to submit the credentials to the...
5,652,194
I have a style that I apply to my buttons. Can I apply the same style to the button of the file upload element without affecting the entry field? ``` <input type="file" name="myFile"> ```
2011/04/13
[ "https://Stackoverflow.com/questions/5652194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/434218/" ]
The designing of file element is not supported by almost all browser. Some browser allow it and some browser does not allow it. You can not make it browser compatible. Basically you do not have complete control to design it. You can also go with this [article](http://www.quirksmode.org/dom/inputfile.html)
Due to security concerns, browsers doesn't allow you to edit or style the upload button. It can be exploited to trick the user. [Example](https://bug57770.bugzilla.mozilla.org/attachment.cgi?id=17860)
38,662,318
For example, I know what `SELECT * FROM example_table;` means. However, I feel uncomfortable not knowing what each part of the code means.
2016/07/29
[ "https://Stackoverflow.com/questions/38662318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6646917/" ]
The second part of a SQL query is the name of the column you want to retrieve for each record you are getting. You can obviously retrieve multiple columns for each record, and (only if you want to retrieve **all** the columns) you can replace the list of them with `*`, which means "all columns". So, in a `SELECT` sta...
For a beginner knowing the follower concepts can be really useful, ***SELECT*** refers to attributes that you want to have displayed in your final query result. There are different 'SELECT' statements such as '**SELECT DISTINCT**' which returns only unique values (if there were duplicate values in the original query r...
38,662,318
For example, I know what `SELECT * FROM example_table;` means. However, I feel uncomfortable not knowing what each part of the code means.
2016/07/29
[ "https://Stackoverflow.com/questions/38662318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6646917/" ]
I am providing you answer by seperating each part of code. SELECT == It orders the computer to include or select each content from the database name(table ) . (\*) == means all {till here code means include all from the database.} FROM == It refers from where we have to select the data. example\_table == This is th...
For a beginner knowing the follower concepts can be really useful, ***SELECT*** refers to attributes that you want to have displayed in your final query result. There are different 'SELECT' statements such as '**SELECT DISTINCT**' which returns only unique values (if there were duplicate values in the original query r...
51,303,189
I have started using mocks in Jest for testing my NodeJS app and they're working nice, but it would make more sense to move `__mocks__` folder to `/test` folder so everything related to tests is there instead of mixing files in `/src`. Is it possible in some way? I cannot find it anywhere in Jest docs.
2018/07/12
[ "https://Stackoverflow.com/questions/51303189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1766444/" ]
`jest.mock('../src/service', () => require('./__mocks__/request'));` This has worked for me
In my package.json i have some jest config ``` "jest": { "preset": "jest-preset-angular", "transform": { "^.+\\.js$": "babel-jest", "^.+\\.(ts|html)$": "<rootDir>/node_modules/jest-preset-angular/preprocessor.js" }, "transformIgnorePatterns": [ "node_modules/babel-runtime" ], ...
2,196,138
Using range based for loops in C++0X, I know we'll be able to do : ``` std::vector<int> numbers = generateNumbers(); for( int k : numbers ) { processNumber( k ); } ``` (might be even simpler to write with lambda) But how should i do if I only want to apply processNumber( k ) to a part of numbers? For example, h...
2010/02/03
[ "https://Stackoverflow.com/questions/2196138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2368/" ]
One possibility might be boost's [iterator\_range](http://www.boost.org/doc/libs/1_41_0/libs/range/doc/utility_class.html) (Not having a compiler which supports range-based for, using `BOOST_FOREACH` instead. I'd expect range-based for work the same, as long as the container or range has the begin and end method.) ``...
~~Something like this may work (unchecked as I don't have access to a C++0x compiler)~~, **Edit:** Checked it on VS10, of course I had to fix numurous errors.... Define a class which is a proxy to any container and whose `iterator`s only return a subset of the container. The example I supply is the simplest one givin...
2,196,138
Using range based for loops in C++0X, I know we'll be able to do : ``` std::vector<int> numbers = generateNumbers(); for( int k : numbers ) { processNumber( k ); } ``` (might be even simpler to write with lambda) But how should i do if I only want to apply processNumber( k ) to a part of numbers? For example, h...
2010/02/03
[ "https://Stackoverflow.com/questions/2196138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2368/" ]
You can use the "[sliced](http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/adaptors/reference/sliced.html)" [range adaptor](http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/adaptors.html) from the [Boost.Range](http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/inde...
~~Something like this may work (unchecked as I don't have access to a C++0x compiler)~~, **Edit:** Checked it on VS10, of course I had to fix numurous errors.... Define a class which is a proxy to any container and whose `iterator`s only return a subset of the container. The example I supply is the simplest one givin...
2,196,138
Using range based for loops in C++0X, I know we'll be able to do : ``` std::vector<int> numbers = generateNumbers(); for( int k : numbers ) { processNumber( k ); } ``` (might be even simpler to write with lambda) But how should i do if I only want to apply processNumber( k ) to a part of numbers? For example, h...
2010/02/03
[ "https://Stackoverflow.com/questions/2196138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2368/" ]
You can use the "[sliced](http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/adaptors/reference/sliced.html)" [range adaptor](http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/adaptors.html) from the [Boost.Range](http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/inde...
One possibility might be boost's [iterator\_range](http://www.boost.org/doc/libs/1_41_0/libs/range/doc/utility_class.html) (Not having a compiler which supports range-based for, using `BOOST_FOREACH` instead. I'd expect range-based for work the same, as long as the container or range has the begin and end method.) ``...
5,685,107
I'm writing an sample app to create a Server on Android and a client to connect to PC. I put the serversocket in a thread of a service. Everything goes perfectly, until a few minutes after the screen goes off. This may be Android kill my server, I tried to put a full wake lock to my code and it wont kill anymore, howev...
2011/04/16
[ "https://Stackoverflow.com/questions/5685107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383149/" ]
Two things that worked for us: * [Wi-Fi lock](http://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock.html) * Set the Wi-Fi sleep policy to never. Some devices will power down the Wi-Fi radio without this setting, even when a program has a lock on the Wi-Fi radio.
I found the problem. That is the router lost the connection to Android. I've tried to ping it and it said "unreachable", after re connect to wifi, it works, but after a while, it comes again
5,685,107
I'm writing an sample app to create a Server on Android and a client to connect to PC. I put the serversocket in a thread of a service. Everything goes perfectly, until a few minutes after the screen goes off. This may be Android kill my server, I tried to put a full wake lock to my code and it wont kill anymore, howev...
2011/04/16
[ "https://Stackoverflow.com/questions/5685107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/383149/" ]
Two things that worked for us: * [Wi-Fi lock](http://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock.html) * Set the Wi-Fi sleep policy to never. Some devices will power down the Wi-Fi radio without this setting, even when a program has a lock on the Wi-Fi radio.
Also try to keep [WakeLock](http://developer.android.com/reference/android/os/PowerManager.WakeLock.html). Doing both works for me.
41,174,995
I have python 3. I installed "Theano" bleeding edge and "Keras" using ``` pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git ``` and also ``` pip install --upgrade git+git://github.com/Theano/Theano.git ``` and ``` pip install git+git://github.com/fchollet/keras.git ``` But when I try to im...
2016/12/15
[ "https://Stackoverflow.com/questions/41174995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4805219/" ]
The problem arises from a broken installation of theano and has nothing to do with keras itself. This error seems to be due to conflicts in the installed version of theano, as also suggested in [this answer](https://stackoverflow.com/q/31444173/4063051) to a related question. An easy way that should solve the problem...
The problem seems to be with your g++ compiler. Try uninstalling it and running your script again. It'll spit a warning implying a degradation in performance, but it'll work nonetheless. ``` 'Python 3.6.3 |Anaconda custom (32-bit)| (default, Oct 15 2017, 07:29:16) [MSC v.1900 32 bit (Intel)] Type "copyright", ...
41,174,995
I have python 3. I installed "Theano" bleeding edge and "Keras" using ``` pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git ``` and also ``` pip install --upgrade git+git://github.com/Theano/Theano.git ``` and ``` pip install git+git://github.com/fchollet/keras.git ``` But when I try to im...
2016/12/15
[ "https://Stackoverflow.com/questions/41174995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4805219/" ]
The problem arises from a broken installation of theano and has nothing to do with keras itself. This error seems to be due to conflicts in the installed version of theano, as also suggested in [this answer](https://stackoverflow.com/q/31444173/4063051) to a related question. An easy way that should solve the problem...
I used conda to install theano and still got the same error. After much trial and error and StackOverflow searches, what worked for me was to first run: ``` conda install m2w64-toolchain ``` followed by: ``` conda install theano ``` Alternatively you can chain the modules together when you create an environment,...
41,174,995
I have python 3. I installed "Theano" bleeding edge and "Keras" using ``` pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git ``` and also ``` pip install --upgrade git+git://github.com/Theano/Theano.git ``` and ``` pip install git+git://github.com/fchollet/keras.git ``` But when I try to im...
2016/12/15
[ "https://Stackoverflow.com/questions/41174995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4805219/" ]
The problem arises from a broken installation of theano and has nothing to do with keras itself. This error seems to be due to conflicts in the installed version of theano, as also suggested in [this answer](https://stackoverflow.com/q/31444173/4063051) to a related question. An easy way that should solve the problem...
For macOS Catalina: ``` conda create -n pymc3 python=3.8 conda activate pymc3 pip install pymc3 ```
41,174,995
I have python 3. I installed "Theano" bleeding edge and "Keras" using ``` pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git ``` and also ``` pip install --upgrade git+git://github.com/Theano/Theano.git ``` and ``` pip install git+git://github.com/fchollet/keras.git ``` But when I try to im...
2016/12/15
[ "https://Stackoverflow.com/questions/41174995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4805219/" ]
I used conda to install theano and still got the same error. After much trial and error and StackOverflow searches, what worked for me was to first run: ``` conda install m2w64-toolchain ``` followed by: ``` conda install theano ``` Alternatively you can chain the modules together when you create an environment,...
The problem seems to be with your g++ compiler. Try uninstalling it and running your script again. It'll spit a warning implying a degradation in performance, but it'll work nonetheless. ``` 'Python 3.6.3 |Anaconda custom (32-bit)| (default, Oct 15 2017, 07:29:16) [MSC v.1900 32 bit (Intel)] Type "copyright", ...
41,174,995
I have python 3. I installed "Theano" bleeding edge and "Keras" using ``` pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git ``` and also ``` pip install --upgrade git+git://github.com/Theano/Theano.git ``` and ``` pip install git+git://github.com/fchollet/keras.git ``` But when I try to im...
2016/12/15
[ "https://Stackoverflow.com/questions/41174995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4805219/" ]
The problem seems to be with your g++ compiler. Try uninstalling it and running your script again. It'll spit a warning implying a degradation in performance, but it'll work nonetheless. ``` 'Python 3.6.3 |Anaconda custom (32-bit)| (default, Oct 15 2017, 07:29:16) [MSC v.1900 32 bit (Intel)] Type "copyright", ...
For macOS Catalina: ``` conda create -n pymc3 python=3.8 conda activate pymc3 pip install pymc3 ```