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,275,831 | 6,276,143 | pyramid - threadlocal doesn't work inside Response's app_iter | With the following sample code: from webob import Response from paste.httpserver import serve
def test_iter(): from pyramid import threadlocal yield 'current request: %s' % threadlocal.get_current_request()
def hello_world(request): return Response(app_iter=test_iter())
if __name__ == '__main__': from pyramid.config... | According to the Pyramid docs the thread-local stack shouldn't be popped until after app_iter is used (see steps 16 and 18), although I see the same behavior as you when I try to run your example. Since the documentation and behavior conflict one of them is wrong, I recommend filing a bug with the Pyramid folks. | pyramid - threadlocal doesn't work inside Response's app_iter With the following sample code: from webob import Response from paste.httpserver import serve
def test_iter(): from pyramid import threadlocal yield 'current request: %s' % threadlocal.get_current_request()
def hello_world(request): return Response(app_ite... | TITLE:
pyramid - threadlocal doesn't work inside Response's app_iter
QUESTION:
With the following sample code: from webob import Response from paste.httpserver import serve
def test_iter(): from pyramid import threadlocal yield 'current request: %s' % threadlocal.get_current_request()
def hello_world(request): retur... | [
"python",
"pyramid",
"thread-local",
"webob"
] | 0 | 0 | 747 | 2 | 0 | 2011-06-08T08:00:12.030000 | 2011-06-08T08:31:02.010000 |
6,275,837 | 6,275,945 | add namespace using xmlnamespacemanager in C# | I am trying to read the data from XML File. In this elements are prefixed with 'app' and 'gml' text. because of these prefixes I am unable to read the data. For this I am trying to add namespace by using XMLNamespaceManager but not getting. Edit: XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(new StringReader(strR... | Something like: var doc = new XmlDocument(); doc.Load(source); var nsmgr = new XmlNamespaceManager(doc.NameTable); nsmgr.AddNamespace("app", "http://www.weather.gov/forecasts/xml/OGC_services"); var firstPoint = doc.SelectSingleNode("//app:Forecast_Gml2Point", nsmgr); Note that the namespace aliases are merely convenie... | add namespace using xmlnamespacemanager in C# I am trying to read the data from XML File. In this elements are prefixed with 'app' and 'gml' text. because of these prefixes I am unable to read the data. For this I am trying to add namespace by using XMLNamespaceManager but not getting. Edit: XmlDocument xmlDoc = new Xm... | TITLE:
add namespace using xmlnamespacemanager in C#
QUESTION:
I am trying to read the data from XML File. In this elements are prefixed with 'app' and 'gml' text. because of these prefixes I am unable to read the data. For this I am trying to add namespace by using XMLNamespaceManager but not getting. Edit: XmlDocume... | [
"c#",
"asp.net"
] | 14 | 18 | 27,828 | 2 | 0 | 2011-06-08T08:01:04.767000 | 2011-06-08T08:13:55.620000 |
6,275,844 | 6,276,362 | UIImage from NSData works fine on iPad2 but not on iPad1 | I just ran into a very strange issue. I currently developing an application that loads images from a remote host in an asynchronous matter and then displays them. the following code is being performed in a background thread, invoked via performSelectorInBackground NSURL *url = [NSURL URLWithString:[ChannelThumbnailURI ... | I can't see an immediate reason why this would work on an iPad2 and not on an iPad1, try adding some more debug code to see where it goes wrong. NSString* urlString = [ChannelThumbnailURI stringByReplacingOccurrencesOfString:@"{PersonName}" withString:person.Name]; if (urlString == nil) {... } NSURL *url = [NSURL URLWi... | UIImage from NSData works fine on iPad2 but not on iPad1 I just ran into a very strange issue. I currently developing an application that loads images from a remote host in an asynchronous matter and then displays them. the following code is being performed in a background thread, invoked via performSelectorInBackgroun... | TITLE:
UIImage from NSData works fine on iPad2 but not on iPad1
QUESTION:
I just ran into a very strange issue. I currently developing an application that loads images from a remote host in an asynchronous matter and then displays them. the following code is being performed in a background thread, invoked via performS... | [
"ios",
"ipad",
"asynchronous",
"uiimage",
"nsdata"
] | 1 | 0 | 502 | 1 | 0 | 2011-06-08T08:01:41.760000 | 2011-06-08T08:54:40.400000 |
6,275,854 | 6,276,109 | selenium-server-standalone-2.0rc2.jar running on server, how to get started? | I downloaded and excuted via java -jar selenium-server-standalone-2.0rc2.jar.... and selenium remote control is running.... basically, two other people and myself need to run firefox browser tests of our web application. how can 3 people run multiple parallel tests on the selenium rc currently running? Do I need to def... | If there is a chance of more people using the selenium instance, its better you go for Selenium-Grid. Selenium grid will ensure that you don't have to worry about allocation of RCs to different tests. Start one hub and 3 remote controls (RCs) in the grid. All 3 of you can then point to same hubURL in the command which ... | selenium-server-standalone-2.0rc2.jar running on server, how to get started? I downloaded and excuted via java -jar selenium-server-standalone-2.0rc2.jar.... and selenium remote control is running.... basically, two other people and myself need to run firefox browser tests of our web application. how can 3 people run m... | TITLE:
selenium-server-standalone-2.0rc2.jar running on server, how to get started?
QUESTION:
I downloaded and excuted via java -jar selenium-server-standalone-2.0rc2.jar.... and selenium remote control is running.... basically, two other people and myself need to run firefox browser tests of our web application. how ... | [
"selenium"
] | 0 | 2 | 1,313 | 2 | 0 | 2011-06-08T08:02:41.920000 | 2011-06-08T08:27:57.893000 |
6,275,858 | 6,275,876 | Programmatically logging into a site | It might sound silly; but can we programmatically login into a site such as Linkedin by passing our user credentials (userid and password)? I am not talking about using OAuth or other mechanism. Edit: I am using the following code in Page_Load method of an.aspx web page to login into Linkedin but it's not working. I se... | You can login to many sites this way, using scripting. I generally prefer Python with BeautifulSoup, but there are many other possibilities for languages and libraries. The general idea is to locate the code for the form that has the username and password fields, fill them in, then post the form. This works for me on L... | Programmatically logging into a site It might sound silly; but can we programmatically login into a site such as Linkedin by passing our user credentials (userid and password)? I am not talking about using OAuth or other mechanism. Edit: I am using the following code in Page_Load method of an.aspx web page to login int... | TITLE:
Programmatically logging into a site
QUESTION:
It might sound silly; but can we programmatically login into a site such as Linkedin by passing our user credentials (userid and password)? I am not talking about using OAuth or other mechanism. Edit: I am using the following code in Page_Load method of an.aspx web... | [
"asp.net"
] | 1 | 2 | 1,788 | 3 | 0 | 2011-06-08T08:03:05.137000 | 2011-06-08T08:05:41.473000 |
6,275,860 | 6,275,891 | mysql_real_escape_string() -> stripslashes() -> jquery.append() | im letting my users type in texts, then take them to server side php and process them, and if everything goes as it should, i just append the text with jquery without the page having to load all over again. This is the procedure: $post_text = htmlspecialchars(mysql_real_escape_string($_POST['post_text'])); some logic..... | It may be, that on your server and your localhost the magic_quotes_gpc directive is set differently, so your string is double encoded on server side. | mysql_real_escape_string() -> stripslashes() -> jquery.append() im letting my users type in texts, then take them to server side php and process them, and if everything goes as it should, i just append the text with jquery without the page having to load all over again. This is the procedure: $post_text = htmlspecialch... | TITLE:
mysql_real_escape_string() -> stripslashes() -> jquery.append()
QUESTION:
im letting my users type in texts, then take them to server side php and process them, and if everything goes as it should, i just append the text with jquery without the page having to load all over again. This is the procedure: $post_te... | [
"php",
"jquery"
] | 2 | 1 | 817 | 3 | 0 | 2011-06-08T08:03:22.847000 | 2011-06-08T08:07:17.833000 |
6,275,897 | 6,275,925 | Images Z-index, make frame front of images | HTML, CSS gurus:) I'm making image frame over images which changes all time. Sorry for my bad English, I'll try it explain, you can see live demo here: http://jsfiddle.net/thisizmonster/fWUKn/ What I want is silver background frame should cover the slideshow images.Now the frame is behind the Flinstones image. | z-index only works with position:absolute, position:relative or position:fixed. Add one of those to your elements will fix your z-index problem. Greetz, XpertEase | Images Z-index, make frame front of images HTML, CSS gurus:) I'm making image frame over images which changes all time. Sorry for my bad English, I'll try it explain, you can see live demo here: http://jsfiddle.net/thisizmonster/fWUKn/ What I want is silver background frame should cover the slideshow images.Now the fra... | TITLE:
Images Z-index, make frame front of images
QUESTION:
HTML, CSS gurus:) I'm making image frame over images which changes all time. Sorry for my bad English, I'll try it explain, you can see live demo here: http://jsfiddle.net/thisizmonster/fWUKn/ What I want is silver background frame should cover the slideshow ... | [
"jquery",
"html",
"image",
"z-index",
"layer"
] | 2 | 2 | 564 | 2 | 0 | 2011-06-08T08:07:54.770000 | 2011-06-08T08:11:34.440000 |
6,275,915 | 6,275,941 | ASP.NET Authentication sliding expiry time on custom ticket | I am creating my own authentication ticket using the following code: string formsCookieStr = string.Empty; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( 1, // version username, // user name DateTime.Now, // issue time DateTime.Now.AddMinutes(30), // expires false, // Persistence userRoleData // user... | That's configured in the forms section of web.config. The way sliding expiration works is that on each request the ASP.NET engine rewrites the authentication cookie by incrementing the timeout: Note however that enabling sliding expiration is one of the things considered as bad practice in the ASP.NET Security Practice... | ASP.NET Authentication sliding expiry time on custom ticket I am creating my own authentication ticket using the following code: string formsCookieStr = string.Empty; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( 1, // version username, // user name DateTime.Now, // issue time DateTime.Now.AddMinute... | TITLE:
ASP.NET Authentication sliding expiry time on custom ticket
QUESTION:
I am creating my own authentication ticket using the following code: string formsCookieStr = string.Empty; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( 1, // version username, // user name DateTime.Now, // issue time Date... | [
"asp.net",
"forms-authentication"
] | 12 | 10 | 6,567 | 1 | 0 | 2011-06-08T08:10:10.227000 | 2011-06-08T08:13:22.163000 |
6,275,923 | 6,276,127 | How to get values from custom cells with textfield UITableView? | I have created a UITableView which function like this section 0 2 custom cells (First name,last name with UITextFields) section 1 (tap a button on header insert a new cell with textfield + a Button to change the title) section 2 (tap a button on header insert a new cell with textfield + a Button to change the title) se... | You have a datasource for your TableView. This source should be updated automatically everytime you insert a new cell. So if you iterate through the array containing your datasource there should also be the values of the textfield somewhere. If this isn't the case you should think about the way you are adding the new c... | How to get values from custom cells with textfield UITableView? I have created a UITableView which function like this section 0 2 custom cells (First name,last name with UITextFields) section 1 (tap a button on header insert a new cell with textfield + a Button to change the title) section 2 (tap a button on header ins... | TITLE:
How to get values from custom cells with textfield UITableView?
QUESTION:
I have created a UITableView which function like this section 0 2 custom cells (First name,last name with UITextFields) section 1 (tap a button on header insert a new cell with textfield + a Button to change the title) section 2 (tap a bu... | [
"ios4",
"uitableview",
"uitextfield"
] | 0 | 2 | 893 | 2 | 0 | 2011-06-08T08:11:04.790000 | 2011-06-08T08:30:18.297000 |
6,275,928 | 6,276,861 | How to Create Custom Tab In Android Application | thanks advance.. when i create custom tab in android application so no one tab display in main screen how to solve this problem please any one tell me? | you mean that you want to create custom tab for your application.ok now you have two class that is homemyclass.java and myclass.java. At first you declare flowing two line in homemyclass.java private Intent mytab; private static final String TAB_MYCLASS = "myclass"; then you write flowing line into onCreate() function ... | How to Create Custom Tab In Android Application thanks advance.. when i create custom tab in android application so no one tab display in main screen how to solve this problem please any one tell me? | TITLE:
How to Create Custom Tab In Android Application
QUESTION:
thanks advance.. when i create custom tab in android application so no one tab display in main screen how to solve this problem please any one tell me?
ANSWER:
you mean that you want to create custom tab for your application.ok now you have two class th... | [
"android"
] | 3 | 3 | 851 | 1 | 0 | 2011-06-08T08:11:48.073000 | 2011-06-08T09:43:54.660000 |
6,275,931 | 6,275,970 | null variable in Php class | I'm very new in php, so I have a very studid problem. I try to write class that will help me with work with DB. Code here: databaseURL = $dbURL; $this->databaseUName = $dbUserName; $this->databasePWord = $dbPword; $this->databaseName = $dbName; $this->nameOfDbWithWorkers = $nameOfDbWithWorkers; }
function setConnectio... | Because a simple variable is always local (except you make it global using global, but don't get used to this;)). What you are probably looking for is a property. You already defined private $connection, but just with $connection within your methods you don't use it, but you are trying to access an undefined local vari... | null variable in Php class I'm very new in php, so I have a very studid problem. I try to write class that will help me with work with DB. Code here: databaseURL = $dbURL; $this->databaseUName = $dbUserName; $this->databasePWord = $dbPword; $this->databaseName = $dbName; $this->nameOfDbWithWorkers = $nameOfDbWithWorker... | TITLE:
null variable in Php class
QUESTION:
I'm very new in php, so I have a very studid problem. I try to write class that will help me with work with DB. Code here: databaseURL = $dbURL; $this->databaseUName = $dbUserName; $this->databasePWord = $dbPword; $this->databaseName = $dbName; $this->nameOfDbWithWorkers = $... | [
"php",
"oop",
"class",
"scope"
] | 1 | 5 | 2,616 | 2 | 0 | 2011-06-08T08:11:53.980000 | 2011-06-08T08:16:07.640000 |
6,275,934 | 6,275,977 | Should I use ASPX pages in MVC3 ASP.NET in place of view or not? | I am designing a project in MVC3 ASP.NET. This project is a website. Should I use ASPX pages in place of view (CSHTML)? Which one is more efficient way to do view (CSHTML or ASPX)? I'am very fresh in MVC3 ASP.NET. Please suggest me. | You are comparing Razor (cshtml) to WebForms (aspx). Both are view engines so one can replace the other. I find Razor more efficent to work with as it tends to be less markup and it fits nice with HTML. Webforms tends to be alot about tag soup and <% all over the place. Here is a comparison from another SO thread: Webf... | Should I use ASPX pages in MVC3 ASP.NET in place of view or not? I am designing a project in MVC3 ASP.NET. This project is a website. Should I use ASPX pages in place of view (CSHTML)? Which one is more efficient way to do view (CSHTML or ASPX)? I'am very fresh in MVC3 ASP.NET. Please suggest me. | TITLE:
Should I use ASPX pages in MVC3 ASP.NET in place of view or not?
QUESTION:
I am designing a project in MVC3 ASP.NET. This project is a website. Should I use ASPX pages in place of view (CSHTML)? Which one is more efficient way to do view (CSHTML or ASPX)? I'am very fresh in MVC3 ASP.NET. Please suggest me.
ANS... | [
"asp.net-mvc"
] | 1 | 4 | 387 | 3 | 0 | 2011-06-08T08:12:11.430000 | 2011-06-08T08:16:47.730000 |
6,275,937 | 6,276,013 | Find location of oracle_home from java | What would be the best way to find oracle home and tnsnames.ora from java? Actually i am trying to get a list of tns entries and display it in program combobox. | There is no some automatic search. If you want Oracle's JDBC driver to use your tns names, you have to define system property (-D) oracle.net.tns_admin=. I recommend setting it up so you can use it and ojdbc will be use it too (if needed) | Find location of oracle_home from java What would be the best way to find oracle home and tnsnames.ora from java? Actually i am trying to get a list of tns entries and display it in program combobox. | TITLE:
Find location of oracle_home from java
QUESTION:
What would be the best way to find oracle home and tnsnames.ora from java? Actually i am trying to get a list of tns entries and display it in program combobox.
ANSWER:
There is no some automatic search. If you want Oracle's JDBC driver to use your tns names, yo... | [
"java",
"oracle"
] | 3 | 2 | 2,580 | 3 | 0 | 2011-06-08T08:12:46.907000 | 2011-06-08T08:20:26.903000 |
6,275,960 | 6,276,220 | Creating tags/labels for daily builds | I am a release engineer and I just switched to a new company. As my role demands setting up the build process in the new company. We use svn for versioning here. In my previous experience it has been a practice that every build will be accompanied with a tag. While defining the new process here, I tried to validate if ... | Actually, if you are talking about SVN, there is no such concept of TAGS. These are just another logical copies just as branches. And even if you create 'em, the old one's can be deleted anytime. The viz-a-viz concept in Subversion is Revision. When you are building from SVN, each tree (trunk/branch) will have a unique... | Creating tags/labels for daily builds I am a release engineer and I just switched to a new company. As my role demands setting up the build process in the new company. We use svn for versioning here. In my previous experience it has been a practice that every build will be accompanied with a tag. While defining the new... | TITLE:
Creating tags/labels for daily builds
QUESTION:
I am a release engineer and I just switched to a new company. As my role demands setting up the build process in the new company. We use svn for versioning here. In my previous experience it has been a practice that every build will be accompanied with a tag. Whil... | [
"svn",
"version-control",
"tags",
"versioning"
] | 1 | 2 | 258 | 1 | 0 | 2011-06-08T08:15:21.907000 | 2011-06-08T08:39:06.177000 |
6,275,961 | 6,298,708 | Database cleaner wipes out all tables even when using :except option | I'm having an issue with database cleaner on a rails project. I use a sqlite3 database in my test environment, and it has a number of tables containing reference data, populated by the db:test:prepare task, that does not need to be wiped between tests. I have a number of cucumber scenarios tagged with @javascript using... | I was running into a similar error, except I was seeing the problem when running my @javascript scenarios. After much googling, reading and hair-pulling I came across this post I looked in the database_cleaner hook file mentioned there ( cucumber-rails-0.4.0/lib/cucumber/rails/hooks/database_cleaner.rb ) and lo-and-beh... | Database cleaner wipes out all tables even when using :except option I'm having an issue with database cleaner on a rails project. I use a sqlite3 database in my test environment, and it has a number of tables containing reference data, populated by the db:test:prepare task, that does not need to be wiped between tests... | TITLE:
Database cleaner wipes out all tables even when using :except option
QUESTION:
I'm having an issue with database cleaner on a rails project. I use a sqlite3 database in my test environment, and it has a number of tables containing reference data, populated by the db:test:prepare task, that does not need to be w... | [
"ruby-on-rails",
"cucumber",
"capybara"
] | 6 | 7 | 4,323 | 3 | 0 | 2011-06-08T08:15:25.190000 | 2011-06-09T20:14:22.370000 |
6,275,971 | 6,275,989 | Can A C Console App Run On Linux And Windows Both | If I Make A Program In C Without Including Windows.h Header File Will It Run On Linux. I Am Making It In Code Blocks On Windows. | No, they use completely different executable formats. You will need to compile a separate executable for each platform. If you stick to standard C it should compile for either though. | Can A C Console App Run On Linux And Windows Both If I Make A Program In C Without Including Windows.h Header File Will It Run On Linux. I Am Making It In Code Blocks On Windows. | TITLE:
Can A C Console App Run On Linux And Windows Both
QUESTION:
If I Make A Program In C Without Including Windows.h Header File Will It Run On Linux. I Am Making It In Code Blocks On Windows.
ANSWER:
No, they use completely different executable formats. You will need to compile a separate executable for each plat... | [
"c",
"windows",
"linux"
] | 0 | 0 | 233 | 4 | 0 | 2011-06-08T08:16:12.063000 | 2011-06-08T08:18:11.350000 |
6,275,976 | 6,276,918 | jquery widget css overrides my own css | I'm using jquery tabs and a few other jquery widget. Now, inside the tab, all the content is styled according to the jquery CSS. So, the easiest way is just to comment out or change a few of the jquery CSS definitions. But then obviously all the other widgets like autocomplete are not working anymore either. How do oth... | I think the solution is to remove the CSS class file with jquery, like in the example for the buttom tabs: | jquery widget css overrides my own css I'm using jquery tabs and a few other jquery widget. Now, inside the tab, all the content is styled according to the jquery CSS. So, the easiest way is just to comment out or change a few of the jquery CSS definitions. But then obviously all the other widgets like autocomplete are... | TITLE:
jquery widget css overrides my own css
QUESTION:
I'm using jquery tabs and a few other jquery widget. Now, inside the tab, all the content is styled according to the jquery CSS. So, the easiest way is just to comment out or change a few of the jquery CSS definitions. But then obviously all the other widgets lik... | [
"jquery",
"html",
"css"
] | 3 | 0 | 683 | 2 | 0 | 2011-06-08T08:16:36.123000 | 2011-06-08T09:48:07.347000 |
6,275,980 | 6,276,004 | String.Replace ignoring case | I have a string called "hello world" I need to replace the word "world" to "csharp" for this I use: string.Replace("World", "csharp"); but as a result, I don't get the string replaced. The reason is case sensitiveness. The original string contains "world" whereas I'm trying to replace "World". Is there any way to avoid... | You could use a Regex and perform a case insensitive replace: class Program { static void Main() { string input = "hello WoRlD"; string result = Regex.Replace(input, "world", "csharp", RegexOptions.IgnoreCase); Console.WriteLine(result); // prints "hello csharp" } } | String.Replace ignoring case I have a string called "hello world" I need to replace the word "world" to "csharp" for this I use: string.Replace("World", "csharp"); but as a result, I don't get the string replaced. The reason is case sensitiveness. The original string contains "world" whereas I'm trying to replace "Worl... | TITLE:
String.Replace ignoring case
QUESTION:
I have a string called "hello world" I need to replace the word "world" to "csharp" for this I use: string.Replace("World", "csharp"); but as a result, I don't get the string replaced. The reason is case sensitiveness. The original string contains "world" whereas I'm tryin... | [
"c#",
"string"
] | 301 | 396 | 220,040 | 21 | 0 | 2011-06-08T08:17:14.410000 | 2011-06-08T08:19:29.353000 |
6,275,988 | 6,276,395 | Refresh a button's label when clicked | I need to change the text of a Button when clicked, so I used myButton.setText("New Label"), but the view is refresh only when the onClick(View v) function is over. Actually what I need is to change the label when the button is clicked without waiting the end of the function: what I do when the button is clicked takes ... | You might want to set an OnTouchListener and implement the onTouch method. In this method you'll get a MotionEvent and can listen to the MotionEvent.ACTION_DOWN. So you can change the label as soon as the user touches the button. | Refresh a button's label when clicked I need to change the text of a Button when clicked, so I used myButton.setText("New Label"), but the view is refresh only when the onClick(View v) function is over. Actually what I need is to change the label when the button is clicked without waiting the end of the function: what ... | TITLE:
Refresh a button's label when clicked
QUESTION:
I need to change the text of a Button when clicked, so I used myButton.setText("New Label"), but the view is refresh only when the onClick(View v) function is over. Actually what I need is to change the label when the button is clicked without waiting the end of t... | [
"android",
"button",
"onclick"
] | 1 | 4 | 1,429 | 2 | 0 | 2011-06-08T08:18:10.617000 | 2011-06-08T08:57:55.367000 |
6,275,993 | 6,276,328 | Return list of generic implementations possible | I have the following interface: public interface Query { IList GetData(); } I would like to have some service that can return all the queries implementations: public interface IQueryProvider { List > GetAllQueries(); } and then be able to call GetData on one: var queries = provider.GetAllQueries(); var results = querie... | You can't use the open generic type Query<>, except inside typeof(). If you wanted to refer to a set of queries (type not specified) you would need a non-generic API, for example: public interface IQuery { IList GetData(); Type QueryType { get; } } public interface IQuery: IQuery { new IList GetData(); } public interfa... | Return list of generic implementations possible I have the following interface: public interface Query { IList GetData(); } I would like to have some service that can return all the queries implementations: public interface IQueryProvider { List > GetAllQueries(); } and then be able to call GetData on one: var queries ... | TITLE:
Return list of generic implementations possible
QUESTION:
I have the following interface: public interface Query { IList GetData(); } I would like to have some service that can return all the queries implementations: public interface IQueryProvider { List > GetAllQueries(); } and then be able to call GetData on... | [
"c#",
".net",
"generics"
] | 3 | 4 | 133 | 3 | 0 | 2011-06-08T08:18:35.627000 | 2011-06-08T08:50:48.190000 |
6,276,110 | 6,276,151 | MySQL select records 1 hour ago or fresher on datetime column | What where clause can I use to select records that are one hour ago or fresher using a DATETIME timestamp? | Something like this? I assume an DATETIME timestamp is an DATETIME field. SELECT * FROM table WHERE datetimefield >= DATE_SUB(NOW(), INTERVAL 1 HOUR) For more information check MySQL's date/time functions. | MySQL select records 1 hour ago or fresher on datetime column What where clause can I use to select records that are one hour ago or fresher using a DATETIME timestamp? | TITLE:
MySQL select records 1 hour ago or fresher on datetime column
QUESTION:
What where clause can I use to select records that are one hour ago or fresher using a DATETIME timestamp?
ANSWER:
Something like this? I assume an DATETIME timestamp is an DATETIME field. SELECT * FROM table WHERE datetimefield >= DATE_SU... | [
"php",
"mysql",
"html",
"database"
] | 6 | 22 | 15,814 | 1 | 0 | 2011-06-08T08:28:04.377000 | 2011-06-08T08:31:28.707000 |
6,276,111 | 6,276,162 | How can I set a specific positon in a String in Java? | I have a String with name str. str = "hi john"; Now I want to set j char to g. How can I do that? | You can't modify a String directly, but you can either use a StringBuilder: str = "hi john"; StringBuilder sb = new StringBuilder(str); sb.setCharAt(3,'g'); str = sb.toString();.. or convert it to a char[] and back str = "hi john"; char[] chars = str.toCharArray(); chars[3] = 'g'; str = new String(chars); | How can I set a specific positon in a String in Java? I have a String with name str. str = "hi john"; Now I want to set j char to g. How can I do that? | TITLE:
How can I set a specific positon in a String in Java?
QUESTION:
I have a String with name str. str = "hi john"; Now I want to set j char to g. How can I do that?
ANSWER:
You can't modify a String directly, but you can either use a StringBuilder: str = "hi john"; StringBuilder sb = new StringBuilder(str); sb.se... | [
"java",
"string"
] | 4 | 6 | 8,476 | 8 | 0 | 2011-06-08T08:28:06.123000 | 2011-06-08T08:33:40.287000 |
6,276,118 | 6,276,450 | Get Spring MessageContext | How to get Spring MessageContext from Java class? Should I use some @Resource or @Autowire to inject context var to class or, for instance, to use some global context SpringContext or some other in order to get MessageContext. What is approach? | I'd start by reading what the standard method of doing this is and try that: @Resource WebServiceContext wsContext;
@WebMethod public String echoHello(String msg) { MessageContext context = wsContext.getMessageContext();... } That's how to do it on the server side. On the client side, the request and response contexts... | Get Spring MessageContext How to get Spring MessageContext from Java class? Should I use some @Resource or @Autowire to inject context var to class or, for instance, to use some global context SpringContext or some other in order to get MessageContext. What is approach? | TITLE:
Get Spring MessageContext
QUESTION:
How to get Spring MessageContext from Java class? Should I use some @Resource or @Autowire to inject context var to class or, for instance, to use some global context SpringContext or some other in order to get MessageContext. What is approach?
ANSWER:
I'd start by reading w... | [
"spring",
"get",
"message"
] | 4 | 3 | 10,227 | 3 | 0 | 2011-06-08T08:29:15.423000 | 2011-06-08T09:03:10.783000 |
6,276,120 | 6,276,661 | trying to inegrate a spellchecker library in my application | I am using eclipse IDE for web development....I hav e made my application and now i m trying to integrate a spellchecker in my application..and also as per the limitations of my project i have to use a spellchecker that uses jsp...so i surfed net and found a few and downloaded there demo version...now i m trying to int... | I have used Jazzy for web application. You have to these API in your jsp. You can also play with AJAX as well. If you application deployed in single environment and not stable then you have take care of dictionary where Jazzy put words. Because when you add words it will be stored in the file. That kind of difficulty y... | trying to inegrate a spellchecker library in my application I am using eclipse IDE for web development....I hav e made my application and now i m trying to integrate a spellchecker in my application..and also as per the limitations of my project i have to use a spellchecker that uses jsp...so i surfed net and found a f... | TITLE:
trying to inegrate a spellchecker library in my application
QUESTION:
I am using eclipse IDE for web development....I hav e made my application and now i m trying to integrate a spellchecker in my application..and also as per the limitations of my project i have to use a spellchecker that uses jsp...so i surfed... | [
"java",
"javascript",
"eclipse",
"jsp"
] | 2 | 1 | 200 | 1 | 0 | 2011-06-08T08:29:22.720000 | 2011-06-08T09:25:44.843000 |
6,276,122 | 6,278,300 | Can I get the SQL string from a JPA Query object? | May I know how can I get the sql from a JPA query? or let's say, convert the JPA query to a SQL string? Thank you very much! | If you only want to know how your JPQL or Criteria Query gets translated to the SQL dialect of your database you can enable fine grained logging in the persistence xml and then look into your log files. The property name and value depends on your JPA implementation. Here is an example of the relevant part of persistenc... | Can I get the SQL string from a JPA Query object? May I know how can I get the sql from a JPA query? or let's say, convert the JPA query to a SQL string? Thank you very much! | TITLE:
Can I get the SQL string from a JPA Query object?
QUESTION:
May I know how can I get the sql from a JPA query? or let's say, convert the JPA query to a SQL string? Thank you very much!
ANSWER:
If you only want to know how your JPQL or Criteria Query gets translated to the SQL dialect of your database you can e... | [
"sql",
"hibernate",
"jpa",
"logging",
"jpql"
] | 37 | 11 | 69,310 | 9 | 0 | 2011-06-08T08:29:28.470000 | 2011-06-08T11:54:19.310000 |
6,276,123 | 6,276,330 | how to provide tcp/ssl support on the same port | Le'ts say you open a tcp socket on port 80 to handle http request, and a ssl socket on port 443 to deal with https...how can some proxy provide access to both of them on the same port?? I found only this link but it wasn't very useful. Can you provide me an erlang example or suggest me some resources from which i can l... | As outlined in the link you provide, you will need to write your own custom server that sniffs the request and then redirects to the correct protocol accordingly. As http://www.faqs.org/rfcs/rfc2818.html indicates, an HTTP session will start with an Initial Request Line (e.g. GET / ), whereas a TLS session will start w... | how to provide tcp/ssl support on the same port Le'ts say you open a tcp socket on port 80 to handle http request, and a ssl socket on port 443 to deal with https...how can some proxy provide access to both of them on the same port?? I found only this link but it wasn't very useful. Can you provide me an erlang example... | TITLE:
how to provide tcp/ssl support on the same port
QUESTION:
Le'ts say you open a tcp socket on port 80 to handle http request, and a ssl socket on port 443 to deal with https...how can some proxy provide access to both of them on the same port?? I found only this link but it wasn't very useful. Can you provide me... | [
"ssl",
"tcp",
"erlang"
] | 0 | 3 | 1,865 | 2 | 0 | 2011-06-08T08:29:48.773000 | 2011-06-08T08:50:50.450000 |
6,276,130 | 6,276,222 | Java URLConnection to php | How to write this code in php? What i should use? CURL? fsockopen? and what is actually send to server (outputString is a post / get and what its variable name)? URL url = new URL(targetURL); final HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty(... | This is a basic example of a cURL post... Further reading at http://www.php.net/manual/en/function.curl-exec.php has very good examples too. An example for SENDING XML: name '); define('XML_POST_URL', 'http://www.domain.com/build_xml.php');
/** * Initialize handle and set options */ $ch = curl_init(); curl_setopt($ch,... | Java URLConnection to php How to write this code in php? What i should use? CURL? fsockopen? and what is actually send to server (outputString is a post / get and what its variable name)? URL url = new URL(targetURL); final HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST")... | TITLE:
Java URLConnection to php
QUESTION:
How to write this code in php? What i should use? CURL? fsockopen? and what is actually send to server (outputString is a post / get and what its variable name)? URL url = new URL(targetURL); final HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReq... | [
"java",
"php",
"urlconnection"
] | 2 | 1 | 4,583 | 1 | 0 | 2011-06-08T08:30:23.073000 | 2011-06-08T08:39:32.983000 |
6,276,136 | 6,276,176 | I can't get rid of this scrollbar | I have website with a form sliding from the right when you click on a blue button: As you can probably see, the horizontal scrollbar allows visitors to see the sliding form before and after it becomes active. That's the problem, I hope someone can help me solve it. This is the jQuery code I'm using: | add this to css: body{overflow-x:hidden;} if you don't have an organized block of css, just add style="overflow-x:hidden" to your body tag like so: solved.;) | I can't get rid of this scrollbar I have website with a form sliding from the right when you click on a blue button: As you can probably see, the horizontal scrollbar allows visitors to see the sliding form before and after it becomes active. That's the problem, I hope someone can help me solve it. This is the jQuery c... | TITLE:
I can't get rid of this scrollbar
QUESTION:
I have website with a form sliding from the right when you click on a blue button: As you can probably see, the horizontal scrollbar allows visitors to see the sliding form before and after it becomes active. That's the problem, I hope someone can help me solve it. Th... | [
"jquery",
"html",
"css"
] | 2 | 3 | 421 | 2 | 0 | 2011-06-08T08:30:38.080000 | 2011-06-08T08:34:48.690000 |
6,276,137 | 6,276,261 | How to convert DataView,DataRowView to Generic Typed Lists | Is there any possible method than looping, Enumerating the ICollection to convert them respectively to Typed List knowing the columns in the ICollection. I am using.net Framework 2.0, C#2.0. Expected answer would be something like this,a one liner List bills = GetBills(DataView/DataRowView/ICollection); where Bills typ... | Could you do it in one line using a LINQ Select with a lambda? Something along these lines.... List bills = yourDataView.Rows.Select(t => new Bills() {BillNumber = t["BillNumber"], BillDate = t["BillDate"], BilledTo = t["BilledTo"]}).ToList(); | How to convert DataView,DataRowView to Generic Typed Lists Is there any possible method than looping, Enumerating the ICollection to convert them respectively to Typed List knowing the columns in the ICollection. I am using.net Framework 2.0, C#2.0. Expected answer would be something like this,a one liner List bills = ... | TITLE:
How to convert DataView,DataRowView to Generic Typed Lists
QUESTION:
Is there any possible method than looping, Enumerating the ICollection to convert them respectively to Typed List knowing the columns in the ICollection. I am using.net Framework 2.0, C#2.0. Expected answer would be something like this,a one l... | [
"c#",
"asp.net",
"class",
"list",
"generics"
] | 1 | 3 | 13,720 | 2 | 0 | 2011-06-08T08:30:38.713000 | 2011-06-08T08:43:43.017000 |
6,276,152 | 6,277,704 | model size check | I've had some success passing query results to my view. Unfortunately the ASP/Razor code balks in the foreach when the resulting model list has 0 entries. @foreach (var action in (List )ViewData["lemons"]) { @Html.Encode( action.acidity) If there are no entries it says something about a null exception. What is the best... | Try do next: Create additional model (viewmodel) in Models folder (for example LemonsView.cs) and put there: public class LemonList { public IQueryable AllLemons { get; set; } } Create a controller (LemonController.cs) public ActionResult Lemons { var model = new LemonList(); var lemons = db.Lemon; model.AllLemons = le... | model size check I've had some success passing query results to my view. Unfortunately the ASP/Razor code balks in the foreach when the resulting model list has 0 entries. @foreach (var action in (List )ViewData["lemons"]) { @Html.Encode( action.acidity) If there are no entries it says something about a null exception.... | TITLE:
model size check
QUESTION:
I've had some success passing query results to my view. Unfortunately the ASP/Razor code balks in the foreach when the resulting model list has 0 entries. @foreach (var action in (List )ViewData["lemons"]) { @Html.Encode( action.acidity) If there are no entries it says something about... | [
"asp.net",
"entity-framework",
"asp.net-mvc-3",
"razor"
] | 0 | 1 | 780 | 1 | 0 | 2011-06-08T08:31:35.163000 | 2011-06-08T11:02:12.557000 |
6,276,153 | 6,276,168 | Does setting an object to nil flag it for garbage collection | When I set an object = nil, will it be garbage collected or do I have to release it? | The current iOS doesn't support garbage collection, so no. However, if object is a @property of another object and is defined something like: @property (nonatomic, retain) id object; Then calling myObject.object = nil will autorelease the previous value of object. | Does setting an object to nil flag it for garbage collection When I set an object = nil, will it be garbage collected or do I have to release it? | TITLE:
Does setting an object to nil flag it for garbage collection
QUESTION:
When I set an object = nil, will it be garbage collected or do I have to release it?
ANSWER:
The current iOS doesn't support garbage collection, so no. However, if object is a @property of another object and is defined something like: @prop... | [
"iphone",
"objective-c",
"ios",
"garbage-collection"
] | 0 | 1 | 116 | 2 | 0 | 2011-06-08T08:31:42.410000 | 2011-06-08T08:34:00.750000 |
6,276,156 | 6,276,648 | rails3 has_and_belongs_to_many customization | Book has_and_belongs_to_many Students Student has_and_belongs_to_many Books In BooksStudents model I want to add "status" field to store if it is rented, bought..etc. and be able to select for example @student.books.rented or @student.books.where(:books_students=>{:status=>2}) Can I do that with HABTM? | AFAIK no, you will need a has_many:through setup.. class Book < ActiveRecord::Base has_many:books_students has_many:students,:through =>:books_students end
class BooksStudent < ActiveRecord::Base belongs_to:book belongs_to:student end
classStudent < ActiveRecord::Base has_many:books_students has_many:books,:through =... | rails3 has_and_belongs_to_many customization Book has_and_belongs_to_many Students Student has_and_belongs_to_many Books In BooksStudents model I want to add "status" field to store if it is rented, bought..etc. and be able to select for example @student.books.rented or @student.books.where(:books_students=>{:status=>2... | TITLE:
rails3 has_and_belongs_to_many customization
QUESTION:
Book has_and_belongs_to_many Students Student has_and_belongs_to_many Books In BooksStudents model I want to add "status" field to store if it is rented, bought..etc. and be able to select for example @student.books.rented or @student.books.where(:books_stu... | [
"ruby-on-rails",
"ruby-on-rails-3",
"activerecord",
"has-and-belongs-to-many"
] | 2 | 3 | 235 | 1 | 0 | 2011-06-08T08:32:06.733000 | 2011-06-08T09:23:42.437000 |
6,276,158 | 6,280,285 | Unittesting a Save function using MVP pattern and RhinoMock | I am trying to get a better code coverage with my unittests, and recently I switched to using RhinoMock for my Mocking needs. But I have got a question with how to write a specific unit-test, the Save() function. I have an IView interface with several functions to retrieve values from the view (aspx page), examples are... | Instead of testing whether these functions are called (they look more like properties instead of functions, BTW), you should check the results of the Save function. You should treat your test code more like a black box and try not to insert too much of its interior knowledge into your tests. This way your tests will be... | Unittesting a Save function using MVP pattern and RhinoMock I am trying to get a better code coverage with my unittests, and recently I switched to using RhinoMock for my Mocking needs. But I have got a question with how to write a specific unit-test, the Save() function. I have an IView interface with several function... | TITLE:
Unittesting a Save function using MVP pattern and RhinoMock
QUESTION:
I am trying to get a better code coverage with my unittests, and recently I switched to using RhinoMock for my Mocking needs. But I have got a question with how to write a specific unit-test, the Save() function. I have an IView interface wit... | [
"asp.net",
"unit-testing",
"rhino-mocks"
] | 0 | 1 | 170 | 1 | 0 | 2011-06-08T08:32:22.223000 | 2011-06-08T14:22:48.897000 |
6,276,175 | 6,276,410 | Adding methods to custom objects in Javascript | Possible Duplicate: Use of 'prototype' vs. 'this' in Javascript? I went to various websites but not able to understand the difference between the following ways of adding methods to custom objects: Method 1: function circle(radius){ this.radius = radius; this.area = function(){ return 3.14*this.radius*this.radius;} } M... | Here is one way to see the difference: var circle1 = circle(1); var circle2 = circle(1); alert(circle1.area == circle2.area); For Method1 you will see false while Method2 yields in true. That's because in the first case you assign a new closure function to each object created, two objects end up with different area fun... | Adding methods to custom objects in Javascript Possible Duplicate: Use of 'prototype' vs. 'this' in Javascript? I went to various websites but not able to understand the difference between the following ways of adding methods to custom objects: Method 1: function circle(radius){ this.radius = radius; this.area = functi... | TITLE:
Adding methods to custom objects in Javascript
QUESTION:
Possible Duplicate: Use of 'prototype' vs. 'this' in Javascript? I went to various websites but not able to understand the difference between the following ways of adding methods to custom objects: Method 1: function circle(radius){ this.radius = radius; ... | [
"javascript",
"prototype-programming"
] | 13 | 12 | 14,024 | 2 | 0 | 2011-06-08T08:34:34.100000 | 2011-06-08T08:59:36.750000 |
6,276,177 | 6,276,388 | JComboBox: want first entry to be blank entry | I have a jcombobox which values come from a list. I want to first value to be blank from dropdown list. The way I approached it was by putting new object of the list type in first as example shows: final List list = getObjectsList(); list.add(new Object()); But this results in null pointer and if do list.add(null); thi... | Doesn't JComboBox.insertItemAt("", 0); work for you? You need to add validation for the blank entry too | JComboBox: want first entry to be blank entry I have a jcombobox which values come from a list. I want to first value to be blank from dropdown list. The way I approached it was by putting new object of the list type in first as example shows: final List list = getObjectsList(); list.add(new Object()); But this results... | TITLE:
JComboBox: want first entry to be blank entry
QUESTION:
I have a jcombobox which values come from a list. I want to first value to be blank from dropdown list. The way I approached it was by putting new object of the list type in first as example shows: final List list = getObjectsList(); list.add(new Object())... | [
"java",
"swing",
"combobox",
"nullpointerexception",
"jcombobox"
] | 11 | 15 | 37,281 | 3 | 0 | 2011-06-08T08:35:13.250000 | 2011-06-08T08:56:57.480000 |
6,276,197 | 6,276,420 | Delphi to display embedded image in outlook msg | I am reading outlook msg files in Delphi 2010 and displaying the html body of a message in a twebbrowser. It does not however display the embedded image. Hot to display embedded images in outlook message? I am using the imported object library. | Embedded images in HTML mail come with src="cid:xx" attribute where xx is the content ID of the image part ( Content-Type: application/octet-stream; Content-Disposition: inline ) in the multi-part MIME message. You could decode and save that part to a temporary file and fix up the src attribute of the img element to po... | Delphi to display embedded image in outlook msg I am reading outlook msg files in Delphi 2010 and displaying the html body of a message in a twebbrowser. It does not however display the embedded image. Hot to display embedded images in outlook message? I am using the imported object library. | TITLE:
Delphi to display embedded image in outlook msg
QUESTION:
I am reading outlook msg files in Delphi 2010 and displaying the html body of a message in a twebbrowser. It does not however display the embedded image. Hot to display embedded images in outlook message? I am using the imported object library.
ANSWER:
... | [
"delphi",
"outlook",
"outlook-object-model"
] | 2 | 4 | 1,930 | 2 | 0 | 2011-06-08T08:36:25.943000 | 2011-06-08T09:00:36.940000 |
6,276,201 | 6,276,315 | Migrate from Prototype to jQuery (for newbie) | I am using Ruby on Rails 3 and I would like to use jQuery instead of Prototype (this one is what I am using at this time). I read many books, guides and tutorials but I still don't understand how I must use jQuery in my code (maybe it seams that nobody it "really" clear on this matter). Also, I have a lot of code writt... | There are two differents things. They are regular script that you can load the same way as you did with jquery: You put them in your public/javascript directories and include them with <%= javascript_include_tag YourNameFile %> Note that I didn't add the.js. javascript_include_tag will do that for you. Then you have JS... | Migrate from Prototype to jQuery (for newbie) I am using Ruby on Rails 3 and I would like to use jQuery instead of Prototype (this one is what I am using at this time). I read many books, guides and tutorials but I still don't understand how I must use jQuery in my code (maybe it seams that nobody it "really" clear on ... | TITLE:
Migrate from Prototype to jQuery (for newbie)
QUESTION:
I am using Ruby on Rails 3 and I would like to use jQuery instead of Prototype (this one is what I am using at this time). I read many books, guides and tutorials but I still don't understand how I must use jQuery in my code (maybe it seams that nobody it ... | [
"javascript",
"jquery",
"ruby-on-rails",
"ruby",
"prototypejs"
] | 1 | 1 | 636 | 2 | 0 | 2011-06-08T08:36:55.250000 | 2011-06-08T08:49:25.577000 |
6,276,205 | 6,276,373 | Change size of SqueezeBox using javascript | Hi I have this JS CODE function openPopup(url) {
var newElem = new Element( 'div' ); newElem.setAttribute('rel','handler'); newElem.setAttribute('class','modal'); SqueezeBox.setContent( 'adopt', newElem ); SqueezeBox.setContent( 'iframe', url);
} This open a popup with the given URL.I'd like to change the size of the... | Please try SqueezeBox.resize({x: 350, y: 400}); Of course you have to resize your content also, as in SqueezeBox.initialize({ size: {x: 350, y: 400} });
var newElem = new Element( 'div' ); newElem.appendText("Some Text"); newElem.setStyle('border', 'solid 2px black'); newElem.setStyle('width', '300px'); SqueezeBox.set... | Change size of SqueezeBox using javascript Hi I have this JS CODE function openPopup(url) {
var newElem = new Element( 'div' ); newElem.setAttribute('rel','handler'); newElem.setAttribute('class','modal'); SqueezeBox.setContent( 'adopt', newElem ); SqueezeBox.setContent( 'iframe', url);
} This open a popup with the g... | TITLE:
Change size of SqueezeBox using javascript
QUESTION:
Hi I have this JS CODE function openPopup(url) {
var newElem = new Element( 'div' ); newElem.setAttribute('rel','handler'); newElem.setAttribute('class','modal'); SqueezeBox.setContent( 'adopt', newElem ); SqueezeBox.setContent( 'iframe', url);
} This open ... | [
"javascript",
"squeezebox"
] | 0 | 1 | 4,489 | 1 | 0 | 2011-06-08T08:37:14.907000 | 2011-06-08T08:55:40.350000 |
6,276,207 | 6,276,279 | How does jQuery.each() work with associative arrays (objects)? | I have an associative array with two object inside. Running this through $(myassoc).each(), the callback runs only once. Also the callback parameters (index and object) returns 0 and the entire associative array, respectively. One would expect jQuery.each() to run for each element in the array, returning the correct ke... | I think you're looking for jQuery.each() instead of.each() try this: $.each(myassoc, function(index, value){ //your code }); | How does jQuery.each() work with associative arrays (objects)? I have an associative array with two object inside. Running this through $(myassoc).each(), the callback runs only once. Also the callback parameters (index and object) returns 0 and the entire associative array, respectively. One would expect jQuery.each()... | TITLE:
How does jQuery.each() work with associative arrays (objects)?
QUESTION:
I have an associative array with two object inside. Running this through $(myassoc).each(), the callback runs only once. Also the callback parameters (index and object) returns 0 and the entire associative array, respectively. One would ex... | [
"javascript",
"jquery",
"associative-array"
] | 16 | 25 | 30,793 | 4 | 0 | 2011-06-08T08:37:43.300000 | 2011-06-08T08:45:41.260000 |
6,276,237 | 6,276,329 | Would you abstract your LINQ queries into extension methods | On my current project we set ourselves some goals for the code metrics "Maintainability Index" and "Cyclometic Complexity". Maintainability Index should be 60 or higher and Cyclometic Complexity 25 or less. We know that the Maintainability Index of 60 and higher is a pretty high one. We also use a lot of linq to filter... | You shouldn't add classes for the sake of metrics. Any metrics are meant to make your code better but following rules blindly, even the best rules, may in fact harm your code. I don't think it's a good idea to stick to certain Maintainability and Complexity indexes. I believe they are useful for evaluating old code, i.... | Would you abstract your LINQ queries into extension methods On my current project we set ourselves some goals for the code metrics "Maintainability Index" and "Cyclometic Complexity". Maintainability Index should be 60 or higher and Cyclometic Complexity 25 or less. We know that the Maintainability Index of 60 and high... | TITLE:
Would you abstract your LINQ queries into extension methods
QUESTION:
On my current project we set ourselves some goals for the code metrics "Maintainability Index" and "Cyclometic Complexity". Maintainability Index should be 60 or higher and Cyclometic Complexity 25 or less. We know that the Maintainability In... | [
"linq",
"extension-methods",
"abstraction",
"maintainability",
"cyclomatic-complexity"
] | 5 | 5 | 602 | 5 | 0 | 2011-06-08T08:41:05.563000 | 2011-06-08T08:50:50.073000 |
6,276,243 | 6,276,463 | Jquery Ajax problem | I'm having an issue and I'm hoping someone could point me in the right direction. I'm trying to parse an xml file using JQuery's.ajax function this is the code: This code resides in a test.js file $(document).ready(function() { $.ajax({ type: 'GET', url: 'test.xml', dataType: 'xml', success: testIt }); });
function te... | Have a go at Firebug, or the built-in developer tools in Chrome, and take a closer look at the request and results from your ajax call. If success doesn't run, but complete does, it is likely that the call comes back with an error status for some reason (likely because of the details subtenante outlined in his answer )... | Jquery Ajax problem I'm having an issue and I'm hoping someone could point me in the right direction. I'm trying to parse an xml file using JQuery's.ajax function this is the code: This code resides in a test.js file $(document).ready(function() { $.ajax({ type: 'GET', url: 'test.xml', dataType: 'xml', success: testIt ... | TITLE:
Jquery Ajax problem
QUESTION:
I'm having an issue and I'm hoping someone could point me in the right direction. I'm trying to parse an xml file using JQuery's.ajax function this is the code: This code resides in a test.js file $(document).ready(function() { $.ajax({ type: 'GET', url: 'test.xml', dataType: 'xml'... | [
"xml",
"ajax",
"jquery"
] | 2 | 0 | 225 | 1 | 0 | 2011-06-08T08:41:48.543000 | 2011-06-08T09:04:18.303000 |
6,276,245 | 6,276,532 | jQuery Lint errors are quite non-descriptive | I want to use jQuery Lint to check for possible jQuery errors. I wanted to try it out on a simple script that works. I included jquery lint all right, set it to level 2 and BAM there was 3 errors. jQuery(.highlightimage) special check failed
jquery.lint.js (line 100)
More info:
Selector:.highlightimage Selectors sho... | The source code at https://github.com/jamespadolsey/jQuery-Lint/blob/551c2106ac0daee95a670fb180610d09e58bb4cc/jquery.lint.js#L711 says: // Find class only-selectors (poor IE6-8 performance) So I guess that's the reason for the warning. If you want to use a class-only selector then I would have thought that you're OK to... | jQuery Lint errors are quite non-descriptive I want to use jQuery Lint to check for possible jQuery errors. I wanted to try it out on a simple script that works. I included jquery lint all right, set it to level 2 and BAM there was 3 errors. jQuery(.highlightimage) special check failed
jquery.lint.js (line 100)
More ... | TITLE:
jQuery Lint errors are quite non-descriptive
QUESTION:
I want to use jQuery Lint to check for possible jQuery errors. I wanted to try it out on a simple script that works. I included jquery lint all right, set it to level 2 and BAM there was 3 errors. jQuery(.highlightimage) special check failed
jquery.lint.js... | [
"javascript",
"jquery",
"jquery-lint"
] | 1 | 3 | 1,459 | 1 | 0 | 2011-06-08T08:41:54.397000 | 2011-06-08T09:10:28.570000 |
6,276,250 | 6,276,339 | If Exists in trigger | Is there a way I can check if a value exists in a table I want to insert into activated by a trigger? If the value does exist, I want nothing to be done and if it doesn't I would like it to be inserted. This is my current trigger ALTER TRIGGER [dbo].[Update] On [dbo].[A] AFTER UPDATE AS Declare @Id int; SELECT @Id = Is... | inserted can contain multiple rows. And left join can be your friend for testing for whether rows already exist: ALTER TRIGGER [dbo].[Update] On [dbo].[A] AFTER UPDATE AS
INSERT INTO dbo.[B] (id, problem) SELECT BugId, ProjectID FROM dbo.[C] inner join inserted i on c.BugID = i.Issue left join dbo.B on B.ID = c.BugID ... | If Exists in trigger Is there a way I can check if a value exists in a table I want to insert into activated by a trigger? If the value does exist, I want nothing to be done and if it doesn't I would like it to be inserted. This is my current trigger ALTER TRIGGER [dbo].[Update] On [dbo].[A] AFTER UPDATE AS Declare @Id... | TITLE:
If Exists in trigger
QUESTION:
Is there a way I can check if a value exists in a table I want to insert into activated by a trigger? If the value does exist, I want nothing to be done and if it doesn't I would like it to be inserted. This is my current trigger ALTER TRIGGER [dbo].[Update] On [dbo].[A] AFTER UPD... | [
"sql-server",
"triggers",
"exists"
] | 0 | 1 | 3,764 | 2 | 0 | 2011-06-08T08:42:18.843000 | 2011-06-08T08:51:49.220000 |
6,276,251 | 6,276,858 | Returning c++ pointers to perl | I have a function in C++ such as: void* getField(interface* p) { int* temp = new int( p->intValue); cout<< "pointer value in c++" << temp << "value of temp = " << temp << endl; return temp; } I am using SWIG to generate wrappers for the above class. Now I am trying to get the returned pointer value in Perl. How do i do... | Because you printed one in decimal and one in hexadecimal: printf "pointer is 0x%x\n", $$b; # prints "pointer is 0x5b1b90" Perl doesn't normally use pointers. The pack and unpack functions can deal with pointers (see Packing and Unpacking C Structures ), but the normal Perl idiom would be to have the function return an... | Returning c++ pointers to perl I have a function in C++ such as: void* getField(interface* p) { int* temp = new int( p->intValue); cout<< "pointer value in c++" << temp << "value of temp = " << temp << endl; return temp; } I am using SWIG to generate wrappers for the above class. Now I am trying to get the returned poi... | TITLE:
Returning c++ pointers to perl
QUESTION:
I have a function in C++ such as: void* getField(interface* p) { int* temp = new int( p->intValue); cout<< "pointer value in c++" << temp << "value of temp = " << temp << endl; return temp; } I am using SWIG to generate wrappers for the above class. Now I am trying to ge... | [
"perl",
"swig"
] | 3 | 5 | 385 | 1 | 0 | 2011-06-08T08:42:18.973000 | 2011-06-08T09:43:44.053000 |
6,276,252 | 6,276,801 | How to efficiently access/change one item in each row of a matrix | I have a matrix A with size (nr,nc), a vector of column indices B (so B has size (nr,1) and every element in B is an integer between 1 and nc), and I want to do something to every element in A that is of the form A(i,B(i)) for i between 1 and nr, efficiency being the key concern. For concreteness, say C is a vector of ... | Use linear indexing: idx = sub2ind(size(A), 1:nr, B'); A(idx) = A(idx) + C'; or (edited version with one less transpose) idx = sub2ind(size(A), (1:nr)', B); A(idx) = A(idx) + C; | How to efficiently access/change one item in each row of a matrix I have a matrix A with size (nr,nc), a vector of column indices B (so B has size (nr,1) and every element in B is an integer between 1 and nc), and I want to do something to every element in A that is of the form A(i,B(i)) for i between 1 and nr, efficie... | TITLE:
How to efficiently access/change one item in each row of a matrix
QUESTION:
I have a matrix A with size (nr,nc), a vector of column indices B (so B has size (nr,1) and every element in B is an integer between 1 and nc), and I want to do something to every element in A that is of the form A(i,B(i)) for i between... | [
"matlab"
] | 1 | 2 | 929 | 2 | 0 | 2011-06-08T08:42:51.643000 | 2011-06-08T09:39:51.743000 |
6,276,254 | 6,278,459 | EL proposals / autocomplete / code assist in Facelets with Eclipse | I tried to activate EL proposals in a Facelets page, but when I hit Ctrl+Space, it doesn't work. I managed to activate JSF tag proposals thank to other questions, but EL proposals aren't working. How can I activate this feature in Eclipse? Is it a known issue? For example: | Eclipse doesn't support this out the box. Even the support in JSP is very limited. Only the properties of and managed beans hardcoded as in faces-config.xml are available by autocomplete. There are however plugins which supports EL autocomplete on @ManagedBean and @Named beans. For example, the JBoss Tools plugin (spec... | EL proposals / autocomplete / code assist in Facelets with Eclipse I tried to activate EL proposals in a Facelets page, but when I hit Ctrl+Space, it doesn't work. I managed to activate JSF tag proposals thank to other questions, but EL proposals aren't working. How can I activate this feature in Eclipse? Is it a known... | TITLE:
EL proposals / autocomplete / code assist in Facelets with Eclipse
QUESTION:
I tried to activate EL proposals in a Facelets page, but when I hit Ctrl+Space, it doesn't work. I managed to activate JSF tag proposals thank to other questions, but EL proposals aren't working. How can I activate this feature in Ecli... | [
"eclipse",
"jsf",
"facelets",
"el"
] | 6 | 7 | 6,965 | 1 | 0 | 2011-06-08T08:42:59.447000 | 2011-06-08T12:09:22.910000 |
6,276,257 | 6,276,446 | overwriting ANT properties file | How can i overwrite some existing property with a newly created properties file? Here is the required structure: initially load Master.properties generate new.properties
load new.properties and master.properties run master.xml (ANT script) The idea is that Master.properties generates some product version which should ... | You should be able to resolve this by looking at the order in which you load (or otherwise specify) your property values. You probably don't need to override property values at all, which something not supported by core Ant. Maybe you can split your Master.properties into two files - one loaded before you generate new.... | overwriting ANT properties file How can i overwrite some existing property with a newly created properties file? Here is the required structure: initially load Master.properties generate new.properties
load new.properties and master.properties run master.xml (ANT script) The idea is that Master.properties generates so... | TITLE:
overwriting ANT properties file
QUESTION:
How can i overwrite some existing property with a newly created properties file? Here is the required structure: initially load Master.properties generate new.properties
load new.properties and master.properties run master.xml (ANT script) The idea is that Master.prope... | [
"ant"
] | 1 | 2 | 2,827 | 2 | 0 | 2011-06-08T08:43:18.823000 | 2011-06-08T09:02:57.147000 |
6,276,264 | 6,287,295 | How to force gcc generate bare asm code (do not use pseudo code) | e.g. MIPS: I use gcc -S xx.c gcc gens: move xxx but I want real instruction sll xxx Maybe a simple question, but I didn't find the answer on Google. EDIT: gcc want to gen a move insn, but in mips there is no real move, it use sll $x, $x, $0 to do move things. also it use sll $0, $0, $0 to do nop things. | move is a pseudo-instruction in MIPS assembly. It's not a real instruction, but the assembler accepts it and translates it. move $rt, $rs translates to addi $rt, $rs, 0. As for making gcc output assembly code with no pseudo-instructions, I don't think that's possible. | How to force gcc generate bare asm code (do not use pseudo code) e.g. MIPS: I use gcc -S xx.c gcc gens: move xxx but I want real instruction sll xxx Maybe a simple question, but I didn't find the answer on Google. EDIT: gcc want to gen a move insn, but in mips there is no real move, it use sll $x, $x, $0 to do move thi... | TITLE:
How to force gcc generate bare asm code (do not use pseudo code)
QUESTION:
e.g. MIPS: I use gcc -S xx.c gcc gens: move xxx but I want real instruction sll xxx Maybe a simple question, but I didn't find the answer on Google. EDIT: gcc want to gen a move insn, but in mips there is no real move, it use sll $x, $x,... | [
"gcc",
"assembly"
] | 1 | 0 | 766 | 1 | 0 | 2011-06-08T08:43:57.780000 | 2011-06-09T02:01:58.377000 |
6,276,271 | 6,276,539 | Fork an existing read-only Git repository | I want to make additions to a Git, so that the original author is able to pull the changes. Normally I'd fork that on something like GitHub and the workflow is simple. However for external repos I did find nothing in the documentation. Does anybody know how this would work for an external repository? Here's what I trie... | I don't think it's this complicated. Clone the original repository git clone git://wiesel.ece.utah.edu/gr-ieee802-15-4.git Create a new repository on github (say gr-ieee802-15-4 under the username wishi ). Add the r/w URL as a remote into your local clone - git remote add github git@github.com:wishi/gr-ieee802-15-4.git... | Fork an existing read-only Git repository I want to make additions to a Git, so that the original author is able to pull the changes. Normally I'd fork that on something like GitHub and the workflow is simple. However for external repos I did find nothing in the documentation. Does anybody know how this would work for ... | TITLE:
Fork an existing read-only Git repository
QUESTION:
I want to make additions to a Git, so that the original author is able to pull the changes. Normally I'd fork that on something like GitHub and the workflow is simple. However for external repos I did find nothing in the documentation. Does anybody know how th... | [
"git",
"version-control",
"merge",
"git-branch"
] | 3 | 8 | 2,816 | 1 | 0 | 2011-06-08T08:44:59.013000 | 2011-06-08T09:11:09.420000 |
6,276,284 | 6,276,343 | How To Call A String Resource In C++ | in resource.h #define String1 333 in resource.rc #include #include "resource.h"
STRINGTABLE { STRING1 "hie people" } in main.cpp #include #include #include using namespace std; int main{ cout< and one more problem i am compiling in code blocks.it says resource.h is not there where i am wrong | I assume that it is Visual C++ and you are using MFC. It is as simple as calling:::LoadString(...) And if you are using MFC, then CString str; str.LoadString(STRING1) LoadString from MSDN An Example here of how to use LoadString | How To Call A String Resource In C++ in resource.h #define String1 333 in resource.rc #include #include "resource.h"
STRINGTABLE { STRING1 "hie people" } in main.cpp #include #include #include using namespace std; int main{ cout< and one more problem i am compiling in code blocks.it says resource.h is not there where ... | TITLE:
How To Call A String Resource In C++
QUESTION:
in resource.h #define String1 333 in resource.rc #include #include "resource.h"
STRINGTABLE { STRING1 "hie people" } in main.cpp #include #include #include using namespace std; int main{ cout< and one more problem i am compiling in code blocks.it says resource.h i... | [
"string",
"visual-c++",
"resources"
] | 4 | 9 | 10,400 | 1 | 0 | 2011-06-08T08:46:16.303000 | 2011-06-08T08:52:17.543000 |
6,276,287 | 6,277,152 | icon issue in packageManager android | I can't get icon in properManner, I use PackageManager: Code example::List applications = getPackageManager().getInstalledPackages(0); for(PackageInfo info: applications){ Drawable icon = info.applicationInfo.loadIcon(getBaseContext()); } if I print icon to LOGCAT then I got result "icon is 9android.graphics.drawable.B... | In order to fecth bitmap from drawable and show in image view try below code Bitmap bitmap = ((BitmapDrawable)icon).getBitmap(); imageView.setImageBitmap(bitmap); | icon issue in packageManager android I can't get icon in properManner, I use PackageManager: Code example::List applications = getPackageManager().getInstalledPackages(0); for(PackageInfo info: applications){ Drawable icon = info.applicationInfo.loadIcon(getBaseContext()); } if I print icon to LOGCAT then I got result ... | TITLE:
icon issue in packageManager android
QUESTION:
I can't get icon in properManner, I use PackageManager: Code example::List applications = getPackageManager().getInstalledPackages(0); for(PackageInfo info: applications){ Drawable icon = info.applicationInfo.loadIcon(getBaseContext()); } if I print icon to LOGCAT ... | [
"android"
] | 0 | 2 | 701 | 1 | 0 | 2011-06-08T08:46:28.360000 | 2011-06-08T10:07:28.937000 |
6,276,288 | 6,276,335 | Javascript 2 functions for onClick only run last one | I have a problem using AJAX. The 2 functions that are called via the onclick event, post each value toggle AJAX and back data in two divs. If only put one function in one onclick. it runs well. but put 2, only run the last one ajax2('".$data."','".$num2."');. Where is the problem? echo " " click "; two js code, functio... | Change the first line of both functions to var HttPRequest = false;. This makes the httprequest private to each function. | Javascript 2 functions for onClick only run last one I have a problem using AJAX. The 2 functions that are called via the onclick event, post each value toggle AJAX and back data in two divs. If only put one function in one onclick. it runs well. but put 2, only run the last one ajax2('".$data."','".$num2."');. Where i... | TITLE:
Javascript 2 functions for onClick only run last one
QUESTION:
I have a problem using AJAX. The 2 functions that are called via the onclick event, post each value toggle AJAX and back data in two divs. If only put one function in one onclick. it runs well. but put 2, only run the last one ajax2('".$data."','".$... | [
"javascript",
"onclick"
] | 0 | 3 | 481 | 1 | 0 | 2011-06-08T08:46:30.257000 | 2011-06-08T08:51:25.877000 |
6,276,294 | 6,276,404 | Interface Builder place many items | I want to make screen with scroll view. How can I place items that will be shown after scroll in Interface Builder? Thanks | Select the elements you'd like to put in a scrollview then: In XCode4: Click in the menu on Editor -> Embed -> scrollview. In XCode3: Click in the menu on Layout -> Embed Objects In -> scrollview. Have a look at How to add " UIScrollView to Interface builder? ", there are several good solutions and comments. | Interface Builder place many items I want to make screen with scroll view. How can I place items that will be shown after scroll in Interface Builder? Thanks | TITLE:
Interface Builder place many items
QUESTION:
I want to make screen with scroll view. How can I place items that will be shown after scroll in Interface Builder? Thanks
ANSWER:
Select the elements you'd like to put in a scrollview then: In XCode4: Click in the menu on Editor -> Embed -> scrollview. In XCode3: C... | [
"xcode",
"ios",
"ios4",
"interface-builder"
] | 2 | 3 | 1,140 | 2 | 0 | 2011-06-08T08:46:44.507000 | 2011-06-08T08:58:52.063000 |
6,276,297 | 6,276,378 | Count item frequency | Hi I'm using Delphi and I have a StringList with this items: 45 A15 015 A15 A15 45 I want to process it and make a second stringlist that will have the number of appearance of each element: 45 [2] 015 [1] A15 [3] How can I do this with Delphi? | You could use a dictionary: Frequencies:= TDictionary.Create; try // Count frequencies for Str in StringList do begin if Frequencies.ContainsKey (Str) then Frequencies [Str]:= Frequencies [Str] + 1 else Frequencies.Add (Str, 1); end;
// Output results to console for Str in Frequencies.Keys do WriteLn (Str + ': ' + Int... | Count item frequency Hi I'm using Delphi and I have a StringList with this items: 45 A15 015 A15 A15 45 I want to process it and make a second stringlist that will have the number of appearance of each element: 45 [2] 015 [1] A15 [3] How can I do this with Delphi? | TITLE:
Count item frequency
QUESTION:
Hi I'm using Delphi and I have a StringList with this items: 45 A15 015 A15 A15 45 I want to process it and make a second stringlist that will have the number of appearance of each element: 45 [2] 015 [1] A15 [3] How can I do this with Delphi?
ANSWER:
You could use a dictionary: ... | [
"algorithm",
"delphi",
"delphi-2009"
] | 10 | 10 | 707 | 3 | 0 | 2011-06-08T08:47:11.307000 | 2011-06-08T08:55:58.920000 |
6,276,302 | 6,277,677 | .NET CF Socket receive timeout | I'm working on an app for Windows CE 5.0, by.NET CF 3.5 SP1. i wanna simulate socket receive timeout and wrote some codes:... AutoResetEvent auto = new AutoResetEvent(false); mySocket.BeginReceiveFrom(arrData, 0, 4, SocketFlags.None, ref EP, new AsyncCallback(ReceiveCallback), mySocket); //if (auto.WaitOne(10000,false)... | I should pass the WaitHandle i created for example as StateObject parameter to my BeginReceiveFrom method that i can access it later in callback method. i edited my code and it works now. in fact, i think the related samples on the Internet are so weak and terrible.... EventWaitHandle auto = new EventWaitHandle(false, ... | .NET CF Socket receive timeout I'm working on an app for Windows CE 5.0, by.NET CF 3.5 SP1. i wanna simulate socket receive timeout and wrote some codes:... AutoResetEvent auto = new AutoResetEvent(false); mySocket.BeginReceiveFrom(arrData, 0, 4, SocketFlags.None, ref EP, new AsyncCallback(ReceiveCallback), mySocket); ... | TITLE:
.NET CF Socket receive timeout
QUESTION:
I'm working on an app for Windows CE 5.0, by.NET CF 3.5 SP1. i wanna simulate socket receive timeout and wrote some codes:... AutoResetEvent auto = new AutoResetEvent(false); mySocket.BeginReceiveFrom(arrData, 0, 4, SocketFlags.None, ref EP, new AsyncCallback(ReceiveCall... | [
"c#",
".net",
"compact-framework",
"windows-ce"
] | 1 | 1 | 2,689 | 2 | 0 | 2011-06-08T08:47:23.140000 | 2011-06-08T11:00:13.143000 |
6,276,310 | 6,276,487 | How display some ImageView in a RelativeLayout? | I have a RelativeLayout RelativeLayout myLayout = new RelativeLayout(this); Then, I add 2 ImageView in this Layout: RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(20, 20);
ImageView img1 = new ImageView(this); // Here I give the position of img1
ImageView img2 = new ImageView(this); // And here ... | Since you are using RelativeLayout and same params for both ImageView one will be overlapped with the other. So define params for both. Add rule to each param for positioning it. And then give addView(). For eg: RelativeLayout myLayout = new RelativeLayout(this);
ImageView img1 = new ImageView(this); RelativeLayout.La... | How display some ImageView in a RelativeLayout? I have a RelativeLayout RelativeLayout myLayout = new RelativeLayout(this); Then, I add 2 ImageView in this Layout: RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(20, 20);
ImageView img1 = new ImageView(this); // Here I give the position of img1
Im... | TITLE:
How display some ImageView in a RelativeLayout?
QUESTION:
I have a RelativeLayout RelativeLayout myLayout = new RelativeLayout(this); Then, I add 2 ImageView in this Layout: RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(20, 20);
ImageView img1 = new ImageView(this); // Here I give the po... | [
"android",
"imageview",
"android-relativelayout"
] | 0 | 3 | 2,516 | 1 | 0 | 2011-06-08T08:48:49.360000 | 2011-06-08T09:05:57.627000 |
6,276,332 | 6,276,710 | Create A COM object inside another COM object | I have the following interface. The interface returns ISystemCmds interface as part of GetSystemCommandInterface method. We are using ATL for creating the COM. interface IDevice: IDispatch{ [id(1), helpstring("method Connect")] HRESULT Connect([in] VARIANT varPortNo); [id(2), helpstring("method GetSystemCommandInterfac... | Use the ATL wizard to create the implementation of ISystemCmds. Then create the object through normal CoCreateInstance, or use the CComObject<> template (see method CreateInstance) if you need to initialize the object in a way that ISystemCmds does not support. Be aware that CComObject<>::CreateInstance() does not AddR... | Create A COM object inside another COM object I have the following interface. The interface returns ISystemCmds interface as part of GetSystemCommandInterface method. We are using ATL for creating the COM. interface IDevice: IDispatch{ [id(1), helpstring("method Connect")] HRESULT Connect([in] VARIANT varPortNo); [id(2... | TITLE:
Create A COM object inside another COM object
QUESTION:
I have the following interface. The interface returns ISystemCmds interface as part of GetSystemCommandInterface method. We are using ATL for creating the COM. interface IDevice: IDispatch{ [id(1), helpstring("method Connect")] HRESULT Connect([in] VARIANT... | [
"c++",
"com",
"windows-ce",
"atl"
] | 3 | 2 | 536 | 2 | 0 | 2011-06-08T08:51:12.967000 | 2011-06-08T09:30:27.197000 |
6,276,334 | 6,277,165 | How cache is managed? | I am writing an application where i m planning to store the Images read from server to Android cache. As I read somewhere "Android cache can be cleared by system whenever the memory is low", so if I image is removed how will i get the indication that the image is removed? | I think there is no way to know wether Android has cleared the cache. But if you save data to the cache folder you can hold on to the filename and check wether the file is present or not. I have a download task for my data which checks the cache first and if there is no data present the download starts. Otherwise the c... | How cache is managed? I am writing an application where i m planning to store the Images read from server to Android cache. As I read somewhere "Android cache can be cleared by system whenever the memory is low", so if I image is removed how will i get the indication that the image is removed? | TITLE:
How cache is managed?
QUESTION:
I am writing an application where i m planning to store the Images read from server to Android cache. As I read somewhere "Android cache can be cleared by system whenever the memory is low", so if I image is removed how will i get the indication that the image is removed?
ANSWER... | [
"android",
"caching"
] | 0 | 1 | 221 | 2 | 0 | 2011-06-08T08:51:24.997000 | 2011-06-08T10:08:48.280000 |
6,276,341 | 6,277,597 | Auto Generated POCO serialization with DataContractSerializer and MetaDataTypeAttribute problem | As the title says, i am having some problems with serializing my auto generated POCO objects. But first some background information: I have created my Data Access Layer using EF 4.0 en ADO.Net POCO Entity Generator following this guide: http://blogs.msdn.com/b/adonet/archive/2010/01/25/walkthrough-poco-template-for-the... | DataContractSerializer doesn't read attributes from external metadata type. Not every feature of.NET framework works with rest of the API especially newer features usually don't work with old ones and that is exactly this case. The best way is either use custom serialization in IXmlSerializable or DTO as @Marc suggeste... | Auto Generated POCO serialization with DataContractSerializer and MetaDataTypeAttribute problem As the title says, i am having some problems with serializing my auto generated POCO objects. But first some background information: I have created my Data Access Layer using EF 4.0 en ADO.Net POCO Entity Generator following... | TITLE:
Auto Generated POCO serialization with DataContractSerializer and MetaDataTypeAttribute problem
QUESTION:
As the title says, i am having some problems with serializing my auto generated POCO objects. But first some background information: I have created my Data Access Layer using EF 4.0 en ADO.Net POCO Entity G... | [
".net",
"entity-framework",
"xml-serialization",
"datacontractserializer"
] | 3 | 1 | 3,330 | 3 | 0 | 2011-06-08T08:52:10.087000 | 2011-06-08T10:53:22.520000 |
6,276,342 | 6,276,421 | Android C2DM Push Notification | I am developing one application and in that application I need to implement push notifications. Can anyone suggest how I should go about implementing push notifications? If I could be provided with a good tutorial, that would be great! Thanks. | // Call when your application start public void StartRegistrationNotification() {
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER"); registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); registrationIntent.putExtra("sender", "....@gmail.com"); this.st... | Android C2DM Push Notification I am developing one application and in that application I need to implement push notifications. Can anyone suggest how I should go about implementing push notifications? If I could be provided with a good tutorial, that would be great! Thanks. | TITLE:
Android C2DM Push Notification
QUESTION:
I am developing one application and in that application I need to implement push notifications. Can anyone suggest how I should go about implementing push notifications? If I could be provided with a good tutorial, that would be great! Thanks.
ANSWER:
// Call when your ... | [
"java",
"android",
"push-notification",
"android-c2dm"
] | 11 | 15 | 23,167 | 2 | 0 | 2011-06-08T08:52:15.467000 | 2011-06-08T09:00:42.717000 |
6,276,348 | 6,276,510 | How to use Linq To Sql query to show the data in my case? | i have a trouble to write a query with Linq i explain better my case, i have a database with 2 tables as follow: it is the first table; Hotel HotelID (Nvarchar(10) - PK) HotelName (Nvarchar (200)) and this one is the second table; Period PeriodID (Int (inc) - PK) _From (Datetime ) _To (Datetime) HotelID(Nvarchar(10) - ... | This article explains working with hierarchical data binding: http://msdn.microsoft.com/en-us/library/aa478959.aspx Then, create an object model which roughly maps to your database tables: Hotel - ID - Name - Bookings - Booking 1 { From, To } - Booking 2 { From, To } - Booking n { From, To } Your Linq should look somet... | How to use Linq To Sql query to show the data in my case? i have a trouble to write a query with Linq i explain better my case, i have a database with 2 tables as follow: it is the first table; Hotel HotelID (Nvarchar(10) - PK) HotelName (Nvarchar (200)) and this one is the second table; Period PeriodID (Int (inc) - PK... | TITLE:
How to use Linq To Sql query to show the data in my case?
QUESTION:
i have a trouble to write a query with Linq i explain better my case, i have a database with 2 tables as follow: it is the first table; Hotel HotelID (Nvarchar(10) - PK) HotelName (Nvarchar (200)) and this one is the second table; Period Period... | [
"c#",
"linq-to-sql"
] | 1 | 2 | 303 | 1 | 0 | 2011-06-08T08:53:30.543000 | 2011-06-08T09:07:57.843000 |
6,276,358 | 6,276,936 | Pros and Cons of SQLite and Shared Preferences | What is the good mechanism to store information among SQLite database and Shared Preferences? Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriate answer on Google. Please help me with example... | It really depends on the data you want to store. SQLite Large amounts of same structured data should be stored in a SQLite database as databases are designed for this kind of data. As the data is structured and managed by the database, it can be queried to get a sub set of the data which matches certain criteria using ... | Pros and Cons of SQLite and Shared Preferences What is the good mechanism to store information among SQLite database and Shared Preferences? Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to find the appropriat... | TITLE:
Pros and Cons of SQLite and Shared Preferences
QUESTION:
What is the good mechanism to store information among SQLite database and Shared Preferences? Why use shared preferences? Why use sqlite? I tried to find the difference between them, and which is the better mechanism for data storing, but I am unable to f... | [
"android",
"database",
"sqlite",
"sharedpreferences",
"data-storage"
] | 184 | 189 | 83,222 | 5 | 0 | 2011-06-08T08:54:11.083000 | 2011-06-08T09:49:29.587000 |
6,276,361 | 6,277,078 | Java - Is a line stretching from (a,b) to (c,d) touching Point(x,y)? | I'm writing a tool in Java which does a little drawing on a Graphics object. But, I'm stuck on a problem that I don't quite know how to solve. Hoping someone can help. How can I determine if a point x,y on a Graphics object touches a line that extends from, for example, 200,200 to 392,144. Sounds simple, but I'm stumpe... | There are correct answers already, but I think it might be more generally useful to have a formula that gives the distance of any point from a specified line. Then you can just check if this is zero, or within whatever tolerance you choose. The following should work regardless of special cases like vertical lines (infi... | Java - Is a line stretching from (a,b) to (c,d) touching Point(x,y)? I'm writing a tool in Java which does a little drawing on a Graphics object. But, I'm stuck on a problem that I don't quite know how to solve. Hoping someone can help. How can I determine if a point x,y on a Graphics object touches a line that extends... | TITLE:
Java - Is a line stretching from (a,b) to (c,d) touching Point(x,y)?
QUESTION:
I'm writing a tool in Java which does a little drawing on a Graphics object. But, I'm stuck on a problem that I don't quite know how to solve. Hoping someone can help. How can I determine if a point x,y on a Graphics object touches a... | [
"java",
"graphics"
] | 5 | 2 | 782 | 7 | 0 | 2011-06-08T08:54:16.340000 | 2011-06-08T10:01:47.587000 |
6,276,380 | 6,276,396 | How to get MAC address of the WIFI interface in android? | I am using the following code: WifiManager wifiMgr = (WifiManager) app.getSystemService(Context.WIFI_SERVICE); return wifiMgr.getConnectionInfo().getMacAddress(); Problem is, the WIFI must be ENABLED in the device in order for me to read its address. How can I still read the MAC of the WIFI even if the WIFI is off? | You can't. Depending on the device, if the wifi adapter is disabled then it may actually be electronically switched off, so you can't read any info from it. From the Android Developers Blog: Mac Address It may be possible to retrieve a Mac address from a device’s WiFi or Bluetooth hardware. We do not recommend using th... | How to get MAC address of the WIFI interface in android? I am using the following code: WifiManager wifiMgr = (WifiManager) app.getSystemService(Context.WIFI_SERVICE); return wifiMgr.getConnectionInfo().getMacAddress(); Problem is, the WIFI must be ENABLED in the device in order for me to read its address. How can I st... | TITLE:
How to get MAC address of the WIFI interface in android?
QUESTION:
I am using the following code: WifiManager wifiMgr = (WifiManager) app.getSystemService(Context.WIFI_SERVICE); return wifiMgr.getConnectionInfo().getMacAddress(); Problem is, the WIFI must be ENABLED in the device in order for me to read its add... | [
"android",
"android-wifi"
] | 6 | 14 | 16,191 | 2 | 0 | 2011-06-08T08:56:06.953000 | 2011-06-08T08:58:05.683000 |
6,276,382 | 6,276,707 | Why does binding "move_node.jstree" only fire once, for the first node, when moving a group of nodes? | Can anyone tell me why binding "move_node.jstree" only fires once, for the first node, when moving a group of nodes? and how can I detect All the nodes that were moved? I need to detect All nodes that were moved so that I can report back via a custom ajax function. This is what I am using at the minute but it only runs... | Finally after a day and a half I have found the right issue number!:-D if you have same problem check it out for solution: http://code.google.com/p/jstree/issues/detail?id=805 This guy best put together a decent set of documentation when the new version is released because the current one has issues. | Why does binding "move_node.jstree" only fire once, for the first node, when moving a group of nodes? Can anyone tell me why binding "move_node.jstree" only fires once, for the first node, when moving a group of nodes? and how can I detect All the nodes that were moved? I need to detect All nodes that were moved so tha... | TITLE:
Why does binding "move_node.jstree" only fire once, for the first node, when moving a group of nodes?
QUESTION:
Can anyone tell me why binding "move_node.jstree" only fires once, for the first node, when moving a group of nodes? and how can I detect All the nodes that were moved? I need to detect All nodes that... | [
"javascript",
"jquery",
"jstree"
] | 4 | 5 | 6,090 | 1 | 0 | 2011-06-08T08:56:23.543000 | 2011-06-08T09:29:44.167000 |
6,276,398 | 6,278,275 | Multiple form classes in django generic (class) views | I'd like to use the class based generic views of django 1.3 for forms, but sometimes have to manage multiple form classes in one form. However, it looks like the existing views based on FormMixin assume a single form class. Is this possible with generic views and how would I do it? EDIT: to clarify, I have one form but... | Facing similar problem, I've come to conclusion that it's not possible. Though having multiple forms per page itself turned out to be a design mistake, presenting all sorts of troubles. E.g., user fills two forms, clicks submit on one of them and loses data from the other. Workaround requires complicated controller tha... | Multiple form classes in django generic (class) views I'd like to use the class based generic views of django 1.3 for forms, but sometimes have to manage multiple form classes in one form. However, it looks like the existing views based on FormMixin assume a single form class. Is this possible with generic views and ho... | TITLE:
Multiple form classes in django generic (class) views
QUESTION:
I'd like to use the class based generic views of django 1.3 for forms, but sometimes have to manage multiple form classes in one form. However, it looks like the existing views based on FormMixin assume a single form class. Is this possible with ge... | [
"django",
"django-forms",
"django-views",
"django-class-based-views"
] | 17 | 11 | 12,474 | 3 | 0 | 2011-06-08T08:58:28.560000 | 2011-06-08T11:51:20.400000 |
6,276,402 | 6,276,509 | How to convert a string into a hyperlink in the iPhone SDK? | I am getting a string from an API. I use a JSON library to parse it, and after I put the string into a UITextView, I need to convert it into a hyperlink. When the user clicks on that hyperlink it should open Safari and load that site. | You can do as yourTextView.editable = NO; yourTextView.dataDetectorTypes = UIDataDetectorTypeAll; Please follow documentation for more detail. This will detect links automatically. | How to convert a string into a hyperlink in the iPhone SDK? I am getting a string from an API. I use a JSON library to parse it, and after I put the string into a UITextView, I need to convert it into a hyperlink. When the user clicks on that hyperlink it should open Safari and load that site. | TITLE:
How to convert a string into a hyperlink in the iPhone SDK?
QUESTION:
I am getting a string from an API. I use a JSON library to parse it, and after I put the string into a UITextView, I need to convert it into a hyperlink. When the user clicks on that hyperlink it should open Safari and load that site.
ANSWER... | [
"iphone",
"cocoa-touch",
"string",
"hyperlink"
] | 0 | 2 | 1,192 | 3 | 0 | 2011-06-08T08:58:46.660000 | 2011-06-08T09:07:53.867000 |
6,276,418 | 6,276,565 | substring searching in a string using suffix tree..? | I have read that: Searching for a substring, pat[1..m], in txt[1..n], can be solved in O(m) time (after the suffix tree for txt has been built in O(n) time). but at each point, we will have to choose which branch to take, so like in n-ary tree, at each node, we will have to compare with all max n pointers in that node ... | Then how above it says that substring can be found in O(m)? By omission. You are correct that the runtime of searching in suffix trees is more complex than merely O(m). However, it can indeed be sped up to O(m) if we trade off space requirements: we need to get the search at each node down to O(1) and we can do this by... | substring searching in a string using suffix tree..? I have read that: Searching for a substring, pat[1..m], in txt[1..n], can be solved in O(m) time (after the suffix tree for txt has been built in O(n) time). but at each point, we will have to choose which branch to take, so like in n-ary tree, at each node, we will ... | TITLE:
substring searching in a string using suffix tree..?
QUESTION:
I have read that: Searching for a substring, pat[1..m], in txt[1..n], can be solved in O(m) time (after the suffix tree for txt has been built in O(n) time). but at each point, we will have to choose which branch to take, so like in n-ary tree, at e... | [
"algorithm",
"data-structures",
"tree",
"suffix-tree"
] | 3 | 5 | 4,504 | 2 | 0 | 2011-06-08T09:00:20.130000 | 2011-06-08T09:14:38.530000 |
6,276,423 | 6,276,474 | Hibernate: memory issues? disadvantages? | Im working with Hibernate 3.6 and until today I couldnt find any disadvantages of using it. But today someone told me that applications using Hibernate will get memory problems when the project gets bigger. This would happen because there would be a lot of objects (hibernate-pojo-objects) which will need to be created ... | Some of them are: Little or no capabilities for remote access and distributability. Mapping schemas can be tedious and O/R mapping has its tricks like using lazy initialization, eager loading etc. What works for one may not work for another. Limited clustering capabilities. Large data sets can still cause memory issues... | Hibernate: memory issues? disadvantages? Im working with Hibernate 3.6 and until today I couldnt find any disadvantages of using it. But today someone told me that applications using Hibernate will get memory problems when the project gets bigger. This would happen because there would be a lot of objects (hibernate-poj... | TITLE:
Hibernate: memory issues? disadvantages?
QUESTION:
Im working with Hibernate 3.6 and until today I couldnt find any disadvantages of using it. But today someone told me that applications using Hibernate will get memory problems when the project gets bigger. This would happen because there would be a lot of obje... | [
"java",
"database",
"performance",
"hibernate",
"memory"
] | 5 | 7 | 4,901 | 3 | 0 | 2011-06-08T09:00:44.357000 | 2011-06-08T09:04:56.773000 |
6,276,440 | 6,276,507 | jQuery - attach event handler for linkButton | I have a user control. It contrains LinkButton. I want to attach an click event to the LinkButton using jquery. <%@ Control AutoEventWireup="true" CodeBehind="Pager.ascx.cs" EnableViewState="true" Inherits="Web.Controls.Pager" Language="C#" ViewStateMode="Enabled" %> The first error I've encountered is Cannot call meth... | try this $('#<%=LinkButtonObj.ClientID%>').click(function() { alert('Handler for.click() called.'); }); | jQuery - attach event handler for linkButton I have a user control. It contrains LinkButton. I want to attach an click event to the LinkButton using jquery. <%@ Control AutoEventWireup="true" CodeBehind="Pager.ascx.cs" EnableViewState="true" Inherits="Web.Controls.Pager" Language="C#" ViewStateMode="Enabled" %> The fir... | TITLE:
jQuery - attach event handler for linkButton
QUESTION:
I have a user control. It contrains LinkButton. I want to attach an click event to the LinkButton using jquery. <%@ Control AutoEventWireup="true" CodeBehind="Pager.ascx.cs" EnableViewState="true" Inherits="Web.Controls.Pager" Language="C#" ViewStateMode="E... | [
"jquery",
"asp.net",
"webforms"
] | 3 | 3 | 2,008 | 4 | 0 | 2011-06-08T09:02:22.640000 | 2011-06-08T09:07:39.257000 |
6,276,441 | 6,277,001 | How to create files from template in rails lib directory? | I am writing a gem and to use it, some directories, ruby classes and yaml files should be created in rails lib directory. I'd like to have a scaffold method, which creates appropriate files with basic information, that will be modified later. How should I do this? Should I add something to 'script' directory or to 'scr... | Check out the Rails Guide on Generators. They use the gem Thor under the hood. | How to create files from template in rails lib directory? I am writing a gem and to use it, some directories, ruby classes and yaml files should be created in rails lib directory. I'd like to have a scaffold method, which creates appropriate files with basic information, that will be modified later. How should I do thi... | TITLE:
How to create files from template in rails lib directory?
QUESTION:
I am writing a gem and to use it, some directories, ruby classes and yaml files should be created in rails lib directory. I'd like to have a scaffold method, which creates appropriate files with basic information, that will be modified later. H... | [
"ruby-on-rails",
"templates",
"rubygems"
] | 1 | 1 | 384 | 1 | 0 | 2011-06-08T09:02:43.377000 | 2011-06-08T09:55:02.730000 |
6,276,442 | 6,276,525 | Why retainCount = 2 - after release? | I use this code. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch.
view = [[UIView alloc] init];
[_window addSubview:view];
[view release];
NSLog(@"count - %d", [view retainCount]);
[self.wind... | Please do not count on retainCount. Fire up Instruments and see if there is a leak. Apple discourages the use of retainCount for debugging purposes: Important: This method is typically of no value in debugging memory management issues. Because any number of framework objects may have retained an object in order to hold... | Why retainCount = 2 - after release? I use this code. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch.
view = [[UIView alloc] init];
[_window addSubview:view];
[view release];
NSLog(@"count - ... | TITLE:
Why retainCount = 2 - after release?
QUESTION:
I use this code. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch.
view = [[UIView alloc] init];
[_window addSubview:view];
[view release];... | [
"ios",
"memory-management",
"retaincount"
] | 0 | 6 | 2,525 | 3 | 0 | 2011-06-08T09:02:45.137000 | 2011-06-08T09:09:57.350000 |
6,276,445 | 6,278,274 | Javascript conditional inclusion pre-minification: does such a tool exist? | All JS minifiers that I can find work by a combination of whitespace elimination, variable renaming, and regular compression. However, much more could be cut if the minifier was aware of which functionality in the module was required for the project that it's being minified for. Let's say a project uses underscore.js, ... | Google's Closure Compiler 's "advanced compilation" functionality does what you want -- it parses your JavaScript source and automatically removes its dead code ( try it online ). A downside is that you may have to make changes to your code for it to work, though. | Javascript conditional inclusion pre-minification: does such a tool exist? All JS minifiers that I can find work by a combination of whitespace elimination, variable renaming, and regular compression. However, much more could be cut if the minifier was aware of which functionality in the module was required for the pro... | TITLE:
Javascript conditional inclusion pre-minification: does such a tool exist?
QUESTION:
All JS minifiers that I can find work by a combination of whitespace elimination, variable renaming, and regular compression. However, much more could be cut if the minifier was aware of which functionality in the module was re... | [
"javascript",
"conditional-compilation",
"minify"
] | 1 | 2 | 259 | 1 | 0 | 2011-06-08T09:02:53.077000 | 2011-06-08T11:51:11.700000 |
6,276,462 | 6,277,082 | How can I allow a user to only update reviews they have written using cancan? | I've been following through Ryan Bates' railscast on using cancan but am stumped as to why checking whether a user has written a review and then allowing them to edit it if they have, wont work for me. heres the code I have: class Ability include CanCan::Ability
def initialize(user) user ||= User.new # guest user (not... | In your view you should write something like <% if can?:update, @review %> testing <% end %> So pass in the actual review-object, instead of just the class. | How can I allow a user to only update reviews they have written using cancan? I've been following through Ryan Bates' railscast on using cancan but am stumped as to why checking whether a user has written a review and then allowing them to edit it if they have, wont work for me. heres the code I have: class Ability inc... | TITLE:
How can I allow a user to only update reviews they have written using cancan?
QUESTION:
I've been following through Ryan Bates' railscast on using cancan but am stumped as to why checking whether a user has written a review and then allowing them to edit it if they have, wont work for me. heres the code I have:... | [
"ruby-on-rails",
"cancan"
] | 2 | 4 | 359 | 3 | 0 | 2011-06-08T09:04:17.167000 | 2011-06-08T10:02:08.743000 |
6,276,464 | 6,276,972 | Where should domain objects and service class objects be located? | I'm doing my best to learn DDD, but I'm unsure about some really basic concepts; Where are your domain objects and services located, and how is the overall layout organized? I have a habit, good or bad I don't know, that's why I ask; to make a "Program" class, which holds domain collections, domain objects and service ... | What you are describing is how to organise your dependencies (in this case, your forms project depends on the services). A few points about the above code: It looks like you have all of your classes in the same file. Generally you should place every new class in its own file. Your service classes should both implement ... | Where should domain objects and service class objects be located? I'm doing my best to learn DDD, but I'm unsure about some really basic concepts; Where are your domain objects and services located, and how is the overall layout organized? I have a habit, good or bad I don't know, that's why I ask; to make a "Program" ... | TITLE:
Where should domain objects and service class objects be located?
QUESTION:
I'm doing my best to learn DDD, but I'm unsure about some really basic concepts; Where are your domain objects and services located, and how is the overall layout organized? I have a habit, good or bad I don't know, that's why I ask; to... | [
"c#",
".net",
"domain-driven-design"
] | 3 | 1 | 757 | 2 | 0 | 2011-06-08T09:04:24.757000 | 2011-06-08T09:52:08.620000 |
6,276,467 | 6,277,061 | Functional programming in Groovy; Apart from curry method:? | Last night i have read about the curry() method in Groovy and i felt the feeling of functional programming, with the use of this curry() method. As a novice in Groovy language, are there any methods in Groovy which provides functional programming capabilities as curry() method does? It will be good, if those methods ar... | There's also Closure composition def plus2 = { it + 2 } def times3 = { it * 3 }
def composed1 = plus2 << times3 assert composed1(3) == 11 And you can use the Method Reference operator & to get a reference to a class method, which you can then use with currying or composition. ie: def parseIntRef = Integer.&parseInt
d... | Functional programming in Groovy; Apart from curry method:? Last night i have read about the curry() method in Groovy and i felt the feeling of functional programming, with the use of this curry() method. As a novice in Groovy language, are there any methods in Groovy which provides functional programming capabilities ... | TITLE:
Functional programming in Groovy; Apart from curry method:?
QUESTION:
Last night i have read about the curry() method in Groovy and i felt the feeling of functional programming, with the use of this curry() method. As a novice in Groovy language, are there any methods in Groovy which provides functional program... | [
"groovy"
] | 3 | 4 | 756 | 1 | 0 | 2011-06-08T09:04:26.430000 | 2011-06-08T09:59:48.033000 |
6,276,481 | 6,276,809 | xslt allowed arguments in concat and normalize-space | I was looking through some code and i saw this: I'm just wondering with just this info, can i safely say for sure that $list is a string and normalize-space($list) will definitely return me a string and the line concat(normalize-space($list), ' ') will definitely return me a string (and the last character of that strin... | $list could be a string, a number, a node set, anything. The result will be a string. And yes, the last character will be a space. For instance: string otherstring returns 18stringotherstring | xslt allowed arguments in concat and normalize-space I was looking through some code and i saw this: I'm just wondering with just this info, can i safely say for sure that $list is a string and normalize-space($list) will definitely return me a string and the line concat(normalize-space($list), ' ') will definitely ret... | TITLE:
xslt allowed arguments in concat and normalize-space
QUESTION:
I was looking through some code and i saw this: I'm just wondering with just this info, can i safely say for sure that $list is a string and normalize-space($list) will definitely return me a string and the line concat(normalize-space($list), ' ') w... | [
"html",
"xml",
"xslt",
"xpath",
"xquery"
] | 3 | 1 | 3,548 | 2 | 0 | 2011-06-08T09:05:28.157000 | 2011-06-08T09:40:31.387000 |
6,276,483 | 6,276,545 | Haskell condition in a map function | Is it possible to have a condition in a map function? For example: map (> 0 < 100 )[1..10] If it's not possible, how could one achieve this? | Not quite like that, I presume you are trying to get a boolean indicating whether the value is greater than 0 and less than 100? You have several options: You can name a function condition:: Int -> Bool condition x = x > 0 && x < 100 map condition [1..10] You can use a lambda map (\x -> x > 0 && x < 100) [1..10] You ca... | Haskell condition in a map function Is it possible to have a condition in a map function? For example: map (> 0 < 100 )[1..10] If it's not possible, how could one achieve this? | TITLE:
Haskell condition in a map function
QUESTION:
Is it possible to have a condition in a map function? For example: map (> 0 < 100 )[1..10] If it's not possible, how could one achieve this?
ANSWER:
Not quite like that, I presume you are trying to get a boolean indicating whether the value is greater than 0 and le... | [
"haskell",
"dictionary"
] | 1 | 5 | 6,265 | 3 | 0 | 2011-06-08T09:05:37.630000 | 2011-06-08T09:11:43.577000 |
6,276,484 | 6,276,541 | Undesirable popup in datepicker in IE6 | I am using a datepicker for one of my form elements in my Drupal page. The problem i have is that in IE6 (testing in IE7 and Firefox, it looks fine), there is a box below the calendar with the word false in it. When the first date picker is clicked, the box is the same size as the calendar. When another date picker is ... | Add this to your css iframe.ui-datepicker-cover { display:none; } else try this.ui-datepicker-cover { display: none; /*sorry for IE5*/ display/**/: block; /*sorry for IE5*/ position: absolute; /*must have*/ z-index: -1; /*must have*/ filter: mask(); /*must have*/ top: -4px; /*must have*/ left: -4px; /*must have*/ width... | Undesirable popup in datepicker in IE6 I am using a datepicker for one of my form elements in my Drupal page. The problem i have is that in IE6 (testing in IE7 and Firefox, it looks fine), there is a box below the calendar with the word false in it. When the first date picker is clicked, the box is the same size as the... | TITLE:
Undesirable popup in datepicker in IE6
QUESTION:
I am using a datepicker for one of my form elements in my Drupal page. The problem i have is that in IE6 (testing in IE7 and Firefox, it looks fine), there is a box below the calendar with the word false in it. When the first date picker is clicked, the box is th... | [
"jquery",
"date",
"internet-explorer-6",
"jquery-ui-datepicker"
] | 0 | 1 | 609 | 1 | 0 | 2011-06-08T09:05:39.273000 | 2011-06-08T09:11:20.027000 |
6,276,501 | 6,276,592 | How to put an image in an AlertDialog? Android | I don't know how to put an image into an AlertDialog. I have this code, but i think this is not possible. AlertDialog.Builder alert = new AlertDialog.Builder(MessageDemo.this); ImageView imageView = (ImageView) findViewById(R.id.imageView1); imageView.setImageResource(R.drawable.cw); alert.setView(imageView); alert.set... | Create one sample.xml and add ImageView in that XML. sample.xml Java Code: AlertDialog.Builder alertadd = new AlertDialog.Builder(MessageDemo.this); LayoutInflater factory = LayoutInflater.from(MessageDemo.this); final View view = factory.inflate(R.layout.sample, null); alertadd.setView(view); alertadd.setNeutralButton... | How to put an image in an AlertDialog? Android I don't know how to put an image into an AlertDialog. I have this code, but i think this is not possible. AlertDialog.Builder alert = new AlertDialog.Builder(MessageDemo.this); ImageView imageView = (ImageView) findViewById(R.id.imageView1); imageView.setImageResource(R.dr... | TITLE:
How to put an image in an AlertDialog? Android
QUESTION:
I don't know how to put an image into an AlertDialog. I have this code, but i think this is not possible. AlertDialog.Builder alert = new AlertDialog.Builder(MessageDemo.this); ImageView imageView = (ImageView) findViewById(R.id.imageView1); imageView.set... | [
"android",
"android-alertdialog"
] | 38 | 82 | 103,669 | 7 | 0 | 2011-06-08T09:07:01.293000 | 2011-06-08T09:17:39.333000 |
6,276,508 | 6,276,699 | Add event to Firefox when a specific url is loaded | I'd like to write an extension that adds a div element to a page when a specific URL is loaded (e.g. when the url is http://www....&q=car&aq I'd like to have a div element containing "car" added to the webpage) I'm already using addEventListener to check if a tab is open but I don't know how to do it for a specific URL... | You can get the url using the command window.location so you can do something like if (window.location.indexof("http://www.yoururl.com")!= -1 &&!$.browser.msie) { //add a div to the dom here.
} This line!$.browser.msie is actually jquery, and might not compile incase you are not including jquery libraries, it basicall... | Add event to Firefox when a specific url is loaded I'd like to write an extension that adds a div element to a page when a specific URL is loaded (e.g. when the url is http://www....&q=car&aq I'd like to have a div element containing "car" added to the webpage) I'm already using addEventListener to check if a tab is op... | TITLE:
Add event to Firefox when a specific url is loaded
QUESTION:
I'd like to write an extension that adds a div element to a page when a specific URL is loaded (e.g. when the url is http://www....&q=car&aq I'd like to have a div element containing "car" added to the webpage) I'm already using addEventListener to ch... | [
"javascript",
"url",
"firefox-addon"
] | 0 | 1 | 246 | 2 | 0 | 2011-06-08T09:07:40.870000 | 2011-06-08T09:29:09.593000 |
6,276,526 | 6,276,554 | Providing multi language support in web application | I am developing a new web application from scratch. I need to provide multi-language support in my website. Which enable users from different regions of the world to see each web page in their own language. Since, i am new to this field so i don't know how to achieve this. One possible way is to make each single page m... | You certainly don't want to create separate pages for each language. ASP.NET is quite well geared towards multiple-languages within one page - with the use of resource files: An effective way to create localized Web pages is to use resources for your page's text and controls based on the user's language and culture. By... | Providing multi language support in web application I am developing a new web application from scratch. I need to provide multi-language support in my website. Which enable users from different regions of the world to see each web page in their own language. Since, i am new to this field so i don't know how to achieve ... | TITLE:
Providing multi language support in web application
QUESTION:
I am developing a new web application from scratch. I need to provide multi-language support in my website. Which enable users from different regions of the world to see each web page in their own language. Since, i am new to this field so i don't kn... | [
"c#",
"asp.net",
"web-applications",
"localization"
] | 0 | 2 | 2,293 | 2 | 0 | 2011-06-08T09:10:00.130000 | 2011-06-08T09:13:24.737000 |
6,276,535 | 6,276,674 | Mocking a dependency that is not visible outside | I have to unit test some old code that wasn't designed to support unit testing (No DI). Is there a way to mock an object that is being initialized within a public method? public int method() {
A a = new A(ar1, arg2); //How to mock this?
} Thanks, -Abidi | Another option is to refactor the code into public int method() { A a = createA(arg1,arg2); }
A createA(int arg1, int arg2) { return new A(arg1,arg2); } In your test method now you can use Mockito's spy and doAnswer functions to override createA on your test fixture with something along the lines of: Foo foo = new Foo... | Mocking a dependency that is not visible outside I have to unit test some old code that wasn't designed to support unit testing (No DI). Is there a way to mock an object that is being initialized within a public method? public int method() {
A a = new A(ar1, arg2); //How to mock this?
} Thanks, -Abidi | TITLE:
Mocking a dependency that is not visible outside
QUESTION:
I have to unit test some old code that wasn't designed to support unit testing (No DI). Is there a way to mock an object that is being initialized within a public method? public int method() {
A a = new A(ar1, arg2); //How to mock this?
} Thanks, -Abi... | [
"junit",
"mockito"
] | 4 | 1 | 573 | 2 | 0 | 2011-06-08T09:11:03.760000 | 2011-06-08T09:27:07.397000 |
6,276,542 | 6,276,671 | How to add an icon into iphone/ipod status bar? | Does Apple not allow developers to add an icon into a status bar? I followed code from a book. The code is simple: @interface UIApplication (extended) - (void) addStatusBarImageNamed:(NSString *)aName; - (void) removeStatusBarImageNamed:(NSString *)aName;
@end
- (void)performAction{ if (xxx) { [[UIApplication sharedA... | In Classes/YourViewController.m, the addStatusBarImageNamed:removeOnExit: method needs to be overwritten with this. - (void) addStatusBarImageNamed:(NSString*)image removeOnExit: (BOOL) remove { if(_statusbarimage!=nil && _responds) { if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"statusBarEnabled"] integer... | How to add an icon into iphone/ipod status bar? Does Apple not allow developers to add an icon into a status bar? I followed code from a book. The code is simple: @interface UIApplication (extended) - (void) addStatusBarImageNamed:(NSString *)aName; - (void) removeStatusBarImageNamed:(NSString *)aName;
@end
- (void)p... | TITLE:
How to add an icon into iphone/ipod status bar?
QUESTION:
Does Apple not allow developers to add an icon into a status bar? I followed code from a book. The code is simple: @interface UIApplication (extended) - (void) addStatusBarImageNamed:(NSString *)aName; - (void) removeStatusBarImageNamed:(NSString *)aName... | [
"iphone",
"cocoa-touch",
"ios",
"icons",
"statusbar"
] | 2 | 0 | 6,038 | 2 | 0 | 2011-06-08T09:11:24.463000 | 2011-06-08T09:26:42.360000 |
6,276,544 | 6,276,663 | ASP.NET - Adding an UpdatePanel trigger to a LinkButton inside a gridview | I was trying to update the content of a modal dialog, and this code works for me: However, when I try to place the LinkButton inside a gridview, like so: This does not work, I get an error saying: A control with ID 'updateSomething' could not be found for the trigger in UpdatePanel 'upNewUpdatePanel'. How can I use the... | Try and add the asp:AsyncPostBackTrigger to the asp:GridView 's OnRowCommand event and handle the link button click in that event and in the cs create the event like this protected void grdListUsers_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "update-something") { grdListUsers.SelectedI... | ASP.NET - Adding an UpdatePanel trigger to a LinkButton inside a gridview I was trying to update the content of a modal dialog, and this code works for me: However, when I try to place the LinkButton inside a gridview, like so: This does not work, I get an error saying: A control with ID 'updateSomething' could not be ... | TITLE:
ASP.NET - Adding an UpdatePanel trigger to a LinkButton inside a gridview
QUESTION:
I was trying to update the content of a modal dialog, and this code works for me: However, when I try to place the LinkButton inside a gridview, like so: This does not work, I get an error saying: A control with ID 'updateSometh... | [
"asp.net",
"gridview",
"updatepanel",
"linkbutton"
] | 5 | 10 | 50,221 | 4 | 0 | 2011-06-08T09:11:35.990000 | 2011-06-08T09:25:49.453000 |
6,276,564 | 6,277,010 | Is it safe to keep all databases on one SQL server? | I'm creating a Multi-Tenant application that uses separate databases for each 'client'. Is it safe to keep all the clients databases on one SQL server? Assuming I give each db its own user account? Thanks | There was an excellent blog post by Brent Ozar last week on this exact subject. How To Design Multi-Client Databases | Is it safe to keep all databases on one SQL server? I'm creating a Multi-Tenant application that uses separate databases for each 'client'. Is it safe to keep all the clients databases on one SQL server? Assuming I give each db its own user account? Thanks | TITLE:
Is it safe to keep all databases on one SQL server?
QUESTION:
I'm creating a Multi-Tenant application that uses separate databases for each 'client'. Is it safe to keep all the clients databases on one SQL server? Assuming I give each db its own user account? Thanks
ANSWER:
There was an excellent blog post by ... | [
"sql-server",
"security",
"production-environment",
"multi-tenant"
] | 1 | 1 | 216 | 3 | 0 | 2011-06-08T09:14:22.570000 | 2011-06-08T09:55:59.783000 |
6,276,570 | 6,276,831 | How to store data in QMap & Qlist in QT? | How to store data in QMap & Qlist and retrieve them in QT? My requirement is I have Schedule Name which are Monday - Sunday and Schedule Items like "Sunday, 12:00 - 17:30"......... Now I want to have 2 QlistWidget one contains schedule names and other contains Schedule items, now when i select one Schedule name in firs... | You need something like this to store your data. //Declare your map QMap > map;
//Populate your map in a function void populateMap () {
QList sundaylist; sundaylist<< "Sunday, 12:00 - 17:30" << "Sunday, 18:00 - 20:30"; map ["Sunday"] = sundaylist;
QList mondaylist; mondaylist<< "Monday, 12:00 - 17:30" << "Monday, 18... | How to store data in QMap & Qlist in QT? How to store data in QMap & Qlist and retrieve them in QT? My requirement is I have Schedule Name which are Monday - Sunday and Schedule Items like "Sunday, 12:00 - 17:30"......... Now I want to have 2 QlistWidget one contains schedule names and other contains Schedule items, no... | TITLE:
How to store data in QMap & Qlist in QT?
QUESTION:
How to store data in QMap & Qlist and retrieve them in QT? My requirement is I have Schedule Name which are Monday - Sunday and Schedule Items like "Sunday, 12:00 - 17:30"......... Now I want to have 2 QlistWidget one contains schedule names and other contains ... | [
"qt",
"qlist",
"qmap"
] | 0 | 3 | 5,493 | 1 | 0 | 2011-06-08T09:15:09.077000 | 2011-06-08T09:42:20.993000 |
6,276,572 | 6,276,962 | Rhino Mocks SetupResult fails | public class simplemocking { public interface IFoo { int foo (); } public void fii() { IFoo foo = MockRepository.GenerateMock (); SetupResult.For (foo.foo ()).Return (5).Repeat.Any (); Console.WriteLine (foo.foo ()); } } Exception: Invalid call, the last call has been used or no call has been made (make sure that you a... | Maybe you can try to use extension methods instead of SetupFor Replace the second line by: foo.Stub(f => f.foo()).Return(5).Repeat.Any(); | Rhino Mocks SetupResult fails public class simplemocking { public interface IFoo { int foo (); } public void fii() { IFoo foo = MockRepository.GenerateMock (); SetupResult.For (foo.foo ()).Return (5).Repeat.Any (); Console.WriteLine (foo.foo ()); } } Exception: Invalid call, the last call has been used or no call has b... | TITLE:
Rhino Mocks SetupResult fails
QUESTION:
public class simplemocking { public interface IFoo { int foo (); } public void fii() { IFoo foo = MockRepository.GenerateMock (); SetupResult.For (foo.foo ()).Return (5).Repeat.Any (); Console.WriteLine (foo.foo ()); } } Exception: Invalid call, the last call has been use... | [
"c#",
"mocking"
] | 1 | 1 | 846 | 1 | 0 | 2011-06-08T09:15:19.603000 | 2011-06-08T09:51:05.867000 |
6,276,573 | 6,276,716 | How to define a dictionary like structure in Oracle PL SQL? | How to define in PL/SQL the following structure: A list of strings which contains multiple rows. Example: 'User A' --> (1) --> 1 (2) --> 2
'User B' --> (1) --> 0 (2) --> 9 The integers are defined as: TYPE number_arry IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; How to define the whole structure? I want to fill this st... | You could use the following structure: SQL> CREATE TABLE my_table AS 2 SELECT 1 user_a, 0 user_b FROM dual 3 UNION ALL SELECT 2, 0 FROM dual 4 UNION ALL SELECT 3, 9 FROM dual;
Table created
SQL> DECLARE 2 CURSOR c1 IS 3 SELECT User_A, User_B FROM my_table; 4 TYPE number_arry IS TABLE OF NUMBER INDEX BY BINARY_INTEGER... | How to define a dictionary like structure in Oracle PL SQL? How to define in PL/SQL the following structure: A list of strings which contains multiple rows. Example: 'User A' --> (1) --> 1 (2) --> 2
'User B' --> (1) --> 0 (2) --> 9 The integers are defined as: TYPE number_arry IS TABLE OF NUMBER INDEX BY BINARY_INTEGE... | TITLE:
How to define a dictionary like structure in Oracle PL SQL?
QUESTION:
How to define in PL/SQL the following structure: A list of strings which contains multiple rows. Example: 'User A' --> (1) --> 1 (2) --> 2
'User B' --> (1) --> 0 (2) --> 9 The integers are defined as: TYPE number_arry IS TABLE OF NUMBER INDE... | [
"sql",
"oracle",
"varray"
] | 3 | 8 | 3,718 | 1 | 0 | 2011-06-08T09:15:28.093000 | 2011-06-08T09:30:51.907000 |
6,276,576 | 6,276,652 | How to Convert integer to char array | int x = 1231212; memcpy(pDVal, &x, 4); int iDSize = sizeof(double); int i = 0; for (; i I used above code segment to print the hex value of each byte of a Integer. But that is not working properly. What is issue here? | Try something like this: void Int32ToUInt8Arr( int32 val, uint8 *pBytes ) { pBytes[0] = (uint8)val; pBytes[1] = (uint8)(val >> 8); pBytes[2] = (uint8)(val >> 16); pBytes[3] = (uint8)(val >> 24); } or perhaps: UInt32 arg = 18; array ^byteArray = BitConverter::GetBytes( arg); // {0x12, 0x00, 0x00, 0x00 }
byteArray->Reve... | How to Convert integer to char array int x = 1231212; memcpy(pDVal, &x, 4); int iDSize = sizeof(double); int i = 0; for (; i I used above code segment to print the hex value of each byte of a Integer. But that is not working properly. What is issue here? | TITLE:
How to Convert integer to char array
QUESTION:
int x = 1231212; memcpy(pDVal, &x, 4); int iDSize = sizeof(double); int i = 0; for (; i I used above code segment to print the hex value of each byte of a Integer. But that is not working properly. What is issue here?
ANSWER:
Try something like this: void Int32ToU... | [
"c++"
] | 0 | 1 | 1,785 | 5 | 0 | 2011-06-08T09:16:05.733000 | 2011-06-08T09:24:32.193000 |
6,276,581 | 6,278,336 | Prototype chain can't get Object()? | I read an article which explains what prototype chain is. It says that if I try to access an object's property but it doesn't have it, javascript engine will try it's.constructor.propotype. If it doesn't have it either then try.construtor.propotype.constructor.propotype. Untill it find the built-in Object(). But I test... | In JS OOP the constructor and prototype properties are flaky, in that they aren't set for you when you perform inheritance. You are supposed to manually set/alter them to implement inheritance. See, for example, this tutorial. It looks like the way you're trying to climb the prototype chain (by traversing through.const... | Prototype chain can't get Object()? I read an article which explains what prototype chain is. It says that if I try to access an object's property but it doesn't have it, javascript engine will try it's.constructor.propotype. If it doesn't have it either then try.construtor.propotype.constructor.propotype. Untill it fi... | TITLE:
Prototype chain can't get Object()?
QUESTION:
I read an article which explains what prototype chain is. It says that if I try to access an object's property but it doesn't have it, javascript engine will try it's.constructor.propotype. If it doesn't have it either then try.construtor.propotype.constructor.propo... | [
"javascript",
"prototype-oriented"
] | 3 | 2 | 1,131 | 2 | 0 | 2011-06-08T09:16:18.437000 | 2011-06-08T11:58:05.297000 |
6,276,583 | 6,276,650 | clustering cell tower ids | If you have a list of cell tower ids and their respective start and end time (i.e. the time the phone was registered at that tower), is there an easy to cluster the ids and visualise the cells and their clusters in a diagram? Thanks | Not without some knowledge of location. Minimally at start time and at end time. If you were travelling in a line for example you could estimate the distance of the tower from the midpoint of those. If you just have time data but no location data there is nothing you can map. Edit: To simplify, if you have no location ... | clustering cell tower ids If you have a list of cell tower ids and their respective start and end time (i.e. the time the phone was registered at that tower), is there an easy to cluster the ids and visualise the cells and their clusters in a diagram? Thanks | TITLE:
clustering cell tower ids
QUESTION:
If you have a list of cell tower ids and their respective start and end time (i.e. the time the phone was registered at that tower), is there an easy to cluster the ids and visualise the cells and their clusters in a diagram? Thanks
ANSWER:
Not without some knowledge of loca... | [
"cluster-analysis",
"telecommunication",
"cellular-network"
] | 1 | 0 | 283 | 1 | 0 | 2011-06-08T09:16:44.497000 | 2011-06-08T09:23:59.897000 |
6,276,588 | 6,276,789 | Saving out a javascript object? | Is it possible to save out some javascript object purely on client-side? My question come from the following workflow: a user enters and posts a text, i do some processing on the server side and return processed text to the user. The user can do some modifications to the returned text, if he doesn't like some processed... | You could implement this functionality with a server side functionality, but not with JavaScript. Pressing 'Save' would create an AJAX call to the server which responds with the file correct headers, making the browser respond with a "Save file" dialog. | Saving out a javascript object? Is it possible to save out some javascript object purely on client-side? My question come from the following workflow: a user enters and posts a text, i do some processing on the server side and return processed text to the user. The user can do some modifications to the returned text, i... | TITLE:
Saving out a javascript object?
QUESTION:
Is it possible to save out some javascript object purely on client-side? My question come from the following workflow: a user enters and posts a text, i do some processing on the server side and return processed text to the user. The user can do some modifications to th... | [
"javascript"
] | 2 | 1 | 600 | 3 | 0 | 2011-06-08T09:17:22.363000 | 2011-06-08T09:38:33.607000 |
6,276,595 | 6,276,731 | about CommonCrypto on iphone SDK.. Can it generate RSA keys and encrypt/decrypt? | I'm trying to know if I can generate RSA keypair from CommonCrypto on iphone. Is there any good guide or doc on commonCrypto somewhere? Does anybody can tell me what is possible to do with CommonCrypto? Does anybody can tell what else I am suppose to use to create RSA keypair and encrypt something on iphone? | The official Security Overview documentation is a good starting point to get a picture what's possible with iOS SDK. Have a look at CryptoExercise, an Apple iOS example app: This sample demonstrates the use of the two main Cryptographic API sets on the iPhone OS SDK. Asymmetric Key Encryption and random nonce generatio... | about CommonCrypto on iphone SDK.. Can it generate RSA keys and encrypt/decrypt? I'm trying to know if I can generate RSA keypair from CommonCrypto on iphone. Is there any good guide or doc on commonCrypto somewhere? Does anybody can tell me what is possible to do with CommonCrypto? Does anybody can tell what else I am... | TITLE:
about CommonCrypto on iphone SDK.. Can it generate RSA keys and encrypt/decrypt?
QUESTION:
I'm trying to know if I can generate RSA keypair from CommonCrypto on iphone. Is there any good guide or doc on commonCrypto somewhere? Does anybody can tell me what is possible to do with CommonCrypto? Does anybody can t... | [
"iphone",
"cryptography"
] | 10 | 5 | 11,140 | 1 | 0 | 2011-06-08T09:17:46.810000 | 2011-06-08T09:32:10.437000 |
6,276,599 | 6,276,613 | How to change the Font in the entire Swing UI application | I have made a swing application. Now I want to change the Font of entire Swing Application, so that any component being added should follow that Font only. Is there any way to achieve the same? | public static void setGlobalFont( Font font ) { Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements() ) { Object key = keys.nextElement(); Object value = UIManager.get( key ); if ( value instanceof Font ) { UIManager.put( key, font ); } } } | How to change the Font in the entire Swing UI application I have made a swing application. Now I want to change the Font of entire Swing Application, so that any component being added should follow that Font only. Is there any way to achieve the same? | TITLE:
How to change the Font in the entire Swing UI application
QUESTION:
I have made a swing application. Now I want to change the Font of entire Swing Application, so that any component being added should follow that Font only. Is there any way to achieve the same?
ANSWER:
public static void setGlobalFont( Font fo... | [
"java",
"swing",
"fonts"
] | 4 | 10 | 2,866 | 1 | 0 | 2011-06-08T09:18:26.107000 | 2011-06-08T09:19:59.690000 |
6,276,607 | 6,276,886 | Selection of frame work for a Java Application | I am going to work on an complex application.Application is about to create lakhs of form dynamically, on those form rules can be apply dynamically and transactions of that forms. For this application points that must be keep in mind are below: 1.Fast Loading: 1.1 Intial application load time must be smaller. 1.2 As th... | I am surprised you found issues with GWT. Personally I feel, it is one of the cleanest front-end implementations. (did you face issues integrating it with hybernate maybe?) Anyways, another framework that is java style based (extends gwt and is richer) is Smart GWT that you can look into. I did a detailed comparison he... | Selection of frame work for a Java Application I am going to work on an complex application.Application is about to create lakhs of form dynamically, on those form rules can be apply dynamically and transactions of that forms. For this application points that must be keep in mind are below: 1.Fast Loading: 1.1 Intial a... | TITLE:
Selection of frame work for a Java Application
QUESTION:
I am going to work on an complex application.Application is about to create lakhs of form dynamically, on those form rules can be apply dynamically and transactions of that forms. For this application points that must be keep in mind are below: 1.Fast Loa... | [
"java",
"hibernate",
"architecture"
] | 1 | 1 | 123 | 2 | 0 | 2011-06-08T09:19:11.580000 | 2011-06-08T09:45:54.893000 |
6,276,611 | 6,276,623 | set local dos variables from java code | If "java -jar" is run from a command line, is there a way to set local dos variable from java program so that after java is exited, it can still be present in the same session? example (cmd) c:\java package.Class
/*then in program you do something like 'System.setVariable("name","value");' */
// java exited
echo %na... | No. Processes cannot modify their parents' environment. The best thing you can do is cheat a little and do either of the following: Let the Java program write out a batch file in some known location and call it afterwards to set variables. Since batch files run in the current cmd process they can alter environment vari... | set local dos variables from java code If "java -jar" is run from a command line, is there a way to set local dos variable from java program so that after java is exited, it can still be present in the same session? example (cmd) c:\java package.Class
/*then in program you do something like 'System.setVariable("name",... | TITLE:
set local dos variables from java code
QUESTION:
If "java -jar" is run from a command line, is there a way to set local dos variable from java program so that after java is exited, it can still be present in the same session? example (cmd) c:\java package.Class
/*then in program you do something like 'System.s... | [
"java",
"batch-file",
"dos",
"windows-console"
] | 2 | 3 | 1,148 | 3 | 0 | 2011-06-08T09:19:47.293000 | 2011-06-08T09:20:57.863000 |
6,276,614 | 6,276,635 | store Os.system result in variable | hello guys i'm wondering how to store os.system result in variable as we know it's return 0 so i'm wondering what i should do to store the result and second question: how to get ip in Linux [ somebody will suggest ifconfig ] but ifconfig show so many result i just wana the IP | import os from subprocess import *
def run_cmd(cmd): p = Popen(cmd, shell=True, stdout=PIPE) output = p.communicate()[0] return output As for the second question, see http://www.cyberciti.biz/tips/read-unixlinux-system-ip-address-in-a-shell-script.html | store Os.system result in variable hello guys i'm wondering how to store os.system result in variable as we know it's return 0 so i'm wondering what i should do to store the result and second question: how to get ip in Linux [ somebody will suggest ifconfig ] but ifconfig show so many result i just wana the IP | TITLE:
store Os.system result in variable
QUESTION:
hello guys i'm wondering how to store os.system result in variable as we know it's return 0 so i'm wondering what i should do to store the result and second question: how to get ip in Linux [ somebody will suggest ifconfig ] but ifconfig show so many result i just wa... | [
"python",
"linux",
"variables",
"os.system"
] | 2 | 1 | 2,950 | 3 | 0 | 2011-06-08T09:20:00.713000 | 2011-06-08T09:22:18.630000 |
6,276,618 | 6,278,037 | Autotools: Switching part of project to a different compiler | I'm working on a big, old, project that is using autotools. I would like to switch one part of the project to C++ (from C). How can I switch the compiler used for a part of the project? I don't like the idea of completely splitting the project into two parts. The directory has only Makefile.am and I suppose I should re... | You must define output variable CXX in configure.ac (the simplest way is by using AC_PROG_CXX macro), then all files with appropriate suffixes (.cc,.cpp) will be compiled by C++ compiler. | Autotools: Switching part of project to a different compiler I'm working on a big, old, project that is using autotools. I would like to switch one part of the project to C++ (from C). How can I switch the compiler used for a part of the project? I don't like the idea of completely splitting the project into two parts.... | TITLE:
Autotools: Switching part of project to a different compiler
QUESTION:
I'm working on a big, old, project that is using autotools. I would like to switch one part of the project to C++ (from C). How can I switch the compiler used for a part of the project? I don't like the idea of completely splitting the proje... | [
"c++",
"c",
"compiler-construction",
"autotools"
] | 1 | 4 | 222 | 2 | 0 | 2011-06-08T09:20:26.203000 | 2011-06-08T11:29:39.220000 |
6,276,625 | 6,276,706 | entity framework not available in Visual Studio 2010 | I have a strange error with Visual Studio 2010 in that Entity Framework doesn't work for me. In the toolbox down the side the icon for the EntityDataSource (and several other components) shows a text snippet icon: Then when I try to insert it via double clicking I just get a massive bunch of text inserted instead of th... | It seems that the most obvious solution doesn't occur until after you have spent 10 minutes taking screenshots and posting up a question on SO. I have just solved this issue by right clicking on the toolbox and choose Reset Toolbox. | entity framework not available in Visual Studio 2010 I have a strange error with Visual Studio 2010 in that Entity Framework doesn't work for me. In the toolbox down the side the icon for the EntityDataSource (and several other components) shows a text snippet icon: Then when I try to insert it via double clicking I ju... | TITLE:
entity framework not available in Visual Studio 2010
QUESTION:
I have a strange error with Visual Studio 2010 in that Entity Framework doesn't work for me. In the toolbox down the side the icon for the EntityDataSource (and several other components) shows a text snippet icon: Then when I try to insert it via do... | [
"visual-studio-2010",
"entity-framework"
] | 0 | 0 | 1,598 | 1 | 0 | 2011-06-08T09:21:06.447000 | 2011-06-08T09:29:43 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.