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,181,820 | 6,182,149 | Remove the windows border/Go fullscreen from a WPF Pages app | I have a WPF Pages (not Window) application, and I would like for it to go fullscreen without the border/seeing the windows taskbar. All the instructions i've seen are for WPF Windows. | Pages apps are designed to run inside a container. The container can be the browser or your own window. It's up to the container to handle the full screen operation. edit Ok, I get it. When no window is present, the framework creates one for you. You can access the window using Application.MainWindow and you can change... | Remove the windows border/Go fullscreen from a WPF Pages app I have a WPF Pages (not Window) application, and I would like for it to go fullscreen without the border/seeing the windows taskbar. All the instructions i've seen are for WPF Windows. | TITLE:
Remove the windows border/Go fullscreen from a WPF Pages app
QUESTION:
I have a WPF Pages (not Window) application, and I would like for it to go fullscreen without the border/seeing the windows taskbar. All the instructions i've seen are for WPF Windows.
ANSWER:
Pages apps are designed to run inside a contain... | [
"c#",
"wpf"
] | 3 | 3 | 2,888 | 1 | 0 | 2011-05-31T00:21:40.607000 | 2011-05-31T01:34:14.447000 |
6,181,822 | 6,181,853 | How do I post a javascript variable to an ASP.net MVC Model? | Im trying to use the Yahoo rich text editor in my web application. I'm kind of new to web programming so this may be a silly question. I'm using a custom model called "blogpost". It contains the following properties: Title Body DateCreated Author I want to use the custom editor for only the "body" property. When I clic... | You can't do this in your MVC View. You need to do it in javascript. You'll need to hook the Submit event on the form and then get the value of the text in the editor, and add it to the post data. Something like: $('form').submit(function(event){ // cancel the default action event.preventDefault(); var body = escape(my... | How do I post a javascript variable to an ASP.net MVC Model? Im trying to use the Yahoo rich text editor in my web application. I'm kind of new to web programming so this may be a silly question. I'm using a custom model called "blogpost". It contains the following properties: Title Body DateCreated Author I want to us... | TITLE:
How do I post a javascript variable to an ASP.net MVC Model?
QUESTION:
Im trying to use the Yahoo rich text editor in my web application. I'm kind of new to web programming so this may be a silly question. I'm using a custom model called "blogpost". It contains the following properties: Title Body DateCreated A... | [
"javascript",
"jquery",
"asp.net-mvc-3",
"yui"
] | 2 | 2 | 2,916 | 2 | 0 | 2011-05-31T00:22:05.993000 | 2011-05-31T00:31:24.220000 |
6,181,845 | 6,192,457 | How can I transform a Map to a case class in Scala? | If I have a Map[String,String]("url" -> "xxx", "title" -> "yyy"), is there an way to generically transform it into a case class Image(url:String, title:String)? I can write a helper: object Image{ def fromMap(params:Map[String,String]) = Image(url=params("url"), title=params("title")) } but is there a way to genericall... | First off, there are some safe alternatives you could do if you just want to shorten your code. The companion object can be treated as a function so you could use something like this: def build2[A,B,C](m: Map[A,B], f: (B,B) => C)(k1: A, k2: A): Option[C] = for { v1 <- m.get(k1) v2 <- m.get(k2) } yield f(v1, v2)
build2... | How can I transform a Map to a case class in Scala? If I have a Map[String,String]("url" -> "xxx", "title" -> "yyy"), is there an way to generically transform it into a case class Image(url:String, title:String)? I can write a helper: object Image{ def fromMap(params:Map[String,String]) = Image(url=params("url"), title... | TITLE:
How can I transform a Map to a case class in Scala?
QUESTION:
If I have a Map[String,String]("url" -> "xxx", "title" -> "yyy"), is there an way to generically transform it into a case class Image(url:String, title:String)? I can write a helper: object Image{ def fromMap(params:Map[String,String]) = Image(url=pa... | [
"class",
"scala",
"dictionary",
"case"
] | 17 | 8 | 8,923 | 5 | 0 | 2011-05-31T00:29:45.937000 | 2011-05-31T19:19:40.487000 |
6,181,847 | 6,186,273 | Android Broadcast Receiver in Widget | Is it possible to register for a broadcast receiver from within a widget? I have tried a few ways and the registration seems to work but the widget is never called back when the event occurs. | Is it possible to register for a broadcast receiver from within a widget? No, sorry. Whatever problem you are trying to solve this way can either be solved a better way or should not be solved. | Android Broadcast Receiver in Widget Is it possible to register for a broadcast receiver from within a widget? I have tried a few ways and the registration seems to work but the widget is never called back when the event occurs. | TITLE:
Android Broadcast Receiver in Widget
QUESTION:
Is it possible to register for a broadcast receiver from within a widget? I have tried a few ways and the registration seems to work but the widget is never called back when the event occurs.
ANSWER:
Is it possible to register for a broadcast receiver from within ... | [
"android",
"broadcastreceiver"
] | 0 | 3 | 2,884 | 3 | 0 | 2011-05-31T00:30:08.340000 | 2011-05-31T10:34:25.740000 |
6,181,849 | 6,181,924 | Dispatcher.BeginInvoke , trying to use lambda to get string set from textblock, but getting conversion error | I am trying to call a selected listbox item from a button, not the listbox.selecteditemchanged method in wpf. So when i try string yadda = listbox.SelectedItem.ToString(); i get an exception: The calling thread cannot access this object because a different thread owns it. So, what i was trying to do is the following: D... | Convert the lambda to an Action: Dispatcher.BeginInvoke((Action)(() => { /*DoStuff*/ })); Or construct one from the lambda: Dispatcher.BeginInvoke(new Action(() => { /*DoStuff*/ })); You probably can write an extension method for the Dispatcher that takes an Action, that way the lambda would be implicitly converted. | Dispatcher.BeginInvoke , trying to use lambda to get string set from textblock, but getting conversion error I am trying to call a selected listbox item from a button, not the listbox.selecteditemchanged method in wpf. So when i try string yadda = listbox.SelectedItem.ToString(); i get an exception: The calling thread ... | TITLE:
Dispatcher.BeginInvoke , trying to use lambda to get string set from textblock, but getting conversion error
QUESTION:
I am trying to call a selected listbox item from a button, not the listbox.selecteditemchanged method in wpf. So when i try string yadda = listbox.SelectedItem.ToString(); i get an exception: T... | [
"c#",
"wpf",
"delegates",
"lambda"
] | 14 | 27 | 7,261 | 1 | 0 | 2011-05-31T00:30:31.730000 | 2011-05-31T00:50:56.250000 |
6,181,855 | 6,181,871 | how to detect invalid commands being passed into create process | I am currently working on a program that starts a program that is specified by the user. passed in is as a wstring entered in by the user. My question is how do i make it throw an exception or check if "passedIn" is vaild. Currently, if the user enters in "notepad.exe" it launches it properly but if they enter somthing... | Quoting the function's documentation (which should have been the first thing you checked): If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. So, check the function's return value. | how to detect invalid commands being passed into create process I am currently working on a program that starts a program that is specified by the user. passed in is as a wstring entered in by the user. My question is how do i make it throw an exception or check if "passedIn" is vaild. Currently, if the user enters in ... | TITLE:
how to detect invalid commands being passed into create process
QUESTION:
I am currently working on a program that starts a program that is specified by the user. passed in is as a wstring entered in by the user. My question is how do i make it throw an exception or check if "passedIn" is vaild. Currently, if t... | [
"c++",
"winapi",
"exception",
"createprocess"
] | 3 | 3 | 133 | 1 | 0 | 2011-05-31T00:31:45.867000 | 2011-05-31T00:36:09.430000 |
6,181,864 | 6,194,207 | Scala execution times in Eclipse | There's something fishy going on when I run Scala programs from Eclipse. I run an App object and it takes 7.8 s to run (actual execution time timed with System.nanoTime in the object). When I run the same.class file from the command line it takes 2.5 s. I notice above the Console window it says Run(1)[Scala Application... | After some experimentation I have 95% of the answer so I will give it myself: I am running Windows 7 64-bit. The command line is using the 32-bit JDK environment, as specified by JAVA_HOME variable. Eclipse is using the 64-bit JRE environment, specified via Window | Preferences | Java | Installed JREs and the project's... | Scala execution times in Eclipse There's something fishy going on when I run Scala programs from Eclipse. I run an App object and it takes 7.8 s to run (actual execution time timed with System.nanoTime in the object). When I run the same.class file from the command line it takes 2.5 s. I notice above the Console window... | TITLE:
Scala execution times in Eclipse
QUESTION:
There's something fishy going on when I run Scala programs from Eclipse. I run an App object and it takes 7.8 s to run (actual execution time timed with System.nanoTime in the object). When I run the same.class file from the command line it takes 2.5 s. I notice above ... | [
"eclipse",
"performance",
"scala",
"eclipse-plugin",
"scala-ide"
] | 4 | 4 | 1,351 | 1 | 0 | 2011-05-31T00:34:37.640000 | 2011-05-31T22:15:08.090000 |
6,181,865 | 6,183,359 | AutoFixture IEnumerable<T> behavior with CreateMany() | When looking at the post here, it looks like I should be able to create several objects using CreateMany(), iterate over them using foreach, and then return them as an array. What I'm seeing is that each iteration seems to create new objects each time. Is this expected behavior? Entity to create: public class TestEntit... | This is indeed the expected default behavior. There are many reasons for that, but basically it boils down to that when you ask for a IEnumerable AutoFixture actually goes to great lengths to ensure that you get only what you ask for. This is surprising behavior to many. The good news is that you can change it. fixture... | AutoFixture IEnumerable<T> behavior with CreateMany() When looking at the post here, it looks like I should be able to create several objects using CreateMany(), iterate over them using foreach, and then return them as an array. What I'm seeing is that each iteration seems to create new objects each time. Is this expec... | TITLE:
AutoFixture IEnumerable<T> behavior with CreateMany()
QUESTION:
When looking at the post here, it looks like I should be able to create several objects using CreateMany(), iterate over them using foreach, and then return them as an array. What I'm seeing is that each iteration seems to create new objects each t... | [
"c#",
"autofixture"
] | 14 | 9 | 9,463 | 1 | 0 | 2011-05-31T00:34:39.293000 | 2011-05-31T05:28:27.273000 |
6,181,870 | 6,181,889 | Closing around a variable in an event handler | I know there is a smart way to utilize closures and do what I am looking for, but I'm not sure what it is. In the following code: var MyApp = { innerObject: { myData: "test value", myMethod: function() { // 'this' ends up referring to HTMLElement, not what I want alert(this.myData); } } open: function() { document.getE... | Keep a reference to this and pass an anonymous function: var self = this; document.getElementById('connectLink').addEventListener('click', function() { self.innerObject.myMethod(); }, false); Also remember that you have to use attachEvent in IE. Update: Newer browsers provide.bind() which lets you bind the context of t... | Closing around a variable in an event handler I know there is a smart way to utilize closures and do what I am looking for, but I'm not sure what it is. In the following code: var MyApp = { innerObject: { myData: "test value", myMethod: function() { // 'this' ends up referring to HTMLElement, not what I want alert(this... | TITLE:
Closing around a variable in an event handler
QUESTION:
I know there is a smart way to utilize closures and do what I am looking for, but I'm not sure what it is. In the following code: var MyApp = { innerObject: { myData: "test value", myMethod: function() { // 'this' ends up referring to HTMLElement, not what... | [
"javascript",
"event-handling",
"closures"
] | 1 | 1 | 96 | 2 | 0 | 2011-05-31T00:35:39.897000 | 2011-05-31T00:41:17.030000 |
6,181,872 | 6,194,248 | Eager-loading most recent item of a has-many relationship | I have two models: Conversation and Message. A message belongs_to a conversation, and a conversation has_many messages: # conversation.rb class Conversation < ActiveRecord::Base has_many:messages end
# message.rb class Message < ActiveRecord::Base belongs_to:conversation end I have an interface that is going to list a... | You can use another association: # conversation.rb class Conversation < ActiveRecord::Base has_many:messages has_one:last_message,:class_name => "Message",:order => "created_at DESC" end
# controller @conversations = Conversation.includes(:last_message)
# view @conversations.each do |conversation| most_recent_message... | Eager-loading most recent item of a has-many relationship I have two models: Conversation and Message. A message belongs_to a conversation, and a conversation has_many messages: # conversation.rb class Conversation < ActiveRecord::Base has_many:messages end
# message.rb class Message < ActiveRecord::Base belongs_to:co... | TITLE:
Eager-loading most recent item of a has-many relationship
QUESTION:
I have two models: Conversation and Message. A message belongs_to a conversation, and a conversation has_many messages: # conversation.rb class Conversation < ActiveRecord::Base has_many:messages end
# message.rb class Message < ActiveRecord::... | [
"ruby-on-rails",
"ruby-on-rails-3",
"has-many",
"eager-loading"
] | 0 | 1 | 734 | 2 | 0 | 2011-05-31T00:36:13.507000 | 2011-05-31T22:23:03.933000 |
6,181,873 | 6,181,909 | Access object value within accepts_nested_attributes_for form | I have the following setup: class Option < ActiveRecord::Base has_many:size_prices accepts_nested_attributes_for:size_prices end
def new @option = Option.new @sizes = @customization.item.sizes @sizes.each do |size| @option.size_prices.build({:size_id => size.id}) end end
<%= f.fields_for:size_prices do |price_form| %... | Yep, the.object on fields_for will give you the object it is building for <%= f.fields_for:size_prices do |price_form| %> <%= price_form.object.size_id %>... | Access object value within accepts_nested_attributes_for form I have the following setup: class Option < ActiveRecord::Base has_many:size_prices accepts_nested_attributes_for:size_prices end
def new @option = Option.new @sizes = @customization.item.sizes @sizes.each do |size| @option.size_prices.build({:size_id => siz... | TITLE:
Access object value within accepts_nested_attributes_for form
QUESTION:
I have the following setup: class Option < ActiveRecord::Base has_many:size_prices accepts_nested_attributes_for:size_prices end
def new @option = Option.new @sizes = @customization.item.sizes @sizes.each do |size| @option.size_prices.buil... | [
"ruby-on-rails",
"nested-forms"
] | 4 | 3 | 1,818 | 1 | 0 | 2011-05-31T00:36:15.940000 | 2011-05-31T00:47:49.947000 |
6,181,876 | 6,181,888 | Sign In/Sign Out toggle | I asked this question earlier today. After trying out suggestions from a few members, I could not accomplish what I want to do. Here is a little more detail. I am trying to achieve a "Sign In/Sign Out" toggle functionality when I click on a hyperlink. On my main page I have HTML like this: Admin When I click the anchor... | Not sure if this is the cause, but you should use addClass and removeClass to toggle classes. And you could shorten it to $(this).find('a').removeClass('btnsignin').addClass('btnsignout') | Sign In/Sign Out toggle I asked this question earlier today. After trying out suggestions from a few members, I could not accomplish what I want to do. Here is a little more detail. I am trying to achieve a "Sign In/Sign Out" toggle functionality when I click on a hyperlink. On my main page I have HTML like this: Admin... | TITLE:
Sign In/Sign Out toggle
QUESTION:
I asked this question earlier today. After trying out suggestions from a few members, I could not accomplish what I want to do. Here is a little more detail. I am trying to achieve a "Sign In/Sign Out" toggle functionality when I click on a hyperlink. On my main page I have HTM... | [
"jquery",
"ajax"
] | 1 | 0 | 466 | 1 | 0 | 2011-05-31T00:37:03.460000 | 2011-05-31T00:41:09.167000 |
6,181,882 | 6,181,894 | Having problem in show() hide() in javascript | <%= select_tag "options", options_for_select(MyModel::ALL_TYPES),:onchange => "serviceChange(this.options[this.selectedIndex].value);" %> <%= f.label:profile_url %> <%= f.text_field:profile_url %> I am having trouble with show and hide. Can anyone help me and explain why it is not working? When I use function the funct... | in your first code block you have if (value == "OTHER") but you never pass anything in called value or define what value is. That may be causing your issue. Try changing that to list if that's what you're passing in and trying to check against. For your second question about the onchange not working, where is checkType... | Having problem in show() hide() in javascript <%= select_tag "options", options_for_select(MyModel::ALL_TYPES),:onchange => "serviceChange(this.options[this.selectedIndex].value);" %> <%= f.label:profile_url %> <%= f.text_field:profile_url %> I am having trouble with show and hide. Can anyone help me and explain why it... | TITLE:
Having problem in show() hide() in javascript
QUESTION:
<%= select_tag "options", options_for_select(MyModel::ALL_TYPES),:onchange => "serviceChange(this.options[this.selectedIndex].value);" %> <%= f.label:profile_url %> <%= f.text_field:profile_url %> I am having trouble with show and hide. Can anyone help me ... | [
"javascript",
"ruby-on-rails"
] | 0 | 2 | 143 | 1 | 0 | 2011-05-31T00:39:20.683000 | 2011-05-31T00:42:30.683000 |
6,181,887 | 6,211,464 | XCode 4 / iOS 4.3 Build Errors on ASI HTTP Library | My development machine died and I've had to rebuild it from scratch. I reinstalled the latest XCode which came with iOS SDK 4.3. I reopened my project and have had to readd all my frameworks to get the code to mostly compile. I'm down to two errors, both basically this: error: expected specifier-qualifier-list before '... | OK, my "fix" for this problem was to create a new project in the new XCode version and copy my classes and resources over. It took about a half an hour to do so as I had about 100 files to move, but it worked on the first attempt. I can only guess that there was some subtle difference between XCode versions I wasn't aw... | XCode 4 / iOS 4.3 Build Errors on ASI HTTP Library My development machine died and I've had to rebuild it from scratch. I reinstalled the latest XCode which came with iOS SDK 4.3. I reopened my project and have had to readd all my frameworks to get the code to mostly compile. I'm down to two errors, both basically this... | TITLE:
XCode 4 / iOS 4.3 Build Errors on ASI HTTP Library
QUESTION:
My development machine died and I've had to rebuild it from scratch. I reinstalled the latest XCode which came with iOS SDK 4.3. I reopened my project and have had to readd all my frameworks to get the code to mostly compile. I'm down to two errors, b... | [
"ios",
"ios4",
"asihttprequest"
] | 0 | 0 | 450 | 1 | 0 | 2011-05-31T00:40:49.887000 | 2011-06-02T07:01:39.003000 |
6,181,895 | 6,181,999 | Array to Virtual Object | Problem! I was wondering if it is possible for an array to be transfered into a virtual object via method. Let's say that I have a class "Person" with two properties "@name" and "@lastname" and then I have an array containing this information, so What I need is to pass each array item into a new object from Person's cl... | Yes class Array def to_vo klass klass.new *self end #..OR.. def to_person Person.new *self end end
p a.map { |e| e.to_vo Person } p a.map(&:to_person) | Array to Virtual Object Problem! I was wondering if it is possible for an array to be transfered into a virtual object via method. Let's say that I have a class "Person" with two properties "@name" and "@lastname" and then I have an array containing this information, so What I need is to pass each array item into a new... | TITLE:
Array to Virtual Object
QUESTION:
Problem! I was wondering if it is possible for an array to be transfered into a virtual object via method. Let's say that I have a class "Person" with two properties "@name" and "@lastname" and then I have an array containing this information, so What I need is to pass each arr... | [
"ruby",
"casting",
"jruby",
"data-transfer-objects"
] | 0 | 3 | 241 | 1 | 0 | 2011-05-31T00:43:13.267000 | 2011-05-31T01:06:27.653000 |
6,181,902 | 6,181,955 | Help with a constraint | I'm creating a table and one of the constraints is that first character must be "G" and then followed by 5 numeric digits: CREATE TABLE PHONE ( PHONEID CHAR (6) NOT NULL, PHONENO NUMERIC NOT NULL, CONSTRAINT PHONE_PHONEID_PK PRIMARY KEY (PHONEID), CONSTRAINT PHONE_PHONENO_UK UNIQUE (PHONENO) ); How do I do this using s... | In MS SQL this would look like this: create table Phone ( PhoneId char(6) not null constraint Phone_PhoneId_PK primary key constraint Phone_PhoneId_CK check (PhoneId like 'G[0-9][0-9][0-9][0-9][0-9]'), PhoneNumber numeric not null constraint Phone_PhoneNumber_UK unique )
insert Phone values('G00001', 123) -- pass
ins... | Help with a constraint I'm creating a table and one of the constraints is that first character must be "G" and then followed by 5 numeric digits: CREATE TABLE PHONE ( PHONEID CHAR (6) NOT NULL, PHONENO NUMERIC NOT NULL, CONSTRAINT PHONE_PHONEID_PK PRIMARY KEY (PHONEID), CONSTRAINT PHONE_PHONENO_UK UNIQUE (PHONENO) ); H... | TITLE:
Help with a constraint
QUESTION:
I'm creating a table and one of the constraints is that first character must be "G" and then followed by 5 numeric digits: CREATE TABLE PHONE ( PHONEID CHAR (6) NOT NULL, PHONENO NUMERIC NOT NULL, CONSTRAINT PHONE_PHONEID_PK PRIMARY KEY (PHONEID), CONSTRAINT PHONE_PHONENO_UK UNI... | [
"sql",
"sql-server",
"oracle",
"database-design",
"constraints"
] | 2 | 2 | 800 | 2 | 0 | 2011-05-31T00:45:52.053000 | 2011-05-31T00:58:00.927000 |
6,181,903 | 6,192,929 | create different modes of interaction in cocos2d | [EDIT: Here's a link to a mockup of what I'm trying to create] http://i53.tinypic.com/w9v2np.jpg I'm trying to create an app for drawing diagrams in cocos2d that have different types of objects, but can't figure what is the best way to allow the user to choose which icon type to add to the diagram. Basically, how do yo... | I suggest you to create the DrawingLayer (CCLayer subclass), PaletteLayer and ControlsLayer. Create the Manager class (subclass from CCLayer if you want to make this class responsible for touches) which will provide the interface for interactions between those layers and store your diagram. The manager will also do suc... | create different modes of interaction in cocos2d [EDIT: Here's a link to a mockup of what I'm trying to create] http://i53.tinypic.com/w9v2np.jpg I'm trying to create an app for drawing diagrams in cocos2d that have different types of objects, but can't figure what is the best way to allow the user to choose which icon... | TITLE:
create different modes of interaction in cocos2d
QUESTION:
[EDIT: Here's a link to a mockup of what I'm trying to create] http://i53.tinypic.com/w9v2np.jpg I'm trying to create an app for drawing diagrams in cocos2d that have different types of objects, but can't figure what is the best way to allow the user to... | [
"drag-and-drop",
"cocos2d-iphone",
"drawing"
] | 0 | 0 | 166 | 1 | 0 | 2011-05-31T00:45:55.220000 | 2011-05-31T20:06:03.260000 |
6,181,905 | 6,182,373 | Matlab area() edge colors cover the axes lines, is there a work around? | figure('Color', 'w') box on x = 1:10; y = 5 * x + 2; area(x, y, 'FaceColor', 'b', 'EdgeColor', 'b') This code creates a figure with the area under the curve shaded blue. The EdgeColor property sets the trapezoidal line around the filled area to blue but this covers up the black axes lines and tick marks. I'm not sure w... | Try adding the following after your code for the figure (gca refers to the current axes): set(gca,'Layer','top') | Matlab area() edge colors cover the axes lines, is there a work around? figure('Color', 'w') box on x = 1:10; y = 5 * x + 2; area(x, y, 'FaceColor', 'b', 'EdgeColor', 'b') This code creates a figure with the area under the curve shaded blue. The EdgeColor property sets the trapezoidal line around the filled area to blu... | TITLE:
Matlab area() edge colors cover the axes lines, is there a work around?
QUESTION:
figure('Color', 'w') box on x = 1:10; y = 5 * x + 2; area(x, y, 'FaceColor', 'b', 'EdgeColor', 'b') This code creates a figure with the area under the curve shaded blue. The EdgeColor property sets the trapezoidal line around the ... | [
"matlab",
"area",
"figure",
"axes"
] | 11 | 12 | 8,929 | 1 | 0 | 2011-05-31T00:46:39.907000 | 2011-05-31T02:18:18.550000 |
6,181,913 | 6,181,933 | jsp, drag and drop, mysql, treeview | i am using JSP. Now assume I have three tables in mysql related as follows Department -> Project -> Members So we can have many Departments each of which can have as many projects and each project will have members... Now i want to design my JSP page as follows -DepartmentA -ProjectA >>Person1 >>Person2 -ProjectB >>Per... | I would have a look at Ext.js. TreeView examples: http://www.sencha.com/products/extjs/examples/#sample-6 Drag and Drop examples: http://www.sencha.com/products/extjs/examples/#sample-9 Open source, and free with the right license. Also jQuery has a very good plugin called jsTree. Check it out: http://www.jstree.com/ M... | jsp, drag and drop, mysql, treeview i am using JSP. Now assume I have three tables in mysql related as follows Department -> Project -> Members So we can have many Departments each of which can have as many projects and each project will have members... Now i want to design my JSP page as follows -DepartmentA -ProjectA... | TITLE:
jsp, drag and drop, mysql, treeview
QUESTION:
i am using JSP. Now assume I have three tables in mysql related as follows Department -> Project -> Members So we can have many Departments each of which can have as many projects and each project will have members... Now i want to design my JSP page as follows -Dep... | [
"mysql",
"ajax",
"jsp",
"drag-and-drop"
] | 1 | 1 | 2,443 | 1 | 0 | 2011-05-31T00:49:00.920000 | 2011-05-31T00:53:07.663000 |
6,181,914 | 6,181,932 | Open source video encoders for an embedded system | I recently designed an H.323 / SIP compliant video server (in code at least) fully equipped with a sockets based API which a.NET SDK would use, and a web server, you know... all of that stuff. Anyway, I chose to use OPAL for my call stack and based my architecture loosely upon the design of EKIGA. I even hijacked the s... | This is the time for microptimisation: Time to look carefully at your inner loops. You need to figure out which inner loops matter, and then look carefully at how you can get the most throughput. You can also do a sanity check: Can the machine really do what you want to do? Eg. if you need to do n multiple/accumulate o... | Open source video encoders for an embedded system I recently designed an H.323 / SIP compliant video server (in code at least) fully equipped with a sockets based API which a.NET SDK would use, and a web server, you know... all of that stuff. Anyway, I chose to use OPAL for my call stack and based my architecture loose... | TITLE:
Open source video encoders for an embedded system
QUESTION:
I recently designed an H.323 / SIP compliant video server (in code at least) fully equipped with a sockets based API which a.NET SDK would use, and a web server, you know... all of that stuff. Anyway, I chose to use OPAL for my call stack and based my ... | [
"c++",
"c",
"linux",
"voip",
"embedded-linux"
] | 3 | 1 | 1,363 | 2 | 0 | 2011-05-31T00:49:22.673000 | 2011-05-31T00:52:57.760000 |
6,181,926 | 6,181,972 | Alternative to Microsoft Access for Data Capture | I have an existing Access Database with forms and reports. This was done back in 2000. At the time of development it was purely to put out fires and get something done for people to start capturing data in a database format, run reports and filter results. I have no idea who created it as the person has since left and ... | There are various database management tools along the level of Access listed at http://alternatives.rzero.com/db.html and Alternatives to Access. The problem is that migrating data is often fairly easy compared to forms and code. If you have an existing application that is working OK, but not well documented etc, then ... | Alternative to Microsoft Access for Data Capture I have an existing Access Database with forms and reports. This was done back in 2000. At the time of development it was purely to put out fires and get something done for people to start capturing data in a database format, run reports and filter results. I have no idea... | TITLE:
Alternative to Microsoft Access for Data Capture
QUESTION:
I have an existing Access Database with forms and reports. This was done back in 2000. At the time of development it was purely to put out fires and get something done for people to start capturing data in a database format, run reports and filter resul... | [
"database",
"ms-access"
] | 1 | 7 | 1,781 | 5 | 0 | 2011-05-31T00:51:13.890000 | 2011-05-31T01:00:40.053000 |
6,181,929 | 6,181,956 | How can I get Vim to highlight syntax as well as textmate | I like the idea of the of editing inside the terminal and like the key bindings of Vim, but the text highlighting in my Vim is much worse than in Textmate. The comparison (textmate is first): Obviously Vim is much worse. I've turned on syntax highlighting in my.vimrc, and have installed python.vim (not sure if this wor... | EDIT 2: If you edit python.vim, you'll find the following line: syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite That's the crucial line for you. So basically, it styles def and class with pythonStatement and anything that follows it is styled with pythonFunction. You might want to rewrite it to... | How can I get Vim to highlight syntax as well as textmate I like the idea of the of editing inside the terminal and like the key bindings of Vim, but the text highlighting in my Vim is much worse than in Textmate. The comparison (textmate is first): Obviously Vim is much worse. I've turned on syntax highlighting in my.... | TITLE:
How can I get Vim to highlight syntax as well as textmate
QUESTION:
I like the idea of the of editing inside the terminal and like the key bindings of Vim, but the text highlighting in my Vim is much worse than in Textmate. The comparison (textmate is first): Obviously Vim is much worse. I've turned on syntax h... | [
"python",
"vim",
"textmate"
] | 0 | 4 | 1,783 | 1 | 0 | 2011-05-31T00:52:19.650000 | 2011-05-31T00:58:04.547000 |
6,181,935 | 6,181,978 | How do you create different variable names while in a loop? | For example purposes... for x in range(0,9): string'x' = "Hello" So I end up with string1, string2, string3... all equaling "Hello" | Sure you can; it's called a dictionary: d = {} for x in range(1, 10): d["string{0}".format(x)] = "Hello" >>> d["string5"] 'Hello' >>> d {'string1': 'Hello', 'string2': 'Hello', 'string3': 'Hello', 'string4': 'Hello', 'string5': 'Hello', 'string6': 'Hello', 'string7': 'Hello', 'string8': 'Hello', 'string9': 'Hello'} I s... | How do you create different variable names while in a loop? For example purposes... for x in range(0,9): string'x' = "Hello" So I end up with string1, string2, string3... all equaling "Hello" | TITLE:
How do you create different variable names while in a loop?
QUESTION:
For example purposes... for x in range(0,9): string'x' = "Hello" So I end up with string1, string2, string3... all equaling "Hello"
ANSWER:
Sure you can; it's called a dictionary: d = {} for x in range(1, 10): d["string{0}".format(x)] = "Hel... | [
"python",
"loops",
"variables"
] | 210 | 241 | 653,930 | 9 | 0 | 2011-05-31T00:53:48.807000 | 2011-05-31T01:02:19.220000 |
6,181,937 | 6,181,957 | How to do a 'Proper case' formatting of a mysql column? | Is it possible in mysql to format a column in Proper Case? Example: Proper("ABSALOM") = "Absalom" I have searched a lot and I think MySQL doesn't have any inbuilt function to do this. Is it possible to do this any other way in MySQL? | You can combine CONCAT and SUBSTRING: CONCAT(UCASE(SUBSTRING(`fieldName`, 1, 1)), LOWER(SUBSTRING(`fieldName`, 2))) | How to do a 'Proper case' formatting of a mysql column? Is it possible in mysql to format a column in Proper Case? Example: Proper("ABSALOM") = "Absalom" I have searched a lot and I think MySQL doesn't have any inbuilt function to do this. Is it possible to do this any other way in MySQL? | TITLE:
How to do a 'Proper case' formatting of a mysql column?
QUESTION:
Is it possible in mysql to format a column in Proper Case? Example: Proper("ABSALOM") = "Absalom" I have searched a lot and I think MySQL doesn't have any inbuilt function to do this. Is it possible to do this any other way in MySQL?
ANSWER:
You... | [
"mysql"
] | 34 | 59 | 52,609 | 5 | 0 | 2011-05-31T00:54:43.450000 | 2011-05-31T00:58:11.157000 |
6,181,944 | 6,182,203 | Mathematica: why 3D plot remember last viewpoint/rotation made to it, even after evaluating again? | I find this a bit annoying. I make a 3D plot, initially it come up in the default orientation. Then, using the mouse, I rotate it some way. Now I run the command again, expecting to obtain the original shape (i.e the original orientation before I rotated it by mouse), but instead, it just gives me the same plot I have ... | Try: With PreserveImageOptions->False, settings for image options from the previous version of a graphic are always ignored. | Mathematica: why 3D plot remember last viewpoint/rotation made to it, even after evaluating again? I find this a bit annoying. I make a 3D plot, initially it come up in the default orientation. Then, using the mouse, I rotate it some way. Now I run the command again, expecting to obtain the original shape (i.e the orig... | TITLE:
Mathematica: why 3D plot remember last viewpoint/rotation made to it, even after evaluating again?
QUESTION:
I find this a bit annoying. I make a 3D plot, initially it come up in the default orientation. Then, using the mouse, I rotate it some way. Now I run the command again, expecting to obtain the original s... | [
"wolfram-mathematica"
] | 3 | 6 | 2,344 | 3 | 0 | 2011-05-31T00:56:01.483000 | 2011-05-31T01:48:09.043000 |
6,181,946 | 6,181,983 | How can I change multiple <SPAN> 's backgroundColor at random intervals? | So I have multiple spans like this: My Span I'd like them to twinkle/blink if you will, with each changing background colors from their normal color state to another color I'll define for just about.5 to 1 second and then back to their normal color. But I would like them all to fire at random times so it doesn't look l... | Get a reference to all span elements. Store their original background color with style.backgroundColor. Generate a random number of seconds. Use setInterval() with a 1000 interval. Each interval, decrement the random number of seconds. When it is 0, change the background color. Use a new setTimeout() to restore the ori... | How can I change multiple <SPAN> 's backgroundColor at random intervals? So I have multiple spans like this: My Span I'd like them to twinkle/blink if you will, with each changing background colors from their normal color state to another color I'll define for just about.5 to 1 second and then back to their normal colo... | TITLE:
How can I change multiple <SPAN> 's backgroundColor at random intervals?
QUESTION:
So I have multiple spans like this: My Span I'd like them to twinkle/blink if you will, with each changing background colors from their normal color state to another color I'll define for just about.5 to 1 second and then back to... | [
"javascript",
"css",
"background-color",
"html"
] | 0 | 3 | 1,162 | 1 | 0 | 2011-05-31T00:56:10.070000 | 2011-05-31T01:03:13.197000 |
6,181,950 | 6,182,181 | TortoiseSVN update file from different path | I was just wondering if this is possible using TortoiseSVN: I have a file living in one directory in the repository, let's say: \\repo\work_branch\bin\Important.dll This file gets updated whenever it needs to be, but always at this location in the repository. I have another folder, containing a different executable, i.... | Yeah. svn:external can do that for you. if you're on 1.6.x or higher you can do it on a single file, 1.5 only works on directories. The syntax for file externals is: http://svnbook.red-bean.com/nightly/en/svn.advanced.externals.html You want to be very sure that you use an explicit revision as the target of your extern... | TortoiseSVN update file from different path I was just wondering if this is possible using TortoiseSVN: I have a file living in one directory in the repository, let's say: \\repo\work_branch\bin\Important.dll This file gets updated whenever it needs to be, but always at this location in the repository. I have another f... | TITLE:
TortoiseSVN update file from different path
QUESTION:
I was just wondering if this is possible using TortoiseSVN: I have a file living in one directory in the repository, let's say: \\repo\work_branch\bin\Important.dll This file gets updated whenever it needs to be, but always at this location in the repository... | [
"svn",
"filesystems",
"tortoisesvn"
] | 1 | 1 | 103 | 2 | 0 | 2011-05-31T00:56:50.347000 | 2011-05-31T01:43:29.847000 |
6,181,960 | 6,182,531 | fetching objects from core data not in a set | I'm trying to fetch objects from core data that are not in a given set, but I haven't been able to get it to work. For instance, suppose that we have a core data entity named User, which has a few attributes such as userName, familyName, givenName, and active. Given an array of strings representing a set of usernames, ... | In order to find the objects that aren't in your array, all you have to do is something like this: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (userName IN %@)", userNames]; That should return a request of all the objects without the ones you specified | fetching objects from core data not in a set I'm trying to fetch objects from core data that are not in a given set, but I haven't been able to get it to work. For instance, suppose that we have a core data entity named User, which has a few attributes such as userName, familyName, givenName, and active. Given an array... | TITLE:
fetching objects from core data not in a set
QUESTION:
I'm trying to fetch objects from core data that are not in a given set, but I haven't been able to get it to work. For instance, suppose that we have a core data entity named User, which has a few attributes such as userName, familyName, givenName, and acti... | [
"iphone",
"objective-c",
"core-data",
"nspredicate"
] | 29 | 69 | 12,856 | 3 | 0 | 2011-05-31T00:58:42.253000 | 2011-05-31T02:48:10.917000 |
6,181,961 | 6,182,080 | Ruby on Rails 3 Time - Parse Milliseconds | I'm trying to parse a date like: 2011-05-21 04:20:46.011 into a Time object in Rails. So far I have the following: Time.strptime("2011-05-21 04:20:46.011", "%Y-%m-%d %H:%M:%S.%3N") But it doesn't seem to like the "%3N" at the end. How do I parse this date? | Use parse: x = Time.parse("2011-05-21 04:20:46.011", "%Y-%m-%d %H:%M:%S.%3N") # => 2011-05-21 04:20:46 -0700 x.usec # => 11000 In many case you don't need to pass in the format either: x = Time.parse("2011-05-21 04:20:46.011") # => 2011-05-21 04:20:46 -0700 x.usec # => 11000 | Ruby on Rails 3 Time - Parse Milliseconds I'm trying to parse a date like: 2011-05-21 04:20:46.011 into a Time object in Rails. So far I have the following: Time.strptime("2011-05-21 04:20:46.011", "%Y-%m-%d %H:%M:%S.%3N") But it doesn't seem to like the "%3N" at the end. How do I parse this date? | TITLE:
Ruby on Rails 3 Time - Parse Milliseconds
QUESTION:
I'm trying to parse a date like: 2011-05-21 04:20:46.011 into a Time object in Rails. So far I have the following: Time.strptime("2011-05-21 04:20:46.011", "%Y-%m-%d %H:%M:%S.%3N") But it doesn't seem to like the "%3N" at the end. How do I parse this date?
AN... | [
"ruby-on-rails",
"ruby",
"datetime",
"time",
"milliseconds"
] | 2 | 9 | 6,821 | 3 | 0 | 2011-05-31T00:58:45.450000 | 2011-05-31T01:21:33.147000 |
6,181,969 | 6,195,012 | Scaling Nginx, PHP-FPM and MongoDB | I am looking for the best way to scale a PHP application under Nginx using PHP-FPM. I am looking at a concurrency of about 1200. Currently, anything over 400 starts to get slow response times. Response size is generally very small, but a few may be fairly large. Request sizes are usually small except for a select few. ... | It seems all it took was a little bit of calculations. Since I have 8 cores available, I can generate more nginx worker processes: nginx.conf worker_processes 4; events { worker_connections 1024; } And 16gb of ram will give some leg room for a static amount of php-fpm workers. php-fpm.conf pm = static pm.max_children =... | Scaling Nginx, PHP-FPM and MongoDB I am looking for the best way to scale a PHP application under Nginx using PHP-FPM. I am looking at a concurrency of about 1200. Currently, anything over 400 starts to get slow response times. Response size is generally very small, but a few may be fairly large. Request sizes are usua... | TITLE:
Scaling Nginx, PHP-FPM and MongoDB
QUESTION:
I am looking for the best way to scale a PHP application under Nginx using PHP-FPM. I am looking at a concurrency of about 1200. Currently, anything over 400 starts to get slow response times. Response size is generally very small, but a few may be fairly large. Requ... | [
"php",
"linux",
"mongodb",
"nginx"
] | 8 | 6 | 7,449 | 2 | 0 | 2011-05-31T01:00:07.830000 | 2011-06-01T00:26:12.303000 |
6,181,980 | 6,182,012 | How can I use a foreach loop to build json objects and call jquery functions in razor | I want to take a list of objects and iterate through the list and build a json object and call a jquery function in a foreach loop of razor. @foreach (var item in Model.CoordinatesObj) { var pinpoint = { "top": item.Top, "left": item.Left, "width": item.Width, "height": item.Height }; $("#toPinpoint").mapImage.addPinpo... | I would put the for loop in an MVC action and then call it using $.ajax() $.ajax({ url: "/Home/NewAction/id", type: "POST", error: function(req,status,errorObj) { /* handle error */ }, success: function(result) { var pinpoint = result; $("#toPinpoint").mapImage.addPinpointExt(pinpoint); } }); use Razor for generating H... | How can I use a foreach loop to build json objects and call jquery functions in razor I want to take a list of objects and iterate through the list and build a json object and call a jquery function in a foreach loop of razor. @foreach (var item in Model.CoordinatesObj) { var pinpoint = { "top": item.Top, "left": item.... | TITLE:
How can I use a foreach loop to build json objects and call jquery functions in razor
QUESTION:
I want to take a list of objects and iterate through the list and build a json object and call a jquery function in a foreach loop of razor. @foreach (var item in Model.CoordinatesObj) { var pinpoint = { "top": item.... | [
"c#",
"jquery",
"asp.net",
"asp.net-mvc-3",
"razor"
] | 1 | 1 | 2,798 | 3 | 0 | 2011-05-31T01:02:47.287000 | 2011-05-31T01:10:17.137000 |
6,181,986 | 6,182,011 | A site for random useful javascript snippets for web development? | I'm going through a pretty amazing ruby on rails course. Just a second ago I learned about flash hashes that show a message after some action has been performed. Obviously, you can apply styling to it and what have you, but I wonder if there are ready-to-go javascript snippets out there that, in the case of flash hashe... | This is not exactly what you asked for but the jQuery and jQuery UI libraries provide a fair number of animation effects that you might find useful. jQuery UI effect() demos - you can also view the source to see how it's being done. jQuery effects - in particular, you might be interested in fadeIn() and fadeOut(). Agai... | A site for random useful javascript snippets for web development? I'm going through a pretty amazing ruby on rails course. Just a second ago I learned about flash hashes that show a message after some action has been performed. Obviously, you can apply styling to it and what have you, but I wonder if there are ready-to... | TITLE:
A site for random useful javascript snippets for web development?
QUESTION:
I'm going through a pretty amazing ruby on rails course. Just a second ago I learned about flash hashes that show a message after some action has been performed. Obviously, you can apply styling to it and what have you, but I wonder if ... | [
"javascript",
"ruby-on-rails"
] | 2 | 2 | 95 | 1 | 0 | 2011-05-31T01:04:15.443000 | 2011-05-31T01:09:44.437000 |
6,181,989 | 6,182,124 | How is wait behaving in this script? | I have this: #!/bin/bash
trap 'echo $? $?' SIGINT
for i in `seq 10`; do echo hello from for sleep 10 done &
bgproc=$! echo bgproc is $bgproc ps -o pid,ppid,cmd echo "waiting now" wait $bgproc I do kill -2 and get 0 0 as o/p Question: When I send SIGINT to this script. Why does it terminate? I know its because of the... | From the Bash Reference Manual: When Bash is waiting for an asynchronous command via the wait builtin, the reception of a signal for which a trap has been set will cause the wait builtin to return immediately with an exit status greater than 128, immediately after which the trap is executed. | How is wait behaving in this script? I have this: #!/bin/bash
trap 'echo $? $?' SIGINT
for i in `seq 10`; do echo hello from for sleep 10 done &
bgproc=$! echo bgproc is $bgproc ps -o pid,ppid,cmd echo "waiting now" wait $bgproc I do kill -2 and get 0 0 as o/p Question: When I send SIGINT to this script. Why does it... | TITLE:
How is wait behaving in this script?
QUESTION:
I have this: #!/bin/bash
trap 'echo $? $?' SIGINT
for i in `seq 10`; do echo hello from for sleep 10 done &
bgproc=$! echo bgproc is $bgproc ps -o pid,ppid,cmd echo "waiting now" wait $bgproc I do kill -2 and get 0 0 as o/p Question: When I send SIGINT to this s... | [
"linux",
"bash"
] | 0 | 3 | 102 | 1 | 0 | 2011-05-31T01:04:26.470000 | 2011-05-31T01:31:00.480000 |
6,181,991 | 6,182,529 | BeginForm rendering a blank action method | The problem is whenever I hardcode Action and Controller in BeginForm it results in a blank action method. I am confused. Below view has been invoked from HomeController and Index action method. @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "first" })) {} Result Below view has been invoked from Ho... | You should try to debug your routes with this tool that you can download from NuGet. http://haacked.com/archive/2011/04/13/routedebugger-2.aspx PM> Install-Package RouteDebugger Let me know how it works for you. | BeginForm rendering a blank action method The problem is whenever I hardcode Action and Controller in BeginForm it results in a blank action method. I am confused. Below view has been invoked from HomeController and Index action method. @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "first" })) {} ... | TITLE:
BeginForm rendering a blank action method
QUESTION:
The problem is whenever I hardcode Action and Controller in BeginForm it results in a blank action method. I am confused. Below view has been invoked from HomeController and Index action method. @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id... | [
".net",
"asp.net-mvc",
"asp.net-mvc-3"
] | 0 | 1 | 594 | 1 | 0 | 2011-05-31T01:04:44.797000 | 2011-05-31T02:47:33.027000 |
6,181,993 | 6,192,047 | Facebook Image Viewer Scrolling Question | I've noticed on facebook, when viewing an image that is larger than the height of your browser window, it will alter the scrollbar of the entire page, so that scrolling up and down will reveal the parts of the image you're missing. Having not been formally trained in the art of JavaScript/CSS, maybe I missed the lesson... | Figured out what I was going for... To use the facebook image viewer theater as an example, when you click to view an image, it will set body's overflow to hidden. At the same time, they will fade in their theater div, whose properties are something along the lines of: position: fixed; width: 100%; height: 100%; top: 0... | Facebook Image Viewer Scrolling Question I've noticed on facebook, when viewing an image that is larger than the height of your browser window, it will alter the scrollbar of the entire page, so that scrolling up and down will reveal the parts of the image you're missing. Having not been formally trained in the art of ... | TITLE:
Facebook Image Viewer Scrolling Question
QUESTION:
I've noticed on facebook, when viewing an image that is larger than the height of your browser window, it will alter the scrollbar of the entire page, so that scrolling up and down will reveal the parts of the image you're missing. Having not been formally trai... | [
"javascript",
"jquery",
"css",
"facebook"
] | 0 | 0 | 1,054 | 2 | 0 | 2011-05-31T01:05:49.917000 | 2011-05-31T18:44:02.737000 |
6,182,000 | 6,182,486 | PHP script as single binary | I was whatching facebook's development steps and getting codes live, i think they are making their script as a single binary and pushing a single file. We got a portal with alot of files inside which coded with PHP. is there any encoder or compiler can bundle all files in single one? While we are pushing our codes to o... | FaceBook use a tool named HipHop which compiles PHP into a single binary executable. | PHP script as single binary I was whatching facebook's development steps and getting codes live, i think they are making their script as a single binary and pushing a single file. We got a portal with alot of files inside which coded with PHP. is there any encoder or compiler can bundle all files in single one? While w... | TITLE:
PHP script as single binary
QUESTION:
I was whatching facebook's development steps and getting codes live, i think they are making their script as a single binary and pushing a single file. We got a portal with alot of files inside which coded with PHP. is there any encoder or compiler can bundle all files in s... | [
"php",
"release-management"
] | 1 | 0 | 3,375 | 3 | 0 | 2011-05-31T01:06:33.783000 | 2011-05-31T02:39:59.110000 |
6,182,002 | 6,182,081 | Error with RelativeLayout and EditText | I am trying to add ads into my app, and I get this weird error that I just can't see how I am possibly getting it. Here is the error 05-30 20:02:48.889: ERROR/AndroidRuntime(3420): FATAL EXCEPTION: main 05-30 20:02:48.889: ERROR/AndroidRuntime(3420): java.lang.RuntimeException: Unable to start activity ComponentInfo{co... | The only thing I can think of is that your project properties (which includes IDs) need fixing. They get out of sync sometimes when you add new IDs/other properties to the project. In eclipse you can right click on the project and select Android > Fix Project Properties. If that doesn't work I have sometimes had to del... | Error with RelativeLayout and EditText I am trying to add ads into my app, and I get this weird error that I just can't see how I am possibly getting it. Here is the error 05-30 20:02:48.889: ERROR/AndroidRuntime(3420): FATAL EXCEPTION: main 05-30 20:02:48.889: ERROR/AndroidRuntime(3420): java.lang.RuntimeException: Un... | TITLE:
Error with RelativeLayout and EditText
QUESTION:
I am trying to add ads into my app, and I get this weird error that I just can't see how I am possibly getting it. Here is the error 05-30 20:02:48.889: ERROR/AndroidRuntime(3420): FATAL EXCEPTION: main 05-30 20:02:48.889: ERROR/AndroidRuntime(3420): java.lang.Ru... | [
"java",
"android",
"android-edittext",
"android-relativelayout"
] | 1 | 2 | 419 | 1 | 0 | 2011-05-31T01:06:45.177000 | 2011-05-31T01:21:41.767000 |
6,182,003 | 6,182,096 | Why is the keyword 'then' required in KRL | When I'm writing a conditional action block in a KRL rule I always forget the 'then' keyword. Here is the correct syntax: rule with_conditions { select when pageview ".*" pre { cheese = "Camembert"; } if (cheese like re/bert/) then { notify("Odd Cheese", "#{cheese} is unusual."); } fired { raise explicit event "odd_che... | Probably because the writers of the language felt that adding then was more natural. | Why is the keyword 'then' required in KRL When I'm writing a conditional action block in a KRL rule I always forget the 'then' keyword. Here is the correct syntax: rule with_conditions { select when pageview ".*" pre { cheese = "Camembert"; } if (cheese like re/bert/) then { notify("Odd Cheese", "#{cheese} is unusual."... | TITLE:
Why is the keyword 'then' required in KRL
QUESTION:
When I'm writing a conditional action block in a KRL rule I always forget the 'then' keyword. Here is the correct syntax: rule with_conditions { select when pageview ".*" pre { cheese = "Camembert"; } if (cheese like re/bert/) then { notify("Odd Cheese", "#{ch... | [
"grammar",
"krl"
] | 2 | 2 | 84 | 1 | 0 | 2011-05-31T01:07:46.310000 | 2011-05-31T01:25:08.067000 |
6,182,005 | 6,182,033 | Rough computation of distance between 2 points | I want to calculate the rough (approximate) distance between two points to reduce the computation overhead. I am using the following formula for the distance between (x1, y1) & (x2, y2): Dist = Mod (x1 - x2) + Mod (y1 - y2) Where Mod is the Modulus operator such that Mod(x) = |X|. This seems to be working. I want to kn... | As long as you're getting the absolute value (like you stated |X|) and not using the modulus function then that will give you the manhattan distance between the two points If that is what you want, then you've not missed anything If you want the straight line distance use the pythagorean theorem. This is sqrt((x1 - x2)... | Rough computation of distance between 2 points I want to calculate the rough (approximate) distance between two points to reduce the computation overhead. I am using the following formula for the distance between (x1, y1) & (x2, y2): Dist = Mod (x1 - x2) + Mod (y1 - y2) Where Mod is the Modulus operator such that Mod(x... | TITLE:
Rough computation of distance between 2 points
QUESTION:
I want to calculate the rough (approximate) distance between two points to reduce the computation overhead. I am using the following formula for the distance between (x1, y1) & (x2, y2): Dist = Mod (x1 - x2) + Mod (y1 - y2) Where Mod is the Modulus operat... | [
"math",
"image-processing",
"geometry"
] | 5 | 12 | 7,471 | 7 | 0 | 2011-05-31T01:08:34.757000 | 2011-05-31T01:13:07.423000 |
6,182,006 | 6,182,138 | Reading Binary File | so I am trying to read a filesystem disk, which has been provided. So, what I want to do is read the 1044 byte from the filesystem. What I am currently doing is the following: if (fp = fopen("filesysFile-full", "r")) { fseek(fp, 1044, SEEK_SET); //Goes to 1024th byte int check[sizeof(char)*4]; //creates a buffer array ... | This line: int check[sizeof(char)*4]; allocates an array of 4 ints. The type of check is therefore int*, so this line: printf("%d",check); prints the address of the array. What you should do it allocate it as an int: int check; and then fread into it: fread(✓, 1, sizeof(int), fp); (This code, incidentally, assumes that... | Reading Binary File so I am trying to read a filesystem disk, which has been provided. So, what I want to do is read the 1044 byte from the filesystem. What I am currently doing is the following: if (fp = fopen("filesysFile-full", "r")) { fseek(fp, 1044, SEEK_SET); //Goes to 1024th byte int check[sizeof(char)*4]; //cre... | TITLE:
Reading Binary File
QUESTION:
so I am trying to read a filesystem disk, which has been provided. So, what I want to do is read the 1044 byte from the filesystem. What I am currently doing is the following: if (fp = fopen("filesysFile-full", "r")) { fseek(fp, 1044, SEEK_SET); //Goes to 1024th byte int check[size... | [
"fread"
] | 0 | 1 | 2,189 | 2 | 0 | 2011-05-31T01:08:42.617000 | 2011-05-31T01:32:57.023000 |
6,182,022 | 6,182,140 | I don't understand how I dynamically resized ul in a div | I'm dynamically filling a div with li elements using php. I was having trouble getting the scrollable area to be limited to content. I was previously using a crap load of extra space in my ul, and I still am but when I set height in the css to 70% it works perfectly. Is this because a ul is traditionally vertical and I... | Your div#lasteventimg has its height property spelled wrong. ul is a block level element and renders as such. A div is also a block level element. Because you have floated the li's they sit next to each other until the container is full horizontally. Then they will wrap to the next line. To prevent the wrapping you can... | I don't understand how I dynamically resized ul in a div I'm dynamically filling a div with li elements using php. I was having trouble getting the scrollable area to be limited to content. I was previously using a crap load of extra space in my ul, and I still am but when I set height in the css to 70% it works perfec... | TITLE:
I don't understand how I dynamically resized ul in a div
QUESTION:
I'm dynamically filling a div with li elements using php. I was having trouble getting the scrollable area to be limited to content. I was previously using a crap load of extra space in my ul, and I still am but when I set height in the css to 7... | [
"css",
"dynamic",
"html-lists"
] | 0 | 0 | 882 | 3 | 0 | 2011-05-31T01:11:40.837000 | 2011-05-31T01:33:03.670000 |
6,182,023 | 6,182,027 | The meaning of **/* in the Ant script | In the following Ant script, what is the meaning of **/*? | ** means any level of subdirectory i.e. match a/x.java, a/b/y.java, a/b/c/z.java, etc. | The meaning of **/* in the Ant script In the following Ant script, what is the meaning of **/*? | TITLE:
The meaning of **/* in the Ant script
QUESTION:
In the following Ant script, what is the meaning of **/*?
ANSWER:
** means any level of subdirectory i.e. match a/x.java, a/b/y.java, a/b/c/z.java, etc. | [
"java",
"ant"
] | 3 | 8 | 233 | 1 | 0 | 2011-05-31T01:11:48.980000 | 2011-05-31T01:12:26.807000 |
6,182,028 | 6,182,045 | How to return an array from a Javascript Facebook API request? | Hopefully there is an easy way to do this and my Javascript skills are just lacking. I am wanting to call a function that will get some Facebook posts, add them to an array and return to use elsewhere. Current code is below. function GetFaceBookStream(name, max) { FB.init({ apiKey: 'removed for post' }); var lastDate =... | You're making an asynchronous AJAX request. The callback only runs after your code finishes. You need to pass the data back using a callback. For example: function GetFaceBookStream(name, max, callback) {... FB.api(..., function(response) {... callback(something, else); }); } You can call the function by supplying a ca... | How to return an array from a Javascript Facebook API request? Hopefully there is an easy way to do this and my Javascript skills are just lacking. I am wanting to call a function that will get some Facebook posts, add them to an array and return to use elsewhere. Current code is below. function GetFaceBookStream(name,... | TITLE:
How to return an array from a Javascript Facebook API request?
QUESTION:
Hopefully there is an easy way to do this and my Javascript skills are just lacking. I am wanting to call a function that will get some Facebook posts, add them to an array and return to use elsewhere. Current code is below. function GetFa... | [
"javascript",
"facebook"
] | 0 | 0 | 346 | 1 | 0 | 2011-05-31T01:12:32.410000 | 2011-05-31T01:14:51.740000 |
6,182,031 | 6,182,060 | IIS 7.0 doesn't allow download of MP4 videos | I hosted some mp4 videos on IIS. Although IIS 7.0 lists the video files, it doesn't allow download of them and a 404 Not Found is returned. | Check the MIME Types, you will probably have to add it (MP4) to "allow download". | IIS 7.0 doesn't allow download of MP4 videos I hosted some mp4 videos on IIS. Although IIS 7.0 lists the video files, it doesn't allow download of them and a 404 Not Found is returned. | TITLE:
IIS 7.0 doesn't allow download of MP4 videos
QUESTION:
I hosted some mp4 videos on IIS. Although IIS 7.0 lists the video files, it doesn't allow download of them and a 404 Not Found is returned.
ANSWER:
Check the MIME Types, you will probably have to add it (MP4) to "allow download". | [
"asp.net",
"iis-7",
"download",
"mp4"
] | 16 | 31 | 18,214 | 1 | 0 | 2011-05-31T01:12:54.817000 | 2011-05-31T01:17:25.810000 |
6,182,034 | 6,182,699 | All my android projects have r.java related errors | For some reason my eclipse/android development environment has stopped creating the r.java files and wont read them in any of my projects. Should I just uninstall eclipse and all traces of it and the android sdk Ive been using and start fresh? Ive been looking for the past couple hours for a fix but I cant find one at ... | Every time I update my source I always do this: Refresh project Clean project Refresh project Works every time (unless I have a build path issue, then Right Clicking and Doing Android Tools->Fix project properties usually works) Having build errors can keep the R file from being generated, make sure you don't have any ... | All my android projects have r.java related errors For some reason my eclipse/android development environment has stopped creating the r.java files and wont read them in any of my projects. Should I just uninstall eclipse and all traces of it and the android sdk Ive been using and start fresh? Ive been looking for the ... | TITLE:
All my android projects have r.java related errors
QUESTION:
For some reason my eclipse/android development environment has stopped creating the r.java files and wont read them in any of my projects. Should I just uninstall eclipse and all traces of it and the android sdk Ive been using and start fresh? Ive bee... | [
"android",
"sdk"
] | 1 | 1 | 499 | 5 | 0 | 2011-05-31T01:13:12.283000 | 2011-05-31T03:21:00.733000 |
6,182,038 | 6,182,059 | CSS that firefox and not webkit can read | Is there a way to specify some CSS that firefox can read but webkit browsers cannot, or visa versa? | Seems you are not alone who wants this: Targeting only Firefox with CSS And you can view more tricks here: http://stephenkui.com/code-css-only-to-firefox-ie-or-safari/ | CSS that firefox and not webkit can read Is there a way to specify some CSS that firefox can read but webkit browsers cannot, or visa versa? | TITLE:
CSS that firefox and not webkit can read
QUESTION:
Is there a way to specify some CSS that firefox can read but webkit browsers cannot, or visa versa?
ANSWER:
Seems you are not alone who wants this: Targeting only Firefox with CSS And you can view more tricks here: http://stephenkui.com/code-css-only-to-firefo... | [
"css",
"browser",
"cross-browser"
] | 0 | 2 | 336 | 2 | 0 | 2011-05-31T01:13:54.887000 | 2011-05-31T01:17:02.813000 |
6,182,039 | 6,184,016 | How do i handle touch events properly in android? | Scope of the project When a user touches the Android screen with two fingers, draw a "Frame" at each touch location with a "cursor" for each frame. Each frame is a custom slider that the cursor will move up and down. All the way up will be 100%, middle will be 0% and all the way down will be -100%. This will be used to... | You're going to need to save the pointerId's of each point and compare them to the new Id's given with each MotionEvent. It's slightly tricky to explain, so I'll point you to this ADB Post that explains it much better than I could. Long story short? Multitouch can be tricksy, but it's not as bad as it looks at first gl... | How do i handle touch events properly in android? Scope of the project When a user touches the Android screen with two fingers, draw a "Frame" at each touch location with a "cursor" for each frame. Each frame is a custom slider that the cursor will move up and down. All the way up will be 100%, middle will be 0% and al... | TITLE:
How do i handle touch events properly in android?
QUESTION:
Scope of the project When a user touches the Android screen with two fingers, draw a "Frame" at each touch location with a "cursor" for each frame. Each frame is a custom slider that the cursor will move up and down. All the way up will be 100%, middle... | [
"java",
"android",
"user-interface",
"multi-touch"
] | 4 | 3 | 12,479 | 1 | 0 | 2011-05-31T01:14:08.320000 | 2011-05-31T06:59:31.613000 |
6,182,041 | 6,182,073 | Search in Django and GET with multiple words | Could you tell me what should I use or where to look if I want to make something like this: When someone types "aaa bbb" (?t=aaa+bbb) in search field, it would only find those models, in which Title field is "aaa bbb", but not "aaa ccc bbb". How to change for example this code to make it find all titles, in which Title... | Like this, but split on whitespace (.split() ) and use the appropriate field in the Q objects. | Search in Django and GET with multiple words Could you tell me what should I use or where to look if I want to make something like this: When someone types "aaa bbb" (?t=aaa+bbb) in search field, it would only find those models, in which Title field is "aaa bbb", but not "aaa ccc bbb". How to change for example this co... | TITLE:
Search in Django and GET with multiple words
QUESTION:
Could you tell me what should I use or where to look if I want to make something like this: When someone types "aaa bbb" (?t=aaa+bbb) in search field, it would only find those models, in which Title field is "aaa bbb", but not "aaa ccc bbb". How to change f... | [
"django",
"search",
"view",
"words"
] | 0 | 3 | 4,715 | 1 | 0 | 2011-05-31T01:14:32.780000 | 2011-05-31T01:20:02.693000 |
6,182,044 | 6,183,892 | 3D models: vertex with different UV | I am writing a python script that parses a 3D model file from one format to another and noticed a problem when storing vertices. It seems like the same vertex could have different UV's in different faces. While writing the script I assumed all vertices would have unique UV's, but now it seems like a false assumption. I... | If the vertex belongs to a shared edge between two faces, you need to store texture coordinates of both faces. I usually store these info at triangle level not at vertex level. | 3D models: vertex with different UV I am writing a python script that parses a 3D model file from one format to another and noticed a problem when storing vertices. It seems like the same vertex could have different UV's in different faces. While writing the script I assumed all vertices would have unique UV's, but now... | TITLE:
3D models: vertex with different UV
QUESTION:
I am writing a python script that parses a 3D model file from one format to another and noticed a problem when storing vertices. It seems like the same vertex could have different UV's in different faces. While writing the script I assumed all vertices would have un... | [
"3d",
"3d-modelling"
] | 0 | 1 | 372 | 1 | 0 | 2011-05-31T01:14:44.427000 | 2011-05-31T06:42:54.357000 |
6,182,046 | 6,182,162 | How can one detect an Android application launching? | Is it possible to detect when an app is executed (i.e., when the user clicks on the app's icon)? I attempted to register an intent of type Intent.ACTION_MAIN using a category of of type Intent.CATEGORY_LAUNCHER hoping this would let me know whenever an app is launched. The problem is, my broadcast receiver is never get... | The application start Intent is not a broadcast, so there is no way to register a broadcast receiver and receive it. As previously answered here, there really is no way to detect the launch of the app. You could possibly write a service that polled the running tasks looking for the application's task (using the Activit... | How can one detect an Android application launching? Is it possible to detect when an app is executed (i.e., when the user clicks on the app's icon)? I attempted to register an intent of type Intent.ACTION_MAIN using a category of of type Intent.CATEGORY_LAUNCHER hoping this would let me know whenever an app is launche... | TITLE:
How can one detect an Android application launching?
QUESTION:
Is it possible to detect when an app is executed (i.e., when the user clicks on the app's icon)? I attempted to register an intent of type Intent.ACTION_MAIN using a category of of type Intent.CATEGORY_LAUNCHER hoping this would let me know whenever... | [
"android",
"broadcastreceiver"
] | 13 | 16 | 13,783 | 2 | 0 | 2011-05-31T01:14:56.883000 | 2011-05-31T01:38:45.223000 |
6,182,049 | 6,182,092 | WEIRD PROBLEM WITH query_posts | I've been trying to put H5 and H6 tags to the recent posts using query post, but Wordpress doesn't want to apply them correctly. It seems to apply them only to the first result, but on the rest, it just discards the second item of the list. I'm going to paste the sidebar.php and some lines of the style.css. I will grea... | All three of your latest posts are from today, May 30. From the WordPress docs: SPECIAL NOTE: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day,... | WEIRD PROBLEM WITH query_posts I've been trying to put H5 and H6 tags to the recent posts using query post, but Wordpress doesn't want to apply them correctly. It seems to apply them only to the first result, but on the rest, it just discards the second item of the list. I'm going to paste the sidebar.php and some line... | TITLE:
WEIRD PROBLEM WITH query_posts
QUESTION:
I've been trying to put H5 and H6 tags to the recent posts using query post, but Wordpress doesn't want to apply them correctly. It seems to apply them only to the first result, but on the rest, it just discards the second item of the list. I'm going to paste the sidebar... | [
"php",
"wordpress"
] | 0 | 2 | 133 | 1 | 0 | 2011-05-31T01:15:03.783000 | 2011-05-31T01:24:21.080000 |
6,182,055 | 6,183,478 | Is this a correct desugaring of the computation workflow? | This is from Expert F# 2.0 page 231. Apparently the following block of code attempt { let! n1 = failIfBig inp1 let! n2 = failIfBig inp2 let sum = n1 + n2 return sum };; de-sugars to this: attempt.Bind( failIfBig inp1,(fun n1 -> attempt.Bind(failIfBig inp2,(fun n2 -> attempt.Return sum))))) but where is sum computed in ... | Yes it's an error in the book and it should be de-sugared as below: attempt.Bind( failIfBig inp1,(fun n1 -> attempt.Bind(failIfBig inp2,(fun n2 -> let sum = n1 + n2 in attempt.Return sum))))) | Is this a correct desugaring of the computation workflow? This is from Expert F# 2.0 page 231. Apparently the following block of code attempt { let! n1 = failIfBig inp1 let! n2 = failIfBig inp2 let sum = n1 + n2 return sum };; de-sugars to this: attempt.Bind( failIfBig inp1,(fun n1 -> attempt.Bind(failIfBig inp2,(fun n... | TITLE:
Is this a correct desugaring of the computation workflow?
QUESTION:
This is from Expert F# 2.0 page 231. Apparently the following block of code attempt { let! n1 = failIfBig inp1 let! n2 = failIfBig inp2 let sum = n1 + n2 return sum };; de-sugars to this: attempt.Bind( failIfBig inp1,(fun n1 -> attempt.Bind(fai... | [
"f#",
"workflow",
"bind"
] | 3 | 2 | 241 | 1 | 0 | 2011-05-31T01:16:38.417000 | 2011-05-31T05:45:55.923000 |
6,182,061 | 6,182,100 | How to jump from one activity to another particular activity in Android? | I have 3 activities in Android like activity_A,activity_B and activity_C. Calling sequences like this activity_A >>>>>>> activity_B >>>>>> activity_C. Currently I am in activity_C and now I want to jump directly to activity_A without entering into activity_B and I also have to pass some data. HOW???? Please give some p... | If you want to add a new copy of Activity_A on top of the stack, just call it the same way as you did before. Otherwise, choose a launch mode depending on what you want the first copy of Activity_A to do. See this question (method #2) for an explanation of passing data between activities. | How to jump from one activity to another particular activity in Android? I have 3 activities in Android like activity_A,activity_B and activity_C. Calling sequences like this activity_A >>>>>>> activity_B >>>>>> activity_C. Currently I am in activity_C and now I want to jump directly to activity_A without entering into... | TITLE:
How to jump from one activity to another particular activity in Android?
QUESTION:
I have 3 activities in Android like activity_A,activity_B and activity_C. Calling sequences like this activity_A >>>>>>> activity_B >>>>>> activity_C. Currently I am in activity_C and now I want to jump directly to activity_A wit... | [
"android"
] | 0 | 1 | 4,171 | 4 | 0 | 2011-05-31T01:17:32.783000 | 2011-05-31T01:26:36.030000 |
6,182,070 | 6,182,082 | Regex to replace asterisk characters with html bold tag | Does anyone have a good regex to do this? For example: This is *an* example should become This is an example I need to run this in Objective C, but I can probably work that bit out on my own. It's the regex that's giving me trouble (so rusty...). Here's what I have so far: s/\*([0-9a-zA-Z ])\*/ $1<\/b>/g But it doesn't... | You're only matching one character between the * s. Try this: s/\*([0-9a-zA-Z ]*?)\*/ $1<\/b>/g or to ensure there's at least one character between the * s: s/\*([0-9a-zA-Z ]+?)\*/ $1<\/b>/g | Regex to replace asterisk characters with html bold tag Does anyone have a good regex to do this? For example: This is *an* example should become This is an example I need to run this in Objective C, but I can probably work that bit out on my own. It's the regex that's giving me trouble (so rusty...). Here's what I hav... | TITLE:
Regex to replace asterisk characters with html bold tag
QUESTION:
Does anyone have a good regex to do this? For example: This is *an* example should become This is an example I need to run this in Objective C, but I can probably work that bit out on my own. It's the regex that's giving me trouble (so rusty...).... | [
"objective-c",
"regex"
] | 5 | 5 | 3,525 | 4 | 0 | 2011-05-31T01:19:04.497000 | 2011-05-31T01:21:54.230000 |
6,182,071 | 6,184,515 | Can I reliably unimport a Python module if I import it in a namespace? | Basically, I have a long running process where I would like to be able to unimport modules and recover memory via the gc. I've read about deleting modules How do I unload (reload) a Python module? and it seems like there are still dangling references that block gc. However, what if I import and use the module only insi... | To un-import a module you will need to ensure that you've removed all references to the module. That means you have to delete the references from all modules that imported it, delete the reference from sys.modules, delete any references to any functions or classes defined in that module and delete all references to obj... | Can I reliably unimport a Python module if I import it in a namespace? Basically, I have a long running process where I would like to be able to unimport modules and recover memory via the gc. I've read about deleting modules How do I unload (reload) a Python module? and it seems like there are still dangling reference... | TITLE:
Can I reliably unimport a Python module if I import it in a namespace?
QUESTION:
Basically, I have a long running process where I would like to be able to unimport modules and recover memory via the gc. I've read about deleting modules How do I unload (reload) a Python module? and it seems like there are still ... | [
"python"
] | 4 | 3 | 3,558 | 2 | 0 | 2011-05-31T01:19:33.050000 | 2011-05-31T07:52:37.223000 |
6,182,086 | 6,182,268 | Mathematica: Unable to zoom in/out using the mouse on a 3D graphics after Rotate[] | I made 3D graphics, and using the known method of zooming, which is to hold the Ctrl and now slide the mouse up and down to zoom in and out as described here http://reference.wolfram.com/mathematica/howto/RotateZoomAndPanGraphics.html This works ok. But now I issue the command Rotate[g,90 Degree], and try to zoom on th... | You are right, there is a bug in the interface. After a few tries, pressing Ctrl and the mouse buttons, I was able to get a weird display: And the zooming works (although inconsistently), but... moving the mouse left to right! | Mathematica: Unable to zoom in/out using the mouse on a 3D graphics after Rotate[] I made 3D graphics, and using the known method of zooming, which is to hold the Ctrl and now slide the mouse up and down to zoom in and out as described here http://reference.wolfram.com/mathematica/howto/RotateZoomAndPanGraphics.html Th... | TITLE:
Mathematica: Unable to zoom in/out using the mouse on a 3D graphics after Rotate[]
QUESTION:
I made 3D graphics, and using the known method of zooming, which is to hold the Ctrl and now slide the mouse up and down to zoom in and out as described here http://reference.wolfram.com/mathematica/howto/RotateZoomAndP... | [
"wolfram-mathematica"
] | 5 | 1 | 1,323 | 2 | 0 | 2011-05-31T01:22:43.220000 | 2011-05-31T02:00:57.740000 |
6,182,094 | 6,182,114 | executing a subprocess from python | I think something is getting subtly mangeled when I attempt to execute a subprocess from a python script I attempt to execute vlc with some (a lot) of arguments. the instance of vlc that arises complains: Your input can't be opened: VLC is unable to open the MRL ' -vvv rtsp://192.168.1.201:554/ch0_multicast_one --sout=... | You should use this... pid = subprocess.Popen(["vlc", "-vvv", "rtsp://%s" % target_nvc.ip_address + ":554/ch0_multicast_one", "--sout=#transcode{acodec=none}:duplicate{dst=rtp{sdp=rtsp://:5544/user_hash.sdp},dst=display}", ":no-sout-rtp-sap", ":no-sout-standard-sap", ":ttl=1", ":sout-keep" ], stdout=subprocess.PIPE, st... | executing a subprocess from python I think something is getting subtly mangeled when I attempt to execute a subprocess from a python script I attempt to execute vlc with some (a lot) of arguments. the instance of vlc that arises complains: Your input can't be opened: VLC is unable to open the MRL ' -vvv rtsp://192.168.... | TITLE:
executing a subprocess from python
QUESTION:
I think something is getting subtly mangeled when I attempt to execute a subprocess from a python script I attempt to execute vlc with some (a lot) of arguments. the instance of vlc that arises complains: Your input can't be opened: VLC is unable to open the MRL ' -v... | [
"python",
"subprocess",
"vlc"
] | 2 | 0 | 3,050 | 3 | 0 | 2011-05-31T01:24:59.550000 | 2011-05-31T01:28:43.233000 |
6,182,097 | 6,182,293 | Ruby cron job in Ubuntu fails silently when trying to back up MySQL to S3 | I have two ruby script cron jobs that I'm trying to run under Ubuntu 10.04.2 LTS on an AWS EC2 instance. They are both failing silently - I see them being run in /var/log/syslog, but there's no resulting files, and piping the output into a file creates no result. The scripts are based on the ruby sql backups here: http... | The full_backup.rb script you link to contains this: cmd = "mysqldump --quick --single-transaction... #... run(cmd) Notice that there is no full path on mysqldump. Cron jobs generally run with a very limited PATH in their environment and I'd guess that mysqldump isn't in that limited PATH. You can try setting your own ... | Ruby cron job in Ubuntu fails silently when trying to back up MySQL to S3 I have two ruby script cron jobs that I'm trying to run under Ubuntu 10.04.2 LTS on an AWS EC2 instance. They are both failing silently - I see them being run in /var/log/syslog, but there's no resulting files, and piping the output into a file c... | TITLE:
Ruby cron job in Ubuntu fails silently when trying to back up MySQL to S3
QUESTION:
I have two ruby script cron jobs that I'm trying to run under Ubuntu 10.04.2 LTS on an AWS EC2 instance. They are both failing silently - I see them being run in /var/log/syslog, but there's no resulting files, and piping the ou... | [
"ruby",
"linux",
"ubuntu",
"cron"
] | 1 | 1 | 862 | 1 | 0 | 2011-05-31T01:25:08.903000 | 2011-05-31T02:04:50.437000 |
6,182,111 | 6,182,256 | Best approach to implement asynchronous loading of photos in UITableView | I am implementing a UITableView with two images in a cell. Both images will be obtained via URL. I was wondering what is the best approach to load both these images asynchronously. There were a couple of recommendations: http://www.hollance.com/2011/03/mhlazytableimages-efficiently-load-images-for-large-tables/ and htt... | Those links should be useful. One good thing about UITableViews is that they do not create all of the cells at once. This means that if the images start loading only when applicable cells are created, it'll roughly load the ones on the screen first, which is a desirable behavior. If you make sure that the images are on... | Best approach to implement asynchronous loading of photos in UITableView I am implementing a UITableView with two images in a cell. Both images will be obtained via URL. I was wondering what is the best approach to load both these images asynchronously. There were a couple of recommendations: http://www.hollance.com/20... | TITLE:
Best approach to implement asynchronous loading of photos in UITableView
QUESTION:
I am implementing a UITableView with two images in a cell. Both images will be obtained via URL. I was wondering what is the best approach to load both these images asynchronously. There were a couple of recommendations: http://w... | [
"objective-c",
"cocoa-touch",
"ios",
"uitableview",
"uiimage"
] | 4 | 1 | 2,633 | 1 | 0 | 2011-05-31T01:28:11.923000 | 2011-05-31T01:59:08.663000 |
6,182,113 | 6,182,194 | Convert all characters to dec or hex HTML code equivalent | Is there a way I can convert ALL characters, including regular ones, using PHP to something like this: &\#38; &\#233; &\#224; &\#231; &\#60; When I say regular characters I mean to say chars like "ABCD123!@#$", etc. Is this possible? | You can do it with this one liner. Split string into a proper array. Iterate over characters getting their ordinal value. Join with the entity pattern. echo '&#'. join(';&#', array_map('ord', str_split($str))). ';'; </code></pre>
<p><a href="http://codepad.viper-7.com/WfUrV9" rel="nofollow">CodePad</a>.</p>
<p>Also, ... | Convert all characters to dec or hex HTML code equivalent Is there a way I can convert ALL characters, including regular ones, using PHP to something like this: &\#38; &\#233; &\#224; &\#231; &\#60; When I say regular characters I mean to say chars like "ABCD123!@#$", etc. Is this possible? | TITLE:
Convert all characters to dec or hex HTML code equivalent
QUESTION:
Is there a way I can convert ALL characters, including regular ones, using PHP to something like this: &\#38; &\#233; &\#224; &\#231; &\#60; When I say regular characters I mean to say chars like "ABCD123!@#$", etc. Is this possible?
ANSWER:
Y... | [
"php",
"html",
"encoding"
] | 1 | 2 | 1,181 | 3 | 0 | 2011-05-31T01:28:31.237000 | 2011-05-31T01:45:57.687000 |
6,182,120 | 6,182,178 | Django: Multiple menus | My django based website will have 3 seperate menus. The items of first one are: contact, about, disclosures. The second one will have: terms and condtions, privacy policy, copyright. And items of main menu are: Home, link1, link2, link2.... The first two menus will have fixed items, and the items of last one may change... | I like to use inclusion template tags for dynamic menus. In my-app/templatetags/myappmenu.py, I have something like: from django import template register = template.Library() @register.inclusion_tag('my-app/menu.html') def myappmenu(): return [("label1", "link1"), ("label2", "link2")] Then, in your template you can loo... | Django: Multiple menus My django based website will have 3 seperate menus. The items of first one are: contact, about, disclosures. The second one will have: terms and condtions, privacy policy, copyright. And items of main menu are: Home, link1, link2, link2.... The first two menus will have fixed items, and the items... | TITLE:
Django: Multiple menus
QUESTION:
My django based website will have 3 seperate menus. The items of first one are: contact, about, disclosures. The second one will have: terms and condtions, privacy policy, copyright. And items of main menu are: Home, link1, link2, link2.... The first two menus will have fixed it... | [
"django",
"menu"
] | 0 | 1 | 1,237 | 2 | 0 | 2011-05-31T01:29:44.527000 | 2011-05-31T01:43:10.983000 |
6,182,128 | 6,182,378 | Timezone problem with jQuery.timeago plugin | I am using timeago jQuery plugin for my blog, but there seems to be a problem with the timing itself, and I cant put my finger and what the cause of the problem is. Its currently May 31st, 2011 02:30 local time here (GMT+DST). Now the example date I have used is... May 31st, 2011 02:01. The following tag for this would... | Hazarding a guess here so I might be quite wrong. The problem is that the test timesatmp you've specified has an offset of 0 so it's the same as UTC - but that's not the same as your time when following DST in the GMT timezone. GMT is the same as UTC i.e. the offset is 0. However, you mention DST and when following Day... | Timezone problem with jQuery.timeago plugin I am using timeago jQuery plugin for my blog, but there seems to be a problem with the timing itself, and I cant put my finger and what the cause of the problem is. Its currently May 31st, 2011 02:30 local time here (GMT+DST). Now the example date I have used is... May 31st, ... | TITLE:
Timezone problem with jQuery.timeago plugin
QUESTION:
I am using timeago jQuery plugin for my blog, but there seems to be a problem with the timing itself, and I cant put my finger and what the cause of the problem is. Its currently May 31st, 2011 02:30 local time here (GMT+DST). Now the example date I have use... | [
"jquery",
"timestamp",
"timeago"
] | 4 | 10 | 5,335 | 2 | 0 | 2011-05-31T01:31:37.817000 | 2011-05-31T02:18:55.240000 |
6,182,129 | 6,182,166 | How to append xml data to xml file without overwriting existing data using php? | HI Guys, Im kinda new to php and xml so pls bear with me. I wanna how am I gonna append an xml data to an xml file without overwriting the existing data uisng PHP. I have here the codes: writexml.php 'Tom', 'age' => '34', 'salary' => "$10000" ); $employees [] = array( 'name' => 'Ryan', 'age' => '20', 'salary' => "$2000... | You will need to open the existing document to append information to it, your last save will simply overwrite the existing file. $doc = new DomDocument(); $doc->loadXML(file_get_contents('employees.xml')); foreach($doc->getElementsByTagName('employees') as $node) { // your current xml logic here } Update for hafedh $do... | How to append xml data to xml file without overwriting existing data using php? HI Guys, Im kinda new to php and xml so pls bear with me. I wanna how am I gonna append an xml data to an xml file without overwriting the existing data uisng PHP. I have here the codes: writexml.php 'Tom', 'age' => '34', 'salary' => "$1000... | TITLE:
How to append xml data to xml file without overwriting existing data using php?
QUESTION:
HI Guys, Im kinda new to php and xml so pls bear with me. I wanna how am I gonna append an xml data to an xml file without overwriting the existing data uisng PHP. I have here the codes: writexml.php 'Tom', 'age' => '34', ... | [
"php",
"xml"
] | 0 | 4 | 4,341 | 1 | 0 | 2011-05-31T01:31:38.910000 | 2011-05-31T01:40:00.240000 |
6,182,132 | 6,182,159 | StringToByteArray() throw exception in C# 2.0 | I am practicing StringToByteArray() on VS2005. But throw exception. Could you please tell me more information about it? Exception alert **An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Could not find any recognizable digits.** public static byte[] StringToByteAr... | You either need to drop the "0x" from the start of the string you pass in, or start your for loop with int i = 2;. Also you're allocating the array in your method. You don't need to do it Main as well. | StringToByteArray() throw exception in C# 2.0 I am practicing StringToByteArray() on VS2005. But throw exception. Could you please tell me more information about it? Exception alert **An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Could not find any recognizable... | TITLE:
StringToByteArray() throw exception in C# 2.0
QUESTION:
I am practicing StringToByteArray() on VS2005. But throw exception. Could you please tell me more information about it? Exception alert **An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Could not fin... | [
"c#",
"c#-2.0",
"arrays"
] | 3 | 4 | 5,260 | 2 | 0 | 2011-05-31T01:32:12.483000 | 2011-05-31T01:38:00.127000 |
6,182,141 | 6,182,200 | Java Inheritance Example | Below is the example for Inheritance class Parent { Parent(int a, int b) { int c = a + b; System.out.println("Sum=" + c); } void display() { System.out.println("Return Statement"); } } class Child extends Parent { Child(int a, int b) { int c = a - b; System.out.println("Difference=" + c); } } public class InheritanceEx... | class child extends parent { child(int a,int b) { int c=a-b; System.out.println("Difference="+c); } } The first thing the child class constructor must do is call the parent class constructor. If you do not do this explicitly (e.g. super(a,b) ), a call to the default constructor is implied ( super() ). For this to work,... | Java Inheritance Example Below is the example for Inheritance class Parent { Parent(int a, int b) { int c = a + b; System.out.println("Sum=" + c); } void display() { System.out.println("Return Statement"); } } class Child extends Parent { Child(int a, int b) { int c = a - b; System.out.println("Difference=" + c); } } p... | TITLE:
Java Inheritance Example
QUESTION:
Below is the example for Inheritance class Parent { Parent(int a, int b) { int c = a + b; System.out.println("Sum=" + c); } void display() { System.out.println("Return Statement"); } } class Child extends Parent { Child(int a, int b) { int c = a - b; System.out.println("Differ... | [
"java"
] | 3 | 8 | 29,437 | 6 | 0 | 2011-05-31T01:33:08.397000 | 2011-05-31T01:47:21.140000 |
6,182,142 | 6,182,177 | How to use getElementId for tag in an asp:Repeater | I have a div inside an asp:Repeater: This works great except my div elements occur within a repeater which means only the first div is found. Could some please explain to me how to get all the divs in the ItemTemplate? | It is invalid to use the same id more than once on a page. Instead you'll have to use some other means of finding your elements, such as css class. jQuery makes this task easy. $(".someClass").show(); However, you may not even need to do that. If all you are trying to do is change some styles on a set of elements under... | How to use getElementId for tag in an asp:Repeater I have a div inside an asp:Repeater: This works great except my div elements occur within a repeater which means only the first div is found. Could some please explain to me how to get all the divs in the ItemTemplate? | TITLE:
How to use getElementId for tag in an asp:Repeater
QUESTION:
I have a div inside an asp:Repeater: This works great except my div elements occur within a repeater which means only the first div is found. Could some please explain to me how to get all the divs in the ItemTemplate?
ANSWER:
It is invalid to use th... | [
"c#",
"javascript",
"asp.net",
"html",
"css"
] | 0 | 1 | 4,054 | 3 | 0 | 2011-05-31T01:33:19.930000 | 2011-05-31T01:42:56.487000 |
6,182,146 | 6,182,170 | Creating an edge from a node in Java | I get an error whenever I try to create a simple edge from a node. Basically, I've created two of my own classes called Node and Edge. The Node class is as follows: public class Node {
public String ident; public int numLinks;
public Edge[] neighbours;
public Node (String ident) { this.ident = ident;
}
public void... | Have you initialzed neighbours in your Node class? It looks like the exception is from accessing a null array ( neighbours[i] ). Also It looks like the neighbours array will grow/shrink dynamically? In this case, instead of using array, consider using ArrayList so you don't have to grow neighbours yourself. | Creating an edge from a node in Java I get an error whenever I try to create a simple edge from a node. Basically, I've created two of my own classes called Node and Edge. The Node class is as follows: public class Node {
public String ident; public int numLinks;
public Edge[] neighbours;
public Node (String ident) ... | TITLE:
Creating an edge from a node in Java
QUESTION:
I get an error whenever I try to create a simple edge from a node. Basically, I've created two of my own classes called Node and Edge. The Node class is as follows: public class Node {
public String ident; public int numLinks;
public Edge[] neighbours;
public No... | [
"java",
"graph",
"edges"
] | 2 | 3 | 7,743 | 2 | 0 | 2011-05-31T01:33:53.090000 | 2011-05-31T01:40:44.930000 |
6,182,147 | 6,182,432 | How to getline() from specific line in a file? C++ | I've looked around a bit and have found no definitive answer on how to read a specific line of text from a file in C++. I have a text file with over 100,000 English words, each on its own line. I can't use arrays because they obviously won't hold that much data, and vectors take too long to store every word. How can I ... | If your words have no white-space (I assume they don't), you can use a more tricky non-getline solution using a deque! using namespace std;
int main() { deque dictionary;
cout << "Loading file..." << endl; ifstream myfile ("dict.txt"); if ( myfile.is_open() ) { copy(istream_iterator (myFile), istream_iterator (), bac... | How to getline() from specific line in a file? C++ I've looked around a bit and have found no definitive answer on how to read a specific line of text from a file in C++. I have a text file with over 100,000 English words, each on its own line. I can't use arrays because they obviously won't hold that much data, and ve... | TITLE:
How to getline() from specific line in a file? C++
QUESTION:
I've looked around a bit and have found no definitive answer on how to read a specific line of text from a file in C++. I have a text file with over 100,000 English words, each on its own line. I can't use arrays because they obviously won't hold that... | [
"c++"
] | 3 | 4 | 10,275 | 7 | 0 | 2011-05-31T01:34:10.363000 | 2011-05-31T02:29:12.253000 |
6,182,150 | 6,190,275 | How can I stop cells from being entered when a datagridview row is selected by a row header click? | Whenever a user clicks the row header, which selects the whole row (and highlights it blue), the cell in the first column is actually entered. That is, if you start typing stuff, the text goes in that cell. I want to prevent this. Would it be possible to have no datagridview cells being entered when one or many rows ar... | Set your DataGridView's ReadOnly property to true or false, depending on whether one or more rows have been selected or if the DGV's 'CellState' has changed. Add the following two events for your DataGridView: private void dataGridView1_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e) { if (e.Stat... | How can I stop cells from being entered when a datagridview row is selected by a row header click? Whenever a user clicks the row header, which selects the whole row (and highlights it blue), the cell in the first column is actually entered. That is, if you start typing stuff, the text goes in that cell. I want to prev... | TITLE:
How can I stop cells from being entered when a datagridview row is selected by a row header click?
QUESTION:
Whenever a user clicks the row header, which selects the whole row (and highlights it blue), the cell in the first column is actually entered. That is, if you start typing stuff, the text goes in that ce... | [
"c#",
"datagridview"
] | 0 | 2 | 1,494 | 3 | 0 | 2011-05-31T01:35:10.573000 | 2011-05-31T15:57:35.480000 |
6,182,151 | 6,182,316 | CUDA program causes nvidia driver to crash | My monte carlo pi calculation CUDA program is causing my nvidia driver to crash when I exceed around 500 trials and 256 full blocks. It seems to be happening in the monteCarlo kernel function.Any help is appreciated. #include #include #include #include #include #define NUM_THREAD 256 #define NUM_BLOCK 256
////////////... | If smaller numbers of trials work correctly, and if you are running on MS Windows without the NVIDIA Tesla Compute Cluster (TCC) driver and/or the GPU you are using is attached to a display, then you are probably exceeding the operating system's "watchdog" timeout. If the kernel occupies the display device (or any GPU ... | CUDA program causes nvidia driver to crash My monte carlo pi calculation CUDA program is causing my nvidia driver to crash when I exceed around 500 trials and 256 full blocks. It seems to be happening in the monteCarlo kernel function.Any help is appreciated. #include #include #include #include #include #define NUM_THR... | TITLE:
CUDA program causes nvidia driver to crash
QUESTION:
My monte carlo pi calculation CUDA program is causing my nvidia driver to crash when I exceed around 500 trials and 256 full blocks. It seems to be happening in the monteCarlo kernel function.Any help is appreciated. #include #include #include #include #inclu... | [
"crash",
"cuda",
"driver",
"nvidia"
] | 4 | 8 | 8,927 | 2 | 0 | 2011-05-31T01:35:29.927000 | 2011-05-31T02:10:05.810000 |
6,182,155 | 6,182,191 | What is the relationship between C and C++ (more technical approach) | I was reading through Relationship between C and C++ and was interested in a more technical look at the question. For example, if you want to use threads in C++, would you (assuming a Linux platform) just use pthreads? I know C++ has the STL and the Boost libraries fill in a lot of gaps... but do C++ programmers genera... | Up through C++03, yes, you'd probably use pthreads. The current draft of C++11 has threading built into the standard library, so you'd probably use that instead (though it's based closely on pthreads, so there's little practical difference between them). In general, however, yes, it's easy to use C libraries directly f... | What is the relationship between C and C++ (more technical approach) I was reading through Relationship between C and C++ and was interested in a more technical look at the question. For example, if you want to use threads in C++, would you (assuming a Linux platform) just use pthreads? I know C++ has the STL and the B... | TITLE:
What is the relationship between C and C++ (more technical approach)
QUESTION:
I was reading through Relationship between C and C++ and was interested in a more technical look at the question. For example, if you want to use threads in C++, would you (assuming a Linux platform) just use pthreads? I know C++ has... | [
"c++",
"c",
"relationship",
"libraries"
] | 2 | 5 | 1,212 | 3 | 0 | 2011-05-31T01:36:26.933000 | 2011-05-31T01:45:08.773000 |
6,182,156 | 6,182,465 | Websphere application server VS Jboss | I am looking for a kind of java ee application server. My company is using Websphere application server and I am reviewing jboss. I am not familiar with WAS, would anybody like to tell me which outstanding features provided by IBM WAS? And what the common features between WAS and JBOSS. I write down my understanding fi... | I don' think you should make comparison this way. Get the IBM team to provide you their list and speak to RedHat and get their list and then make the comparison. RAD is not free by any means. WAS is a good stack as it has a good track record in high volume sites and is the foundation of a number of IBM products (e.g Pr... | Websphere application server VS Jboss I am looking for a kind of java ee application server. My company is using Websphere application server and I am reviewing jboss. I am not familiar with WAS, would anybody like to tell me which outstanding features provided by IBM WAS? And what the common features between WAS and J... | TITLE:
Websphere application server VS Jboss
QUESTION:
I am looking for a kind of java ee application server. My company is using Websphere application server and I am reviewing jboss. I am not familiar with WAS, would anybody like to tell me which outstanding features provided by IBM WAS? And what the common features... | [
"jboss",
"websphere"
] | 0 | 1 | 4,034 | 1 | 0 | 2011-05-31T01:36:59.647000 | 2011-05-31T02:36:03.743000 |
6,182,168 | 6,187,422 | Google Analytics and the precision of data/report | I was just curious to know if the data presented in the google analytics report includes bots/spiders/crawlers. One of the websites that we are building is still stealth(zero marketing, though the site went live about 20 odd days ago). My boss was happy and proud that we are having visitors from all over the world alre... | As explained above, Google Analytics uses a Javascript based mechanism, and since most crawlers won't execute JavaScript, you shouldn't see crawlers into your stats, but true visitors. In some situations however you could get some "noise" into your stats: someone has put, by mistake?, your UA number into its website pa... | Google Analytics and the precision of data/report I was just curious to know if the data presented in the google analytics report includes bots/spiders/crawlers. One of the websites that we are building is still stealth(zero marketing, though the site went live about 20 odd days ago). My boss was happy and proud that w... | TITLE:
Google Analytics and the precision of data/report
QUESTION:
I was just curious to know if the data presented in the google analytics report includes bots/spiders/crawlers. One of the websites that we are building is still stealth(zero marketing, though the site went live about 20 odd days ago). My boss was happ... | [
"php",
"google-analytics",
"web-crawler",
"bots"
] | 1 | 2 | 391 | 2 | 0 | 2011-05-31T01:40:39.083000 | 2011-05-31T12:14:41.707000 |
6,182,171 | 6,183,831 | How to make Haskell GLUT using freeglut on Windows? | How to make the Haskell GLUT binding using freeglut instead of the original GLUT on windows? | I find a easy way doing this. Just clean out all the original GLUT lib stuff and download a precompiled freeglut.dll and change it to glut32.dll and save to C:\WINDOWS\system32. Eric Wong | How to make Haskell GLUT using freeglut on Windows? How to make the Haskell GLUT binding using freeglut instead of the original GLUT on windows? | TITLE:
How to make Haskell GLUT using freeglut on Windows?
QUESTION:
How to make the Haskell GLUT binding using freeglut instead of the original GLUT on windows?
ANSWER:
I find a easy way doing this. Just clean out all the original GLUT lib stuff and download a precompiled freeglut.dll and change it to glut32.dll and... | [
"windows",
"opengl",
"haskell",
"glut",
"freeglut"
] | 3 | 3 | 972 | 1 | 0 | 2011-05-31T01:41:01.173000 | 2011-05-31T06:34:57.763000 |
6,182,176 | 6,182,302 | Retain drop down list value after form submission | I have a form where a user rates a poem from 1 to 3. My code is as follows: You scored: #duplicateCheck.score# – Rate This Poem – 1 2 3 If the user has already rated the poem, I am trying to make their previous score be selected. If not, the user can select 1-3. How should I do this? | Depends on how you're storing the fact that the user has already rated the poem. But from a high level: selected="selected" >1 selected="selected" >2 selected="selected" >3 So, do you already have a handle on whether or not the user has rated the poem? Or is that the actual question? | Retain drop down list value after form submission I have a form where a user rates a poem from 1 to 3. My code is as follows: You scored: #duplicateCheck.score# – Rate This Poem – 1 2 3 If the user has already rated the poem, I am trying to make their previous score be selected. If not, the user can select 1-3. How sho... | TITLE:
Retain drop down list value after form submission
QUESTION:
I have a form where a user rates a poem from 1 to 3. My code is as follows: You scored: #duplicateCheck.score# – Rate This Poem – 1 2 3 If the user has already rated the poem, I am trying to make their previous score be selected. If not, the user can s... | [
"coldfusion"
] | 0 | 2 | 2,398 | 2 | 0 | 2011-05-31T01:42:55.130000 | 2011-05-31T02:07:17.893000 |
6,182,183 | 6,217,343 | Solr Custom RequestHandler - injecting query parameters | Short question: I'm looking for a way (java) to intercept a query to Solr and inject a few extra filtering parameters provided by my business logic. What structures should I use? Context: First of all, a little confession: I'm such a rookie regarding Solr. For me, setting up a server, defining a schema, coding a functi... | Oh well. As previously stated, the answer that worked for me. Feel free to comment or bash! private void SearchDocumentsTypeII(SolrDocumentList results, SolrIndexSearcher searcher, String q, UserPermissions up, int ndocs, SolrQueryRequest req, Map fields, Set alreadyFound) throws IOException, ParseException {
BooleanQ... | Solr Custom RequestHandler - injecting query parameters Short question: I'm looking for a way (java) to intercept a query to Solr and inject a few extra filtering parameters provided by my business logic. What structures should I use? Context: First of all, a little confession: I'm such a rookie regarding Solr. For me,... | TITLE:
Solr Custom RequestHandler - injecting query parameters
QUESTION:
Short question: I'm looking for a way (java) to intercept a query to Solr and inject a few extra filtering parameters provided by my business logic. What structures should I use? Context: First of all, a little confession: I'm such a rookie regar... | [
"java",
"solr",
"requesthandler"
] | 5 | 1 | 7,146 | 4 | 0 | 2011-05-31T01:43:42.513000 | 2011-06-02T16:29:06.233000 |
6,182,189 | 6,191,203 | Tab character in itext | I have write the code to create the report using itext.For that,i have to add the header which is like BSJ Economy Report Date:31/12/10 For that i need to put the tab character(\t) between the above strings.But i can't find out the tab character in itext.I have used "\t" and "\t".This was not working.Please help me to ... | There isn't one. Sounds like a job for a 3-column table. Or perhaps a ColumnText drawing into the same rectangle with three different alignments? Lots of options. | Tab character in itext I have write the code to create the report using itext.For that,i have to add the header which is like BSJ Economy Report Date:31/12/10 For that i need to put the tab character(\t) between the above strings.But i can't find out the tab character in itext.I have used "\t" and "\t".This was not wor... | TITLE:
Tab character in itext
QUESTION:
I have write the code to create the report using itext.For that,i have to add the header which is like BSJ Economy Report Date:31/12/10 For that i need to put the tab character(\t) between the above strings.But i can't find out the tab character in itext.I have used "\t" and "\t... | [
"java",
"itext"
] | 5 | 2 | 9,340 | 2 | 0 | 2011-05-31T01:44:45.800000 | 2011-05-31T17:25:50.407000 |
6,182,192 | 6,182,466 | Protect my java application from being copied | How do I stop someone from copying and duplicating the application i am making in java? I am using mysql as back-end for my application and the platform is Linux. Is there a way to provide this security? EDIT: Is there a way like in windows where some applications even if we copy the folder and past it into other syste... | Alright, here is an alternate answer to my comment. Don't sell software, sell support. Implement a simple licensing system tied to an email address. Only provide support for users with registered email addresses. For tips on creating that, see Software Licensing System at the OTN. The solutions shown there are crackabl... | Protect my java application from being copied How do I stop someone from copying and duplicating the application i am making in java? I am using mysql as back-end for my application and the platform is Linux. Is there a way to provide this security? EDIT: Is there a way like in windows where some applications even if w... | TITLE:
Protect my java application from being copied
QUESTION:
How do I stop someone from copying and duplicating the application i am making in java? I am using mysql as back-end for my application and the platform is Linux. Is there a way to provide this security? EDIT: Is there a way like in windows where some appl... | [
"java"
] | 0 | 5 | 4,576 | 6 | 0 | 2011-05-31T01:45:17.680000 | 2011-05-31T02:36:11.737000 |
6,182,198 | 6,183,635 | what's wrong with this approach re referencing another project in Xcode 4? | I'm trying to reference another Xcode4 project within Xcode4 but having troubles - what's I'm currently doing is as follows: In project B in XCode4 I drag in project A (from Finder) into project B In project B's main target, in Build Phases / Target Dependencies I add/select my project A's main target. I put an, #impor... | If I'm reading this correctly I had the same issue the other night. Except that I was dealing with two targets, one that built a static library and the other that ran an app to executes tests on the static lib. Here's what I did Target A builds a static lib. Target B runs a unit testing suite for testing target A's sta... | what's wrong with this approach re referencing another project in Xcode 4? I'm trying to reference another Xcode4 project within Xcode4 but having troubles - what's I'm currently doing is as follows: In project B in XCode4 I drag in project A (from Finder) into project B In project B's main target, in Build Phases / Ta... | TITLE:
what's wrong with this approach re referencing another project in Xcode 4?
QUESTION:
I'm trying to reference another Xcode4 project within Xcode4 but having troubles - what's I'm currently doing is as follows: In project B in XCode4 I drag in project A (from Finder) into project B In project B's main target, in... | [
"iphone",
"xcode",
"ios",
"xcode4"
] | 0 | 2 | 462 | 1 | 0 | 2011-05-31T01:46:53.260000 | 2011-05-31T06:10:03.753000 |
6,182,206 | 6,183,112 | Is there any analogue to NetBeans RCP in .Net/C# world? | In Java world, NetBeans is not only an IDE, but also an RCP (rich client platform) - a versatile extensible foundation for building desktop modular applications. Is there anything alike in.Net/C# world? | The simple answer is, unfortunately, "No". Some things to think about here though: Visual Studio, which is the de-facto standard IDE in the.NET world, is commercial and although it's extensible, it's not intended to be used as a generic RCP platform. Sharp Develop is an open source.NET IDE. I don't know that it's meant... | Is there any analogue to NetBeans RCP in .Net/C# world? In Java world, NetBeans is not only an IDE, but also an RCP (rich client platform) - a versatile extensible foundation for building desktop modular applications. Is there anything alike in.Net/C# world? | TITLE:
Is there any analogue to NetBeans RCP in .Net/C# world?
QUESTION:
In Java world, NetBeans is not only an IDE, but also an RCP (rich client platform) - a versatile extensible foundation for building desktop modular applications. Is there anything alike in.Net/C# world?
ANSWER:
The simple answer is, unfortunatel... | [
"c#",
"java",
".net",
"netbeans",
"rcp"
] | 2 | 4 | 1,199 | 1 | 0 | 2011-05-31T01:49:03.957000 | 2011-05-31T04:49:04.797000 |
6,182,210 | 6,182,491 | How to retrieve mongo db object and return it as json object | Hi I have this as one of my controllers: [HttpPost] public JsonResult GetPinPoints(string Id) { Frames rslt = null;
string connString = ConfigurationManager.ConnectionStrings["MongoConnStringNew"].ToString(); MongoUrl murl = new MongoUrl(connString); MongoServer mgconf = new MongoServer(murl); try { mgconf.Connect(); ... | The return Json(myObject) statement should take an object that'll be serialised to JSON then returned to the browser as a string, but by calling ToJson() the rslt.CoordinatesObj object will be serialised twice. It's also possible CoordinatesObj isn't being deserislised properly, so it's throwing an exception because To... | How to retrieve mongo db object and return it as json object Hi I have this as one of my controllers: [HttpPost] public JsonResult GetPinPoints(string Id) { Frames rslt = null;
string connString = ConfigurationManager.ConnectionStrings["MongoConnStringNew"].ToString(); MongoUrl murl = new MongoUrl(connString); MongoSe... | TITLE:
How to retrieve mongo db object and return it as json object
QUESTION:
Hi I have this as one of my controllers: [HttpPost] public JsonResult GetPinPoints(string Id) { Frames rslt = null;
string connString = ConfigurationManager.ConnectionStrings["MongoConnStringNew"].ToString(); MongoUrl murl = new MongoUrl(co... | [
"c#",
"jquery",
"asp.net",
"asp.net-mvc-3",
"mongodb"
] | 1 | 0 | 3,320 | 2 | 0 | 2011-05-31T01:49:27.293000 | 2011-05-31T02:41:19.720000 |
6,182,219 | 6,182,238 | How to Turn Number into a String with Format? | Say I have a number, double, or NSNumber, 3.333333 I want that to turn that into @"3.3" How would I do so? Can I do NSString stringWithFormat? But what's the format? | 0.0f means the amount of digits before and after the decimal. So @Wevah's answer would be correct, but keeping that in mind will save you time in the future. | How to Turn Number into a String with Format? Say I have a number, double, or NSNumber, 3.333333 I want that to turn that into @"3.3" How would I do so? Can I do NSString stringWithFormat? But what's the format? | TITLE:
How to Turn Number into a String with Format?
QUESTION:
Say I have a number, double, or NSNumber, 3.333333 I want that to turn that into @"3.3" How would I do so? Can I do NSString stringWithFormat? But what's the format?
ANSWER:
0.0f means the amount of digits before and after the decimal. So @Wevah's answer ... | [
"objective-c",
"cocoa"
] | 0 | 1 | 275 | 4 | 0 | 2011-05-31T01:51:35 | 2011-05-31T01:55:03.470000 |
6,182,227 | 6,183,536 | I'm upgraded my project to Razor view engine, but VS2010 still auto-generates WebForms | I have upgraded to MVC3 and Razor, everything works fine. However, in my return View(model); the "View" is red and VS2010 will helpfully suggest I generate a view. When I do, it generates a aspx/WebForms view. There's no other aspx files in the project, and if I run the project, the Razor view engine works fine. There'... | These are not explicit answer but rather a list of actions that you could try.. In the csproj file of your project make sure that the are set to {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Try changing the ProjectGuid to some other Guid ( last pos... | I'm upgraded my project to Razor view engine, but VS2010 still auto-generates WebForms I have upgraded to MVC3 and Razor, everything works fine. However, in my return View(model); the "View" is red and VS2010 will helpfully suggest I generate a view. When I do, it generates a aspx/WebForms view. There's no other aspx f... | TITLE:
I'm upgraded my project to Razor view engine, but VS2010 still auto-generates WebForms
QUESTION:
I have upgraded to MVC3 and Razor, everything works fine. However, in my return View(model); the "View" is red and VS2010 will helpfully suggest I generate a view. When I do, it generates a aspx/WebForms view. There... | [
"visual-studio-2010",
"asp.net-mvc-3",
"razor"
] | 0 | 2 | 989 | 2 | 0 | 2011-05-31T01:53:11.100000 | 2011-05-31T05:55:29.370000 |
6,182,232 | 6,182,279 | How to set view or Activity for dealing with previous listactivity? for example "see full detail page" | This is my ListActivity after clicking on the list it will start a new activity which shows Full detail of each attraction place. I have no idea how to implement Full detail page. Can you guys show me some code of full detail activity which retrieve data from the previous list? public class AttractionsListActivity exte... | Override onListItemClick(...) in your List Activity, using the Cursor get the id of the selected item Start your Detail Activity passing the id through the intent extras In your Detail Activity, recover the id and open a cursor to get your data back from the DB. Fill your view with the data | How to set view or Activity for dealing with previous listactivity? for example "see full detail page" This is my ListActivity after clicking on the list it will start a new activity which shows Full detail of each attraction place. I have no idea how to implement Full detail page. Can you guys show me some code of ful... | TITLE:
How to set view or Activity for dealing with previous listactivity? for example "see full detail page"
QUESTION:
This is my ListActivity after clicking on the list it will start a new activity which shows Full detail of each attraction place. I have no idea how to implement Full detail page. Can you guys show m... | [
"android",
"view",
"simplecursoradapter",
"settext",
"android-cursoradapter"
] | 6 | 4 | 3,519 | 3 | 0 | 2011-05-31T01:54:16.353000 | 2011-05-31T02:03:01.860000 |
6,182,244 | 6,182,454 | using access sql to do INSERT INTO (aggregate function) | here's my code: insert into archive from temp where temp.field6>archive.field6 i would like to insert the entire row into a table archive from table temp where one field is greater than another. what is wrong with my syntax? it is giving me ERROR ON INSERT InTO edit: here is what i have so far: INSERT INTO archive SELE... | INSERT INTO archive SELECT temp.* FROM temp WHERE temp.field6>(SELECT max(archive.field6) FROM archive); | using access sql to do INSERT INTO (aggregate function) here's my code: insert into archive from temp where temp.field6>archive.field6 i would like to insert the entire row into a table archive from table temp where one field is greater than another. what is wrong with my syntax? it is giving me ERROR ON INSERT InTO ed... | TITLE:
using access sql to do INSERT INTO (aggregate function)
QUESTION:
here's my code: insert into archive from temp where temp.field6>archive.field6 i would like to insert the entire row into a table archive from table temp where one field is greater than another. what is wrong with my syntax? it is giving me ERROR... | [
"sql",
"ms-access",
"insert"
] | 0 | 3 | 2,335 | 2 | 0 | 2011-05-31T01:55:53.267000 | 2011-05-31T02:33:19.110000 |
6,182,247 | 6,182,358 | Change Android TabWidget bottom bar color | How do I change the color of the bottom bar for TabWidget? I have successfully changed the tab background color but the bottom bar is still grey/orange and I couldn't find any info in the Android doc and source regarding this. Thanks. | I'm guessing that "bottom bar" refers to the optional horizontal line that separates the tabs and the content. Take a look at the various tabStrip attributes described in the TabWidget API doc. You can set different drawables for the left and right parts of the strip. | Change Android TabWidget bottom bar color How do I change the color of the bottom bar for TabWidget? I have successfully changed the tab background color but the bottom bar is still grey/orange and I couldn't find any info in the Android doc and source regarding this. Thanks. | TITLE:
Change Android TabWidget bottom bar color
QUESTION:
How do I change the color of the bottom bar for TabWidget? I have successfully changed the tab background color but the bottom bar is still grey/orange and I couldn't find any info in the Android doc and source regarding this. Thanks.
ANSWER:
I'm guessing tha... | [
"android",
"tabwidget"
] | 2 | 0 | 11,851 | 3 | 0 | 2011-05-31T01:57:25.823000 | 2011-05-31T02:16:26.017000 |
6,182,248 | 6,182,310 | Fullscreen Flash Slideshow | Previously I'd worked on a flash application that would be embedded into a webpage at 100x20 that loaded a graphic for a button based on XML. When the button was clicked, the application would go full-screen via AS3. stage.displayState = StageDisplayState.FULL_SCREEN; This worked great - the application went full-scree... | This is a flash security restriction. You absolutely cannot launch flash into fullscreen without explicitly doing so from a click event. http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7c5d.html | Fullscreen Flash Slideshow Previously I'd worked on a flash application that would be embedded into a webpage at 100x20 that loaded a graphic for a button based on XML. When the button was clicked, the application would go full-screen via AS3. stage.displayState = StageDisplayState.FULL_SCREEN; This worked great - the ... | TITLE:
Fullscreen Flash Slideshow
QUESTION:
Previously I'd worked on a flash application that would be embedded into a webpage at 100x20 that loaded a graphic for a button based on XML. When the button was clicked, the application would go full-screen via AS3. stage.displayState = StageDisplayState.FULL_SCREEN; This w... | [
"javascript",
"flash",
"actionscript-3",
"fullscreen"
] | 1 | 2 | 691 | 1 | 0 | 2011-05-31T01:57:32.797000 | 2011-05-31T02:08:53.447000 |
6,182,252 | 6,182,349 | Python socket server and client, keeps losing connection | I am expanding on a GUI program for a remotely controlled robot. The idea is to program a simple GUI client in Python that connects to a remote server, also written in Python. The client would send simple messages to the server, the server would receive the message, and then transmit it via serial to an Arduino Mega th... | You are calling accept() inside the loop, which will block for another connection. The original connection will be dereferenced and automatically closed when/if another connection comes in. Normally, you spawn an independent handler (fork, thread, or add to async event handler) to handle new connections that does the w... | Python socket server and client, keeps losing connection I am expanding on a GUI program for a remotely controlled robot. The idea is to program a simple GUI client in Python that connects to a remote server, also written in Python. The client would send simple messages to the server, the server would receive the messa... | TITLE:
Python socket server and client, keeps losing connection
QUESTION:
I am expanding on a GUI program for a remotely controlled robot. The idea is to program a simple GUI client in Python that connects to a remote server, also written in Python. The client would send simple messages to the server, the server would... | [
"python",
"sockets",
"serial-port",
"arduino",
"pyserial"
] | 2 | 3 | 4,141 | 1 | 0 | 2011-05-31T01:57:53.700000 | 2011-05-31T02:15:15.660000 |
6,182,253 | 6,182,326 | table updates empty spaces when user do not enter anything to the textbox | i am doing a project where one may update the name, position, department and tag of the employee. But as i do my project, it wont update, i know there is something wrong with my code. would you guys mind checking it. my php page has an index.php which is the main menu, if you click the employee name in the list, a pop ... | You use $_POST for 'name/pos/dep/tag' and $_GET for 'emp' so you're probably not getting the values. Change the GETs to POST - that should do it. Since you're updating, I'd recommend using POST over GET. GET is more appropriate for searching. Also, you can put all your update queries into one update query. Like so. $na... | table updates empty spaces when user do not enter anything to the textbox i am doing a project where one may update the name, position, department and tag of the employee. But as i do my project, it wont update, i know there is something wrong with my code. would you guys mind checking it. my php page has an index.php ... | TITLE:
table updates empty spaces when user do not enter anything to the textbox
QUESTION:
i am doing a project where one may update the name, position, department and tag of the employee. But as i do my project, it wont update, i know there is something wrong with my code. would you guys mind checking it. my php page... | [
"php",
"mysql",
"sql-update"
] | 0 | 2 | 286 | 3 | 0 | 2011-05-31T01:58:17.417000 | 2011-05-31T02:11:32.010000 |
6,182,258 | 6,182,288 | finding the row that has the first TD containing the specified time | 7:00am 7:30am 8:00am 8:30am 9:00am 9:30am I have a basic table that I am using as a timetable, and would like to traverse the tds and trs. What I want to do is to first use the "contains" selector to find the row with the time I want, then when I have the Row, I want to use "Eq" to choose which column. $("tr.time:first... | You want something like this... $("tr.time td:first-child:contains('" + mytime + "')") jsFiddle. | finding the row that has the first TD containing the specified time 7:00am 7:30am 8:00am 8:30am 9:00am 9:30am I have a basic table that I am using as a timetable, and would like to traverse the tds and trs. What I want to do is to first use the "contains" selector to find the row with the time I want, then when I have ... | TITLE:
finding the row that has the first TD containing the specified time
QUESTION:
7:00am 7:30am 8:00am 8:30am 9:00am 9:30am I have a basic table that I am using as a timetable, and would like to traverse the tds and trs. What I want to do is to first use the "contains" selector to find the row with the time I want,... | [
"jquery"
] | 0 | 1 | 859 | 1 | 0 | 2011-05-31T01:59:20.380000 | 2011-05-31T02:04:06.303000 |
6,182,260 | 6,182,286 | Simple Android app fails without starting | Hello there people of stack overflow, I have just started developing with android and have run into a bit of a problem. I am trying to run a very simple app that has a single button, which when clicked updates the text to the current time. However, the app does not even start up. I am following a book. "Beginning Andro... | You should enclose the button inside a layout (linear, relative, etc): | Simple Android app fails without starting Hello there people of stack overflow, I have just started developing with android and have run into a bit of a problem. I am trying to run a very simple app that has a single button, which when clicked updates the text to the current time. However, the app does not even start u... | TITLE:
Simple Android app fails without starting
QUESTION:
Hello there people of stack overflow, I have just started developing with android and have run into a bit of a problem. I am trying to run a very simple app that has a single button, which when clicked updates the text to the current time. However, the app doe... | [
"android"
] | 0 | 2 | 75 | 3 | 0 | 2011-05-31T01:59:33.730000 | 2011-05-31T02:03:34.743000 |
6,182,261 | 6,182,303 | How can I speed up this query? | I have a table with 60 attributes in it, attribute1..attribute60. The database engine in MySQL and the table engine is MyISAM. The query is as follows: SELECT DISTINCT attribute1 FROM `product_applications` WHERE `product_applications`.`brand_id` NOT IN (642, 630, 513, 637, 632, 556, 548, 628, 651, 660, 648, 557, 650, ... | Previously, the following used a LEFT JOIN -- but the OP reversed the logic to use an INNER JOIN: SELECT DISTINCT t.attribute1 FROM PRODUCT_APPLICATIONS t JOIN (SELECT 642 AS brand_id UNION ALL SELECT 630 UNION ALL SELECT 513 UNION ALL SELECT 637 UNION ALL SELECT 632 UNION ALL SELECT 556 UNION ALL SELECT 548 UNION ALL ... | How can I speed up this query? I have a table with 60 attributes in it, attribute1..attribute60. The database engine in MySQL and the table engine is MyISAM. The query is as follows: SELECT DISTINCT attribute1 FROM `product_applications` WHERE `product_applications`.`brand_id` NOT IN (642, 630, 513, 637, 632, 556, 548,... | TITLE:
How can I speed up this query?
QUESTION:
I have a table with 60 attributes in it, attribute1..attribute60. The database engine in MySQL and the table engine is MyISAM. The query is as follows: SELECT DISTINCT attribute1 FROM `product_applications` WHERE `product_applications`.`brand_id` NOT IN (642, 630, 513, 6... | [
"mysql",
"sql",
"query-optimization"
] | 1 | 2 | 139 | 3 | 0 | 2011-05-31T01:59:36.087000 | 2011-05-31T02:07:19.597000 |
6,182,269 | 6,182,463 | Can't get state of UISwitch when initiated in cellForRowAtIndexPath? | I initiate my cellForRowAtIndexPath. It shows up, but when I try to reference it from a different class, it returns (null). If I initiate it in my viewDidLoad, it works but it needs to be in the UITableView. AddAlbumViewController: //.h IBOutlet UISwitch *privateSwitch; @property (nonatomic, retain) IBOutlet UISwitch *... | Assuming this code: privateSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(199, 8, 0, 0)]; [privateSwitch addTarget:self action:@selector(switchToggled:) forControlEvents: UIControlEventTouchUpInside]; [cell.contentView addSubview:privateSwitch]; is actually in your tableView:cellForRowAtIndexPath:, then that code ... | Can't get state of UISwitch when initiated in cellForRowAtIndexPath? I initiate my cellForRowAtIndexPath. It shows up, but when I try to reference it from a different class, it returns (null). If I initiate it in my viewDidLoad, it works but it needs to be in the UITableView. AddAlbumViewController: //.h IBOutlet UISwi... | TITLE:
Can't get state of UISwitch when initiated in cellForRowAtIndexPath?
QUESTION:
I initiate my cellForRowAtIndexPath. It shows up, but when I try to reference it from a different class, it returns (null). If I initiate it in my viewDidLoad, it works but it needs to be in the UITableView. AddAlbumViewController: /... | [
"objective-c",
"uitableview",
"uiswitch"
] | 0 | 1 | 360 | 1 | 0 | 2011-05-31T02:01:14.883000 | 2011-05-31T02:35:50.240000 |
6,182,270 | 6,182,417 | can ticking checkbox update javascript function call arguments? | I have few pairs of button & check box like on my pages (the combination of the first two arguments in this examole it's 'login' & 'basics' is unique for each button( run Can I somehow update onclick="run_through_ajax('login','basics','false')" to onclick="run_through_ajax('login','basics',' true ')" once the checkbox ... | How 'bout this? HTML: run run run Javascript: function run_through_ajax(p1, p2, p3) { console.log('p1: '+p1+', p2: '+p2+', p3: '+p3); }
$(document).ready(function(){ $('button[type=button]').click(function(e){ var params = $(this).prev('input[type=hidden]').val(); run_through_ajax(params.split('|')[0], params.split('|... | can ticking checkbox update javascript function call arguments? I have few pairs of button & check box like on my pages (the combination of the first two arguments in this examole it's 'login' & 'basics' is unique for each button( run Can I somehow update onclick="run_through_ajax('login','basics','false')" to onclick=... | TITLE:
can ticking checkbox update javascript function call arguments?
QUESTION:
I have few pairs of button & check box like on my pages (the combination of the first two arguments in this examole it's 'login' & 'basics' is unique for each button( run Can I somehow update onclick="run_through_ajax('login','basics','fa... | [
"javascript",
"jquery"
] | 0 | 1 | 493 | 1 | 0 | 2011-05-31T02:01:32.230000 | 2011-05-31T02:27:05.467000 |
6,182,271 | 6,182,334 | CUDA emulator for windows 7 | I have read several related posts but while some of them are for emulators on linux, others are on specific versions of windows with some preferences. So, I want to keep it simple: Is there a CUDA emulator that runs on windows. If yes, please provide me the link | GPUOcelot has a section about the "experimental" windows build in the installation wiki. Edit in 2021 to note that while Ocelot was a very impressive student research project, all the original authors moved on to other things many years ago and active development has ceased. It is very unlikely that the code, which is ... | CUDA emulator for windows 7 I have read several related posts but while some of them are for emulators on linux, others are on specific versions of windows with some preferences. So, I want to keep it simple: Is there a CUDA emulator that runs on windows. If yes, please provide me the link | TITLE:
CUDA emulator for windows 7
QUESTION:
I have read several related posts but while some of them are for emulators on linux, others are on specific versions of windows with some preferences. So, I want to keep it simple: Is there a CUDA emulator that runs on windows. If yes, please provide me the link
ANSWER:
GP... | [
"cuda",
"nvidia"
] | 1 | 4 | 3,606 | 2 | 0 | 2011-05-31T02:01:32.717000 | 2011-05-31T02:13:14.407000 |
6,182,290 | 6,182,352 | regex to remove ordinals | I need to remove ordinals via regex, but my regex skills are quite lacking. The following locates the ordinals, but includes the digit just prior in the return value. I need to isolate and remove just the ordinal. [0-9](?:st|nd|rd|th) | You need to use a look-behind assertion so that only st|nd|rd|th preceded by a [0-9] are matched, but the [0-9] isn't included in the match. i.e.: (?<=[0-9])(?:st|nd|rd|th) I've linked to the perl-compatible syntax, but if you're using posix, posix extended, vi or one of many other regex syntaxes you'll need to look up... | regex to remove ordinals I need to remove ordinals via regex, but my regex skills are quite lacking. The following locates the ordinals, but includes the digit just prior in the return value. I need to isolate and remove just the ordinal. [0-9](?:st|nd|rd|th) | TITLE:
regex to remove ordinals
QUESTION:
I need to remove ordinals via regex, but my regex skills are quite lacking. The following locates the ordinals, but includes the digit just prior in the return value. I need to isolate and remove just the ordinal. [0-9](?:st|nd|rd|th)
ANSWER:
You need to use a look-behind ass... | [
"regex"
] | 8 | 16 | 8,018 | 5 | 0 | 2011-05-31T02:04:28.440000 | 2011-05-31T02:15:48.847000 |
6,182,296 | 6,182,473 | How to manipulate dataType xml when using $.ajax? | I am having some difficulties with the XML dataype when using $.ajax. I created a PHP file ( test.php ): "; echo " Tristan Jun "; echo " 22 "; echo " "; return; }?> TEST Here is my description for this example: When i click the 'TEST' button, it will call the AJAX to show the result of the PHP code In the AJAX call I o... | If the whole code you've posted is the content of test.php, the response can't be valid xml. The output will end with, but start's with a. (XML needs to have one root-element). I would suggest to use the output_buffer, if the request comes via ajax discard the contents of the buffer before echoing the xml.(Or just put ... | How to manipulate dataType xml when using $.ajax? I am having some difficulties with the XML dataype when using $.ajax. I created a PHP file ( test.php ): "; echo " Tristan Jun "; echo " 22 "; echo " "; return; }?> TEST Here is my description for this example: When i click the 'TEST' button, it will call the AJAX to sh... | TITLE:
How to manipulate dataType xml when using $.ajax?
QUESTION:
I am having some difficulties with the XML dataype when using $.ajax. I created a PHP file ( test.php ): "; echo " Tristan Jun "; echo " 22 "; echo " "; return; }?> TEST Here is my description for this example: When i click the 'TEST' button, it will c... | [
"php",
"jquery",
"xml",
"ajax"
] | 0 | 0 | 933 | 1 | 0 | 2011-05-31T02:05:11.793000 | 2011-05-31T02:37:27.343000 |
6,182,299 | 6,182,319 | Javascript If else statement | $(".Arrow44").click(function(event) { $("#aca").slideDown(); event.stopPropagation(); });
$(document).click(function(event) { var a = $(event.target).andSelf().parents("#aca"); if (a.length == 0 && $("#aca").is(":visible")) { $("#aca").slideUp(); } else $(".Arrow44").click(function(event) { $("#aca").slideUp(); }
});... | $(".Arrow44").click(function () { $("#aca").slideToggle(); return false; // stop bubbling and prevent default action - remove if not necessary }); | Javascript If else statement $(".Arrow44").click(function(event) { $("#aca").slideDown(); event.stopPropagation(); });
$(document).click(function(event) { var a = $(event.target).andSelf().parents("#aca"); if (a.length == 0 && $("#aca").is(":visible")) { $("#aca").slideUp(); } else $(".Arrow44").click(function(event) ... | TITLE:
Javascript If else statement
QUESTION:
$(".Arrow44").click(function(event) { $("#aca").slideDown(); event.stopPropagation(); });
$(document).click(function(event) { var a = $(event.target).andSelf().parents("#aca"); if (a.length == 0 && $("#aca").is(":visible")) { $("#aca").slideUp(); } else $(".Arrow44").clic... | [
"javascript",
"jquery",
"if-statement"
] | 0 | 2 | 197 | 1 | 0 | 2011-05-31T02:05:59.117000 | 2011-05-31T02:10:43.570000 |
6,182,311 | 6,182,333 | Move controls programmatically in a method warns 'method not found' and 'control may not respond to' | I have a UISegmentedView that I use to present the user with an option on one of two calculations they can do in my program. If the segmented control is one way, it should show 4 text boxes and their labels, if the other only 3 (and the calculation would change as well). This all works, my problem is with moving the co... | In which class did you define these methods? (doesn't appear to be a category) Let's say you defined them in SomeClass, then you need to do this: [someInstanceOfSomeClass moveControlUp:labelPointsHeader]; Right now you are sending a message to a UILabel in the first case, but UILabel does not have this method. The meth... | Move controls programmatically in a method warns 'method not found' and 'control may not respond to' I have a UISegmentedView that I use to present the user with an option on one of two calculations they can do in my program. If the segmented control is one way, it should show 4 text boxes and their labels, if the othe... | TITLE:
Move controls programmatically in a method warns 'method not found' and 'control may not respond to'
QUESTION:
I have a UISegmentedView that I use to present the user with an option on one of two calculations they can do in my program. If the segmented control is one way, it should show 4 text boxes and their l... | [
"objective-c",
"methods",
"uitextfield",
"uilabel",
"uicontrol"
] | 1 | 0 | 541 | 1 | 0 | 2011-05-31T02:09:06.443000 | 2011-05-31T02:13:14.407000 |
6,182,313 | 6,182,360 | I can't get multiple values out of MySQL using a select statement in PHP | This is my code: $bookresult = mysqli_query($db, "SELECT bookID FROM order_items WHERE orderID = '".$orders['orderID']."';"); The problem I have is that there are multiple bookIDs that are pulled out of MySQL. So when I do this: $books = mysqli_fetch_array($bookresult); There is no way for me to get all the bookIDs tha... | You need to use a loop to go through all of the values. You can view them by using the following php code. (You can use mysql_fetch_array in place of mysql_fetch_assoc if you wish. while ($books_row = mysql_fetch_assoc($bookresult)) { //output here. echo " "; print_r($books_row); echo " "; } The output there is great f... | I can't get multiple values out of MySQL using a select statement in PHP This is my code: $bookresult = mysqli_query($db, "SELECT bookID FROM order_items WHERE orderID = '".$orders['orderID']."';"); The problem I have is that there are multiple bookIDs that are pulled out of MySQL. So when I do this: $books = mysqli_fe... | TITLE:
I can't get multiple values out of MySQL using a select statement in PHP
QUESTION:
This is my code: $bookresult = mysqli_query($db, "SELECT bookID FROM order_items WHERE orderID = '".$orders['orderID']."';"); The problem I have is that there are multiple bookIDs that are pulled out of MySQL. So when I do this: ... | [
"php",
"mysql",
"sql",
"mysqli"
] | 0 | 0 | 259 | 2 | 0 | 2011-05-31T02:09:22.650000 | 2011-05-31T02:16:55.287000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.