All Questions

Ask Question
5001795 questions
1

votes
1

answer
247

views

Using .select, .uniq and .order in PostgreSQL

I have a one-to-many relationship between the models Organizer and Event. I want to get the five organizers that most recently has updated an event. Event.order('updated_at asc'). where(organizer_id: [1,2,3,4,5,6,7,8,9]). select(:organizer_id).uniq.limit(5) The above code works good in SQLite3 but t...
Fellow Stranger
1

votes
2

answer
2.2k

views

How to use Function VB.NET Insert To Database?

i using function with vb.net. i'm query sql to datagridview and insert data from datagridview to Databse By function. But Error in function: The name 'EXHBK13004' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted. i wa...
nettoon493
1

votes
4

answer
3.8k

views

C# create custom dialog result form

I have a two forms in C#, one I intend to use as a dialog result and the other is the "main" form. how do I set up the other form so that the code in form1 waits until the second form is dismissed before resuming executing the next line of code?
fifamaniac04
1

votes
3

answer
380

views

Sorting NSDocumentDirectory by name

I want to sort all NSDocumentDirectory by fileName but folders should be first by name and then all files are sorted by name. In my Document Directory, i have lots of files and folders also. i have the array like, _filePathsArray =[[NSFileManager defaultManager] contentsOfDirectoryAtPath:_selectedPa...
Apple
1

votes
3

answer
122

views

Unsigned 64 bit integers which cannot map onto a double [duplicate]

This question already has an answer here: Are all integer values perfectly represented as doubles? [duplicate] 5 answers Are there unsigned 64 bit integer values which cannot be represented with a double precision floating point type? (As a double is also 64 bit there must be some.) If so, how can...
aggsol
1

votes
1

answer
1.3k

views

ssh tail output lines only with keyword

I'm trying to tail a large file in an ssh command prompt, but I need to filter it so it only displays lines that contain a particular keyword in them. I'm using this command currently to tail. # tail /usr/local/apache/logs/access_log If possible please let me know what I would add to this command to...
sven30
1

votes
1

answer
855

views

Animation in HTML without lag

I am trying to create a spinning animation using HTML and jQuery. I have tried two different ways: 1) Wrote my custom animation function to make the animation happen. $(window).load(function() { $(".vfx_1").css({width:'550px', height:'400px', position:'absolute', top: '250px', left: '150px'}); //40...
1

votes
1

answer
6.6k

views

Using an embedded .dll in an executable

Okay. So I know there's lots of questions about how to embed dlls inside exes, but my problem is rather different. (Specifically, I'm using the fmod library to play sounds in my program, and I'm embedding the fmod.dll, but that's beside the point.) I am using Visual C++ 2010 Ultimate. I have succes...
Pojo
1

votes
1

answer
4k

views

Incorrect syntax parsing :setvar in SQLCMD mode

I downloaded an AdventureWorks 2012 LT Script from CodeProject, but when I try to run it it says: Incorrect syntax was encountered while parsing :setvar. There's nothing more than this: :setvar SqlSamplesDatabasePath "C:\Program Files\...\DATA\"; :setvar SqlSamplesSourceDataPath "C:\Samples\...\";...
pangular
1

votes
1

answer
90

views

boost foreach with protected inheritance of container

I'm getting a compile time error with the following code. The error pops up on the use of BOOST_FOREACH on line 23: 17 class MyVec: protected std::vector 18 { 19 public: 20 void add(int i) { this->push_back(i); } 21 void print() 22 { 23 BOOST_FOREACH(int i,...
user2604093
1

votes
1

answer
947

views

object of type 'NoneType' has no len() Python

I have been experimenting with dicts in python so I can remove 'magic numbers' as I think they are referred to but I keep getting the error: object of type 'NoneType' has no len(). It only happens some of the time in my hangman program, and I am unsure why. This is the general area where I think it...
AlexSwearingen
1

votes
1

answer
248

views

Why does GTK+ define TRUE and FALSE?

Why do GTK+ and several other frameworks provide TRUE and FALSE macros? Is there any advantage to using TRUE and FALSE instead of the built-in C values true and false? You can see their implementation here: http://www.gtk.org/api/2.6/glib/glib-Standard-Macros.html#TRUE:CAPS
Will Kunkel
1

votes
1

answer
570

views

How to make ANE that accesses GooglePlay GameServices

I develop AdobeAIR App for Android. So, I try to make ANE(ActionScript Native Extensions)that accesses GooglePlay GameServices. But, it is now working because of the following problem. [Error] 07-22 11:22:44.976: W/Bundle(24987): Key com.google.android.gms.games.APP_ID expected String but value...
user2081756
1

votes
1

answer
603

views

dynamically changing entry value of util:map in Spring

I have defined below map definition in spring config file,So I will get the clientList map object.So my question is,i want to change the entry key "java" value based on some other condition. So here,i can do this after getting map object and using if conditions.Is any otherway i can do this in sprin...
user2610401
1

votes
3

answer
2.7k

views

Difference between multi dimensional arrays and array of pointers

I always believed that in C : int a[5][3]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; refers to an array of arrays and in memory fifteen contiguous blocks are stored but a[0] is the pointer to a[0][0] and a[1] is the pointer to a[1][0] and so on. So I thought it to be similar to be an array of pointers....
user1369975
1

votes
1

answer
943

views

Offline storage for mobile devices?

I am writing a mobile website that needs to store some data offline, and to sync that data when there is an internet connection. It is possible to use HTML5 Web SQL Databases, but there's a space limit of 5MB. I am wondering: Can I create multiple databases in HTML5 Web SQL Databases, so that the to...
HQXU85
1

votes
2

answer
4.2k

views

NumPy in IDLE (Python 3.3.2) on Mac OSx 10.8

I know this may be a repeat question, but all the answers I've found on here are WAY above my head. I'm very new at Python, but I would like to use NumPy in IDLE (python 3.3.2). IDLE doesn't seem to access the numpy that comes w/ OSX 10.8 (which is python 2.7). I can't find a Numpy for Python 3 inst...
Kim Delaney
1

votes
1

answer
1.4k

views

Rscript does not work when invoked in PHP but does from Command Prompt

I am trying to execute an R script from my PHP page using the exec function. I have set the environment variables in Windows and Rscript works fine on the command prompt. However on the PHP page it says, " 'Rscript' is not recognized as an internal or external command, operable program or batch file...
user1523478
1

votes
1

answer
88

views

CSS Width Property Not Getting Set

I will try to explain myself as best I can because I really don't want to have to copy all the code over (there is a lot). I have a span which is getting text from an AngularJS binding (not important to this question) and I am setting four style parameters to this span: A width: 100px white-space: n...
Nigh7Sh4de
1

votes
1

answer
71

views

every time I change my widget xml, I get runtime error in eclipse

I try to edit my android widget xml. everytime I change one property (drawable, gravity...) The layout is marked as error build runs OK, but the application doesn't run. Eclipse says there are errors, but I see no in the error window/problem/log-cat Unexpected namespace prefix "xmlns" found for tag...
Elad Benda
1

votes
1

answer
1.4k

views

Panda3d model rotation

I have a program I'm writing based off of a tutorial: from direct.showbase.ShowBase import ShowBase class MyApp(ShowBase): def __init__(self): ShowBase.__init__(self) # Load the environment model. self.environ = self.loader.loadModel("models/misc/rgbCube") # Reparent the model to render. self.enviro...
Elias Benevedes
1

votes
1

answer
845

views

Barometer App - Where to from here?

I am working on a basic barometer app and I have run into a slight snag. I want to take the data that is being received and have it run through a text view that I have setup just for the pressure variable. Here is my code to this point: import android.app.Activity; import android.hardware.Sensor; im...
CodeMonkeyAlx
1

votes
2

answer
2.4k

views

PHP DomDocument appendChild to end of root

I've got an XML formatted like so foo 1 bar 2 And I've created a new element with info from a form. When I do $dom->appendChild($newthing), it's appended to the end of the document, after . Like this foo 1 bar 2 bar 2 Obviously I want my new element to be a child of the root element, not after it....
ejfrancis
1

votes
1

answer
119

views

Navigate from child to Parent not work

In my usecase, I want to navigate from parent route to a child route and from child to parent. The first case work, but the second not. Why? What is wrong? Is the mistake in renderTemplate? App = Ember.Application.create(); App.Router.map(function() { this.resource('parent',function(){ this.resourc...
abuder
1

votes
2

answer
7k

views

Make submenu dropdown wider than parent li

I did the job by make the submenu functioning, the problem is I can't get the submenu width wider than its parent. when i hover, its messed up as you can see in fiddle links i provided below please take a look at this http://jsfiddle.net/wR5L5/ .navigation { height: 35px; background: #333; } .navig...
robbiejobs
1

votes
1

answer
565

views

Java Generics: Implement multiple sub-interfaces of an generic interface

I've following codes. interface Observer { void update(); } interface FirstClassObserver extends Observer{ } interface SecondClassObserver extends Observer { } Now, I'm required to do as follows. class MainClass implements FirstClassObserver, SecondClassObserver { } But Eclipse give following proble...
TheKojuEffect
1

votes
1

answer
785

views

Node.js supertest post gzipped data

I'd like to write a test to post up some zipped data to a url as follows, but it doesn't work: zlib.gzip('foo_bar_data', function (err, buffer) { request(app) .post('/foo/bar') .set('Content-Encoding', 'gzip') .send(buffer) .expect(200) .end(function(err, res){ if (err) return done(err); //various o...
user1328174
1

votes
2

answer
454

views

Choosing same option in select list

What I have is a html select list that is populated through jquery. Right now I have the change event so that when I change the option, the map refocuses on the POI. I'm trying to make it work so that when I click on the same option, the map treats it as a change event. Options don't support click e...
Nixon
1

votes
1

answer
301

views

How to use two gruntfiles for the same project/folder?

i think i am in a special situation. I am building a website and a mobile web-app based on the same source (with a few expectation like e.g. the index.html) But that's why I need need two Gruntfiles to configure the build-tasks for each project separately (the site and the app). How can I work with...
fabian
1

votes
3

answer
2.5k

views

How to format mySQL date to show in datepicker in android?

When I get a date from mySQL, its in the format 2013-06-05, but when I try to display it in a datepicker dialog, I am getting the year 1933 and the month and day is also not right... The variable Setdate would be the string "2013-06-05". public void onClick(View v) { // TODO Auto-generated method st...
sneaky
1

votes
1

answer
964

views

How to convert django variable into json in template properly

I am using django-jsonify to convert django variable into json in javascript, and it returns such list [{"pk": 4, "model": "api.post", "fields": {"summary": "Testing", "title": "My Test"}}, {"pk": 5, "model": "api.post", "fields": {"summary": "testing again", "title": "Another test"}}] But desired...
Aydar Omurbekov
1

votes
1

answer
2.3k

views

can't clone repo from remote - ssh keys identification error

I'm on Windows and I'm using Git Bash. I want to clone remote bare repository. Supposedly I've set up ssh keys correctly, because I can access server through ssh protocol. I've tested it by trying to get a list of directories on server: $ ssh [email protected] ls It asks for passphrase: Enter pass...
1

votes
1

answer
66

views

clear piped output without interrupting program?

I am running a program (pianobar) piped to a text file, that outputs every second. The resulting file ("pianobarout.txt") needs to be cleared regularly, or it grows to massive proportions. However, I do not want to stop pianobar to clear the file. I have tried running > pianobarout.txt as well as...
Greg Schoppe
1

votes
1

answer
252

views

Process memory management queries

Here is a picture summarizing my understanding of process memory layout as organized by kernel. I would like to understand 1)When is Segmentation and Paging process takes place? During compilation or right after the program is executed 2) At any given instance is it by any means possible to access...
Keen Learner
1

votes
1

answer
3.1k

views

Beautifulsoup and Soupstrainer for getting links dont work with hasattr, returning always true

i am using Beautifulsoup4 and Soupstrainer with Python 3.3 for getting all links from a webpage. The following is the important code-snippet: r = requests.get(adress, headers=headers) for link in BeautifulSoup(r.text, parse_only=SoupStrainer('a')): if hasattr(link, 'href'): I tested some webpages an...
zwieback86
1

votes
1

answer
640

views

SublimeText3 plugin on_modified api implementation

I'm trying to develop some plugin for SublimeText3. The plugin is supposed to behave on every modification of the text, so looking at the api http://www.sublimetext.com/docs/3/api_reference.html on_modified_async(view) is the one to use I guessed. so the code goes like this: #!/usr/bin/env python im...
Ken OKABE
1

votes
3

answer
2.8k

views

Modify specifics lines on a text file in matlab

I have a test.txt file which contains bla bla bla ble ble BEGIN_SCAN 100 150 200 300 150 800 END_SCAN blebleble blublublu I would like to change only the numbers between BEGIN_SCAN and END_SCAN for this matrix M = [100 125; 200 350; 150 835] saving the result on result.txt file. Any idea?
cvc
1

votes
1

answer
3.4k

views

SystemVerilog packed array vs unpacked array memory footprint

Is it true that with the contemporary advanced SV RTL simulators, the simulation footprint may increase when using unpacked arrays vs the packed arrays? If so, is this a problem and do verification teams insist on rules to use packed arrays? TIA. Sanjay
shparekh
1

votes
3

answer
1.6k

views

jquery click to hide and show another button

I have two buttons set as hidden : I have a jquery where I check some conditions fetched from the database. Either one of the button will be shown and that depends on if the condition is 1 or 0..That means when I click any of the button it must get hidden and the other one must shown up..? But it's...
user2605321
1

votes
3

answer
5.6k

views

C# not reading excel date from spreadsheet

I uploaded an excel spreadsheet using Microsoft.Office.Interop.Excel. When I try to read cells with a date value in order to insert it into my data set, its not being recognized as a date and it comes up as a random number? this is the way that I refer to the cell: Excel.Range startDate = objsheet.g...
user2140832

View more questions