Score: 1°       Point: 3056235       Stars: 1200        

Stack Overflow
Stack Overflow-avatar

Stack Overflow


A language-independent collaboratively edited question and answer site for programmers.

Get Adobe Flash player


Relevance Vector Machine

I am looking for a descent implementation of s.
Can anyone recommend an python library or C++ implementation that I could interface?
Thanks heaps in advance,

2013-06-12 00:32:28

Massive CSV file into Matlab

I have a CSV file 1.6 GB large, that I need to feed into matlab. I will have to do this frequently and I need it to run quickly. The file is of the form:
20111205 00:00.2 99.18 6 E
20111205 00:00.2 99.18 5 E
20111205 00:00.2 99.18 1 E
20111205 00:00.2 99.195 5 E
20111205 00:00.2 99.195 5 E
20111205 01:27.0 99.19 5 E
20111205 02:01.4 99.185 1 E
20111205 02:01.4 99.185 1 E
20111205 02:01.4 99.185 1 E
20111205 02:01.4 99.185 1 E
The code I have right now is the following:
format long g
fid = fopen('C:\Program Files\MATLAB\R2013a\EDU13.csv','r');
[c] = fscanf(fid, '%d,%d:%d.%d,%f,%d,%c');
c = reshape(c, 7, length(c)/7)
But this is far too slow. I would appreciate a method of getting this CSV file into matlab in the most efficient manner possible. Thank you!

2013-06-12 00:31:43

mod_rewrite adding full path to re_writes

I am trying to replace all dns names with one using mod_rewrite,
mod_rewrite is enable and doing something, however its changing all URL's to
http://www.testsite3.com/C:/httpd-2.4.4- win32/Apache24/htdocs/
the rule & condition is:
RewriteCond %{REMOTE_HOST} !^.+\.testsite3\.com$
RewriteRule ^(/~.+) http://www.testsite3.com/$1 [R,L]
testsite3 and all hostnames here are in hosts file as
How can I get this to properly re_write the url and not add /C:/httpd-2.4.4-win32/Apache24/htdocs/ to the end but add the proper path from the URL entered by user

2013-06-12 00:31:34

How to query the object which has manytomany field point to them in django

I have two models User and Company
class Company(models.Model):
name = models.CharField max_length=50)
class User(models.Model):
name = models.CharField( max_length=40)
following = models.ManyToManyField(Company)
I want to get all the company which has some users are following them.
Something like
Company.objects.filter(has_following = True)
How can i do it ?

2013-06-12 00:31:24

How to set environment variables in Supervisor service

How do you export environment variables in the command executed by Supervisor? I first tried:
command="export SITE=domain1; python manage.py command"
but Supervisor reports "can't find command".
So then I tried:
command=/bin/bash -c "export SITE=domain1; python manage.py command"
and the command runs, but this seems to interfere with the daemonization since when I stop the Supervisor daemon, all the other daemons it's running aren't stopped.

2013-06-12 00:30:52

Uploading a large file from phone

I'm trying to write a WP8 app that needs to upload a large amount of data back to my server. My server runs on ASP.net and implements REST using WebAPI.
I've gotten to a point where I can upload small amount of data, say 2-5MB using a POST and transfer them over to Azure blobs. Now, I'm thinking about moving a decent amount of data, say ~40-50MB from the phone using the background transfer API defined here
http://msdn.microsoft.com/en-us/library/ windowsphone/develop/hh202955(v=vs.105). aspx
The phone API supports -
Over cellular connection - 5 MB,
Over Wi-Fi connection with battery power - 20 MB
Over Wi-Fi connection with external power - 100 MB
The part that I'm struggling to understand is -
The MSDN kb article recommends that the server implement range requests, which is fair. However, it

2013-06-12 00:30:50

Android - Formatter.formatIPAddress deprecation with API 12

I see that the method is depricated and the replacement is supposed to be getHostAddress().
My question is how is getHostAddress a replacement? I can't seem to get it to do anything near the same thing.
What I'm trying to do is take an interger representation of a subnet mask and convert it to a string.
formatIPAddress does this perfectly.
As an example, my subnet mask is "". The interger value that the WifiManager returns is 105696409. formatIPAddress returns this correctly.
I can't seem to get getHostAddress to even work, much less convert an interger value to a subnet mask stsring.
Example code that does work
WifiManager wm = (WifiManager) MasterController.maincontext.getSystemSe rvice(Context.WIFI_SERVICE);
DhcpInfo wi = wm.getDhcpInfo();
int ip = wm.getDhcpInfo().ipAddre

2013-06-12 00:30:37

Bresenham's line algorithm. Does exist ncurses output for file?

I have homework, ASCII line plot drawer. I must print graph into to file. All algoritms of Bresenham's line algoritm have function SetPixel ( x, y ); in loops. This function must print pixel by x and y. NCurses library is idealy solution for print on windows console, but I must print into file.txt. I think that Ncurses only print on window console. My question: How to implement SetPixel function for print into file in this code? :
void Line( const float x1, const float y1, const float x2, const float y2, const Color& color )
// Bresenham's line algorithm
const bool steep = (fabs(y2 - y1) > fabs(x2 - x1));
std::swap(x1, y1);
std::swap(x2, y2);
if(x1 > x2)
std::swap(x1, x2);
std::swap(y1, y2);
const float dx = x2 - x1;
const float dy = fabs(y2 - y1);
float error = dx / 2

2013-06-12 00:26:18

What is the "+" in "+filter"?

This tutorial
shows a css blur example with
img {
+filter: blur(30px);
then goes on to mention
"Note: + stands for vendor prefix"
. Why is a plus sign used here instead of a vendor prefix such as "-webkit-"?

2013-06-12 00:25:54

How do I access a character at an index in a stored string?

So, lets say I do this:
getline ( cin , message );
Can I access the nth character in this message?

2013-06-12 00:25:18

Converting MySQL query to Hibernate Criteria

SELECT * FROM test.pchi new INNER JOIN rlhi old ON new_id = old.menu_id where new.name='?'
I tried using fetch, but I'm very new to this and keep getting some weird errors. Could someone please demonstrate how to do this?
How about this?
.setFetchMode("rlhi", FetchMode.JOIN)
.add(Restrictions.eq("new_id", "rlhi.menu_id"))
.add(Restrictions.eq("name", "SOME INPUT"))

2013-06-12 00:21:23

pass built-in methods into variables/arguments

I'm learning javascript right now, seems like beautiful functional language to me, it is wonderful move from PHP, I should have done this earlier. Although, I cannot figure this one out:
var v1 = (/[abc]/).test;
test method called on incompatible undefined
, I'm trying to store the test method of that regex into variable and invoke it later.
but it works with my own functions:
function foo(){
return 'I\'m foo';
var f = foo;
f(); // returns I'm foo
It should work on methods too, since functions are just methods of parent object anyway, right?
Ultimately, the reason I'm trying this is to be able to write something like this:
var a = ['a', 'b', 'c'];
a.every( (/[abc]/).test );
to check each array member against that regex.
Why doesn't this work? Is it limitation in passing buil

2013-06-12 00:19:37

python: URL parsing differences between urllib and urllib2

I'm trying out the following piece of Python code:
import urllib
import urllib2
url = 'https://AzureDiamond:hunter2@example.co m/my/rest/api.json'
u = urllib.urlopen(url) # works fine
u = urllib2.urlopen(url) # InvalidURL: nonnumeric port: 'hunter2@example.com'
I've tried urllib.quote without any success, I suspect urllib2 and urllib are parsing the URL differently, how can I make the two work similarly?

2013-06-12 00:14:14

How can i create a loop that checks a users input to see if it is an existing file?

I need the user to enter a file and for as long as the user enters files that exist the file will loop. The program will break when the user enters a file that does not exist.
using namespace std;
int main()
string currentfile;
int i = 0;
do {
cout << "Please enter a file name \n";
cin >> currentfile;
cout << currentfile << "\n";
ifstream myfile(currentfile);
if (myfile.good())
// display thenumber of characters, words, and lines in that file
else {
cout << "break";
} while(true);
// repeat while user enters valid file name
when i enter a file that exists,
returns good then if i try a file that does not exist the like
returns true again. If i start the program and i try first a file that does not ex

2013-06-12 00:12:26

How to order by this query?

I have table of likes/dislikes on game:
Table example:
Image Link
This code gives me the last week games the had likes, order by their likes count:
$limit = 10;
$time = _time() - 60*60*24*7;
$games_id = array();
$games_id_query = $this->db->execQuery("SELECT `game_id`, count(*) as `likes_count` FROM `likes` WHERE `type` = 'like' AND `time` > '{$time}' group by `game_id` order by `likes_count` DESC LIMIT {$limit}");
$games_id_num = $games_id_query->num_rows;
if($games_id_num > 0) {
while($row = $games_id_query->fetch_object()) {
$games_id[] = (array) $row;
I need addition to this code. I want one more order by, and it will be the dislikes count of this game_id, ASC.
How should I do this? with SQL only... thanks very much!

2013-06-12 00:07:45

How do I specify the protocol in an anchor and still use relative path?

It is always preferred on a personal website to use relative paths in anchors so that you can easily move your directory structure to a new website, but I want to make part of my website password protected (using .htaccess) and hence use https. Is there a way in an anchor's href to specify a different protocol
hard-coding the
as well?
I want to turn it into something like:
The above obviously doesn't work. Is there any way to do it? I am trying to avoid any scripting but would appreciate a JavaScript more than PHP or ASP.

2013-06-11 23:43:41

Search Wikipedia, get the first paragraph of the first entry found in all available languages using C#?

Suppose, I have a list of sightseeings in one language and want to enrich this list with some data from Wikipedia.
So, I have the following data - city is Munich and it has the following attractions:
I need to perform the following:
Send a query to Wikipedia in the given language (this case it is German, for it is more likely that German wiki has a respective article.
Once the article is found I want to get its page title and first 2-3 paragraphs.
I want to strip-down any Wiki-markup and get only the text.
It would be nice to have the text of this article along with the title in the original ("de") and in some other languages.
I tried Linq-to-Wiki from NuGet Repository, but I can't get this scenario to run... Here is my code that justly times out:
var en

2013-06-11 23:10:01

2.0 version of System.Management.Automation?

Is there a 2.0 (or greater) version of the
I'm looking at the
class in C# which says that this class was introduced with
PowerShell 2.0
. Does that version number correspond with the version number I'm seeing when I add the reference to the assembly in Visual Studio?
This is kind of an additional question to
my other question
which is in regards to having trouble resolving the
class inside that assembly.
I've tried the
assembly in both the GAC:
C:\Windows\assembly\GAC_MSIL\System.Mana gement.Automation\ e35
Reference Assemblies
C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v 1.0
Both containing folders only have version 1.0
I have PowerShell 2.0 installe

2013-06-11 21:04:12

mongo update $set value copied from array

Can someone show me the syntax for setting the value of a field from an array in the same document? That is, given:
{ "MyArray" : [ 1, 2, 3 ] }
I need to update it to
{ "MyArray" : [ 1, 2, 3 ], "NewValue" : 3 }

2013-06-11 19:44:32

LessCssProcessor import and declaration for wro4j

I'm trying to use a LessCss processor in my maven project using wro4j version 1.45. I use this import statement and I get an error at build time saying it isn't recognized.
import ro.isdc.wro.extensions.processor.support .less.LessCssProcessor;
All help is appreciated

2013-06-11 19:44:18

View More (Log In and Will Fans)

Win the T-shirt

with only 4000 points

Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.

© 2010-2018 Fabrizio Fichera


Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.

Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !

evolveStar.com provides a search engine that allows you to gather information to write their own blog.

evolveStar.com enhances the sources displaying the logo of the site.

If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com

Specifies the subject copyright violation and the url of the page

evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.

Next will be effectual and relevant checks.