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
32,665,658
I am using a subclassed UINavigationController which manages all the viewControllers in my app. It pushes and pops viewControllers in the main flow and presents and dismisses modally those viewControllers which are required arbitrarily. In one case, I need to present a viewController modally before popping another in ...
2015/09/19
[ "https://Stackoverflow.com/questions/32665658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043580/" ]
Wrapping the popViewController call in an `dispatch_async` block worked. ``` [self presentViewController:searchVC animated:YES completion:^{ dispatch_async(dispatch_get_main_queue(), ^{ [self popViewControllerAnimated:YES]; }); }]; ```
If you're using split view controller, try removing it.
3,704,610
I'm using Sunspot Solr search, which works fine for the most part for basic search. It's supposed to be able to handle quotation marks around phrases, so that a search for `test case` will return documents with both test and case, whereas a search for `"test case"` should return documents with the phrase test case. Ho...
2010/09/13
[ "https://Stackoverflow.com/questions/3704610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257611/" ]
You can pass a `Proc` object to `config.action_controller.asset_host` and have it determine the result programmatically at runtime. ``` config.action_controller.asset_host = Proc.new do |source| case source when /^\/(images|videos|audios)/ "http://mybucket.s3.amazonaws.com" else "http://mydomain.com" e...
There's nothing stopping you from passing full url to `image_tag`: `image_tag("#{IMAGE_ROOT}/icon.png")`. But to me moving static images (icons, backgrounds, etc) to S3 and leaving stylesheets/js files on rails sounds kinda inconsistent. You could either move them all to S3 or setup Apache for caching (if you're afrai...
35,948,556
Are there any good tutorials or books to get started with Cordova? I have already visited the official website but I didn't think the documentation they have is a good starting point.
2016/03/11
[ "https://Stackoverflow.com/questions/35948556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6030569/" ]
I suggest you to choose a framework for hybrid mobile development. I use [`ionic`](http://ionicframework.com/) framework, which has a lot of powerful components and tools. Also `ionic` is built on the top of the **AngularJS**. In addition, there are a lot of good examples and tutorials for ionic development. See [de...
I´m not completely sure that this is the right forum for you but start out with the following: 1. [Get started fast by Apache Cordova](https://cordova.apache.org/#getstarted) 2. Take a look at NetBeans [Getting Started with Cordova Applications](https://netbeans.org/kb/docs/webclient/cordova-gettingstarted.html) 3. Ta...
35,948,556
Are there any good tutorials or books to get started with Cordova? I have already visited the official website but I didn't think the documentation they have is a good starting point.
2016/03/11
[ "https://Stackoverflow.com/questions/35948556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6030569/" ]
I´m not completely sure that this is the right forum for you but start out with the following: 1. [Get started fast by Apache Cordova](https://cordova.apache.org/#getstarted) 2. Take a look at NetBeans [Getting Started with Cordova Applications](https://netbeans.org/kb/docs/webclient/cordova-gettingstarted.html) 3. Ta...
As vahid najafi, I recommend you to use a Framework, there is other good framework for mobile applications called Lugo, <http://lungo.tapquo.com/>
35,948,556
Are there any good tutorials or books to get started with Cordova? I have already visited the official website but I didn't think the documentation they have is a good starting point.
2016/03/11
[ "https://Stackoverflow.com/questions/35948556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6030569/" ]
I suggest you to choose a framework for hybrid mobile development. I use [`ionic`](http://ionicframework.com/) framework, which has a lot of powerful components and tools. Also `ionic` is built on the top of the **AngularJS**. In addition, there are a lot of good examples and tutorials for ionic development. See [de...
As vahid najafi, I recommend you to use a Framework, there is other good framework for mobile applications called Lugo, <http://lungo.tapquo.com/>
31,084,163
Does `int myarray[7][7]` not create a box with 8x8 locations of 0-7 rows and columns in C++? When I run: ``` int board[7][7] = {0}; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cout << board[i][j] << " "; } cout << endl; } ``` I get output: ``` 0 0 0 0 0 0 0 0 0...
2015/06/27
[ "https://Stackoverflow.com/questions/31084163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089899/" ]
Two dimensional arrays are not different to the one dimensional ones in this regard: Just as ``` int a[7]; ``` can be indexed from 0 to 6, ``` int a2[7][7]; ``` can be indexed from 0 to 6 in both dimensions, index 7 is out of bounds. In particular: `a2` has 7 columns and rows, not 8.
`int board[7][7];` will only allocate 7x7, not 8x8. When it's allocated, you specify how many, but indexes start at 0 and run to the size - 1. So based on your source, I would say you really want `int board[8][8]`.
31,084,163
Does `int myarray[7][7]` not create a box with 8x8 locations of 0-7 rows and columns in C++? When I run: ``` int board[7][7] = {0}; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cout << board[i][j] << " "; } cout << endl; } ``` I get output: ``` 0 0 0 0 0 0 0 0 0...
2015/06/27
[ "https://Stackoverflow.com/questions/31084163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089899/" ]
`int board[7][7];` will only allocate 7x7, not 8x8. When it's allocated, you specify how many, but indexes start at 0 and run to the size - 1. So based on your source, I would say you really want `int board[8][8]`.
Araay starts from zero means that it will have n-1 elements not n+1 elements try ``` int a[8][8] = {} i = 0 j = 0 for(i=0;i<8;i++) { for(j=0;j<8;j++) { a[i][j] = 0; } } ```
31,084,163
Does `int myarray[7][7]` not create a box with 8x8 locations of 0-7 rows and columns in C++? When I run: ``` int board[7][7] = {0}; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cout << board[i][j] << " "; } cout << endl; } ``` I get output: ``` 0 0 0 0 0 0 0 0 0...
2015/06/27
[ "https://Stackoverflow.com/questions/31084163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089899/" ]
Two dimensional arrays are not different to the one dimensional ones in this regard: Just as ``` int a[7]; ``` can be indexed from 0 to 6, ``` int a2[7][7]; ``` can be indexed from 0 to 6 in both dimensions, index 7 is out of bounds. In particular: `a2` has 7 columns and rows, not 8.
`int board[7][7] = {0};` creates a 7x7 array. You are going out of bounds in your loop. Change it to `int board[8][8] = {0};`
31,084,163
Does `int myarray[7][7]` not create a box with 8x8 locations of 0-7 rows and columns in C++? When I run: ``` int board[7][7] = {0}; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cout << board[i][j] << " "; } cout << endl; } ``` I get output: ``` 0 0 0 0 0 0 0 0 0...
2015/06/27
[ "https://Stackoverflow.com/questions/31084163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089899/" ]
`int board[7][7] = {0};` creates a 7x7 array. You are going out of bounds in your loop. Change it to `int board[8][8] = {0};`
Araay starts from zero means that it will have n-1 elements not n+1 elements try ``` int a[8][8] = {} i = 0 j = 0 for(i=0;i<8;i++) { for(j=0;j<8;j++) { a[i][j] = 0; } } ```
31,084,163
Does `int myarray[7][7]` not create a box with 8x8 locations of 0-7 rows and columns in C++? When I run: ``` int board[7][7] = {0}; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cout << board[i][j] << " "; } cout << endl; } ``` I get output: ``` 0 0 0 0 0 0 0 0 0...
2015/06/27
[ "https://Stackoverflow.com/questions/31084163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089899/" ]
Two dimensional arrays are not different to the one dimensional ones in this regard: Just as ``` int a[7]; ``` can be indexed from 0 to 6, ``` int a2[7][7]; ``` can be indexed from 0 to 6 in both dimensions, index 7 is out of bounds. In particular: `a2` has 7 columns and rows, not 8.
``` int board[8][7] = {0}; ``` When you do as above, you created only 8 rows and 7 columns. So your loop condition should be as follows: ``` for (int i = 0; i < 8; i++) { for (int j = 0; j < 7; j++) { ``` If you try as follows system will print garbage values from 8th columns ``` for (int i = 0; i...
31,084,163
Does `int myarray[7][7]` not create a box with 8x8 locations of 0-7 rows and columns in C++? When I run: ``` int board[7][7] = {0}; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cout << board[i][j] << " "; } cout << endl; } ``` I get output: ``` 0 0 0 0 0 0 0 0 0...
2015/06/27
[ "https://Stackoverflow.com/questions/31084163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089899/" ]
Two dimensional arrays are not different to the one dimensional ones in this regard: Just as ``` int a[7]; ``` can be indexed from 0 to 6, ``` int a2[7][7]; ``` can be indexed from 0 to 6 in both dimensions, index 7 is out of bounds. In particular: `a2` has 7 columns and rows, not 8.
Araay starts from zero means that it will have n-1 elements not n+1 elements try ``` int a[8][8] = {} i = 0 j = 0 for(i=0;i<8;i++) { for(j=0;j<8;j++) { a[i][j] = 0; } } ```
31,084,163
Does `int myarray[7][7]` not create a box with 8x8 locations of 0-7 rows and columns in C++? When I run: ``` int board[7][7] = {0}; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cout << board[i][j] << " "; } cout << endl; } ``` I get output: ``` 0 0 0 0 0 0 0 0 0...
2015/06/27
[ "https://Stackoverflow.com/questions/31084163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089899/" ]
``` int board[8][7] = {0}; ``` When you do as above, you created only 8 rows and 7 columns. So your loop condition should be as follows: ``` for (int i = 0; i < 8; i++) { for (int j = 0; j < 7; j++) { ``` If you try as follows system will print garbage values from 8th columns ``` for (int i = 0; i...
Araay starts from zero means that it will have n-1 elements not n+1 elements try ``` int a[8][8] = {} i = 0 j = 0 for(i=0;i<8;i++) { for(j=0;j<8;j++) { a[i][j] = 0; } } ```
40,233,429
My Table is ``` +-----+----+----+------+ |EmpID|Name|Dept|Deptno| +-----+----+----+------+ |1 |Abc |xyz |10 | |1 |Abc |xyz |10 | |2 |Def |pqr |20 | +-----+----+----+------+ ``` I want the output table as ``` +-----+----+----+------+ |EmpID|Name|Dept|Deptno| +-----+----+----+------+ |1 |Abc |xy...
2016/10/25
[ "https://Stackoverflow.com/questions/40233429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5757710/" ]
Use `CTE` + `ROW_NUMBER` to delete the duplicates alone ``` ;WITH cte AS (SELECT Row_number()OVER(partition BY EmpId, Name, Email, Deptno ORDER BY (SELECT NULL)) AS rn,* FROM table_name) DELETE FROM cte WHERE rn > 1 ``` I think you can keep only `EmpId` in `Partition BY`
Apply Below 3 Query For Your Problem. 1.) ALTER TABLE dbo.test ADD AUTOID INT IDENTITY(1,1) 2.) SELECT \* FROM dbo.test WHERE AUTOID NOT IN (SELECT MIN(AUTOID) \_ FROM dbo.test GROUP BY EmpId,Name,dept,Deptno) 3.) DELETE FROM dbo.test WHERE AUTOID NOT IN (SELECT MIN(AUTOID) \_ FROM dbo.test GROUP BY EmpId,Name,dep...
40,233,429
My Table is ``` +-----+----+----+------+ |EmpID|Name|Dept|Deptno| +-----+----+----+------+ |1 |Abc |xyz |10 | |1 |Abc |xyz |10 | |2 |Def |pqr |20 | +-----+----+----+------+ ``` I want the output table as ``` +-----+----+----+------+ |EmpID|Name|Dept|Deptno| +-----+----+----+------+ |1 |Abc |xy...
2016/10/25
[ "https://Stackoverflow.com/questions/40233429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5757710/" ]
``` WITH CTE AS ( SELECT EmpID,Name,Dept,Deptno, RN = ROW_NUMBER()OVER(PARTITION BY EmpID,Name,Dept,Deptno ORDER BY EmpID,Name,Dept,Deptno) FROM MyTable ) DELETE FROM CTE WHERE RN > 1 ```
Apply Below 3 Query For Your Problem. 1.) ALTER TABLE dbo.test ADD AUTOID INT IDENTITY(1,1) 2.) SELECT \* FROM dbo.test WHERE AUTOID NOT IN (SELECT MIN(AUTOID) \_ FROM dbo.test GROUP BY EmpId,Name,dept,Deptno) 3.) DELETE FROM dbo.test WHERE AUTOID NOT IN (SELECT MIN(AUTOID) \_ FROM dbo.test GROUP BY EmpId,Name,dep...
39,292,424
I can't figure out how to reference a Swift VC from an Objective C VC in a mixed language project. Here is Objective C code: ``` #import "NamesVC." ... ([segue.identifier isEqualToString:@"peopleSegue"]){ NamesVC *vc = segue.destinationViewController; vc.selEntity = @"People"; vc.de...
2016/09/02
[ "https://Stackoverflow.com/questions/39292424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3133055/" ]
Import `ProjectModuleName-swift.h` header inside your `.m` file where you want to access Swift controller like this. ``` #import "ProjectModuleName-Swift.h" ``` After that you are able to access `NamesVC` inside your Objective c `ViewController`. For more about this read Apple [documentation](https://developer.app...
**Importing Swift into Objective-C** > > You should import the Swift code from that target into any Objective-C .m file within that target using this syntax and substituting the appropriate name: > > > ``` #import "NamesVC.h" ```
39,292,424
I can't figure out how to reference a Swift VC from an Objective C VC in a mixed language project. Here is Objective C code: ``` #import "NamesVC." ... ([segue.identifier isEqualToString:@"peopleSegue"]){ NamesVC *vc = segue.destinationViewController; vc.selEntity = @"People"; vc.de...
2016/09/02
[ "https://Stackoverflow.com/questions/39292424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3133055/" ]
Import `ProjectModuleName-swift.h` header inside your `.m` file where you want to access Swift controller like this. ``` #import "ProjectModuleName-Swift.h" ``` After that you are able to access `NamesVC` inside your Objective c `ViewController`. For more about this read Apple [documentation](https://developer.app...
For anyone not finding a solution changing ``` "MyApp-Swift.h" to <MyApp-Swift.h> ``` in my objective c .m file that I wanted to reference my swift class
39,292,424
I can't figure out how to reference a Swift VC from an Objective C VC in a mixed language project. Here is Objective C code: ``` #import "NamesVC." ... ([segue.identifier isEqualToString:@"peopleSegue"]){ NamesVC *vc = segue.destinationViewController; vc.selEntity = @"People"; vc.de...
2016/09/02
[ "https://Stackoverflow.com/questions/39292424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3133055/" ]
For anyone not finding a solution changing ``` "MyApp-Swift.h" to <MyApp-Swift.h> ``` in my objective c .m file that I wanted to reference my swift class
**Importing Swift into Objective-C** > > You should import the Swift code from that target into any Objective-C .m file within that target using this syntax and substituting the appropriate name: > > > ``` #import "NamesVC.h" ```
5,671
I am working on hand tool skills and building a workbench. The Paul Sellers workbench that he has videos of on youtube. I find that as I am chopping my mortises my chisel wants to turn to one side or the other. I am using a bevel edge chisel not a mortise chisel and using the Paul Sellers technique. The mortise is a th...
2017/03/14
[ "https://woodworking.stackexchange.com/questions/5671", "https://woodworking.stackexchange.com", "https://woodworking.stackexchange.com/users/3437/" ]
I'm not sure exactly in what way the two sides don't line up exactly. Working in from both faces should ensure the 'mouth' of the mortise on each face is pretty much bang-on, even if the mortise cheeks are a bit ragged or drift off. The ideal fix for a badly mis-cut mortise is actually to scrap the piece and start aga...
To answer your general question "What should I do?", I would submit that it's not that big of a deal, it will probably be fine, and only you will ever notice that the tenon on one end of the bench is fatter than the tenon opposite. Since you haven't cut the tenon yet, widening the mortise seems like the easiest solutio...
5,671
I am working on hand tool skills and building a workbench. The Paul Sellers workbench that he has videos of on youtube. I find that as I am chopping my mortises my chisel wants to turn to one side or the other. I am using a bevel edge chisel not a mortise chisel and using the Paul Sellers technique. The mortise is a th...
2017/03/14
[ "https://woodworking.stackexchange.com/questions/5671", "https://woodworking.stackexchange.com", "https://woodworking.stackexchange.com/users/3437/" ]
I'm not sure exactly in what way the two sides don't line up exactly. Working in from both faces should ensure the 'mouth' of the mortise on each face is pretty much bang-on, even if the mortise cheeks are a bit ragged or drift off. The ideal fix for a badly mis-cut mortise is actually to scrap the piece and start aga...
I found myself in exactly the same situation as the OP, on exactly the same project. I'm also building the Sellers workbench, and on my first mortise the holes were both very badly off vertical. My leg pieces are 90 x 90, and the mortise holes "missed" by about 5mm at the halfway point. Looking at it afterwards, the er...
5,671
I am working on hand tool skills and building a workbench. The Paul Sellers workbench that he has videos of on youtube. I find that as I am chopping my mortises my chisel wants to turn to one side or the other. I am using a bevel edge chisel not a mortise chisel and using the Paul Sellers technique. The mortise is a th...
2017/03/14
[ "https://woodworking.stackexchange.com/questions/5671", "https://woodworking.stackexchange.com", "https://woodworking.stackexchange.com/users/3437/" ]
Assuming that the failure to line up is due to small compounded errors, there are a series of small posture and behavioral changes you can make to help make your work more accurate, and you can make guides to help you control the tools. But, given that your mortise holes don't line up, you can probably fix them by ana...
To answer your general question "What should I do?", I would submit that it's not that big of a deal, it will probably be fine, and only you will ever notice that the tenon on one end of the bench is fatter than the tenon opposite. Since you haven't cut the tenon yet, widening the mortise seems like the easiest solutio...
5,671
I am working on hand tool skills and building a workbench. The Paul Sellers workbench that he has videos of on youtube. I find that as I am chopping my mortises my chisel wants to turn to one side or the other. I am using a bevel edge chisel not a mortise chisel and using the Paul Sellers technique. The mortise is a th...
2017/03/14
[ "https://woodworking.stackexchange.com/questions/5671", "https://woodworking.stackexchange.com", "https://woodworking.stackexchange.com/users/3437/" ]
Assuming that the failure to line up is due to small compounded errors, there are a series of small posture and behavioral changes you can make to help make your work more accurate, and you can make guides to help you control the tools. But, given that your mortise holes don't line up, you can probably fix them by ana...
I found myself in exactly the same situation as the OP, on exactly the same project. I'm also building the Sellers workbench, and on my first mortise the holes were both very badly off vertical. My leg pieces are 90 x 90, and the mortise holes "missed" by about 5mm at the halfway point. Looking at it afterwards, the er...
5,671
I am working on hand tool skills and building a workbench. The Paul Sellers workbench that he has videos of on youtube. I find that as I am chopping my mortises my chisel wants to turn to one side or the other. I am using a bevel edge chisel not a mortise chisel and using the Paul Sellers technique. The mortise is a th...
2017/03/14
[ "https://woodworking.stackexchange.com/questions/5671", "https://woodworking.stackexchange.com", "https://woodworking.stackexchange.com/users/3437/" ]
I found myself in exactly the same situation as the OP, on exactly the same project. I'm also building the Sellers workbench, and on my first mortise the holes were both very badly off vertical. My leg pieces are 90 x 90, and the mortise holes "missed" by about 5mm at the halfway point. Looking at it afterwards, the er...
To answer your general question "What should I do?", I would submit that it's not that big of a deal, it will probably be fine, and only you will ever notice that the tenon on one end of the bench is fatter than the tenon opposite. Since you haven't cut the tenon yet, widening the mortise seems like the easiest solutio...
20,431,049
I can't find documentation on this function and therefor I can't make it work right. When is that function being called, what is it doing and what is it taking as first parameters? I'm trying to get access token from passport, but can't reach it anyhow. ``` passport.use(new FacebookStrategy({ clientID: APP_ID, ...
2013/12/06
[ "https://Stackoverflow.com/questions/20431049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2102437/" ]
`User.findOrCreate` is a made-up function that represents whatever function you have to find a user by Facebook ID, or to create one if the user doesn't exist. I think your first problem is that your callback URL is just going to your root, so you probably are never getting to that function. Your callback URL should ...
If you would like to use `findOrCreate`, try the npm package [mongoose-findorcreate](https://www.npmjs.com/package/mongoose-findorcreate), or [supergoose](https://www.npmjs.com/package/supergoose) e.g. `mongoose-findorcreate` ``` var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost'); var findOr...
36,093,062
My team is working on a set of tools and pages that require google analytics for us to analyze. We have an Analytics account for our team where we gather our data that we've used for a good while now. Recently we've had to combine our website with another repository, under another team's website. Because of this, our...
2016/03/18
[ "https://Stackoverflow.com/questions/36093062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6083679/" ]
The two existing answers on this page are not correct and will actually not work. You definitely **do not** need to download the `analytics.js` script twice, and you definitely **do not** want to create two [command queue](https://developers.google.com/analytics/devguides/collection/analyticsjs/how-analyticsjs-works#th...
change the last `(window,document,'script','//www.google-analytics.com/analytics.js','ga');` to `(window,document,'script','//www.google-analytics.com/analytics.js','ga2');` and use `ga2('send', 'event', 'MyAnalytics', 'MyEvent');`
20,685,721
I have never setup up a queueing system before. I decided to give it a shot. It seems the queueing system is working perfectly. However, it doesn't seem the data is being sent correctly. Here is my code. ``` ... $comment = new Comment(Input::all()); $comment->user_id = $user->id; $comment->save(); if ($comment->isSav...
2013/12/19
[ "https://Stackoverflow.com/questions/20685721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2340657/" ]
There's no reason to compare the elements in a `Set`. [By definition,](http://docs.oracle.com/javase/6/docs/api/java/util/Set.html) they are all different to one another. From the javadoc: > > A collection that contains no duplicate elements. > > > More formally, sets contain no pair of elements e1 and e2 such tha...
I'm not sure exactly what you are doing in your "comparison" but if it really is just finding matching elements then the Set Interface at <http://docs.oracle.com/javase/tutorial/collections/interfaces/set.html> has some useful methods. For example: * `s1.retainAll(s2)` — transforms s1 into the intersection of s1 and ...
20,685,721
I have never setup up a queueing system before. I decided to give it a shot. It seems the queueing system is working perfectly. However, it doesn't seem the data is being sent correctly. Here is my code. ``` ... $comment = new Comment(Input::all()); $comment->user_id = $user->id; $comment->save(); if ($comment->isSav...
2013/12/19
[ "https://Stackoverflow.com/questions/20685721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2340657/" ]
The source code for the copy constructor is [widely available](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/HashSet.java#HashSet.%3Cinit%3E%28java.util.Collection%29), so you can study that as well as [clone()](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/ope...
There's no reason to compare the elements in a `Set`. [By definition,](http://docs.oracle.com/javase/6/docs/api/java/util/Set.html) they are all different to one another. From the javadoc: > > A collection that contains no duplicate elements. > > > More formally, sets contain no pair of elements e1 and e2 such tha...
20,685,721
I have never setup up a queueing system before. I decided to give it a shot. It seems the queueing system is working perfectly. However, it doesn't seem the data is being sent correctly. Here is my code. ``` ... $comment = new Comment(Input::all()); $comment->user_id = $user->id; $comment->save(); if ($comment->isSav...
2013/12/19
[ "https://Stackoverflow.com/questions/20685721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2340657/" ]
The source code for the copy constructor is [widely available](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/HashSet.java#HashSet.%3Cinit%3E%28java.util.Collection%29), so you can study that as well as [clone()](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/ope...
I'm not sure exactly what you are doing in your "comparison" but if it really is just finding matching elements then the Set Interface at <http://docs.oracle.com/javase/tutorial/collections/interfaces/set.html> has some useful methods. For example: * `s1.retainAll(s2)` — transforms s1 into the intersection of s1 and ...
3,520,084
I am a new developer for Umbraco. I am having problem setting up my Visual Studio 2010 as a developer platform for umbraco 4.5.x with TFS and between remote teams. My current setup is to open the whole umbraco site in Visual studio and tideup with TFS. Obeviusly this means that some of the files and folders gets locke...
2010/08/19
[ "https://Stackoverflow.com/questions/3520084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295530/" ]
This should solve your problem =) EDIT: Link updated <http://our.umbraco.org/wiki/codegarden-2009/open-space-minutes/working-in-visual-studio-when-developing-umbraco-solutions> I made a VS2010 umbraco project template, that configures the commands used to copy files to the umbraco folder on build, like described in ...
Is it mandatory to use TFS as your version control? We have used **Mercurial** and **Visual svn server** as version controls in our projects. In this i feel Mercurial as more comfortable for Umbraco projects.
87,103
We have a multi-entry visa from 15-7-2016 until 15-7-2017. The calculator isn't working and keeps giving an error. We were already in the Schengen Area on these dates: 15-7-2016 until 26-9-2016 and from 5-1-2017 until 29-1-2017 We want to go again from 6-5-2017 until 14-7-2017 Is this okay and will it be allowed?
2017/01/30
[ "https://travel.stackexchange.com/questions/87103", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/56753/" ]
If you don't want to depend on the calculator, you can also note that by the time you enter on May 6, you will **have been outside of Schengen for more than 90 consecutive days** (namely, say, the full months of February, March, and April, plus May 1st). This, in itself, is enough to make everything that came *before*...
Today's date is populated automatically in "Date of entry/Control" (and needs to be a specific format): [![Schengen calculator](https://i.stack.imgur.com/fhF9G.jpg)](https://i.stack.imgur.com/fhF9G.jpg) The above (as reference by @Dorothy) is the official calculator and does appear to be working. What it is saying is...
306,055
Based only loosely on [How are questions in the 'hot' tab selected?](https://meta.stackexchange.com/questions/4766/how-are-questions-in-the-hot-tab-selected) Some people seem to enjoy landing with their posts on the frontpage, possibly influencing their reputation quite massively (either up or down). But this comes so...
2018/01/22
[ "https://meta.stackexchange.com/questions/306055", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/373864/" ]
> > Is timing the key? > > > Yes, timing is a crucial factor, and the single thing you can control as one posting an answer. If you're really afraid that your answer will send the question to the HNQ list, just wait before answering. Half day should be enough. Answering within half a day is still fine, but this i...
First, I think you're linking to the wrong formula. [This](https://meta.stackexchange.com/a/61343/295232) is the correct one for Hot Network Questions. > > Should I avoid answering for the time being if the question is "in danger of going hot"? > > > That helps. According to the post I linked to, > > * Question...
948
When I am really overloaded with work, I don't have time to reply to new client's requests on estimations (how much will it cost, can you do these addons,...) as I simply cannot concentrate to produce a quality reply. Often it takes up to 2 days before I reply them. And even after two days, I may reply by informing th...
2013/11/08
[ "https://freelancing.stackexchange.com/questions/948", "https://freelancing.stackexchange.com", "https://freelancing.stackexchange.com/users/517/" ]
If your reply is simply "I'm overloaded with work [... etc]", should it really take two days to send out? As a (part-time) freelancer, I don't have the problem of being overloaded with freelance work (not yet!), but when coupled with all of my other responsibilities, it does get demanding. I will say though that whe...
*The main idea is to keep your customer up-to-date.* Send a note saying that > > I will do it.... > > > Just it, something in this manner. There is no need in composing a legendary responce or do the task right away all the night over. Just think about it - your customer doesn't know what is going on... He ha...
948
When I am really overloaded with work, I don't have time to reply to new client's requests on estimations (how much will it cost, can you do these addons,...) as I simply cannot concentrate to produce a quality reply. Often it takes up to 2 days before I reply them. And even after two days, I may reply by informing th...
2013/11/08
[ "https://freelancing.stackexchange.com/questions/948", "https://freelancing.stackexchange.com", "https://freelancing.stackexchange.com/users/517/" ]
If your reply is simply "I'm overloaded with work [... etc]", should it really take two days to send out? As a (part-time) freelancer, I don't have the problem of being overloaded with freelance work (not yet!), but when coupled with all of my other responsibilities, it does get demanding. I will say though that whe...
**I always reply within 24 (business) hours.** Even if that reply is to let the client know I received their email and have been unable to provide the attention it deserves. I then provide a specific date to expect a reply. Generally that date is within one or two days, rarely (if ever) longer. Prompt communication is...
948
When I am really overloaded with work, I don't have time to reply to new client's requests on estimations (how much will it cost, can you do these addons,...) as I simply cannot concentrate to produce a quality reply. Often it takes up to 2 days before I reply them. And even after two days, I may reply by informing th...
2013/11/08
[ "https://freelancing.stackexchange.com/questions/948", "https://freelancing.stackexchange.com", "https://freelancing.stackexchange.com/users/517/" ]
**I always reply within 24 (business) hours.** Even if that reply is to let the client know I received their email and have been unable to provide the attention it deserves. I then provide a specific date to expect a reply. Generally that date is within one or two days, rarely (if ever) longer. Prompt communication is...
*The main idea is to keep your customer up-to-date.* Send a note saying that > > I will do it.... > > > Just it, something in this manner. There is no need in composing a legendary responce or do the task right away all the night over. Just think about it - your customer doesn't know what is going on... He ha...
2,506
Does anyone know of a good, complete translation of the Valmiki Ramayana, with each word explained? I have found two such translations online, but both are incomplete. [Valmikiramayan.net](http://www.valmikiramayan.net) stops with Yuddha Kanda, while [this](http://www.valmiki.iitk.ac.in/) has only the first five kan...
2014/07/31
[ "https://hinduism.stackexchange.com/questions/2506", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/592/" ]
The site [valmikiramayan.net](http://www.valmikiramayan.net) you mentioned covers the Bala Kanda through the Yuddha Kanda, so presumably all you really want is a word-for-word translation of the Uttara Kanda. Well, unfortunately it's hard enough to find any translation at all of the Uttara Kanda, let alone a word-for-w...
Manmatha Nath Dutt's translation of Uttara Kanda is also available on archive.org [here](https://archive.org/download/Ramayana_201309). Look for: 1. Ramayana-VOL-4-Uttara-Kanda.pdf (scanned copy) 2. Ramayana-VOL-4-Uttara-Kanda\_text.pdf (OCR-converted to text, so you can search the contents) --- `EDIT:` If you are...
16,498,174
I am trying to make a tiny program that has 3 buttons, all of them of white color. Pressing the first button (that has the text "Go!") will cause the second button to become orange for 3 seconds and then, after that time, it will become white again AND the third button will become permanently green. However, in my fo...
2013/05/11
[ "https://Stackoverflow.com/questions/16498174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Swing is single threaded. Calling `Thread.sleep` in the `EDT` prevents UI updates. Use a [Swing Timer](http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html) instead.
You're calling `Thread.sleep(3000)` on the main thread. Hence why your program freezes for three seconds. As @MarounMaroun suggested, you should use a `SwingWorker`. [Here](http://docs.oracle.com/javase/6/docs/api/javax/swing/SwingWorker.html) is the documentation.
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
You need to send request like below in swift 3 ``` let urlString = "https://httpbin.org/get" Alamofire.request(urlString, method: .post, parameters: ["foo": "bar"],encoding: JSONEncoding.default, headers: nil).responseJSON { response in switch response.result { case .success: p...
This will work better in Swift 4. ``` let url = "yourlink.php". // This will be your link let parameters: Parameters = ["User_type": type, "User_name": name, "User_email": email, "User_contact": contact, "User_password": password, "from_referral": referral] //This will be your parameter Alamofire.request(url, me...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
You need to send request like below in swift 3 ``` let urlString = "https://httpbin.org/get" Alamofire.request(urlString, method: .post, parameters: ["foo": "bar"],encoding: JSONEncoding.default, headers: nil).responseJSON { response in switch response.result { case .success: p...
Alamofire for GET and POST method using Alamofire 1.Create a file named "GlobalMethod" for multiple use ``` import Alamofire class GlobalMethod: NSObject { static let objGlobalMethod = GlobalMethod() func ServiceMethod(url:String, method:String, controller:UIViewController, parameters:Parameters, completion...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
You need to send request like below in swift 3 ``` let urlString = "https://httpbin.org/get" Alamofire.request(urlString, method: .post, parameters: ["foo": "bar"],encoding: JSONEncoding.default, headers: nil).responseJSON { response in switch response.result { case .success: p...
Alamofire using post method import UIKit import Alamofire ``` class ViewController: UIViewController { let parameters = [ "username": "foo", "password": "123456" ] let url = "https://httpbin.org/post" override func viewDidLoad() { super.viewDidLoad() Alamofire.request(url, method...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
You need to send request like below in swift 3 ``` let urlString = "https://httpbin.org/get" Alamofire.request(urlString, method: .post, parameters: ["foo": "bar"],encoding: JSONEncoding.default, headers: nil).responseJSON { response in switch response.result { case .success: p...
Please find the code below \*\* > > pod 'Alamofire', '~> 5.4' > > > \*\* \*\* > > pod 'ObjectMapper', '~> 4.2' > > > \*\* \*\* > > pod 'SwiftyJSON' > > > \*\* > > pod 'TPKeyboardAvoiding' > > > **Use Model** ``` import ObjectMapper class LoginModel : Mappable{ var status : String? ...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
This will work better in Swift 4. ``` let url = "yourlink.php". // This will be your link let parameters: Parameters = ["User_type": type, "User_name": name, "User_email": email, "User_contact": contact, "User_password": password, "from_referral": referral] //This will be your parameter Alamofire.request(url, me...
Alamofire for GET and POST method using Alamofire 1.Create a file named "GlobalMethod" for multiple use ``` import Alamofire class GlobalMethod: NSObject { static let objGlobalMethod = GlobalMethod() func ServiceMethod(url:String, method:String, controller:UIViewController, parameters:Parameters, completion...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
Alamofire using post method import UIKit import Alamofire ``` class ViewController: UIViewController { let parameters = [ "username": "foo", "password": "123456" ] let url = "https://httpbin.org/post" override func viewDidLoad() { super.viewDidLoad() Alamofire.request(url, method...
This will work better in Swift 4. ``` let url = "yourlink.php". // This will be your link let parameters: Parameters = ["User_type": type, "User_name": name, "User_email": email, "User_contact": contact, "User_password": password, "from_referral": referral] //This will be your parameter Alamofire.request(url, me...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
This will work better in Swift 4. ``` let url = "yourlink.php". // This will be your link let parameters: Parameters = ["User_type": type, "User_name": name, "User_email": email, "User_contact": contact, "User_password": password, "from_referral": referral] //This will be your parameter Alamofire.request(url, me...
Please find the code below \*\* > > pod 'Alamofire', '~> 5.4' > > > \*\* \*\* > > pod 'ObjectMapper', '~> 4.2' > > > \*\* \*\* > > pod 'SwiftyJSON' > > > \*\* > > pod 'TPKeyboardAvoiding' > > > **Use Model** ``` import ObjectMapper class LoginModel : Mappable{ var status : String? ...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
Alamofire using post method import UIKit import Alamofire ``` class ViewController: UIViewController { let parameters = [ "username": "foo", "password": "123456" ] let url = "https://httpbin.org/post" override func viewDidLoad() { super.viewDidLoad() Alamofire.request(url, method...
Alamofire for GET and POST method using Alamofire 1.Create a file named "GlobalMethod" for multiple use ``` import Alamofire class GlobalMethod: NSObject { static let objGlobalMethod = GlobalMethod() func ServiceMethod(url:String, method:String, controller:UIViewController, parameters:Parameters, completion...
40,604,502
how is it possible to send a POST request with a data in the HTTP body with Alamofire 4? I used custom encoding at swift 2.3 it was working good. I converted my code swift 3 and I tried to paramater encoding but not working. This code : ``` public struct MyCustomEncoding : ParameterEncoding { private let data: Data in...
2016/11/15
[ "https://Stackoverflow.com/questions/40604502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6603909/" ]
Alamofire using post method import UIKit import Alamofire ``` class ViewController: UIViewController { let parameters = [ "username": "foo", "password": "123456" ] let url = "https://httpbin.org/post" override func viewDidLoad() { super.viewDidLoad() Alamofire.request(url, method...
Please find the code below \*\* > > pod 'Alamofire', '~> 5.4' > > > \*\* \*\* > > pod 'ObjectMapper', '~> 4.2' > > > \*\* \*\* > > pod 'SwiftyJSON' > > > \*\* > > pod 'TPKeyboardAvoiding' > > > **Use Model** ``` import ObjectMapper class LoginModel : Mappable{ var status : String? ...
51,776
Most instructions that come with cable (aka mechanical) disc brakes say not to use the barrel adjusters on the brake levers. Why not? Is there that much difference between the barrel adjuster on the levers and the barrel adjuster on the calliper?
2018/01/13
[ "https://bicycles.stackexchange.com/questions/51776", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/11160/" ]
As you dial out the barrel adjuster on the brake lever you pull more cable by effectively lengthening the cable outer (aka cable housing). By pulling more cable you change the starting position of the caliper brake arm, which if extreme enough, could mean: 1. the caliper brake arm may not have enough travel to get the...
I've just had a quick read of the [BB7 / 5 service manual](https://sram-cdn-pull-zone-gsdesign.netdna-ssl.com/cdn/farfuture/OI4YGQgqZEcjy_yY3ADfOwZ7ERe_boIouJmwijm2BNs/mtime:1372788192/sites/default/files/techdocs/gen.0000000003513_rev_b_2012_bb7_bb5_service_manual_english.pdf). The only reference to not using barrel ...
52,004,636
I have a datatable that is using standard features (pagination, sorting, searching, date range, etc.), but I also need to have a portion at the bottom of the table that displays the total salary of each office. The output would (ideally) look something like this if you searched for, say, "engineer": * London: $295,500...
2018/08/24
[ "https://Stackoverflow.com/questions/52004636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10134021/" ]
You Can do sum of salary by office using below code sample as said over [here](https://datatables.net/forums/discussion/31038/how-to-sum-column-based-on-values-from-another-column), which you can modify according to your need. Replace `1` by column number you want to compare data with. ``` total = api.cells( functi...
You should really consider using the small [**`sum()`**](https://datatables.net/plug-ins/api/sum()) plug-in. In your case, all what you need next is something like ``` drawCallback: function() { var sum = this.api().column( 5, { search:'applied', page: 'all' }).data().sum(); $( this.api().column(5).footer() ).tex...
16,425,312
I have the following string in php which is a date: "05/06/2013" I need it to be in the following format: 06-MAY-13 Whichever method I use needs to be able to handle any date given in the first format and convert it into the desired format. How could I do this in php? Thanks
2013/05/07
[ "https://Stackoverflow.com/questions/16425312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1898806/" ]
By using [`strtotime()`](http://php.net/strtotime) and [`date()`](http://php.net/date). Spefically: ``` echo date('d-M-y', strtotime('05/06/2013')); ``` Replace `M` with `F` if you want the full name of the month.
``` date("d-F-y",strtotime("05/06/2013")); ```
16,425,312
I have the following string in php which is a date: "05/06/2013" I need it to be in the following format: 06-MAY-13 Whichever method I use needs to be able to handle any date given in the first format and convert it into the desired format. How could I do this in php? Thanks
2013/05/07
[ "https://Stackoverflow.com/questions/16425312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1898806/" ]
By using [`strtotime()`](http://php.net/strtotime) and [`date()`](http://php.net/date). Spefically: ``` echo date('d-M-y', strtotime('05/06/2013')); ``` Replace `M` with `F` if you want the full name of the month.
This is how you do it with the [`DateTime`](http://us3.php.net/manual/en/class.datetime.php) Class. ``` $Date = new DateTime("05/03/2013"); echo $Date->format("d-M-Y"); ```
16,425,312
I have the following string in php which is a date: "05/06/2013" I need it to be in the following format: 06-MAY-13 Whichever method I use needs to be able to handle any date given in the first format and convert it into the desired format. How could I do this in php? Thanks
2013/05/07
[ "https://Stackoverflow.com/questions/16425312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1898806/" ]
``` date("d-F-y",strtotime("05/06/2013")); ```
This is how you do it with the [`DateTime`](http://us3.php.net/manual/en/class.datetime.php) Class. ``` $Date = new DateTime("05/03/2013"); echo $Date->format("d-M-Y"); ```
184,272
The optimal hyperplane in SVM is defined as: $$\mathbf w \cdot \mathbf x+b=0,$$ where $b$ represents threshold. If we have some mapping $\mathbf \phi$ which maps input space to some space $Z$, we can define SVM in the space $Z$, where the optimal hiperplane will be: $$\mathbf w \cdot \mathbf \phi(\mathbf x)+b=0.$$ ...
2015/11/30
[ "https://stats.stackexchange.com/questions/184272", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/96620/" ]
Why bias is important? ====================== The bias term $b$ is, indeed, a special parameter in SVM. Without it, the classifier will always go through the origin. So, SVM does not give you the separating hyperplane with the maximum margin if it does not happen to pass through the origin, unless you have a bias term...
Sometimes, people will just omit the intercept in SVM, but i think the reason maybe we can penalizing intercept in order to omit it. i.e., we can modify the data $\mathbf{\hat{x}} = (\mathbf{1}, \mathbf{x})$, and $\mathbf{\hat{w}} = (w\_{0}, \mathbf{w}^{T})^{T}$ so that omit the intercept $$\mathbf{x} ~ \mathbf{w} + ...
184,272
The optimal hyperplane in SVM is defined as: $$\mathbf w \cdot \mathbf x+b=0,$$ where $b$ represents threshold. If we have some mapping $\mathbf \phi$ which maps input space to some space $Z$, we can define SVM in the space $Z$, where the optimal hiperplane will be: $$\mathbf w \cdot \mathbf \phi(\mathbf x)+b=0.$$ ...
2015/11/30
[ "https://stats.stackexchange.com/questions/184272", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/96620/" ]
Sometimes, people will just omit the intercept in SVM, but i think the reason maybe we can penalizing intercept in order to omit it. i.e., we can modify the data $\mathbf{\hat{x}} = (\mathbf{1}, \mathbf{x})$, and $\mathbf{\hat{w}} = (w\_{0}, \mathbf{w}^{T})^{T}$ so that omit the intercept $$\mathbf{x} ~ \mathbf{w} + ...
In additional to the reasons mentioned above, the distance of a point $x$ to a hyperplane defined by slope $\theta$ and intercept $b$ is $$\frac{|\theta^T x + b|}{||\theta||}$$ This is how the concept of margin in SVM is movitated. If you change the $\theta$ to include the intercept term $b$, the norm of the $\theta$ ...
184,272
The optimal hyperplane in SVM is defined as: $$\mathbf w \cdot \mathbf x+b=0,$$ where $b$ represents threshold. If we have some mapping $\mathbf \phi$ which maps input space to some space $Z$, we can define SVM in the space $Z$, where the optimal hiperplane will be: $$\mathbf w \cdot \mathbf \phi(\mathbf x)+b=0.$$ ...
2015/11/30
[ "https://stats.stackexchange.com/questions/184272", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/96620/" ]
Why bias is important? ====================== The bias term $b$ is, indeed, a special parameter in SVM. Without it, the classifier will always go through the origin. So, SVM does not give you the separating hyperplane with the maximum margin if it does not happen to pass through the origin, unless you have a bias term...
In additional to the reasons mentioned above, the distance of a point $x$ to a hyperplane defined by slope $\theta$ and intercept $b$ is $$\frac{|\theta^T x + b|}{||\theta||}$$ This is how the concept of margin in SVM is movitated. If you change the $\theta$ to include the intercept term $b$, the norm of the $\theta$ ...
101,015
A supplier is sending me very private information. For security, we are using thedecryptor.com website to encrypt the message. The website provides public and private keys. We agreed that he will sends me a public key before payment, and a private key after payment. I would like to know if it is possible to change the...
2022/07/16
[ "https://crypto.stackexchange.com/questions/101015", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/102890/" ]
> > A supplier is sending me very private information. For security, we are using thedecryptor.com website to encrypt the message. The website provides public and private keys. > > > This website doesn't share any information about how the encryption / decryption happens and should not be trusted for that reason a...
I'm a little confused about the process you're doing there. Normally you would do this for an encrypted data transfer: You generate a public and private key, give the supplier the public key, so that he can encrypt his message with it. After payment he sends you the encrypted data and you can decrypt the whole thing w...
77,321
*This is a future goal of mine, not a problem I currently face. Hope that doesn't invalidate the question.* **I really want to fly aboard the aircraft registered N123AA** (this is only a dummy registration standing in for a variety of real registrations that I want to fly on). The airline that operates N123AA operates...
2016/08/24
[ "https://travel.stackexchange.com/questions/77321", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/49613/" ]
Unless you know someone who works at that airline, there is no way to find this out and even then, they would only be able to see the *expected* schedule for a few days. There is no pattern (well, there might be, but it's still not enough) and aircraft are constantly swapped out so even that's nothing you can book on. ...
Check the routes the night before each possible travel day. If your target plane is assigned to one of the routes, go online and buy a ticket on that flight, and fly the next day. It will be expensive, because you will be booking less than 24 hours before the flight, but it will get what you want. The airline probabl...
43,063,375
I am running into a problem that I am having trouble figuring out in python (which I will currently blame on sever jetlag). I have an array, let's call it x. The plot of x where y-axis is generic value, x-axis is index of array, looks like: ![y-axis is generic value, x-axis is index of array](https://i.stack.imgur.co...
2017/03/28
[ "https://Stackoverflow.com/questions/43063375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7655525/" ]
Actions on Google is now available in German, according to <https://developers.googleblog.com/2017/10/apps-for-google-assistant-new-languages.html>
There are two issues here: 1. Actions on Google are not (yet) supported on a Google Assistant besides the Google Home. 2. Actions on Google and Google Home are not (yet) supported in anything besides English. **Update: May 2017** At Google I/O, they made two announcements relevant to this: 1. Actions on Google are ...
13,087,432
> > **Lighten a specific aspect of:** > > [Factory Pattern. When to use factory methods?](https://stackoverflow.com/questions/69849/factory-pattern-when-to-use-factory-methods) > > > At my team there was a discussion about the factory design pattern. In our project we have some Factories that are build like t...
2012/10/26
[ "https://Stackoverflow.com/questions/13087432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693175/" ]
The advantage of factories is that they decouple code. Take your class `Foo`, which needs an instance of `A`: ``` class Foo { public function __construct() { $a = new A; } } ``` The class `Foo` is now coupled to the class `A`, because it hardcodes the classname in its source. You cannot provide an ...
It depends. Design patterns are there to solve a problem, not to create a problem. * If you would create products inside another class the factory could provide a mock object for testing. * If you would create products with different kind of data to the constructor, a factory would come in handy. * If you would stri...
48,234,419
Hi everyone and thank you for your time. This was created in Visual Studio 2012,and I'm using the standard Windows Libraries. I am attempting to call a DLL function explicitly and I believe the code I've written is correct; however, I am receiving an error. I'm not sure if it's an error in something that I've written ...
2018/01/12
[ "https://Stackoverflow.com/questions/48234419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6163869/" ]
The initial error is caused by the library you're using failing to correctly handle a file that doesn't exist. The path you gave contains single slashes `\`, which are treated as escape characters, not path separators. Path separators must be escaped, i.e. `\\` to be treated correctly.
There is no point casting a string literal to LPCSTR. As for the \_com\_error that is definitely coming from the DLL. I would suggest wrapping that in a: ``` try { ... } catch(_com_error const & e) { wprintf(L"Caught a com error: %s\r\n", e.ErrorMessage()); } ``` And then you might be able to figure out what is...
10,441,721
I am reading the C++ Primer, in the overloaded operation chapter, the author gave an example: ``` // member binary operator: left-hand operand bound to implicit this pointer Sales_item& Sales_item::operator+=(const Sales_item&); // nonmember binary operator: must declare a parameter for each operand Sales_item operato...
2012/05/04
[ "https://Stackoverflow.com/questions/10441721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253656/" ]
It means that you can do something like the following ``` a = 1; (a += 1) += 1; ``` and the result will be a == 3. This is because the left most call to += modifies `a` and then returns a reference to it. Then the next += operates on the reference to `a` and again adds a number to it. On the other hand, the nor...
``` a = a + b; ``` is also ``` a += b; ``` which is equivalent to ``` a.operator+= (b) ``` operator += supports compound assignment: ``` (a += b) += c; ``` is equivalent to ``` a.operator+= (b).operator+= (c); ``` The last line would not be possible if a value was returned instead of an rvalue. Consider ...
28,398,572
**Clarification** This questions was asked before `kotlin` hit version 1.0. Language syntax in example is obsolete now, please follow official docs. --- I'm playing with **kotlin** and **spring DI**. I want to use constructor-based dependency injection, so I need to annotate the constructor. I tried following approa...
2015/02/08
[ "https://Stackoverflow.com/questions/28398572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1730696/" ]
Try to write: ``` Configuration public open class AppConfig [Import(javaClass<DataSourceConfig>())] (dataSource: DataSource) { //... } ```
This syntax works for me: ``` Configuration Import(javaClass<DataSourceConfig>()) public open class AppConfig { private val dataSource: DataSource Autowired constructor(dataSource: DataSource){ this.dataSource = dataSource } } ```
28,398,572
**Clarification** This questions was asked before `kotlin` hit version 1.0. Language syntax in example is obsolete now, please follow official docs. --- I'm playing with **kotlin** and **spring DI**. I want to use constructor-based dependency injection, so I need to annotate the constructor. I tried following approa...
2015/02/08
[ "https://Stackoverflow.com/questions/28398572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1730696/" ]
Hrm, I think the syntax has changed radically since this question was posted. The current way (according to the [docs](https://kotlinlang.org/docs/reference/classes.html)) is to add the keyword `constructor` between your class name and arguments and annotate *that*, i.e. ``` public class AppConfig @Configuration cons...
Try to write: ``` Configuration public open class AppConfig [Import(javaClass<DataSourceConfig>())] (dataSource: DataSource) { //... } ```
28,398,572
**Clarification** This questions was asked before `kotlin` hit version 1.0. Language syntax in example is obsolete now, please follow official docs. --- I'm playing with **kotlin** and **spring DI**. I want to use constructor-based dependency injection, so I need to annotate the constructor. I tried following approa...
2015/02/08
[ "https://Stackoverflow.com/questions/28398572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1730696/" ]
Hrm, I think the syntax has changed radically since this question was posted. The current way (according to the [docs](https://kotlinlang.org/docs/reference/classes.html)) is to add the keyword `constructor` between your class name and arguments and annotate *that*, i.e. ``` public class AppConfig @Configuration cons...
This syntax works for me: ``` Configuration Import(javaClass<DataSourceConfig>()) public open class AppConfig { private val dataSource: DataSource Autowired constructor(dataSource: DataSource){ this.dataSource = dataSource } } ```
44,631,258
I was playing with the lists in erlang. I have a randomly populated list of the following format: ``` List=[{10,"English",id1},{20,"Maths",id2},{30,"Geo",id3},{20,"English",id4}] ``` this is in the format [{Marks,Subject,Id}]. I wanted to make a list out of this list containing of only "English" as the subject whic...
2017/06/19
[ "https://Stackoverflow.com/questions/44631258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6524915/" ]
After filtering the list, couldn't you use `lists:max/1` to get the tuple with maximum marks? ``` lists:max(NewList) ```
Note that this assumes that the input list contains only tuples for the Subject desired, as the OP has already filtered on that. Alternatively that filter could be added here to avoid that separate step. To get the tuples with the max value of an arbitrary element of each one (Marks in this case, of which could be mor...
44,631,258
I was playing with the lists in erlang. I have a randomly populated list of the following format: ``` List=[{10,"English",id1},{20,"Maths",id2},{30,"Geo",id3},{20,"English",id4}] ``` this is in the format [{Marks,Subject,Id}]. I wanted to make a list out of this list containing of only "English" as the subject whic...
2017/06/19
[ "https://Stackoverflow.com/questions/44631258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6524915/" ]
After filtering the list, couldn't you use `lists:max/1` to get the tuple with maximum marks? ``` lists:max(NewList) ```
``` 1> List = [{10,"maths", "Joe"},{12,"english","Mark"},{10,"maths","Rebecca"},{15,"english","Janice"}]. [{10,"maths","Joe"}, {12,"english","Mark"}, {10,"maths","Rebecca"}, {15,"english","Janice"}] 2> Best = fun(List,Subject) -> lists:foldl(fun({Mark,S,Id},{BestMark,_}) when Mark > BestMark, S == Subject -> {Mark,[...
44,631,258
I was playing with the lists in erlang. I have a randomly populated list of the following format: ``` List=[{10,"English",id1},{20,"Maths",id2},{30,"Geo",id3},{20,"English",id4}] ``` this is in the format [{Marks,Subject,Id}]. I wanted to make a list out of this list containing of only "English" as the subject whic...
2017/06/19
[ "https://Stackoverflow.com/questions/44631258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6524915/" ]
If I understood correctly, that would work: ``` NewList = lists:filter(fun(A)->element(2,A)=="English" end,List). {_, _, MaxID} = lists:max(NewList). ```
Note that this assumes that the input list contains only tuples for the Subject desired, as the OP has already filtered on that. Alternatively that filter could be added here to avoid that separate step. To get the tuples with the max value of an arbitrary element of each one (Marks in this case, of which could be mor...
44,631,258
I was playing with the lists in erlang. I have a randomly populated list of the following format: ``` List=[{10,"English",id1},{20,"Maths",id2},{30,"Geo",id3},{20,"English",id4}] ``` this is in the format [{Marks,Subject,Id}]. I wanted to make a list out of this list containing of only "English" as the subject whic...
2017/06/19
[ "https://Stackoverflow.com/questions/44631258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6524915/" ]
If I understood correctly, that would work: ``` NewList = lists:filter(fun(A)->element(2,A)=="English" end,List). {_, _, MaxID} = lists:max(NewList). ```
``` 1> List = [{10,"maths", "Joe"},{12,"english","Mark"},{10,"maths","Rebecca"},{15,"english","Janice"}]. [{10,"maths","Joe"}, {12,"english","Mark"}, {10,"maths","Rebecca"}, {15,"english","Janice"}] 2> Best = fun(List,Subject) -> lists:foldl(fun({Mark,S,Id},{BestMark,_}) when Mark > BestMark, S == Subject -> {Mark,[...
44,631,258
I was playing with the lists in erlang. I have a randomly populated list of the following format: ``` List=[{10,"English",id1},{20,"Maths",id2},{30,"Geo",id3},{20,"English",id4}] ``` this is in the format [{Marks,Subject,Id}]. I wanted to make a list out of this list containing of only "English" as the subject whic...
2017/06/19
[ "https://Stackoverflow.com/questions/44631258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6524915/" ]
I don't think Derek Brown's [lists:foldl()](http://erldocs.com/current/stdlib/lists.html?i=0&search=lists:foldl#foldl/3) solution will work correctly. `lists:foldl()` allows you to step through a list while maintaining and manipulating a separate variable. After the last element has been processed, `lists:foldl()` retu...
Note that this assumes that the input list contains only tuples for the Subject desired, as the OP has already filtered on that. Alternatively that filter could be added here to avoid that separate step. To get the tuples with the max value of an arbitrary element of each one (Marks in this case, of which could be mor...
44,631,258
I was playing with the lists in erlang. I have a randomly populated list of the following format: ``` List=[{10,"English",id1},{20,"Maths",id2},{30,"Geo",id3},{20,"English",id4}] ``` this is in the format [{Marks,Subject,Id}]. I wanted to make a list out of this list containing of only "English" as the subject whic...
2017/06/19
[ "https://Stackoverflow.com/questions/44631258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6524915/" ]
I don't think Derek Brown's [lists:foldl()](http://erldocs.com/current/stdlib/lists.html?i=0&search=lists:foldl#foldl/3) solution will work correctly. `lists:foldl()` allows you to step through a list while maintaining and manipulating a separate variable. After the last element has been processed, `lists:foldl()` retu...
``` 1> List = [{10,"maths", "Joe"},{12,"english","Mark"},{10,"maths","Rebecca"},{15,"english","Janice"}]. [{10,"maths","Joe"}, {12,"english","Mark"}, {10,"maths","Rebecca"}, {15,"english","Janice"}] 2> Best = fun(List,Subject) -> lists:foldl(fun({Mark,S,Id},{BestMark,_}) when Mark > BestMark, S == Subject -> {Mark,[...
34,279,868
I have 3 classes defined this way: ``` class Device: Some method class SSH: def connect(self,type): # code def execute(self,cmd): # code class Netconf: def connect(self,type): # code def execute(self,cmd): # code ``` Note SSH and Netconf classes have same method names but they d...
2015/12/15
[ "https://Stackoverflow.com/questions/34279868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3267989/" ]
You can do this by storing the type of device connected in a private `Device` attribute and then forwarding most method calls to it by adding a custom `__getattr__()` method. This is a little tricky in the `connect()` method because that's were the target device is defined (as opposed to in the `Device.__init__()` init...
You should implement the [**Strategy Pattern**](https://en.wikipedia.org/wiki/Strategy_pattern). The `connect()` method should instantiate the appropriate class (`detach()`ing from the previous if required) and store it, and then other methods should delegate to the stored object.
1,234,103
I'm importing massive data into a JackRabbit JCR repository. A good UI management tool to visualize the JCR repository would be great to check if the imported data is in a good layout, and also would make my life as developer easier.
2009/08/05
[ "https://Stackoverflow.com/questions/1234103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141634/" ]
I am the creator of the JCR Controller. The webstart version is limited and I will update it soon. The best way is to checkout the sourcecode directly from sourceforge. It will be also be a good moment to update the Controller.
I can recommend you [JCR Controller](https://sourceforge.net/projects/jcrconnector/).
1,234,103
I'm importing massive data into a JackRabbit JCR repository. A good UI management tool to visualize the JCR repository would be great to check if the imported data is in a good layout, and also would make my life as developer easier.
2009/08/05
[ "https://Stackoverflow.com/questions/1234103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141634/" ]
I am the creator of the JCR Controller. The webstart version is limited and I will update it soon. The best way is to checkout the sourcecode directly from sourceforge. It will be also be a good moment to update the Controller.
This was previously answered, see [Is there a tool to directly edit the contents of a Jackrabbit repository?](https://stackoverflow.com/questions/382622) BTW, I wouldn't call that "Graphical Tool", as I'd associate that with some sort of drawing or 3D application. It's rather a "management UI", "browser" or "content e...
29,801,230
When I view my website [example page](http://albunack.net/artist/1584532a-62ed-4cbe-ad95-6def0af7df35) on on my iPad there isn't enough width really so its all a bit cramped up because many columns (especially when you expand the sections). So I twist my iPad to view the page in landscape and instead of making use of ...
2015/04/22
[ "https://Stackoverflow.com/questions/29801230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1480018/" ]
Just add ``` html{ -webkit-text-size-adjust: 100%; } ``` This was already discussed here; [Preserve HTML font-size when iPhone orientation changes from portrait to landscape](https://stackoverflow.com/questions/2710764/preserve-html-font-size-when-iphone-orientation-changes-from-portrait-to-landsca)
``` @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { html { -webkit-text-size-adjust: 100%; } } ``` These are proper media queries to limit this particular css to only iPad in portrait and landscape. Doing it this way *shouldn't* have any effect on your desktop view.
29,801,230
When I view my website [example page](http://albunack.net/artist/1584532a-62ed-4cbe-ad95-6def0af7df35) on on my iPad there isn't enough width really so its all a bit cramped up because many columns (especially when you expand the sections). So I twist my iPad to view the page in landscape and instead of making use of ...
2015/04/22
[ "https://Stackoverflow.com/questions/29801230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1480018/" ]
Use the viewport meta tag to improve the presentation of your web content on iOS. Typically, you use the viewport meta tag to set the width and initial scale of the viewport. For example, if your webpage is narrower than 980 pixels, then you should set the width of the viewport to fit your web content. If you are desig...
``` @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { html { -webkit-text-size-adjust: 100%; } } ``` These are proper media queries to limit this particular css to only iPad in portrait and landscape. Doing it this way *shouldn't* have any effect on your desktop view.
59,488,977
``` Parent -Child1 -GrandChild1 -GreatGrandChild1 -Name="Name One" -GreatGrandChild2 -Name="Name Two" -GreatGrandChild3 -Name="Name One" -GrandChild2 -GreatGrandChild4 -Name="Name One" ...
2019/12/26
[ "https://Stackoverflow.com/questions/59488977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2922388/" ]
Since we need to manipulate the collection (to remove great grand children with "Name One"), LINQ alone won't be sufficient. ``` //assuming it is ok to mutate the existing list of Objects (parents) var grandChildren = parents.SelectMany(p => p.Children).SelectMany(c => c.GrandChildren); foreach (var grandChild in gra...
I think you're looking for something like this: ``` parent.ChildList = parent.ChildList.Where(x => x.GrandChildList.Any(y => y.Name == "Name One") == false).ToList(); ```
59,488,977
``` Parent -Child1 -GrandChild1 -GreatGrandChild1 -Name="Name One" -GreatGrandChild2 -Name="Name Two" -GreatGrandChild3 -Name="Name One" -GrandChild2 -GreatGrandChild4 -Name="Name One" ...
2019/12/26
[ "https://Stackoverflow.com/questions/59488977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2922388/" ]
Since we need to manipulate the collection (to remove great grand children with "Name One"), LINQ alone won't be sufficient. ``` //assuming it is ok to mutate the existing list of Objects (parents) var grandChildren = parents.SelectMany(p => p.Children).SelectMany(c => c.GrandChildren); foreach (var grandChild in gra...
Does this doesnt work: ``` var hasAnyGreatGrandChildren = parent.Child.GrandChild .SelectMany(x => x.GreatGrandChild) .Any(x ==> x.Name != "Name One"); ```
59,488,977
``` Parent -Child1 -GrandChild1 -GreatGrandChild1 -Name="Name One" -GreatGrandChild2 -Name="Name Two" -GreatGrandChild3 -Name="Name One" -GrandChild2 -GreatGrandChild4 -Name="Name One" ...
2019/12/26
[ "https://Stackoverflow.com/questions/59488977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2922388/" ]
Since we need to manipulate the collection (to remove great grand children with "Name One"), LINQ alone won't be sufficient. ``` //assuming it is ok to mutate the existing list of Objects (parents) var grandChildren = parents.SelectMany(p => p.Children).SelectMany(c => c.GrandChildren); foreach (var grandChild in gra...
What you need to do is a deep copy with condition of the first list. here is a little exemple: ``` var parentWithoutNameOne = new Parent { Childs = parent.Childs .Select(o => new Child() { GrandChilds = o.GrandChilds.Select(p => new GrandChild ...
19,445,832
I try to implement baresip for Android, it uses custom `alsa` module for control audio devices. This module uses this code for open device handler: ``` err = snd_pcm_open(&st->write, device, SND_PCM_STREAM_PLAYBACK, 0); ``` I tried to pass 'default', 'plug:hw:0,0', 'hw:0,0', 'hw:00,0' into this function. All result...
2013/10/18
[ "https://Stackoverflow.com/questions/19445832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2156937/" ]
You can use `LEAST` and `GREATEST` function to achieve it. ``` SELECT GREATEST(A.date0, B.date0) AS date0, LEAST(A.date1, B.date1) AS date1 FROM A, B WHERE B.x = A.x ``` Both are described here <http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html>
I suppose you are looking for: [`GREATEST()`](http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_greatest) and [`LEAST()`](http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_least)
19,445,832
I try to implement baresip for Android, it uses custom `alsa` module for control audio devices. This module uses this code for open device handler: ``` err = snd_pcm_open(&st->write, device, SND_PCM_STREAM_PLAYBACK, 0); ``` I tried to pass 'default', 'plug:hw:0,0', 'hw:0,0', 'hw:00,0' into this function. All result...
2013/10/18
[ "https://Stackoverflow.com/questions/19445832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2156937/" ]
You can use `LEAST` and `GREATEST` function to achieve it. ``` SELECT GREATEST(A.date0, B.date0) AS date0, LEAST(A.date1, B.date1) AS date1 FROM A, B WHERE B.x = A.x ``` Both are described here <http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html>
Try this: ``` SELECT GREATEST(A.date0, B.date0) AS `date0`,LEAST(A.date0, B.date0) AS `date1` FROM A JOIN B ON A.id = B.role; ```
19,445,832
I try to implement baresip for Android, it uses custom `alsa` module for control audio devices. This module uses this code for open device handler: ``` err = snd_pcm_open(&st->write, device, SND_PCM_STREAM_PLAYBACK, 0); ``` I tried to pass 'default', 'plug:hw:0,0', 'hw:0,0', 'hw:00,0' into this function. All result...
2013/10/18
[ "https://Stackoverflow.com/questions/19445832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2156937/" ]
You can use `LEAST` and `GREATEST` function to achieve it. ``` SELECT GREATEST(A.date0, B.date0) AS date0, LEAST(A.date1, B.date1) AS date1 FROM A, B WHERE B.x = A.x ``` Both are described here <http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html>
Just watch out if NULL is likely to be in a field value ... ``` SELECT LEAST(NULL,NOW()); ``` and ``` SELECT GREATEST(NULL,NOW()); ``` both return null, which may not be what you want (especially in the case of GREATEST)
19,445,832
I try to implement baresip for Android, it uses custom `alsa` module for control audio devices. This module uses this code for open device handler: ``` err = snd_pcm_open(&st->write, device, SND_PCM_STREAM_PLAYBACK, 0); ``` I tried to pass 'default', 'plug:hw:0,0', 'hw:0,0', 'hw:00,0' into this function. All result...
2013/10/18
[ "https://Stackoverflow.com/questions/19445832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2156937/" ]
I suppose you are looking for: [`GREATEST()`](http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_greatest) and [`LEAST()`](http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_least)
Try this: ``` SELECT GREATEST(A.date0, B.date0) AS `date0`,LEAST(A.date0, B.date0) AS `date1` FROM A JOIN B ON A.id = B.role; ```
19,445,832
I try to implement baresip for Android, it uses custom `alsa` module for control audio devices. This module uses this code for open device handler: ``` err = snd_pcm_open(&st->write, device, SND_PCM_STREAM_PLAYBACK, 0); ``` I tried to pass 'default', 'plug:hw:0,0', 'hw:0,0', 'hw:00,0' into this function. All result...
2013/10/18
[ "https://Stackoverflow.com/questions/19445832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2156937/" ]
I suppose you are looking for: [`GREATEST()`](http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_greatest) and [`LEAST()`](http://dev.mysql.com/doc/refman/5.6/en/comparison-operators.html#function_least)
Just watch out if NULL is likely to be in a field value ... ``` SELECT LEAST(NULL,NOW()); ``` and ``` SELECT GREATEST(NULL,NOW()); ``` both return null, which may not be what you want (especially in the case of GREATEST)
19,445,832
I try to implement baresip for Android, it uses custom `alsa` module for control audio devices. This module uses this code for open device handler: ``` err = snd_pcm_open(&st->write, device, SND_PCM_STREAM_PLAYBACK, 0); ``` I tried to pass 'default', 'plug:hw:0,0', 'hw:0,0', 'hw:00,0' into this function. All result...
2013/10/18
[ "https://Stackoverflow.com/questions/19445832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2156937/" ]
Just watch out if NULL is likely to be in a field value ... ``` SELECT LEAST(NULL,NOW()); ``` and ``` SELECT GREATEST(NULL,NOW()); ``` both return null, which may not be what you want (especially in the case of GREATEST)
Try this: ``` SELECT GREATEST(A.date0, B.date0) AS `date0`,LEAST(A.date0, B.date0) AS `date1` FROM A JOIN B ON A.id = B.role; ```
37,443,447
I have a Python list filled with instances of a class I defined. I would like to create a new list with all the instances from the original list that meet a certain criterion in one of their attributes. That is, for all the elements in `list1`, filled with instances of some `class obj`, I want all the elements for ...
2016/05/25
[ "https://Stackoverflow.com/questions/37443447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6024753/" ]
There's definitely a more concise way to do it, with a list comprehension: ``` filtered_list = [obj for obj in list1 if obj.attrib==someValue] ``` I don't know if you can go any faster though, because in the problem as you described you'll always have to check every object in the list somehow.
You can perhaps use pandas series. Read your list into a pandas series `your_list`. Then you can filter by using the `[]` syntax and the `.apply` method: ``` def check_attrib(obj, value): return obj.attrib==value new_list = your_list[your_list.apply(check_attrib)] ``` Remember the `[]` syntax filters a series b...
37,443,447
I have a Python list filled with instances of a class I defined. I would like to create a new list with all the instances from the original list that meet a certain criterion in one of their attributes. That is, for all the elements in `list1`, filled with instances of some `class obj`, I want all the elements for ...
2016/05/25
[ "https://Stackoverflow.com/questions/37443447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6024753/" ]
There's definitely a more concise way to do it, with a list comprehension: ``` filtered_list = [obj for obj in list1 if obj.attrib==someValue] ``` I don't know if you can go any faster though, because in the problem as you described you'll always have to check every object in the list somehow.
For completeness, you could also use [filter](https://docs.python.org/2/library/functions.html?highlight=filter%20built#filter) and a [lambda expression](https://docs.python.org/2/reference/expressions.html#lambda): ``` filtered_lst1 = filter(lambda obj: obj.attrib==someValue, lst1) ```
24,660,413
I'm trying to override a css class to improve the site when looking in a small screen. Here is the e.g. My file: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` Core file: ``` .fp-roksprocket-showcase.rt-block { margin: 0; padding: 100p...
2014/07/09
[ "https://Stackoverflow.com/questions/24660413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3761292/" ]
If you want to remove the padding put: `padding: 0`
It appears you are missing the curly brackets from your media query. You have: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` what you should have is: ``` @media only screen and (max-width: 480px){ body.layout-mode-responsive .fp-ro...
24,660,413
I'm trying to override a css class to improve the site when looking in a small screen. Here is the e.g. My file: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` Core file: ``` .fp-roksprocket-showcase.rt-block { margin: 0; padding: 100p...
2014/07/09
[ "https://Stackoverflow.com/questions/24660413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3761292/" ]
If you want to remove the padding put: `padding: 0`
Change: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` to this: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { padding: 0; } } ``` You forgot to c...
24,660,413
I'm trying to override a css class to improve the site when looking in a small screen. Here is the e.g. My file: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` Core file: ``` .fp-roksprocket-showcase.rt-block { margin: 0; padding: 100p...
2014/07/09
[ "https://Stackoverflow.com/questions/24660413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3761292/" ]
How css styling occurs is all the parent styling is automatically inherited by all the children elements and if you want to override any of the parent style you then have to specify it in the child element css style. Suppose we have ``` .parent{color:red;} ``` then all the child elements will have the css style `c...
It appears you are missing the curly brackets from your media query. You have: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` what you should have is: ``` @media only screen and (max-width: 480px){ body.layout-mode-responsive .fp-ro...
24,660,413
I'm trying to override a css class to improve the site when looking in a small screen. Here is the e.g. My file: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` Core file: ``` .fp-roksprocket-showcase.rt-block { margin: 0; padding: 100p...
2014/07/09
[ "https://Stackoverflow.com/questions/24660413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3761292/" ]
You are looking for the `initial` keyword. Please check [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/initial). The `initial` keyword resets the inherited style to the default style according to CSS specifications. However, this is supported since CSS3 only and it looks like you need to add work...
It appears you are missing the curly brackets from your media query. You have: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` what you should have is: ``` @media only screen and (max-width: 480px){ body.layout-mode-responsive .fp-ro...
24,660,413
I'm trying to override a css class to improve the site when looking in a small screen. Here is the e.g. My file: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` Core file: ``` .fp-roksprocket-showcase.rt-block { margin: 0; padding: 100p...
2014/07/09
[ "https://Stackoverflow.com/questions/24660413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3761292/" ]
How css styling occurs is all the parent styling is automatically inherited by all the children elements and if you want to override any of the parent style you then have to specify it in the child element css style. Suppose we have ``` .parent{color:red;} ``` then all the child elements will have the css style `c...
Change: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` to this: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { padding: 0; } } ``` You forgot to c...
24,660,413
I'm trying to override a css class to improve the site when looking in a small screen. Here is the e.g. My file: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` Core file: ``` .fp-roksprocket-showcase.rt-block { margin: 0; padding: 100p...
2014/07/09
[ "https://Stackoverflow.com/questions/24660413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3761292/" ]
You are looking for the `initial` keyword. Please check [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/initial). The `initial` keyword resets the inherited style to the default style according to CSS specifications. However, this is supported since CSS3 only and it looks like you need to add work...
Change: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { margin: 0; } ``` to this: ``` @media only screen and (max-width: 480px) body.layout-mode-responsive .fp-roksprocket-showcase.rt-block { padding: 0; } } ``` You forgot to c...
42,778,317
I have implemented a **collection view** on my Cocoa app following [Ray Wenderlich's tutorial](https://www.raywenderlich.com/145978/nscollectionview-tutorial) (very helpful, given how buggy and broken Apple's API is in this area). In the tutorial, the collection view's canvas is colored black using the following code ...
2017/03/14
[ "https://Stackoverflow.com/questions/42778317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433373/" ]
1. In Interface Builder, select the CollectionView in the document outline. 2. In the Utilities window, show the Attributes inspector. 3. Set the desired color in the Primary color selector control. Note: the Ray Wenderlich tutorial that you referenced sets the background color of the collection view programmatically....
for changing it programmatically in Swift 3 use e.g.: ``` collectionView.backgroundColors = [NSColor.black] ```
42,778,317
I have implemented a **collection view** on my Cocoa app following [Ray Wenderlich's tutorial](https://www.raywenderlich.com/145978/nscollectionview-tutorial) (very helpful, given how buggy and broken Apple's API is in this area). In the tutorial, the collection view's canvas is colored black using the following code ...
2017/03/14
[ "https://Stackoverflow.com/questions/42778317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433373/" ]
1. In Interface Builder, select the CollectionView in the document outline. 2. In the Utilities window, show the Attributes inspector. 3. Set the desired color in the Primary color selector control. Note: the Ray Wenderlich tutorial that you referenced sets the background color of the collection view programmatically....
Just change `self.view.wantsLayer = true` in `self.collectionView.wantsLayer = true`
42,778,317
I have implemented a **collection view** on my Cocoa app following [Ray Wenderlich's tutorial](https://www.raywenderlich.com/145978/nscollectionview-tutorial) (very helpful, given how buggy and broken Apple's API is in this area). In the tutorial, the collection view's canvas is colored black using the following code ...
2017/03/14
[ "https://Stackoverflow.com/questions/42778317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433373/" ]
for changing it programmatically in Swift 3 use e.g.: ``` collectionView.backgroundColors = [NSColor.black] ```
Just change `self.view.wantsLayer = true` in `self.collectionView.wantsLayer = true`
26,123,437
I need a method like `DLFileEntryLocalServiceUtil.getFileAsStream(...)`.However, I am using SOAP services of Liferay in my application. Is there anyway to get a file stream about the document or getting file like byte array or something like this.
2014/09/30
[ "https://Stackoverflow.com/questions/26123437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2689665/" ]
Just use `document` instead of `body` (your `body` element has a calculated height of 0, but document is always the full size of the window): <http://jsfiddle.net/TrueBlueAussie/95vczfve/5/> ``` $(document).ready(function () { $(document).click(function (ev) { mouseX = ev.pageX; mouseY = e...
Your body has 0 height because it has 0 content. Try adding this to your CSS: ``` html, body { height: 100%; margin: 0; } ``` Or try adding some content. [jsFiddle ========](http://jsfiddle.net/SpYk3/62hnurzd/) --- On a side tip, a lot of things about your jQuery can be made cleaner/easier: ``` $(document).read...
26,123,437
I need a method like `DLFileEntryLocalServiceUtil.getFileAsStream(...)`.However, I am using SOAP services of Liferay in my application. Is there anyway to get a file stream about the document or getting file like byte array or something like this.
2014/09/30
[ "https://Stackoverflow.com/questions/26123437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2689665/" ]
Your body has 0 height because it has 0 content. Try adding this to your CSS: ``` html, body { height: 100%; margin: 0; } ``` Or try adding some content. [jsFiddle ========](http://jsfiddle.net/SpYk3/62hnurzd/) --- On a side tip, a lot of things about your jQuery can be made cleaner/easier: ``` $(document).read...
Regarding part 2 of your question, my first thought is to include query params in the image URL, so that instead of `http://www.example.com/thingies/someimage.jpg` you get something like `http://www.example.com/thingies/someimage.jpg?x0=10&y0=25&x1=30&y1=5`. From there you would simply check if that string has query pa...
26,123,437
I need a method like `DLFileEntryLocalServiceUtil.getFileAsStream(...)`.However, I am using SOAP services of Liferay in my application. Is there anyway to get a file stream about the document or getting file like byte array or something like this.
2014/09/30
[ "https://Stackoverflow.com/questions/26123437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2689665/" ]
Just use `document` instead of `body` (your `body` element has a calculated height of 0, but document is always the full size of the window): <http://jsfiddle.net/TrueBlueAussie/95vczfve/5/> ``` $(document).ready(function () { $(document).click(function (ev) { mouseX = ev.pageX; mouseY = e...
Regarding part 2 of your question, my first thought is to include query params in the image URL, so that instead of `http://www.example.com/thingies/someimage.jpg` you get something like `http://www.example.com/thingies/someimage.jpg?x0=10&y0=25&x1=30&y1=5`. From there you would simply check if that string has query pa...
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
You have some errors in your code: 1. Use `myArray[i].push( 0 );` to add a new column. Your code (`myArray[i][j].push(0);`) would work in a 3-dimensional array as it tries to add another element to an array at position `[i][j]`. 2. You only expand (col-d)-many columns in all rows, even in those, which haven't been ini...
``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = 0; i < rows; i++) { for (var j = 0; j < cols; j++) { if(j <= c && i <= r) { myArray[i][j] = 1; } else { myArray[i][j] = 0; } } } ```
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = 0; i < rows; i++) { for (var j = 0; j < cols; j++) { if(j <= c && i <= r) { myArray[i][j] = 1; } else { myArray[i][j] = 0; } } } ```
The solution below uses a double loop to add data to the bottom of a 2x2 array in the Case 3. The inner loop pushes selected elements' values into a new row array. The outerloop then pushes the new row array to the bottom of an existing array (see [Newbie: Add values to two-dimensional array with for loops, Google Apps...
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
You have some errors in your code: 1. Use `myArray[i].push( 0 );` to add a new column. Your code (`myArray[i][j].push(0);`) would work in a 3-dimensional array as it tries to add another element to an array at position `[i][j]`. 2. You only expand (col-d)-many columns in all rows, even in those, which haven't been ini...
In your case you can do that without using `push` at all: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] var newRows = 8; var newCols = 7; var item; for (var i = 0; i < newRows; i++) { item = myArray[i] || (myArray[i] = []); for (var k = item.length; k < newCols; k++) item[...
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
Iterating over two dimensions means you'll need to check over two dimensions. assuming you're starting with: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ]; //don't forget your semi-colons ``` You want to expand this two-dimensional array to become: ``` var myArray = [ [1,1,1,1,1,0,0],...
you are calling the push() on an array element (int), where push() should be called on the array, also handling/filling the array this way makes no sense you can do it like this ``` for (var i = 0; i < rows - 1; i++) { for (var j = c; j < cols; j++) { myArray[i].push(0); } } for (var i = r; i < rows - 1; i+...
11,345,954
I'm trying to push to a two-dimensional array without it messing up, currently My array is: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] ``` And my code I'm trying is: ``` var r = 3; //start from rows 3 var c = 5; //start from col 5 var rows = 8; var cols = 7; for (var i = r; i < rows; i++) { f...
2012/07/05
[ "https://Stackoverflow.com/questions/11345954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497481/" ]
Iterating over two dimensions means you'll need to check over two dimensions. assuming you're starting with: ``` var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ]; //don't forget your semi-colons ``` You want to expand this two-dimensional array to become: ``` var myArray = [ [1,1,1,1,1,0,0],...
Create am array and put inside the first, in this case i get data from JSON response ``` $.getJSON('/Tool/GetAllActiviesStatus/', var dataFC = new Array(); function (data) { for (var i = 0; i < data.Result.length; i++) { var serie = new Array(data.Result[i].FUNCAO, data.Result[i].QT, true, true);...