question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,190,568
6,190,621
Set .m2 for a single build-job to different location
For a build-job on a build-server, I want to set the.m2 location to something different from user.home/.m2. I thought I could trick maven by setting export HOME=$WORKSPACE for the build, but artifacts kept being downloaded and being deployed to the build user's home directory. Therefore I think that maven uses the user...
You can override the location of the settings.xml file from the command line... mvn --settings /path/to/settings.xml From here you can customize anything you would need. [update] You can even override the "global" settings which are typically merged with the user's settings.xml form their.m2 directory via --global-sett...
Set .m2 for a single build-job to different location For a build-job on a build-server, I want to set the.m2 location to something different from user.home/.m2. I thought I could trick maven by setting export HOME=$WORKSPACE for the build, but artifacts kept being downloaded and being deployed to the build user's home ...
TITLE: Set .m2 for a single build-job to different location QUESTION: For a build-job on a build-server, I want to set the.m2 location to something different from user.home/.m2. I thought I could trick maven by setting export HOME=$WORKSPACE for the build, but artifacts kept being downloaded and being deployed to the ...
[ "java", "maven" ]
5
6
1,619
2
0
2011-05-31T16:23:10.813000
2011-05-31T16:28:33.560000
6,190,571
6,192,185
LINQ to get the field values seperated by delimiter
I have a situation where I need to display ItemID and ItemName from Items table. Let's say ItemID is 002, and ItemName is Apple. I have another field called SupplementaryItems in the table which stores related ItemID seperated by | (delimiter), something like 003|004|005. I am using MVC3 with a repository pattern, some...
This is the best I could come up with. It will result in two queries, but never pulls the entire table into memory. var q = from item in (from item in TblItems where item.ItemID == 1 select new { Name = item.ItemName, SupplementaryItems = item.SupplementaryItems.Split('|') }).AsEnumerable() select new { Name = item.Nam...
LINQ to get the field values seperated by delimiter I have a situation where I need to display ItemID and ItemName from Items table. Let's say ItemID is 002, and ItemName is Apple. I have another field called SupplementaryItems in the table which stores related ItemID seperated by | (delimiter), something like 003|004|...
TITLE: LINQ to get the field values seperated by delimiter QUESTION: I have a situation where I need to display ItemID and ItemName from Items table. Let's say ItemID is 002, and ItemName is Apple. I have another field called SupplementaryItems in the table which stores related ItemID seperated by | (delimiter), somet...
[ "c#", "linq-to-sql", "join", "self", "delimiter" ]
1
1
1,035
1
0
2011-05-31T16:23:21.343000
2011-05-31T18:58:13.237000
6,190,573
6,232,252
ListView in background receives input (Fragment API)
My app is based on a tabbed layout where each tab is assignes a FragmentActivity. One of this activities has the following layout: When switching to that tab, a list is created and shown. If a list item is selected, a Fragment is created and shown on top of the list: Filiale fragment = new Filiale(); FragmentManager fr...
The reason for this behaviour is that ViewGroups by default don't handle input events, but pass them through to widgets behind them, if there are any. In my given code, the list has height "wrap_content", thus the remaining vertical area is covered only by the LinearLayout element which passes input through to the hidd...
ListView in background receives input (Fragment API) My app is based on a tabbed layout where each tab is assignes a FragmentActivity. One of this activities has the following layout: When switching to that tab, a list is created and shown. If a list item is selected, a Fragment is created and shown on top of the list:...
TITLE: ListView in background receives input (Fragment API) QUESTION: My app is based on a tabbed layout where each tab is assignes a FragmentActivity. One of this activities has the following layout: When switching to that tab, a list is created and shown. If a list item is selected, a Fragment is created and shown o...
[ "android", "tabs", "focus", "fragment", "android-framelayout" ]
1
1
917
1
0
2011-05-31T16:23:26.527000
2011-06-03T20:23:11.977000
6,190,575
6,190,675
jQuery live() on HTML Element
I've got the following in my section: That isn't working. However: does work (except the live() functionality of adding the event listener as I dynamically had h5 elements). Any idea why the live() call isn't working on h5. If I call $(".addButton").live(...) it does work (notice my selector is a class, not an html ele...
I think you're hitting something other than h5 / jQuery live problems. Look at this fiddle, it's just h5s with a live click event handler: http://jsfiddle.net/Vjwfx/2/ Works well. So it must be something else you're adding.
jQuery live() on HTML Element I've got the following in my section: That isn't working. However: does work (except the live() functionality of adding the event listener as I dynamically had h5 elements). Any idea why the live() call isn't working on h5. If I call $(".addButton").live(...) it does work (notice my select...
TITLE: jQuery live() on HTML Element QUESTION: I've got the following in my section: That isn't working. However: does work (except the live() functionality of adding the event listener as I dynamically had h5 elements). Any idea why the live() call isn't working on h5. If I call $(".addButton").live(...) it does work...
[ "html", "jquery" ]
1
1
1,548
1
0
2011-05-31T16:23:34.780000
2011-05-31T16:33:24.420000
6,190,585
6,190,674
Visual studio unit tests and client server programs
I have a solution that is client server. The client and the server are projects in the same solution. I want to unit test the client, which, obviously, requires that the server be running. Is there some way to specify in the unit test project that the server project should be started before running a particular unit te...
The best approach to this is to actually write REAL unit tests. What you are running now is considered an integration test. A true unit test is system indepenent and repeatable, and should make one assertion of functionality for one component. By system independent I mean that it should not depend on a running instance...
Visual studio unit tests and client server programs I have a solution that is client server. The client and the server are projects in the same solution. I want to unit test the client, which, obviously, requires that the server be running. Is there some way to specify in the unit test project that the server project s...
TITLE: Visual studio unit tests and client server programs QUESTION: I have a solution that is client server. The client and the server are projects in the same solution. I want to unit test the client, which, obviously, requires that the server be running. Is there some way to specify in the unit test project that th...
[ "c#", "visual-studio", "unit-testing", "client-server" ]
3
3
2,651
6
0
2011-05-31T16:24:46.883000
2011-05-31T16:33:18.880000
6,190,599
6,190,631
VB.NET MySQL connection
Can Visual Studio natively connect to a MySQL database or do I need to install a 3rd party connector first? Could someone please provide a small code example either way? I can't seem to make this work.
Can Visual Studio natively connect to a MySQL database? Based upon my knowledge, no. Do I need to install a 3rd party connector first? Yes, MySQL has their own.NET Connector. Could someone please provide a small code example either way? I can't seem to make this work. Here is the link to the MySQL Connector documentati...
VB.NET MySQL connection Can Visual Studio natively connect to a MySQL database or do I need to install a 3rd party connector first? Could someone please provide a small code example either way? I can't seem to make this work.
TITLE: VB.NET MySQL connection QUESTION: Can Visual Studio natively connect to a MySQL database or do I need to install a 3rd party connector first? Could someone please provide a small code example either way? I can't seem to make this work. ANSWER: Can Visual Studio natively connect to a MySQL database? Based upon ...
[ "mysql", "vb.net" ]
2
10
57,839
2
0
2011-05-31T16:26:18.907000
2011-05-31T16:29:36.010000
6,190,605
6,190,729
Android: are there cases when an Activity is re-created even when "android:configChanges=" set to everything?
First, a short description of the problem's background: I've run into troubles with handling background workers lifecycles in line with Activity lifecycle. First problem is that a new instance of activity is created whenever the configuration changes (this includes screen orientation) so I had to pull my workers from t...
If you are asking this, your app is probably broken. So -- why do you care? If you can't handle your activity being restarted, then you will break in the situation where your app's process needs to be killed for memory while in the background and the user later returns to it. If you can handle being restarted, why do y...
Android: are there cases when an Activity is re-created even when "android:configChanges=" set to everything? First, a short description of the problem's background: I've run into troubles with handling background workers lifecycles in line with Activity lifecycle. First problem is that a new instance of activity is cr...
TITLE: Android: are there cases when an Activity is re-created even when "android:configChanges=" set to everything? QUESTION: First, a short description of the problem's background: I've run into troubles with handling background workers lifecycles in line with Activity lifecycle. First problem is that a new instance...
[ "android", "android-activity", "dialog", "android-asynctask", "android-configchanges" ]
1
1
434
2
0
2011-05-31T16:26:47.923000
2011-05-31T16:37:52.277000
6,190,609
6,191,866
Add a constructor to a boost::python vector_indexing_suite exposed class
I'd like to add a constructor so I can do this (my bytes are in strings because I'm using python 2.6 and 2.7): import myboostpymodule d = 'serialised representation of a vector of some c++ objects' vec = myboostpymodule.MyVectorType(d) Where I overload the vector constructor to accept a string, which will contain ser...
I don't think using boost::python::wrapper will help you, since you'll need to use the constructor. I looked at boost::python::vector_indexing_suite definition and I think you can in fact define your own constructor. There's a function in boost::python to specify your own named constructors. It is usually used to imple...
Add a constructor to a boost::python vector_indexing_suite exposed class I'd like to add a constructor so I can do this (my bytes are in strings because I'm using python 2.6 and 2.7): import myboostpymodule d = 'serialised representation of a vector of some c++ objects' vec = myboostpymodule.MyVectorType(d) Where I o...
TITLE: Add a constructor to a boost::python vector_indexing_suite exposed class QUESTION: I'd like to add a constructor so I can do this (my bytes are in strings because I'm using python 2.6 and 2.7): import myboostpymodule d = 'serialised representation of a vector of some c++ objects' vec = myboostpymodule.MyVecto...
[ "boost-python" ]
2
1
1,485
1
0
2011-05-31T16:26:59.657000
2011-05-31T18:28:11.343000
6,190,611
6,190,777
all my android projects have phantom errors
Any of the projects that I have open have errors all of a sudden. Ive tried reinstalling java, eclipse, and android but nothing works. However, when I import the projects to my other computer they have no errors. Am I going to have to format my machine? I just went through every process but that and I really dont want ...
I had same problem a few weeks. Look in the Problems folder of eclipse. See if you debug certifcate expired. Reference: http://javadude.wordpress.com/2010/09/28/eclipse-throws-debug-certificate-expired/ This page gives you directions to fix.
all my android projects have phantom errors Any of the projects that I have open have errors all of a sudden. Ive tried reinstalling java, eclipse, and android but nothing works. However, when I import the projects to my other computer they have no errors. Am I going to have to format my machine? I just went through ev...
TITLE: all my android projects have phantom errors QUESTION: Any of the projects that I have open have errors all of a sudden. Ive tried reinstalling java, eclipse, and android but nothing works. However, when I import the projects to my other computer they have no errors. Am I going to have to format my machine? I ju...
[ "android" ]
0
2
351
3
0
2011-05-31T16:27:30.830000
2011-05-31T16:43:00.720000
6,190,612
6,190,711
how to write python array (data = []) to excel?
I am writing a python program to process.hdf files, I would like to output this data to an excel spreadsheet. I put the data into an array as shown below: Code: data = [] for rec in hdfFile[:]: data.append(rec) from here I have created a 2D array with 9 columns and 171 rows. I am looking for a way to iterate through t...
A great file type to be aware of is a CSV, or Comma Separated Value file. It's a very simple text file type (normally already associated with Excel or other spreadsheet apps) where each comma separates multiple cells on the same row and each new line in the file represents data on a new row. I.E.: A,B,C 1,2,3 "Hello, W...
how to write python array (data = []) to excel? I am writing a python program to process.hdf files, I would like to output this data to an excel spreadsheet. I put the data into an array as shown below: Code: data = [] for rec in hdfFile[:]: data.append(rec) from here I have created a 2D array with 9 columns and 171 r...
TITLE: how to write python array (data = []) to excel? QUESTION: I am writing a python program to process.hdf files, I would like to output this data to an excel spreadsheet. I put the data into an array as shown below: Code: data = [] for rec in hdfFile[:]: data.append(rec) from here I have created a 2D array with 9...
[ "python", "arrays", "excel-2007", "python-2.7", "xlwt" ]
5
4
25,349
3
0
2011-05-31T16:27:31.047000
2011-05-31T16:36:24.247000
6,190,613
6,190,961
JS XML Parsing: Value Not Changing
I am parsing XML with Javascript. My XML looks like this: Channel 1 Channel 2 Ignore the strange structure (out of my control). I am running this JS code: function updateAnalogCfgValues (xmlDoc) { var analogCfgs = xmlDoc.selectNodes ("//channel"); var cfg = analogCfgs.nextNode (); var cnt = 1; while (cfg!== null) { va...
Looking at an XPath tutorial and getting some help from a co-worker led to the answer. I needed my search string to be.//Label. This selects my current channel node and then looks for the label node. Before, it was just searching the whole document for the first label node, which is why things didn't change.
JS XML Parsing: Value Not Changing I am parsing XML with Javascript. My XML looks like this: Channel 1 Channel 2 Ignore the strange structure (out of my control). I am running this JS code: function updateAnalogCfgValues (xmlDoc) { var analogCfgs = xmlDoc.selectNodes ("//channel"); var cfg = analogCfgs.nextNode (); var...
TITLE: JS XML Parsing: Value Not Changing QUESTION: I am parsing XML with Javascript. My XML looks like this: Channel 1 Channel 2 Ignore the strange structure (out of my control). I am running this JS code: function updateAnalogCfgValues (xmlDoc) { var analogCfgs = xmlDoc.selectNodes ("//channel"); var cfg = analogCfg...
[ "javascript", "xml" ]
1
1
159
1
0
2011-05-31T16:27:31.517000
2011-05-31T17:01:00.810000
6,190,617
6,190,824
How can I create a read-only class member in Scala?
I want to create a Scala class where one of its var is read-only from outside the class, but still a var. How can I do it? If it was a val, there was no need to do anything. By default, the definition implies public access and read-only.
Define a public "getter" to a private var. scala> class Foo { | private var _bar = 0 | | def incBar() { | _bar += 1 | } | | def bar = _bar | } defined class Foo scala> val foo = new Foo foo: Foo = Foo@1ff83a9 scala> foo.bar res0: Int = 0 scala> foo.incBar() scala> foo.bar res2: Int = 1 scala> foo.bar = 4:7: error:...
How can I create a read-only class member in Scala? I want to create a Scala class where one of its var is read-only from outside the class, but still a var. How can I do it? If it was a val, there was no need to do anything. By default, the definition implies public access and read-only.
TITLE: How can I create a read-only class member in Scala? QUESTION: I want to create a Scala class where one of its var is read-only from outside the class, but still a var. How can I do it? If it was a val, there was no need to do anything. By default, the definition implies public access and read-only. ANSWER: Def...
[ "scala", "variables", "member" ]
18
36
7,215
2
0
2011-05-31T16:28:13.887000
2011-05-31T16:47:44.430000
6,190,620
6,190,671
how to see generated sql from a linq query
Just trying to get the sql that is generated by a linq query.
With Linq2Sql dc.GetCommand(query).CommandText see http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.getcommand.aspx for more info. But I usually use LinqPad
how to see generated sql from a linq query Just trying to get the sql that is generated by a linq query.
TITLE: how to see generated sql from a linq query QUESTION: Just trying to get the sql that is generated by a linq query. ANSWER: With Linq2Sql dc.GetCommand(query).CommandText see http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.getcommand.aspx for more info. But I usually use LinqPad
[ "sql", "linq" ]
32
33
94,003
7
0
2011-05-31T16:28:29.550000
2011-05-31T16:33:13.717000
6,190,622
6,190,660
Mock mail on xampp development box
I have a local development box that I code on before I transfer my programs to a test server. It's a basic xampp set up. However, this limits my ability to test on the local box when I have to send mail in my program. Is there a way to mock this? I don't have any desire to set up a mail server on my local machine. Most...
I tend to just use GMAIL via SMTP (easy enough to setup a free test GMAIL account). ProjectPier has a tutorial on it, just read between the lines and set it up for your needs: http://www.projectpier.org/node/817 There is also a generic tutorial, which I would prefer to use, here: http://expertester.wordpress.com/2010/0...
Mock mail on xampp development box I have a local development box that I code on before I transfer my programs to a test server. It's a basic xampp set up. However, this limits my ability to test on the local box when I have to send mail in my program. Is there a way to mock this? I don't have any desire to set up a ma...
TITLE: Mock mail on xampp development box QUESTION: I have a local development box that I code on before I transfer my programs to a test server. It's a basic xampp set up. However, this limits my ability to test on the local box when I have to send mail in my program. Is there a way to mock this? I don't have any des...
[ "php", "email", "testing", "mocking", "xampp" ]
1
1
667
2
0
2011-05-31T16:28:35.867000
2011-05-31T16:32:13.717000
6,190,627
6,191,436
Issue with contentOffset
Right now i'm working on an app which uses a custom splitView, it has a PDFTableController which represents the rootViewController and popover table and I have AffirmaPDFViewController which represents the detailViewController. The way the interface is set up is that there is a scrollView and within the scrollView ther...
Based on the garbage values, it looks like the scroll view and the web views haven't been added to the view hierarchy or they haven't been connected via outlets.
Issue with contentOffset Right now i'm working on an app which uses a custom splitView, it has a PDFTableController which represents the rootViewController and popover table and I have AffirmaPDFViewController which represents the detailViewController. The way the interface is set up is that there is a scrollView and w...
TITLE: Issue with contentOffset QUESTION: Right now i'm working on an app which uses a custom splitView, it has a PDFTableController which represents the rootViewController and popover table and I have AffirmaPDFViewController which represents the detailViewController. The way the interface is set up is that there is ...
[ "xcode", "ios", "ipad", "uitableview", "uiwebview" ]
0
0
700
1
0
2011-05-31T16:29:03.657000
2011-05-31T17:48:19.437000
6,190,628
6,191,298
asp.net mvc 3 change "URL" from "/" to "?id="
I am using MVC 3. The page contents come from SQL database. I notice a problem when I try to pass variables using Javascript. It does not work when the url showing directory/pagename, however it works if the url is directory?=pagename!! Any idea why and how can I change the url to be?=id. Here is the action link: <%: H...
It should work with /controller/action/id, but you can always do something like: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}?id={id}", // URL with parameters new { controller = "Home", act...
asp.net mvc 3 change "URL" from "/" to "?id=" I am using MVC 3. The page contents come from SQL database. I notice a problem when I try to pass variables using Javascript. It does not work when the url showing directory/pagename, however it works if the url is directory?=pagename!! Any idea why and how can I change the...
TITLE: asp.net mvc 3 change "URL" from "/" to "?id=" QUESTION: I am using MVC 3. The page contents come from SQL database. I notice a problem when I try to pass variables using Javascript. It does not work when the url showing directory/pagename, however it works if the url is directory?=pagename!! Any idea why and ho...
[ "asp.net-mvc", "asp.net-mvc-3" ]
0
0
1,123
1
0
2011-05-31T16:29:16.710000
2011-05-31T17:35:02.713000
6,190,629
6,190,791
jQuery UI Autocomplete Category How to Skip Category Headers
I've got a working autocomplete field in my web application and I'm looking for a way to increase the usability of the field by somehow automatically skipping the category fields when an arrow key is used to scroll down the available choices (after typing in a partial search term). For example, if a user starts typing ...
This line: ul.append( " " + item.category + " " ); is causing the problem. Internally, the widget uses list items with a class ui-menu-item to distinguish whether or not an li is an actual menu item that can be selected. When you press the 'down' key, the widget finds the next item with a class ui-menu-item and moves t...
jQuery UI Autocomplete Category How to Skip Category Headers I've got a working autocomplete field in my web application and I'm looking for a way to increase the usability of the field by somehow automatically skipping the category fields when an arrow key is used to scroll down the available choices (after typing in ...
TITLE: jQuery UI Autocomplete Category How to Skip Category Headers QUESTION: I've got a working autocomplete field in my web application and I'm looking for a way to increase the usability of the field by somehow automatically skipping the category fields when an arrow key is used to scroll down the available choices...
[ "jquery-ui", "autocomplete", "jquery-ui-autocomplete", "categories" ]
9
6
4,208
3
0
2011-05-31T16:29:21.313000
2011-05-31T16:44:17.647000
6,190,634
6,191,392
Prevent Background Thread "Timeout expired." error
I have the following portion of code on a Click Event on my page: Dim ts As New ThreadStart(AddressOf SendEmails) Dim t As New Thread(ts) t.IsBackground = True t.Start() This actions the SendEmails method which sends out 1000s of newsletter emails. However, it seems this is timing out, as I've been able to log the foll...
Showing some code in the "SendEmails" function will be helpful. The timeout is probably happening at SMTP level...looking at the error message, it could also be that the server has closed the SMTP connection. Knowing what Email server you are connecting to will also be helpful. If it's an Exchange Server, the admin pro...
Prevent Background Thread "Timeout expired." error I have the following portion of code on a Click Event on my page: Dim ts As New ThreadStart(AddressOf SendEmails) Dim t As New Thread(ts) t.IsBackground = True t.Start() This actions the SendEmails method which sends out 1000s of newsletter emails. However, it seems th...
TITLE: Prevent Background Thread "Timeout expired." error QUESTION: I have the following portion of code on a Click Event on my page: Dim ts As New ThreadStart(AddressOf SendEmails) Dim t As New Thread(ts) t.IsBackground = True t.Start() This actions the SendEmails method which sends out 1000s of newsletter emails. Ho...
[ "vb.net", "timeout", "asp.net-3.5", "background-thread" ]
1
1
931
1
0
2011-05-31T16:29:45.130000
2011-05-31T17:43:55.597000
6,190,636
6,190,846
What are things to take into account when implementing a custom RESTful interface in a webapp?
I'm currently exploring the different options for building a not-too-complex web application, in which some role based access control is involved. Furthermore, read/write operations on a small number (think around 5) of different database tables must be performed. I've been toying with the idea of creating a JSON-based...
Well, it's a global question that will require a big answer:) First of all, about your Twitter question, they use hashbang uri style. When you go to twitter.com/cx42net for example, you are automatically redirected to twitter.com/#!/cx42net. When it's a crawler, like Google bots, the crawler will change #! by?_escaped_...
What are things to take into account when implementing a custom RESTful interface in a webapp? I'm currently exploring the different options for building a not-too-complex web application, in which some role based access control is involved. Furthermore, read/write operations on a small number (think around 5) of diffe...
TITLE: What are things to take into account when implementing a custom RESTful interface in a webapp? QUESTION: I'm currently exploring the different options for building a not-too-complex web application, in which some role based access control is involved. Furthermore, read/write operations on a small number (think ...
[ "json", "web-applications", "rest", "web-crawler" ]
3
3
77
1
0
2011-05-31T16:30:00.567000
2011-05-31T16:48:58.817000
6,190,644
6,190,775
In Mathematica, how to simplify expressions like a == +/- b into a^2 == b^2?
In Mathematica, how can I simplify expressions like a == b || a == -b into a^2 = b^2? Every function that I have tried (including Reduce, Simplify, and FullSimplify) does not do it. Note that I want this to work for an arbitrary (polynomial) expressions a and b. As another example, a == b || a == -b || a == i b || a ==...
The Boolean expression can be converted to the algebraic form as follows: In[18]:= (a == b || a == -b || a == I b || a == -I b) /. {Or -> Times, Equal -> Subtract} // Expand Out[18]= a^4 - b^4 EDIT In response to making the transformation leave out parts in other variables, one can write Or transformation function, an...
In Mathematica, how to simplify expressions like a == +/- b into a^2 == b^2? In Mathematica, how can I simplify expressions like a == b || a == -b into a^2 = b^2? Every function that I have tried (including Reduce, Simplify, and FullSimplify) does not do it. Note that I want this to work for an arbitrary (polynomial) e...
TITLE: In Mathematica, how to simplify expressions like a == +/- b into a^2 == b^2? QUESTION: In Mathematica, how can I simplify expressions like a == b || a == -b into a^2 = b^2? Every function that I have tried (including Reduce, Simplify, and FullSimplify) does not do it. Note that I want this to work for an arbitr...
[ "wolfram-mathematica", "simplify" ]
5
7
814
2
0
2011-05-31T16:30:41.877000
2011-05-31T16:42:52.560000
6,190,652
6,191,489
Nested forms with Vaadin / display contents of a collection
I would like to display a complex Java Bean in a Vaadin form so that the user can edit the bean. However the bean consists of simple properties (String, Integer and so on), but also of a collection of yet another bean (though this has only simple properties). What I like to do know is to display a table which contains ...
Maybe this example on Nested Beans and Subforms will help: Book of Vaadin Examples Also, this example looks like what you need http://demo.vaadin.com/book-examples/book/?restartApplication#component.form.subform.nestedtable
Nested forms with Vaadin / display contents of a collection I would like to display a complex Java Bean in a Vaadin form so that the user can edit the bean. However the bean consists of simple properties (String, Integer and so on), but also of a collection of yet another bean (though this has only simple properties). ...
TITLE: Nested forms with Vaadin / display contents of a collection QUESTION: I would like to display a complex Java Bean in a Vaadin form so that the user can edit the bean. However the bean consists of simple properties (String, Integer and so on), but also of a collection of yet another bean (though this has only si...
[ "java", "nested-forms", "vaadin" ]
4
4
4,282
1
0
2011-05-31T16:31:12.547000
2011-05-31T17:52:40.997000
6,190,653
6,191,602
NullReferenceException in SubSonic's 2.2 RecordBase.cs after Json request. Why?
I have an MVC project that consumes a WCF service. The service returns a collection of locations that is used to filter for autocomplete in a text box. I initially tried this with with my own "Person" object to ensure I had the entire thing working. jQuery call: $(function () { $("#txtGeoLocation").autocomplete({ sour...
I've managed to solve the problem, although not as elegant as I wanted it to be, and I would still like to know why I was having issues referencing a class exposed through my service. For the solution, I created a WebsiteGeoLocation model class that has some of the properties of the FeederService.GeoLocation class. I t...
NullReferenceException in SubSonic's 2.2 RecordBase.cs after Json request. Why? I have an MVC project that consumes a WCF service. The service returns a collection of locations that is used to filter for autocomplete in a text box. I initially tried this with with my own "Person" object to ensure I had the entire thing...
TITLE: NullReferenceException in SubSonic's 2.2 RecordBase.cs after Json request. Why? QUESTION: I have an MVC project that consumes a WCF service. The service returns a collection of locations that is used to filter for autocomplete in a text box. I initially tried this with with my own "Person" object to ensure I ha...
[ "c#", "jquery", "json", "subsonic", "nullreferenceexception" ]
0
0
195
1
0
2011-05-31T16:31:26.573000
2011-05-31T18:04:13.460000
6,190,654
6,190,833
how select item from a ListView?
my class extends Activity, not ListActivity. i have this code on create method but i select an item from the list, the background of it dont stay orange. I have to move the arrows in the emulator for down to navigate on the listview. When i click on the button center on the emulator, the log dont show the message. I ti...
Personnaly, I prefer to use click listeners on my view than using a itemclicklistener on the list itself. Click listeners on views can be shared, and you will get the source of the event using the parameter of onClick. Here is an example: private SharedClickListener sharedListener = new SharedClikListener(); private c...
how select item from a ListView? my class extends Activity, not ListActivity. i have this code on create method but i select an item from the list, the background of it dont stay orange. I have to move the arrows in the emulator for down to navigate on the listview. When i click on the button center on the emulator, th...
TITLE: how select item from a ListView? QUESTION: my class extends Activity, not ListActivity. i have this code on create method but i select an item from the list, the background of it dont stay orange. I have to move the arrows in the emulator for down to navigate on the listview. When i click on the button center o...
[ "java", "android", "android-listview" ]
0
0
213
1
0
2011-05-31T16:31:27.647000
2011-05-31T16:48:18.427000
6,190,655
6,194,401
How to prevent reload after change rotation jquerymobile
i developed a simple Android App with using jquerymobile and Phonegap. Problem is that, after change rotation, is app completely reloaded. Is possible to prevent this reload? Thanks very much for any advice.
It depends whether you want to stay in portrait mode, or whether you do want to switch orientation, but reload faster. If you want to stay in portrait mode irrespective of the orientation of the device then look at (for example) How do I disable orientation change on Android?. If you want to change orientation then you...
How to prevent reload after change rotation jquerymobile i developed a simple Android App with using jquerymobile and Phonegap. Problem is that, after change rotation, is app completely reloaded. Is possible to prevent this reload? Thanks very much for any advice.
TITLE: How to prevent reload after change rotation jquerymobile QUESTION: i developed a simple Android App with using jquerymobile and Phonegap. Problem is that, after change rotation, is app completely reloaded. Is possible to prevent this reload? Thanks very much for any advice. ANSWER: It depends whether you want ...
[ "android", "cordova" ]
2
4
5,469
5
0
2011-05-31T16:31:31.097000
2011-05-31T22:45:25.197000
6,190,657
6,190,708
PHP - Call to a member function find() on a non-object
So this error is killing me, heres the code: $html = file_get_html('vids.html'); foreach($html->find('a') as $element) { echo $element->name }
Did you include the simple_html_dom.php file first? include_once('/simple_html_dom.php'); And is your vids.html in the same directory you are calling from?
PHP - Call to a member function find() on a non-object So this error is killing me, heres the code: $html = file_get_html('vids.html'); foreach($html->find('a') as $element) { echo $element->name }
TITLE: PHP - Call to a member function find() on a non-object QUESTION: So this error is killing me, heres the code: $html = file_get_html('vids.html'); foreach($html->find('a') as $element) { echo $element->name } ANSWER: Did you include the simple_html_dom.php file first? include_once('/simple_html_dom.php'); An...
[ "php" ]
0
1
4,184
2
0
2011-05-31T16:31:42.920000
2011-05-31T16:36:09.863000
6,190,661
6,190,838
running a .sh file inside grails server
I am trying to run a bash file(.sh) to make some photos conversion in my grails server, my code is the following to make that task: def folderTo = grailsAttributes.getApplicationContext().getResource("/files/").getFile() def f = new File(folderFrom.toString()) def cmd = '/bin/bash /var/lib/tomcat6/webapps/malibueventap...
Sounds like you're not alone: How to solve "java.io.IOException: error=12, Cannot allocate memory" calling Runtime#exec()? Above SO thread provides a (possible) solution to your problem, give it a shot.
running a .sh file inside grails server I am trying to run a bash file(.sh) to make some photos conversion in my grails server, my code is the following to make that task: def folderTo = grailsAttributes.getApplicationContext().getResource("/files/").getFile() def f = new File(folderFrom.toString()) def cmd = '/bin/bas...
TITLE: running a .sh file inside grails server QUESTION: I am trying to run a bash file(.sh) to make some photos conversion in my grails server, my code is the following to make that task: def folderTo = grailsAttributes.getApplicationContext().getResource("/files/").getFile() def f = new File(folderFrom.toString()) d...
[ "java", "grails", "groovy", "io" ]
1
2
990
2
0
2011-05-31T16:32:14.200000
2011-05-31T16:48:33.643000
6,190,673
6,190,698
How to evaluate arbitrary code in Python?
I'd like to be able to evaluate arbitrary code from a string in Python, including code composed of multiple statements, and statements that span multiple lines. The approaches I've tried so far have been to use exec and eval, but these seem to only be able to evaluate expressions. I have also tried the code.Interactive...
exec seems to be what you are looking for: s = """ for i in range(5): print(i) """ exec s prints 0 1 2 3 4 eval() only handles expressions, but exec handles arbitrary code.
How to evaluate arbitrary code in Python? I'd like to be able to evaluate arbitrary code from a string in Python, including code composed of multiple statements, and statements that span multiple lines. The approaches I've tried so far have been to use exec and eval, but these seem to only be able to evaluate expressio...
TITLE: How to evaluate arbitrary code in Python? QUESTION: I'd like to be able to evaluate arbitrary code from a string in Python, including code composed of multiple statements, and statements that span multiple lines. The approaches I've tried so far have been to use exec and eval, but these seem to only be able to ...
[ "python" ]
1
3
3,993
4
0
2011-05-31T16:33:17.610000
2011-05-31T16:35:21.047000
6,190,677
6,190,748
Howto remove Listeners on SWING JComponents
is there an easy way to remove all Listeners from a JComponent? JComponent widget = getComponentOverScaryMethod(); EventListener[] listners = widget.getListeners(EventListener.class); for (EventListener l: listners) { widget.remove*RandomListener*(l); } Background: I have a JComponent with an unknown amount of Listener...
There's a workaround mentioned here: Bug ID: 4380536, I want a method to remove all listeners from a Component
Howto remove Listeners on SWING JComponents is there an easy way to remove all Listeners from a JComponent? JComponent widget = getComponentOverScaryMethod(); EventListener[] listners = widget.getListeners(EventListener.class); for (EventListener l: listners) { widget.remove*RandomListener*(l); } Background: I have a J...
TITLE: Howto remove Listeners on SWING JComponents QUESTION: is there an easy way to remove all Listeners from a JComponent? JComponent widget = getComponentOverScaryMethod(); EventListener[] listners = widget.getListeners(EventListener.class); for (EventListener l: listners) { widget.remove*RandomListener*(l); } Back...
[ "java", "swing", "listener" ]
8
4
3,651
3
0
2011-05-31T16:33:31.763000
2011-05-31T16:40:15.457000
6,190,680
6,191,034
How to refer to a table of values in a subform in Microsoft Access
I'm working on a searching function for my database. I've created a test DB to figure things out and I've gotten stuck. When I'm on the same form searching within a range is quite straight forward and I accomplished it using the following VBA code: Private Sub Command12_Click() Dim strWhere As String Dim lngLen As Long...
I don't understand which form contains Command24. You can find out by temporarily changing Command24_Click. Private Sub Command24_Click() Debug.Print "'Me' refers to " & Me.Name Stop End Sub The Stop statement will put you in break mode. Then you can use the Immediate Window to explore object path variations until you ...
How to refer to a table of values in a subform in Microsoft Access I'm working on a searching function for my database. I've created a test DB to figure things out and I've gotten stuck. When I'm on the same form searching within a range is quite straight forward and I accomplished it using the following VBA code: Priv...
TITLE: How to refer to a table of values in a subform in Microsoft Access QUESTION: I'm working on a searching function for my database. I've created a test DB to figure things out and I've gotten stuck. When I'm on the same form searching within a range is quite straight forward and I accomplished it using the follow...
[ "ms-access", "search" ]
0
1
986
1
0
2011-05-31T16:33:41.533000
2011-05-31T17:08:17.283000
6,190,694
6,190,966
VB 2010: How to calculate a date difference?
I'd like do make a program which returns you how old you are, in years, months, weeks and days. But I didn't get it to compare different times. Input is a string which looks like 01.01.2011 (dd.mm.yyyy). Please, can somebody help? Thanks very much! EDIT: My code so far is this: Try dim date1 as string = '01.01.2011' ' ...
DateDiff is a VB function and is not part of the standard.Net library (So C# can't use it). It's easier to use the TimeSpan class and the toString() method with Custom TimeSpan Format String to get what you want. Edit: Here's the code, you can compare result to http://www.easycalculation.com/date-day/age-calculator.php...
VB 2010: How to calculate a date difference? I'd like do make a program which returns you how old you are, in years, months, weeks and days. But I didn't get it to compare different times. Input is a string which looks like 01.01.2011 (dd.mm.yyyy). Please, can somebody help? Thanks very much! EDIT: My code so far is th...
TITLE: VB 2010: How to calculate a date difference? QUESTION: I'd like do make a program which returns you how old you are, in years, months, weeks and days. But I didn't get it to compare different times. Input is a string which looks like 01.01.2011 (dd.mm.yyyy). Please, can somebody help? Thanks very much! EDIT: My...
[ "vb.net" ]
2
6
46,362
1
0
2011-05-31T16:34:49.347000
2011-05-31T17:01:25.193000
6,190,696
6,199,145
Simple doctrine query -> one specific row and column
I do have a table called "tax" with two column "id | tax_value". I can list the table with an foreach very well. Now my question, how does the code look like when I just want to have one specfic row and column in the php code? I don't want it in the query!!! for example: column 2 (tax_value) row 1. The query gives me ...
In TaxTable.class.php: public function getOneById($id) { $q = Doctrine_Query::create()->select("t.tax_value") ->from("tax t") ->where("t.id =?", $id) ->fetchOne(); return $q; } In action: public function executeTaxView(sfWebRequest $request) { $this->tax = TaxTable::getInstance()->getOneById($request->getParameter("id"...
Simple doctrine query -> one specific row and column I do have a table called "tax" with two column "id | tax_value". I can list the table with an foreach very well. Now my question, how does the code look like when I just want to have one specfic row and column in the php code? I don't want it in the query!!! for exam...
TITLE: Simple doctrine query -> one specific row and column QUESTION: I do have a table called "tax" with two column "id | tax_value". I can list the table with an foreach very well. Now my question, how does the code look like when I just want to have one specfic row and column in the php code? I don't want it in the...
[ "php", "symfony1", "doctrine" ]
1
4
7,005
3
0
2011-05-31T16:35:05.853000
2011-06-01T09:38:42.407000
6,190,701
6,190,714
Number of times a record shows up : SQL Server
I have a table with just one field, say Numbers. And it looks like this: Numbers 1 1 1 2 2 2 3 3 3 3 3 4 4 4 4 What I want is an output of the number of times each number shows up. For example, 1 has a count of 15, 2 has a count of 33 and so on. What is the query I would run to identify the number of occurrences?
select Numbers, count(*) as Count from MyTable group by Numbers
Number of times a record shows up : SQL Server I have a table with just one field, say Numbers. And it looks like this: Numbers 1 1 1 2 2 2 3 3 3 3 3 4 4 4 4 What I want is an output of the number of times each number shows up. For example, 1 has a count of 15, 2 has a count of 33 and so on. What is the query I would r...
TITLE: Number of times a record shows up : SQL Server QUESTION: I have a table with just one field, say Numbers. And it looks like this: Numbers 1 1 1 2 2 2 3 3 3 3 3 4 4 4 4 What I want is an output of the number of times each number shows up. For example, 1 has a count of 15, 2 has a count of 33 and so on. What is t...
[ "sql", "sql-server" ]
2
8
3,323
3
0
2011-05-31T16:35:24.447000
2011-05-31T16:36:59.503000
6,190,713
6,191,100
How to detect if a user uploaded a file larger than post_max_size?
How should I go about handling http uploads that exceeds the post_max_size in a sane manner? In my configuration post_max_size is a few MB larger than upload_max_filesize The problems I'm having are: If a user uploads a file exceeding post_max_size The _POST array is empty The _FILES array is empty, and of course any e...
For a simple fix that would require no server side changes, I would use the HTML5 File API to check the size of the file before uploading. If it exceeds the known limit, then cancel the upload. I believe something like this would work: function on_submit() { if (document.getElementById("upload").files[0].size > 666) { ...
How to detect if a user uploaded a file larger than post_max_size? How should I go about handling http uploads that exceeds the post_max_size in a sane manner? In my configuration post_max_size is a few MB larger than upload_max_filesize The problems I'm having are: If a user uploads a file exceeding post_max_size The ...
TITLE: How to detect if a user uploaded a file larger than post_max_size? QUESTION: How should I go about handling http uploads that exceeds the post_max_size in a sane manner? In my configuration post_max_size is a few MB larger than upload_max_filesize The problems I'm having are: If a user uploads a file exceeding ...
[ "php", "file-upload", "php-5.3" ]
11
10
4,564
6
0
2011-05-31T16:36:56.780000
2011-05-31T17:15:56.117000
6,190,716
6,190,911
Identifying slowdown in IE
I am working on a site right now that is experiencing a slow down in Internet Explorer. More specifically, the page just freezes for around 2 to 3 seconds after loading all of the visible page elements, as if it is still loading something. Normally, I just profile the site in FF or Chrome, but this issue is specific to...
You wrote you tried to use profiler in IE, but did you use IE Developer Tools? In section Using the Profiler in this article there is a screenshot of profiler and Function view, but there is also Call Tree view you may want to try. Press Start profiling, do the action you want to inspect, press Stop profiling, change t...
Identifying slowdown in IE I am working on a site right now that is experiencing a slow down in Internet Explorer. More specifically, the page just freezes for around 2 to 3 seconds after loading all of the visible page elements, as if it is still loading something. Normally, I just profile the site in FF or Chrome, bu...
TITLE: Identifying slowdown in IE QUESTION: I am working on a site right now that is experiencing a slow down in Internet Explorer. More specifically, the page just freezes for around 2 to 3 seconds after loading all of the visible page elements, as if it is still loading something. Normally, I just profile the site i...
[ "internet-explorer", "web-optimization" ]
1
1
282
1
0
2011-05-31T16:37:04.480000
2011-05-31T16:55:45.150000
6,190,722
6,190,938
iOS: Is there a way to determine when an UIView did appear, after calling view.hidden = NO
I have an UIView with 8 to 10 large images (each loaded into an UIImageView) as subviews. Those images are aligned next to each other, so that they compose a real long horizontal image. This view is put into an UIScrollView, so that the user can scroll along this long horizontal image. Loading all those images (from th...
What you could do is make a UIViewController subclass, and make that the owner of this view, and in that method you could try putting code you need in the viewDidLoad method and see if that is more accurate, however i think that the real issue is the imageViews you use are taking their time loading the images, not the ...
iOS: Is there a way to determine when an UIView did appear, after calling view.hidden = NO I have an UIView with 8 to 10 large images (each loaded into an UIImageView) as subviews. Those images are aligned next to each other, so that they compose a real long horizontal image. This view is put into an UIScrollView, so t...
TITLE: iOS: Is there a way to determine when an UIView did appear, after calling view.hidden = NO QUESTION: I have an UIView with 8 to 10 large images (each loaded into an UIImageView) as subviews. Those images are aligned next to each other, so that they compose a real long horizontal image. This view is put into an ...
[ "ios", "uiview" ]
3
2
11,164
2
0
2011-05-31T16:37:29.760000
2011-05-31T16:58:22.047000
6,190,723
6,190,769
SQL Server 2005 - how to compare field value, and return a count if different, for every occurance
DECLARE @CURRENTSCHOOL TABLE (STUDENT VARCHAR(8), COURSE VARCHAR(8), SCHOOL VARCHAR(2)) INSERT INTO @CURRENTSCHOOL VALUES ('10000000','MCR1010','11') INSERT INTO @CURRENTSCHOOL VALUES ('12000000','MCR6080','11') INSERT INTO @CURRENTSCHOOL VALUES ('13000000','MCR6090','15') DECLARE @OTHERSCHOOLS TABLE (STUDENT VARCHAR(...
SELECT cs.student, COUNT(os.course) FROM @CURRENTSCHOOL cs LEFT JOIN @OTHERSCHOOLS os ON cs.student = os.student AND cs.school <> os.school GROUP BY cs.student outputs STUDENT -------- ----------- 10000000 2 12000000 1 13000000 0 If Null is really preferred over Zero then you can do this (or use the equivalent CTE) SEL...
SQL Server 2005 - how to compare field value, and return a count if different, for every occurance DECLARE @CURRENTSCHOOL TABLE (STUDENT VARCHAR(8), COURSE VARCHAR(8), SCHOOL VARCHAR(2)) INSERT INTO @CURRENTSCHOOL VALUES ('10000000','MCR1010','11') INSERT INTO @CURRENTSCHOOL VALUES ('12000000','MCR6080','11') INSERT IN...
TITLE: SQL Server 2005 - how to compare field value, and return a count if different, for every occurance QUESTION: DECLARE @CURRENTSCHOOL TABLE (STUDENT VARCHAR(8), COURSE VARCHAR(8), SCHOOL VARCHAR(2)) INSERT INTO @CURRENTSCHOOL VALUES ('10000000','MCR1010','11') INSERT INTO @CURRENTSCHOOL VALUES ('12000000','MCR608...
[ "sql-server", "t-sql", "count" ]
3
3
987
2
0
2011-05-31T16:37:30.207000
2011-05-31T16:42:21.857000
6,190,726
6,190,764
JSON Strings to MultiDimensional Arrays
I seem to have a problem converting an array backwards and forwards between PHP/JS. I'm using an XmlHttpRequest from JavaScript to a PHP page which uses json_encode to encode a multidimensional (2D) array. When receiving the string, I use JSON.parse() to decode the string, but it comes back as a 1D array. Is there any ...
Edit: After your edit showing your actual JSON: The JSON you've defined isn't defining a two-dimensional array, it's defining a one-dimensional array of objects. Once deserialized, you'd access (say) the title of the first book like so: alert(myArray[0].title); Live example (note that in that example I've had to escape...
JSON Strings to MultiDimensional Arrays I seem to have a problem converting an array backwards and forwards between PHP/JS. I'm using an XmlHttpRequest from JavaScript to a PHP page which uses json_encode to encode a multidimensional (2D) array. When receiving the string, I use JSON.parse() to decode the string, but it...
TITLE: JSON Strings to MultiDimensional Arrays QUESTION: I seem to have a problem converting an array backwards and forwards between PHP/JS. I'm using an XmlHttpRequest from JavaScript to a PHP page which uses json_encode to encode a multidimensional (2D) array. When receiving the string, I use JSON.parse() to decode ...
[ "javascript", "json" ]
3
5
7,093
1
0
2011-05-31T16:37:41.220000
2011-05-31T16:41:55.633000
6,190,730
6,190,810
jQuery addClass problem
I am using IE7. I have an input box as follows: And I am trying to do the following: $("#location").addClass('flagged'); But this wipes out all existing styling of the text box. The class 'flag' does not have any styling associated with it. The existing classes have the following CSS: input.editable { height: 18px; bac...
Try seeing the classes assigned to the element, IE: var myClass = $('#location').attr('class'); alert("classes = " + myClass);
jQuery addClass problem I am using IE7. I have an input box as follows: And I am trying to do the following: $("#location").addClass('flagged'); But this wipes out all existing styling of the text box. The class 'flag' does not have any styling associated with it. The existing classes have the following CSS: input.edit...
TITLE: jQuery addClass problem QUESTION: I am using IE7. I have an input box as follows: And I am trying to do the following: $("#location").addClass('flagged'); But this wipes out all existing styling of the text box. The class 'flag' does not have any styling associated with it. The existing classes have the followi...
[ "jquery", "html", "css" ]
6
1
2,054
2
0
2011-05-31T16:37:54.620000
2011-05-31T16:46:03.657000
6,190,733
6,190,918
Turn on the android phone
I had old phone with one interesting functionality, that was ability to turn on on scheduled time. Actually the procedure was 1. Set alarm 2. Turn off phone 3. Wait for time to pass and the phone will go on without user interaction. I really loved this functionality cause you have active phone (it wakes you up) in the ...
That isn't possible in Android. At least not exactly what you want. You may set you phone to Airplane mode, or put sound and notifications in mute (this is what i do) for pre-set hours/days. For this i use an application called Timeriffic ( https://market.android.com/details?id=com.alfray.timeriffic )
Turn on the android phone I had old phone with one interesting functionality, that was ability to turn on on scheduled time. Actually the procedure was 1. Set alarm 2. Turn off phone 3. Wait for time to pass and the phone will go on without user interaction. I really loved this functionality cause you have active phone...
TITLE: Turn on the android phone QUESTION: I had old phone with one interesting functionality, that was ability to turn on on scheduled time. Actually the procedure was 1. Set alarm 2. Turn off phone 3. Wait for time to pass and the phone will go on without user interaction. I really loved this functionality cause you...
[ "android", "alarm" ]
0
2
4,464
3
0
2011-05-31T16:38:20.673000
2011-05-31T16:56:19.080000
6,190,739
6,191,212
Force a merge in TFS after conflicts have been resolved
TFS 2010, VS 2010 We have a situation in TFS where a developer has not been following proper merge procedure. When I run a compare of his developer directory against trunk, I get a number of files marked as either different or not in trunk at all. The last merge/check-in to trunk was by him on 2011-05-26, and his last ...
You need to go to the command line and use tf merge /force e.g. tf merge $/TeamProject/DevBranch $/TeamProject/Trunk /force This should do what you want. for more info try tf msdn which will open a browser and take you to the online help for the tf command tools. /recursive fixes all and displays the GUI for conflicts.
Force a merge in TFS after conflicts have been resolved TFS 2010, VS 2010 We have a situation in TFS where a developer has not been following proper merge procedure. When I run a compare of his developer directory against trunk, I get a number of files marked as either different or not in trunk at all. The last merge/c...
TITLE: Force a merge in TFS after conflicts have been resolved QUESTION: TFS 2010, VS 2010 We have a situation in TFS where a developer has not been following proper merge procedure. When I run a compare of his developer directory against trunk, I get a number of files marked as either different or not in trunk at all...
[ "visual-studio", "visual-studio-2010", "tfs" ]
17
17
16,815
2
0
2011-05-31T16:39:13.497000
2011-05-31T17:27:01.270000
6,190,743
6,190,832
Finding Local maximum in C
I would like to find the local maximum within the interval of 0 to 3.1416 for this Sin(x) function. But it shows always 0 as the maximum value.i.e The maximum value=0; Please help me finding my faults. thanks. #include #include #include #ifndef max #define max(a,b) ((a)>(b)?(a):(b)) #endif double f(double x){ return si...
You have an error in calling the printf function. You should not use %d format identifier here because it means that printf should output an integer while your maximum variable is double. Use %f instead and your program will output 1.5708 which is correct. You can find the list of all possible printf format identifiers...
Finding Local maximum in C I would like to find the local maximum within the interval of 0 to 3.1416 for this Sin(x) function. But it shows always 0 as the maximum value.i.e The maximum value=0; Please help me finding my faults. thanks. #include #include #include #ifndef max #define max(a,b) ((a)>(b)?(a):(b)) #endif do...
TITLE: Finding Local maximum in C QUESTION: I would like to find the local maximum within the interval of 0 to 3.1416 for this Sin(x) function. But it shows always 0 as the maximum value.i.e The maximum value=0; Please help me finding my faults. thanks. #include #include #include #ifndef max #define max(a,b) ((a)>(b)?...
[ "c", "max" ]
5
3
1,928
2
0
2011-05-31T16:39:31.367000
2011-05-31T16:48:16.210000
6,190,747
6,190,850
QT http setting a user agent
void MainWindow::on_WowButton_clicked() { http->setHost("pastebin.ca"); http->get("/raw/2072840"); QString paste(http->readAll()); ui->textEdit->setText(paste); } Now, I want to set user agent for the get request. please tell the proper way to set a user agent. Thanks!
QHttp is obsolete and depricated. You are required to use QNetworkAccessManager instead. QNetworkAccessManager* mgr = new QNetworkAccessManager();.... QNetworkRequest req; req.setUrl(QUrl("enter url") ); req.setRawHeader( "User-Agent", "Mozilla Firefox" ); mgr->get(req); If you still want to use QHttp QHttpRequestHead...
QT http setting a user agent void MainWindow::on_WowButton_clicked() { http->setHost("pastebin.ca"); http->get("/raw/2072840"); QString paste(http->readAll()); ui->textEdit->setText(paste); } Now, I want to set user agent for the get request. please tell the proper way to set a user agent. Thanks!
TITLE: QT http setting a user agent QUESTION: void MainWindow::on_WowButton_clicked() { http->setHost("pastebin.ca"); http->get("/raw/2072840"); QString paste(http->readAll()); ui->textEdit->setText(paste); } Now, I want to set user agent for the get request. please tell the proper way to set a user agent. Thanks! AN...
[ "qt", "http", "qt4" ]
1
5
5,150
1
0
2011-05-31T16:39:58.877000
2011-05-31T16:49:11.827000
6,190,751
6,191,290
elementwise binding in R
I want a function f such that (outer(X, Y, f))[i, j] is a side-by-side concatenation of the i-th element of X and the j-th element of Y, something like c(X[i], Y[j]), or having a similar structure. Furthermore, I want this result to be such that the process can be repeated, and, in this way we get that (outer(outer(X, ...
The function Vectorize() is your friend here: define f to be: f <- Vectorize( function(a,b) c(as.list(a), as.list(b)), SIMPLIFY = FALSE ) Then you can do (with your definition of foo above): z <- foo(list(LETTERS[1:2], c(3, 4, 5), letters[6:7])) For example you can check that the entries match your example above: > z,,...
elementwise binding in R I want a function f such that (outer(X, Y, f))[i, j] is a side-by-side concatenation of the i-th element of X and the j-th element of Y, something like c(X[i], Y[j]), or having a similar structure. Furthermore, I want this result to be such that the process can be repeated, and, in this way we ...
TITLE: elementwise binding in R QUESTION: I want a function f such that (outer(X, Y, f))[i, j] is a side-by-side concatenation of the i-th element of X and the j-th element of Y, something like c(X[i], Y[j]), or having a similar structure. Furthermore, I want this result to be such that the process can be repeated, an...
[ "r", "vectorization", "reduce", "elementwise-operations" ]
4
5
248
1
0
2011-05-31T16:40:37.087000
2011-05-31T17:34:25.057000
6,190,753
6,191,239
NHibernate one-way association with XRef table
I'm stuck trying to get the mapping I want to persist correctly. For my example, I have an ItemY class which can have 0,1,* Assets. However, an Asset can belong to an ItemY or an ItemZ object. I'm trying to use a cross-reference table to store this. Schema TABLE [dbo].[ItemY]( [ItemYID] [int] IDENTITY(1,1) NOT NULL, --...
inverse="true" means the "other side" is responsible for persisting the relationship. Since you have no "other side" (the relationship is unidirectional), remove that attribute.
NHibernate one-way association with XRef table I'm stuck trying to get the mapping I want to persist correctly. For my example, I have an ItemY class which can have 0,1,* Assets. However, an Asset can belong to an ItemY or an ItemZ object. I'm trying to use a cross-reference table to store this. Schema TABLE [dbo].[Ite...
TITLE: NHibernate one-way association with XRef table QUESTION: I'm stuck trying to get the mapping I want to persist correctly. For my example, I have an ItemY class which can have 0,1,* Assets. However, an Asset can belong to an ItemY or an ItemZ object. I'm trying to use a cross-reference table to store this. Schem...
[ "nhibernate" ]
1
2
506
1
0
2011-05-31T16:40:39.213000
2011-05-31T17:29:12.353000
6,190,755
6,190,921
Define Android animation without using xml
How can I define this animation xml by java code without using xml
Yes, why not? AnimationSet set = new AnimationSet( true ); Animation translate = new TranslateAnimation( -100, 0, 0, 0); translate.setDuration( 900 ); set.addAnimation( translate ); Regards, Stéphane
Define Android animation without using xml How can I define this animation xml by java code without using xml
TITLE: Define Android animation without using xml QUESTION: How can I define this animation xml by java code without using xml ANSWER: Yes, why not? AnimationSet set = new AnimationSet( true ); Animation translate = new TranslateAnimation( -100, 0, 0, 0); translate.setDuration( 900 ); set.addAnimation( translate ); R...
[ "android", "animation" ]
2
8
2,178
1
0
2011-05-31T16:40:40.047000
2011-05-31T16:56:29.737000
6,190,757
6,191,040
Newbie Flex question: getting a reference to an object from within a .as file
I am modifying some Flex code written by someone else. There is an mx:text control that I want to change the 'text' property of. I know how to do this within the.mxml file in which the control is defined, however I don't know how to do this from within a separate.as ActionScript file. I recall in Flash there is some wa...
Is this as file connected with mxml (inherits from it)? If not, you need to pass the reference to mxml class (or Text control) to class in as file.
Newbie Flex question: getting a reference to an object from within a .as file I am modifying some Flex code written by someone else. There is an mx:text control that I want to change the 'text' property of. I know how to do this within the.mxml file in which the control is defined, however I don't know how to do this f...
TITLE: Newbie Flex question: getting a reference to an object from within a .as file QUESTION: I am modifying some Flex code written by someone else. There is an mx:text control that I want to change the 'text' property of. I know how to do this within the.mxml file in which the control is defined, however I don't kno...
[ "flash", "apache-flex" ]
0
0
58
1
0
2011-05-31T16:40:52.727000
2011-05-31T17:08:49.923000
6,190,768
6,191,015
Generating Java interface from a C++ header file
We have some proprietary libraries we need to interface with. These libraries are Windows DLLs, or Linux.so files. We got the headers to define the interfaces. Since I have never done anything with native libs, I looked at JNAerator (http://code.google.com/p/jnaerator/) and the BridJ and JNA stuff. What's a simple way ...
JNI coding is usually a manual process of writing C++ code to create the native glue methods. There's an entire book that explains it. In some cases, http://jna.java.net/ can automate or accelerate this process, but don't count on it. You can't 'bundle the native libraries' unless you go down the path of using OSGi or ...
Generating Java interface from a C++ header file We have some proprietary libraries we need to interface with. These libraries are Windows DLLs, or Linux.so files. We got the headers to define the interfaces. Since I have never done anything with native libs, I looked at JNAerator (http://code.google.com/p/jnaerator/) ...
TITLE: Generating Java interface from a C++ header file QUESTION: We have some proprietary libraries we need to interface with. These libraries are Windows DLLs, or Linux.so files. We got the headers to define the interfaces. Since I have never done anything with native libs, I looked at JNAerator (http://code.google....
[ "java", "maven-2", "interop", "native", "jna" ]
4
2
1,644
2
0
2011-05-31T16:42:20.767000
2011-05-31T17:06:42.417000
6,190,773
6,190,902
Django: get the first object from a filter query or create
In Django, queryset provides a method called get_or_create that either returns an objects or creates an object. However, like the get method, get_or_create can throw an exception if the query returns multiple objects. Is there an method to do this elegantly: objects = Model.manager.filter(params) if len(objects) == 0: ...
get_or_create() is just a convenience function so there's nothing wrong with writing your own, like pavid has shown or result = Model.objects.filter(field__lookup=value)[0] if not result: result = Model.objects.create(...) return result EDIT As suggested, changed the [:1] slice (which returns a single-entry list) after...
Django: get the first object from a filter query or create In Django, queryset provides a method called get_or_create that either returns an objects or creates an object. However, like the get method, get_or_create can throw an exception if the query returns multiple objects. Is there an method to do this elegantly: ob...
TITLE: Django: get the first object from a filter query or create QUESTION: In Django, queryset provides a method called get_or_create that either returns an objects or creates an object. However, like the get method, get_or_create can throw an exception if the query returns multiple objects. Is there an method to do ...
[ "django", "django-models", "django-queryset" ]
38
54
94,478
7
0
2011-05-31T16:42:48.490000
2011-05-31T16:54:35.443000
6,190,776
6,190,798
What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)?
Let's assume an iteration in which we call a function without a return value. The way I think my program should behave is explained in this pseudocode: for element in some_list: foo(element) def foo(element): do something if check is true: do more (because check was succesful) else: return None do much much more... If...
You could simply use return which does exactly the same as return None Your function will also return None if execution reaches the end of the function body without hitting a return statement. Returning nothing is the same as returning None in Python.
What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)? Let's assume an iteration in which we call a function without a return value. The way I think my program should behave is explained in this pseudocode: for element in some_list: foo(element) def...
TITLE: What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)? QUESTION: Let's assume an iteration in which we call a function without a return value. The way I think my program should behave is explained in this pseudocode: for element in some_list:...
[ "python", "function", "return" ]
249
414
599,552
4
0
2011-05-31T16:42:57.490000
2011-05-31T16:44:39.347000
6,190,779
6,191,153
Monitor Android system settings values
I want to watch a system setting and get notified when its value changes. The Cursor class has a setNotificationUri method which sounded nice, but it doesn't work and coding it also feels strange... Thats what I did: // Create a content resolver and add a listener ContentResolver resolver = getContentResolver(); resolv...
here is how it can be done, works great: How to implement a ContentObserver for call logs. note than some settings are first written / reallly changed when the user presses the back key in the system preference screen where he changed something!
Monitor Android system settings values I want to watch a system setting and get notified when its value changes. The Cursor class has a setNotificationUri method which sounded nice, but it doesn't work and coding it also feels strange... Thats what I did: // Create a content resolver and add a listener ContentResolver ...
TITLE: Monitor Android system settings values QUESTION: I want to watch a system setting and get notified when its value changes. The Cursor class has a setNotificationUri method which sounded nice, but it doesn't work and coding it also feels strange... Thats what I did: // Create a content resolver and add a listene...
[ "android", "settings", "listener" ]
8
6
16,372
2
0
2011-05-31T16:43:07.960000
2011-05-31T17:22:00.717000
6,190,784
6,197,971
rails send empty message
Mailer: class CustomerHistoryMailer < ActionMailer::Base default:from => "notifications@example.com" def log_email(to) mail(:to => to,:subject => 'Report') end end Controller: class Admin::ReportsController < ApplicationController def index CustomerHistoryMailer.log_email("me@example.com").deliver end end View (app/vie...
I removed config.action_mailer.deprecation =:log line from config/environments/development.rb and it works now.
rails send empty message Mailer: class CustomerHistoryMailer < ActionMailer::Base default:from => "notifications@example.com" def log_email(to) mail(:to => to,:subject => 'Report') end end Controller: class Admin::ReportsController < ApplicationController def index CustomerHistoryMailer.log_email("me@example.com").deli...
TITLE: rails send empty message QUESTION: Mailer: class CustomerHistoryMailer < ActionMailer::Base default:from => "notifications@example.com" def log_email(to) mail(:to => to,:subject => 'Report') end end Controller: class Admin::ReportsController < ApplicationController def index CustomerHistoryMailer.log_email("me@...
[ "ruby-on-rails-3" ]
1
0
916
2
0
2011-05-31T16:43:19.813000
2011-06-01T07:57:03.767000
6,190,797
6,190,812
Why I cannot access the C:\WINDOWS\assembly\GAC Folder?
I find the path of Microsoft.Office>interop.Excel under the Solution/References is C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll However, such a file doesn't exist on my C:\WINDOWS\assembly\GAC at all. Further, there is not GAC folder under C:\WINDO...
Use the command prompt to navigate there. Windows Explorer has an extension that runs for the assembly folder, hiding some of the details. Here is a post on how to turn it off. http://geekswithblogs.net/pavelka/archive/2006/05/05/WindowsExplorerAndTheGlobalAssemblyCache.aspx or http://weblogs.asp.net/jkey/archive/2003/...
Why I cannot access the C:\WINDOWS\assembly\GAC Folder? I find the path of Microsoft.Office>interop.Excel under the Solution/References is C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll However, such a file doesn't exist on my C:\WINDOWS\assembly\GAC...
TITLE: Why I cannot access the C:\WINDOWS\assembly\GAC Folder? QUESTION: I find the path of Microsoft.Office>interop.Excel under the Solution/References is C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll However, such a file doesn't exist on my C:\WI...
[ "c#", "reference", "gac", ".net-assembly" ]
9
9
26,410
3
0
2011-05-31T16:44:35.573000
2011-05-31T16:46:33.203000
6,190,803
6,190,866
How do you compare multiple RHS values in RSPec?
I'm new to RSpec, and I'm trying to run "should == A || B", but it's ignoring the 'B' and is only comparing with 'A' (and thus failing when val is 'B'): Sample.find(:all).map(&:param).each{|val| val.should == 'A'||'B'} Does anyone know how I include the 'B' in the comparison?
['A', 'B'].should include(val) That might get your spec passing, but is it what you want to test? That the return value is a member of a set? If so, then perhaps this is a good solution.
How do you compare multiple RHS values in RSPec? I'm new to RSpec, and I'm trying to run "should == A || B", but it's ignoring the 'B' and is only comparing with 'A' (and thus failing when val is 'B'): Sample.find(:all).map(&:param).each{|val| val.should == 'A'||'B'} Does anyone know how I include the 'B' in the compar...
TITLE: How do you compare multiple RHS values in RSPec? QUESTION: I'm new to RSpec, and I'm trying to run "should == A || B", but it's ignoring the 'B' and is only comparing with 'A' (and thus failing when val is 'B'): Sample.find(:all).map(&:param).each{|val| val.should == 'A'||'B'} Does anyone know how I include the...
[ "ruby-on-rails", "ruby", "comparison", "rspec" ]
3
4
910
4
0
2011-05-31T16:45:01.233000
2011-05-31T16:50:59.723000
6,190,809
6,190,834
void pointer conditional raising segfault
I'm using a double-linked list and getting some odd performance regarding edge cases when we're dealing with previous or next pointers that are null. GDB returns the following error: Program received signal SIGSEGV, Segmentation fault. 0x0804a9c1 in DLinkDelete (delete=0xd8c9d33c) at test.c:213 213 if (prevdl && prevdl...
Presumably prevdl points to invalid memory? Come on, does 0xdadadada really look like a valid address to you? " It's too idiotic to be schizophrenic ".
void pointer conditional raising segfault I'm using a double-linked list and getting some odd performance regarding edge cases when we're dealing with previous or next pointers that are null. GDB returns the following error: Program received signal SIGSEGV, Segmentation fault. 0x0804a9c1 in DLinkDelete (delete=0xd8c9d3...
TITLE: void pointer conditional raising segfault QUESTION: I'm using a double-linked list and getting some odd performance regarding edge cases when we're dealing with previous or next pointers that are null. GDB returns the following error: Program received signal SIGSEGV, Segmentation fault. 0x0804a9c1 in DLinkDelet...
[ "c", "c99", "void-pointers" ]
1
5
312
6
0
2011-05-31T16:46:01.403000
2011-05-31T16:48:22
6,190,814
6,191,581
Sed print with evaluated date command on back reference
I have a file (as one often does) with dates in *nix time as seconds from the Epoch, followed by a message and a final "thread" field I am wanting to select. All separated with a '|' as exported from a sqlite DB... e.g 1306003700|SENT|21 1277237887|SENT|119 1274345263|SENT|115 1261168663|RECV|21 1306832459|SENT|80 1306...
Perl is handy here: perl -MPOSIX -F'\|' -lane ' next unless $F[2] == "80"; print(strftime("%Y-%m-%d %T", localtime $F[0]), ": ", $F[1]) ' input.file
Sed print with evaluated date command on back reference I have a file (as one often does) with dates in *nix time as seconds from the Epoch, followed by a message and a final "thread" field I am wanting to select. All separated with a '|' as exported from a sqlite DB... e.g 1306003700|SENT|21 1277237887|SENT|119 127434...
TITLE: Sed print with evaluated date command on back reference QUESTION: I have a file (as one often does) with dates in *nix time as seconds from the Epoch, followed by a message and a final "thread" field I am wanting to select. All separated with a '|' as exported from a sqlite DB... e.g 1306003700|SENT|21 12772378...
[ "bash", "unix", "date", "sed" ]
2
1
2,316
7
0
2011-05-31T16:46:52.747000
2011-05-31T18:01:59.407000
6,190,816
6,190,870
Random Pick 2 Int as an option
private void btnStart_Click(object sender, EventArgs e) { Random random = new Random(); int randomNumber = random.Next(0, 1000); int RandomTolerance = 5 || 10; lblRandomValue.Text = randomNumber + "000" + "O" + RandomTolerance; } I do not understand how to allow the RandomTolerance to choose between 5 and 10 only as an...
int RandomTolerance=random.Next(0,2)<1?5:10; As a side note, reseeding your random number generator over and over is usually a bad idea. You should read up on how random number generators work.
Random Pick 2 Int as an option private void btnStart_Click(object sender, EventArgs e) { Random random = new Random(); int randomNumber = random.Next(0, 1000); int RandomTolerance = 5 || 10; lblRandomValue.Text = randomNumber + "000" + "O" + RandomTolerance; } I do not understand how to allow the RandomTolerance to cho...
TITLE: Random Pick 2 Int as an option QUESTION: private void btnStart_Click(object sender, EventArgs e) { Random random = new Random(); int randomNumber = random.Next(0, 1000); int RandomTolerance = 5 || 10; lblRandomValue.Text = randomNumber + "000" + "O" + RandomTolerance; } I do not understand how to allow the Rand...
[ "c#", "random", "int" ]
3
6
367
2
0
2011-05-31T16:47:24.200000
2011-05-31T16:51:17.583000
6,190,820
6,190,881
Android ListActivity - how to add a view below the ListView?
I'm trying to put a ProgressBar view below a ListView for a ListActivity. I want it to be always below the last row in the listView. The ProgressBar, which is placed in a LinearLayout, does appear, as long as the list (which is filled by an adapter at runtime) is not exceeding the screen. As soon as the list is larger ...
You should add a footer using: list.addFooterView(footerView); or doing it manually, but then consider using relative layouts, there are far more powerfull than linear layouts. And then place your footer below the list, or better, place your list and your empty view above your footerview.
Android ListActivity - how to add a view below the ListView? I'm trying to put a ProgressBar view below a ListView for a ListActivity. I want it to be always below the last row in the listView. The ProgressBar, which is placed in a LinearLayout, does appear, as long as the list (which is filled by an adapter at runtime...
TITLE: Android ListActivity - how to add a view below the ListView? QUESTION: I'm trying to put a ProgressBar view below a ListView for a ListActivity. I want it to be always below the last row in the listView. The ProgressBar, which is placed in a LinearLayout, does appear, as long as the list (which is filled by an ...
[ "android", "android-layout", "android-listview" ]
9
12
4,509
1
0
2011-05-31T16:47:36.217000
2011-05-31T16:52:18.317000
6,190,827
6,190,882
how to achieve this css3 shadow effect?
I am trying to see if its possible to achieve this kind of shadow using pure css3: I quickly mocked this up in photoshop. I am looking for that curved shadow effect. I know its possible to get straigt shadow effects. I tried to look on google I dont even know what to call that curved shadow. I couldn't find anywhere th...
At first I didn't think it was possible. Then I found this page that shows some nice examples in pure css. Nifty. See the demo page for an idea of what can be achieved.
how to achieve this css3 shadow effect? I am trying to see if its possible to achieve this kind of shadow using pure css3: I quickly mocked this up in photoshop. I am looking for that curved shadow effect. I know its possible to get straigt shadow effects. I tried to look on google I dont even know what to call that cu...
TITLE: how to achieve this css3 shadow effect? QUESTION: I am trying to see if its possible to achieve this kind of shadow using pure css3: I quickly mocked this up in photoshop. I am looking for that curved shadow effect. I know its possible to get straigt shadow effects. I tried to look on google I dont even know wh...
[ "shadow", "css" ]
16
21
19,741
2
0
2011-05-31T16:47:54.067000
2011-05-31T16:52:18.927000
6,190,863
6,191,030
NSAssert doesn't work
I'm trying to use NSAssert in my code but it doesn't do a thing. In this piece of code, the assertion should fail but doesn't: MSLog(@"cross.obj = %@",[cross obj]); NSAssert([cross obj]!=nil,@"[cross obj] == nil"); The output of this is: cross.obj = (null) What could be the problem?
NS_BLOCK_ASSERTIONS blocks assertions from functioning. Try deleting the definition.
NSAssert doesn't work I'm trying to use NSAssert in my code but it doesn't do a thing. In this piece of code, the assertion should fail but doesn't: MSLog(@"cross.obj = %@",[cross obj]); NSAssert([cross obj]!=nil,@"[cross obj] == nil"); The output of this is: cross.obj = (null) What could be the problem?
TITLE: NSAssert doesn't work QUESTION: I'm trying to use NSAssert in my code but it doesn't do a thing. In this piece of code, the assertion should fail but doesn't: MSLog(@"cross.obj = %@",[cross obj]); NSAssert([cross obj]!=nil,@"[cross obj] == nil"); The output of this is: cross.obj = (null) What could be the probl...
[ "objective-c", "assert", "nsassert" ]
2
3
1,595
3
0
2011-05-31T16:50:35.213000
2011-05-31T17:08:01.297000
6,190,868
6,190,888
Python Dictionary with List as Keys and Tuple as Values
I have a list that I want to use as the keys to a dictionary and a list of tuples with the values. Consider the following: d = {} l = ['a', 'b', 'c', 'd', 'e'] t = [(1, 2, 3, 4), (7, 8, 9, 10), (4, 5, 6, 7), (9, 6, 3, 8), (7, 4, 1, 2)] for i in range(len(l)): d[l[i]] = t[i] The list will consistently be 5 values and t...
I did no timings, but probably d = dict(zip(l, t)) will be quite good. For only 5 key-value pairs, I don't think izip() will provide any advantage over zip(). The fact that each tuple has a lot of items does not matter for this operation, since the tuple objects are not copied at any point, neither with your approach n...
Python Dictionary with List as Keys and Tuple as Values I have a list that I want to use as the keys to a dictionary and a list of tuples with the values. Consider the following: d = {} l = ['a', 'b', 'c', 'd', 'e'] t = [(1, 2, 3, 4), (7, 8, 9, 10), (4, 5, 6, 7), (9, 6, 3, 8), (7, 4, 1, 2)] for i in range(len(l)): d[l...
TITLE: Python Dictionary with List as Keys and Tuple as Values QUESTION: I have a list that I want to use as the keys to a dictionary and a list of tuples with the values. Consider the following: d = {} l = ['a', 'b', 'c', 'd', 'e'] t = [(1, 2, 3, 4), (7, 8, 9, 10), (4, 5, 6, 7), (9, 6, 3, 8), (7, 4, 1, 2)] for i in ...
[ "python", "list", "dictionary", "tuples" ]
6
17
9,120
2
0
2011-05-31T16:51:01.800000
2011-05-31T16:52:53.213000
6,190,869
6,190,904
animating with jquery - offset.left not updating
i'm trying to animate an object in several steps across the screen until it gets to its target. however, the offset.left value isn't dynamically changing (or i'm doing it wrong, more likely). here's what I have var initialOffset = $('#puzzle-transition-object').offset(); //thing to move var terminalOffset = $('#puzzle-...
Looks like you should be doing this: var initialOffset = $('#puzzle-transition-object').offset(); //thing to move var terminalOffset = $('#puzzle-container').offset(); //thing to touch var dtt = terminalOffset.left - initialOffset.left; //distance to travel var stepSegment = "+=" + Math.ceil(dtt/8) + "px"; //in left: c...
animating with jquery - offset.left not updating i'm trying to animate an object in several steps across the screen until it gets to its target. however, the offset.left value isn't dynamically changing (or i'm doing it wrong, more likely). here's what I have var initialOffset = $('#puzzle-transition-object').offset();...
TITLE: animating with jquery - offset.left not updating QUESTION: i'm trying to animate an object in several steps across the screen until it gets to its target. however, the offset.left value isn't dynamically changing (or i'm doing it wrong, more likely). here's what I have var initialOffset = $('#puzzle-transition-...
[ "jquery", "jquery-animate", "offset" ]
0
1
1,139
1
0
2011-05-31T16:51:03.857000
2011-05-31T16:54:37.143000
6,190,883
6,210,249
Pasting a very long string in eclipse editor
I am trying to paste a very long string in eclipse like: String str = "verrrrrrrrry long string that hass 9000 characters"; I want it to appear as String str = "verrrrrrrrry long"+ "string that hass "+ "9000 characters"; I tried the option mentioned here: Paste a multi-line Java String in Eclipse, but that gives me a ...
None of the settings worked for me, though they might be correct and I might have some other issue with my workspace. Anyways, I was able to work through my problem with this expression: cat Data.txt | grep -o -E '.{1,70}' | sed -r 's/(.*)/ "\1"+/' P.S: If anyone else confirms that one of the answers given by anyone in...
Pasting a very long string in eclipse editor I am trying to paste a very long string in eclipse like: String str = "verrrrrrrrry long string that hass 9000 characters"; I want it to appear as String str = "verrrrrrrrry long"+ "string that hass "+ "9000 characters"; I tried the option mentioned here: Paste a multi-line...
TITLE: Pasting a very long string in eclipse editor QUESTION: I am trying to paste a very long string in eclipse like: String str = "verrrrrrrrry long string that hass 9000 characters"; I want it to appear as String str = "verrrrrrrrry long"+ "string that hass "+ "9000 characters"; I tried the option mentioned here: ...
[ "java", "eclipse", "editor" ]
2
1
3,229
3
0
2011-05-31T16:52:36.837000
2011-06-02T04:08:28.867000
6,190,897
6,190,979
Python Win32, how to save an XLS as a CSV?
I'm loading up a.xlsx with win32com and would like to save the results as a csv when I'm done. myworkbook.SaveAs('results.csv') gives me an xlsx file with a csv extension. How do I save as an actual CSV?
I think that if you add the type after the filename, it should work. (Can't test right now.) I think the type for CSV (DOS) is 24. myworkbook.SaveAs('results.csv', 24)
Python Win32, how to save an XLS as a CSV? I'm loading up a.xlsx with win32com and would like to save the results as a csv when I'm done. myworkbook.SaveAs('results.csv') gives me an xlsx file with a csv extension. How do I save as an actual CSV?
TITLE: Python Win32, how to save an XLS as a CSV? QUESTION: I'm loading up a.xlsx with win32com and would like to save the results as a csv when I'm done. myworkbook.SaveAs('results.csv') gives me an xlsx file with a csv extension. How do I save as an actual CSV? ANSWER: I think that if you add the type after the fil...
[ "python", "excel", "csv", "win32com" ]
3
4
6,864
4
0
2011-05-31T16:54:20.830000
2011-05-31T17:02:29.283000
6,190,900
6,192,750
Page_Load not update after click the button
I have a simple ASP.NET page: sub Page_Load //Get data form databse and show it end sub sud deletsome(Source As Object, e As EventArgs) //delete one record when user click on submit button end sub When I click the button, the page reload, all the data have no change, I must re-enter the page again, the record I have d...
In asp page life cycle, page load happens before the button click (I know, it's kind of strange). The easiest work around is to place your code in the page "PreRender" event.
Page_Load not update after click the button I have a simple ASP.NET page: sub Page_Load //Get data form databse and show it end sub sud deletsome(Source As Object, e As EventArgs) //delete one record when user click on submit button end sub When I click the button, the page reload, all the data have no change, I must ...
TITLE: Page_Load not update after click the button QUESTION: I have a simple ASP.NET page: sub Page_Load //Get data form databse and show it end sub sud deletsome(Source As Object, e As EventArgs) //delete one record when user click on submit button end sub When I click the button, the page reload, all the data have ...
[ "asp.net", "vb.net" ]
0
1
2,024
4
0
2011-05-31T16:54:33.697000
2011-05-31T19:50:21.040000
6,190,903
6,191,191
WCF Known Type error
I get this error when calling my service: Server Error in '/' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error...
Use following ServiceKnownTypeAttribute constructor to specify type of class ( declaringType ) containing the static method methodName that will return service known types: public ServiceKnownTypeAttribute( string methodName, Type declaringType ) Inside the aforementioned static method add all service known types that ...
WCF Known Type error I get this error when calling my service: Server Error in '/' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please revi...
TITLE: WCF Known Type error QUESTION: I get this error when calling my service: Server Error in '/' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this re...
[ "wcf", "known-types" ]
2
2
1,723
1
0
2011-05-31T16:54:37.020000
2011-05-31T17:25:05.067000
6,190,907
6,190,937
Overflow issue in CSS
i have an iframe on my page and seem to be facing somewhat common issue... E Actually there are 2 iframes... 1. Header iframe which has table with some columns... 2. Content iframe which has table with column data.. Now the 2 iframe tables are aligned vertically... The alignment works fine if the columns are less and t...
you could adjust the height of the iframe if the scrollbars are present, just check the iframes scrollWidth against it's offsetWidth and if the scroll width is higher, increase the height of the iframe by the height of the scrollbar, prolly 5-10px, I'd have to check to be sure. Something like: $('#my_frame).ready(funct...
Overflow issue in CSS i have an iframe on my page and seem to be facing somewhat common issue... E Actually there are 2 iframes... 1. Header iframe which has table with some columns... 2. Content iframe which has table with column data.. Now the 2 iframe tables are aligned vertically... The alignment works fine if the ...
TITLE: Overflow issue in CSS QUESTION: i have an iframe on my page and seem to be facing somewhat common issue... E Actually there are 2 iframes... 1. Header iframe which has table with some columns... 2. Content iframe which has table with column data.. Now the 2 iframe tables are aligned vertically... The alignment ...
[ "javascript", "jquery", "html", "css", "overflow" ]
0
0
191
1
0
2011-05-31T16:54:52.497000
2011-05-31T16:58:20.487000
6,190,910
6,191,003
zend pagination page range vs item count per page
This may be a very basic question. But it is not very clear to me, the difference between setItemCountPerPage and setPageRange. The zend manual defines both as below. I don't see a difference on reading it. Could someone tell how they are different, may be in the context of actual usage. Thanks setItemCountPerPage: Set...
setItemCountPerPage refers to the ACTUAL DATA you are paginating. setPageRange refers to the PAGINATION CONTROLS (the little HTML snippet with links to the other pages). Check out the different pagination styles in your pagination controls and it will become very obvious what this is. You can really use one without the...
zend pagination page range vs item count per page This may be a very basic question. But it is not very clear to me, the difference between setItemCountPerPage and setPageRange. The zend manual defines both as below. I don't see a difference on reading it. Could someone tell how they are different, may be in the contex...
TITLE: zend pagination page range vs item count per page QUESTION: This may be a very basic question. But it is not very clear to me, the difference between setItemCountPerPage and setPageRange. The zend manual defines both as below. I don't see a difference on reading it. Could someone tell how they are different, ma...
[ "zend-framework", "zend-paginator" ]
1
4
2,962
1
0
2011-05-31T16:55:09.127000
2011-05-31T17:05:47.147000
6,190,919
6,190,941
MVVM relations between viewmodel-view
I am an newbie in wpf and mvvm. I can't answer a base question... What relations should be in my application between model,viewmodel, view... One view-one viewmodel, or one model-one viewmodel? Or may be one viewmodel-many view
one or more models => one view model one view model => one view
MVVM relations between viewmodel-view I am an newbie in wpf and mvvm. I can't answer a base question... What relations should be in my application between model,viewmodel, view... One view-one viewmodel, or one model-one viewmodel? Or may be one viewmodel-many view
TITLE: MVVM relations between viewmodel-view QUESTION: I am an newbie in wpf and mvvm. I can't answer a base question... What relations should be in my application between model,viewmodel, view... One view-one viewmodel, or one model-one viewmodel? Or may be one viewmodel-many view ANSWER: one or more models => one v...
[ "wpf", "mvvm", "design-patterns" ]
1
7
2,285
3
0
2011-05-31T16:56:23.603000
2011-05-31T16:58:43.027000
6,190,923
6,191,092
Apache Ant: Is it possible to insert/replace with text from a raw text file?
I'd like to take text from a standard text file and insert it into an XML that is copied with replace tokens by Apache Ant. Is this possible? Example (this is what I use so far): The ${app.updatenotes} are currently a string that is defined in a build.properties file. But instead I'd like to write update notes in a sim...
The apache ant loadfile task will allow to read your text file, and put its content into the app.updatenotes property. You can simply use: Then, use your filterchain, just as before. loadresource has some options, for instance to control the encoding of your file, or to control how to react if the file is not present, ...
Apache Ant: Is it possible to insert/replace with text from a raw text file? I'd like to take text from a standard text file and insert it into an XML that is copied with replace tokens by Apache Ant. Is this possible? Example (this is what I use so far): The ${app.updatenotes} are currently a string that is defined in...
TITLE: Apache Ant: Is it possible to insert/replace with text from a raw text file? QUESTION: I'd like to take text from a standard text file and insert it into an XML that is copied with replace tokens by Apache Ant. Is this possible? Example (this is what I use so far): The ${app.updatenotes} are currently a string ...
[ "apache", "ant", "insert", "replace" ]
4
6
4,188
1
0
2011-05-31T16:56:36.663000
2011-05-31T17:14:50.497000
6,190,929
6,190,980
Accessing running Grails application from a remote machine
I'm developing a Grails application to a school work. Typically, this is the URL for any server running on a local machine: http://localhost:8080/ProjectName After I run tomcat server with my Grails project, I go to that location and I can acess the website. But, as far as I know, everyone in my LAN should be able to l...
You need to use your machine's hostname or IP to access it from another machine. You can get this information from a command prompt: Windows C:\>hostname yourhostname C:\>ipconfig... IPv4 Address...........: 192.168.x.x Linux (usually) $ hostname yourhostname $ ifconfig... inet.addr:192.168.x.x You can use either of ...
Accessing running Grails application from a remote machine I'm developing a Grails application to a school work. Typically, this is the URL for any server running on a local machine: http://localhost:8080/ProjectName After I run tomcat server with my Grails project, I go to that location and I can acess the website. Bu...
TITLE: Accessing running Grails application from a remote machine QUESTION: I'm developing a Grails application to a school work. Typically, this is the URL for any server running on a local machine: http://localhost:8080/ProjectName After I run tomcat server with my Grails project, I go to that location and I can ace...
[ "grails" ]
2
3
2,101
2
0
2011-05-31T16:57:06.037000
2011-05-31T17:02:59.967000
6,190,939
6,191,148
Display data based on timeframe with SUM
With PHP and MySQL I am trying to display items with most votes over a certain period of time (24 hour, 1 week, 1 year, etc). When someone votes on an item, a table records the user, item id, vote, and time, like so: Table1 username | itemid | vote | time asdf | 127 | 1 | 1306726126 asdf | 124 | -1 | 1306726123 bob | 1...
Something like this should work. SELECT SUM(Table1.vote) as votes, Table2.* FROM Table2 LEFT JOIN Table1 ON Table1.itemid=Table2.itemid WHERE Table1.`time`>=DATE_SUB(Table1.`time`, INTERVAL 24 HOUR) GROUP BY Table1.itemid ORDER BY Table1.votes DESC
Display data based on timeframe with SUM With PHP and MySQL I am trying to display items with most votes over a certain period of time (24 hour, 1 week, 1 year, etc). When someone votes on an item, a table records the user, item id, vote, and time, like so: Table1 username | itemid | vote | time asdf | 127 | 1 | 130672...
TITLE: Display data based on timeframe with SUM QUESTION: With PHP and MySQL I am trying to display items with most votes over a certain period of time (24 hour, 1 week, 1 year, etc). When someone votes on an item, a table records the user, item id, vote, and time, like so: Table1 username | itemid | vote | time asdf ...
[ "php", "mysql", "database", "vote" ]
2
1
142
1
0
2011-05-31T16:58:37.410000
2011-05-31T17:20:43.977000
6,190,955
6,192,577
How to find struct member uses with cscope and ignore local variables?
I'm using cscope for a large project with vim, but without the vim mappings (they froze vim for some weird reason). I'm using cscope commands from within vim, and I want to be able to find uses of structure members throughout the code. Suppose I have something like this: 1 typedef struct _s{ 2 3 int x; 4 } S; 5 6 int m...
I don't think there is any way to get cscope to differentiate between the local variable x and the structure member variable. The way we solve this problem at my company is to use a unique naming scheme for the member variables that helps differentiate them: typedef struct _s{ int s_x; } S; It's a little bit awkward at...
How to find struct member uses with cscope and ignore local variables? I'm using cscope for a large project with vim, but without the vim mappings (they froze vim for some weird reason). I'm using cscope commands from within vim, and I want to be able to find uses of structure members throughout the code. Suppose I hav...
TITLE: How to find struct member uses with cscope and ignore local variables? QUESTION: I'm using cscope for a large project with vim, but without the vim mappings (they froze vim for some weird reason). I'm using cscope commands from within vim, and I want to be able to find uses of structure members throughout the c...
[ "c", "vim", "cscope" ]
13
4
2,300
2
0
2011-05-31T17:00:00.593000
2011-05-31T19:31:27.147000
6,190,960
6,191,036
Activating a different section of a JQuery Accordion
I'd really appreciate any help with this problem. This is a much simplified version of a longer set of php code, but it still has the problem, so I've ruled out the rest as the cause. The accordion is being created in the of the main page. The HTML that follows is generated by an included php file. The accordion works ...
The active option is what you need: activeType: Boolean or Integer Default: 0 Which panel is currently open. Multiple types supported: Boolean: Setting active to false will collapse all panels. This requires the collapsible option to be true. Integer: The zero-based index of the panel that is active (open). A negative ...
Activating a different section of a JQuery Accordion I'd really appreciate any help with this problem. This is a much simplified version of a longer set of php code, but it still has the problem, so I've ruled out the rest as the cause. The accordion is being created in the of the main page. The HTML that follows is ge...
TITLE: Activating a different section of a JQuery Accordion QUESTION: I'd really appreciate any help with this problem. This is a much simplified version of a longer set of php code, but it still has the problem, so I've ruled out the rest as the cause. The accordion is being created in the of the main page. The HTML ...
[ "jquery", "jquery-ui", "accordion" ]
2
5
2,886
1
0
2011-05-31T17:00:47.443000
2011-05-31T17:08:25.133000
6,190,963
6,191,216
C++ macro to convert a string to list of characters
Is it possible to have a macro to have: CHAR_LIST(chicken) to expand to: 'c', 'h', 'i', 'c', 'k', 'e', 'n' [Reason I want it: because for even moderate-sized strings, a macro is hugely more convenient than manually expanding. And the reason I need to expand is passing in a string to a varidiac template]
Update by the answerer, July 2015: Due to the comments above on the question itself, we can see the the real question was not about macros per se. The real problem the questioner wanted to solve was to be able to pass a literal string to a template that accepts a series of chars as non-type template arguments. Here is ...
C++ macro to convert a string to list of characters Is it possible to have a macro to have: CHAR_LIST(chicken) to expand to: 'c', 'h', 'i', 'c', 'k', 'e', 'n' [Reason I want it: because for even moderate-sized strings, a macro is hugely more convenient than manually expanding. And the reason I need to expand is passing...
TITLE: C++ macro to convert a string to list of characters QUESTION: Is it possible to have a macro to have: CHAR_LIST(chicken) to expand to: 'c', 'h', 'i', 'c', 'k', 'e', 'n' [Reason I want it: because for even moderate-sized strings, a macro is hugely more convenient than manually expanding. And the reason I need to...
[ "c++", "c", "macros" ]
10
9
4,768
2
0
2011-05-31T17:01:18.780000
2011-05-31T17:27:18.610000
6,190,971
6,191,007
Ordering results by total vote count
I'm building a voting system. There are two tables - one for votes, other for items being voted on. In this example, the items are threads. First, I get the items. Second, I get the votes for the items & count them. Third, I'd like to display the items in an order based on the total counted votes. $q = $db_conn->prepar...
This assumes there is one row per vote in the vote table: select t.id, t.title, c.VoteCount from thread t inner join ( select item_id, count(*) as VoteCount from vote where item_type_id = 1 group by item_id ) c on t.id = c.item_id order by c.VoteCount desc If not, you can do this: select t.id, t.title, v.Value as VoteC...
Ordering results by total vote count I'm building a voting system. There are two tables - one for votes, other for items being voted on. In this example, the items are threads. First, I get the items. Second, I get the votes for the items & count them. Third, I'd like to display the items in an order based on the total...
TITLE: Ordering results by total vote count QUESTION: I'm building a voting system. There are two tables - one for votes, other for items being voted on. In this example, the items are threads. First, I get the items. Second, I get the votes for the items & count them. Third, I'd like to display the items in an order ...
[ "php", "mysql", "voting" ]
2
1
425
2
0
2011-05-31T17:01:55.227000
2011-05-31T17:06:02.590000
6,190,972
6,191,014
Passing the Entire Array in VB.Net
I'm a beginner in programming. I wrote a script to set DNS setting using VB. I was able to set the primary address. However, I don't know how to set the secondary address because it will require the use of array. How can this be done? Dim DNS As String() = {"192.168.1.1", "192.168.1.2"} Dim objMC As ManagementClass = ...
In VB.Net the Dim keyword is actually short for Dimension and can be used for declaring arrays. Simply apply brackets to the variable or type and hey presto you have an array. Dim arrayOfString As String() Or Dim arrayOfString() As String Of course, its a little more complicated than that. You may want to declare your ...
Passing the Entire Array in VB.Net I'm a beginner in programming. I wrote a script to set DNS setting using VB. I was able to set the primary address. However, I don't know how to set the secondary address because it will require the use of array. How can this be done? Dim DNS As String() = {"192.168.1.1", "192.168.1.2...
TITLE: Passing the Entire Array in VB.Net QUESTION: I'm a beginner in programming. I wrote a script to set DNS setting using VB. I was able to set the primary address. However, I don't know how to set the secondary address because it will require the use of array. How can this be done? Dim DNS As String() = {"192.168....
[ "vb.net" ]
2
6
1,886
1
0
2011-05-31T17:01:58.983000
2011-05-31T17:06:39.173000
6,190,974
6,256,711
Access 2007: type mismatch when opening an ADO connection
I have an Access ADP file. I upgraded the back-end database to point to a SQL 2005 server instead of a SQL 2000 server and changed the database connection information appropriately. The file runs perfectly fine on my own system, running Windows 7 (64-bit) and Access 2007. On the target systems running Windows XP and Ac...
Here's what I finally found out that appears to be relevant: On 64-bit Windows 7 Pro, the Microsoft MDAC Component Checker tool tells me that I am running MDAC version "UNKNOWN", with file versions of either 6.1.7600.16385, or 6.1.7601.17514 (which by a strange coincidence match up very closely with the Windows version...
Access 2007: type mismatch when opening an ADO connection I have an Access ADP file. I upgraded the back-end database to point to a SQL 2005 server instead of a SQL 2000 server and changed the database connection information appropriately. The file runs perfectly fine on my own system, running Windows 7 (64-bit) and Ac...
TITLE: Access 2007: type mismatch when opening an ADO connection QUESTION: I have an Access ADP file. I upgraded the back-end database to point to a SQL 2005 server instead of a SQL 2000 server and changed the database connection information appropriately. The file runs perfectly fine on my own system, running Windows...
[ "ms-access", "ms-access-2007" ]
5
6
5,065
5
0
2011-05-31T17:02:00.937000
2011-06-06T19:00:07.390000
6,190,978
6,191,080
f#: initialize array of array
in the following code, does array of array A = B? let A = Array.init 3 (fun _ -> Array.init 2 (fun _ -> 0)) let defaultCreate n defaultValue = Array.init n (fun _ -> defaultValue) let B = defaultCreate 3 (defaultCreate 2 0) if I assign values to A and B, they are different,what happened? thanks. for i = 0 to 2 do for j...
They are not the same. Arrays are reference types, and are stored on the heap. When you create an array with another array as the default value, you are storing references to the same array, over and over again. Numbers are another thing. They are immutable, and are stored by value, on the stack. So you can't change th...
f#: initialize array of array in the following code, does array of array A = B? let A = Array.init 3 (fun _ -> Array.init 2 (fun _ -> 0)) let defaultCreate n defaultValue = Array.init n (fun _ -> defaultValue) let B = defaultCreate 3 (defaultCreate 2 0) if I assign values to A and B, they are different,what happened? t...
TITLE: f#: initialize array of array QUESTION: in the following code, does array of array A = B? let A = Array.init 3 (fun _ -> Array.init 2 (fun _ -> 0)) let defaultCreate n defaultValue = Array.init n (fun _ -> defaultValue) let B = defaultCreate 3 (defaultCreate 2 0) if I assign values to A and B, they are differen...
[ "f#" ]
1
0
583
2
0
2011-05-31T17:02:22.417000
2011-05-31T17:13:56.927000
6,190,982
6,191,102
What is the best way to handle connections (e.g. to mysql server using MySQLdb) in python, needed by multiple nested functions?
When accessing a MySQL database on low level using python, I use the MySQLdb module. I create a connection instance, then a cursor instance then I pass it to every function, that needs the cursor. Sometimes I have many nested function calls, all desiring the mysql_cursor. Would it hurt to initialise the connection as g...
I think that database cursors are scarce resources, so passing them around can limit your scalability and cause management issues (e.g. which method is responsible for closing the connection)? I'd recommend pooling connections and keeping them open for the shortest time possible. Check out the connection, perform the d...
What is the best way to handle connections (e.g. to mysql server using MySQLdb) in python, needed by multiple nested functions? When accessing a MySQL database on low level using python, I use the MySQLdb module. I create a connection instance, then a cursor instance then I pass it to every function, that needs the cur...
TITLE: What is the best way to handle connections (e.g. to mysql server using MySQLdb) in python, needed by multiple nested functions? QUESTION: When accessing a MySQL database on low level using python, I use the MySQLdb module. I create a connection instance, then a cursor instance then I pass it to every function, ...
[ "python", "connection", "global-variables" ]
2
1
315
1
0
2011-05-31T17:03:04.743000
2011-05-31T17:15:59.297000
6,190,993
6,194,212
Variable strangely takes the value zero after the call of a subroutine
I have been facing some issues trying to convert a code previously compiled with compaq visual fortran 6.6 to gfortran. Here is a specific problem I have met with gfortran: There is a variable called "et" which takes the value 3E+10. Then the program calls a subroutine. "et" doesn't appear in the subroutine, but after ...
Perhaps you have a memory access error, such as an array bounds violation, or a mismatch between actual and dummy arguments. Are the interfaces of the subroutines explicit, such as being "used" from a module? Also try turning on compiler debugging options... obviously subscript checking, but others might catch somethin...
Variable strangely takes the value zero after the call of a subroutine I have been facing some issues trying to convert a code previously compiled with compaq visual fortran 6.6 to gfortran. Here is a specific problem I have met with gfortran: There is a variable called "et" which takes the value 3E+10. Then the progra...
TITLE: Variable strangely takes the value zero after the call of a subroutine QUESTION: I have been facing some issues trying to convert a code previously compiled with compaq visual fortran 6.6 to gfortran. Here is a specific problem I have met with gfortran: There is a variable called "et" which takes the value 3E+1...
[ "fortran", "gfortran", "fortran-common-block" ]
0
2
454
2
0
2011-05-31T17:04:30.747000
2011-05-31T22:15:33
6,190,998
6,191,021
Need To Find My Own Process ID In VB6
I am changing the architecture of a VB 6 scheduling application from serial execution architecture to parallel execution and I need to do this with as little code changes as possible. Basically, the first instance of the.exe will start a defined amount of additional instances. One of the changes required is to update t...
Do it the same way a program in any other language would do it: Call GetCurrentProcessId.
Need To Find My Own Process ID In VB6 I am changing the architecture of a VB 6 scheduling application from serial execution architecture to parallel execution and I need to do this with as little code changes as possible. Basically, the first instance of the.exe will start a defined amount of additional instances. One ...
TITLE: Need To Find My Own Process ID In VB6 QUESTION: I am changing the architecture of a VB 6 scheduling application from serial execution architecture to parallel execution and I need to do this with as little code changes as possible. Basically, the first instance of the.exe will start a defined amount of addition...
[ "winapi", "vb6" ]
3
6
8,633
2
0
2011-05-31T17:05:07.677000
2011-05-31T17:07:22.560000
6,191,005
6,308,296
nhibernate alternate id's using generated properties
** This question has been edited to make it simpler and more focused ** Employee has an EmployeeNumberValue property which I would like to have auto-incremented by the db. To the business domain, this is a unique id assigned to employees and used to identify them on employee cards, etc. To the database however, it is a...
From a design perpective I wouldn't rely on NHibernate in this case. What I mean is, that in your domain model, you want an employee to get a new employee card number. In this case I would only allow an employee to be instantiated if there is a card number. public class EmployeeCardNumber { private string id = String.E...
nhibernate alternate id's using generated properties ** This question has been edited to make it simpler and more focused ** Employee has an EmployeeNumberValue property which I would like to have auto-incremented by the db. To the business domain, this is a unique id assigned to employees and used to identify them on ...
TITLE: nhibernate alternate id's using generated properties QUESTION: ** This question has been edited to make it simpler and more focused ** Employee has an EmployeeNumberValue property which I would like to have auto-incremented by the db. To the business domain, this is a unique id assigned to employees and used to...
[ "nhibernate", "identity", "sequences" ]
1
1
2,664
3
0
2011-05-31T17:05:48.380000
2011-06-10T15:09:35.073000
6,191,009
6,193,448
Python finding stdin filepath on Linux
How can I tell the file (or tty) that is attached to my stdios? Something like: >>> import sys >>> print sys.stdin.__path__ '/dev/tty1' >>> I could look in proc: import os, sys os.readlink('/proc/self/fd/%s' % sys.stdin.fileno()) But seems like there should be a builtin way?
Got it! >>> import os >>> import sys >>> print os.ttyname(sys.stdin.fileno()) '/dev/pts/0' >>> It raise s OSError: [Errno 22] Invalid argument if stdin isn't a TTY; but thats easy enough to test for with isatty()
Python finding stdin filepath on Linux How can I tell the file (or tty) that is attached to my stdios? Something like: >>> import sys >>> print sys.stdin.__path__ '/dev/tty1' >>> I could look in proc: import os, sys os.readlink('/proc/self/fd/%s' % sys.stdin.fileno()) But seems like there should be a builtin way?
TITLE: Python finding stdin filepath on Linux QUESTION: How can I tell the file (or tty) that is attached to my stdios? Something like: >>> import sys >>> print sys.stdin.__path__ '/dev/tty1' >>> I could look in proc: import os, sys os.readlink('/proc/self/fd/%s' % sys.stdin.fileno()) But seems like there should be a ...
[ "python", "stdin", "filepath" ]
5
1
1,595
2
0
2011-05-31T17:06:04.137000
2011-05-31T20:54:42.087000
6,191,025
6,193,821
Treat a java.lang.Iterable as a #list expression in Freemarker
I have a java.lang.Iterable (in fact, a com.google.gson.JsonArray instance). I would like to enumerate the items in the list using freemarker (2.3.16). [#assign sports = controller.sports] [#-- At this point, sports is bound to a com.google.gson.JsonArray instance. --] [#list sports as sport] ${sport_index} [/#list] I...
Explicitly looping over the iterator should work, e.g.: [#list sports.iterator() as sport] ${sport_index} [/#list]
Treat a java.lang.Iterable as a #list expression in Freemarker I have a java.lang.Iterable (in fact, a com.google.gson.JsonArray instance). I would like to enumerate the items in the list using freemarker (2.3.16). [#assign sports = controller.sports] [#-- At this point, sports is bound to a com.google.gson.JsonArray i...
TITLE: Treat a java.lang.Iterable as a #list expression in Freemarker QUESTION: I have a java.lang.Iterable (in fact, a com.google.gson.JsonArray instance). I would like to enumerate the items in the list using freemarker (2.3.16). [#assign sports = controller.sports] [#-- At this point, sports is bound to a com.googl...
[ "java", "list", "freemarker", "iterable" ]
5
5
4,029
3
0
2011-05-31T17:07:37.347000
2011-05-31T21:32:29.640000
6,191,031
6,191,069
Proper way to manage C++ include directives
I'm a little confused about how C++ handles includes. I have something like: typedef struct { //struct fields } Vertex; #include "GenericObject.h" Now in GenericObject.h I have: class GenericObject { public: Vertex* vertices; } When I try to compile, the compiler says: ISO C++ forbids declaration of 'Vertex' with no t...
Two things, first you want it to just be... struct Vertex { //struct fields }; That is a properly defined struct in C++. Now you either need to include Vertex.h, or what ever file contains the vertex struct, in your generic object header, #include "Vertex.h" class GenericObject { public: Vertex* vertices; }; or forward...
Proper way to manage C++ include directives I'm a little confused about how C++ handles includes. I have something like: typedef struct { //struct fields } Vertex; #include "GenericObject.h" Now in GenericObject.h I have: class GenericObject { public: Vertex* vertices; } When I try to compile, the compiler says: ISO C...
TITLE: Proper way to manage C++ include directives QUESTION: I'm a little confused about how C++ handles includes. I have something like: typedef struct { //struct fields } Vertex; #include "GenericObject.h" Now in GenericObject.h I have: class GenericObject { public: Vertex* vertices; } When I try to compile, the co...
[ "c++", "include" ]
2
9
1,145
5
0
2011-05-31T17:08:04.993000
2011-05-31T17:12:14.010000
6,191,038
6,191,247
Can content in DIVs be sorted?
Is it possible to sort DIVs, based on value from the form the DIV contains? Hare is the HTML, to better get a visual idea how the HTML looks like http://jsfiddle.net/littlesandra88/gtYBE/1/ Here is the HTML simplified to illustrate the problem: ID Title 127 27 What I would like is to be able to click on a button to sor...
Here is is an example of sorting by the id: http://jsfiddle.net/ryanrolds/CuJ9T/ The above example doesn't require jQuery. It's not a drop in solution for your exact problem but it should give a very good idea how to solve your current problem.
Can content in DIVs be sorted? Is it possible to sort DIVs, based on value from the form the DIV contains? Hare is the HTML, to better get a visual idea how the HTML looks like http://jsfiddle.net/littlesandra88/gtYBE/1/ Here is the HTML simplified to illustrate the problem: ID Title 127 27 What I would like is to be a...
TITLE: Can content in DIVs be sorted? QUESTION: Is it possible to sort DIVs, based on value from the form the DIV contains? Hare is the HTML, to better get a visual idea how the HTML looks like http://jsfiddle.net/littlesandra88/gtYBE/1/ Here is the HTML simplified to illustrate the problem: ID Title 127 27 What I wou...
[ "javascript", "jquery" ]
3
1
118
2
0
2011-05-31T17:08:40.593000
2011-05-31T17:29:53.557000
6,191,053
6,191,381
Creating a hit counter using the cache or application scope
I would like to create a hit counter for my ColdFusion app. I don't want the database hits table to be updated on each page hit. Ideally, I would like to aggregate the hits in the app scope, or the cache in some type of struct, then save them intermittently. I have to ideas so far:. Idea 1 Create an app or cache struct...
Trying to capture this data in the ways you've describe introduces scaling problems with cache expiration to avoid OOM or long iteration times as the number of entries grows when you ultimately want to persist to a database. The information you want to aggregate is already captured in web server logs. Parsing these is ...
Creating a hit counter using the cache or application scope I would like to create a hit counter for my ColdFusion app. I don't want the database hits table to be updated on each page hit. Ideally, I would like to aggregate the hits in the app scope, or the cache in some type of struct, then save them intermittently. I...
TITLE: Creating a hit counter using the cache or application scope QUESTION: I would like to create a hit counter for my ColdFusion app. I don't want the database hits table to be updated on each page hit. Ideally, I would like to aggregate the hits in the app scope, or the cache in some type of struct, then save them...
[ "architecture", "coldfusion", "coldfusion-9", "hit" ]
2
5
1,073
2
0
2011-05-31T17:10:51.900000
2011-05-31T17:42:46.017000
6,191,055
6,191,106
Would an MSI able to launch programs/files with elevated permissions automatically?
I am trying to make it possible for an.msi file to open an executable which will register a Browser Helper Object. Since this involves writing to the registry, cmd.exe must be elevated with administrative privelages. I am able to manipulate the ShellExecute() function to make a UAC dialog pop up and ask whether the use...
My understanding is that IF UAC is enabled there should be no way to get around it. If there is it is an exploit and should be avoided.
Would an MSI able to launch programs/files with elevated permissions automatically? I am trying to make it possible for an.msi file to open an executable which will register a Browser Helper Object. Since this involves writing to the registry, cmd.exe must be elevated with administrative privelages. I am able to manipu...
TITLE: Would an MSI able to launch programs/files with elevated permissions automatically? QUESTION: I am trying to make it possible for an.msi file to open an executable which will register a Browser Helper Object. Since this involves writing to the registry, cmd.exe must be elevated with administrative privelages. I...
[ "c++", "windows-installer", "bho", "cmd", "regsvr32" ]
0
0
284
2
0
2011-05-31T17:10:58.687000
2011-05-31T17:16:20.043000
6,191,071
6,191,368
java.lang.ArrayIndexOutOfBoundsException in android
I have an app in android(I'm running it on emulator) that receives location updates and I wanna found out the speed of the device that I track. I do this by computing the distance between two consecutive location updates and callculating the time that I receive these updates. And finally I wanna find the speed by divid...
Look at this snippet: if(time.length==2) { var=time[1]-time[0]; time[0]=time[1]; i=1; } i++; After this, the value of i is 2, because time.length == 2 is always true. Next time the method gets called, the line time[i]=t; will trigger the ArrayIndexOutOfBoundsException. Later edit: Better not bother with an array for ju...
java.lang.ArrayIndexOutOfBoundsException in android I have an app in android(I'm running it on emulator) that receives location updates and I wanna found out the speed of the device that I track. I do this by computing the distance between two consecutive location updates and callculating the time that I receive these ...
TITLE: java.lang.ArrayIndexOutOfBoundsException in android QUESTION: I have an app in android(I'm running it on emulator) that receives location updates and I wanna found out the speed of the device that I track. I do this by computing the distance between two consecutive location updates and callculating the time tha...
[ "android", "distance" ]
0
0
860
2
0
2011-05-31T17:12:21.900000
2011-05-31T17:42:05.613000
6,191,072
6,191,137
forward protocol @required to subclasses
I have: @interface SuperClass: UIViewController And then @interface SubClass: SuperClass This SuperClass does not have the required protocol methods implemented SubClass one does. Is it possible to prevent the warnings (saying SuperClass implementation is incomplete)? Instead of implementing empty/nil methods in SuperC...
No, what you're asking for is essentially abstract classes, which don't exist in Objective-C. Your best bet is to stub the methods in the base class to throw an exception of some kind.
forward protocol @required to subclasses I have: @interface SuperClass: UIViewController And then @interface SubClass: SuperClass This SuperClass does not have the required protocol methods implemented SubClass one does. Is it possible to prevent the warnings (saying SuperClass implementation is incomplete)? Instead of...
TITLE: forward protocol @required to subclasses QUESTION: I have: @interface SuperClass: UIViewController And then @interface SubClass: SuperClass This SuperClass does not have the required protocol methods implemented SubClass one does. Is it possible to prevent the warnings (saying SuperClass implementation is incom...
[ "objective-c" ]
6
5
1,613
4
0
2011-05-31T17:12:33.477000
2011-05-31T17:19:38
6,191,078
6,191,143
Javascript Date object odd behaviour/bug?
I'm working with javascript Date objects and seeing very odd behavior. If I keep setting a date object to another date object + an offset, it starts adding 30 days or so. If I reset the date object in between attempts or if I do the date math on the same object it works as expected. Probably easier to see the test bed ...
You keep adding 32 days from the date.getDate()+1 If you change to var test = new Date(); test.setDate( test.getDate() + 1 ); console.log("test1:", date, test); test.setDate( test.getDate() + 1 ); console.log("test2:", date, test); test.setDate( test.getDate() + 1 ); console.log("test3:", date, test); You get start: Da...
Javascript Date object odd behaviour/bug? I'm working with javascript Date objects and seeing very odd behavior. If I keep setting a date object to another date object + an offset, it starts adding 30 days or so. If I reset the date object in between attempts or if I do the date math on the same object it works as expe...
TITLE: Javascript Date object odd behaviour/bug? QUESTION: I'm working with javascript Date objects and seeing very odd behavior. If I keep setting a date object to another date object + an offset, it starts adding 30 days or so. If I reset the date object in between attempts or if I do the date math on the same objec...
[ "javascript", "date" ]
1
0
1,052
3
0
2011-05-31T17:13:47.130000
2011-05-31T17:20:12.777000
6,191,079
6,191,147
Retrieve Link ID
Let say we have link as following for link as ****.com/index.php?id=4 the is 4 for link as ****.com/4 the is 4 for link as ****.com/4-keyowrd-keyword $realid = array_shift(explode("-", $id)); so is 4 Now my question is for link as ****.com/4/keyword-keyword How then get the id as 4 is there any way to do it? Thanks
If you actually have a complete URL with the scheme included (i.e.: http://something.com and not just something.com), you can do: // Search in the query string $url = 'http://something.php/index.php?id=4'; $query = parse_url($url, PHP_URL_QUERY); parse_str($query, $queryArr); $id = $queryArr['id']; echo $id; // 4 // S...
Retrieve Link ID Let say we have link as following for link as ****.com/index.php?id=4 the is 4 for link as ****.com/4 the is 4 for link as ****.com/4-keyowrd-keyword $realid = array_shift(explode("-", $id)); so is 4 Now my question is for link as ****.com/4/keyword-keyword How then get the id as 4 is there any way to ...
TITLE: Retrieve Link ID QUESTION: Let say we have link as following for link as ****.com/index.php?id=4 the is 4 for link as ****.com/4 the is 4 for link as ****.com/4-keyowrd-keyword $realid = array_shift(explode("-", $id)); so is 4 Now my question is for link as ****.com/4/keyword-keyword How then get the id as 4 is...
[ "php" ]
1
2
129
3
0
2011-05-31T17:13:52.230000
2011-05-31T17:20:39.873000
6,191,086
6,191,107
What's the difference between String and new String?
Possible Duplicate: What is the purpose of the expression “new String(…)” in Java? What's the difference between these two statements: String a1 = new String("abc"); and String a2 = "abc"; If you could illustrate the difference, that would be great.
The first one is creating a new String object; the second one is effectively using one which already exists (it's created while loading the class file.) There is virtually never a reason to use the String(String) constructor. (I say virtually because there is one case: if you're breaking up a huge String by calling sub...
What's the difference between String and new String? Possible Duplicate: What is the purpose of the expression “new String(…)” in Java? What's the difference between these two statements: String a1 = new String("abc"); and String a2 = "abc"; If you could illustrate the difference, that would be great.
TITLE: What's the difference between String and new String? QUESTION: Possible Duplicate: What is the purpose of the expression “new String(…)” in Java? What's the difference between these two statements: String a1 = new String("abc"); and String a2 = "abc"; If you could illustrate the difference, that would be great....
[ "java" ]
2
3
1,378
1
0
2011-05-31T17:14:30.430000
2011-05-31T17:16:26.473000
6,191,089
6,191,120
checking if substring exist in range
In iOS, Given an URL https://whateverthisisanurl.google.com/helloworld If I want to test if google exists between the // and / whats is a good way to do it?
Try this NSString *mystring = @"https://whateverthisisanurl.google.com/helloworld"; NSString *regex = @".*?//.*?\\.google\\..*?/.*?"; NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; if ([regextest evaluateWithObject:mystring] == YES) { NSLog(@"Match!"); } else { NSLog(@"No match!...
checking if substring exist in range In iOS, Given an URL https://whateverthisisanurl.google.com/helloworld If I want to test if google exists between the // and / whats is a good way to do it?
TITLE: checking if substring exist in range QUESTION: In iOS, Given an URL https://whateverthisisanurl.google.com/helloworld If I want to test if google exists between the // and / whats is a good way to do it? ANSWER: Try this NSString *mystring = @"https://whateverthisisanurl.google.com/helloworld"; NSString *regex...
[ "ios" ]
1
3
377
1
0
2011-05-31T17:14:42.107000
2011-05-31T17:17:47.487000
6,191,093
6,191,127
<span>/<div> shorthand for css - is this legit?
If I create an HTML element: sc { font-variant: small-caps; } and apply it like this: I want to display this text in small-caps. it works as expected (except in IE, of course.) It becomes shorthand for.sc { font-variant: small-caps; } I want to display this text in small-caps. Is this intended/documented behavior? Is t...
XHTML (and XML on which it is based) is designed to let you add custom elements in a similar fashion, but instead using a custom XML namespace with your element names. Then you can either use CSS to style those elements directly, or use XSLT to transform them into real HTML elements. This is why (or at least one reason...
<span>/<div> shorthand for css - is this legit? If I create an HTML element: sc { font-variant: small-caps; } and apply it like this: I want to display this text in small-caps. it works as expected (except in IE, of course.) It becomes shorthand for.sc { font-variant: small-caps; } I want to display this text in small-...
TITLE: <span>/<div> shorthand for css - is this legit? QUESTION: If I create an HTML element: sc { font-variant: small-caps; } and apply it like this: I want to display this text in small-caps. it works as expected (except in IE, of course.) It becomes shorthand for.sc { font-variant: small-caps; } I want to display t...
[ "html", "css" ]
12
9
482
5
0
2011-05-31T17:14:51.483000
2011-05-31T17:18:29.710000
6,191,097
6,191,237
Problem transforming XML with XSLT
I am having problem transforming xml to xml using xsl. I found out where the problem comes from but still don't know how to fix it. I think the problems comes from this line If I remove the "uri="" xmlns="http://dl.kr.org/dig/2003/02/lang"" and leave only the " " everything works perfectly. But is there a way to transf...
You are correct: the reason your transformation isn't working is that you have a namespace declaration on the tells element. To make this particular problem go away, you need to make your XSLT aware of the namespace, and tell it that the tells element that it's trying to transform belongs to that namespace. The most co...
Problem transforming XML with XSLT I am having problem transforming xml to xml using xsl. I found out where the problem comes from but still don't know how to fix it. I think the problems comes from this line If I remove the "uri="" xmlns="http://dl.kr.org/dig/2003/02/lang"" and leave only the " " everything works perf...
TITLE: Problem transforming XML with XSLT QUESTION: I am having problem transforming xml to xml using xsl. I found out where the problem comes from but still don't know how to fix it. I think the problems comes from this line If I remove the "uri="" xmlns="http://dl.kr.org/dig/2003/02/lang"" and leave only the " " eve...
[ "xml", "xslt" ]
1
5
5,612
3
0
2011-05-31T17:15:40.920000
2011-05-31T17:29:10.047000
6,191,101
6,203,814
Struts multiple file upload with Dyna Action Forms (Struts 1)
I need to upload multiple files on a single page. With DynaAction forms you must specify the "name" of each one. I need this to be dynamic. I believe that I can use an array/list to get a bunch of files, but I can't match the files to anything specific. A map would be perfect, but I am afraid I cannot figure out the "k...
So I researched and spent 3 hours trying different stuff. There is a dearth of info on the web concerning this. Lots of unanswered questions. Now that Struts 1 is sunset, there will probably be no more info, so I thought I would add a nail to the coffin... I discovered that I was making this a bigger deal than I needed...
Struts multiple file upload with Dyna Action Forms (Struts 1) I need to upload multiple files on a single page. With DynaAction forms you must specify the "name" of each one. I need this to be dynamic. I believe that I can use an array/list to get a bunch of files, but I can't match the files to anything specific. A ma...
TITLE: Struts multiple file upload with Dyna Action Forms (Struts 1) QUESTION: I need to upload multiple files on a single page. With DynaAction forms you must specify the "name" of each one. I need this to be dynamic. I believe that I can use an array/list to get a bunch of files, but I can't match the files to anyth...
[ "file-upload", "struts", "struts-1" ]
0
1
2,506
1
0
2011-05-31T17:15:58.487000
2011-06-01T15:35:10.857000
6,191,104
6,201,206
Symfony admin generator, link to filtered result
i have an admin generator for the folowing model: #schema.yml Author: columns: name: { type: string(255), notnull: true } Book: columns: authorId: { type: integer, notnull: true } title: { type: string(512), notnull: true } content: { type: string(512), notnull: true } relations: Author: { onDelete: CASCADE, local: au...
This lecture answers your question (slide 39 and 40): http://www.slideshare.net/jcleveley/working-with-the-admin-generator in your actions.class php add: class AuthorActions extends AutoAuthorActions { public function executeViewBooks($request) { $this->getUser()->setAttribute( 'book.filters', array('authorId' => $requ...
Symfony admin generator, link to filtered result i have an admin generator for the folowing model: #schema.yml Author: columns: name: { type: string(255), notnull: true } Book: columns: authorId: { type: integer, notnull: true } title: { type: string(512), notnull: true } content: { type: string(512), notnull: true } ...
TITLE: Symfony admin generator, link to filtered result QUESTION: i have an admin generator for the folowing model: #schema.yml Author: columns: name: { type: string(255), notnull: true } Book: columns: authorId: { type: integer, notnull: true } title: { type: string(512), notnull: true } content: { type: string(512)...
[ "symfony1", "filter", "admin-generator" ]
5
5
2,086
1
0
2011-05-31T17:16:10.873000
2011-06-01T12:33:31.827000
6,191,109
6,191,158
Textarea horiz. scrollbar not applying
I have a textarea that contains code. The problem is, that in order for it to look good, the Textarea has to stop wrapping the text, and use a Horizontal Scrollbar instead. I tried this: textarea { overflow: scroll; overflow-y: scroll; overflow-x: scroll; overflow:-moz-scrollbars-horizontal; } and this: textarea { ov...
Set the wrap attribute to off Demo: http://jsfiddle.net/wesley_murch/HZkLK/ There is also a soft and hard value for wrap. The only decent reference on this I found on tizag.com, although there must be better ones out there. From the linked page: The wrap attribute refers to how the text reacts when it reaches the end o...
Textarea horiz. scrollbar not applying I have a textarea that contains code. The problem is, that in order for it to look good, the Textarea has to stop wrapping the text, and use a Horizontal Scrollbar instead. I tried this: textarea { overflow: scroll; overflow-y: scroll; overflow-x: scroll; overflow:-moz-scrollbars-...
TITLE: Textarea horiz. scrollbar not applying QUESTION: I have a textarea that contains code. The problem is, that in order for it to look good, the Textarea has to stop wrapping the text, and use a Horizontal Scrollbar instead. I tried this: textarea { overflow: scroll; overflow-y: scroll; overflow-x: scroll; overflo...
[ "html", "css", "textarea", "scrollbar" ]
6
11
7,081
3
0
2011-05-31T17:16:37.003000
2011-05-31T17:22:52.253000
6,191,116
6,202,970
Stuck in making 2D game movement engine
I am making a movement engine for my top-down 2D game, but I got stuck trying to solve the following problem: The player can move using the arrow keys, which accelerate you in the respective directions. There is friction so you stop moving after releasing the keys, though not instantly. When you hold two perpendicular ...
Sorry for not letting you think about this for more than a day, but I managed to solve it, and it ain't two lines of code. (Though still thanks for everyone for the ideas) Because I'm lazy and tired, I won't change it to pseudocode, except the following two methods: updateGame(){ player.walk(); player.move(); } player....
Stuck in making 2D game movement engine I am making a movement engine for my top-down 2D game, but I got stuck trying to solve the following problem: The player can move using the arrow keys, which accelerate you in the respective directions. There is friction so you stop moving after releasing the keys, though not ins...
TITLE: Stuck in making 2D game movement engine QUESTION: I am making a movement engine for my top-down 2D game, but I got stuck trying to solve the following problem: The player can move using the arrow keys, which accelerate you in the respective directions. There is friction so you stop moving after releasing the ke...
[ "2d" ]
3
1
2,111
3
0
2011-05-31T17:17:20.147000
2011-06-01T14:39:08.707000