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,201,410 | 6,247,578 | How to change widget layout background programmatically in Android | Take this widget layout for example (part of my whole widget layout) I want to be able to change the background drawable used based on a users selection. For example using remote views I can update the colour of a textview by doing something like this: remoteView.setTextColor(R.id.text_view1, Color.WHITE); However I ha... | Ok, well the only solution that I could end up coming up with for this was to change the way I was displaying the background image in the LinearLayout. As you can see above I was using the android:background tag to display the image. What I ended up doing was that I removed this and then encased my entire widget layout... | How to change widget layout background programmatically in Android Take this widget layout for example (part of my whole widget layout) I want to be able to change the background drawable used based on a users selection. For example using remote views I can update the colour of a textview by doing something like this: ... | TITLE:
How to change widget layout background programmatically in Android
QUESTION:
Take this widget layout for example (part of my whole widget layout) I want to be able to change the background drawable used based on a users selection. For example using remote views I can update the colour of a textview by doing som... | [
"android",
"layout",
"background",
"widget"
] | 15 | 8 | 15,399 | 2 | 0 | 2011-06-01T12:50:34.297000 | 2011-06-06T03:46:02.093000 |
6,201,413 | 6,201,445 | Violation of UNIQUE KEY constraint while updating field | I am using a gridview i that adding the row with text box and adding the data which is successfully done.. But when i am update a field Email it is showing the error.. Violation of UNIQUE KEY constraint while updating field function: Update_U_Anonymoususerdetails
int InsId=0, UserId=0,UserInstLink=0,UserCreditRecord=0... | It is because a record with same email already exists in the database. And the database has a constraint on the email field that each entry in this field should be unique in the table you are inserting data into. EDIT: If this data is provided by a user, then you need to catch this exception and show a message to the u... | Violation of UNIQUE KEY constraint while updating field I am using a gridview i that adding the row with text box and adding the data which is successfully done.. But when i am update a field Email it is showing the error.. Violation of UNIQUE KEY constraint while updating field function: Update_U_Anonymoususerdetails
... | TITLE:
Violation of UNIQUE KEY constraint while updating field
QUESTION:
I am using a gridview i that adding the row with text box and adding the data which is successfully done.. But when i am update a field Email it is showing the error.. Violation of UNIQUE KEY constraint while updating field function: Update_U_Ano... | [
"c#",
"asp.net"
] | 1 | 3 | 2,420 | 2 | 0 | 2011-06-01T12:51:03.923000 | 2011-06-01T12:53:26.477000 |
6,201,425 | 6,202,035 | Wait for an Ajax call to complete with Selenium 2 WebDriver | I'm using Selenium 2 WebDriver to test an UI which uses AJAX. Is there a way to make the driver to wait for a bit that the Ajax request will complete. Basically I have this: d.FindElement(By.XPath("//div[8]/div[3]/div/button")).Click(); // This click trigger an ajax request which will fill the below ID with content. //... | var wait = new WebDriverWait(d, TimeSpan.FromSeconds(5)); var element = wait.Until(driver => driver.FindElement(By.Id("Hobbies"))); | Wait for an Ajax call to complete with Selenium 2 WebDriver I'm using Selenium 2 WebDriver to test an UI which uses AJAX. Is there a way to make the driver to wait for a bit that the Ajax request will complete. Basically I have this: d.FindElement(By.XPath("//div[8]/div[3]/div/button")).Click(); // This click trigger a... | TITLE:
Wait for an Ajax call to complete with Selenium 2 WebDriver
QUESTION:
I'm using Selenium 2 WebDriver to test an UI which uses AJAX. Is there a way to make the driver to wait for a bit that the Ajax request will complete. Basically I have this: d.FindElement(By.XPath("//div[8]/div[3]/div/button")).Click(); // Th... | [
"c#",
"ajax",
"selenium",
"selenium-webdriver"
] | 60 | 18 | 97,903 | 10 | 0 | 2011-06-01T12:52:08.260000 | 2011-06-01T13:35:43.913000 |
6,201,428 | 6,203,426 | How to access application constants from within a model? | I have an application where a user can set up an account which has a public URL associated with it a-la-twitter, e.g. http://myapplication.com/user_directory In order to make sure that the users can't chose directories that I want to reserve (home, help, settings etc) I have a list of these stored in a configuration fi... | Urgh, I just realised why this wasn't working. I was declaring the constants after the app had been initialized. Doesn't work # Load the rails application require File.expand_path('../application', __FILE__)
# Initialize the rails application MyApplication::Application.initialize!
APP_CONFIG = YAML.load_file("#{Rails... | How to access application constants from within a model? I have an application where a user can set up an account which has a public URL associated with it a-la-twitter, e.g. http://myapplication.com/user_directory In order to make sure that the users can't chose directories that I want to reserve (home, help, settings... | TITLE:
How to access application constants from within a model?
QUESTION:
I have an application where a user can set up an account which has a public URL associated with it a-la-twitter, e.g. http://myapplication.com/user_directory In order to make sure that the users can't chose directories that I want to reserve (ho... | [
"ruby-on-rails",
"ruby"
] | 1 | 1 | 1,874 | 3 | 0 | 2011-06-01T12:52:14.533000 | 2011-06-01T15:11:15.970000 |
6,201,432 | 6,264,021 | testing devise login with cucumber | I know the ideal thing to do would be to fill the login form and follow that flow. The thing is that I am not using devise for login in. I do login in my application the user after authenticating with Facebook and fb_graph gem. So the devise sign_in view only has the link "connect with Facebook", but I am able to see t... | Instead of doing that, which I am not proud of I ended up doing the following: Application controller before_filter:authenticate_user!,:except => [:login]
# This action is supposed to only be accessed in the test environment. # This is for being able of running the cucumber tests. def login @user = User.find(params[:i... | testing devise login with cucumber I know the ideal thing to do would be to fill the login form and follow that flow. The thing is that I am not using devise for login in. I do login in my application the user after authenticating with Facebook and fb_graph gem. So the devise sign_in view only has the link "connect wit... | TITLE:
testing devise login with cucumber
QUESTION:
I know the ideal thing to do would be to fill the login form and follow that flow. The thing is that I am not using devise for login in. I do login in my application the user after authenticating with Facebook and fb_graph gem. So the devise sign_in view only has the... | [
"authentication",
"devise",
"cucumber"
] | 1 | 2 | 2,008 | 2 | 0 | 2011-06-01T12:52:36.060000 | 2011-06-07T10:39:51.967000 |
6,201,434 | 6,201,483 | How to render pages as we go in PHP? | It's really weird, I just changed server last week and I have a large script that process lots of information (personal script). What it does it add stuff to the database with a foreach and then echo where it is (ex: "ID #27 was processed") and so on until its done. With the old server, I would see this "echo" script r... | If you have access to the php.ini, you can set output_buffering = Off to disable this behavior entirely. Otherwise, use flush() as suggested by others. I believe the default setting for output_buffering is 4096. If the new server is set much higher, you might also try simply lowering it rather than turning it off to ac... | How to render pages as we go in PHP? It's really weird, I just changed server last week and I have a large script that process lots of information (personal script). What it does it add stuff to the database with a foreach and then echo where it is (ex: "ID #27 was processed") and so on until its done. With the old ser... | TITLE:
How to render pages as we go in PHP?
QUESTION:
It's really weird, I just changed server last week and I have a large script that process lots of information (personal script). What it does it add stuff to the database with a foreach and then echo where it is (ex: "ID #27 was processed") and so on until its done... | [
"php"
] | 2 | 4 | 1,955 | 4 | 0 | 2011-06-01T12:52:38.450000 | 2011-06-01T12:56:30.817000 |
6,201,447 | 6,202,147 | IIS caching project reference binaries | I just had to debug an issue where Asp.Net seemed to be caching the dll's of projects referenced by the website, even after those were rebuilt The solution compiles, but at runtime Asp.Net references an out of date binary in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root, and throws an excep... | As mentioned in my update, this appears to be related to the optimizeCompilations flag http://blogs.msdn.com/b/davidebb/archive/2009/04/15/a-new-flag-to-optimize-asp-net-compilation-behavior.aspx | IIS caching project reference binaries I just had to debug an issue where Asp.Net seemed to be caching the dll's of projects referenced by the website, even after those were rebuilt The solution compiles, but at runtime Asp.Net references an out of date binary in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ... | TITLE:
IIS caching project reference binaries
QUESTION:
I just had to debug an issue where Asp.Net seemed to be caching the dll's of projects referenced by the website, even after those were rebuilt The solution compiles, but at runtime Asp.Net references an out of date binary in C:\Windows\Microsoft.NET\Framework\v4.... | [
"asp.net",
"reference",
"temporary-files"
] | 0 | 0 | 710 | 2 | 0 | 2011-06-01T12:53:32.717000 | 2011-06-01T13:43:01.403000 |
6,201,449 | 6,202,847 | How to modularize Rails code? | Basically, I'm in the process of writing a website that interfaces with many popular websites (Facebook, Twitter, Youtube etc). My principal objective will be the same, however the way I accomplish my objective will be different for every site I support, because their layout is different and because I'll have to script... | Looks like the strategy pattern to me. You could do it like this (not sure where to put it in Rails). require "delegate"
class Youtube def open_connection #code to open connection with youtube end
def do_stuff puts "doing stuff on Youtube" end
def close_connection #code to close connection end end
class Facebook #d... | How to modularize Rails code? Basically, I'm in the process of writing a website that interfaces with many popular websites (Facebook, Twitter, Youtube etc). My principal objective will be the same, however the way I accomplish my objective will be different for every site I support, because their layout is different a... | TITLE:
How to modularize Rails code?
QUESTION:
Basically, I'm in the process of writing a website that interfaces with many popular websites (Facebook, Twitter, Youtube etc). My principal objective will be the same, however the way I accomplish my objective will be different for every site I support, because their lay... | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-3"
] | 2 | 3 | 779 | 2 | 0 | 2011-06-01T12:53:55.353000 | 2011-06-01T14:31:03.867000 |
6,201,461 | 6,211,261 | Why is Android's JSONObject retained in memory? | I am working on an OutOfMemory exception generated when a really large JSONObject is created but never garbage collected by Android's framework. On each subsequent update the memory leak just gets bigger and bigger till I run out of memory. We have a large data structure that changes over time and on each update we sen... | Maybe it's best to convert your JSON response into a POJO as soon as you receive it. The Jackson JSON parser will do that for you in two lines of code and can also turn it back into your JSON Object if you ever need to do that. Jackson is very fast (they claim the fastest of all the parsers) so you won't take much of a... | Why is Android's JSONObject retained in memory? I am working on an OutOfMemory exception generated when a really large JSONObject is created but never garbage collected by Android's framework. On each subsequent update the memory leak just gets bigger and bigger till I run out of memory. We have a large data structure ... | TITLE:
Why is Android's JSONObject retained in memory?
QUESTION:
I am working on an OutOfMemory exception generated when a really large JSONObject is created but never garbage collected by Android's framework. On each subsequent update the memory leak just gets bigger and bigger till I run out of memory. We have a lar... | [
"android",
"json",
"out-of-memory"
] | 2 | 2 | 3,031 | 1 | 0 | 2011-06-01T12:54:49.740000 | 2011-06-02T06:36:11.173000 |
6,201,463 | 6,201,498 | IPhone Key board is not responding | In the viewdidload method, I've assigned one of my text fields as first responder by the following way. [txtUsername becomeFirstResponder]; When the view gets loaded, the text field becomes active and a keyboard appears. But when I tried typing on the keyboard, it is not responding. However when I touched the text fiel... | Calling becomeFirstResponder in viewDidLoad is not a good idea because the view might not even be on the screen and part of the view hierarchy yet. Try calling becomeFirstResponder in viewDidAppear: instead: - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated];
[txtUsername becomeFirstResponder]; } | IPhone Key board is not responding In the viewdidload method, I've assigned one of my text fields as first responder by the following way. [txtUsername becomeFirstResponder]; When the view gets loaded, the text field becomes active and a keyboard appears. But when I tried typing on the keyboard, it is not responding. H... | TITLE:
IPhone Key board is not responding
QUESTION:
In the viewdidload method, I've assigned one of my text fields as first responder by the following way. [txtUsername becomeFirstResponder]; When the view gets loaded, the text field becomes active and a keyboard appears. But when I tried typing on the keyboard, it is... | [
"iphone",
"ios4",
"keyboard"
] | 0 | 2 | 124 | 2 | 0 | 2011-06-01T12:54:58.963000 | 2011-06-01T12:57:48.130000 |
6,201,466 | 6,201,569 | How to return to previous activity without any user interaction | I'm new to android development and I'm trying to make an android app that calls an activity in a loop, but every time the activity returns result it has to show the main screen. The problem is that there can't be any user interaction, because the smartphone is going to be mounted on a robot and it's going to scan for b... | It looks like your Thread.sleep() is blocking the UI for 3 secs and immediately relaunching your scan activity before it gets the chance to refresh the screen after your background change. Try changing the background, and then moving both the three second wait -and- the startActivityForResult() code into a Handler, lea... | How to return to previous activity without any user interaction I'm new to android development and I'm trying to make an android app that calls an activity in a loop, but every time the activity returns result it has to show the main screen. The problem is that there can't be any user interaction, because the smartphon... | TITLE:
How to return to previous activity without any user interaction
QUESTION:
I'm new to android development and I'm trying to make an android app that calls an activity in a loop, but every time the activity returns result it has to show the main screen. The problem is that there can't be any user interaction, bec... | [
"android"
] | 2 | 0 | 314 | 1 | 0 | 2011-06-01T12:55:16.390000 | 2011-06-01T13:02:15.543000 |
6,201,469 | 6,202,086 | Where to download the complete source code of android.jar? | I downloaded the repository: git://android.git.kernel.org/platform/frameworks/base.git But I found it's not enough. For example, most of the source code for the packages like java., javax. were not there. What else repository do I need to download? | First, that's not really the source code to android.jar. The android.jar on your development machine is a JAR of stubs for the non-hidden classes and methods that form the basis of the SDK. Second, downloading one Git repository usually isn't particularly useful if you want to work with the code. You are going to need ... | Where to download the complete source code of android.jar? I downloaded the repository: git://android.git.kernel.org/platform/frameworks/base.git But I found it's not enough. For example, most of the source code for the packages like java., javax. were not there. What else repository do I need to download? | TITLE:
Where to download the complete source code of android.jar?
QUESTION:
I downloaded the repository: git://android.git.kernel.org/platform/frameworks/base.git But I found it's not enough. For example, most of the source code for the packages like java., javax. were not there. What else repository do I need to down... | [
"android",
"android-source"
] | 1 | 2 | 4,719 | 1 | 0 | 2011-06-01T12:55:28.060000 | 2011-06-01T13:39:00.390000 |
6,201,472 | 6,201,849 | xpath Query for xpath extractor of Jmeter | Can someone please provide me the xml query for retrieving the value of sessionId from the below response: 316 I tried using /ns2:createUserResponse/@sessionId and seems its not returning anything. I want to use this query in the XPATH extractor of jmeter. My requirement: I need to retrieve sessionId value using xpath ... | Have you set JMeter to use namespaces? JMeter has been reported to have problems with namespaces. If fiddling with settings won't help, here is a workaround for the root element /*/@sessionId Workaround for any element in a namespace is to use *[local-name() = 'element'] instead of prefix:element | xpath Query for xpath extractor of Jmeter Can someone please provide me the xml query for retrieving the value of sessionId from the below response: 316 I tried using /ns2:createUserResponse/@sessionId and seems its not returning anything. I want to use this query in the XPATH extractor of jmeter. My requirement: I nee... | TITLE:
xpath Query for xpath extractor of Jmeter
QUESTION:
Can someone please provide me the xml query for retrieving the value of sessionId from the below response: 316 I tried using /ns2:createUserResponse/@sessionId and seems its not returning anything. I want to use this query in the XPATH extractor of jmeter. My ... | [
"xpath",
"extractor"
] | 1 | 2 | 2,701 | 1 | 0 | 2011-06-01T12:55:39.260000 | 2011-06-01T13:22:39.157000 |
6,201,474 | 6,218,920 | ActionScript 3 AMF Zend fails silently | I'm trying to connect to a Zend-PHP service within a pure ActionScript program. I've managed to use the service successfully using Flex. (But Flex mobile apps are bloated, and typically 10x bigger than pure ActionScript apps - which is why I'm trying to write it in Pure Actionscript). I'm trying to access the PHP/Zend ... | It took me a long time to realise - but the gateway url was pointing to the wrong.php file. (But had the code not failed silently, and yielded some diagnostics, I might have got there quicker). Anyway - Thanks for your help everyone. | ActionScript 3 AMF Zend fails silently I'm trying to connect to a Zend-PHP service within a pure ActionScript program. I've managed to use the service successfully using Flex. (But Flex mobile apps are bloated, and typically 10x bigger than pure ActionScript apps - which is why I'm trying to write it in Pure Actionscri... | TITLE:
ActionScript 3 AMF Zend fails silently
QUESTION:
I'm trying to connect to a Zend-PHP service within a pure ActionScript program. I've managed to use the service successfully using Flex. (But Flex mobile apps are bloated, and typically 10x bigger than pure ActionScript apps - which is why I'm trying to write it ... | [
"flash",
"apache-flex",
"actionscript-3",
"zend-framework",
"amf"
] | 0 | 0 | 489 | 2 | 0 | 2011-06-01T12:55:49.430000 | 2011-06-02T18:46:48.867000 |
6,201,484 | 6,201,586 | Resize images in GridView on Android | I follow this tutorial to create a GridView: This line: imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); Size 85x85 is great for my Wildfire, but on HTC Desire it looks very small. How can I change the image size according to the screen? I have 2 different layouts, but Gridview hasn't any attribute in the ... | You could try to make an adjustment based off the pixel density of the current device you are on. DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); switch(metrics.densityDpi){ case DisplayMetrics.DENSITY_LOW: imageView.setLayoutParams(new GridView.LayoutParams(lo... | Resize images in GridView on Android I follow this tutorial to create a GridView: This line: imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); Size 85x85 is great for my Wildfire, but on HTC Desire it looks very small. How can I change the image size according to the screen? I have 2 different layouts, but ... | TITLE:
Resize images in GridView on Android
QUESTION:
I follow this tutorial to create a GridView: This line: imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); Size 85x85 is great for my Wildfire, but on HTC Desire it looks very small. How can I change the image size according to the screen? I have 2 diffe... | [
"android",
"image",
"gridview",
"image-size"
] | 5 | 8 | 9,162 | 2 | 0 | 2011-06-01T12:56:36.217000 | 2011-06-01T13:03:36.087000 |
6,201,488 | 6,202,601 | Combine 2 select statements | I have 2 select statements and would like to combine them so they're displayed in 1 table. Select 1: SELECT LAST_DAY, SUM(BILLABLE), AVG(BILLABLE) FROM EMPLOYEES GROUP BY YEAR(LAST_DAY),WEEK(LAST_DAY) ORDER BY LAST_DAY Select 2: SELECT BILLABLE FROM EMPLOYEES WHERE NAME LIKE '$lookup%' The goal here is to show all empl... | The "lookup" row thing looks like it's probably a kludge, so I'd question your design. Also, it looks like your "Employee" table isn't actually rows of employees, but rows of weekly sales or something. It doesn't seem like it's 3NF, which will probably cause you a lot of headaches. Anyway, I think that this will do wha... | Combine 2 select statements I have 2 select statements and would like to combine them so they're displayed in 1 table. Select 1: SELECT LAST_DAY, SUM(BILLABLE), AVG(BILLABLE) FROM EMPLOYEES GROUP BY YEAR(LAST_DAY),WEEK(LAST_DAY) ORDER BY LAST_DAY Select 2: SELECT BILLABLE FROM EMPLOYEES WHERE NAME LIKE '$lookup%' The g... | TITLE:
Combine 2 select statements
QUESTION:
I have 2 select statements and would like to combine them so they're displayed in 1 table. Select 1: SELECT LAST_DAY, SUM(BILLABLE), AVG(BILLABLE) FROM EMPLOYEES GROUP BY YEAR(LAST_DAY),WEEK(LAST_DAY) ORDER BY LAST_DAY Select 2: SELECT BILLABLE FROM EMPLOYEES WHERE NAME LIK... | [
"mysql",
"select"
] | 3 | 2 | 1,535 | 1 | 0 | 2011-06-01T12:56:55.463000 | 2011-06-01T14:13:21.437000 |
6,201,489 | 6,201,504 | There is no constructor for interface in Java? | In Java, if I have an interface: public interface MyInterface{ } Then MyInterface implementation is: class MyClass implements MyInterface { public MyClass(int a) { } } So what I mean is that if a user wants to do declare a MyInterface instance with constructor: MyInterface mine = new MyInterface(2); then it is not poss... | MyInterface mine = new MyInterface(2); then it is not possible right? That's right. You can never do something like MyInterface mine = new MyInterface(2); After new you have to pick a class that implements the interface (*), such as MyClass: MyInterface mine = new MyClass(2); Why? You can think of an interface as a pro... | There is no constructor for interface in Java? In Java, if I have an interface: public interface MyInterface{ } Then MyInterface implementation is: class MyClass implements MyInterface { public MyClass(int a) { } } So what I mean is that if a user wants to do declare a MyInterface instance with constructor: MyInterface... | TITLE:
There is no constructor for interface in Java?
QUESTION:
In Java, if I have an interface: public interface MyInterface{ } Then MyInterface implementation is: class MyClass implements MyInterface { public MyClass(int a) { } } So what I mean is that if a user wants to do declare a MyInterface instance with constr... | [
"java"
] | 2 | 19 | 17,410 | 6 | 0 | 2011-06-01T12:56:56.870000 | 2011-06-01T12:58:02.560000 |
6,201,505 | 6,201,614 | Temporary disabling a Submit Button | I have a form which upload a big file to server. Something like this: I need to prevent the user resubmit the form while the previous processing is not ready. How can I disable submit button before processing and enable the button after submit action? | The correct way to do this in jQuery, as of version 1.6, is with the new prop() method. Also important is that you attach the event to the form's submit event, NOT to the submit button itself. That way if someone hits enter while filling out the form, like I'm sure we all do, the button will still be disabled. Correct ... | Temporary disabling a Submit Button I have a form which upload a big file to server. Something like this: I need to prevent the user resubmit the form while the previous processing is not ready. How can I disable submit button before processing and enable the button after submit action? | TITLE:
Temporary disabling a Submit Button
QUESTION:
I have a form which upload a big file to server. Something like this: I need to prevent the user resubmit the form while the previous processing is not ready. How can I disable submit button before processing and enable the button after submit action?
ANSWER:
The c... | [
"javascript",
"jquery"
] | 4 | 2 | 2,169 | 7 | 0 | 2011-06-01T12:58:03.823000 | 2011-06-01T13:06:09.230000 |
6,201,506 | 6,202,097 | Crop live video stream | I have a streaming video that is displayed on a web page through a flash player from an external source. This video has a huge border that I would like to crop out before displaying. How can I alter the feed in real time before showing it to the user, such that the resulting video has its border removed? Thanks. | You don't need to crop the stream, you can simply apply a mask to the video object in the desired dimension (size of stream without borders). You may have some difficulties in fullscreen mode. Also you may resize the video object in that way, that it fills the area where you are displaying the stream. This needs some m... | Crop live video stream I have a streaming video that is displayed on a web page through a flash player from an external source. This video has a huge border that I would like to crop out before displaying. How can I alter the feed in real time before showing it to the user, such that the resulting video has its border ... | TITLE:
Crop live video stream
QUESTION:
I have a streaming video that is displayed on a web page through a flash player from an external source. This video has a huge border that I would like to crop out before displaying. How can I alter the feed in real time before showing it to the user, such that the resulting vid... | [
"flash",
"actionscript",
"video",
"video-streaming"
] | 0 | 0 | 1,785 | 2 | 0 | 2011-06-01T12:58:12.160000 | 2011-06-01T13:39:34.967000 |
6,201,508 | 6,202,055 | Full width background, without a wrapper | I'm working on a site, and thought I'd see if there is a better way to achive the same result. The problem: The page is made up of several sections, each one with its own background, that should be the full width of the browser. The content within each section is in a 960px centered. At present I am wrapping each secti... | Your requirements are contradictory. You specify that each of the three sections should span the entire width of the page (and contain different background) but the contents of each of these must be restricted to 960px. A single div can not simultaneously have 100% width and 960px width. Short of doing some JavaScript ... | Full width background, without a wrapper I'm working on a site, and thought I'd see if there is a better way to achive the same result. The problem: The page is made up of several sections, each one with its own background, that should be the full width of the browser. The content within each section is in a 960px cent... | TITLE:
Full width background, without a wrapper
QUESTION:
I'm working on a site, and thought I'd see if there is a better way to achive the same result. The problem: The page is made up of several sections, each one with its own background, that should be the full width of the browser. The content within each section ... | [
"css"
] | 3 | 1 | 2,093 | 6 | 0 | 2011-06-01T12:05:23.703000 | 2011-06-01T13:37:00.840000 |
6,201,511 | 6,201,562 | How to use Validation Control Properly in Webpage | I am working on a project in which I have a web page named as Booking. I use validation controls as per requirement. They all work properly. The Problem is that when user open a Booking page and want to move another page without filling any detail. All the validation controls show error message. How can I stop that? | Set the CauseValidation property of the control you are using to navigate to the other page to false. Refer to the following for more information about validation: Validating ASP.NET Server Controls | How to use Validation Control Properly in Webpage I am working on a project in which I have a web page named as Booking. I use validation controls as per requirement. They all work properly. The Problem is that when user open a Booking page and want to move another page without filling any detail. All the validation co... | TITLE:
How to use Validation Control Properly in Webpage
QUESTION:
I am working on a project in which I have a web page named as Booking. I use validation controls as per requirement. They all work properly. The Problem is that when user open a Booking page and want to move another page without filling any detail. All... | [
"c#",
"asp.net",
"validation"
] | 0 | 2 | 279 | 2 | 0 | 2011-06-01T12:58:22.950000 | 2011-06-01T13:01:31.123000 |
6,201,513 | 6,202,027 | Why is Oracle eating my string? | i currently try to execute the following query on an Oracle DB select tzname || ' (UTC'|| tz_offset(tzname) || ')' from v$timezone_names It not seems to be very complicated. Just the name of the timzone and the UTC offset in braces. But when i execute the query with PL/SQL Developer on windows it always eats up the las... | Issuing the following query: select dump(tz_offset(tzname)) from v$timezone_names; You get results like these: Typ=1 Len=7: 43,48,49,58,48,48,0 Typ=1 Len=7: 43,48,49,58,48,48,0 Typ=1 Len=7: 43,48,49,58,48,48,0 Typ=1 Len=7: 43,48,49,58,48,48,0 Typ=1 Len=7: 43,48,49,58,48,48,0 Typ=1 Len=7: 43,48,49,58,48,48,0... This sho... | Why is Oracle eating my string? i currently try to execute the following query on an Oracle DB select tzname || ' (UTC'|| tz_offset(tzname) || ')' from v$timezone_names It not seems to be very complicated. Just the name of the timzone and the UTC offset in braces. But when i execute the query with PL/SQL Developer on w... | TITLE:
Why is Oracle eating my string?
QUESTION:
i currently try to execute the following query on an Oracle DB select tzname || ' (UTC'|| tz_offset(tzname) || ')' from v$timezone_names It not seems to be very complicated. Just the name of the timzone and the UTC offset in braces. But when i execute the query with PL/... | [
"oracle",
"oracle10g",
"plsqldeveloper"
] | 8 | 7 | 1,089 | 3 | 0 | 2011-06-01T12:58:28.863000 | 2011-06-01T13:34:52.353000 |
6,201,515 | 6,201,633 | How to page multiple plots in R in separate jpeg files? | I'd like to plot multiple plots in separate bitmap files using the file name pattern (for example, for JPEG) file.%03d.jpg in R. I tried using something like: somevar <- 1 jpg(paste(sep='',filename,'.%03d.jpg')) while(somevar <= n) { plot(data[somevar]) dev.new() somevar <- somevar + 1 } dev.off() but it creates one.jp... | I think this should work somevar <- 1 while(somevar <= n) { jpg(sprintf("%s%03.jpg", filename, somevar)) plot(data[somevar]) dev.off() somevar <- somevar + 1 } Plotting goes from device opening (here jpeg(...) ) to dev.off(). You control the filename (where I corrected your use of paste() to sprintf() ) and the loop. | How to page multiple plots in R in separate jpeg files? I'd like to plot multiple plots in separate bitmap files using the file name pattern (for example, for JPEG) file.%03d.jpg in R. I tried using something like: somevar <- 1 jpg(paste(sep='',filename,'.%03d.jpg')) while(somevar <= n) { plot(data[somevar]) dev.new() ... | TITLE:
How to page multiple plots in R in separate jpeg files?
QUESTION:
I'd like to plot multiple plots in separate bitmap files using the file name pattern (for example, for JPEG) file.%03d.jpg in R. I tried using something like: somevar <- 1 jpg(paste(sep='',filename,'.%03d.jpg')) while(somevar <= n) { plot(data[so... | [
"r",
"default",
"device",
"jpeg"
] | 5 | 6 | 1,942 | 2 | 0 | 2011-06-01T12:58:38.053000 | 2011-06-01T13:07:06.343000 |
6,201,518 | 6,203,147 | Fluent NHibernate automap base class overrides | I have the following base class. public abstract class BaseEntity { public virtual long Id { get; set; } public virtual DateTime CreateDate { get; set; } public virtual DateTime? UpdateDate { get; set; } public virtual bool IsDeleted { get; set; } public virtual string CreatedBy { get; set; } } And it's a base class fo... | You can't override a mapping for a base class since that mapping doesn't actually ever get created. If you want to continue using the Automapper you can create a convention public class BaseEntityPropertiesConvention: IPropertyConvention { public void Apply(IPropertyInstance instance) { if (instance.EntityType.IsSubcla... | Fluent NHibernate automap base class overrides I have the following base class. public abstract class BaseEntity { public virtual long Id { get; set; } public virtual DateTime CreateDate { get; set; } public virtual DateTime? UpdateDate { get; set; } public virtual bool IsDeleted { get; set; } public virtual string Cre... | TITLE:
Fluent NHibernate automap base class overrides
QUESTION:
I have the following base class. public abstract class BaseEntity { public virtual long Id { get; set; } public virtual DateTime CreateDate { get; set; } public virtual DateTime? UpdateDate { get; set; } public virtual bool IsDeleted { get; set; } public ... | [
"c#",
".net",
"nhibernate",
"fluent-nhibernate",
"automapping"
] | 2 | 3 | 994 | 1 | 0 | 2011-06-01T12:58:46.900000 | 2011-06-01T14:50:41.433000 |
6,201,519 | 6,201,656 | Is there a standard/common practice for documenting an event handler? | This is something that causes me some pause from time to time. It seems like I need to provide a description for sender and e. Since I cannot think of anything particularly meaningful I'd prefer to delete the two param elements. /// /// Fired when the destination project is updated. /// /// /// private void UpdateDesti... | You might want to use GhostDoc to do all the heavy lifting for you (like the parameters documentation for example) so that you can concentrate on providing meaningful information for the remaining elements (the summary in that case). | Is there a standard/common practice for documenting an event handler? This is something that causes me some pause from time to time. It seems like I need to provide a description for sender and e. Since I cannot think of anything particularly meaningful I'd prefer to delete the two param elements. /// /// Fired when th... | TITLE:
Is there a standard/common practice for documenting an event handler?
QUESTION:
This is something that causes me some pause from time to time. It seems like I need to provide a description for sender and e. Since I cannot think of anything particularly meaningful I'd prefer to delete the two param elements. ///... | [
".net",
"documentation"
] | 1 | 3 | 62 | 1 | 0 | 2011-06-01T12:58:47.870000 | 2011-06-01T13:08:51.263000 |
6,201,525 | 6,202,917 | Silverlight WCF RIA, adding items to EntityList and submitting domaincontext changes | for example i've got a TestItem entity: public class TestItem { [Key] public int Id { get; set; } public string Description { get; set; } } and view model with list, method where we'll add new items to this list, and method where we'll call _TestDomainContext.SubmitChanges EntityList SomeList = new EntityList (_TestDom... | Yes, you have to refresh your client copy of the cache so that the newly added Id fields are there. Just as a proof of concept try the below code: private void AddTestItem() { var key = _TestDomainContext.TestItems.Max(c=> c.Id) + 1; SomeList.Add(new TestItem(){Id = key}); } This will resolve the conflict but is not th... | Silverlight WCF RIA, adding items to EntityList and submitting domaincontext changes for example i've got a TestItem entity: public class TestItem { [Key] public int Id { get; set; } public string Description { get; set; } } and view model with list, method where we'll add new items to this list, and method where we'll... | TITLE:
Silverlight WCF RIA, adding items to EntityList and submitting domaincontext changes
QUESTION:
for example i've got a TestItem entity: public class TestItem { [Key] public int Id { get; set; } public string Description { get; set; } } and view model with list, method where we'll add new items to this list, and ... | [
"silverlight",
"wcf-ria-services"
] | 1 | 2 | 907 | 1 | 0 | 2011-06-01T12:59:13.917000 | 2011-06-01T14:35:52.347000 |
6,201,529 | 6,201,609 | How do I turn a C# object into a JSON string in .NET? | I have classes like these: class MyDate { int year, month, day; }
class Lad { string firstName; string lastName; MyDate dateOfBirth; } And I would like to turn a Lad object into a JSON string like this: { "firstName":"Markoff", "lastName":"Chaney", "dateOfBirth": { "year":"1901", "month":"4", "day":"30" } } (Without t... | Please Note Microsoft recommends that you DO NOT USE JavaScriptSerializer See the header of the documentation page: For.NET Framework 4.7.2 and later versions, use the APIs in the System.Text.Json namespace for serialization and deserialization. For earlier versions of.NET Framework, use Newtonsoft.Json. Original answe... | How do I turn a C# object into a JSON string in .NET? I have classes like these: class MyDate { int year, month, day; }
class Lad { string firstName; string lastName; MyDate dateOfBirth; } And I would like to turn a Lad object into a JSON string like this: { "firstName":"Markoff", "lastName":"Chaney", "dateOfBirth": {... | TITLE:
How do I turn a C# object into a JSON string in .NET?
QUESTION:
I have classes like these: class MyDate { int year, month, day; }
class Lad { string firstName; string lastName; MyDate dateOfBirth; } And I would like to turn a Lad object into a JSON string like this: { "firstName":"Markoff", "lastName":"Chaney"... | [
"c#",
".net",
"json",
"serialization"
] | 1,241 | 1,025 | 2,141,795 | 15 | 0 | 2011-06-01T12:59:21.500000 | 2011-06-01T13:05:38.227000 |
6,201,532 | 6,202,010 | multiple status buttons - background-color | On the order page, there is 3 buttons [New Order] [Processing] [Completed] If I click on the processing button - the background of the button should change. It will also update the order status to the database. [New Order] button will have green background by default. If I click on the [Processing] button, the backgrou... | Use jQuery's css and get/post functions.... HTML: New Order Processing Completed CSS: button.button { background-color:#fff; border:thin solid #000; } button.button:first-child { background-color:green; } JS: $(document).ready(function() { $("button.button").click(function() { $("button.button").css("background-color",... | multiple status buttons - background-color On the order page, there is 3 buttons [New Order] [Processing] [Completed] If I click on the processing button - the background of the button should change. It will also update the order status to the database. [New Order] button will have green background by default. If I cli... | TITLE:
multiple status buttons - background-color
QUESTION:
On the order page, there is 3 buttons [New Order] [Processing] [Completed] If I click on the processing button - the background of the button should change. It will also update the order status to the database. [New Order] button will have green background by... | [
"javascript",
"ajax",
"jquery"
] | 0 | 1 | 248 | 2 | 0 | 2011-06-01T12:59:30.113000 | 2011-06-01T13:33:29.457000 |
6,201,546 | 6,204,192 | Scala StringBuilder | Is there an implicit method to convert scala.collection.mutable.StringBuilder to java.lang.StringBuilder? I am using a Java library (JCommander) in which one of the methods ( usage ) takes a java.jang.StringBuilder argument. | You can't start with a Scala StringBuilder and then obtain the Java version. You can, however, wrap a java.lang.StringBuilder in the Scala version. So: val jsb = new java.lang.StringBuilder(); val sb = new StringBuilder(jsb); // Do Scala-y stuff with sb JCommander.whatever.usage(jsb); // Do more Scala-y stuff Since--no... | Scala StringBuilder Is there an implicit method to convert scala.collection.mutable.StringBuilder to java.lang.StringBuilder? I am using a Java library (JCommander) in which one of the methods ( usage ) takes a java.jang.StringBuilder argument. | TITLE:
Scala StringBuilder
QUESTION:
Is there an implicit method to convert scala.collection.mutable.StringBuilder to java.lang.StringBuilder? I am using a Java library (JCommander) in which one of the methods ( usage ) takes a java.jang.StringBuilder argument.
ANSWER:
You can't start with a Scala StringBuilder and t... | [
"scala",
"stringbuilder",
"implicit-conversion"
] | 11 | 10 | 6,580 | 3 | 0 | 2011-06-01T13:00:18.190000 | 2011-06-01T16:03:15.413000 |
6,201,559 | 6,201,649 | JavaScript function is not working | I have this line in a button click method on my aspx.cs file ClientScript.RegisterStartupScript(this.GetType(), "RefreshOpener", "RefreshParent()", true); I have this code on aspx file function RefreshParent() { window.opener.location.href = window.opener.location.href;
} When I debug th code, it comes to this line Cl... | If the button is placed inside of an UpdatePanel then you'll need to use the ScriptManager.RegisterStartupScript method ( MSDN Link ). Your code should look like: ScriptManager.RegisterStartupScript(this, this.GetType(), "RefreshOpener","RefreshParent()", true); | JavaScript function is not working I have this line in a button click method on my aspx.cs file ClientScript.RegisterStartupScript(this.GetType(), "RefreshOpener", "RefreshParent()", true); I have this code on aspx file function RefreshParent() { window.opener.location.href = window.opener.location.href;
} When I debu... | TITLE:
JavaScript function is not working
QUESTION:
I have this line in a button click method on my aspx.cs file ClientScript.RegisterStartupScript(this.GetType(), "RefreshOpener", "RefreshParent()", true); I have this code on aspx file function RefreshParent() { window.opener.location.href = window.opener.location.hr... | [
"c#",
"javascript",
"asp.net"
] | 2 | 3 | 365 | 2 | 0 | 2011-06-01T13:01:18.600000 | 2011-06-01T13:08:15.560000 |
6,201,576 | 6,218,601 | Is it possible in Javascript to fire an event when someone clicks a flashobject | We use a video player on our site which gives us the following embed code Is it possible to detect when someone clicks on the object to play it? I'd like to capture an event to fire off some other Javascript. Any ideas welcomed. Cheers | You want to use ExternalInterface to call your javascript: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html | Is it possible in Javascript to fire an event when someone clicks a flashobject We use a video player on our site which gives us the following embed code Is it possible to detect when someone clicks on the object to play it? I'd like to capture an event to fire off some other Javascript. Any ideas welcomed. Cheers | TITLE:
Is it possible in Javascript to fire an event when someone clicks a flashobject
QUESTION:
We use a video player on our site which gives us the following embed code Is it possible to detect when someone clicks on the object to play it? I'd like to capture an event to fire off some other Javascript. Any ideas wel... | [
"javascript",
"flash",
"embed"
] | 1 | 1 | 204 | 1 | 0 | 2011-06-01T13:02:55.127000 | 2011-06-02T18:20:26.600000 |
6,201,577 | 6,202,307 | Java: Difference between two lists | My company's cat-herding application tracks a convoy of cats. Periodically, it needs to compare previousOrder to currentOrder (each is an ArrayList ) and notify the cat-wranglers of any changes. Each cat is unique and can only appear once in each list (or not at all). Most of the time, the previousOrder and currentOrde... | Here's an algorithm I put together to merge two lists, old and new. It's not the most elegant or efficient, but it seems to work okay for the data I'm using it for. new is the most updated list of data, and old is the out-of-date list that needs to get transformed into new. The algorithm performs its operations on the ... | Java: Difference between two lists My company's cat-herding application tracks a convoy of cats. Periodically, it needs to compare previousOrder to currentOrder (each is an ArrayList ) and notify the cat-wranglers of any changes. Each cat is unique and can only appear once in each list (or not at all). Most of the time... | TITLE:
Java: Difference between two lists
QUESTION:
My company's cat-herding application tracks a convoy of cats. Periodically, it needs to compare previousOrder to currentOrder (each is an ArrayList ) and notify the cat-wranglers of any changes. Each cat is unique and can only appear once in each list (or not at all)... | [
"java",
"algorithm",
"list",
"edit-distance"
] | 18 | 10 | 8,946 | 5 | 0 | 2011-06-01T13:02:56.540000 | 2011-06-01T13:54:20.383000 |
6,201,584 | 6,201,638 | How to parse quoted as well as unquoted arguments in Perl? | I want my perl script to correctly parse two command line arguments separated by a space into two variables: $ cat 1.pl print "arg1 = >$ARGV[0]<\n"; print "arg2 = >$ARGV[1]<\n"; $ perl 1.pl a b arg1 = >a< arg2 = >b< $ perl 1.pl "a b" arg1 = >a b< arg2 = >< $ Is there a generic way of dealing with this rather than tryin... | The data is passed to Perl by the shell. program a b will send a and b program 'a b' will send a b program "a b" will send a b program a\ b will send a b Perl has, AFAIK, no way of telling the difference between any of the last three. You could split every argument on spaces, and that would get the effect you are descr... | How to parse quoted as well as unquoted arguments in Perl? I want my perl script to correctly parse two command line arguments separated by a space into two variables: $ cat 1.pl print "arg1 = >$ARGV[0]<\n"; print "arg2 = >$ARGV[1]<\n"; $ perl 1.pl a b arg1 = >a< arg2 = >b< $ perl 1.pl "a b" arg1 = >a b< arg2 = >< $ Is... | TITLE:
How to parse quoted as well as unquoted arguments in Perl?
QUESTION:
I want my perl script to correctly parse two command line arguments separated by a space into two variables: $ cat 1.pl print "arg1 = >$ARGV[0]<\n"; print "arg2 = >$ARGV[1]<\n"; $ perl 1.pl a b arg1 = >a< arg2 = >b< $ perl 1.pl "a b" arg1 = >a... | [
"perl",
"command-line"
] | 1 | 10 | 276 | 2 | 0 | 2011-06-01T13:03:26.977000 | 2011-06-01T13:07:33.120000 |
6,201,585 | 6,226,809 | Is it possible to set the column width for a XSSF worksheet using Apache POI API? | I need to generate a MS Excel 2007+ file from my application according to a given pattern provided by management. Most of the work is done, but I have to set the column width to 11,34 centimeters. I tried to use the setColumnWidth(int columnIndex, int width) method, but regardless of the value I provide it does not wor... | Actually, I was mistaken from the very beggining! My (terrible!) bad! Width columns were already being set, but thought not! All it took as a simple "rule of three" and I was set. | Is it possible to set the column width for a XSSF worksheet using Apache POI API? I need to generate a MS Excel 2007+ file from my application according to a given pattern provided by management. Most of the work is done, but I have to set the column width to 11,34 centimeters. I tried to use the setColumnWidth(int col... | TITLE:
Is it possible to set the column width for a XSSF worksheet using Apache POI API?
QUESTION:
I need to generate a MS Excel 2007+ file from my application according to a given pattern provided by management. Most of the work is done, but I have to set the column width to 11,34 centimeters. I tried to use the setC... | [
"apache",
"width",
"apache-poi",
"xssf"
] | 0 | 0 | 7,884 | 2 | 0 | 2011-06-01T13:03:27.147000 | 2011-06-03T11:57:44.983000 |
6,201,595 | 6,201,630 | Using negative lookahead multiple times (or matching multiple characters with ^)? | I want to do something like this: / ]*>(?!<\/script>)*<\/script>/g to match all scripts tag in a html string using javascript. I know this won't work but i can't seem to find any other solutions. The script-tag can either use the src attribute and close it self right after ( ) or can contain the code within the script-... | You were close / ]*>(?:(?!<\/script>).)*<\/script>/g You must have something to eat the actual script body. That's what the. does here. The look-ahead check must occur before every character, so it is wrapped in an extra (non-capturing) group. To capture the script source code in group 1, just add another set of parens... | Using negative lookahead multiple times (or matching multiple characters with ^)? I want to do something like this: / ]*>(?!<\/script>)*<\/script>/g to match all scripts tag in a html string using javascript. I know this won't work but i can't seem to find any other solutions. The script-tag can either use the src attr... | TITLE:
Using negative lookahead multiple times (or matching multiple characters with ^)?
QUESTION:
I want to do something like this: / ]*>(?!<\/script>)*<\/script>/g to match all scripts tag in a html string using javascript. I know this won't work but i can't seem to find any other solutions. The script-tag can eithe... | [
"javascript",
"regex"
] | 3 | 6 | 708 | 2 | 0 | 2011-06-01T13:04:37.600000 | 2011-06-01T13:06:56.083000 |
6,201,596 | 6,201,747 | Facebook app - don't request permission to get users data | I've created a simple Facebook app that doesn't need any data/info from users. When I try to view the app on Facebook, it's requesting permission to access my personal info. I want the app to display without this request, for both logged in and not logged in users. What's the code to do this? Edit with more info: I hav... | Simple solution is to create the app in the developers area, do all the settings to an iframe and create the application path to your website. Now in your website remove all the PHP code related to FACEBOOK GRAPH API and let it be a simple website that is independent of facebook. This will make what you want. | Facebook app - don't request permission to get users data I've created a simple Facebook app that doesn't need any data/info from users. When I try to view the app on Facebook, it's requesting permission to access my personal info. I want the app to display without this request, for both logged in and not logged in use... | TITLE:
Facebook app - don't request permission to get users data
QUESTION:
I've created a simple Facebook app that doesn't need any data/info from users. When I try to view the app on Facebook, it's requesting permission to access my personal info. I want the app to display without this request, for both logged in and... | [
"php",
"facebook"
] | 2 | 3 | 681 | 1 | 0 | 2011-06-01T13:04:46.557000 | 2011-06-01T13:17:06.740000 |
6,201,601 | 6,204,989 | Spring session bean: initialize with values | I've a doubt about Spring session bean. Let me try to explain what I need and what I did. I need to store on a session variable (in that case a Bean) the user_id so, when I need to create some record on db I can keep track of who did what. To do that, for first, I created a bean and, second, I modified my application c... | You mean how to get the user_id into the session bean? Depending on your application this should probably happen right after the user "logged in". Meaning, if you for instance have a login webflow or controller, set the user_id in your session bean within that webflow or controller. So if I understood your context corr... | Spring session bean: initialize with values I've a doubt about Spring session bean. Let me try to explain what I need and what I did. I need to store on a session variable (in that case a Bean) the user_id so, when I need to create some record on db I can keep track of who did what. To do that, for first, I created a b... | TITLE:
Spring session bean: initialize with values
QUESTION:
I've a doubt about Spring session bean. Let me try to explain what I need and what I did. I need to store on a session variable (in that case a Bean) the user_id so, when I need to create some record on db I can keep track of who did what. To do that, for fi... | [
"java",
"spring",
"jakarta-ee"
] | 1 | 1 | 2,759 | 2 | 0 | 2011-06-01T13:05:08.037000 | 2011-06-01T17:04:30.080000 |
6,201,604 | 6,201,681 | Joining 2 MySQL Queries | I finally got all of my queries written (thanks to all who have helped me). The First One: SELECT cards.card_id, concat(cards.title, ' By Amy') AS TitleConcat, cards.meta_description, cards.description, '' as Bob, '' as Weight, '' as UPC, cards.seo_keywords, concat('http://www.amyadele.com/attachments//cards/',cards.ca... | You're joining twice to the card_lookup_values table. You must assign each reference to this table a unique alias to distinguish them. I've used clv1 and clv2 in the snippet below to illustrate.... join card_lookup_values clv1 on clv1.card_id = cards.card_id INNER JOIN card_categories cc ON cards.card_id = cc.card_id A... | Joining 2 MySQL Queries I finally got all of my queries written (thanks to all who have helped me). The First One: SELECT cards.card_id, concat(cards.title, ' By Amy') AS TitleConcat, cards.meta_description, cards.description, '' as Bob, '' as Weight, '' as UPC, cards.seo_keywords, concat('http://www.amyadele.com/attac... | TITLE:
Joining 2 MySQL Queries
QUESTION:
I finally got all of my queries written (thanks to all who have helped me). The First One: SELECT cards.card_id, concat(cards.title, ' By Amy') AS TitleConcat, cards.meta_description, cards.description, '' as Bob, '' as Weight, '' as UPC, cards.seo_keywords, concat('http://www.... | [
"php",
"mysql"
] | 2 | 1 | 82 | 1 | 0 | 2011-06-01T13:05:16.507000 | 2011-06-01T13:11:12.107000 |
6,201,605 | 6,201,642 | Detect which link was clicked? Always returns undefined. What's wrong? | I am trying to detect which of the first 3 links is being clicked on by outputting the links ID. It always returns undefined. What's wrong? ---1--- ---2--- ---3--- normal link | You are not targeting any of the links. window.onload = function() { $("a.a").click(function() { alert(this.id); return false; }); } What this is doing ( $("a.a").click(function(){ ) is looking for any click events on anchors of class name 'a' and run the following anonymous function. | Detect which link was clicked? Always returns undefined. What's wrong? I am trying to detect which of the first 3 links is being clicked on by outputting the links ID. It always returns undefined. What's wrong? ---1--- ---2--- ---3--- normal link | TITLE:
Detect which link was clicked? Always returns undefined. What's wrong?
QUESTION:
I am trying to detect which of the first 3 links is being clicked on by outputting the links ID. It always returns undefined. What's wrong? ---1--- ---2--- ---3--- normal link
ANSWER:
You are not targeting any of the links. window... | [
"javascript",
"jquery"
] | 7 | 13 | 8,896 | 4 | 0 | 2011-06-01T13:05:19.253000 | 2011-06-01T13:07:52.857000 |
6,201,623 | 6,206,404 | Perl: How do you convert this to a subroutine? | The purpose of the subroutine is to check if the word pasttense is in both the other scalars passed in, and then perform a substitution and return that. Original working code: if ($sentences[$i] =~ /\b$pasttense/i and $firstword[1] =~ /\b$pasttense/i) { $subsentences[$i] =~ s/$pasttense/ **$pasttense** /ig; } elsif ($s... | It looks like all your tests and substitutions follow the same pattern. So I converted the if/elsif/ logic chain to data, and process an array of possible tests. use strict; use warnings;
use My::VerbTenseChanger qw( changeVerbForm );
sub suffix_changer_and_highlighter {
my ($presentword, $check1, $check2) = @_; ##s... | Perl: How do you convert this to a subroutine? The purpose of the subroutine is to check if the word pasttense is in both the other scalars passed in, and then perform a substitution and return that. Original working code: if ($sentences[$i] =~ /\b$pasttense/i and $firstword[1] =~ /\b$pasttense/i) { $subsentences[$i] =... | TITLE:
Perl: How do you convert this to a subroutine?
QUESTION:
The purpose of the subroutine is to check if the word pasttense is in both the other scalars passed in, and then perform a substitution and return that. Original working code: if ($sentences[$i] =~ /\b$pasttense/i and $firstword[1] =~ /\b$pasttense/i) { $... | [
"perl"
] | 4 | 1 | 205 | 3 | 0 | 2011-06-01T03:50:17.523000 | 2011-06-01T19:10:10.070000 |
6,201,624 | 6,201,817 | Android copying large inputstream to file very slow | I have an app that is downloading a zip file and then copying this file to a temporary file on the sd card on the phone, but it is being very very slow. InputStream in = new BufferedInputStream(url.openStream(), 1024); File tempFile = File.createTempFile("arc", ".zip", targetDir); //target dir is a file String tempFile... | Donot increase buffer size. That may cause your application MemoryOutOfBoundsException. There are varous factors for which your download will be slow. Weak internet connection, Weak file transfer and receiveing mode is also responsible. It also depend on capacity of device. Check whether you are using following code to... | Android copying large inputstream to file very slow I have an app that is downloading a zip file and then copying this file to a temporary file on the sd card on the phone, but it is being very very slow. InputStream in = new BufferedInputStream(url.openStream(), 1024); File tempFile = File.createTempFile("arc", ".zip"... | TITLE:
Android copying large inputstream to file very slow
QUESTION:
I have an app that is downloading a zip file and then copying this file to a temporary file on the sd card on the phone, but it is being very very slow. InputStream in = new BufferedInputStream(url.openStream(), 1024); File tempFile = File.createTemp... | [
"java",
"android",
"inputstream"
] | 2 | 0 | 2,163 | 1 | 0 | 2011-06-01T13:06:41.410000 | 2011-06-01T13:20:45.240000 |
6,201,629 | 6,201,927 | Mobile Safari and dynamically loading images affects performance | I am developing a web site that is specifically targeted for Mobile Safari. Imagine a camera (the window) which travels around a world (the document) on a random and automatic basis. Within this world we have a series of images. When the camera moves to a part of the world where images are not present, new images are a... | I don't believe so. Each image loaded into the DOM requires memory and processing in order to be rendered. The more image you have loaded in the DOM the more memory the page takes up. Each image that gets rendered and inserted into the DOM requires processing power. | Mobile Safari and dynamically loading images affects performance I am developing a web site that is specifically targeted for Mobile Safari. Imagine a camera (the window) which travels around a world (the document) on a random and automatic basis. Within this world we have a series of images. When the camera moves to a... | TITLE:
Mobile Safari and dynamically loading images affects performance
QUESTION:
I am developing a web site that is specifically targeted for Mobile Safari. Imagine a camera (the window) which travels around a world (the document) on a random and automatic basis. Within this world we have a series of images. When the... | [
"javascript",
"jquery",
"iphone",
"html",
"mobile-safari"
] | 0 | 0 | 418 | 1 | 0 | 2011-06-01T13:06:52.560000 | 2011-06-01T13:28:38.090000 |
6,201,631 | 6,201,666 | Error while running an installed Windows Service on dedicated Server | Error while running an installed Windows Service on dedicated Server I installed my windows service on my virtual dedicated server using the exe file of my windows service. When I try to run my windows service from a virtual dedicated server then I get following error. Service cannot be started. System.InvalidOperation... | Did you supply an app.config for the service.exe? It looks like it's either missing or incorrect from the exception message: Could not find default endpoint element that references contract 'MyService.MyServSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for... | Error while running an installed Windows Service on dedicated Server Error while running an installed Windows Service on dedicated Server I installed my windows service on my virtual dedicated server using the exe file of my windows service. When I try to run my windows service from a virtual dedicated server then I ge... | TITLE:
Error while running an installed Windows Service on dedicated Server
QUESTION:
Error while running an installed Windows Service on dedicated Server I installed my windows service on my virtual dedicated server using the exe file of my windows service. When I try to run my windows service from a virtual dedicate... | [
".net",
".net-3.5",
"service",
"windows-services"
] | 0 | 1 | 393 | 1 | 0 | 2011-06-01T13:07:01.920000 | 2011-06-01T13:09:43.197000 |
6,201,634 | 6,201,955 | Microsoft CRM 4.0 and magic strings | Is there a method/tool/technique for developing with Microsoft CRM 4.0 that keeps the developer from having to use strings for entity names and attributes? | We've built our own model classes and store entity names, attribute names, and picklist values there. It's just a bunch of enums and constant strings, but at least it's using a centralized constant so we can know when something breaks. | Microsoft CRM 4.0 and magic strings Is there a method/tool/technique for developing with Microsoft CRM 4.0 that keeps the developer from having to use strings for entity names and attributes? | TITLE:
Microsoft CRM 4.0 and magic strings
QUESTION:
Is there a method/tool/technique for developing with Microsoft CRM 4.0 that keeps the developer from having to use strings for entity names and attributes?
ANSWER:
We've built our own model classes and store entity names, attribute names, and picklist values there.... | [
"dynamics-crm",
"dynamics-crm-4"
] | 0 | 1 | 132 | 2 | 0 | 2011-06-01T13:07:13.450000 | 2011-06-01T13:30:08.490000 |
6,201,640 | 6,201,773 | Is it possible to run iis6 and iis7 in parallel? | We have a huge amount of webApplications running on IIS6. Because we want to run an MS MVC2 or MVC3 Webapp we have to use IIS7. Migrating these huge amount of IIS6 webapps is way to time intensive for us. is it possible to run IIS6 and IIS7 on one machine? Thanks! | No - it isn't possible to run IIS6 and IIS7 on the same machine. The version of IIS for a machine is dictated by the operating system and cannot be installed standalone. For instance, Windows XP shipped with IIS5.1, Windows 2003 shipped with IIS 6.0, Windows 2008 shipped with IIS7.0 and Windows 2008 R2 shipped with IIS... | Is it possible to run iis6 and iis7 in parallel? We have a huge amount of webApplications running on IIS6. Because we want to run an MS MVC2 or MVC3 Webapp we have to use IIS7. Migrating these huge amount of IIS6 webapps is way to time intensive for us. is it possible to run IIS6 and IIS7 on one machine? Thanks! | TITLE:
Is it possible to run iis6 and iis7 in parallel?
QUESTION:
We have a huge amount of webApplications running on IIS6. Because we want to run an MS MVC2 or MVC3 Webapp we have to use IIS7. Migrating these huge amount of IIS6 webapps is way to time intensive for us. is it possible to run IIS6 and IIS7 on one machi... | [
"asp.net",
"asp.net-mvc",
"iis-7",
"iis-6"
] | 4 | 5 | 6,487 | 4 | 0 | 2011-06-01T13:07:43.377000 | 2011-06-01T13:18:29.687000 |
6,201,646 | 6,201,748 | Good practices for naming interfaces and implementations and placing them into packages | I'm mostly speaking about Java and classical OOP. Say I'm using DAO pattern. So I create interfaces like CustomerDao, AccountDao and others. I would place then into org.example.dao package: org.example.dao.CustomerDao org.example.dao.AccountDao... This all seems good to me so far. Then I create implementations for thes... | There are two camps: functional and technical naming. The one like: org.example.customer org.example.account The other like: org.example.dao org.example.service I personally like to have the interface and the implementations in one spot and make only the interface public and to package by functionality as the packages ... | Good practices for naming interfaces and implementations and placing them into packages I'm mostly speaking about Java and classical OOP. Say I'm using DAO pattern. So I create interfaces like CustomerDao, AccountDao and others. I would place then into org.example.dao package: org.example.dao.CustomerDao org.example.da... | TITLE:
Good practices for naming interfaces and implementations and placing them into packages
QUESTION:
I'm mostly speaking about Java and classical OOP. Say I'm using DAO pattern. So I create interfaces like CustomerDao, AccountDao and others. I would place then into org.example.dao package: org.example.dao.Customer... | [
"java",
"oop",
"coding-style"
] | 2 | 2 | 772 | 4 | 0 | 2011-06-01T13:08:12.900000 | 2011-06-01T13:17:09.423000 |
6,201,652 | 6,202,515 | Failed to create HTML page using GWT plugin for Eclipse | When i create a new GWT (version 2.3) project using the Eclipse (version 3.5) plugin, without enabling sample code, i failed to create a new HTML page by using the GWT->new HTML page. It opens the dialog window, i enter the name of the file and the module, but when i press 'finish', it does nothing! Bug or my mistake? | It is gwt eclipse plugin bug.. Here is the exception; java.lang.NullPointerException at com.google.gdt.eclipse.core.ResourceUtils.getResourceAsString(ResourceUtils.java:655) at com.google.gdt.eclipse.core.ResourceUtils.getResourceAsString(ResourceUtils.java:467) at com.google.gwt.eclipse.core.wizards.NewHostPageWizard.... | Failed to create HTML page using GWT plugin for Eclipse When i create a new GWT (version 2.3) project using the Eclipse (version 3.5) plugin, without enabling sample code, i failed to create a new HTML page by using the GWT->new HTML page. It opens the dialog window, i enter the name of the file and the module, but whe... | TITLE:
Failed to create HTML page using GWT plugin for Eclipse
QUESTION:
When i create a new GWT (version 2.3) project using the Eclipse (version 3.5) plugin, without enabling sample code, i failed to create a new HTML page by using the GWT->new HTML page. It opens the dialog window, i enter the name of the file and t... | [
"gwt",
"eclipse-plugin"
] | 3 | 3 | 1,751 | 3 | 0 | 2011-06-01T13:08:21.233000 | 2011-06-01T14:07:34.530000 |
6,201,654 | 6,207,214 | Create a PDF file from Excel: problem with images | I have an Excel template that I use to create PDF specification sheets for our vendors. I can open, manipulate and export to a PDF file fine except when I insert a picture. This is the code I am using to add one picture workSheet.Shapes.AddPicture(imagePath, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.... | Microsoft is to thank for this one. 6 hours of more or less banging my head against a wall testing on multiple computers with multiple file formats and PDF file tools I find out it is a compatibility issue with Excel 2010. I finally got a spare laptop so I could stop bugging other people to test things on their PCs and... | Create a PDF file from Excel: problem with images I have an Excel template that I use to create PDF specification sheets for our vendors. I can open, manipulate and export to a PDF file fine except when I insert a picture. This is the code I am using to add one picture workSheet.Shapes.AddPicture(imagePath, Microsoft.... | TITLE:
Create a PDF file from Excel: problem with images
QUESTION:
I have an Excel template that I use to create PDF specification sheets for our vendors. I can open, manipulate and export to a PDF file fine except when I insert a picture. This is the code I am using to add one picture workSheet.Shapes.AddPicture(ima... | [
"c#",
"image",
"export-to-pdf"
] | 1 | 3 | 6,979 | 2 | 0 | 2011-06-01T13:08:33.137000 | 2011-06-01T20:27:07.130000 |
6,201,657 | 6,205,075 | What does "Splats" mean in the CoffeeScript tutorial? | Looking at this CoffeeScript tutorial: http://jashkenas.github.com/coffee-script/ I don't quite see what the Splats is for. What is this construction? Where does it come from (historically) | The term "splat operator" comes from Ruby, where the * character (sometimes called the "splat"—see the Jargon File entry ) is used to indicate that an entry in an argument list should "soak up" a list of arguments. CoffeeScript adopted Ruby-style splats very early on (see issue 16 ), but at Douglas Crockford's suggesti... | What does "Splats" mean in the CoffeeScript tutorial? Looking at this CoffeeScript tutorial: http://jashkenas.github.com/coffee-script/ I don't quite see what the Splats is for. What is this construction? Where does it come from (historically) | TITLE:
What does "Splats" mean in the CoffeeScript tutorial?
QUESTION:
Looking at this CoffeeScript tutorial: http://jashkenas.github.com/coffee-script/ I don't quite see what the Splats is for. What is this construction? Where does it come from (historically)
ANSWER:
The term "splat operator" comes from Ruby, where ... | [
"javascript",
"coffeescript"
] | 114 | 199 | 25,758 | 4 | 0 | 2011-06-01T13:08:56.210000 | 2011-06-01T17:10:00.633000 |
6,201,665 | 6,201,728 | How to define an appropriate complex type? | I have this in my xsd: and I want to define complex like: 1 xs:decimal 2 xs:string So if the value for Parameter is decimal to take decimal and if value is not decimal to assume that value is string. How to declare my complex type? | You'll need a complexType together with a choice to express this: Edit: Based on your comments maybe this is worth a try: But JAXB will translate this to String anyway, so there's no benefit from the union, at least with respect to the generated classes. And that you are using JAXB is just a guess. | How to define an appropriate complex type? I have this in my xsd: and I want to define complex like: 1 xs:decimal 2 xs:string So if the value for Parameter is decimal to take decimal and if value is not decimal to assume that value is string. How to declare my complex type? | TITLE:
How to define an appropriate complex type?
QUESTION:
I have this in my xsd: and I want to define complex like: 1 xs:decimal 2 xs:string So if the value for Parameter is decimal to take decimal and if value is not decimal to assume that value is string. How to declare my complex type?
ANSWER:
You'll need a comp... | [
"xsd"
] | 1 | 2 | 114 | 1 | 0 | 2011-06-01T13:09:39.610000 | 2011-06-01T13:15:13.703000 |
6,201,667 | 6,202,934 | Message delivery sequence in akka actors | I'm pretty new to Akka and couldn't find the answer in the reference manual. Suppose we have remote actors distributed in the cluster of 3 machines (A, B, C), where one actor lives on each machine and others have actorRef to 2 others, i.e.: Machine A: A (real actor) -> B (ref) -> C (ref)
Machine B: -> A (ref) B (real ... | For (1) you have the guarantee that msg1 will be enqueued by the dispatcher before msg2. What actually happens once they are enqueued is really dependent on which dispatcher you use: http://akka.io/docs/akka/1.1.2/scala/dispatchers.html, but in your case then so long as B can accept both messages then it will always re... | Message delivery sequence in akka actors I'm pretty new to Akka and couldn't find the answer in the reference manual. Suppose we have remote actors distributed in the cluster of 3 machines (A, B, C), where one actor lives on each machine and others have actorRef to 2 others, i.e.: Machine A: A (real actor) -> B (ref) -... | TITLE:
Message delivery sequence in akka actors
QUESTION:
I'm pretty new to Akka and couldn't find the answer in the reference manual. Suppose we have remote actors distributed in the cluster of 3 machines (A, B, C), where one actor lives on each machine and others have actorRef to 2 others, i.e.: Machine A: A (real a... | [
"scala",
"message",
"actor",
"akka",
"mq"
] | 15 | 9 | 3,016 | 2 | 0 | 2011-06-01T13:09:44.837000 | 2011-06-01T14:36:48.143000 |
6,201,671 | 6,201,688 | MVC 3 Razor, don't show default value | I'm using Html.TextBoxFor(model => model.field) which works fine, however it defaults to 0 for numbers, and to N/A for strings if they are not set, how can i possible change that such it doesn't show anything if the value is not set? | You have to make the values in your model nullable, like so: public class Model { public int? Field { get; set; } } That way an empty value will map to the null value and vice versa. | MVC 3 Razor, don't show default value I'm using Html.TextBoxFor(model => model.field) which works fine, however it defaults to 0 for numbers, and to N/A for strings if they are not set, how can i possible change that such it doesn't show anything if the value is not set? | TITLE:
MVC 3 Razor, don't show default value
QUESTION:
I'm using Html.TextBoxFor(model => model.field) which works fine, however it defaults to 0 for numbers, and to N/A for strings if they are not set, how can i possible change that such it doesn't show anything if the value is not set?
ANSWER:
You have to make the ... | [
"c#",
"asp.net-mvc-3"
] | 6 | 8 | 2,841 | 2 | 0 | 2011-06-01T13:10:03.790000 | 2011-06-01T13:11:45.240000 |
6,201,673 | 6,201,790 | Exception throwing on button click in iphone | I have my interface like. #import @interface HistoryShow: UIViewController {
}
-(IBAction) listTableViewController:(id) sender;
@end and my implementation file is like below. -(IBAction) listTableViewController:(id) sender {
NSLog(@"Loaded");
NSLog(@"FFFFFFFFFFF");
//MyViewController *vewq = [[MyViewController al... | Please Check in your XIB file... and set all IBOutlets properly..... drag button's touchupInside to FilesOwner and select your method.... there is no any problem in your code...... | Exception throwing on button click in iphone I have my interface like. #import @interface HistoryShow: UIViewController {
}
-(IBAction) listTableViewController:(id) sender;
@end and my implementation file is like below. -(IBAction) listTableViewController:(id) sender {
NSLog(@"Loaded");
NSLog(@"FFFFFFFFFFF");
//M... | TITLE:
Exception throwing on button click in iphone
QUESTION:
I have my interface like. #import @interface HistoryShow: UIViewController {
}
-(IBAction) listTableViewController:(id) sender;
@end and my implementation file is like below. -(IBAction) listTableViewController:(id) sender {
NSLog(@"Loaded");
NSLog(@"F... | [
"iphone",
"uiviewcontroller"
] | 1 | 2 | 514 | 2 | 0 | 2011-06-01T13:10:14.447000 | 2011-06-01T13:19:03.410000 |
6,201,676 | 6,201,729 | Iterating through all Textareas with Javascript (jQuery) | I would like to perform something with all my text areas, however selecting all of them with $("textarea") wont do. Here's what I am trying to do in Pseudo code: for each textarea do alert(textarea.val) In my case, I need to do a Word replacement in all of my textareas, so I thought doing it with iteration would be a l... | $(function(){ $("textarea").each(function(){ this.value = this.value.replace("AFFURL",producturl); }); }); See a working demo | Iterating through all Textareas with Javascript (jQuery) I would like to perform something with all my text areas, however selecting all of them with $("textarea") wont do. Here's what I am trying to do in Pseudo code: for each textarea do alert(textarea.val) In my case, I need to do a Word replacement in all of my tex... | TITLE:
Iterating through all Textareas with Javascript (jQuery)
QUESTION:
I would like to perform something with all my text areas, however selecting all of them with $("textarea") wont do. Here's what I am trying to do in Pseudo code: for each textarea do alert(textarea.val) In my case, I need to do a Word replacemen... | [
"jquery",
"html",
"textarea",
"iteration"
] | 13 | 25 | 24,731 | 4 | 0 | 2011-06-01T13:11:02.427000 | 2011-06-01T13:15:14.747000 |
6,201,678 | 6,278,304 | How to convert dates without getting 'String was not recognized as a valid DateTime.'-error? | I'm trying to convert dates for example 30/12/2000 to 2000-12-30 using this code: System.Globalization.CultureInfo enUS = new System.Globalization.CultureInfo("en-US"); DateTime.ParseExact(row.Cells[6].ToString(), "yyyy-MM-dd", enUS); But I'm getting this error: String was not recognized as a valid DateTime. Can someon... | I fixed it by using Convert.ToDateTime(row.Cells[6].Text) See how simple it is. | How to convert dates without getting 'String was not recognized as a valid DateTime.'-error? I'm trying to convert dates for example 30/12/2000 to 2000-12-30 using this code: System.Globalization.CultureInfo enUS = new System.Globalization.CultureInfo("en-US"); DateTime.ParseExact(row.Cells[6].ToString(), "yyyy-MM-dd",... | TITLE:
How to convert dates without getting 'String was not recognized as a valid DateTime.'-error?
QUESTION:
I'm trying to convert dates for example 30/12/2000 to 2000-12-30 using this code: System.Globalization.CultureInfo enUS = new System.Globalization.CultureInfo("en-US"); DateTime.ParseExact(row.Cells[6].ToStrin... | [
"c#",
"asp.net",
"methods"
] | 2 | 0 | 3,180 | 10 | 0 | 2011-06-01T13:11:05.913000 | 2011-06-08T11:54:37.500000 |
6,201,695 | 6,207,597 | Investigating a bad free() pointer reference | My program is crashing badly in an unitary test, due to a free() call to a bad pointer, with this error message: *** glibc detected *** /home/user/main.out: free(): invalid pointer: 0x006d0065 *** The code looks roughly like this: // constructor is MyObj( const std::string & ) // and copies the string in its own std:st... | Ok, finally nailed the bug down. For those interested, it was a structure that wasn't zeroed in the constructor of the class using it. The schema was like this: MyObj ---> BaseClass ---> structure member not initialized Since this structure holds some pointers to strings, the NULL-check was failing and I'd free a bad p... | Investigating a bad free() pointer reference My program is crashing badly in an unitary test, due to a free() call to a bad pointer, with this error message: *** glibc detected *** /home/user/main.out: free(): invalid pointer: 0x006d0065 *** The code looks roughly like this: // constructor is MyObj( const std::string &... | TITLE:
Investigating a bad free() pointer reference
QUESTION:
My program is crashing badly in an unitary test, due to a free() call to a bad pointer, with this error message: *** glibc detected *** /home/user/main.out: free(): invalid pointer: 0x006d0065 *** The code looks roughly like this: // constructor is MyObj( c... | [
"c++",
"gdb",
"free"
] | 1 | 0 | 2,030 | 3 | 0 | 2011-06-01T13:12:01.123000 | 2011-06-01T20:57:31.570000 |
6,201,719 | 6,201,749 | SQL fetch all in a self-join construction | My current database looks like CREATE TABLE sites( siteId INT(11) AUTO_INCREMENT, siteType VARCHAR(255), siteName VARCHAR(255), siteDomain VARCHAR(255), PRIMARY KEY(siteId) ); CREATE TABLE siteSites( parentId INT(11), childId INT(11) ) I'm trying to join all the tables and fetch all data. like: and than i want to get b... | SELECT s1.siteId as ParentSiteId, s1.siteType as ParentType, s1.siteName as ParentName, s1.siteDomain as ParentDomain, s2.siteId as ChildSiteId, s2.siteType as ChildType, s2.siteName as ChildName, s2.siteDomain as ChildDomain FROM sites s1 INNER JOIN siteSites ss ON s1.siteId = ss.parentId INNER JOIN sites s2 ON ss.chi... | SQL fetch all in a self-join construction My current database looks like CREATE TABLE sites( siteId INT(11) AUTO_INCREMENT, siteType VARCHAR(255), siteName VARCHAR(255), siteDomain VARCHAR(255), PRIMARY KEY(siteId) ); CREATE TABLE siteSites( parentId INT(11), childId INT(11) ) I'm trying to join all the tables and fetc... | TITLE:
SQL fetch all in a self-join construction
QUESTION:
My current database looks like CREATE TABLE sites( siteId INT(11) AUTO_INCREMENT, siteType VARCHAR(255), siteName VARCHAR(255), siteDomain VARCHAR(255), PRIMARY KEY(siteId) ); CREATE TABLE siteSites( parentId INT(11), childId INT(11) ) I'm trying to join all t... | [
"php",
"mysql",
"sql"
] | 1 | 4 | 283 | 4 | 0 | 2011-06-01T13:14:20.733000 | 2011-06-01T13:17:11.293000 |
6,201,723 | 6,202,467 | Cancellation of a Task without Providing the Task method with the CancellationTokenSource | I'm trying to provide a functionality of having two Methods one called StartTask(action mymethod) and the other called StopTask(); problem is the action has to have access to the CancellationTokenSource to check for cancellation and exit the method (return) which is not really what i want the method could be in another... | I'm not sure that I entirely understand your question, but I'll take a stab at it. It seems like you're trying to solve two problems at once here. First you're trying to pass parameters to an asynchronous thread and/or cancel that thread (very similar issues). As others have stated BackgroundWorker already handles canc... | Cancellation of a Task without Providing the Task method with the CancellationTokenSource I'm trying to provide a functionality of having two Methods one called StartTask(action mymethod) and the other called StopTask(); problem is the action has to have access to the CancellationTokenSource to check for cancellation a... | TITLE:
Cancellation of a Task without Providing the Task method with the CancellationTokenSource
QUESTION:
I'm trying to provide a functionality of having two Methods one called StartTask(action mymethod) and the other called StopTask(); problem is the action has to have access to the CancellationTokenSource to check ... | [
"c#",
"multithreading",
"parallel-processing"
] | 0 | 0 | 302 | 3 | 0 | 2011-06-01T13:14:44.937000 | 2011-06-01T14:04:12.283000 |
6,201,734 | 6,201,764 | C# stored procedure with parameters | I am receiving an error in my application and i can not figure out how to resolve it. Here is the code: SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString); myConnection.Open();
SqlCommand cmd = new SqlCommand("SELECT ServerIP FROM Servers", myConnect... | My guess is that in myCommand2.Parameters.Add("@TaskName", SqlDbType.NVarChar, 50).Value = t; t is not a string? | C# stored procedure with parameters I am receiving an error in my application and i can not figure out how to resolve it. Here is the code: SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString); myConnection.Open();
SqlCommand cmd = new SqlCommand("SELE... | TITLE:
C# stored procedure with parameters
QUESTION:
I am receiving an error in my application and i can not figure out how to resolve it. Here is the code: SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString); myConnection.Open();
SqlCommand cmd = ne... | [
"c#",
"sql",
"stored-procedures"
] | 19 | 19 | 49,928 | 9 | 0 | 2011-06-01T13:15:46.423000 | 2011-06-01T13:18:03.393000 |
6,201,736 | 6,210,694 | Java:using apache POI how to convert ms word file to pdf? | By using apache POI how to convert ms word file to pdf? I an using the following code but its not working giving errors I guess I am importing the wrong classes? import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream;
import org.apache.poi.hslf.record.Document... | Got It solved import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream;
import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.Paragraph; import com.lowagie.text.pdf.PdfWriter;
import org.apache.poi.hwpf.HWPFDocumen... | Java:using apache POI how to convert ms word file to pdf? By using apache POI how to convert ms word file to pdf? I an using the following code but its not working giving errors I guess I am importing the wrong classes? import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io... | TITLE:
Java:using apache POI how to convert ms word file to pdf?
QUESTION:
By using apache POI how to convert ms word file to pdf? I an using the following code but its not working giving errors I guess I am importing the wrong classes? import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStre... | [
"java",
"itext",
"apache-poi"
] | 32 | 17 | 117,773 | 8 | 0 | 2011-06-01T13:16:02.757000 | 2011-06-02T05:14:26.360000 |
6,201,759 | 6,247,885 | What's the difference between WaitForMultipleObjects and boost::asio on multiple windows::basic_handle's? | I have a list of HANDLE's, controlled by a lot of different IO devices. What would be the (performance) difference between: A call to WaitForMultipleObjects on all these handles async_read on boost::windows::basic_handle's around all these handles Is WaitForMultipleObjects O(n) time complex with n the amount of handles... | since it sounds like the main use you would derive from asio is the fact that it is built on top of IO completion ports (iocp for short). So, let's start with comparing iocp with WaitForMultipleObjects(). These two approaches are essentially the same as select vs. epoll on linux. The main drawback of WaitForMultipleObj... | What's the difference between WaitForMultipleObjects and boost::asio on multiple windows::basic_handle's? I have a list of HANDLE's, controlled by a lot of different IO devices. What would be the (performance) difference between: A call to WaitForMultipleObjects on all these handles async_read on boost::windows::basic_... | TITLE:
What's the difference between WaitForMultipleObjects and boost::asio on multiple windows::basic_handle's?
QUESTION:
I have a list of HANDLE's, controlled by a lot of different IO devices. What would be the (performance) difference between: A call to WaitForMultipleObjects on all these handles async_read on boos... | [
"c++",
"multithreading",
"boost-asio",
"waitformultipleobjects"
] | 5 | 11 | 4,455 | 2 | 0 | 2011-06-01T13:17:46.147000 | 2011-06-06T04:53:35.073000 |
6,201,768 | 6,201,949 | PHP Zend date format | I want to input a timestamp in below format to the database. yyyy-mm-dd hh:mm:ss How can I get in above format? When I use $date = new Zend_Date(); it returns month dd, yyyy hh:mm:ss PM I also use a JavaScript calender to insert a selected date and it returns in dd-mm-yyyy format Now, I want to convert these both forma... | Not sure if this will help you, but try using: // to show both date and time, $date->get('YYYY-MM-dd HH:mm:ss');
// or, to show date only $date->get('YYYY-MM-dd') | PHP Zend date format I want to input a timestamp in below format to the database. yyyy-mm-dd hh:mm:ss How can I get in above format? When I use $date = new Zend_Date(); it returns month dd, yyyy hh:mm:ss PM I also use a JavaScript calender to insert a selected date and it returns in dd-mm-yyyy format Now, I want to con... | TITLE:
PHP Zend date format
QUESTION:
I want to input a timestamp in below format to the database. yyyy-mm-dd hh:mm:ss How can I get in above format? When I use $date = new Zend_Date(); it returns month dd, yyyy hh:mm:ss PM I also use a JavaScript calender to insert a selected date and it returns in dd-mm-yyyy format ... | [
"php",
"zend-framework",
"date",
"zend-date",
"formatdatetime"
] | 14 | 26 | 46,639 | 6 | 0 | 2011-06-01T13:18:11.630000 | 2011-06-01T13:29:47.993000 |
6,201,779 | 6,201,995 | How do you add a new form to an existing c++ project? | I want to add a new form which loads at startup on an existing command line c++ project, how do i go about this? | right click on project->add->New Item->select UI under Visual c++ You have to compile your app as CLR, to use win forms. Then from your exe's startup code, instantiate this form's object and then use objDlg->ShowDialog(). Its pretty much same And clr option may not be compatible with MTd and few others(?) | How do you add a new form to an existing c++ project? I want to add a new form which loads at startup on an existing command line c++ project, how do i go about this? | TITLE:
How do you add a new form to an existing c++ project?
QUESTION:
I want to add a new form which loads at startup on an existing command line c++ project, how do i go about this?
ANSWER:
right click on project->add->New Item->select UI under Visual c++ You have to compile your app as CLR, to use win forms. Then ... | [
"c++",
"visual-studio-2008",
"forms",
"command-line-interface"
] | 0 | 1 | 2,277 | 1 | 0 | 2011-06-01T13:18:47.963000 | 2011-06-01T13:32:59.427000 |
6,201,791 | 6,202,570 | custom template for a textBox that does not behave as I want on IsEnabled = false | my issue is a bit similar to this one: Having an issue with my TextBox control template but I'd like to go a little further: my issue is simple: I have templated controls (labels, textboxes, checkboxes and so on...). Each control has default value that can all be overriden at runtime by setting the control instance's p... | By default, that ScrollViewer is itself templated to look like this: I got that out of the TextBox by using Blend, by the way. I'm betting that if you add your triggers to that ScrollContentPresenter in that template the way you did it to the ContentPresenter in the Label that it'll work for you. | custom template for a textBox that does not behave as I want on IsEnabled = false my issue is a bit similar to this one: Having an issue with my TextBox control template but I'd like to go a little further: my issue is simple: I have templated controls (labels, textboxes, checkboxes and so on...). Each control has defa... | TITLE:
custom template for a textBox that does not behave as I want on IsEnabled = false
QUESTION:
my issue is a bit similar to this one: Having an issue with my TextBox control template but I'd like to go a little further: my issue is simple: I have templated controls (labels, textboxes, checkboxes and so on...). Eac... | [
"wpf",
"xaml",
"templating",
"operator-precedence",
"isenabled"
] | 2 | 4 | 2,937 | 1 | 0 | 2011-06-01T13:19:06.483000 | 2011-06-01T14:10:58.827000 |
6,201,802 | 6,201,858 | GIT Pull deleted my commit | After git pull I have done git reset hard to undo the merge with commit id before merge.Somehow my entire commit is gone and I cant the see the commit in history also. But I have the commit id, on git show command I can see my changes. How can I get back my changes and how to track what mistake I have done | if you have the commit hash, and you have not run garbage collection, you can always go back to that commit with git checkout. if you want to re-apply it on top of your current head, you could do git cherry-pick | GIT Pull deleted my commit After git pull I have done git reset hard to undo the merge with commit id before merge.Somehow my entire commit is gone and I cant the see the commit in history also. But I have the commit id, on git show command I can see my changes. How can I get back my changes and how to track what mista... | TITLE:
GIT Pull deleted my commit
QUESTION:
After git pull I have done git reset hard to undo the merge with commit id before merge.Somehow my entire commit is gone and I cant the see the commit in history also. But I have the commit id, on git show command I can see my changes. How can I get back my changes and how t... | [
"git",
"git-merge",
"git-reset",
"git-commit"
] | 4 | 5 | 1,799 | 1 | 0 | 2011-06-01T13:19:32.400000 | 2011-06-01T13:23:10.607000 |
6,201,807 | 6,202,215 | Are static functions acceptable practice for certain things in c++? | Sometimes, for certain things like writing a line to a console, feels like something that should be globally accessible to all objects. Something like: writeError("UNHANDLED EXCEPTION",someData); Also things such as math functions feel this way too. But how do you draw the line when doing this sort of thing becomes bad... | Some people draw the line at the point where the non-member function needs to be a friend of one of its arguments, so they use a lot of free functions. Some people draw the line at the point where the non-member function could reasonably be a member function of one of its arguments, even though it doesn't actually use ... | Are static functions acceptable practice for certain things in c++? Sometimes, for certain things like writing a line to a console, feels like something that should be globally accessible to all objects. Something like: writeError("UNHANDLED EXCEPTION",someData); Also things such as math functions feel this way too. Bu... | TITLE:
Are static functions acceptable practice for certain things in c++?
QUESTION:
Sometimes, for certain things like writing a line to a console, feels like something that should be globally accessible to all objects. Something like: writeError("UNHANDLED EXCEPTION",someData); Also things such as math functions fee... | [
"c++"
] | 5 | 10 | 2,703 | 3 | 0 | 2011-06-01T13:20:05.830000 | 2011-06-01T13:47:22.820000 |
6,201,808 | 6,202,151 | Set default value in a routing on each request | I have got following routing, which basically enables me to keep the language within the url and makes sure only de and fr (constraint) is possible. In the Default - Routing, I set de as standard if there is no language in the url contained: // Routing with language routes.MapRoute("Default_with_language", "{lang}/{con... | In your Application_BeginRequest handler, you can access the current route and you should be able to change the values using something like this. HttpContext.Current.Request.RequestContext.RouteData.Values.Add("lang", detectedLanguageFromUrl); Hopefully, that's enough to make routing pick up the new value. | Set default value in a routing on each request I have got following routing, which basically enables me to keep the language within the url and makes sure only de and fr (constraint) is possible. In the Default - Routing, I set de as standard if there is no language in the url contained: // Routing with language routes... | TITLE:
Set default value in a routing on each request
QUESTION:
I have got following routing, which basically enables me to keep the language within the url and makes sure only de and fr (constraint) is possible. In the Default - Routing, I set de as standard if there is no language in the url contained: // Routing wi... | [
"c#",
"asp.net-mvc-3",
"routes"
] | 0 | 0 | 270 | 2 | 0 | 2011-06-01T13:20:06.877000 | 2011-06-01T13:43:11.057000 |
6,201,819 | 6,201,847 | call app deletegate methods from subclass app delegates | So i am new to iOS programming. I am using SDK 4.0 and you know when you build a universal project they provide you with app delegates for the full project and two sub class app delegates classes for iphone and ipad. Question is how will i call app delegate method from the sub class app delegate class that is extending... | You can send messages to the parent/super class using super like [super doThisMethod];. If you have to use the ivars or properties declared in the superclass, you can directly refer to them as they were declared in your class - ivar or self.property. But you should read Apple's guide on Objective-C first. It is pretty ... | call app deletegate methods from subclass app delegates So i am new to iOS programming. I am using SDK 4.0 and you know when you build a universal project they provide you with app delegates for the full project and two sub class app delegates classes for iphone and ipad. Question is how will i call app delegate method... | TITLE:
call app deletegate methods from subclass app delegates
QUESTION:
So i am new to iOS programming. I am using SDK 4.0 and you know when you build a universal project they provide you with app delegates for the full project and two sub class app delegates classes for iphone and ipad. Question is how will i call a... | [
"iphone",
"ios",
"ios4"
] | 0 | 1 | 858 | 1 | 0 | 2011-06-01T13:20:49.937000 | 2011-06-01T13:22:34.180000 |
6,201,823 | 6,233,750 | Uva Judge 10149, Yahtzee | UPDATE: I have found the problem that my DP solution didn't handle bonus correctly. I added one more dimension to the state array to represent the sum of the first 6 categories. However, the solution got timed out. It's not badly timeout since each test case can be solved less than 1 sec on my machine. The problem desc... | Here is the working solution. import java.io.FileInputStream; import java.io.IOException; import java.util.Arrays; import java.util.Scanner;
public class P10149 {
static final int MAX_BONUS_SUM = 115;
public static void main(String[] args) throws IOException { Scanner in = new Scanner(new FileInputStream("input.txt"... | Uva Judge 10149, Yahtzee UPDATE: I have found the problem that my DP solution didn't handle bonus correctly. I added one more dimension to the state array to represent the sum of the first 6 categories. However, the solution got timed out. It's not badly timeout since each test case can be solved less than 1 sec on my ... | TITLE:
Uva Judge 10149, Yahtzee
QUESTION:
UPDATE: I have found the problem that my DP solution didn't handle bonus correctly. I added one more dimension to the state array to represent the sum of the first 6 categories. However, the solution got timed out. It's not badly timeout since each test case can be solved less... | [
"algorithm",
"dynamic-programming"
] | 3 | 2 | 1,422 | 2 | 0 | 2011-06-01T13:21:05.217000 | 2011-06-04T00:00:44.413000 |
6,201,833 | 6,211,753 | Converting a fix msg to indivdual attributes | I have a fix msg coming in which I need to extract the invdividual attributes. Is there any Java jars or libs currently out there with added fix functionality. Currently looking over QuickFIX/J This however seems to be more focused on send and receiving the FIX msgs. Has anyone any experience in work with translating a... | Every message class has a set of functions to extract the fields in the message and standard. An example class MassQuote. There are named get methods which return you the field. Else you can use the generic getField to return you the field attribute. In case of groups, first get the number of groups and then iterate ov... | Converting a fix msg to indivdual attributes I have a fix msg coming in which I need to extract the invdividual attributes. Is there any Java jars or libs currently out there with added fix functionality. Currently looking over QuickFIX/J This however seems to be more focused on send and receiving the FIX msgs. Has any... | TITLE:
Converting a fix msg to indivdual attributes
QUESTION:
I have a fix msg coming in which I need to extract the invdividual attributes. Is there any Java jars or libs currently out there with added fix functionality. Currently looking over QuickFIX/J This however seems to be more focused on send and receiving the... | [
"java",
"mapping",
"translation",
"fix-protocol"
] | 1 | 0 | 188 | 2 | 0 | 2011-06-01T13:21:36.927000 | 2011-06-02T07:36:02.643000 |
6,201,838 | 6,206,591 | In NHibernate ID Generator section in mapping files, What is the meaning of assigned and select? | In NHibernate ID Generator section in mapping files, What is the meaning of assigned and select? | There's identity/sequence and assigned. From the NH documentation: 5.1.5.1. generator For databases which support identity columns (DB2, MySQL, Sybase, MS SQL), you may use identity key generation. For databases that support sequences (DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB) you may use sequence style key ge... | In NHibernate ID Generator section in mapping files, What is the meaning of assigned and select? In NHibernate ID Generator section in mapping files, What is the meaning of assigned and select? | TITLE:
In NHibernate ID Generator section in mapping files, What is the meaning of assigned and select?
QUESTION:
In NHibernate ID Generator section in mapping files, What is the meaning of assigned and select?
ANSWER:
There's identity/sequence and assigned. From the NH documentation: 5.1.5.1. generator For databases... | [
"c#",
"nhibernate",
"orm",
"id-generation"
] | 4 | 4 | 5,252 | 2 | 0 | 2011-06-01T13:22:10.277000 | 2011-06-01T19:29:30.640000 |
6,201,854 | 6,202,139 | Android - Unable to fetch contact photo? | i am trying to fetch a contact image using contact id. Here is my code:- public Bitmap getDisplayPhoto(Long id) { Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI,id); InputStream input = Contacts.openContactPhotoInputStream(this.getContentResolver(), uri); if (input == null) { return null; } return BitmapFact... | Are your contacts synced from Facebook? Because those appear to not be accessible. If that's not the case, you may want to try this: InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(this.getContentResolver(), uri); Wasn't sure if you had the import for ContactsContract in place. | Android - Unable to fetch contact photo? i am trying to fetch a contact image using contact id. Here is my code:- public Bitmap getDisplayPhoto(Long id) { Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI,id); InputStream input = Contacts.openContactPhotoInputStream(this.getContentResolver(), uri); if (input ==... | TITLE:
Android - Unable to fetch contact photo?
QUESTION:
i am trying to fetch a contact image using contact id. Here is my code:- public Bitmap getDisplayPhoto(Long id) { Uri uri = ContentUris.withAppendedId(Contacts.CONTENT_URI,id); InputStream input = Contacts.openContactPhotoInputStream(this.getContentResolver(), ... | [
"android",
"image",
"fetch",
"contacts"
] | 1 | 4 | 2,017 | 3 | 0 | 2011-06-01T13:22:53.067000 | 2011-06-01T13:42:08.517000 |
6,201,855 | 6,202,168 | Remove items from Microsoft.VisualBasic.Collection where Key contains string | I have a Microsoft.VisualBasic.Collection where they keys are "123,A" "123,B" Is there a way to remove all keys where they begin with 123? Thanks | Without looping, I doubt it. The.Remove() method only accepts a single key as an argument, nothing like a wildcard sort of thing. | Remove items from Microsoft.VisualBasic.Collection where Key contains string I have a Microsoft.VisualBasic.Collection where they keys are "123,A" "123,B" Is there a way to remove all keys where they begin with 123? Thanks | TITLE:
Remove items from Microsoft.VisualBasic.Collection where Key contains string
QUESTION:
I have a Microsoft.VisualBasic.Collection where they keys are "123,A" "123,B" Is there a way to remove all keys where they begin with 123? Thanks
ANSWER:
Without looping, I doubt it. The.Remove() method only accepts a single... | [
"vb.net",
"collections"
] | 0 | 0 | 471 | 1 | 0 | 2011-06-01T13:23:01.940000 | 2011-06-01T13:44:28.077000 |
6,201,857 | 6,213,397 | MSI Patch Creation Problems | A new version of our product (a software package) has been released recently. To expand functionality, we developed a plugin afterwards. Now we would like to deploy these files (two new files and an updated version of an existing file) as hotfix (or update) with MSI patch (msp). I downloaded a blank PCP file from MSDN ... | The first screen appearing is asking to Repair or Remove the product. This is not what we want. In the upgrade package increase the Product Version. This way you will use a minor upgrade instead of a small update. You can also try using the MSIEXEC command line to apply the patch: http://msdn.microsoft.com/en-us/librar... | MSI Patch Creation Problems A new version of our product (a software package) has been released recently. To expand functionality, we developed a plugin afterwards. Now we would like to deploy these files (two new files and an updated version of an existing file) as hotfix (or update) with MSI patch (msp). I downloaded... | TITLE:
MSI Patch Creation Problems
QUESTION:
A new version of our product (a software package) has been released recently. To expand functionality, we developed a plugin afterwards. Now we would like to deploy these files (two new files and an updated version of an existing file) as hotfix (or update) with MSI patch (... | [
"visual-studio-2010",
"deployment",
"windows-installer",
"setup-project",
"patch"
] | 0 | 0 | 1,073 | 1 | 0 | 2011-06-01T13:23:08.933000 | 2011-06-02T10:36:27.437000 |
6,201,862 | 6,202,001 | LINQ join scoping | Looks like join cannot use sets defined inside query or am I doing something wrong? from a in new[] { new { Id = 1 }, new { Id = 2 } }
let bees = new[] { new { Id = 2 }, new { Id = 3 } }
join b in bees on a.Id equals b.Id
select 1; This one gives compile time error 'Element "bees" does not exist in the current conte... | This is not legal either way you slice it - you cannot declare a range variable "in the middle" of a join - internally the let clause gets translated to a Select() statement with an anonymous type - but you cannot use Select() either in the middle of the join, you have to move it after the join. | LINQ join scoping Looks like join cannot use sets defined inside query or am I doing something wrong? from a in new[] { new { Id = 1 }, new { Id = 2 } }
let bees = new[] { new { Id = 2 }, new { Id = 3 } }
join b in bees on a.Id equals b.Id
select 1; This one gives compile time error 'Element "bees" does not exist in... | TITLE:
LINQ join scoping
QUESTION:
Looks like join cannot use sets defined inside query or am I doing something wrong? from a in new[] { new { Id = 1 }, new { Id = 2 } }
let bees = new[] { new { Id = 2 }, new { Id = 3 } }
join b in bees on a.Id equals b.Id
select 1; This one gives compile time error 'Element "bees"... | [
"linq",
"join"
] | 2 | 2 | 101 | 2 | 0 | 2011-06-01T13:23:18.043000 | 2011-06-01T13:33:10.810000 |
6,201,863 | 6,202,039 | Using virtual inheritance on "final" classes in unfinished class hierarchies | Is there any harm or is it considered bad design to preemptively derive virtually classes in an unfinished class hierarchy that are currently "at the bottom" (i.e., the most derived)? Is there a good reason one would want to wait until there was actually a need for virtual inheritance (i.e., when someone decides to ext... | I would avoid virtual inheritance until actually needed. When you use virtual inheritance you are leaking part of the abstractions that you build on your class, and in particular how you initialize your base class, by forcing the call to the virtual base to the most derived type. | Using virtual inheritance on "final" classes in unfinished class hierarchies Is there any harm or is it considered bad design to preemptively derive virtually classes in an unfinished class hierarchy that are currently "at the bottom" (i.e., the most derived)? Is there a good reason one would want to wait until there w... | TITLE:
Using virtual inheritance on "final" classes in unfinished class hierarchies
QUESTION:
Is there any harm or is it considered bad design to preemptively derive virtually classes in an unfinished class hierarchy that are currently "at the bottom" (i.e., the most derived)? Is there a good reason one would want to ... | [
"c++",
"inheritance",
"multiple-inheritance",
"virtual-inheritance"
] | 3 | 3 | 142 | 2 | 0 | 2011-06-01T13:23:18.773000 | 2011-06-01T13:35:59.147000 |
6,201,864 | 6,211,232 | I cannot center the text of a userdefined Button | I created a Button and I set its UIID to boutonPpal. I set the bgAlign attribute to ALIGN_CENTER in the resource Editor but the text of the Button is not centered at runtime! So how to make the text centered? | bgAlign aligns the background image of a component. Use the "Align" tab if using the latest LWUIT. If you are using 1.4 you need to actually invoke setAlign() on the component since in 1.4 alignment was not a part of the theme. | I cannot center the text of a userdefined Button I created a Button and I set its UIID to boutonPpal. I set the bgAlign attribute to ALIGN_CENTER in the resource Editor but the text of the Button is not centered at runtime! So how to make the text centered? | TITLE:
I cannot center the text of a userdefined Button
QUESTION:
I created a Button and I set its UIID to boutonPpal. I set the bgAlign attribute to ALIGN_CENTER in the resource Editor but the text of the Button is not centered at runtime! So how to make the text centered?
ANSWER:
bgAlign aligns the background image... | [
"java-me",
"lwuit"
] | 0 | 1 | 173 | 1 | 0 | 2011-06-01T13:23:21.440000 | 2011-06-02T06:31:41.193000 |
6,201,874 | 6,209,244 | Session-Per-Request with SqlConnection / System.Transactions | I've just started using Dapper for a project, having mostly used ORMs like NHibernate and EF for the past few years. Typically in our web applications we implement session per request, beginning a transaction at the start of the request and committing it at the end. Should we do something similar when working directly ... | This is what we do: We define a static called DB on an object called Current public static DBContext DB { var result = GetContextItem (itemKey);
if (result == null) { result = InstantiateDB(); SetContextItem(itemKey, result); }
return result; }
public static T GetContextItem (string itemKey, bool strict = true) {
#... | Session-Per-Request with SqlConnection / System.Transactions I've just started using Dapper for a project, having mostly used ORMs like NHibernate and EF for the past few years. Typically in our web applications we implement session per request, beginning a transaction at the start of the request and committing it at t... | TITLE:
Session-Per-Request with SqlConnection / System.Transactions
QUESTION:
I've just started using Dapper for a project, having mostly used ORMs like NHibernate and EF for the past few years. Typically in our web applications we implement session per request, beginning a transaction at the start of the request and ... | [
"sql-server",
"sqlconnection",
"system.transactions",
"dapper"
] | 15 | 10 | 2,225 | 2 | 0 | 2011-06-01T13:24:23.380000 | 2011-06-02T00:33:47.420000 |
6,201,875 | 6,201,915 | get drop down box attributes | In the below i have a a div with employee names and ahave to assign a grade for them,my question is that i have get the empid for all the selected values in getgrade_values function.Using jquery how to get the ids of the drop down box with its value where the values are selected when on click of evaluate function funct... | var select = $('select[name="emp"]') var empId = select.attr('id') alert('empId = '+empId) select.children('option:selected').each(function() { alert('grade selected = ' + $(this).val()) }) DEMO: http://jsfiddle.net/hdTEP/ | get drop down box attributes In the below i have a a div with employee names and ahave to assign a grade for them,my question is that i have get the empid for all the selected values in getgrade_values function.Using jquery how to get the ids of the drop down box with its value where the values are selected when on cli... | TITLE:
get drop down box attributes
QUESTION:
In the below i have a a div with employee names and ahave to assign a grade for them,my question is that i have get the empid for all the selected values in getgrade_values function.Using jquery how to get the ids of the drop down box with its value where the values are se... | [
"javascript",
"jquery",
"jquery-selectors",
"jquery-validate"
] | 0 | 1 | 1,068 | 2 | 0 | 2011-06-01T13:24:26.347000 | 2011-06-01T13:27:47.713000 |
6,201,877 | 6,202,572 | What is difference between "git checkout -f" and "git reset --hard HEAD"? | I need to revert local changes for deployments. (I'd used svn revert for this in old skool SVN days.) And im using git reset --hard HEAD for this. (Also git fetch and git merge origin/$branch --no-ff for syncronizing with upstream branch.) But some articles points git checkout -f for reverting changes. What's key diffe... | The two of them have the exact same effect. I recommend you to choose the solution you're the more comfortable with. But if in this particular case the effect is the same, with different values it would be completely different. Basically (there is more, see linked topics) with a reset you move the current branch and th... | What is difference between "git checkout -f" and "git reset --hard HEAD"? I need to revert local changes for deployments. (I'd used svn revert for this in old skool SVN days.) And im using git reset --hard HEAD for this. (Also git fetch and git merge origin/$branch --no-ff for syncronizing with upstream branch.) But so... | TITLE:
What is difference between "git checkout -f" and "git reset --hard HEAD"?
QUESTION:
I need to revert local changes for deployments. (I'd used svn revert for this in old skool SVN days.) And im using git reset --hard HEAD for this. (Also git fetch and git merge origin/$branch --no-ff for syncronizing with upstre... | [
"git"
] | 92 | 74 | 118,556 | 2 | 0 | 2011-06-01T13:24:37.160000 | 2011-06-01T14:11:07.273000 |
6,201,882 | 6,202,062 | Convert A Char To Keys | I have a special char (/ @) That I want to convert to Keys. I am currently using this: Keys k = (Keys)'/'; And while debugging, I get that k equals to: LButton | RButton | MButton | Back | Space type - System.Windows.Forms.Keys k's keycode was suppose to be 111. NOTE: The code does work for uppercase letters such as: K... | You can't cast from char to Keys. Keys is a flags enumeration that represents which physical keys are pressed on the keyboard. What you are trying might not be a straightforward problem to solve. Who's to say what keyboard the user used and what mapping generates what particular character on the user's keyboard and the... | Convert A Char To Keys I have a special char (/ @) That I want to convert to Keys. I am currently using this: Keys k = (Keys)'/'; And while debugging, I get that k equals to: LButton | RButton | MButton | Back | Space type - System.Windows.Forms.Keys k's keycode was suppose to be 111. NOTE: The code does work for upper... | TITLE:
Convert A Char To Keys
QUESTION:
I have a special char (/ @) That I want to convert to Keys. I am currently using this: Keys k = (Keys)'/'; And while debugging, I get that k equals to: LButton | RButton | MButton | Back | Space type - System.Windows.Forms.Keys k's keycode was suppose to be 111. NOTE: The code d... | [
"c#",
"char",
"key",
"special-characters"
] | 9 | 3 | 21,698 | 6 | 0 | 2011-06-01T13:25:05.063000 | 2011-06-01T13:37:36.257000 |
6,201,883 | 6,201,917 | how to edit a wordpress theme background? | I have wordpress installed on my system. I am using twentyten theme, in the theme directory there is style.css file. In that file I tried body { background-color: red; } but nothing happens, no matter what change in style.css it does not reflects in browser. Please help. | Have you cleared your browser's cache? Often the browser will cache the css files to be more efficient, so any changes you make to it require you to clear the cache. If you're using a windows machine: ctrl + shift + del should bring up the clear cache dialog Edit: it appears that your css was in the @media print sectio... | how to edit a wordpress theme background? I have wordpress installed on my system. I am using twentyten theme, in the theme directory there is style.css file. In that file I tried body { background-color: red; } but nothing happens, no matter what change in style.css it does not reflects in browser. Please help. | TITLE:
how to edit a wordpress theme background?
QUESTION:
I have wordpress installed on my system. I am using twentyten theme, in the theme directory there is style.css file. In that file I tried body { background-color: red; } but nothing happens, no matter what change in style.css it does not reflects in browser. P... | [
"php",
"css",
"wordpress",
"wordpress-theming"
] | 1 | 5 | 370 | 4 | 0 | 2011-06-01T13:25:10.723000 | 2011-06-01T13:28:02.060000 |
6,201,884 | 6,202,304 | How can I change Image on Gridview Runtime? | I have one GridView with 3 Column and 3 Rows I want to change Image when User Click any two Images. for Example I Click First Row 1 and Column 3 Image and Secondly I Click on Row 3 and Column 2 show now i want to change this two Images like Swap the Image How is it Possible? public class MainActivity extends Activity {... | Swaping the images in the GridView is very simple.What you have to do is 1* Store the cliked position,where you want to perform the swaping. 2* By using those two values perform the swap operation on mThumbIds array. 3* Finally invoke the notifyDataSetChanged() method on the Adapter object i.e im.notifyDataSetChanged()... | How can I change Image on Gridview Runtime? I have one GridView with 3 Column and 3 Rows I want to change Image when User Click any two Images. for Example I Click First Row 1 and Column 3 Image and Secondly I Click on Row 3 and Column 2 show now i want to change this two Images like Swap the Image How is it Possible? ... | TITLE:
How can I change Image on Gridview Runtime?
QUESTION:
I have one GridView with 3 Column and 3 Rows I want to change Image when User Click any two Images. for Example I Click First Row 1 and Column 3 Image and Secondly I Click on Row 3 and Column 2 show now i want to change this two Images like Swap the Image Ho... | [
"android"
] | 0 | 4 | 9,522 | 3 | 0 | 2011-06-01T13:25:14.273000 | 2011-06-01T13:54:09.403000 |
6,201,887 | 6,202,318 | transfer value of parameter from one view to other? | i have 2 asp.net mvc views. view1.aspx and view2.aspx. of course they are [HTTPGet] Actions for each view as well Models View1Model.cs and View2Model.cs in view1.aspc I have a hyperlink, by clicking on it I'am landing on view2.aspx. i want to pass some text message from view1 to view2 and display it on view2.aspx. i wa... | You can send a POST to any action by using an HTML form with the url as view2.aspx. Any fields within that form (eg a hidden field) are then sent as POST data and can be accessed via a parameter in the view2 action or can be bound to View2Model. You should use the Html.BeginForm() helper for this. | transfer value of parameter from one view to other? i have 2 asp.net mvc views. view1.aspx and view2.aspx. of course they are [HTTPGet] Actions for each view as well Models View1Model.cs and View2Model.cs in view1.aspc I have a hyperlink, by clicking on it I'am landing on view2.aspx. i want to pass some text message fr... | TITLE:
transfer value of parameter from one view to other?
QUESTION:
i have 2 asp.net mvc views. view1.aspx and view2.aspx. of course they are [HTTPGet] Actions for each view as well Models View1Model.cs and View2Model.cs in view1.aspc I have a hyperlink, by clicking on it I'am landing on view2.aspx. i want to pass so... | [
"c#",
"asp.net-mvc"
] | 2 | 1 | 147 | 2 | 0 | 2011-06-01T13:25:38.243000 | 2011-06-01T13:54:48.940000 |
6,201,889 | 6,202,872 | Component sizing as3 | I have a problem when attempting to size a component in a class a few levels down in my app. The class hierarchy of my app is as follows: ConcretApp.as --> playlistView.as --> PlaylistGateway.as --> PlaylistState.as --> FLVState.as When sizing an image to a width of 650 and height of 350 in ConcretApp.as (the main pare... | I suppose resize() is called twice e.g. function resize() {...do resize super.resize() } | Component sizing as3 I have a problem when attempting to size a component in a class a few levels down in my app. The class hierarchy of my app is as follows: ConcretApp.as --> playlistView.as --> PlaylistGateway.as --> PlaylistState.as --> FLVState.as When sizing an image to a width of 650 and height of 350 in Concret... | TITLE:
Component sizing as3
QUESTION:
I have a problem when attempting to size a component in a class a few levels down in my app. The class hierarchy of my app is as follows: ConcretApp.as --> playlistView.as --> PlaylistGateway.as --> PlaylistState.as --> FLVState.as When sizing an image to a width of 650 and height... | [
"actionscript-3"
] | 1 | 0 | 76 | 1 | 0 | 2011-06-01T13:25:49.303000 | 2011-06-01T14:32:52.410000 |
6,201,895 | 6,264,880 | Update value with join | using Hibernate, I'd like to update a data in the database based on conditions, but I got the following error: "node to traverse cannot be null" Here is my database description: Account: id, email, password Member: id, account, team Team: id, current (and a reference to member => members) Here is my JPA: UPDATE Team t ... | The JPA 2.0 specification in chapter 4 contains details of all supported features in JPQL. This is the definition of the "update" statement: The syntax of these operations is as follows: update_statement::= update_clause [where_clause] update_clause::= UPDATE entity_name [[AS] identification_variable] SET update_item {... | Update value with join using Hibernate, I'd like to update a data in the database based on conditions, but I got the following error: "node to traverse cannot be null" Here is my database description: Account: id, email, password Member: id, account, team Team: id, current (and a reference to member => members) Here is... | TITLE:
Update value with join
QUESTION:
using Hibernate, I'd like to update a data in the database based on conditions, but I got the following error: "node to traverse cannot be null" Here is my database description: Account: id, email, password Member: id, account, team Team: id, current (and a reference to member =... | [
"java",
"hibernate",
"jpa",
"jpql"
] | 16 | 9 | 25,482 | 2 | 0 | 2011-06-01T13:26:19.613000 | 2011-06-07T12:04:50.973000 |
6,201,897 | 6,202,047 | Prevent UAC Dialog | We linked our application with a manifest with requireAdministrator option in c++. This is because the application modifies HKLM registry entries. When we execute the application, Windows displays the following message. Is it possible to make this window do not appear for our application without changing the UAC settin... | The basic answer is no. UAC is designed to prompt you for just this purpose. If you could bypass the UAC for your good application, the same could be true for the bad applications that are out there. Because you are writing to the registry at HKLM, you have to elevate your access. You could move the dialog around a bit... | Prevent UAC Dialog We linked our application with a manifest with requireAdministrator option in c++. This is because the application modifies HKLM registry entries. When we execute the application, Windows displays the following message. Is it possible to make this window do not appear for our application without chan... | TITLE:
Prevent UAC Dialog
QUESTION:
We linked our application with a manifest with requireAdministrator option in c++. This is because the application modifies HKLM registry entries. When we execute the application, Windows displays the following message. Is it possible to make this window do not appear for our applic... | [
"windows",
"windows-7",
"uac"
] | 1 | 6 | 369 | 1 | 0 | 2011-06-01T13:26:21.280000 | 2011-06-01T13:36:27.567000 |
6,201,900 | 6,202,045 | Salesforce SOQL return all partners of single account | I am trying to find all the account that have the same partner. I am new to SOQL and I cannot do a join so I am at a loss. Here is the closest I have gotten: Select Name, Site, Status__c FROM Account WHERE Account.Id = Partner.AccountToId AND Partner.AccountFromId = '0013000000bF5rtABC' This does not work. Perhaps my b... | Below query will return all accounts who are partners with 0013000000bF5rtABC. In salesforce you need to use concept of inner queries to perform join. Select Name, Site, Status__c FROM Account where ID IN (Select AccountToId from Partner where AccountFromId = '0013000000bF5rtABC') | Salesforce SOQL return all partners of single account I am trying to find all the account that have the same partner. I am new to SOQL and I cannot do a join so I am at a loss. Here is the closest I have gotten: Select Name, Site, Status__c FROM Account WHERE Account.Id = Partner.AccountToId AND Partner.AccountFromId =... | TITLE:
Salesforce SOQL return all partners of single account
QUESTION:
I am trying to find all the account that have the same partner. I am new to SOQL and I cannot do a join so I am at a loss. Here is the closest I have gotten: Select Name, Site, Status__c FROM Account WHERE Account.Id = Partner.AccountToId AND Partn... | [
"api",
"salesforce",
"soql"
] | 1 | 3 | 2,231 | 1 | 0 | 2011-06-01T13:26:23.150000 | 2011-06-01T13:36:23.480000 |
6,201,913 | 6,206,767 | Get the full size icons of the Trash can | I am trying to display the icons of the Trash can in my app, both empty and full. I've tried several methods to get the icons, but each time the size is 32x32. Do you know a way to get a full size image? | I assume that you’re getting the trash icon through NSWorkspace, using the kTrashIcon constant from IconsCore.h (if you’re not, this is: NSImage* image = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kTrashIcon)]; …this NSImage contains representations in a number of different sizes. If you wa... | Get the full size icons of the Trash can I am trying to display the icons of the Trash can in my app, both empty and full. I've tried several methods to get the icons, but each time the size is 32x32. Do you know a way to get a full size image? | TITLE:
Get the full size icons of the Trash can
QUESTION:
I am trying to display the icons of the Trash can in my app, both empty and full. I've tried several methods to get the icons, but each time the size is 32x32. Do you know a way to get a full size image?
ANSWER:
I assume that you’re getting the trash icon thro... | [
"objective-c",
"cocoa",
"macos",
"icons",
"recycle-bin"
] | 3 | 6 | 1,206 | 4 | 0 | 2011-06-01T13:27:25.077000 | 2011-06-01T19:45:39.767000 |
6,201,916 | 6,202,262 | MYSQL - Get rows in all the selected categories | I'm trying to write query to a MYSQL database that queries for products that have a relationship with all selected categories Products table product_id | product_name --------------------------------- 1 | product name one 2 | product name two 3 | product three Category table category_id | category_name 1 | category one... | Using 2 JOINs SELECT p.* FROM products p JOIN category_relationship r1 ON r1.product_id = p.product_id JOIN category_relationship r2 ON r2.product_id = p.product_id WHERE r1.category_id = 1 AND r2.category_id = 3 Using GROUP BY SELECT p.* FROM products p JOIN category_relationship r ON r.product_id = p.product_id WHERE... | MYSQL - Get rows in all the selected categories I'm trying to write query to a MYSQL database that queries for products that have a relationship with all selected categories Products table product_id | product_name --------------------------------- 1 | product name one 2 | product name two 3 | product three Category ta... | TITLE:
MYSQL - Get rows in all the selected categories
QUESTION:
I'm trying to write query to a MYSQL database that queries for products that have a relationship with all selected categories Products table product_id | product_name --------------------------------- 1 | product name one 2 | product name two 3 | product... | [
"mysql",
"relational-database"
] | 1 | 2 | 319 | 5 | 0 | 2011-06-01T13:27:54.290000 | 2011-06-01T13:51:11.633000 |
6,201,920 | 6,242,579 | When would you us Ext.application() vs. Ext.Loader.setConfig, .require, and .onReady? | I see that some of the examples included with ExtJS 4 start up via a single call to Ext.application(). Other examples, however, manually call Ext.Loader.setConfig(), Ext.require(), and Ext.onReady() instead. I want to make sure I understand the difference. Am I correct in assuming that: you'd normally use the convenien... | The full application call is used for the Ext MVC approach, and comes with a set of conventions to pre-load additional components, for example the stores and views options in the controller classes. For a better explanation see the Ext documentation on MVC. If you just need to throw a few components on the page, as you... | When would you us Ext.application() vs. Ext.Loader.setConfig, .require, and .onReady? I see that some of the examples included with ExtJS 4 start up via a single call to Ext.application(). Other examples, however, manually call Ext.Loader.setConfig(), Ext.require(), and Ext.onReady() instead. I want to make sure I unde... | TITLE:
When would you us Ext.application() vs. Ext.Loader.setConfig, .require, and .onReady?
QUESTION:
I see that some of the examples included with ExtJS 4 start up via a single call to Ext.application(). Other examples, however, manually call Ext.Loader.setConfig(), Ext.require(), and Ext.onReady() instead. I want t... | [
"extjs4"
] | 6 | 8 | 8,610 | 1 | 0 | 2011-06-01T13:28:07.683000 | 2011-06-05T11:20:52.323000 |
6,201,922 | 6,201,945 | Optimizing the IF condition | AddPatient = {}; if(GenderValue === undefined) { AddPatient.Gender = ' '; } else { AddPatient.Gender = GenderValue; } if(DateOfBirthValue === undefined) { AddPatient.DateOfBirth = ' '; } else { AddPatient.DateOfBirth = DateOfBirthValue; } if(SSNValue === undefined) { AddPatient.SSN = ' '; } else { AddPatient.SSN = SSNV... | You can write AddPatient.Gender = GenderValue || " "; The || operator returns the left-most "truthy" operand, so this will evaluate to " " if GenderValue is "falsy" (such as undefined, false, "", 0, or null ) | Optimizing the IF condition AddPatient = {}; if(GenderValue === undefined) { AddPatient.Gender = ' '; } else { AddPatient.Gender = GenderValue; } if(DateOfBirthValue === undefined) { AddPatient.DateOfBirth = ' '; } else { AddPatient.DateOfBirth = DateOfBirthValue; } if(SSNValue === undefined) { AddPatient.SSN = ' '; } ... | TITLE:
Optimizing the IF condition
QUESTION:
AddPatient = {}; if(GenderValue === undefined) { AddPatient.Gender = ' '; } else { AddPatient.Gender = GenderValue; } if(DateOfBirthValue === undefined) { AddPatient.DateOfBirth = ' '; } else { AddPatient.DateOfBirth = DateOfBirthValue; } if(SSNValue === undefined) { AddPat... | [
"javascript"
] | 3 | 15 | 167 | 4 | 0 | 2011-06-01T13:28:17.207000 | 2011-06-01T13:29:26.790000 |
6,201,924 | 6,202,082 | Swing - calling events from inside panel | I have simple Swing GUI with main window JFrame and its main panel derive from JPanel. The panel has some buttons that can be clicked and generate events. I want these events affect data stored in JFrame because it is my main application - it has some queues for thread, open streams and so on. So how do I make my butto... | To invoke methods in the parent frame you need a reference to the parent frame. So your JPanel's constructor can be declared like this: public MyPanel(MyFrame frame){ super(); this.frame = frame; //the rest of your code } And in the JFrame you invoke this constructor like this: panel = new MyPanel(this);//this refers t... | Swing - calling events from inside panel I have simple Swing GUI with main window JFrame and its main panel derive from JPanel. The panel has some buttons that can be clicked and generate events. I want these events affect data stored in JFrame because it is my main application - it has some queues for thread, open str... | TITLE:
Swing - calling events from inside panel
QUESTION:
I have simple Swing GUI with main window JFrame and its main panel derive from JPanel. The panel has some buttons that can be clicked and generate events. I want these events affect data stored in JFrame because it is my main application - it has some queues fo... | [
"java",
"swing",
"jframe",
"jbutton",
"actionlistener"
] | 5 | 4 | 4,431 | 4 | 0 | 2011-06-01T13:28:19.623000 | 2011-06-01T13:38:40.877000 |
6,201,939 | 6,202,159 | How Connect to remote host from Aptana Studio 3 | I am using CODA from a long time.. now i use aptana studio 3 my Question How Connect to remote host from Aptana Studio 3? thanks | From the Project Explorer, expand the project you want to hook up to a remote site (or just right click and create a new Web project that's empty if you just want to explore a remote site from there). There's a "Connections" node, right click it and select "Add New connection...". A dialog will appear, at bottom you ca... | How Connect to remote host from Aptana Studio 3 I am using CODA from a long time.. now i use aptana studio 3 my Question How Connect to remote host from Aptana Studio 3? thanks | TITLE:
How Connect to remote host from Aptana Studio 3
QUESTION:
I am using CODA from a long time.. now i use aptana studio 3 my Question How Connect to remote host from Aptana Studio 3? thanks
ANSWER:
From the Project Explorer, expand the project you want to hook up to a remote site (or just right click and create a... | [
"ftp",
"aptana"
] | 66 | 113 | 117,925 | 3 | 0 | 2011-06-01T13:29:01.870000 | 2011-06-01T13:43:51.120000 |
6,201,941 | 6,202,955 | how to connect my model to my app | Hey all,(im a beginner in rails) i've created a controller that look like that: class HomeController < ApplicationController
def homepage end
def showmsg @postword = params[:p] end
end the showmsg view looks like that: <%= @postword %> and my homepage view looks like that: <%= form_tag( {:controller => 'home',:actio... | I would argue that you're approach is not very rail's like... so if you're learning rails... you're learning it wrong. Make a Model. Call it "Message": rails generate model Message content:string remember to migrate (hopefully you have your databases setup properly): rake db:migrate Then in your controller, when you po... | how to connect my model to my app Hey all,(im a beginner in rails) i've created a controller that look like that: class HomeController < ApplicationController
def homepage end
def showmsg @postword = params[:p] end
end the showmsg view looks like that: <%= @postword %> and my homepage view looks like that: <%= form_... | TITLE:
how to connect my model to my app
QUESTION:
Hey all,(im a beginner in rails) i've created a controller that look like that: class HomeController < ApplicationController
def homepage end
def showmsg @postword = params[:p] end
end the showmsg view looks like that: <%= @postword %> and my homepage view looks li... | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-3"
] | 1 | 4 | 633 | 3 | 0 | 2011-06-01T13:29:08.947000 | 2011-06-01T14:38:15.843000 |
6,201,942 | 6,202,131 | bash quoted variable substitution in sqlplus + heredoc | must be an easy one. [edit] i am writing a BASH script, using HERE document to redirect some statements to SQL*Plus command-prompt. sqlplus -s user/pw@db > $TMPFILE < of course this doesn't work as there is no substitution within single quotes. so how i go about doing this? i cannot do something like "'%$1%'" because d... | It should work without modification My simple tests works: cat << HERE $BASHPID '$BASHPID' HERE returns 4608 '4608' This is because If word is unquoted, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion. In the latter case, the character sequence \newlin... | bash quoted variable substitution in sqlplus + heredoc must be an easy one. [edit] i am writing a BASH script, using HERE document to redirect some statements to SQL*Plus command-prompt. sqlplus -s user/pw@db > $TMPFILE < of course this doesn't work as there is no substitution within single quotes. so how i go about do... | TITLE:
bash quoted variable substitution in sqlplus + heredoc
QUESTION:
must be an easy one. [edit] i am writing a BASH script, using HERE document to redirect some statements to SQL*Plus command-prompt. sqlplus -s user/pw@db > $TMPFILE < of course this doesn't work as there is no substitution within single quotes. so... | [
"bash",
"variables",
"heredoc"
] | 2 | 3 | 4,008 | 2 | 0 | 2011-06-01T13:29:08.867000 | 2011-06-01T13:41:29.233000 |
6,201,950 | 6,201,973 | asp.net: How to detect iOS/Android? | I've recently launched a web app written in C#/.net 4.0 making extensive use of jQuery & jQuery UI to give the best possible user experience. However some users have reported problems when using the site through an iPhone or Android devices. What is the best accepted method of detecting both iOS and Android? so that I ... | Generically speaking, you should detect the browser server side, and then render the correct templates/viewport to the browser. Check the user agent string sent to the server, by the browser - iOS generally contains the substring, "iPhone" and Android uses "Android" followed by the version number ("Android 2.2") | asp.net: How to detect iOS/Android? I've recently launched a web app written in C#/.net 4.0 making extensive use of jQuery & jQuery UI to give the best possible user experience. However some users have reported problems when using the site through an iPhone or Android devices. What is the best accepted method of detect... | TITLE:
asp.net: How to detect iOS/Android?
QUESTION:
I've recently launched a web app written in C#/.net 4.0 making extensive use of jQuery & jQuery UI to give the best possible user experience. However some users have reported problems when using the site through an iPhone or Android devices. What is the best accepte... | [
"c#",
"asp.net",
"android",
"ios"
] | 12 | 7 | 30,181 | 4 | 0 | 2011-06-01T13:29:51.393000 | 2011-06-01T13:31:23.623000 |
6,201,958 | 6,207,225 | Cocoa: programmatically show the main window after closing it with X | I want to programmatically re-open the main window of my Cocoa application after the user closed it with the X button. I know it's still somewhere in memory but I don't know where. | If you're using the default Cocoa Application template, your app delegate has a reference to the window that's in MainMenu.xib. You can simply call [window makeKeyAndOrderFront:self]; perhaps in an IBAction triggered by a menu item, to reopen the window. Note: be sure that the "Release when closed" and "One shot" boxes... | Cocoa: programmatically show the main window after closing it with X I want to programmatically re-open the main window of my Cocoa application after the user closed it with the X button. I know it's still somewhere in memory but I don't know where. | TITLE:
Cocoa: programmatically show the main window after closing it with X
QUESTION:
I want to programmatically re-open the main window of my Cocoa application after the user closed it with the X button. I know it's still somewhere in memory but I don't know where.
ANSWER:
If you're using the default Cocoa Applicati... | [
"objective-c",
"cocoa",
"macos"
] | 4 | 9 | 3,090 | 2 | 0 | 2011-06-01T13:30:16.790000 | 2011-06-01T20:28:11.500000 |
6,201,960 | 6,202,118 | Multiple UnitOfWorks, ISession and repositories | Do you know a good example somewhere for this? What I would like is the following: using(IUnitOfWork uow = UnitOfWork.Start()) { repositoryA.Add(insanceOfA); repositoryB.Add(instanceOfB);
uow.Commit(); } But this case is too ideal, because what I also want is multiple UnitOfWorks (per presenter in most cases, and this... | What I do, is pass the unitOfWork that should be used to the Repository. To achieve this, you can make sure that you have to pass the UnitOfWork instance that must be used by the repository in the repository's constructor. In order to make it all a bit more user-friendly, you can create extension methods on your UnitOf... | Multiple UnitOfWorks, ISession and repositories Do you know a good example somewhere for this? What I would like is the following: using(IUnitOfWork uow = UnitOfWork.Start()) { repositoryA.Add(insanceOfA); repositoryB.Add(instanceOfB);
uow.Commit(); } But this case is too ideal, because what I also want is multiple Un... | TITLE:
Multiple UnitOfWorks, ISession and repositories
QUESTION:
Do you know a good example somewhere for this? What I would like is the following: using(IUnitOfWork uow = UnitOfWork.Start()) { repositoryA.Add(insanceOfA); repositoryB.Add(instanceOfB);
uow.Commit(); } But this case is too ideal, because what I also w... | [
"nhibernate",
"transactions",
"repository",
"unit-of-work"
] | 0 | 3 | 338 | 1 | 0 | 2011-06-01T13:30:25.943000 | 2011-06-01T13:40:38.987000 |
6,201,964 | 6,203,430 | Rails 3 / jquery / ajax - can i change this to submit one answer instead of the entire form? | I'm grateful to the folks who helped me meander my way through a diagnostic process here. I rewrote the code that i am hoping will continue to work through future versions of jQuery. I am concerned, though, about two things: Have i coded something else that is going to come back and bite me in the tail? Quite a few cli... | I would keep your view as it is, and change the application.js, to be as little obtrusive as possible: $('.submittable').live('change', function() { $.post( $(this).closest('form').attr('href'), $(this).serialize() ); }); EDIT: I didn't see that you want to render the answers afterwards. I'm not sure how to avoid code ... | Rails 3 / jquery / ajax - can i change this to submit one answer instead of the entire form? I'm grateful to the folks who helped me meander my way through a diagnostic process here. I rewrote the code that i am hoping will continue to work through future versions of jQuery. I am concerned, though, about two things: Ha... | TITLE:
Rails 3 / jquery / ajax - can i change this to submit one answer instead of the entire form?
QUESTION:
I'm grateful to the folks who helped me meander my way through a diagnostic process here. I rewrote the code that i am hoping will continue to work through future versions of jQuery. I am concerned, though, ab... | [
"jquery",
"ajax",
"ruby-on-rails-3"
] | 0 | 0 | 405 | 1 | 0 | 2011-06-01T13:30:46.680000 | 2011-06-01T15:11:21.627000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.