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 |
|---|---|---|---|---|---|
56,217,829 | Ionic Showing error on device console Error: advanced-http: invalid params object, needs to be an object with strings
Error: advanced-http: invalid params object, needs to be an object with strings.
```
private http: HTTP
verify(){
this.http.get('http://outreach.pk/api/sendsms.php/sendsms/url?id=rchiginsur... | 2019/05/20 | [
"https://Stackoverflow.com/questions/56217829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8825698/"
] | you need to set the headers for the request by using `set` as shown:
```
this.http.setHeader('*', String("Content-Type"), String("application/json"));
this.http.setHeader('*', String("Accept"), String("application/json"));
```
and you need to set the serializer
```
this.http.setDataSerializer('json');
``` | Since your header is empty, just put "null" for headers object and set serializer. For example:
```
this.http.setDataSerializer("json");
this.http.post(url, body, null).then(res => {....});
```
or
```
this.http.setDataSerializer("json");
this.http.post(url, body, {headers: {'Content-Type: application/json'}}).then(... |
1,061,016 | still a bit of a n00b on SharpSVN, I'm looking to get some simple code to open up an SVN repository, and read (at least) the full path of all files in a specific folder.
Lets say that this folder is \trunk\source
I'm not looking to checkout or commit, just read into a list
I'm also looking to read ALL files, not jus... | 2009/06/29 | [
"https://Stackoverflow.com/questions/1061016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/129565/"
] | ok it looks like I found a method..
```
bool gotList;
List<string> files = new List<string>();
using (SvnClient client = new SvnClient())
{
Collection<SvnListEventArgs> list;
gotList = client.GetList(projectPath, out list);
if (gotList)
... | Wrote this in a hurry in notepad; Sorry.
```
SvnClient client = new SvnClient();
client.Authentication.DefaultCredentials = new NetworkCredential("svnuser", "svnpass");
SvnUriTarget folderTarget = new SvnUriTarget("https://mysvnserver.com/mysvnpath");
List<String> filesFound = getFolderFiles(client, folderTarget);
//... |
60,084,727 | There is a table in which the managers column and the status column. How to calculate the total status of Fully, the divided total of records with all statuses except N / A for each manager?
I tried to portray in this way, but nothing came of it
First Query
```
SELECT "Manager Name", count("Performance Score") as Pe... | 2020/02/05 | [
"https://Stackoverflow.com/questions/60084727",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11989201/"
] | The JavaScript approach to detect closing still works.
The syntax just has changed a little
```
UI.getCurrent().getPage().executeJs("function closeListener() { $0.$server.windowClosed(); } " +
"window.addEventListener('beforeunload', closeListener); " +
"window.addEventListener('unload', closeListener... | Depending on which browsers you need to support, you might also want to take a look at the [Beacon API](https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API), which is supported by all modern browsers, but not IE11.
The Beacon API has the benefit of being non-blocking. With the unload listener, the client waits... |
8,327 | I'm looking to make some custom gui elements. Has anyone had success using pyside to use Qt to communicate with Blender? | 2014/04/04 | [
"https://blender.stackexchange.com/questions/8327",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/2452/"
] | There is at least a video showing someone compiled PyQt into Blender:
<http://vimeo.com/86398593>
And a facebook post:
<https://www.facebook.com/cgtutorials/posts/521688517904188?stream_ref=10>
So it seems possible, at least with a modified Blender binary. | I have tried to get PySide working inside Blender, but i have had trouble getting PySide working correctly in python 3.4 standalone, so i gave up on PySide and moved to PyQt4.
First of all, i have it working on mac OSX 10.8 with blender 2.71. but i would say the process below would be almost the same on linux, but for... |
5,828,971 | i have made one site in which i have given functionality called 'connect with facebook'. it works fine for login..
but now i want to implement functionality when i click on logout, it should be logged out from facebook as well...
can any one tell me from where i should start..? | 2011/04/29 | [
"https://Stackoverflow.com/questions/5828971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/730607/"
] | Make sure that the **class-name** stated in the *Inhertis*-part of your page-directive **matches** the name of the class in your **code-behind file**.
Master1.master:
```
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="master1.master.cs" Inherits="FlexStock.Forms.master1" %>
```
Master1.Master.cs:
```
... | Have you built your project w/o any errors/warning?
Error says that its unable to find code-behind class `FlexStock.Forms.master1` so issue will be likely in `master1.Master.cs` or `designer.cs` - where you may have changed the namespace or class name w/o making the same change in markup. Or there is some compilation... |
5,828,971 | i have made one site in which i have given functionality called 'connect with facebook'. it works fine for login..
but now i want to implement functionality when i click on logout, it should be logged out from facebook as well...
can any one tell me from where i should start..? | 2011/04/29 | [
"https://Stackoverflow.com/questions/5828971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/730607/"
] | Make sure that the **class-name** stated in the *Inhertis*-part of your page-directive **matches** the name of the class in your **code-behind file**.
Master1.master:
```
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="master1.master.cs" Inherits="FlexStock.Forms.master1" %>
```
Master1.Master.cs:
```
... | If you can see the bin folder in Explorer, but not in VS, try "Including" it in your project.
Maybe drag the folder into Solution Explorer, and then right-click it and Include it. |
38,839,796 | Here's some test in my Chrome dev console:
```
> tags
returns ["test_tag", "test_tag2"]
> tags.forEach
returns undefined
> ["test_tag", "test_tag2"].forEach
returns forEach() { [native code] }
```
I have no idea why my `tags` object is not responding to `forEach`.
Checking the type is not very instructive, which... | 2016/08/08 | [
"https://Stackoverflow.com/questions/38839796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2981429/"
] | jQuery's `map()` function returns the collection of elements, or in this case the returned text wrapped in a jQuery object, which is of course an object, not an array.
If you wanted the text in an array, you'd use `get()` as well
```
var $nodes = $(".metadata")
var tags = $nodes.map(function(idx, node){
var nodeJ... | Try it like this:
```
Array.prototype.forEach.call(tags, function(el){
console.log(el);
});
``` |
39,464,748 | I have a Flask API, it connects to a Redis cluster for caching purposes. Should I be creating and tearing down a Redis connection on each flask api call? Or, should I try and maintain a connection across requests?
My argument against the second option is that I should really try and keep the api as stateless as possib... | 2016/09/13 | [
"https://Stackoverflow.com/questions/39464748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1658296/"
] | This is about performance and scale. To get those 2 buzzwords buzzing you'll in fact need persistent connections.
Eventual race conditions will be no different than with a reconnect on every request so that shouldn't be a problem. Any RCs will depend on how you're using redis, but if it's just caching there's not much... | It's good idea from the performance standpoint to keep connections to a database opened between requests. The reason for that is that opening and closing connections is not free and takes some time which may become problem when you have too many requests. Another issue that a database can only handle up to a certain nu... |
17,078,981 | Normalization not in a general relational database sense, in this context.
I have received reports from a User. The data in these reports was generated roughly at the same time, making the timestamp the same for all reports gathered in one request.
I'm still pretty new to datastore, and I know you can query on proper... | 2013/06/13 | [
"https://Stackoverflow.com/questions/17078981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1458482/"
] | ```
SetZero::setZero((int **)a, 4, 5)
```
`a` is not an array of pointers, it is simply a 2 dimensional array.
notice how the access violation is reading address 0x0000004B? that's 75, a number between 0 and 99 :) because you are treating a 2 dimensional array (which is just a one dimensional array with a neat way o... | One suggestion about the SetZero(). There is a function called [memset()](http://www.cplusplus.com/reference/cstring/memset/) which allows you to set all bytes to a specific value given a starting pointer and the range. This function could make your SetZero() function more cleaner:
---
```
void * memset ( void * ptr,... |
49,674,913 | I run a statistical test in R (running in RStudio). I save the result using a variable name. I want to extract one part of the result. How do I do this?
Here is an example with the R code at the end.
I set up an experiment with four treatments, and gather data. I next run ANOVA and perform a Tukey HSD test. The result ... | 2018/04/05 | [
"https://Stackoverflow.com/questions/49674913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4547897/"
] | simply use subsetting of your `posthoc` variable.
```
posthoc$`Expt1$Trt`[,4]
```
or you can try the `broom` package.
```
library(broom)
res <- tidy(posthoc)
res
term comparison estimate conf.low conf.high adj.p.value
1 Expt1$Trt B-A 5.904138 1.3639293 10.444346 5.223255e-03
2 Expt1$Trt ... | Jimbou has already provided an excellent solution. I would also go for `broom` especially when doing plots with `ggplot2`. I would just like to expound on the comment by John Coleman.
You can inspect the object by using `str`. In case of `posthoc`,
```
str(posthoc)
```
gives
```
List of 1
$ Expt1$Trt: num [1:6, ... |
41,297,615 | With regard to the built-in Excel function: VLOOKUP(lookup\_value,table\_array,col\_index\_num,range\_lookup).
This function is described at <https://support.microsoft.com/en-gb/kb/181213>
As we know this function starts to give the wrong results if you insert a column in the middle of the lookup table. This is becau... | 2016/12/23 | [
"https://Stackoverflow.com/questions/41297615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1170311/"
] | SPSS has a [`FILE HANDLE`](http://www.ibm.com/support/knowledgecenter/en/SSLVMB_21.0.0/com.ibm.spss.statistics.help/syn_file_handle.htm) and [`CD`](http://www.ibm.com/support/knowledgecenter/en/SSLVMB_21.0.0/com.ibm.spss.statistics.help/syn_cd.htm) command (as you point out also) that aid to try make these type of thin... | Another possibility is to use the STATS OPEN PROJECT extension command. This opens a project and carries out the actions it defines. It can open data files, run any syntax, etc. You can have a master project that does things you always want and subprojects for specific work. It can be set to do this on Statistics start... |
70,881,196 | How can i transform this sql query to an EF linq command
```
"update dbo.table set col1= col1 + 1 where Id = 27"
```
i want to execute this query using one command to avoid concurrency problems
in case of another client modify the record in the same time
i'm looking for doing that using EF but in one command
i tr... | 2022/01/27 | [
"https://Stackoverflow.com/questions/70881196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15190100/"
] | There are ways to [update a column without first querying](https://stackoverflow.com/questions/3642371/how-to-update-only-one-field-using-entity-framework/5567616#5567616), but the problem you have is that the update is based on the existing value.
Entity Framework can't help you there. You can only do what you want w... | Even the original SQL statement should be executed within a transaction if you want to be sure no other changes can occur between reading and updating the value. It's one SQL statement, but the db still has to read the value, increment and store. |
70,881,196 | How can i transform this sql query to an EF linq command
```
"update dbo.table set col1= col1 + 1 where Id = 27"
```
i want to execute this query using one command to avoid concurrency problems
in case of another client modify the record in the same time
i'm looking for doing that using EF but in one command
i tr... | 2022/01/27 | [
"https://Stackoverflow.com/questions/70881196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15190100/"
] | I would propose to use [linq2db.EntityFrameworkCore](https://github.com/linq2db/linq2db.EntityFrameworkCore) (note that I'm one of the creators)
Then you can do that with ease:
```cs
await context.table1.Where(x => x.Id == 27)
.Set(x => x.Col1, prev => prev.Col1 + 1)
.UpdateAsync();
``` | Even the original SQL statement should be executed within a transaction if you want to be sure no other changes can occur between reading and updating the value. It's one SQL statement, but the db still has to read the value, increment and store. |
1,495,139 | I have 3 sets of tabular data I want to display with a JavaScript framework in ASP.NET MVC. I know I can embed a separate grid in a tab, but this seems inefficient especially when large datasets are involved since I imagine 3 separate grids would be created. I haven't found a JavaScript datagrid which emulates what a s... | 2009/09/29 | [
"https://Stackoverflow.com/questions/1495139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | Since you tagged this with Ext JS, I'll mention that it's quite simple to render grids into tabs using Ext JS. It also supports deferred load/render, so that only the first tab/grid would load initially, then the others would be loaded on first access. Without knowing your specific requirements it's hard to comment fur... | jQuery Grid is kinda what people use a lot. I use it and it's pretty good.
[jqGrid Link](http://www.jqgrid.com/)
I wouldn't draw a grid with three tabs. I'd use a single grid with a tab control and then load data via jQuery as required.
Or maybe have three PartialViews that you can load dynamically when you hit a ta... |
1,495,139 | I have 3 sets of tabular data I want to display with a JavaScript framework in ASP.NET MVC. I know I can embed a separate grid in a tab, but this seems inefficient especially when large datasets are involved since I imagine 3 separate grids would be created. I haven't found a JavaScript datagrid which emulates what a s... | 2009/09/29 | [
"https://Stackoverflow.com/questions/1495139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | jQuery Grid is kinda what people use a lot. I use it and it's pretty good.
[jqGrid Link](http://www.jqgrid.com/)
I wouldn't draw a grid with three tabs. I'd use a single grid with a tab control and then load data via jQuery as required.
Or maybe have three PartialViews that you can load dynamically when you hit a ta... | You could use [JS tab object](http://www.pagecolumn.com/webparts/tabs_object_top_bottom.htm) to create tabs.
And use [javascript grid framework](http://www.pagecolumn.com/javascript/js_grid_framework.htm) to create grids and populate data into grids. |
1,495,139 | I have 3 sets of tabular data I want to display with a JavaScript framework in ASP.NET MVC. I know I can embed a separate grid in a tab, but this seems inefficient especially when large datasets are involved since I imagine 3 separate grids would be created. I haven't found a JavaScript datagrid which emulates what a s... | 2009/09/29 | [
"https://Stackoverflow.com/questions/1495139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | Since you tagged this with Ext JS, I'll mention that it's quite simple to render grids into tabs using Ext JS. It also supports deferred load/render, so that only the first tab/grid would load initially, then the others would be loaded on first access. Without knowing your specific requirements it's hard to comment fur... | You could also use [dhtmlx grid.](http://dhtmlx.com/docs/products/dhtmlxGrid/) |
1,495,139 | I have 3 sets of tabular data I want to display with a JavaScript framework in ASP.NET MVC. I know I can embed a separate grid in a tab, but this seems inefficient especially when large datasets are involved since I imagine 3 separate grids would be created. I haven't found a JavaScript datagrid which emulates what a s... | 2009/09/29 | [
"https://Stackoverflow.com/questions/1495139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | Since you tagged this with Ext JS, I'll mention that it's quite simple to render grids into tabs using Ext JS. It also supports deferred load/render, so that only the first tab/grid would load initially, then the others would be loaded on first access. Without knowing your specific requirements it's hard to comment fur... | You could use [JS tab object](http://www.pagecolumn.com/webparts/tabs_object_top_bottom.htm) to create tabs.
And use [javascript grid framework](http://www.pagecolumn.com/javascript/js_grid_framework.htm) to create grids and populate data into grids. |
1,495,139 | I have 3 sets of tabular data I want to display with a JavaScript framework in ASP.NET MVC. I know I can embed a separate grid in a tab, but this seems inefficient especially when large datasets are involved since I imagine 3 separate grids would be created. I haven't found a JavaScript datagrid which emulates what a s... | 2009/09/29 | [
"https://Stackoverflow.com/questions/1495139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/58634/"
] | You could also use [dhtmlx grid.](http://dhtmlx.com/docs/products/dhtmlxGrid/) | You could use [JS tab object](http://www.pagecolumn.com/webparts/tabs_object_top_bottom.htm) to create tabs.
And use [javascript grid framework](http://www.pagecolumn.com/javascript/js_grid_framework.htm) to create grids and populate data into grids. |
14,667,010 | I'm playing with the Gamepad API - in particular the axes using the joysticks on a controller. The position of these updates a lot and often - as such, the event that I'm listening for (movement on the sticks) also happens a lot. Is there any way to limit it happening to, say, 25 times a second in order to reduce lag? | 2013/02/02 | [
"https://Stackoverflow.com/questions/14667010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2036108/"
] | You can't limit the rate at which JavaScript events are triggered, but your event handler could opt to do nothing on some calls. Here is an example using `mousemove` (I don't know which Gamepad API you're talking about):
```
var lastMove = 0;
document.addEventListener('mousemove', function() {
// do nothing if las... | Initialize a variable that increments every time the event listener activates. Make it so that the function the event listener outputs only occurs when the variable is below 25. |
14,667,010 | I'm playing with the Gamepad API - in particular the axes using the joysticks on a controller. The position of these updates a lot and often - as such, the event that I'm listening for (movement on the sticks) also happens a lot. Is there any way to limit it happening to, say, 25 times a second in order to reduce lag? | 2013/02/02 | [
"https://Stackoverflow.com/questions/14667010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2036108/"
] | You could do something like this, where you check how often your event is called in a 1 second interval and whether or not you process it. Code sample, rough outline of what I was thinking (no gaurantee (like that spelling)).
```
function process_event() {
var curr = new Date().getTime();
if ((curr - timeObj.last) < 1... | Initialize a variable that increments every time the event listener activates. Make it so that the function the event listener outputs only occurs when the variable is below 25. |
14,667,010 | I'm playing with the Gamepad API - in particular the axes using the joysticks on a controller. The position of these updates a lot and often - as such, the event that I'm listening for (movement on the sticks) also happens a lot. Is there any way to limit it happening to, say, 25 times a second in order to reduce lag? | 2013/02/02 | [
"https://Stackoverflow.com/questions/14667010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2036108/"
] | You can't limit the rate at which JavaScript events are triggered, but your event handler could opt to do nothing on some calls. Here is an example using `mousemove` (I don't know which Gamepad API you're talking about):
```
var lastMove = 0;
document.addEventListener('mousemove', function() {
// do nothing if las... | You could do something like this, where you check how often your event is called in a 1 second interval and whether or not you process it. Code sample, rough outline of what I was thinking (no gaurantee (like that spelling)).
```
function process_event() {
var curr = new Date().getTime();
if ((curr - timeObj.last) < 1... |
56,443,979 | Is there a way to make a class that holds several other classes?
In the Bootstrap menu, there are many anchor tags with the same multiple classes such as:
```
<a class="nav-item nav-link" asp-controller="Account" asp-action="Login">Login</a>
```
To something like:
```
<a class="consolidate-name" asp-controller="A... | 2019/06/04 | [
"https://Stackoverflow.com/questions/56443979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1261114/"
] | Regular Expressions will work nicely here.
`.contains()` [allows for regex](https://docs.cypress.io/api/commands/contains.html#Regular-Expression) So you can do a regex that matches the whole string only (use `^` and `$`). That way anything with extra characters won't match (like New Navigation Label). So for example,... | You can use below code snippet to click on an element which has exact text. This will work like charm, let me know if you face any issue.
You have to handle like below in cypress which is equivalent getText() in selenium webdriver.
```
clickElementWithEaxctTextMatch(eleText) {
cy.get(".className").each(ele => {
... |
1,419,718 | I've been playing with C++ for a few years now, and want to become adept at using
and factories. Are there some good web tutorials and/or textbooks that cover this well?
I started programming prior to the wide use of the term "patterns" ('80's)... but when I first saw the term I recognized the "pattern" of it's usage... | 2009/09/14 | [
"https://Stackoverflow.com/questions/1419718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The links in this forum post will help you a ton:
[Forum Post](http://www.codeguru.com/forum/showthread.php?t=327982) | Do you mean book for C++ Templates and Design patterns ?
Then, my choice:
* C++ Templates : [C++ Templates The
Complete Guide](http://books.google.co.in/books?id=EotSAwuBkJoC&dq=C%2B%2B+Templates+The+Complete+Guide+%2B+josuttis&printsec=frontcover&source=bl&ots=iwLZM21oeg&sig=0v97fIH9aFLXQfQH6MjyY64iuRk&hl=en&ei=79Ot... |
1,419,718 | I've been playing with C++ for a few years now, and want to become adept at using
and factories. Are there some good web tutorials and/or textbooks that cover this well?
I started programming prior to the wide use of the term "patterns" ('80's)... but when I first saw the term I recognized the "pattern" of it's usage... | 2009/09/14 | [
"https://Stackoverflow.com/questions/1419718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Read books of Herb Sutter like **Exceptional C++** or **C++ Coding Standards**,
books from Scott Meyers, like **Effective C++**.
For different patterns read **Design Patterns** by the Gang of four (Gamma, Helm, Johnson, Vlissides), the **Advanced C++ Programming Styles and Idioms** by James O. Coplien is also good.
I... | Do you mean book for C++ Templates and Design patterns ?
Then, my choice:
* C++ Templates : [C++ Templates The
Complete Guide](http://books.google.co.in/books?id=EotSAwuBkJoC&dq=C%2B%2B+Templates+The+Complete+Guide+%2B+josuttis&printsec=frontcover&source=bl&ots=iwLZM21oeg&sig=0v97fIH9aFLXQfQH6MjyY64iuRk&hl=en&ei=79Ot... |
46,750,808 | How can I tell my function to respond to an endpoint specified on the received message with a HTTP Post response in Google Cloud function? In the code, or the trigger configuration, or in the package json?
I think I'm looking for something [like this](https://cloud.google.com/functions/docs/writing/http) but in python... | 2017/10/15 | [
"https://Stackoverflow.com/questions/46750808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8612164/"
] | All you need is just this -
**return Response('No file uploaded', status=500**)
Check this out -
<https://www.programcreek.com/python/example/51515/flask.Response>
FYI, A Google Cloud Function uses a Flask Response object -
<http://flask.pocoo.org/docs/0.12/api/#flask.Flask.make_response> | This is the link to google's answer: <https://cloud.google.com/functions/docs/writing/http>
I used this link to write this solution:
```
headers= {
'Access-Control-Allow-Origin': '*',
'Content-Type':'application/json'
}
id1= "1234567"
var1= "variable 1"
text = '{"id1":"'+id1+'... |
3,310,857 | I'm about to design a client application and the server part is not designed either.
I need to decide on the communication protocol.
The requirements are:
* fast, compact
* supports binary file transfer both ways
* server is probably PHP, client .NET
So far I have considered these:
* custom XML over HTTP - I've do... | 2010/07/22 | [
"https://Stackoverflow.com/questions/3310857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/177591/"
] | Answering my own question, the tool is available here: [MSDN subscribers download](http://msdn.microsoft.com/en-us/vstudio/ff655021.aspx) | This online service <http://modeling-languages.com/content/xmi2-tool-exchanging-uml-models-among-case-tools> helps to exchange UML class diagrams between different tools. Not sure if the XMI format imported/exported by your specific tool combination is similar to one of the currently supported tools |
3,555,474 | We use WordPress for development, but often make a lot of modifications. We're looking for a way to always keep our development version up to date with our modified version.
It possible to import all of the [WordPress SVN](http://core.svn.wordpress.org/) commits, branches and tags, but merge these with any we've made ... | 2010/08/24 | [
"https://Stackoverflow.com/questions/3555474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/45350/"
] | What you want is a vendor branch. We used it with wordpress and it works well.
[Subversion svn:externals file override?](https://stackoverflow.com/questions/3754459/subversion-svnexternals-file-override/3785904#3785904) | I think you can merge from the WordPress SVN repo into your local repo, but you need to keep track of what revisions you have merged, and you need to remind yourself to do the merge.
There is no concept of live forking in SVN. The closest you can get is [SVN Externals](http://svnbook.red-bean.com/en/1.0/ch07s03.html),... |
26,555 | Is it possible to create thrusters for station keeping that require no fuel?
Are there ideas similar to solar sails which can help in station- keeping and make use of a natural phenomenon? Except the EM drive. | 2018/04/09 | [
"https://space.stackexchange.com/questions/26555",
"https://space.stackexchange.com",
"https://space.stackexchange.com/users/23950/"
] | In theory an Electro Dynamic Tether (<https://en.wikipedia.org/wiki/Electrodynamic_tether>) could be used to impart momentum to a satellite or station for station-keeping maneuvers, converting electricity to momentum.
See this paper: <http://issfd.org/2015/files/downloads/papers/111_Oliveira.pdf> | The EM drive is currently the only concept under testing that I'm aware.
If by fuel you mean some consumable that is loaded before lunch, and if by "Is it possible" you are proposing a more theoretical rather than readily practical question, I would argue that it should be possible to create some kind of particle acce... |
872,230 | I've been reading its man page but haven't yet been successful in figuring out how it works. On calling system(), is a new child process forked and the shell binary exec()-ed in it? That may be a stupid guess though. | 2009/05/16 | [
"https://Stackoverflow.com/questions/872230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/108127/"
] | Yes, system() is essentially a fork() and exec() "sh -c" for the passed command string. An example implementation (from eglibc, recently forked from glibc) can be found [here](http://www.eglibc.org/cgi-bin/viewcvs.cgi/branches/eglibc-2_9/libc/sysdeps/posix/system.c?rev=7350&view=markup). | Yes, system("foo bar") is equivalent to execv("/bin/sh", ["sh", "-c", "foo bar"]). |
36,240,991 | I'm working with CSV but all the tutorials I've read use 2D Lists.
```
private void cargaCSV()
{
List<string[]> values = new List<string[]>();
var reader = new StreamReader(File.OpenRead(*my file*));
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
... | 2016/03/26 | [
"https://Stackoverflow.com/questions/36240991",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4608648/"
] | If all the arrays have the same length, then you can do what you are doing and, after that, create and fill the array manually:
```
string[,] stringArray = new string[values.Count, values.First().Length]
for (int i = 0; i < values.Count; i++)
row = values[i];
for (int j = 0; j < row.Length; j++)
strin... | You don't have to typecast hard and old way.
Simply replace
```
string [,] Data = values.ToArray();
```
With
```
var Data = values.ToArray();
```
Now Data is two dimensional array of strings. |
66,886 | I'm trying to translate [a video on TED](http://www.ted.com/talks/susan_cain_the_power_of_introverts.html) into my native language (Latvian). At the very start there is an expression I'm unfamiliar with - "animal warmth". I think I kind of understand the idea intuitively, but I can't think of any similar expressions in... | 2012/05/06 | [
"https://english.stackexchange.com/questions/66886",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/5587/"
] | It simply describes, rather graphically, the comfort to be derived from the presence of other people, particularly people you are close to. | Animal warmth is literally a warmth generated from within an animal or person, as opposed to external sources of heat. It is used figuratively to mean a coziness and closeness with another being. Here are a few examples of its use.
The first excerpt is from an old medical journal, just showing that it's an old term an... |
66,886 | I'm trying to translate [a video on TED](http://www.ted.com/talks/susan_cain_the_power_of_introverts.html) into my native language (Latvian). At the very start there is an expression I'm unfamiliar with - "animal warmth". I think I kind of understand the idea intuitively, but I can't think of any similar expressions in... | 2012/05/06 | [
"https://english.stackexchange.com/questions/66886",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/5587/"
] | It simply describes, rather graphically, the comfort to be derived from the presence of other people, particularly people you are close to. | I belong to a local Toastmasters group and my next 5-7 minute speech is coming up. I've chosen the title 'Animal Warmth' and here is the very first draft of my speech (sorry it is not as yet more polished):
>
> Animal warmth
>
>
> I wonder how many of you have experienced the warmth and comfort you
> can get from ... |
66,886 | I'm trying to translate [a video on TED](http://www.ted.com/talks/susan_cain_the_power_of_introverts.html) into my native language (Latvian). At the very start there is an expression I'm unfamiliar with - "animal warmth". I think I kind of understand the idea intuitively, but I can't think of any similar expressions in... | 2012/05/06 | [
"https://english.stackexchange.com/questions/66886",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/5587/"
] | Animal warmth is literally a warmth generated from within an animal or person, as opposed to external sources of heat. It is used figuratively to mean a coziness and closeness with another being. Here are a few examples of its use.
The first excerpt is from an old medical journal, just showing that it's an old term an... | I belong to a local Toastmasters group and my next 5-7 minute speech is coming up. I've chosen the title 'Animal Warmth' and here is the very first draft of my speech (sorry it is not as yet more polished):
>
> Animal warmth
>
>
> I wonder how many of you have experienced the warmth and comfort you
> can get from ... |
804,761 | While I'm browsing the Internet, Opera always pop out a lots of these Server certificate chain incomplete boxes. Several times it pops out tons of them . Even if I click to remember my choice or aproove, it still pop out hundreds of them... What should I do?
I tried different Opera versions - 12.14 , 12. 15 , 12.16 , ... | 2014/08/29 | [
"https://superuser.com/questions/804761",
"https://superuser.com",
"https://superuser.com/users/362978/"
] | I just had this problem myself.
Make sure your virus scanner (AVG, AVAST, Norton, etc.) is not scanning your email. You have google so turning it off is good because it's simply redundant to scan them again. Google scans all email for you. I'm not sure the root cause, but that will fix your problem.
I know I'm a fe... | It's possible your router, or computers have been exploited; for example alterations to your DNS entries. A good place to start would be checking (and if needed changing) your computer's and router's DNS entries to use your IP's DNS servers.
**Changing Your Router's DNS Entries:**
You router will likely have a local ... |
804,761 | While I'm browsing the Internet, Opera always pop out a lots of these Server certificate chain incomplete boxes. Several times it pops out tons of them . Even if I click to remember my choice or aproove, it still pop out hundreds of them... What should I do?
I tried different Opera versions - 12.14 , 12. 15 , 12.16 , ... | 2014/08/29 | [
"https://superuser.com/questions/804761",
"https://superuser.com",
"https://superuser.com/users/362978/"
] | I know that this should be a comment but I don't have enough privilege.
I had myself a problem like that in the past and I recognized that the problem is that my date is not updated. | It's possible your router, or computers have been exploited; for example alterations to your DNS entries. A good place to start would be checking (and if needed changing) your computer's and router's DNS entries to use your IP's DNS servers.
**Changing Your Router's DNS Entries:**
You router will likely have a local ... |
804,761 | While I'm browsing the Internet, Opera always pop out a lots of these Server certificate chain incomplete boxes. Several times it pops out tons of them . Even if I click to remember my choice or aproove, it still pop out hundreds of them... What should I do?
I tried different Opera versions - 12.14 , 12. 15 , 12.16 , ... | 2014/08/29 | [
"https://superuser.com/questions/804761",
"https://superuser.com",
"https://superuser.com/users/362978/"
] | I know that this should be a comment but I don't have enough privilege.
I had myself a problem like that in the past and I recognized that the problem is that my date is not updated. | I just had this problem myself.
Make sure your virus scanner (AVG, AVAST, Norton, etc.) is not scanning your email. You have google so turning it off is good because it's simply redundant to scan them again. Google scans all email for you. I'm not sure the root cause, but that will fix your problem.
I know I'm a fe... |
68,011,222 | I need to make an algorithm in which the person types a login and password and he has three attempts, I did a "while x <= 3" (ox has a value of 0) and then an if inside the while with the login and password condition . But how do I stop while asking for login and password 3 times even hitting the login and password on ... | 2021/06/16 | [
"https://Stackoverflow.com/questions/68011222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You mentioned that you want to load your data without clicking the button and you are putting all the code responsible for retrieving and displaying data inside the OnClickListener of the button.
If you want to display data when the app loads, take all the code out of OnClickListener.
You are not seeing data until a d... | To fetch data without click take the method call outside the click Listener.
```
my_func(exampleList);
```
Before my\_fun() method run your buildRecyclerView(); method in oncreate.
Then in last line of try block notify the adapter of recyclerView to update the data in it. |
68,011,222 | I need to make an algorithm in which the person types a login and password and he has three attempts, I did a "while x <= 3" (ox has a value of 0) and then an if inside the while with the login and password condition . But how do I stop while asking for login and password 3 times even hitting the login and password on ... | 2021/06/16 | [
"https://Stackoverflow.com/questions/68011222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You mentioned that you want to load your data without clicking the button and you are putting all the code responsible for retrieving and displaying data inside the OnClickListener of the button.
If you want to display data when the app loads, take all the code out of OnClickListener.
You are not seeing data until a d... | Simply call your method in `onCreate`. For example :
```
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mQueue = MySingleton.getInstance(this).getRequestQueue();
exampleList = new ArrayList<>();
thisIsMyFunction... |
53,048,916 | I am analyzing the student test data, but before that I want to tidy it. I tried to build a tidy data frame but it seems like the rows are duplicating. Below is my code.
```
library(tidyverse)
(Test <- tibble(
Student = c("A", "B", "C", "D", "E"),
Test1 = c("SAT", "SAT", "SAT", "SAT", "SAT"),
Test2 = c("NA", "AC... | 2018/10/29 | [
"https://Stackoverflow.com/questions/53048916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9613842/"
] | It is simple , as you emit event to make footer flag to true. In same way you have to again make one emit and subscribe to make it false.
**In your main service... E.x common.service.ts**
```
footerReset = new EventEmitter<any>();
```
Now when ever you change component or call any API you just have to emit event..... | It's because your **ngOnInit** is not firing on your route change , So your code won't execute. I think it's known issue. There are some alternative to execute ngOnInit explicitly.It's explain in the below thread
<https://github.com/angular/angular/issues/20112>
I would suggest move your code to the constructor , So... |
11,871,962 | Hi all
Our Maven scripts are currently written to compile/package & deploy in tomcat6 (development) server. This helped us in automating the build-deploy process.
Moving forward, we want to do **automated deployments into WAS7 (Websphere 7) server using MAVEN** scripts. Few articles which i read talks about invo... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11871962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1538815/"
] | I don't know if that works for WAS 7, but IBM provide support for WAS 6 and Maven integration :
* <http://sdudzin.blogspot.fr/2007/09/maven-2-and-websphere-automated-build.html>
* <https://www.ibm.com/developerworks/wikis/download/attachments/113607155/RAD_755_MAVEN_0601.pdf?version=1>
* [Maven Integration for RAD7.5 ... | You can use this plugin
<http://code.google.com/p/websphere-maven-plugin/>
```
<plugin>
<groupId>Websphere7AM.plugin</groupId>
<artifactId>websphere7am-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<defaultCommand>
<host>localhost</host>
<port>8880</port>
</defaultCommand>
<commands>
... |
267,375 | I've started using Dropbox but I'm finding that my upload speeds are dropping down to the withering pace of 6Kb per second. I have checked my upload speed with [speedtest.net](http://speedtest.net) and I get just under 1Mbs.
Is this due to preferences or settings on my install or would this be something out of my cont... | 2011/04/06 | [
"https://superuser.com/questions/267375",
"https://superuser.com",
"https://superuser.com/users/30182/"
] | Check your Preferences. By default, Dropbox doesn't limit download speed, but limits upload speed to whatever they think is sufficient.
 | The up/down speeds depend on many different variables. Please see [Why is my internet so slow?](https://superuser.com/questions/8392/why-is-my-internet-so-slow) for detailed explanations.
As for your question, it's not a common experience. I just tested a 5 mb file and it uploaded just fine, i.e. using the full upload... |
267,375 | I've started using Dropbox but I'm finding that my upload speeds are dropping down to the withering pace of 6Kb per second. I have checked my upload speed with [speedtest.net](http://speedtest.net) and I get just under 1Mbs.
Is this due to preferences or settings on my install or would this be something out of my cont... | 2011/04/06 | [
"https://superuser.com/questions/267375",
"https://superuser.com",
"https://superuser.com/users/30182/"
] | Check your Preferences. By default, Dropbox doesn't limit download speed, but limits upload speed to whatever they think is sufficient.
 | I don't think it's a problem with Dropbox but your Internet connection.
Usually the upload speed of your connection is slower than your download speed, using a site like [SpeedTest.net](http://www.speedtest.net) will show you both values and if you can publish them we can have a better idea of what's happening.
It wo... |
267,375 | I've started using Dropbox but I'm finding that my upload speeds are dropping down to the withering pace of 6Kb per second. I have checked my upload speed with [speedtest.net](http://speedtest.net) and I get just under 1Mbs.
Is this due to preferences or settings on my install or would this be something out of my cont... | 2011/04/06 | [
"https://superuser.com/questions/267375",
"https://superuser.com",
"https://superuser.com/users/30182/"
] | Check your Preferences. By default, Dropbox doesn't limit download speed, but limits upload speed to whatever they think is sufficient.
 | It's my experience also, so I moved to Wuala.
From my experience Dropbox seems to slow down the speed when you have a lot of files to download (f.e. when you have a new PC that has to download the complete storage once). F.e. when I have to sync only 2-3 files then I get "normal" speeds of 700-800Kb/s. If the number o... |
4,139,164 | How can show arabic numbers in label?
better is i say how can i convert en numbers to arabic numbers.
like ۱و۲و۳و...
iphone | 2010/11/09 | [
"https://Stackoverflow.com/questions/4139164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498137/"
] | Since Lollipop (API 21) there is [PowerManager#ACTION\_POWER\_SAVE\_MODE\_CHANGED](http://developer.android.com/reference/android/os/PowerManager.html#ACTION_POWER_SAVE_MODE_CHANGED) broadcast intent.
So you need just to receive it:
---
AndroidManifest.xml:
```
<receiver android:name=".observers.PowerSaveModeReceiv... | >
> How can an Android listener be created to perform a task just before entering power save mode?
>
>
>
There is no broadcast `Intent` for this. The closest is `ACTION_SCREEN_OFF`. The device will likely fall asleep in the near future after you receive this broadcast. And, you can only listen for this broadcast u... |
4,139,164 | How can show arabic numbers in label?
better is i say how can i convert en numbers to arabic numbers.
like ۱و۲و۳و...
iphone | 2010/11/09 | [
"https://Stackoverflow.com/questions/4139164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498137/"
] | The answer above(for API 21 and above) is not exactly right. You should register a receiver in your activity or service like this:
```
BroadcastReceiver powerSaverChangeReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
checkPowerSaverMode();
}
}... | >
> How can an Android listener be created to perform a task just before entering power save mode?
>
>
>
There is no broadcast `Intent` for this. The closest is `ACTION_SCREEN_OFF`. The device will likely fall asleep in the near future after you receive this broadcast. And, you can only listen for this broadcast u... |
4,139,164 | How can show arabic numbers in label?
better is i say how can i convert en numbers to arabic numbers.
like ۱و۲و۳و...
iphone | 2010/11/09 | [
"https://Stackoverflow.com/questions/4139164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498137/"
] | The answer above(for API 21 and above) is not exactly right. You should register a receiver in your activity or service like this:
```
BroadcastReceiver powerSaverChangeReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
checkPowerSaverMode();
}
}... | Since Lollipop (API 21) there is [PowerManager#ACTION\_POWER\_SAVE\_MODE\_CHANGED](http://developer.android.com/reference/android/os/PowerManager.html#ACTION_POWER_SAVE_MODE_CHANGED) broadcast intent.
So you need just to receive it:
---
AndroidManifest.xml:
```
<receiver android:name=".observers.PowerSaveModeReceiv... |
759,105 | I have a computer (HP Pavilion g6-2342dx) which came with Windows 8, and thus the new UEFI boot system. I would like to install a few OS's which are not EFI compatible, and Arch GNU/Linux with BIOS mode. However, I would not like to completely wipe all my files to set to legacy. My preferred options would be to:
1. Mul... | 2014/05/27 | [
"https://superuser.com/questions/759105",
"https://superuser.com",
"https://superuser.com/users/293521/"
] | AFAIK, the easiest way to do this is to use my [rEFInd boot manager,](http://www.rodsbooks.com/refind/) which enables switching between EFI-mode and BIOS-mode booting. You'll need to uncomment the `scanfor` option in `refind.conf` and ensure that `hdbios` is among the options. Also, be sure to use the latest version; p... | There are many solutions to this when you Google "Disable Secure Boot UEFI". I usually direct people to the HowToGeek article which gives a lot of details about the Why behind Secure Boot mechanics as well as How.
[How to Boot and Install Linux on a UEFI PC With Secure Boot](http://www.howtogeek.com/175641/how-to-boot... |
759,105 | I have a computer (HP Pavilion g6-2342dx) which came with Windows 8, and thus the new UEFI boot system. I would like to install a few OS's which are not EFI compatible, and Arch GNU/Linux with BIOS mode. However, I would not like to completely wipe all my files to set to legacy. My preferred options would be to:
1. Mul... | 2014/05/27 | [
"https://superuser.com/questions/759105",
"https://superuser.com",
"https://superuser.com/users/293521/"
] | It is possible. I have an option in my BIOS to either boot UEFI first or Legacy first. I have installed Ubuntu in UEFI mode from a USB live disk (first) and Windows 7 not in UEFI (MBR) from a DVD. This has resulted in 2 x 100mb partitions and I can switch OS's via the BIOS.
I found this accidentally but it works.
As ... | There are many solutions to this when you Google "Disable Secure Boot UEFI". I usually direct people to the HowToGeek article which gives a lot of details about the Why behind Secure Boot mechanics as well as How.
[How to Boot and Install Linux on a UEFI PC With Secure Boot](http://www.howtogeek.com/175641/how-to-boot... |
33,543,003 | I want to calculate total number of working days in between two date.
Here we include second and fourth Saturday as working day(i.e all Even Saturdays are considered as Holiday)
I can get the day of the particular date by using below code
```
$day = ‘2015-11-07’;
$dayName = date("l",strtotime($day));
if ($dayName =='... | 2015/11/05 | [
"https://Stackoverflow.com/questions/33543003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259939/"
] | Use list comprehension:
```
[x for x in list1 if x in list2]
```
This returns me this list for your data:
```
[{'count': 351, 'evt_datetime': datetime.datetime(2015, 10, 23, 8, 45), 'att_value': 'red'}, {'count': 359, 'evt_datetime': datetime.datetime(2015, 10, 23, 8, 45), 'att_value': 'red'}]
``` | If order is not important and you don't need to worry about duplicates then you can use set intersection:
```
a = [1,2,3,4,5]
b = [1,3,5,6]
list(set(a) & set(b))
[1, 3, 5]
``` |
33,543,003 | I want to calculate total number of working days in between two date.
Here we include second and fourth Saturday as working day(i.e all Even Saturdays are considered as Holiday)
I can get the day of the particular date by using below code
```
$day = ‘2015-11-07’;
$dayName = date("l",strtotime($day));
if ($dayName =='... | 2015/11/05 | [
"https://Stackoverflow.com/questions/33543003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259939/"
] | The solution below might perform better for large lists but might also need more memory due to the sorting step.
The intersection can either be done over a defined sortKey e.g. 'count' or the the hash of the dictionary will be used as suggested by <https://stackoverflow.com/a/60765557/1497139>. The algorithm sorts the... | If order is not important and you don't need to worry about duplicates then you can use set intersection:
```
a = [1,2,3,4,5]
b = [1,3,5,6]
list(set(a) & set(b))
[1, 3, 5]
``` |
33,543,003 | I want to calculate total number of working days in between two date.
Here we include second and fourth Saturday as working day(i.e all Even Saturdays are considered as Holiday)
I can get the day of the particular date by using below code
```
$day = ‘2015-11-07’;
$dayName = date("l",strtotime($day));
if ($dayName =='... | 2015/11/05 | [
"https://Stackoverflow.com/questions/33543003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/259939/"
] | Use list comprehension:
```
[x for x in list1 if x in list2]
```
This returns me this list for your data:
```
[{'count': 351, 'evt_datetime': datetime.datetime(2015, 10, 23, 8, 45), 'att_value': 'red'}, {'count': 359, 'evt_datetime': datetime.datetime(2015, 10, 23, 8, 45), 'att_value': 'red'}]
``` | The solution below might perform better for large lists but might also need more memory due to the sorting step.
The intersection can either be done over a defined sortKey e.g. 'count' or the the hash of the dictionary will be used as suggested by <https://stackoverflow.com/a/60765557/1497139>. The algorithm sorts the... |
27,158,252 | i'm not to bad at javascript myself but i am wondering for a few days at this moment wheter it's possible or not. And if it is, who can help me ?
*i need to build a single page application , and i am at the early phase.
now one part where i am stuck at the moment is.*
**i wish to load different kind of questions i... | 2014/11/26 | [
"https://Stackoverflow.com/questions/27158252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3436769/"
] | You need to issue AJAX GET request, load text file data, and use response text as a question. Something like this:
```
var request = new XMLHttpRequest();
request.open('GET', 'question.txt', true);
request.onload = function() {
if (request.status >= 200 && request.status < 400){
var Question = request.res... | You just need 1) a list of questions and 2) to reset the canvas when setting a new question:
```
var questionIndex = 0;
var questions = [
"question 1",
"question 2",
"question 3"
];
function nextQuestion() {
var canvas = document.getElementById('myCanvas');
var ctx = canvas.getCont... |
38,240,502 | Good day,
I have a model class like below
```
public class EmployeeModel
{
[Key]
public int employeeId{get;set;}
public string Fullname {get;set;}
public string Address{get;set;}
public ICollection<PaymentModel> Payments {get;set;}
}
public class PaymentModel
{
[K... | 2016/07/07 | [
"https://Stackoverflow.com/questions/38240502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5545309/"
] | it colud be a good alternative
```
var listing = from d in db.Payments
.include("Employees")
.where d.IsPosted == 1
select d.Employees;
```
(not tested, then please fix mistakes)
start from pyaments, filter for is posted=1
, then select related emplyees | Try something like this: It will give you a list of anonymous type that will hold the employee and it's payments.
```
using (dbcontext ctx = new dbcontext())
{
ctx.Connection.Open();
var result = (from e in ctx.Employees
join p in ctx.Payments on e.employeeId equals p.employeeId
... |
38,240,502 | Good day,
I have a model class like below
```
public class EmployeeModel
{
[Key]
public int employeeId{get;set;}
public string Fullname {get;set;}
public string Address{get;set;}
public ICollection<PaymentModel> Payments {get;set;}
}
public class PaymentModel
{
[K... | 2016/07/07 | [
"https://Stackoverflow.com/questions/38240502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5545309/"
] | What are you asking for is not natively supported, so there is no easier way, but for sure there is more efficient way because your current code is performing N + 1 database queries.
A better way could be to retrieve employees and related filtered payments with one database query using anonymous type projection, and t... | it colud be a good alternative
```
var listing = from d in db.Payments
.include("Employees")
.where d.IsPosted == 1
select d.Employees;
```
(not tested, then please fix mistakes)
start from pyaments, filter for is posted=1
, then select related emplyees |
38,240,502 | Good day,
I have a model class like below
```
public class EmployeeModel
{
[Key]
public int employeeId{get;set;}
public string Fullname {get;set;}
public string Address{get;set;}
public ICollection<PaymentModel> Payments {get;set;}
}
public class PaymentModel
{
[K... | 2016/07/07 | [
"https://Stackoverflow.com/questions/38240502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5545309/"
] | What are you asking for is not natively supported, so there is no easier way, but for sure there is more efficient way because your current code is performing N + 1 database queries.
A better way could be to retrieve employees and related filtered payments with one database query using anonymous type projection, and t... | Try something like this: It will give you a list of anonymous type that will hold the employee and it's payments.
```
using (dbcontext ctx = new dbcontext())
{
ctx.Connection.Open();
var result = (from e in ctx.Employees
join p in ctx.Payments on e.employeeId equals p.employeeId
... |
40,473,360 | This is a conceptual question, so I am not providing the "working code" for this reason.
Imagine one has two std::vector of different types and different number of entities, just for example:
```
vector <int> A;
vector <string> B;
```
One has a set of rules following which one can associate any members of A with so... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40473360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152072/"
] | A `std::multiset` of `std::pair`s would be able to map multiple `int*`s to zero or more `std::string*`s:
```
std::multiset < std::pair<int*, std::vector<std::string*>>> map_A_to_B;
```
Example:
```
#include <set>
#include <vector>
#include <string>
#include <utility>
#include <iostream>
int main()
{
std::vecto... | Based on your comment, it seems like you want an actual mapping (as in math, from a set A to a set B) that is general (not one-to-one or onto). First you have to conceptually understand what you want. First, you want a mapping between a class A (say int in your example) to B (string). Let's template this:
```
template... |
40,473,360 | This is a conceptual question, so I am not providing the "working code" for this reason.
Imagine one has two std::vector of different types and different number of entities, just for example:
```
vector <int> A;
vector <string> B;
```
One has a set of rules following which one can associate any members of A with so... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40473360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152072/"
] | A `std::multiset` of `std::pair`s would be able to map multiple `int*`s to zero or more `std::string*`s:
```
std::multiset < std::pair<int*, std::vector<std::string*>>> map_A_to_B;
```
Example:
```
#include <set>
#include <vector>
#include <string>
#include <utility>
#include <iostream>
int main()
{
std::vecto... | You could use Boost to implement a [bidirectional map](http://www.boost.org/doc/libs/1_37_0/libs/multi_index/doc/examples.html) - that would allow you to use either of the values as a key. [Here is an example of how to use it](http://www.boost.org/doc/libs/1_37_0/libs/multi_index/example/bimap.cpp). But, in short: (usa... |
40,473,360 | This is a conceptual question, so I am not providing the "working code" for this reason.
Imagine one has two std::vector of different types and different number of entities, just for example:
```
vector <int> A;
vector <string> B;
```
One has a set of rules following which one can associate any members of A with so... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40473360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152072/"
] | You could implement some *database* techniques: indices. Place your data into a single `vector` then create `std::map` for each way you want to index your data or relate the data.
Rather than 2 vectors, make one vector of structures:
```
struct Datum
{
int value;
string text;
};
// The database
std::vector<Dat... | A `std::multiset` of `std::pair`s would be able to map multiple `int*`s to zero or more `std::string*`s:
```
std::multiset < std::pair<int*, std::vector<std::string*>>> map_A_to_B;
```
Example:
```
#include <set>
#include <vector>
#include <string>
#include <utility>
#include <iostream>
int main()
{
std::vecto... |
40,473,360 | This is a conceptual question, so I am not providing the "working code" for this reason.
Imagine one has two std::vector of different types and different number of entities, just for example:
```
vector <int> A;
vector <string> B;
```
One has a set of rules following which one can associate any members of A with so... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40473360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152072/"
] | You could implement some *database* techniques: indices. Place your data into a single `vector` then create `std::map` for each way you want to index your data or relate the data.
Rather than 2 vectors, make one vector of structures:
```
struct Datum
{
int value;
string text;
};
// The database
std::vector<Dat... | Based on your comment, it seems like you want an actual mapping (as in math, from a set A to a set B) that is general (not one-to-one or onto). First you have to conceptually understand what you want. First, you want a mapping between a class A (say int in your example) to B (string). Let's template this:
```
template... |
40,473,360 | This is a conceptual question, so I am not providing the "working code" for this reason.
Imagine one has two std::vector of different types and different number of entities, just for example:
```
vector <int> A;
vector <string> B;
```
One has a set of rules following which one can associate any members of A with so... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40473360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3152072/"
] | You could implement some *database* techniques: indices. Place your data into a single `vector` then create `std::map` for each way you want to index your data or relate the data.
Rather than 2 vectors, make one vector of structures:
```
struct Datum
{
int value;
string text;
};
// The database
std::vector<Dat... | You could use Boost to implement a [bidirectional map](http://www.boost.org/doc/libs/1_37_0/libs/multi_index/doc/examples.html) - that would allow you to use either of the values as a key. [Here is an example of how to use it](http://www.boost.org/doc/libs/1_37_0/libs/multi_index/example/bimap.cpp). But, in short: (usa... |
16,188,971 | I have a array in java script
```
var aaa = ["school1,100"],["school2,101"],["school3,103"]
```
I want to bind this array to Multiselect Listbox of razor page.
Any one can help me ? | 2013/04/24 | [
"https://Stackoverflow.com/questions/16188971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1498159/"
] | You have to use jQuery for binding Javascript array to the listbox. Below code will help you to bind JS Array to listbox.
**JAVASCRIPT**
```
$(document).ready(function () {
var aaa = ["school1,100", "school2,101", "school3,103"]
for (var i = 0; i < aaa.length; i++) {
$('#listbox').append('<option>' + aaa[... | ```
<select id="listbox" size="5"></select>
```
JS:
```
var select = document.getElementById('listbox');
addOptions(select, aaa);
function addOptions(el, ar){
for(var i = 0; i < ar.length; i++){
var option = document.createElement('option');
option.innerHTML = ar[i];
el.appendChild(optio... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | A concise solution:
```
location.search
.slice(1)
.split('&')
.map(p => p.split('='))
.reduce((obj, pair) => {
const [key, value] = pair.map(decodeURIComponent);
obj[key] = value;
return obj;
}, {});
``` | Using phpjs
```
function parse_str(str, array) {
// discuss at: http://phpjs.org/functions/parse_str/
// original by: Cagri Ekin
// improved by: Michael White (http://getsprink.com)
// improved by: Jack
// improved by: Brett Zamir (http://brett-zamir.me)
// bugfixed by: Onno ... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | Using ES6, URL API and URLSearchParams API.
```
function objectifyQueryString(url) {
let _url = new URL(url);
let _params = new URLSearchParams(_url.search);
let query = Array.from(_params.keys()).reduce((sum, value)=>{
return Object.assign({[value]: _params.get(value)}, sum);
}, {});
return query;
}
``... | Pretty easy using the `URLSearchParams` JavaScript Web API,
```js
var paramsString = "abc=foo&def=%5Basf%5D&xyz=5";
//returns an iterator object
var searchParams = new URLSearchParams(paramsString);
//Usage
for (let p of searchParams) {
console.log(p);
}
//Get the query strings
console.log(searchParams.toString()... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | The proposed solutions I found so far do not cover more complex scenarios.
I needed to convert a query string like
`https://random.url.com?Target=Offer&Method=findAll&filters%5Bhas_goals_enabled%5D%5BTRUE%5D=1&filters%5Bstatus%5D=active&fields%5B%5D=id&fields%5B%5D=name&fields%5B%5D=default_goal_name`
into an objec... | I needed to also deal with `+` in the query part of the URL ([decodeURIComponent doesn't](https://stackoverflow.com/questions/4535288/why-doesnt-decodeuriab-a-b)), so I adapted Wolfgang's code to become:
```
var search = location.search.substring(1);
search = search?JSON.parse('{"' + search.replace(/\+/g, ' ').replac... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | I had the same problem, tried the solutions here, but none of them really worked, since I had arrays in the URL parameters, like this:
```
?param[]=5¶m[]=8&othr_param=abc¶m[]=string
```
So I ended up writing my own JS function, which makes an array out of the param in URI:
```
/**
* Creates an object from ... | Many other solutions don't account for edge cases.
This one handles
* null keys `a=1&b=2&`
* null values `a=1&b`
* empty values `a=1&b=`
* unencoded equals signs `a=1&b=2=3=4`
```js
decodeQueryString: qs => {
// expects qs to not have a ?
// return if empty qs
if (qs === '') return {};
return qs.sp... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | There's a lightweight library called [YouAreI.js](https://github.com/purge/youarei.js) that's tested and makes this really easy.
```
YouAreI = require('YouAreI')
uri = new YouAreI('http://user:pass@www.example.com:3000/a/b/c?d=dad&e=1&f=12.3#fragment');
uri.query_get() => { d: 'dad', e: '1', f: '12.3' }
``` | ```
//under ES6
const getUrlParamAsObject = (url = window.location.href) => {
let searchParams = url.split('?')[1];
const result = {};
//in case the queryString is empty
if (searchParams!==undefined) {
const paramParts = searchParams.split('&');
for(let part of paramParts) {
... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | I found [$.String.deparam](https://github.com/jupiterjs/jquerymx/blob/master/lang/string/deparam/deparam.js) the most complete pre built solution (can do nested objects etc.). Check out the [documentation](http://javascriptmvc.com/docs.html#!jQuery.String.deparam). | Here's one I use:
```
var params = {};
window.location.search.substring(1).split('&').forEach(function(pair) {
pair = pair.split('=');
if (pair[1] !== undefined) {
var key = decodeURIComponent(pair[0]),
val = decodeURIComponent(pair[1]),
val = val ? val.replace(/\++/g,' ').trim() : '';
if ... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | A concise solution:
```
location.search
.slice(1)
.split('&')
.map(p => p.split('='))
.reduce((obj, pair) => {
const [key, value] = pair.map(decodeURIComponent);
obj[key] = value;
return obj;
}, {});
``` | If you are using URI.js, you can use:
<https://medialize.github.io/URI.js/docs.html#static-parseQuery>
```
var result = URI.parseQuery("?foo=bar&hello=world&hello=mars&bam=&yup");
result === {
foo: "bar",
hello: ["world", "mars"],
bam: "",
yup: null
};
``` |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | Here's my quick and dirty version, basically its splitting up the URL parameters separated by '&' into array elements, and then iterates over that array adding key/value pairs separated by '=' into an object. I'm using decodeURIComponent() to translate the encoded characters to their normal string equivalents (so %20 b... | Many other solutions don't account for edge cases.
This one handles
* null keys `a=1&b=2&`
* null values `a=1&b`
* empty values `a=1&b=`
* unencoded equals signs `a=1&b=2=3=4`
```js
decodeQueryString: qs => {
// expects qs to not have a ?
// return if empty qs
if (qs === '') return {};
return qs.sp... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | One simple answer with build in native Node module.(No third party npm modules)
The querystring module provides utilities for parsing and formatting URL query strings. It can be accessed using:
```
const querystring = require('querystring');
const body = "abc=foo&def=%5Basf%5D&xyz=5"
const parseJSON = querystring.pa... | Here is a more-streamlined version of [silicakes' approach](https://stackoverflow.com/a/52539264/1762224).
The following function(s) can parse a querystring from either a [`USVString`](https://developer.mozilla.org/en-US/docs/Web/API/USVString) or [`Location`](https://developer.mozilla.org/en-US/docs/Web/API/Location)... |
8,648,892 | I have a string like this:
```
abc=foo&def=%5Basf%5D&xyz=5
```
How can I convert it into a JavaScript object like this?
```
{
abc: 'foo',
def: '[asf]',
xyz: 5
}
``` | 2011/12/27 | [
"https://Stackoverflow.com/questions/8648892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/376947/"
] | ```js
console.log(decodeURI('abc=foo&def=%5Basf%5D&xyz=5')
.split('&')
.reduce((result, current) => {
const [key, value] = current.split('=');
result[key] = value;
return result
}, {}))
``` | I needed to also deal with `+` in the query part of the URL ([decodeURIComponent doesn't](https://stackoverflow.com/questions/4535288/why-doesnt-decodeuriab-a-b)), so I adapted Wolfgang's code to become:
```
var search = location.search.substring(1);
search = search?JSON.parse('{"' + search.replace(/\+/g, ' ').replac... |
13,418,173 | I want to use jQuery UI on my site. I downloaded custom build, but it didn't work. So I used "full" version from their site. It doesn't work either.
My only code is:
```
$('#gameRelease').datepicker();
```
And what I get is an error in console:
```
Uncaught TypeError: Cannot read property 'fadeIn' of undefined
`... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13418173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1409674/"
] | Silly problem. It turns out, that you have to load jQueryUI right after jQuery. And I loaded it later. | The plugin *Nivo Slider for WordPress* (0.2) loads it's own `jquery.effects.core.js` file, which also makes the datepicker throw the same error.
If disabling the plugin makes the datepickers work, then you have to edit the `nivoslider4wp-show.php` file. Find the line with `<script ... src=".../js/jquery.effects.core.j... |
184,727 | I'm trying to get a list output, but I get integer results.
Is there a way to convert integers to a list?
Here is my code:
```
list = {12, 37, 44, 96};
list2 = IntegerDigits[list];
Do[
list3 = Total[list2[[i]]];
Print[list3];
, {i, 1, Length[list]}]
``` | 2018/10/26 | [
"https://mathematica.stackexchange.com/questions/184727",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/60960/"
] | ```
Total /@ IntegerDigits[list]
```
>
> {3, 10, 8, 15}
>
>
>
Also
```
Total[IntegerDigits[list], {2}] (* thanks: HenrikSchumacher *)
Total[Transpose@IntegerDigits[list]]
FromDigits[#, 1] & /@ IntegerDigits[list]
```
>
> {3, 10, 8, 15}
>
>
> | It does not improve on the previous solutions, but for such manipulations Table is normally enough. For the above lists,
```
Table[Total[list2[[i]]], {i, 1, Length[list]}]
``` |
265,513 | When I clicked on terminal.
It shows this:
```
Last login: Fri Apr 1 17:04:59 on ttys000
-bash: export: /opt/local/bin': not a valid identifier
-bash: export: :/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/usr/local/git/bin:/usr/X11/bin':
```
not a valid identifier
Josh@Macbook-Pro~$ export
I inst... | 2011/04/01 | [
"https://superuser.com/questions/265513",
"https://superuser.com",
"https://superuser.com/users/65071/"
] | The HTTP request is sent from Client to port 8080 of the Proxy Server. The Proxy Server then originates a new HTTP request to the destination site. The proxy, depending on the configuration, will often add a "X-Forwarded-For" header to the HTTP request. The log files on the destination web site will show the proxy's IP... | There's no such thing as "tcp packet". TCP operates with data streams. There are IP packets.
You seem to be lacking some basic knowledge about networking, I suggest you to get a good book about TCP/IP. Everyone's favorite seems to be "TCP/IP illustrated" by W. Richard Stevens.
Back to your question.
A proxy is a mid... |
265,513 | When I clicked on terminal.
It shows this:
```
Last login: Fri Apr 1 17:04:59 on ttys000
-bash: export: /opt/local/bin': not a valid identifier
-bash: export: :/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/usr/local/git/bin:/usr/X11/bin':
```
not a valid identifier
Josh@Macbook-Pro~$ export
I inst... | 2011/04/01 | [
"https://superuser.com/questions/265513",
"https://superuser.com",
"https://superuser.com/users/65071/"
] | The HTTP request is sent from Client to port 8080 of the Proxy Server. The Proxy Server then originates a new HTTP request to the destination site. The proxy, depending on the configuration, will often add a "X-Forwarded-For" header to the HTTP request. The log files on the destination web site will show the proxy's IP... | HTTP is a Layer 7 protocol so dont get confuse. when you use a HTTP proxy and you type say google.com , the HTTP header still same google.com, but the destination IP address will be IP address of the Proxy, source will be Hosts IP to the customized port number 8080. |
265,513 | When I clicked on terminal.
It shows this:
```
Last login: Fri Apr 1 17:04:59 on ttys000
-bash: export: /opt/local/bin': not a valid identifier
-bash: export: :/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/usr/local/git/bin:/usr/X11/bin':
```
not a valid identifier
Josh@Macbook-Pro~$ export
I inst... | 2011/04/01 | [
"https://superuser.com/questions/265513",
"https://superuser.com",
"https://superuser.com/users/65071/"
] | The HTTP request is sent from Client to port 8080 of the Proxy Server. The Proxy Server then originates a new HTTP request to the destination site. The proxy, depending on the configuration, will often add a "X-Forwarded-For" header to the HTTP request. The log files on the destination web site will show the proxy's IP... | To use an HTTP proxy, the request is sent from the client to the proxy server's IP address rather than to the destination server. **The proxy must then read the HTTP header** to extract the *request-URI*. The request-URI includes the name or IP of the destination server, and the proxy server uses that information to fo... |
265,513 | When I clicked on terminal.
It shows this:
```
Last login: Fri Apr 1 17:04:59 on ttys000
-bash: export: /opt/local/bin': not a valid identifier
-bash: export: :/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/usr/local/git/bin:/usr/X11/bin':
```
not a valid identifier
Josh@Macbook-Pro~$ export
I inst... | 2011/04/01 | [
"https://superuser.com/questions/265513",
"https://superuser.com",
"https://superuser.com/users/65071/"
] | HTTP is a Layer 7 protocol so dont get confuse. when you use a HTTP proxy and you type say google.com , the HTTP header still same google.com, but the destination IP address will be IP address of the Proxy, source will be Hosts IP to the customized port number 8080. | There's no such thing as "tcp packet". TCP operates with data streams. There are IP packets.
You seem to be lacking some basic knowledge about networking, I suggest you to get a good book about TCP/IP. Everyone's favorite seems to be "TCP/IP illustrated" by W. Richard Stevens.
Back to your question.
A proxy is a mid... |
265,513 | When I clicked on terminal.
It shows this:
```
Last login: Fri Apr 1 17:04:59 on ttys000
-bash: export: /opt/local/bin': not a valid identifier
-bash: export: :/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/usr/local/git/bin:/usr/X11/bin':
```
not a valid identifier
Josh@Macbook-Pro~$ export
I inst... | 2011/04/01 | [
"https://superuser.com/questions/265513",
"https://superuser.com",
"https://superuser.com/users/65071/"
] | To use an HTTP proxy, the request is sent from the client to the proxy server's IP address rather than to the destination server. **The proxy must then read the HTTP header** to extract the *request-URI*. The request-URI includes the name or IP of the destination server, and the proxy server uses that information to fo... | There's no such thing as "tcp packet". TCP operates with data streams. There are IP packets.
You seem to be lacking some basic knowledge about networking, I suggest you to get a good book about TCP/IP. Everyone's favorite seems to be "TCP/IP illustrated" by W. Richard Stevens.
Back to your question.
A proxy is a mid... |
265,513 | When I clicked on terminal.
It shows this:
```
Last login: Fri Apr 1 17:04:59 on ttys000
-bash: export: /opt/local/bin': not a valid identifier
-bash: export: :/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/bin:/usr/local/git/bin:/usr/X11/bin':
```
not a valid identifier
Josh@Macbook-Pro~$ export
I inst... | 2011/04/01 | [
"https://superuser.com/questions/265513",
"https://superuser.com",
"https://superuser.com/users/65071/"
] | HTTP is a Layer 7 protocol so dont get confuse. when you use a HTTP proxy and you type say google.com , the HTTP header still same google.com, but the destination IP address will be IP address of the Proxy, source will be Hosts IP to the customized port number 8080. | To use an HTTP proxy, the request is sent from the client to the proxy server's IP address rather than to the destination server. **The proxy must then read the HTTP header** to extract the *request-URI*. The request-URI includes the name or IP of the destination server, and the proxy server uses that information to fo... |
42,761,862 | I use asp.net MVC model binding to accept the parameters for ajax.
I have an object, it's data structure like this:
```
{
"conditions": [
{
"field": "",
"opreator": "",
"value": ""
},[{
"field": "",
"opreator": "",
"value": ""
}... | 2017/03/13 | [
"https://Stackoverflow.com/questions/42761862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5954068/"
] | This can be achieved with a simple linear step combined with a for-loop.
```js
var stop = 5, step = 20;
for (var i = 0, min = 0, max = step; i < stop; i++, min+=step, max+=step) {
console.log(i, min, max);
}
```
```css
.as-console-wrapper { top: 0; max-height: 100% !important; }
```
If you do not want to create... | ```js
var res = [0, 1, 2, 3, 4].map(function (e) { return [e * 20, e * 20 + 20]; });
console.log(res);
```
**Edit:** let **N** be a arbitrary number which defines desired array size.
```js
var N = 10;
var res = new Array(N).fill(0).map(function (e, i) { return [i * 20, i * 20 + 20]; });
console.log(res);
``` |
42,761,862 | I use asp.net MVC model binding to accept the parameters for ajax.
I have an object, it's data structure like this:
```
{
"conditions": [
{
"field": "",
"opreator": "",
"value": ""
},[{
"field": "",
"opreator": "",
"value": ""
}... | 2017/03/13 | [
"https://Stackoverflow.com/questions/42761862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5954068/"
] | This can be achieved with a simple linear step combined with a for-loop.
```js
var stop = 5, step = 20;
for (var i = 0, min = 0, max = step; i < stop; i++, min+=step, max+=step) {
console.log(i, min, max);
}
```
```css
.as-console-wrapper { top: 0; max-height: 100% !important; }
```
If you do not want to create... | You can use `map` to achieve this one, returning an array for min max.
```js
const data = [0,1,2,3,4,5]
function minMax(index) {
return [index * 20, (index * 20) + 20]
}
const out = data.map(minMax)
console.log(out)
``` |
14,010,665 | What I'd like to achieve is a pulsate effect on an action (button click for example). So what I made is this (simplified [removed browser specifics]):
```
@keyframes pulse {
0% {transform: scale(1);}
50% {transform: scale(1.02);}
100% {transform: scale(1);}
}
.pulsate{
animation-name: pulse 0.2s linear 2;
}
... | 2012/12/23 | [
"https://Stackoverflow.com/questions/14010665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/484025/"
] | This is the solution to my problem. As @Aspiring Aqib pointed out I needed a delay between adding and removing the Class. He used a delay() jquery but it was not working.
Here is my solution using setTimeout();
```
$('#some_element').addClass('pulsate');
setTimeout(function(){
$('#some_element').removeClass('puls... | `ToggleClass()` did not worked because when you clicked it first time then it added the class and the animation played . When you clicked the second time it removed that class and this time, class is removed thats why it does not plays animation. On third time, it works like first time and this process will continue :/... |
2,778,270 | If $X$ is a set, $\{X\_i\}$ a family of topological spaces and for each $i\in I$ there is a map $f\_i:X\_i\rightarrow X$, then one can define a topology on $X$ which is the finest topology for which the maps $f\_i$ are all continuous. Sucha topology is the final topology. According to Bourbaki (and also to [Wiki](https... | 2018/05/12 | [
"https://math.stackexchange.com/questions/2778270",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/415701/"
] | There is a problem with the sentence “Clearly $f^{-1}\_i(U)$ cannot be open in $X\_i$, since the operation $f^{-1}\_i(U)$ is not defined for at least one index in $I$.” For *each* $U\subset Y$ and *each* $i\in I$, it makes sense to talk about $f\_i^{-1}(U)$, since it is defined as $\left\{x\in X\,\middle|\,f(x)\in U\ri... | $f^{-1}[U\_i]$ is **always** defined, namely as $\{x\in X\_i: f\_i(x) \in U\_i\}$. This might be empty (or even $X\_i$) depending on $U\_i$.
Example: suppose $f: X \to Y$ is a constant map with value $p \in Y$. Then
$f^{-1}[O]=\emptyset$ when $p\notin O$ and $f^{-1}[O] = X$ when $p\in O$. So open in $X$ always, rega... |
7,871,368 | I want to know why `id` is a weak reference pointer,how it is able to handle any `class` type pointer and at run time how can we detect that which type of class pointer is assigned to `id`. | 2011/10/24 | [
"https://Stackoverflow.com/questions/7871368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/299797/"
] | >
> Why is id a weak reference pointer?
>
>
>
`id` is not a weak reference pointer, at least not in the ARC ownership sense. Whether an `id`-typed reference to an object is weak or not depends on the reference having been declared `__weak` (and variations) and the object’s class actually supporting weak references... | It's nice to have a generic object type, so you can define collection types that can hold any kind of object, and other generic services that work with any object without knowing what kind of object it is.
There is no trick to make id work. At a binary level all pointers are interchangeable. They just represent a memo... |
7,871,368 | I want to know why `id` is a weak reference pointer,how it is able to handle any `class` type pointer and at run time how can we detect that which type of class pointer is assigned to `id`. | 2011/10/24 | [
"https://Stackoverflow.com/questions/7871368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/299797/"
] | >
> Why is id a weak reference pointer?
>
>
>
`id` is not a weak reference pointer, at least not in the ARC ownership sense. Whether an `id`-typed reference to an object is weak or not depends on the reference having been declared `__weak` (and variations) and the object’s class actually supporting weak references... | It may be worth to take a look on header file objc/objc.h to find internals of `id`.
```
typedef struct objc_class *Class;
typedef struct objc_object {
Class isa;
} *id;
typedef struct objc_selector *SEL;
typedef id (*IMP)(id, SEL, ...);
``` |
7,871,368 | I want to know why `id` is a weak reference pointer,how it is able to handle any `class` type pointer and at run time how can we detect that which type of class pointer is assigned to `id`. | 2011/10/24 | [
"https://Stackoverflow.com/questions/7871368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/299797/"
] | It's nice to have a generic object type, so you can define collection types that can hold any kind of object, and other generic services that work with any object without knowing what kind of object it is.
There is no trick to make id work. At a binary level all pointers are interchangeable. They just represent a memo... | It may be worth to take a look on header file objc/objc.h to find internals of `id`.
```
typedef struct objc_class *Class;
typedef struct objc_object {
Class isa;
} *id;
typedef struct objc_selector *SEL;
typedef id (*IMP)(id, SEL, ...);
``` |
1,518,379 | I'm getting this error (Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.) when trying to run a stored procedure from C# on a SQL Server 2005 database. I'm not actively/purposefully using transactions or anything, which is what makes this error weird. I can run ... | 2009/10/05 | [
"https://Stackoverflow.com/questions/1518379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184155/"
] | It sounds like there is a `TransactionScope` somewhere that is unhappy. The `_DBManager.CheckConnection` and `_DBManager.SqlConnection` sounds like you are keeping a `SqlConnection` hanging around, which I expect will contribute to this.
To be honest, in *most* common cases you are better off just using the inbuilt co... | From the code it seems that you are utilizing an already opened connection. May be there's a transaction pending previously on the same connection. |
51,394,716 | i don't know why this program is not working on my computer while other PC does
so when i want to running this program it gives one error is given below,
so try to hep for fix it...
**index.js**
```
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter, Route} from 'react-ro... | 2018/07/18 | [
"https://Stackoverflow.com/questions/51394716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10097453/"
] | It is there, just needs a bit of digging :-)
[This page](https://datatables.net/manual/server-side) details the sent parameters and the returned data. The DataTable sends some data when using server-side processing and expects the returned data to be in a specific format - both of which are detailed in that page far b... | DataTables has the ability to read data from virtually any JSON data source that can be obtained by Ajax. <https://datatables.net/examples/data_sources/ajax> |
35,729,053 | I'm going through a SQL tutorial, and came across this question.
I've been stuck for sometime.
**Customers**
```
id INTEGER PRIMARY KEY
lastname VARCHAR
firstname VARCHAR
```
**Purchases**
```
id INTEGER PRIMARY KEY
customers_id INTEGER FOREIGN KEY customers(id)
purchasedate DATETIME
purchaseam... | 2016/03/01 | [
"https://Stackoverflow.com/questions/35729053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2891803/"
] | Yeah, or to avoid the whole `distinct` business you could write
```
SELECT id, LastName, firstname FROM Customers
WHERE EXISTS ( SELECT 1 FROM Purchases
WHERE customers_id=Customers.id
AND MONTH(purchasedate)=2 AND YEAR(purchasedate)=2016 )
``` | Your query will return a list with duplicates name. Just add `DISTINCT`
Dont use `*`, just include the fields your require.
Also include the `id`, just in case two ppl has same first and last name
```
SELECT DISTINCT Customers.id, Customers.LastName, Customers.firstname
from Purchases
inner join Customers
on Purc... |
35,729,053 | I'm going through a SQL tutorial, and came across this question.
I've been stuck for sometime.
**Customers**
```
id INTEGER PRIMARY KEY
lastname VARCHAR
firstname VARCHAR
```
**Purchases**
```
id INTEGER PRIMARY KEY
customers_id INTEGER FOREIGN KEY customers(id)
purchasedate DATETIME
purchaseam... | 2016/03/01 | [
"https://Stackoverflow.com/questions/35729053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2891803/"
] | I will go with `EXISTS` which will avoid duplicate
```
SELECT Customers.id,
Customers.LastName,
Customers.firstname
FROM Customers
WHERE EXISTS (SELECT 1
FROM Purchases
WHERE Purchases.customers_id = Customers.id
AND Month(purchasedate) = 2)
``... | Your query will return a list with duplicates name. Just add `DISTINCT`
Dont use `*`, just include the fields your require.
Also include the `id`, just in case two ppl has same first and last name
```
SELECT DISTINCT Customers.id, Customers.LastName, Customers.firstname
from Purchases
inner join Customers
on Purc... |
35,729,053 | I'm going through a SQL tutorial, and came across this question.
I've been stuck for sometime.
**Customers**
```
id INTEGER PRIMARY KEY
lastname VARCHAR
firstname VARCHAR
```
**Purchases**
```
id INTEGER PRIMARY KEY
customers_id INTEGER FOREIGN KEY customers(id)
purchasedate DATETIME
purchaseam... | 2016/03/01 | [
"https://Stackoverflow.com/questions/35729053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2891803/"
] | Yeah, or to avoid the whole `distinct` business you could write
```
SELECT id, LastName, firstname FROM Customers
WHERE EXISTS ( SELECT 1 FROM Purchases
WHERE customers_id=Customers.id
AND MONTH(purchasedate)=2 AND YEAR(purchasedate)=2016 )
``` | I will go with `EXISTS` which will avoid duplicate
```
SELECT Customers.id,
Customers.LastName,
Customers.firstname
FROM Customers
WHERE EXISTS (SELECT 1
FROM Purchases
WHERE Purchases.customers_id = Customers.id
AND Month(purchasedate) = 2)
``... |
40,751,826 | I've always known to import my `Observable` operators separately to limit the load times. However I've noticed something today that I hope someone could please explain to me.
I am using IntelliJ/WebStorm with Webpack.
Let's say on a page in my `ngOnInit` I have an http call:
```
ngOnInit() {
this.http.get... | 2016/11/22 | [
"https://Stackoverflow.com/questions/40751826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2275792/"
] | Why not have a file(ex: rxjs-extensions.ts) with your required rxjs observable class extensions and operators?
```
// Observable class extensions
import 'rxjs/add/observable/throw';
// Observable operators
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
```
And then... | You can use all operators by using this:
```
import * as Rx from "rxjs/Rx";
Rx.Observable.of(1,2,3,4,5);
``` |
40,751,826 | I've always known to import my `Observable` operators separately to limit the load times. However I've noticed something today that I hope someone could please explain to me.
I am using IntelliJ/WebStorm with Webpack.
Let's say on a page in my `ngOnInit` I have an http call:
```
ngOnInit() {
this.http.get... | 2016/11/22 | [
"https://Stackoverflow.com/questions/40751826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2275792/"
] | Why not have a file(ex: rxjs-extensions.ts) with your required rxjs observable class extensions and operators?
```
// Observable class extensions
import 'rxjs/add/observable/throw';
// Observable operators
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
```
And then... | Starting from WebStorm 2016.3 (I believe), you have an option to blacklist certain imports. `Editor > Code Style > StypeScript`
```
Do not import exactly from: [rxjs]
```
Additionally, there is a flag available in tslint to prohibit global imports:
```
{
"rules": {
"import-blacklist": [true, "rxjs"]
}
}
``... |
40,751,826 | I've always known to import my `Observable` operators separately to limit the load times. However I've noticed something today that I hope someone could please explain to me.
I am using IntelliJ/WebStorm with Webpack.
Let's say on a page in my `ngOnInit` I have an http call:
```
ngOnInit() {
this.http.get... | 2016/11/22 | [
"https://Stackoverflow.com/questions/40751826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2275792/"
] | Starting from WebStorm 2016.3 (I believe), you have an option to blacklist certain imports. `Editor > Code Style > StypeScript`
```
Do not import exactly from: [rxjs]
```
Additionally, there is a flag available in tslint to prohibit global imports:
```
{
"rules": {
"import-blacklist": [true, "rxjs"]
}
}
``... | You can use all operators by using this:
```
import * as Rx from "rxjs/Rx";
Rx.Observable.of(1,2,3,4,5);
``` |
19,640,681 | In this case `hours_start` will be 08:00:00 and `hours_end` will be 14:00:00
here's the code i'm using to generate a list of 30 minute time slots between start and end
```
while($row = $q->fetch()){
$hours = $row['hours_end'] - $row['hours_start']; //amount of hours working in day
for($i = 0; $i < $hours * 2;... | 2013/10/28 | [
"https://Stackoverflow.com/questions/19640681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2391454/"
] | Its because you are setting `$timeslot` using `h` which is only a 12 hour format without appending `am` or `pm`. Then taking that 12 hour format and running it through `strtotime` which expects 24 hour format if am or pm is not present. Hence anything after 12 becomes am again.
You need to use:
```
$timeslot = date('... | Your date format is using `h` instead of `H`. The lowercase `h` is [12 hour format](http://php.net/manual/en/function.date.php)
Use a capital `H` instead for 24 hours.
```
date('H:i A', strtotime($timeslot))
``` |
25,216,786 | I want to implement a screen layout as shown below, with a Scrollview at the top of the screen, and a block of 2 buttons which are fixed at the bottom of the screen. I also want the buttons to occupy a fixed proportion of the screen width, and have used weights in a horizontal layout to achieve this.
 method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds?
```
public class GenericClassUtil {
... | 2014/08/18 | [
"https://Stackoverflow.com/questions/25359358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1625596/"
] | Create an Interface and extend `Easel`, `Cat`, `Dog` class to that interface.
```
public static <T extends ThatInterface> workWithRealTypeAttr(T objectClass) {
//here get access to values of Easel, Cat, Dog or some other class
}
```
[Ref:](http://docs.oracle.com/javase/tutorial/java/generics/bounded.html)
>
> The... | Although it's not elegant you could use construction as below. You can try using instanceof and casting.
```
public static <T> workWithRealTypeAttr(T objectClass) {
if (objectClass instanceof Easel) {
((Easel) objectClass).toSomehtingEaselsDo());
} elseif (objectClass instanceof Cat) {
((Cat) ... |
25,359,358 | I have a question around the topic Generics in Java:
Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds?
```
public class GenericClassUtil {
... | 2014/08/18 | [
"https://Stackoverflow.com/questions/25359358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1625596/"
] | >
> I want to have access to certain method/fields of the real class
>
>
>
If you want to access method/fields of the real class then use different **overloaded methods**
```
class GenericClassUtil {
public static void workWithRealTypeAttr(Bird objectClass) {
// call a method specific to Bird (Ease... | Although it's not elegant you could use construction as below. You can try using instanceof and casting.
```
public static <T> workWithRealTypeAttr(T objectClass) {
if (objectClass instanceof Easel) {
((Easel) objectClass).toSomehtingEaselsDo());
} elseif (objectClass instanceof Cat) {
((Cat) ... |
25,359,358 | I have a question around the topic Generics in Java:
Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds?
```
public class GenericClassUtil {
... | 2014/08/18 | [
"https://Stackoverflow.com/questions/25359358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1625596/"
] | Create an Interface and extend `Easel`, `Cat`, `Dog` class to that interface.
```
public static <T extends ThatInterface> workWithRealTypeAttr(T objectClass) {
//here get access to values of Easel, Cat, Dog or some other class
}
```
[Ref:](http://docs.oracle.com/javase/tutorial/java/generics/bounded.html)
>
> The... | >
> I want to have access to certain method/fields of the real class
>
>
>
If you want to access method/fields of the real class then use different **overloaded methods**
```
class GenericClassUtil {
public static void workWithRealTypeAttr(Bird objectClass) {
// call a method specific to Bird (Ease... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.