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,289,254
6,289,320
What is port 8000 used for in play
Listening for transport dt_socket at address: 8000 The above string is spewed out during Play Framework initialization, how is this port used?
Basically your application will run on port 9000 And As i know it will listen for client debugger on port 8000 and socketAttach will use dt_socket as transport
What is port 8000 used for in play Listening for transport dt_socket at address: 8000 The above string is spewed out during Play Framework initialization, how is this port used?
TITLE: What is port 8000 used for in play QUESTION: Listening for transport dt_socket at address: 8000 The above string is spewed out during Play Framework initialization, how is this port used? ANSWER: Basically your application will run on port 9000 And As i know it will listen for client debugger on port 8000 and ...
[ "playframework" ]
3
3
633
1
0
2011-06-09T07:06:47.807000
2011-06-09T07:13:33.843000
6,289,263
6,289,324
How do you use SOAP::Lite?
I am very new to linux and perl and I am trying to use SOAP::Lite as an API for ffencoderd, a daemon to convert my videos in background. I know I am probably doing something stupid but I read the documentation SOAP::Lite and is says to type use SOAP::Lite. I type into the terminal use SOAP::Lite and it says 'no command...
Your problem seems to be that you don't know Perl, rather then that you don't know SOAP::Lite. You might like to start with the Modern Perl book (in hard copy or a free ebook). SOAP::Lite is a module, not an executable, so you don't run it directly from the command line. use is part of the Perl language, not an executa...
How do you use SOAP::Lite? I am very new to linux and perl and I am trying to use SOAP::Lite as an API for ffencoderd, a daemon to convert my videos in background. I know I am probably doing something stupid but I read the documentation SOAP::Lite and is says to type use SOAP::Lite. I type into the terminal use SOAP::L...
TITLE: How do you use SOAP::Lite? QUESTION: I am very new to linux and perl and I am trying to use SOAP::Lite as an API for ffencoderd, a daemon to convert my videos in background. I know I am probably doing something stupid but I read the documentation SOAP::Lite and is says to type use SOAP::Lite. I type into the te...
[ "linux", "perl", "soap" ]
0
4
492
2
0
2011-06-09T07:07:37.480000
2011-06-09T07:13:43.330000
6,289,264
6,289,866
Symfony2: Auth using Doctrine2 entity - password set to blank value after saving an entity
I've hit a dead end here. When I save any kind of entity in my controller, the password and salt of the user that is currently logged in is blanked out in the database. This is a relevant portion of my security configuration: security: encoders: ISE\LoginBundle\Entity\User: algorithm: sha1 iterations: 1 encode_as_base6...
Symfony has a difference between plaintext and hashed credetials. In "eraseCredentials" you are supposed to delete all the plaintext information, not the hashed credetials that are saved to the database.
Symfony2: Auth using Doctrine2 entity - password set to blank value after saving an entity I've hit a dead end here. When I save any kind of entity in my controller, the password and salt of the user that is currently logged in is blanked out in the database. This is a relevant portion of my security configuration: sec...
TITLE: Symfony2: Auth using Doctrine2 entity - password set to blank value after saving an entity QUESTION: I've hit a dead end here. When I save any kind of entity in my controller, the password and salt of the user that is currently logged in is blanked out in the database. This is a relevant portion of my security ...
[ "php", "authentication", "entity", "doctrine-orm", "symfony" ]
2
5
1,833
1
0
2011-06-09T07:07:37.947000
2011-06-09T08:09:27.293000
6,289,266
6,289,643
Did anybody ever migrate from Accurev to ClearCase?
I heard a lot of stories about people migrating from ClearCase to AccuRev. But I've never heard of migration in the opposite direction. Is it because nobody ever dropped AccuRev in favor of ClearCase? Did you considered both and gone with ClearCase? I know that AccuRev is a great version control system, but I want to k...
The only reason you would migrate from Accurev to ClearCase would be if: ClearCase was part of a IBM deal including much more than a simple VCS (usually many servers and other softwares) IBM support was part of the consideration (IBM offering a very complete and detailed support for all its software) But beside that ex...
Did anybody ever migrate from Accurev to ClearCase? I heard a lot of stories about people migrating from ClearCase to AccuRev. But I've never heard of migration in the opposite direction. Is it because nobody ever dropped AccuRev in favor of ClearCase? Did you considered both and gone with ClearCase? I know that AccuRe...
TITLE: Did anybody ever migrate from Accurev to ClearCase? QUESTION: I heard a lot of stories about people migrating from ClearCase to AccuRev. But I've never heard of migration in the opposite direction. Is it because nobody ever dropped AccuRev in favor of ClearCase? Did you considered both and gone with ClearCase? ...
[ "version-control", "migration", "clearcase", "accurev" ]
2
2
591
1
0
2011-06-09T07:07:42.117000
2011-06-09T07:47:19.277000
6,289,277
6,289,299
Count of td (table) using jQuery?
Text Text Text Text Text Text Text That is my HTML.. I want to know the count of td's which does not have an empty div (with class="inside") in jQuery? How do I go about it?
Something like this, with the has, not, and empty selectors: $('td:not(:has(div.inside:empty))').length;
Count of td (table) using jQuery? Text Text Text Text Text Text Text That is my HTML.. I want to know the count of td's which does not have an empty div (with class="inside") in jQuery? How do I go about it?
TITLE: Count of td (table) using jQuery? QUESTION: Text Text Text Text Text Text Text That is my HTML.. I want to know the count of td's which does not have an empty div (with class="inside") in jQuery? How do I go about it? ANSWER: Something like this, with the has, not, and empty selectors: $('td:not(:has(div.insid...
[ "jquery", "html", "jquery-selectors" ]
4
10
2,848
3
0
2011-06-09T07:09:06.143000
2011-06-09T07:11:50.770000
6,289,285
6,289,434
Why is the class information for this html element not accessed by Javascript?
In my HTML for my file I have a div with the id "divNavyBox." The code is below. Note that once the mouse hovers over it, it executes the doAnimation() from var animated. var animated = { el: document.getElementById("divNavyBox"), doAnimation: function() { if (el.className=="box") { el.className="boxAlt"; } if (el.c...
here you assign boxAlt if current = box if (el.className=="box") { el.className="boxAlt"; } here you switch back if current is boxAlt which is allways true if the class has been box from the beginning. if (el.className=="boxAlt") { el.className="box"; } Change it to something like: doAnimation: function() { el.classNam...
Why is the class information for this html element not accessed by Javascript? In my HTML for my file I have a div with the id "divNavyBox." The code is below. Note that once the mouse hovers over it, it executes the doAnimation() from var animated. var animated = { el: document.getElementById("divNavyBox"), doAnimat...
TITLE: Why is the class information for this html element not accessed by Javascript? QUESTION: In my HTML for my file I have a div with the id "divNavyBox." The code is below. Note that once the mouse hovers over it, it executes the doAnimation() from var animated. var animated = { el: document.getElementById("divNa...
[ "javascript" ]
0
2
106
3
0
2011-06-09T07:10:09.133000
2011-06-09T07:25:33.810000
6,289,286
6,289,387
How to use regex match end of line in Windows
I have a.txt file created in Windows and now should be edited in Linux. I want to match the end of a line with grep. Let's say the content of the line I am going to find is "foo bar" in file bar. Then I issue the command grep 'r$' bar, but no output yielded. Given in Windows a new line consists of '\r\n', different fro...
If your grep supports -P (perl-regexp), then to match a CRLF: grep -P '\r$' file or: grep Ctrl+V Ctrl+M file ( Ctrl+V Ctrl+M will produce ^M )
How to use regex match end of line in Windows I have a.txt file created in Windows and now should be edited in Linux. I want to match the end of a line with grep. Let's say the content of the line I am going to find is "foo bar" in file bar. Then I issue the command grep 'r$' bar, but no output yielded. Given in Window...
TITLE: How to use regex match end of line in Windows QUESTION: I have a.txt file created in Windows and now should be edited in Linux. I want to match the end of a line with grep. Let's say the content of the line I am going to find is "foo bar" in file bar. Then I issue the command grep 'r$' bar, but no output yielde...
[ "regex", "linux", "grep", "newline" ]
15
10
15,680
4
0
2011-06-09T07:10:09.473000
2011-06-09T07:20:42.103000
6,289,287
6,289,362
jQuery Text Replace
Have some text that needs to be replaced, searched around this website for all results with similar titles and no luck. Currently the text is Handling Fee: and I need it to say Shipping Insurance: - Please Help! Here's the html output of the page; Order Summary Quantity Product Price Total 1 ACT Clutch Kit - Heavy Duty...
You can use a jQuery:contains selector: $("td:contains('Handling Fee:')").text("Shipping Insurance:"); You can see it in action here: http://jsfiddle.net/cnhYj/ Update in order to get it to work after the document is ready you can write it like that: $(function() { $("td:contains('Handling Fee:')").text("Shipping Insur...
jQuery Text Replace Have some text that needs to be replaced, searched around this website for all results with similar titles and no luck. Currently the text is Handling Fee: and I need it to say Shipping Insurance: - Please Help! Here's the html output of the page; Order Summary Quantity Product Price Total 1 ACT Clu...
TITLE: jQuery Text Replace QUESTION: Have some text that needs to be replaced, searched around this website for all results with similar titles and no luck. Currently the text is Handling Fee: and I need it to say Shipping Insurance: - Please Help! Here's the html output of the page; Order Summary Quantity Product Pri...
[ "javascript", "jquery", "html", "text", "replace" ]
2
7
8,777
3
0
2011-06-09T07:10:35.143000
2011-06-09T07:17:35.200000
6,289,291
6,289,547
Zend cache frontend configuration
Zend_Cache can be configured to cache several types of output, including the results of function calls, the results of object and static method calls, entire pages, and configuration data. Given this controller and related views how would you go with caching?From what some of you suggested here (see @marcin) I understo...
Sorry I did not replay earlier. Quickly, I'll would like to present one way of catching this for your consideration. For simplicity, I'll just concentrate on caching your outputs using Output frontend. In you application.ini you can setup your catching as follows: resources.cachemanager.myviewcache.frontend.name = Outp...
Zend cache frontend configuration Zend_Cache can be configured to cache several types of output, including the results of function calls, the results of object and static method calls, entire pages, and configuration data. Given this controller and related views how would you go with caching?From what some of you sugge...
TITLE: Zend cache frontend configuration QUESTION: Zend_Cache can be configured to cache several types of output, including the results of function calls, the results of object and static method calls, entire pages, and configuration data. Given this controller and related views how would you go with caching?From what...
[ "php", "zend-framework", "caching" ]
1
4
2,204
2
0
2011-06-09T07:11:06.577000
2011-06-09T07:38:31.347000
6,289,310
6,289,364
Cannot do normal select in mysql database
I try to do normal select on database, like select * from xxx limit 0,30. But I get this message: ERROR 29 (HY000): File 'tablename.MYD' not found (Errcode: 13) I try to search the file on mysql datafile folder, and I find it. How can this happen.
Can you access the database using a tool like PhpMyAdmin? According to this site a full repair should solve it: mysqlcheck --all-databases --auto-repair -ucojjohealth -p If that doesn't solve it: While the above command repairs corrupted databases in most cases, there is a possibility of getting a new error message aft...
Cannot do normal select in mysql database I try to do normal select on database, like select * from xxx limit 0,30. But I get this message: ERROR 29 (HY000): File 'tablename.MYD' not found (Errcode: 13) I try to search the file on mysql datafile folder, and I find it. How can this happen.
TITLE: Cannot do normal select in mysql database QUESTION: I try to do normal select on database, like select * from xxx limit 0,30. But I get this message: ERROR 29 (HY000): File 'tablename.MYD' not found (Errcode: 13) I try to search the file on mysql datafile folder, and I find it. How can this happen. ANSWER: Can...
[ "mysql" ]
0
1
6,373
3
0
2011-06-09T07:12:25.110000
2011-06-09T07:18:10.817000
6,289,329
6,289,404
Using dropbox and git without conflitcts
I'm working with people using only Dropbox as version control and collaboration tool. I don't intend to change their behavior. On the other hand, I'm a git-addicted, and want to use it for my personal use. Is their anyway to have a.git directory without syncing it in Dropbox? Thanks
According to this thread in the Dropbox forum, you can't omit/exclude folders. There is Selective Sync but that also doesn't what you need. So the best solution right now is to sync manually, for example with rsync(1): Create a new folder somewhere Sync this folder with the folder in Dropbox using rsync. I suggest to w...
Using dropbox and git without conflitcts I'm working with people using only Dropbox as version control and collaboration tool. I don't intend to change their behavior. On the other hand, I'm a git-addicted, and want to use it for my personal use. Is their anyway to have a.git directory without syncing it in Dropbox? Th...
TITLE: Using dropbox and git without conflitcts QUESTION: I'm working with people using only Dropbox as version control and collaboration tool. I don't intend to change their behavior. On the other hand, I'm a git-addicted, and want to use it for my personal use. Is their anyway to have a.git directory without syncing...
[ "git", "dropbox" ]
18
12
5,910
5
0
2011-06-09T07:14:58.483000
2011-06-09T07:22:19.690000
6,289,344
6,289,505
Basic struts 2 application for understanding
I started reading about struts2 yesterday and came across the below slide. Site link It gave a good picture of what can be done with struts2, I want if somebody can demonstrate the above image with an example working code for a simple CRUD webapp (with simple empid and empname in db). This can turn out to be a nice tut...
Have a look at AppFuse It can create a project skeleton using a variety of web frameworks (including Struts 2) for you to experiment with.
Basic struts 2 application for understanding I started reading about struts2 yesterday and came across the below slide. Site link It gave a good picture of what can be done with struts2, I want if somebody can demonstrate the above image with an example working code for a simple CRUD webapp (with simple empid and empna...
TITLE: Basic struts 2 application for understanding QUESTION: I started reading about struts2 yesterday and came across the below slide. Site link It gave a good picture of what can be done with struts2, I want if somebody can demonstrate the above image with an example working code for a simple CRUD webapp (with simp...
[ "java", "struts2" ]
0
1
448
2
0
2011-06-09T07:16:11.347000
2011-06-09T07:33:51.587000
6,289,358
6,289,644
Edit option in Android tableLayout like in iphone UITableView
I need to have an edit option in tableLayout just like in iphone UITableView. When edit button is clicked a Delete button should appear in each row of tableLayout. What I just did was I created a Delete button in each row at runtime and made it hide. And when Edit button is clicked, Delete button gets visible. But I do...
You can always make a seperate xml file containing only a delete button and then inflate it into all the rows when the edit button is clicked.That way you dont have to hide all those delete buttons and can add them only if needed... Create a new xml file under res->layout and add only this to it Then just inflate it in...
Edit option in Android tableLayout like in iphone UITableView I need to have an edit option in tableLayout just like in iphone UITableView. When edit button is clicked a Delete button should appear in each row of tableLayout. What I just did was I created a Delete button in each row at runtime and made it hide. And whe...
TITLE: Edit option in Android tableLayout like in iphone UITableView QUESTION: I need to have an edit option in tableLayout just like in iphone UITableView. When edit button is clicked a Delete button should appear in each row of tableLayout. What I just did was I created a Delete button in each row at runtime and mad...
[ "android" ]
0
1
1,170
2
0
2011-06-09T07:17:22.417000
2011-06-09T07:47:19.607000
6,289,365
6,298,964
Shell script re-directing output with tee command buffers output in some cases and not in others
I've simplified a shell script down to two commands: Terminal A (Redirect STDIN to a named pipe): tee -a >>pipe Terminal B (Read from the pipe used above): tail -f pipe The results I don't understand: Result 1: Start tee, start tail: any input into the first terminal will be buffered and only show up in the 2nd after t...
I'm not an expert on this, but the behavior seems straightforward. Suppose you apply tail to an ordinary text file; it will print the last 10 lines and quit. If you use tail -f, it will print the last 10 lines, then monitor the file; from then on it will print each new line that is appended to the file. This is the lin...
Shell script re-directing output with tee command buffers output in some cases and not in others I've simplified a shell script down to two commands: Terminal A (Redirect STDIN to a named pipe): tee -a >>pipe Terminal B (Read from the pipe used above): tail -f pipe The results I don't understand: Result 1: Start tee, s...
TITLE: Shell script re-directing output with tee command buffers output in some cases and not in others QUESTION: I've simplified a shell script down to two commands: Terminal A (Redirect STDIN to a named pipe): tee -a >>pipe Terminal B (Read from the pipe used above): tail -f pipe The results I don't understand: Resu...
[ "shell", "unix", "tail", "tee" ]
1
0
1,786
1
0
2011-06-09T07:18:20.127000
2011-06-09T20:40:52.013000
6,289,368
6,289,395
What are reverse generic relationships used for?
The documentation on contenttypes says this: If you know which models you'll be using most often, you can also add a "reverse" generic relationship to enable an additional API. But what's their practical use? I fail to understand.
If you have a model with: A) Kitchen ---generic relation---> any food But you know you will do often: B) Vegetables.get_kitchen() Instead of doing get_kitchen() manually, you can add the reverse relationship in the Vegetable model and it will get the Kitchen for you. This kind of reverse relation is automaticly added t...
What are reverse generic relationships used for? The documentation on contenttypes says this: If you know which models you'll be using most often, you can also add a "reverse" generic relationship to enable an additional API. But what's their practical use? I fail to understand.
TITLE: What are reverse generic relationships used for? QUESTION: The documentation on contenttypes says this: If you know which models you'll be using most often, you can also add a "reverse" generic relationship to enable an additional API. But what's their practical use? I fail to understand. ANSWER: If you have a...
[ "django", "contenttypes" ]
0
3
267
1
0
2011-06-09T07:18:56.977000
2011-06-09T07:21:34.360000
6,289,371
6,289,416
jQuery Media Plugin doesnt works in firefox4
I had used jquery media plugin to display pdf file in html This is my following codes... New document PDF File My html file displays pdf file in all browser except ff4. Why Firefox4 doesnt display pdf file instead of displaying it throw out pdf file as download file
Do you have the Adobe Reader plugin installed on FF4? Even so there looks to be a bug http://support.mozilla.com/en-US/questions/803288. Best test - can you view other pdf files, from other sites in the FF4 browser?
jQuery Media Plugin doesnt works in firefox4 I had used jquery media plugin to display pdf file in html This is my following codes... New document PDF File My html file displays pdf file in all browser except ff4. Why Firefox4 doesnt display pdf file instead of displaying it throw out pdf file as download file
TITLE: jQuery Media Plugin doesnt works in firefox4 QUESTION: I had used jquery media plugin to display pdf file in html This is my following codes... New document PDF File My html file displays pdf file in all browser except ff4. Why Firefox4 doesnt display pdf file instead of displaying it throw out pdf file as down...
[ "jquery", "jquery-plugins", "firefox4" ]
0
1
527
1
0
2011-06-09T07:19:06.013000
2011-06-09T07:23:16.497000
6,289,376
6,289,453
I'm getting an error concerning enum (I think)
I'm testing code remotely on a Solaris machine through SSH Secure Shell using c++. Not sure of what version anything is; Solaris, the c++/compiler, etc. (and don't know how to find out through SSH Secure Shell)... This code: #include #include #include #include using std::cout; using std::cin; using std::string; enum S...
The include of cmath is defining preprocessor constants OVERFLOW as 3 and UNDERFLOW as 4. So the line declaring the enum becomes (if there are no other constants): enum STR_TO_INT_STATUS { SUCCESS, 3, 4, INCONVERTIBLE }; which, of course is not valid syntax.
I'm getting an error concerning enum (I think) I'm testing code remotely on a Solaris machine through SSH Secure Shell using c++. Not sure of what version anything is; Solaris, the c++/compiler, etc. (and don't know how to find out through SSH Secure Shell)... This code: #include #include #include #include using std::c...
TITLE: I'm getting an error concerning enum (I think) QUESTION: I'm testing code remotely on a Solaris machine through SSH Secure Shell using c++. Not sure of what version anything is; Solaris, the c++/compiler, etc. (and don't know how to find out through SSH Secure Shell)... This code: #include #include #include #in...
[ "c++", "enums" ]
8
24
18,975
4
0
2011-06-09T07:19:30.423000
2011-06-09T07:27:48.427000
6,289,377
6,290,625
Best practice for using same source files in multiple projects in Qt Creator
I would like to use the same header and source file in multiple, closely related projects. Qt creator allows to have multiple projects open in the Projects bar, and it allows to "Add existing files". I can add source files from an other project to my current project, it appears nicely in the tree structure, but I can't...
You can add include-file search paths in the.pro file like this: INCLUDEPATH +=../MyIncludeFilePath0 F:/MyProj/MyIncludeFilePath1 etc.
Best practice for using same source files in multiple projects in Qt Creator I would like to use the same header and source file in multiple, closely related projects. Qt creator allows to have multiple projects open in the Projects bar, and it allows to "Add existing files". I can add source files from an other projec...
TITLE: Best practice for using same source files in multiple projects in Qt Creator QUESTION: I would like to use the same header and source file in multiple, closely related projects. Qt creator allows to have multiple projects open in the Projects bar, and it allows to "Add existing files". I can add source files fr...
[ "qt-creator" ]
1
1
1,050
1
0
2011-06-09T07:19:39.630000
2011-06-09T09:20:40.113000
6,289,388
6,289,586
Custom type application settings in ASP.NET
Just now I came across ApplicationSettings in.NET WinForms that could handle complex types. Currently I am using AppSettings in my ASP.NET WebForms which can handle only string. Can I use ApplicationSettings in Webforms? If so how?
The basic idea: In a different project, create classes that will hold your custom settings. For example: public class EndPoint { public string HostName { get; set; } public int Port { get; set; } } public class EndPointCollection: Collection { } Build the project containing the classes. Go to the Settings tab in Proje...
Custom type application settings in ASP.NET Just now I came across ApplicationSettings in.NET WinForms that could handle complex types. Currently I am using AppSettings in my ASP.NET WebForms which can handle only string. Can I use ApplicationSettings in Webforms? If so how?
TITLE: Custom type application settings in ASP.NET QUESTION: Just now I came across ApplicationSettings in.NET WinForms that could handle complex types. Currently I am using AppSettings in my ASP.NET WebForms which can handle only string. Can I use ApplicationSettings in Webforms? If so how? ANSWER: The basic idea: I...
[ "c#", ".net", "asp.net", "web-config", "settings" ]
11
40
12,194
2
0
2011-06-09T07:20:47.517000
2011-06-09T07:42:00.617000
6,289,393
6,289,685
Why would SQL Server choose Clustered Index Scan over Non-Clustered one?
In one of the tables I am querying, a clustered index was created over a key that's not a primary key. (I don't know why.) However, there's a non-clustered index for the primary key for this table. In the execution plan, SQL is choosing the clustered index, rather than the non-clustered index for the primary key which ...
Most likely one of: too many rows to make the index effective index doesn't fit the ON/WHERE conditions index isn't covering and SQL Server avoids a key lookup Edit, after update: Your indexes are useless because they are all single column indexes, so it does a clustered index scan. You need an index that matches your ...
Why would SQL Server choose Clustered Index Scan over Non-Clustered one? In one of the tables I am querying, a clustered index was created over a key that's not a primary key. (I don't know why.) However, there's a non-clustered index for the primary key for this table. In the execution plan, SQL is choosing the cluste...
TITLE: Why would SQL Server choose Clustered Index Scan over Non-Clustered one? QUESTION: In one of the tables I am querying, a clustered index was created over a key that's not a primary key. (I don't know why.) However, there's a non-clustered index for the primary key for this table. In the execution plan, SQL is c...
[ "sql-server" ]
2
4
5,565
4
0
2011-06-09T07:21:14.137000
2011-06-09T07:51:29.933000
6,289,396
6,289,413
Is there a RTL function like StringOfChar which duplicates strings instead of chars?
I am using the StringOfChar function to create a string of chars like this S:= StringOfChar('b', 5); //s is set to 'bbbbb' Is there any RTL function that does the same (like StringofString('abc',3) must return 'abcabcabc' ), but accepts a string as parameter instead of char? I can write a function like that but I'm loo...
the function which you are looking for is StrUtils.DupeString s:=DupeString('abc',3) will return 'abcabcabc'
Is there a RTL function like StringOfChar which duplicates strings instead of chars? I am using the StringOfChar function to create a string of chars like this S:= StringOfChar('b', 5); //s is set to 'bbbbb' Is there any RTL function that does the same (like StringofString('abc',3) must return 'abcabcabc' ), but accept...
TITLE: Is there a RTL function like StringOfChar which duplicates strings instead of chars? QUESTION: I am using the StringOfChar function to create a string of chars like this S:= StringOfChar('b', 5); //s is set to 'bbbbb' Is there any RTL function that does the same (like StringofString('abc',3) must return 'abcabc...
[ "delphi", "delphi-xe" ]
15
22
596
1
0
2011-06-09T07:21:34.897000
2011-06-09T07:23:01.763000
6,289,402
6,289,468
Use a reflected instance of ObservableCollection
I'm dealing with reflection stuffs, I've got a problem with a reflected instance of ObservableCollection. I mean, if create a new instance of it with: Type virtualObservable = typeof(ObservableCollection<>); object observable = virtualObservable.MakeGenericType(genericType) I've got an object, but I can't use it like a...
There are three possibilities: If genericType is known at compile time, cast the return value of MakeGenericType to an ObservableCollection using that type of as the generic parameter. If you are on.NET 4.0, make observable of type dynamic, not object. Cast observable to the type you need, i.e. if you want to register ...
Use a reflected instance of ObservableCollection I'm dealing with reflection stuffs, I've got a problem with a reflected instance of ObservableCollection. I mean, if create a new instance of it with: Type virtualObservable = typeof(ObservableCollection<>); object observable = virtualObservable.MakeGenericType(genericTy...
TITLE: Use a reflected instance of ObservableCollection QUESTION: I'm dealing with reflection stuffs, I've got a problem with a reflected instance of ObservableCollection. I mean, if create a new instance of it with: Type virtualObservable = typeof(ObservableCollection<>); object observable = virtualObservable.MakeGen...
[ "c#", ".net", "reflection", "runtime", "activator" ]
0
2
2,028
1
0
2011-06-09T07:22:10.007000
2011-06-09T07:29:13.420000
6,289,415
6,289,443
Getting the selected value from DetailsVIew to TextBox
How can I get the selected value from DetailsView to a textbox? So far I'm using this TextBox.Text = DetailsView1.SelectedValue.String(); But returns an error: Object reference not set to an instance of an object. I could do it in OnDataBound and ItemInserted in formview with no problem but this time I want to get the ...
DetailsView1.SelectedValue.String() will throw a null reference exception if SelectedValue is null, i.e. there is no selected value, which in the context of a DetailsView i think means it contains no data. You want to do: if (DetailsView1.SelectedValue!= null) { MyTextbox.Text = DetailsView1.SelectedValue.ToSTring(); }
Getting the selected value from DetailsVIew to TextBox How can I get the selected value from DetailsView to a textbox? So far I'm using this TextBox.Text = DetailsView1.SelectedValue.String(); But returns an error: Object reference not set to an instance of an object. I could do it in OnDataBound and ItemInserted in fo...
TITLE: Getting the selected value from DetailsVIew to TextBox QUESTION: How can I get the selected value from DetailsView to a textbox? So far I'm using this TextBox.Text = DetailsView1.SelectedValue.String(); But returns an error: Object reference not set to an instance of an object. I could do it in OnDataBound and ...
[ "c#", "asp.net" ]
0
2
1,541
1
0
2011-06-09T07:23:08.947000
2011-06-09T07:26:48.167000
6,289,417
6,298,657
Permanent access token with YouTube api?
I have gone through the google documentations for Oauth and AuthSub methods for authenticating and I've tried to google this without results. For Facebook, you can request an access token which is of length lifetime, meaning you won't have to be requesting a new token every few weeks. What about Google, and YouTube in ...
Finally found it. They don't expire. You have to make sure to perform the last step, exchanging your single use token for a session token. That session token should not expire. Here's what my step (using the Google AuthSub Client Library) looks like in C#: sessionToken = AuthSubUtil.exchangeForSessionToken(authToken, n...
Permanent access token with YouTube api? I have gone through the google documentations for Oauth and AuthSub methods for authenticating and I've tried to google this without results. For Facebook, you can request an access token which is of length lifetime, meaning you won't have to be requesting a new token every few ...
TITLE: Permanent access token with YouTube api? QUESTION: I have gone through the google documentations for Oauth and AuthSub methods for authenticating and I've tried to google this without results. For Facebook, you can request an access token which is of length lifetime, meaning you won't have to be requesting a ne...
[ "php", "oauth", "youtube-api", "authsub", "google-authentication" ]
7
4
5,622
1
0
2011-06-09T07:23:19.147000
2011-06-09T20:10:49.803000
6,289,419
6,289,639
cant touch button while it is moving
I have written the code shown below. my problem is that I can't touch some of the buttons. I have written that method in NSTimer method. Can anybody help in solving this problem? One method is to create a button and another for changing the values to screen size. -(void)createButton { int x=0; int y=0; int width=100; i...
try set target:self action:buttonpressed I think you forget to do that, the function will be fired when you click it [button addTarget:self action:@selector(buttonpressed:) forControlEvents:UIControlEventTouchUpInside];
cant touch button while it is moving I have written the code shown below. my problem is that I can't touch some of the buttons. I have written that method in NSTimer method. Can anybody help in solving this problem? One method is to create a button and another for changing the values to screen size. -(void)createButton...
TITLE: cant touch button while it is moving QUESTION: I have written the code shown below. my problem is that I can't touch some of the buttons. I have written that method in NSTimer method. Can anybody help in solving this problem? One method is to create a button and another for changing the values to screen size. -...
[ "ipad", "uibutton", "nstimer" ]
0
1
110
1
0
2011-06-09T07:23:57.867000
2011-06-09T07:46:39.620000
6,289,422
6,289,504
NSDateFormatter @"mmddyyy"?
Helo, I'm trying the bunch of code and it is giving null. Is there any problem in this code? NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; // get NSDate from old string format [dateFormatter setDateFormat:@"mmddyyy"]; NSDate *date = [dateFormatter dateFromString:@"02012002"]; NSLog(@"%@",date); // ge...
You r missing one 'y' there in second line- it either should be - dateFormatter setDateFormat:@"mmddyyyy"]; or dateFormatter setDateFormat:@"MMddyyyy"];
NSDateFormatter @"mmddyyy"? Helo, I'm trying the bunch of code and it is giving null. Is there any problem in this code? NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; // get NSDate from old string format [dateFormatter setDateFormat:@"mmddyyy"]; NSDate *date = [dateFormatter dateFromString:@"02012002...
TITLE: NSDateFormatter @"mmddyyy"? QUESTION: Helo, I'm trying the bunch of code and it is giving null. Is there any problem in this code? NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; // get NSDate from old string format [dateFormatter setDateFormat:@"mmddyyy"]; NSDate *date = [dateFormatter dateFro...
[ "iphone", "objective-c", "nsdateformatter" ]
1
1
167
2
0
2011-06-09T07:24:19.387000
2011-06-09T07:33:47.927000
6,289,424
6,289,466
Zipping a file from memory in linux
I'm working on application that must enrypt and zip files. So, I create some data in memory (text, binary or whatever), encrypt it and save to disk (file1 and file2). The I call e.g. "zip out.zip file1 file2 ". I do not want to save this files to disk, but immediately create zip and pack these files from memory. How sh...
You could try to use the zlib library to be able to create zip files from memory buffers. The boost:iostreams could also be a good solution.
Zipping a file from memory in linux I'm working on application that must enrypt and zip files. So, I create some data in memory (text, binary or whatever), encrypt it and save to disk (file1 and file2). The I call e.g. "zip out.zip file1 file2 ". I do not want to save this files to disk, but immediately create zip and ...
TITLE: Zipping a file from memory in linux QUESTION: I'm working on application that must enrypt and zip files. So, I create some data in memory (text, binary or whatever), encrypt it and save to disk (file1 and file2). The I call e.g. "zip out.zip file1 file2 ". I do not want to save this files to disk, but immediate...
[ "c++", "linux", "zip" ]
2
3
2,012
3
0
2011-06-09T07:24:52.843000
2011-06-09T07:29:10.740000
6,289,446
6,289,527
including script doesn't work in web.py
everyone.I wanna include javascript in the html(webpy templates),but it doesn't work.the javascript code in the html works very well... following is the main python file(main.py): urls = ('/main','main') render = web.template.render('templates/') class main: def GET(self): return render.main() app = web.application(u...
You must put the include.js file in a "static/js" directory at the root of your project and src should be "static/js/include.js".
including script doesn't work in web.py everyone.I wanna include javascript in the html(webpy templates),but it doesn't work.the javascript code in the html works very well... following is the main python file(main.py): urls = ('/main','main') render = web.template.render('templates/') class main: def GET(self): retur...
TITLE: including script doesn't work in web.py QUESTION: everyone.I wanna include javascript in the html(webpy templates),but it doesn't work.the javascript code in the html works very well... following is the main python file(main.py): urls = ('/main','main') render = web.template.render('templates/') class main: de...
[ "javascript", "python", "web.py" ]
0
2
2,683
1
0
2011-06-09T07:26:56.203000
2011-06-09T07:36:17.353000
6,289,451
6,289,490
Catch a mouse click event on a control
Possible Duplicate: Handling a Click for all controls on a Form I have a user control, I add controls on this user control. All of children will cover user control' region. That mean, you don't have any space to click on user control. My problem how to detect user mouse click on this user control's region. Please give ...
As per you can do following handle control click event in that event check the sender -- its of your control type This will do your task For Example -- here I am handling button click event (you can handle click event of your control) private void button1_Click(object sender, System.EventArgs e) { if(sender is Button)/...
Catch a mouse click event on a control Possible Duplicate: Handling a Click for all controls on a Form I have a user control, I add controls on this user control. All of children will cover user control' region. That mean, you don't have any space to click on user control. My problem how to detect user mouse click on t...
TITLE: Catch a mouse click event on a control QUESTION: Possible Duplicate: Handling a Click for all controls on a Form I have a user control, I add controls on this user control. All of children will cover user control' region. That mean, you don't have any space to click on user control. My problem how to detect use...
[ "c#", ".net", "click" ]
1
2
2,148
1
0
2011-06-09T07:27:43.183000
2011-06-09T07:31:37.860000
6,289,458
6,289,488
Super simple problem with ArrayList in Java
I've two different classes: Cliente.java public class Cliente { private static String user; private static String password; public Cliente (String usr, String pass) { user = usr; password = pass; } public String getUser() { return user; } } And AddToArrayList.java, where I create a Client type ArrayList and and some cl...
Static variables are Class level variables. To have separate copies of String user; and String password; for each instance of Cliente, make then non-static.
Super simple problem with ArrayList in Java I've two different classes: Cliente.java public class Cliente { private static String user; private static String password; public Cliente (String usr, String pass) { user = usr; password = pass; } public String getUser() { return user; } } And AddToArrayList.java, where I cr...
TITLE: Super simple problem with ArrayList in Java QUESTION: I've two different classes: Cliente.java public class Cliente { private static String user; private static String password; public Cliente (String usr, String pass) { user = usr; password = pass; } public String getUser() { return user; } } And AddToArrayLis...
[ "java", "arraylist" ]
1
3
298
5
0
2011-06-09T07:28:08.717000
2011-06-09T07:31:14.810000
6,289,475
6,289,500
Is this how django does Single Table Inheritance?
In this SO question I see the following: class MediaContent(models.Model): uploader = models.ForeignKey(User) title = models.CharField(max_length=100) created = models.DateTimeField(auto_now_add=True) def draw_item(self): pass class Meta: abstract = True class Picture(MediaContent): picture = models.ImageField(uploa...
There will be two tables created, one for Picture, and one for Video. It will not be possible to create a query that returns both types. "Abstract base classes"
Is this how django does Single Table Inheritance? In this SO question I see the following: class MediaContent(models.Model): uploader = models.ForeignKey(User) title = models.CharField(max_length=100) created = models.DateTimeField(auto_now_add=True) def draw_item(self): pass class Meta: abstract = True class Pictur...
TITLE: Is this how django does Single Table Inheritance? QUESTION: In this SO question I see the following: class MediaContent(models.Model): uploader = models.ForeignKey(User) title = models.CharField(max_length=100) created = models.DateTimeField(auto_now_add=True) def draw_item(self): pass class Meta: abstract = ...
[ "django", "single-table-inheritance" ]
3
3
1,497
2
0
2011-06-09T07:30:00.310000
2011-06-09T07:32:45.590000
6,289,483
6,289,508
Usage of checkbox to retrive the multiple dataitems in Datagrid inASP.NET C#
protected void Button1_Click(object sender, EventArgs e) { foreach (DataGridItem di in GridView1.Items) { HtmlInputCheckBox chkBx = (HtmlInputCheckBox)di.FindControl("CheckBox1"); if (chkBx!= null && chkBx.Checked) { //What should I write to get the Items of that checked row. } } } Help me how to retrieve the row ite...
It should Rows instead Items foreach (GridViewRow di in GridView1.Rows) { HtmlInputCheckBox chkBx = (HtmlInputCheckBox)di.FindControl("CheckBox1"); if (chkBx!= null && chkBx.Checked) { //What should I write to get the Items of that checked row. } }
Usage of checkbox to retrive the multiple dataitems in Datagrid inASP.NET C# protected void Button1_Click(object sender, EventArgs e) { foreach (DataGridItem di in GridView1.Items) { HtmlInputCheckBox chkBx = (HtmlInputCheckBox)di.FindControl("CheckBox1"); if (chkBx!= null && chkBx.Checked) { //What should I write to g...
TITLE: Usage of checkbox to retrive the multiple dataitems in Datagrid inASP.NET C# QUESTION: protected void Button1_Click(object sender, EventArgs e) { foreach (DataGridItem di in GridView1.Items) { HtmlInputCheckBox chkBx = (HtmlInputCheckBox)di.FindControl("CheckBox1"); if (chkBx!= null && chkBx.Checked) { //What s...
[ "c#", ".net", "asp.net", "gridview", "checkbox" ]
0
2
177
1
0
2011-06-09T07:31:03.317000
2011-06-09T07:34:11.967000
6,289,489
6,289,560
change between 'and' and 'or' filter in linq-to-xml in c#
Is it possible to set the filter constraints to 'OR' in linq-to-xml? I iterate through an array in order to filter desired values like this: XElement root = XElement.Load(fileName); IEnumerable selectedElements = root.Elements("OrderNum").Elements("Job"); for (int i = 1; i < chkBx.Count(); i++) { if (chkBx[i].Checked ...
var filters = chkBx.Where(r => r.Checked).Select(r => r.Text).ToList(); selectedElements = selectedElements.Where(r => filters.Contains((string)r.Parent.Element(element)))
change between 'and' and 'or' filter in linq-to-xml in c# Is it possible to set the filter constraints to 'OR' in linq-to-xml? I iterate through an array in order to filter desired values like this: XElement root = XElement.Load(fileName); IEnumerable selectedElements = root.Elements("OrderNum").Elements("Job"); for (...
TITLE: change between 'and' and 'or' filter in linq-to-xml in c# QUESTION: Is it possible to set the filter constraints to 'OR' in linq-to-xml? I iterate through an array in order to filter desired values like this: XElement root = XElement.Load(fileName); IEnumerable selectedElements = root.Elements("OrderNum").Eleme...
[ "c#", "filter", "linq-to-xml" ]
3
3
127
3
0
2011-06-09T07:31:19.467000
2011-06-09T07:39:36.313000
6,289,495
6,289,595
Need help with zend form validation
I wanted to create an invitation form for user to signup. But the signup form is only for people have the special invitation code. So how can I set it in Zend form validation to check if the invitation code matches the code the user enter. The invitation code is the same for all the people that are invited. Here is the...
If you use 5.3 you can use the callback validator with an closure: $valid = new Zend_Validate_Callback(function($value){ // some validation return true; }); or you could use the regex validator $validator = new Zend_Validate_Regex(array('pattern' => '/^Test/'); or the Identical validator: $valid = new Zend_Validate_Ide...
Need help with zend form validation I wanted to create an invitation form for user to signup. But the signup form is only for people have the special invitation code. So how can I set it in Zend form validation to check if the invitation code matches the code the user enter. The invitation code is the same for all the ...
TITLE: Need help with zend form validation QUESTION: I wanted to create an invitation form for user to signup. But the signup form is only for people have the special invitation code. So how can I set it in Zend form validation to check if the invitation code matches the code the user enter. The invitation code is the...
[ "zend-framework", "zend-form" ]
0
3
204
3
0
2011-06-09T07:32:06.240000
2011-06-09T07:42:50.397000
6,289,507
6,289,975
webkit css3 animation loop
I made a background to animate from left to right. Everything works fine but when background-image reaches right, the animation starts over again. How can i make it to run continuously so that it appears it is traveling from left to right always (no breaks)? Here is the fiddle link works only in webkit browsers: http:/...
With that image, you can't. The CSS is doing what it's supposed to (repeating infinitely), but the image itself is not continuous. What you need is an image whose last frame is identical to its first, so that when the animation ends, it appears as if it never stopped. You can achieve this effect by making an extra-long...
webkit css3 animation loop I made a background to animate from left to right. Everything works fine but when background-image reaches right, the animation starts over again. How can i make it to run continuously so that it appears it is traveling from left to right always (no breaks)? Here is the fiddle link works only...
TITLE: webkit css3 animation loop QUESTION: I made a background to animate from left to right. Everything works fine but when background-image reaches right, the animation starts over again. How can i make it to run continuously so that it appears it is traveling from left to right always (no breaks)? Here is the fidd...
[ "animation", "google-chrome", "css", "webkit" ]
8
19
51,393
3
0
2011-06-09T07:33:55.653000
2011-06-09T08:20:33.033000
6,289,509
6,289,736
How can we use EXSLT without downloading its source?
XSLTSL seems to claim that we can use EXSLT without downloading its source: Import or include either the main stylesheet, or the stylesheet module you wish to use, directly from the library website; http://xsltsl.sourceforge.net/modules/. The modules directory always contains the latest stable release. I've tried this:...
You are not using the library correctly. Take a look at the instructions here. Once you have downloaded the library, you need to: 1) Add an import to your xsl file: 2) Add a namespace: xmlns:str="http://xsltsl.org/string" 3) Call the template like this: hello world This will produce HELLO WORLD. UPDATE: No, you do not ...
How can we use EXSLT without downloading its source? XSLTSL seems to claim that we can use EXSLT without downloading its source: Import or include either the main stylesheet, or the stylesheet module you wish to use, directly from the library website; http://xsltsl.sourceforge.net/modules/. The modules directory always...
TITLE: How can we use EXSLT without downloading its source? QUESTION: XSLTSL seems to claim that we can use EXSLT without downloading its source: Import or include either the main stylesheet, or the stylesheet module you wish to use, directly from the library website; http://xsltsl.sourceforge.net/modules/. The module...
[ "xml", "xslt", "exslt" ]
3
1
1,669
2
0
2011-06-09T07:34:12.153000
2011-06-09T07:56:28.433000
6,289,513
6,290,975
Where Is color_map defined in BGL?
Example code from BGL: breadth_first_search(g, vertex(s, g), color_map(get(&VertexProps::color, g)).visitor(vis)); What is color_map, where is it defined? And where is it documented?
It's defined as a named parameter in http://www.boost.org/doc/libs/1_46_0/boost/graph/named_function_params.hpp
Where Is color_map defined in BGL? Example code from BGL: breadth_first_search(g, vertex(s, g), color_map(get(&VertexProps::color, g)).visitor(vis)); What is color_map, where is it defined? And where is it documented?
TITLE: Where Is color_map defined in BGL? QUESTION: Example code from BGL: breadth_first_search(g, vertex(s, g), color_map(get(&VertexProps::color, g)).visitor(vis)); What is color_map, where is it defined? And where is it documented? ANSWER: It's defined as a named parameter in http://www.boost.org/doc/libs/1_46_0/b...
[ "c++", "boost", "boost-graph" ]
0
2
420
3
0
2011-06-09T07:34:38.997000
2011-06-09T09:50:44.477000
6,289,518
6,289,568
creation of jar failing
I am trying to create a jar using the following command on a RHEL box jar -cf first MANIFEST.TXT HelloWorld.class the contents of MANIFEST.TXT is Main-Class: HelloWorld This is failing with the following error Failed to load Main-Class manifest attribute from first I understand i need to create the manifest file which ...
See the example from jar -help: jar cvfm classes.jar mymanifest -C foo/. You must specify m so jar knows there is a manifest file and you should not omit the.jar from first. This should work: jar cfm first.jar MANIFEST.TXT HelloWorld.class
creation of jar failing I am trying to create a jar using the following command on a RHEL box jar -cf first MANIFEST.TXT HelloWorld.class the contents of MANIFEST.TXT is Main-Class: HelloWorld This is failing with the following error Failed to load Main-Class manifest attribute from first I understand i need to create ...
TITLE: creation of jar failing QUESTION: I am trying to create a jar using the following command on a RHEL box jar -cf first MANIFEST.TXT HelloWorld.class the contents of MANIFEST.TXT is Main-Class: HelloWorld This is failing with the following error Failed to load Main-Class manifest attribute from first I understand...
[ "java", "jar" ]
1
3
64
1
0
2011-06-09T07:35:04.773000
2011-06-09T07:40:34.230000
6,289,520
6,289,616
is it possible that SQL Profiler trace does not show calls done within a trigger?
I am just suspicious that the SQL Profiler does not show the calls done within by one of the triggers I have. If I am right, Is there a setting to force profiler to show also the calls done within triggers? Note: The trigger I am talking about makes some sp calls
Try adding the SP:StmtCompleted and/or SP:Completed events to your trace setup - this should provide you with what you're after.
is it possible that SQL Profiler trace does not show calls done within a trigger? I am just suspicious that the SQL Profiler does not show the calls done within by one of the triggers I have. If I am right, Is there a setting to force profiler to show also the calls done within triggers? Note: The trigger I am talking ...
TITLE: is it possible that SQL Profiler trace does not show calls done within a trigger? QUESTION: I am just suspicious that the SQL Profiler does not show the calls done within by one of the triggers I have. If I am right, Is there a setting to force profiler to show also the calls done within triggers? Note: The tri...
[ "sql", "sql-server", "triggers", "sql-server-profiler" ]
1
3
2,635
2
0
2011-06-09T07:35:30.417000
2011-06-09T07:45:23.293000
6,289,526
6,289,740
IE9 jquery slidedown effect issue
So i have a ul list where i click a div above it and then i toggle it so i can slidedown/up the list... but when i slidedown the list on IE9 i see this weird effect below it: this happens on slideUp my code looks like this: $(".btn").click(function() { if ($(this).next().is(":visible")){ $(".slide_menu").slideUp("fast"...
If all you want to do is toggle it on clicks, try this. Altered your code just a bit, I don't have IE9 because I'm on a mac but this should work. If it still doesn't work. Tell me and I'll see what I can do! http://jsfiddle.net/fWJuk/1/
IE9 jquery slidedown effect issue So i have a ul list where i click a div above it and then i toggle it so i can slidedown/up the list... but when i slidedown the list on IE9 i see this weird effect below it: this happens on slideUp my code looks like this: $(".btn").click(function() { if ($(this).next().is(":visible")...
TITLE: IE9 jquery slidedown effect issue QUESTION: So i have a ul list where i click a div above it and then i toggle it so i can slidedown/up the list... but when i slidedown the list on IE9 i see this weird effect below it: this happens on slideUp my code looks like this: $(".btn").click(function() { if ($(this).nex...
[ "jquery", "internet-explorer-9", "effect", "slideup" ]
4
1
2,175
2
0
2011-06-09T07:36:16.753000
2011-06-09T07:56:47.023000
6,289,531
6,289,690
Rails 3 AR: Save and update methods do not save attributes changed in database but not object in memory?
Consider this scenario: butterfly = Butterfly.create(:color='blue') Butterfly.update_all(:color='red') At this point, as expected, butterfly (in memory) is blue while the corresponding database object is red. Now try to update the database entry butterfly.update_attributes(:size=>'big') The result is that the size attr...
Sort-of. Model.update_all issues an update query directly to the underlying database; it doesn't update any instances you already have in memory. Similarly, instance.update_attributes only updates—it doesn't re-fetch from the database, as it assumes that the instance has the most up-to-date attribute values already. Th...
Rails 3 AR: Save and update methods do not save attributes changed in database but not object in memory? Consider this scenario: butterfly = Butterfly.create(:color='blue') Butterfly.update_all(:color='red') At this point, as expected, butterfly (in memory) is blue while the corresponding database object is red. Now tr...
TITLE: Rails 3 AR: Save and update methods do not save attributes changed in database but not object in memory? QUESTION: Consider this scenario: butterfly = Butterfly.create(:color='blue') Butterfly.update_all(:color='red') At this point, as expected, butterfly (in memory) is blue while the corresponding database obj...
[ "ruby-on-rails-3", "activerecord" ]
2
6
2,584
1
0
2011-06-09T07:36:46.600000
2011-06-09T07:52:19.240000
6,289,532
6,290,748
Editing user groups using Powershell
I wanted to add multiple members to local admin group, below is the code function Add-Admin { [CmdletBinding()] Param ([Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="UserName to be added to local Admin Group")] [string[]] $username,[Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="Domain ...
Just consider your $username variable as an array (as it is) replace: $Group.Add("WinNT://" + $domain + "/" + $username) by foreach ($user in $username) { $Group.Add("WinNT://" + $domain + "/" + $user) }
Editing user groups using Powershell I wanted to add multiple members to local admin group, below is the code function Add-Admin { [CmdletBinding()] Param ([Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="UserName to be added to local Admin Group")] [string[]] $username,[Parameter(Mandatory=$true,ValueFr...
TITLE: Editing user groups using Powershell QUESTION: I wanted to add multiple members to local admin group, below is the code function Add-Admin { [CmdletBinding()] Param ([Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="UserName to be added to local Admin Group")] [string[]] $username,[Parameter(Manda...
[ "powershell" ]
0
1
271
1
0
2011-06-09T07:36:53.607000
2011-06-09T09:30:58.690000
6,289,537
6,289,593
Which audio format and what compression should i choose for HTML embed?
I have a web application that uses jQuery to load some sound effect on user request. The file is currently compressed as WAV 16bit and takes 415kb. I don't know what compression level or format should i choose in order to embed this file to HTML with small size and playable on all browsers. converting to mono didn't wo...
jPlayer is a nice jQuery library that could be used to play the sound. You may need to customize the display of the player to make it hidden if you want to programatically play the sound. You may need to encode the sound in multiple formats, but jPlayer can handle the fallback to flash if no native HTML5 audio support ...
Which audio format and what compression should i choose for HTML embed? I have a web application that uses jQuery to load some sound effect on user request. The file is currently compressed as WAV 16bit and takes 415kb. I don't know what compression level or format should i choose in order to embed this file to HTML wi...
TITLE: Which audio format and what compression should i choose for HTML embed? QUESTION: I have a web application that uses jQuery to load some sound effect on user request. The file is currently compressed as WAV 16bit and takes 415kb. I don't know what compression level or format should i choose in order to embed th...
[ "jquery", "html", "audio" ]
1
2
1,107
2
0
2011-06-09T07:37:39.213000
2011-06-09T07:42:40.190000
6,289,538
6,290,063
Aggregate a dataframe on a given column and display another column
I have a dataframe in R of the following form: > head(data) Group Score Info 1 1 1 a 2 1 2 b 3 1 3 c 4 2 4 d 5 2 3 e 6 2 1 f I would like to aggregate it following the Score column using the max function > aggregate(data$Score, list(data$Group), max) Group.1 x 1 1 3 2 2 4 But I also would like to display the Info colu...
First, you split the data using split: split(z,z$Group) Than, for each chunk, select the row with max Score: lapply(split(z,z$Group),function(chunk) chunk[which.max(chunk$Score),]) Finally reduce back to a data.frame do.call ing rbind: do.call(rbind,lapply(split(z,z$Group),function(chunk) chunk[which.max(chunk$Score),]...
Aggregate a dataframe on a given column and display another column I have a dataframe in R of the following form: > head(data) Group Score Info 1 1 1 a 2 1 2 b 3 1 3 c 4 2 4 d 5 2 3 e 6 2 1 f I would like to aggregate it following the Score column using the max function > aggregate(data$Score, list(data$Group), max) G...
TITLE: Aggregate a dataframe on a given column and display another column QUESTION: I have a dataframe in R of the following form: > head(data) Group Score Info 1 1 1 a 2 1 2 b 3 1 3 c 4 2 4 d 5 2 3 e 6 2 1 f I would like to aggregate it following the Score column using the max function > aggregate(data$Score, list(da...
[ "r", "aggregate", "plyr", "greatest-n-per-group" ]
56
39
123,875
8
0
2011-06-09T07:37:45.113000
2011-06-09T08:30:00.193000
6,289,544
6,289,574
jQuery mousedown find exact element on which event get fired
Hi I have this HTML code Passengers and have this JS code $("Table tr th").mousedown(function (e) { /*mousedown code goes here... */ /* ignore if mousedown occur on div "some-handle" */ } Now I try to catch if mousedown occur on div having class "some-handle". can I do that?
Check e.target. This is the element where the event originated. if ($(e.target).hasClass('some-handle')) { // fired on div "some-handle" }
jQuery mousedown find exact element on which event get fired Hi I have this HTML code Passengers and have this JS code $("Table tr th").mousedown(function (e) { /*mousedown code goes here... */ /* ignore if mousedown occur on div "some-handle" */ } Now I try to catch if mousedown occur on div having class "some-handle"...
TITLE: jQuery mousedown find exact element on which event get fired QUESTION: Hi I have this HTML code Passengers and have this JS code $("Table tr th").mousedown(function (e) { /*mousedown code goes here... */ /* ignore if mousedown occur on div "some-handle" */ } Now I try to catch if mousedown occur on div having c...
[ "jquery", "mouseevent" ]
1
11
10,700
4
0
2011-06-09T07:38:15.307000
2011-06-09T07:41:13.050000
6,289,553
6,289,605
Relationship Problem in SQL (Column can't be cascaded)
I have 3 tables (Patient,Doctor,Appointments) patient has a primary key(Patient_ID)and a foreign key (Doctor_ID) Doctor has a primary key(Doctor_ID) Appointments has a primary key(Appo_ID)and two foreign keys(Patient_ID,Doctor_ID) here is the problem,In the relationship diagram the two relations(Patient.Patient_ID,App....
It's a cyclic dependency, why would you want it to cascade? And why are you updating the Doctor_ID strictly speaking you shouldn't ever be updating (setting) the primary key. That you are filtering Where Doctor_ID=@Doctor_ID on the same value you are updating Set Doctor_ID=@Doctor_ID tells me you haven't tought this th...
Relationship Problem in SQL (Column can't be cascaded) I have 3 tables (Patient,Doctor,Appointments) patient has a primary key(Patient_ID)and a foreign key (Doctor_ID) Doctor has a primary key(Doctor_ID) Appointments has a primary key(Appo_ID)and two foreign keys(Patient_ID,Doctor_ID) here is the problem,In the relatio...
TITLE: Relationship Problem in SQL (Column can't be cascaded) QUESTION: I have 3 tables (Patient,Doctor,Appointments) patient has a primary key(Patient_ID)and a foreign key (Doctor_ID) Doctor has a primary key(Doctor_ID) Appointments has a primary key(Appo_ID)and two foreign keys(Patient_ID,Doctor_ID) here is the prob...
[ "sql-server-2005", "relationships" ]
1
1
168
3
0
2011-06-09T07:38:56.657000
2011-06-09T07:43:54.287000
6,289,563
6,289,610
java - catch event of double click on icon in tray
I want to make my form visible when I double click the tray icon? How do I catch the double click on the icon? Thanks.
Try to use MouseListener with public void mousePressed( MouseEvent e ) { if(e.getClickCount() >= 2){ //do something } }
java - catch event of double click on icon in tray I want to make my form visible when I double click the tray icon? How do I catch the double click on the icon? Thanks.
TITLE: java - catch event of double click on icon in tray QUESTION: I want to make my form visible when I double click the tray icon? How do I catch the double click on the icon? Thanks. ANSWER: Try to use MouseListener with public void mousePressed( MouseEvent e ) { if(e.getClickCount() >= 2){ //do something } }
[ "java", "swing" ]
9
11
11,368
6
0
2011-06-09T07:39:42.357000
2011-06-09T07:44:46.033000
6,289,572
6,290,660
iphone: Use different icons with different build targets?
Right now I have a regular iphone app with unique springboard icon and splash screens. Now I want to create basically the same app with minor changes - and this app will have a different name, different springboard icon and different splash screens. So basically what I did now was to duplicate the original build target...
Ok I found the answer and it's rather simple. As I already mentioned I duplicated the target that I have - and changed the product name. Then there is the tricky part with the app icon and the splash screen. What I basically did was to delete these files from the project folder and move them to an external folder. Then...
iphone: Use different icons with different build targets? Right now I have a regular iphone app with unique springboard icon and splash screens. Now I want to create basically the same app with minor changes - and this app will have a different name, different springboard icon and different splash screens. So basically...
TITLE: iphone: Use different icons with different build targets? QUESTION: Right now I have a regular iphone app with unique springboard icon and splash screens. Now I want to create basically the same app with minor changes - and this app will have a different name, different springboard icon and different splash scr...
[ "iphone", "ipad", "build", "target" ]
18
3
9,620
7
0
2011-06-09T07:40:50.710000
2011-06-09T09:23:06.413000
6,289,573
6,290,280
Boost.Filesystem crashes
Does anyone had this problem? When searching a partition with recursive_directory_iterator, when it reaches the end it crashes. I get this in Visual Studio 2008 with boost 1.39 but also at home using MinGW with boost 1.46. I don't think I am doing something wrong: #include "stdafx.h" #include #include using namespace s...
Windows does not allow you to look inside the directory "System Volume Information". So unleashing a recursive_directory_iterator on "System Volume Information" is a bad idea. Edit: You may be able to solve the problem with recursive_directory_iterator::no_push(). From The Boost docs: void no_push(bool value=true); Re...
Boost.Filesystem crashes Does anyone had this problem? When searching a partition with recursive_directory_iterator, when it reaches the end it crashes. I get this in Visual Studio 2008 with boost 1.39 but also at home using MinGW with boost 1.46. I don't think I am doing something wrong: #include "stdafx.h" #include #...
TITLE: Boost.Filesystem crashes QUESTION: Does anyone had this problem? When searching a partition with recursive_directory_iterator, when it reaches the end it crashes. I get this in Visual Studio 2008 with boost 1.39 but also at home using MinGW with boost 1.46. I don't think I am doing something wrong: #include "st...
[ "c++", "boost", "boost-filesystem" ]
2
4
2,601
3
0
2011-06-09T07:41:01.577000
2011-06-09T08:51:18.053000
6,289,600
6,289,782
best method and data structure for sorting a list of tuples into multiple lists?
Let's say I have a list of tuples like this: l = [('music','300','url'),('movie','400','url'), ('clothing','250','url'),('music','350','url'), ('music','400','url'),('movie','1000','url')] and that I want to sort these tuples into multiple lists, each grouped by the first element in the tuples. Further, once grouped in...
Well, you can get your lists easily with a list comprehension: music = [x for x in l if x[0] == 'music'] movie = [x for x in l if x[0] == 'movie'] clothing = [x for x in l if x[0] == 'clothing'] You can even sort them in place >>> music.sort(key=lambda x: x[1], reverse=True) <<< [('music', '400', 'url'), ('music', '350...
best method and data structure for sorting a list of tuples into multiple lists? Let's say I have a list of tuples like this: l = [('music','300','url'),('movie','400','url'), ('clothing','250','url'),('music','350','url'), ('music','400','url'),('movie','1000','url')] and that I want to sort these tuples into multiple...
TITLE: best method and data structure for sorting a list of tuples into multiple lists? QUESTION: Let's say I have a list of tuples like this: l = [('music','300','url'),('movie','400','url'), ('clothing','250','url'),('music','350','url'), ('music','400','url'),('movie','1000','url')] and that I want to sort these tu...
[ "python", "list", "sorting" ]
1
3
2,098
3
0
2011-06-09T07:43:32.190000
2011-06-09T08:00:05.297000
6,289,607
6,290,086
Can't solve "Sqlparameter is already contained by another SqlparameterCollection"
I am using 2 threads (from same class) in a windows service. I always getting the same error message: "The SqlParameter is already contained by another SqlParameterCollection. at System.Data.SqlClient.SqlParameterCollection.Validate(Int32 index, Object value) at System.Data.SqlClient.SqlParameterCollection.Add(Object v...
You are trying to add a SqlParameter to a SqlParameterCollection twice. This may or may not be happening across threads. If this is a multi-threading issue then all your variables should be scoped locally because, if they are not you should be implemeting sychronisation on thier access, probably with lock. If this is n...
Can't solve "Sqlparameter is already contained by another SqlparameterCollection" I am using 2 threads (from same class) in a windows service. I always getting the same error message: "The SqlParameter is already contained by another SqlParameterCollection. at System.Data.SqlClient.SqlParameterCollection.Validate(Int32...
TITLE: Can't solve "Sqlparameter is already contained by another SqlparameterCollection" QUESTION: I am using 2 threads (from same class) in a windows service. I always getting the same error message: "The SqlParameter is already contained by another SqlParameterCollection. at System.Data.SqlClient.SqlParameterCollect...
[ "c#", "multithreading", "database-connection", "sqlparameter" ]
1
2
9,045
2
0
2011-06-09T07:44:22.240000
2011-06-09T08:32:27.130000
6,289,611
6,289,719
How can I change a button's image in a controller from another one?
I've got a small issue in setting the image for a button in MainViewController, from another UIViewController. Actually what happens is this: when I click the lockButton in the MainViewController, it opens a different UIViewController where I can set password. Once the password is set successfully, I need to change the...
You have to point to the instance of the MainViewController and then change the settings for its inner components. First of all, you should be able to access that instance from your app delegate, at least this is straightforward if you're using the default project template from Xcode. To do this you should use this sni...
How can I change a button's image in a controller from another one? I've got a small issue in setting the image for a button in MainViewController, from another UIViewController. Actually what happens is this: when I click the lockButton in the MainViewController, it opens a different UIViewController where I can set p...
TITLE: How can I change a button's image in a controller from another one? QUESTION: I've got a small issue in setting the image for a button in MainViewController, from another UIViewController. Actually what happens is this: when I click the lockButton in the MainViewController, it opens a different UIViewController...
[ "iphone", "cocoa", "uiviewcontroller", "uibutton" ]
1
0
319
1
0
2011-06-09T07:44:54.947000
2011-06-09T07:54:52.153000
6,289,619
6,289,903
How Can use one connection in all my beans?
I have created 3 classes: The first for connection(Connectionx),the second I'am using it to fill UI as checkbox,selectonemenu(BeanTools) and the third is for my "operations"(NumberOfIssue). 1)The problem that I want to connect to the database just a once,I have done the connection in the class Connectionx and I want to...
Use a connection pool like commons-dbcp. By the way this kind of code "select count(OS_CURRENTSTEP.entry_id) as nbissue [.. snip...] and issuestatus.pname="+maValeur+" and jiraissue.issuetype=issuetype.id [... snip...] and resolution.pname='Fixed' Group By project.pname,priority.pname,issuetype.pname;"; is vulnerable t...
How Can use one connection in all my beans? I have created 3 classes: The first for connection(Connectionx),the second I'am using it to fill UI as checkbox,selectonemenu(BeanTools) and the third is for my "operations"(NumberOfIssue). 1)The problem that I want to connect to the database just a once,I have done the conne...
TITLE: How Can use one connection in all my beans? QUESTION: I have created 3 classes: The first for connection(Connectionx),the second I'am using it to fill UI as checkbox,selectonemenu(BeanTools) and the third is for my "operations"(NumberOfIssue). 1)The problem that I want to connect to the database just a once,I h...
[ "java", "jsf" ]
0
2
379
2
0
2011-06-09T07:45:41.977000
2011-06-09T08:13:47.553000
6,289,624
6,290,001
Convert Oracle trigger to SQL Server
I'm not familiar with MSSQL triggers I need to convert a Oracle trigger in to MSSQL here's the Oracle trigger:- create or replace trigger TRG_GRP_SEQ before insert on T_USER_GROUP for each row begin select count(*) into:new.GROUPSEQUENCE from T_USER_GROUP; end; I'm in trouble covering the before statements and for each...
SQL Server can make columns identity which means they autoincrement for newly inserted rows. I recommend you use one, which would let you dispense with the trigger entirely. If you already have data in your table, then you'll ned to create a new table and populate it like so: CREATE TABLE T_USER_GROUP_New ( GroupSequen...
Convert Oracle trigger to SQL Server I'm not familiar with MSSQL triggers I need to convert a Oracle trigger in to MSSQL here's the Oracle trigger:- create or replace trigger TRG_GRP_SEQ before insert on T_USER_GROUP for each row begin select count(*) into:new.GROUPSEQUENCE from T_USER_GROUP; end; I'm in trouble coveri...
TITLE: Convert Oracle trigger to SQL Server QUESTION: I'm not familiar with MSSQL triggers I need to convert a Oracle trigger in to MSSQL here's the Oracle trigger:- create or replace trigger TRG_GRP_SEQ before insert on T_USER_GROUP for each row begin select count(*) into:new.GROUPSEQUENCE from T_USER_GROUP; end; I'm...
[ "sql-server", "oracle", "triggers", "sql-server-2000" ]
2
1
3,453
3
0
2011-06-09T07:45:54.753000
2011-06-09T08:23:26.787000
6,289,627
6,289,666
Is it possible to override a Method in a Base Class within the same Class (NOT a Derived Class)?
My understanding is that it is possible to Override a method (marked as Virtual ) in a base class from a derived class using the keywords override. But what about overriding a method in the same class? In my specific case, I have a class x with 2 methods. Method a has some common behavior with b, and b adds functionali...
You could simply call your method a() from within your method b(). No need (and no way) to override a method. public class x { private static int _i = 0; public static void a() { _i = 1; } public static void b() { a(); // here is _i = 1; } } On the other hand you could have parameter overloads for your method. public ...
Is it possible to override a Method in a Base Class within the same Class (NOT a Derived Class)? My understanding is that it is possible to Override a method (marked as Virtual ) in a base class from a derived class using the keywords override. But what about overriding a method in the same class? In my specific case, ...
TITLE: Is it possible to override a Method in a Base Class within the same Class (NOT a Derived Class)? QUESTION: My understanding is that it is possible to Override a method (marked as Virtual ) in a base class from a derived class using the keywords override. But what about overriding a method in the same class? In ...
[ "c#", ".net", "asp.net", "oop" ]
6
11
3,119
6
0
2011-06-09T07:46:08.467000
2011-06-09T07:49:51.727000
6,289,629
6,289,715
svg pattern on background image
Is it possible to put a.svg pattern as a background image, the svg pattern should be resized to the window width and height.
It's possible but limited in browser support. Webkit tends to have the best SVG support and IE the worst. You can assign it using CSS and the CSS3 background-size property. body { background: url(bg.svg) no-repeat; background-size: 100%; -o-background-size: 100%; -webkit-background-size: 100%; -moz-background-size: 100...
svg pattern on background image Is it possible to put a.svg pattern as a background image, the svg pattern should be resized to the window width and height.
TITLE: svg pattern on background image QUESTION: Is it possible to put a.svg pattern as a background image, the svg pattern should be resized to the window width and height. ANSWER: It's possible but limited in browser support. Webkit tends to have the best SVG support and IE the worst. You can assign it using CSS an...
[ "jquery", "css", "svg" ]
1
1
719
1
0
2011-06-09T07:46:16.530000
2011-06-09T07:54:33.357000
6,289,634
6,289,792
Common JSON Call class
var JsonClientPatientSearch = Titanium.Network.createHTTPClient(); // API Url to call var url = GetAPIUrl() + "PatientSearch"; JsonClientPatientSearch.open("POST", url); //setting Request Header JsonClientPatientSearch.setRequestHeader("Content-type", "application/json"); JsonClientPatientSearch.send(PatientSearch(Pat...
You can create instances of objects and reuse them. Your code would look something like this: var MyCall = function(url, onLoad, onError){ // API Url to call this.url = GetAPIUrl() + url; this.onLoad = onLoad; this.onError = onError; }; MyCall.prototype = { call: function(){ var JsonClientPatientSearch = Titanium.Netwo...
Common JSON Call class var JsonClientPatientSearch = Titanium.Network.createHTTPClient(); // API Url to call var url = GetAPIUrl() + "PatientSearch"; JsonClientPatientSearch.open("POST", url); //setting Request Header JsonClientPatientSearch.setRequestHeader("Content-type", "application/json"); JsonClientPatientSearch...
TITLE: Common JSON Call class QUESTION: var JsonClientPatientSearch = Titanium.Network.createHTTPClient(); // API Url to call var url = GetAPIUrl() + "PatientSearch"; JsonClientPatientSearch.open("POST", url); //setting Request Header JsonClientPatientSearch.setRequestHeader("Content-type", "application/json"); JsonC...
[ "javascript", "json" ]
0
2
210
2
0
2011-06-09T07:46:33.193000
2011-06-09T08:01:00.807000
6,289,635
6,289,691
How to call a stored procedure in a where clause
I have two stored procedures. Lets take them as SP1 and SP2. SP1 is the main Stored proc and SP2 is the stored proc called inside SP2. i.e) SP1 has three input parameters(Fromdate,todate,LoginName) and SP2 has one input parameter(LoginName). What I want to do is: Call the SP2 inside SP1's where clause as: SELECT column...
Here's one such way of achieving this - you might also want to read up on Table-valued UDFs. CREATE TABLE #logins ( ) INSERT INTO #logins EXEC SP2 @LoginName SELECT column1, column2, column3 from YOUMISSEDTHETABLEOUTHERE where column1<=fromdate and column1>=todate and column2 in ( SELECT therelevantcolumn FROM #login...
How to call a stored procedure in a where clause I have two stored procedures. Lets take them as SP1 and SP2. SP1 is the main Stored proc and SP2 is the stored proc called inside SP2. i.e) SP1 has three input parameters(Fromdate,todate,LoginName) and SP2 has one input parameter(LoginName). What I want to do is: Call th...
TITLE: How to call a stored procedure in a where clause QUESTION: I have two stored procedures. Lets take them as SP1 and SP2. SP1 is the main Stored proc and SP2 is the stored proc called inside SP2. i.e) SP1 has three input parameters(Fromdate,todate,LoginName) and SP2 has one input parameter(LoginName). What I want...
[ "sql-server-2005", "stored-procedures", "where-clause" ]
2
3
2,282
2
0
2011-06-09T07:46:35.247000
2011-06-09T07:52:41.747000
6,289,640
6,289,747
Java: generics type
Class B extends from class A, and G is generics class. Now - G g = new G (); If I'm not wrong, then X can be:? extends A or? super B My question: Why X can't be simply A. B extends from A, so that seems correct. Where am I wrong?
X can't be A because what goes in the generics on the left side must match the generics on the right side. However, by saying X is "? extends A", it tells java that the generic type for g is any class that has at least the functionality of A. Simply put, G!= G, but G can hold either G, G, or anything else that extends ...
Java: generics type Class B extends from class A, and G is generics class. Now - G g = new G (); If I'm not wrong, then X can be:? extends A or? super B My question: Why X can't be simply A. B extends from A, so that seems correct. Where am I wrong?
TITLE: Java: generics type QUESTION: Class B extends from class A, and G is generics class. Now - G g = new G (); If I'm not wrong, then X can be:? extends A or? super B My question: Why X can't be simply A. B extends from A, so that seems correct. Where am I wrong? ANSWER: X can't be A because what goes in the gener...
[ "java" ]
1
0
96
3
0
2011-06-09T07:46:58.087000
2011-06-09T07:57:36.053000
6,289,645
6,290,135
Bind Treeview inside Repeater
I want to bind the Tree view inside the repeater like below image: please tell me the way how can I do this.
try this protected void myRepeater_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { TreeView MyTree = (TreeView)e.Item.FindControl("MyTreeID"); MyTree.DataSource = MyDataSoure; MyTree.DataBind(); } }
Bind Treeview inside Repeater I want to bind the Tree view inside the repeater like below image: please tell me the way how can I do this.
TITLE: Bind Treeview inside Repeater QUESTION: I want to bind the Tree view inside the repeater like below image: please tell me the way how can I do this. ANSWER: try this protected void myRepeater_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item...
[ "c#", "asp.net", "treeview", "repeater" ]
1
0
2,122
1
0
2011-06-09T07:47:26.890000
2011-06-09T08:37:32.720000
6,289,650
6,290,005
how to allow content editing, for limited time in asp.net mvc 3
i have to implement like this: A user will be able to edit a comment till 10 minutes after posting the comment. There will be an edit link associated with the comment of the server time is less than 10 minutes of the posted comment. However, it may happen that the comment will not save if more than 10 minutes have pass...
Yep, @Palantir is correct. Just wanted to expand a little on how to tackle the presentation layer. When saving comment, set a CreatedOn field to DateTime.Now. Have a ViewModel like this: public class CommentViewModel { [HiddenInput] public int CommentId { get; set; } public string Text { get; set; } public DateTime Cre...
how to allow content editing, for limited time in asp.net mvc 3 i have to implement like this: A user will be able to edit a comment till 10 minutes after posting the comment. There will be an edit link associated with the comment of the server time is less than 10 minutes of the posted comment. However, it may happen ...
TITLE: how to allow content editing, for limited time in asp.net mvc 3 QUESTION: i have to implement like this: A user will be able to edit a comment till 10 minutes after posting the comment. There will be an edit link associated with the comment of the server time is less than 10 minutes of the posted comment. Howev...
[ "asp.net-mvc" ]
0
1
134
2
0
2011-06-09T07:47:37.670000
2011-06-09T08:23:50.273000
6,289,670
6,289,996
How do I add Nodes through Backgroundworker to a TreeView from a Database and reload Children while expanding a Node in Windows Forms C#?
I have a Nhibernate Database which provide the Data as hierarchical List<>. I have a TreeView in my Windows Forms GUI and a Backgroundworker which populate the TreeView with all Root Nodes and their Children (nothing more because of Lazy loading exception from NHibernate but this is okay because I expect that the user ...
This SO Question should provide some help on the lazy loading. It uses a threadpool instead of a background worker which you can find arguments for/against on google, but in my opinion its not a bad choice to use the threadpool in Winforms. With the above post to guide you, pass the node that is being expanded through ...
How do I add Nodes through Backgroundworker to a TreeView from a Database and reload Children while expanding a Node in Windows Forms C#? I have a Nhibernate Database which provide the Data as hierarchical List<>. I have a TreeView in my Windows Forms GUI and a Backgroundworker which populate the TreeView with all Root...
TITLE: How do I add Nodes through Backgroundworker to a TreeView from a Database and reload Children while expanding a Node in Windows Forms C#? QUESTION: I have a Nhibernate Database which provide the Data as hierarchical List<>. I have a TreeView in my Windows Forms GUI and a Backgroundworker which populate the Tree...
[ "c#", "winforms", "nhibernate", "treeview", "backgroundworker" ]
0
0
1,437
1
0
2011-06-09T07:50:16.897000
2011-06-09T08:23:01.350000
6,289,678
6,289,739
How to forward/route requests based on conditions in Rails 3?
this is my first question here and I am currently trying to build my first Ruby on Rails app so this question might be kind of basic. The Problem: I want a form on the root site which consists of only two fields, email and password for a user model. Depending on whether the email address that was typed in already exist...
Actually, that's a fairly solid way of handling the problem. Routes in Rails are only supposed to be a simple way of mapping URLs to code. Logic like that belongs exactly where you've placed it: in the controller.
How to forward/route requests based on conditions in Rails 3? this is my first question here and I am currently trying to build my first Ruby on Rails app so this question might be kind of basic. The Problem: I want a form on the root site which consists of only two fields, email and password for a user model. Dependin...
TITLE: How to forward/route requests based on conditions in Rails 3? QUESTION: this is my first question here and I am currently trying to build my first Ruby on Rails app so this question might be kind of basic. The Problem: I want a form on the root site which consists of only two fields, email and password for a us...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "routes" ]
0
1
810
2
0
2011-06-09T07:51:00.207000
2011-06-09T07:56:40.003000
6,289,688
6,289,974
General question about interfaces
I know, its a stupid question, but someone told me that we can write a code in an interface, i mean not a logic but System.out.println(), in an interface.. Is this true??
One thing has been forgotten, an interface can have static classes and interfaces, such as; public interface MyInterface { public static class Holder {}; } EDIT JLS states that, Interfaces may contain member type declarations (§8.5). A member type declaration in an interface is implicitly static and public.
General question about interfaces I know, its a stupid question, but someone told me that we can write a code in an interface, i mean not a logic but System.out.println(), in an interface.. Is this true??
TITLE: General question about interfaces QUESTION: I know, its a stupid question, but someone told me that we can write a code in an interface, i mean not a logic but System.out.println(), in an interface.. Is this true?? ANSWER: One thing has been forgotten, an interface can have static classes and interfaces, such ...
[ "java", "interface" ]
1
2
103
8
0
2011-06-09T07:52:09.130000
2011-06-09T08:20:26.213000
6,289,699
6,289,748
what is the best and general way to refer a function's __name__ in a function?
Possible Duplicate: How do I get the name of a function or method from within a Python function or method? The below code function return it's name. It works but I still have to specify the 'test.' in front of of the __name__. Is there any general way to refer the __name__? def test(): print test.__name__
There is no way to access the function name in a python function without using a backtrace. In [1]: import inspect In [2]: def test():...: print inspect.stack()[0][3]...: In [3]: test() test So, what you want to use is inspect.stack()[0][3] or, if you want to move it into a separate function, inspect.stack()[1][3] (f...
what is the best and general way to refer a function's __name__ in a function? Possible Duplicate: How do I get the name of a function or method from within a Python function or method? The below code function return it's name. It works but I still have to specify the 'test.' in front of of the __name__. Is there any g...
TITLE: what is the best and general way to refer a function's __name__ in a function? QUESTION: Possible Duplicate: How do I get the name of a function or method from within a Python function or method? The below code function return it's name. It works but I still have to specify the 'test.' in front of of the __name...
[ "python", "python-3.x" ]
0
0
2,726
2
0
2011-06-09T07:53:23.120000
2011-06-09T07:57:42.373000
6,289,709
6,289,873
Get all duplicates rows in sql
I want to fetch all duplicate values in sql. I searched at many places, but I don't get what I exactly want. My table is like this: company_id | supplier_id | company_name | organisation_no | type | sold_date ---------------------------------------------------------------------------- 121234 | 934575 | fgdf | 12345 | s...
select * from your_table where organization_no in (select organization_no from your_table group by organization_no having count(*) > 1)
Get all duplicates rows in sql I want to fetch all duplicate values in sql. I searched at many places, but I don't get what I exactly want. My table is like this: company_id | supplier_id | company_name | organisation_no | type | sold_date ---------------------------------------------------------------------------- 121...
TITLE: Get all duplicates rows in sql QUESTION: I want to fetch all duplicate values in sql. I searched at many places, but I don't get what I exactly want. My table is like this: company_id | supplier_id | company_name | organisation_no | type | sold_date --------------------------------------------------------------...
[ "mysql", "sql" ]
2
6
3,654
2
0
2011-06-09T07:54:14.287000
2011-06-09T08:10:09.510000
6,289,710
6,289,734
Error: Types don't match between the anchor and the recursive part , recursive cte for decimal datatype
I have something as the below declare @t table (id int identity,Price decimal(6,2)) insert into @t select 17.5 union all select 10.34 union all select 2.0 union all select 34.5 Now if I write a query as below;with cte(id, price) as ( select id, price from @t union all select cte.id, cte.price + t.price from cte join @t...
The fix:;with cte(id,price) as ( Select id, price from @t Union all Select cte.id, cast(cte.price + t.price as decimal(6,2)) From cte Join @t t On cte.id < t.id ) Select * from @t Explanation: The expression cte.price + t.price will return the type that is not necessarily decimal(6,2), can return decimal(5,2). So it ca...
Error: Types don't match between the anchor and the recursive part , recursive cte for decimal datatype I have something as the below declare @t table (id int identity,Price decimal(6,2)) insert into @t select 17.5 union all select 10.34 union all select 2.0 union all select 34.5 Now if I write a query as below;with ct...
TITLE: Error: Types don't match between the anchor and the recursive part , recursive cte for decimal datatype QUESTION: I have something as the below declare @t table (id int identity,Price decimal(6,2)) insert into @t select 17.5 union all select 10.34 union all select 2.0 union all select 34.5 Now if I write a quer...
[ "sql", "sql-server-2005", "t-sql", "common-table-expression" ]
4
5
5,366
2
0
2011-06-09T07:54:15.663000
2011-06-09T07:56:13.817000
6,289,718
6,289,802
Android: intercepting back key
since the back key destroys my application and all data will be lost I need to intercept it to ask the user if that is really what he wants. I thought of the following structure: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { // a...
When the user presses back your dialog appears. The onKeyDown has now been dealt with so you return true. Your dialog is now showing, when you press yes you want to imitate the back button which is what finish(); does when you press no you just dismiss the dialog and the activity continues You'll want this: @Override p...
Android: intercepting back key since the back key destroys my application and all data will be lost I need to intercept it to ask the user if that is really what he wants. I thought of the following structure: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && even...
TITLE: Android: intercepting back key QUESTION: since the back key destroys my application and all data will be lost I need to intercept it to ask the user if that is really what he wants. I thought of the following structure: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KE...
[ "android", "android-alertdialog", "onkeydown" ]
3
3
2,383
2
0
2011-06-09T07:54:39.700000
2011-06-09T08:02:03.613000
6,289,721
6,289,842
Compile time tree structure
I want to retrieve values from a tree stored in another system. For example: GetValue("Vehicle.Car.Ford.Focus.Engine.Oil.Color") To avoid typing errors and invalid keys, I want to check the name at compile time by creating an object or class with the tree structure in it: GetValue(Vehicle.Car.Ford.Focus.Engine.Oil.Colo...
If you want compile-time checking, you need to define your structure using compile-time constructs in some way. You could use T4 text template to automatically generate code from the tree structure. Possible ways I can think of: Nested static classes public static class Vehicle { public static class Car { public static...
Compile time tree structure I want to retrieve values from a tree stored in another system. For example: GetValue("Vehicle.Car.Ford.Focus.Engine.Oil.Color") To avoid typing errors and invalid keys, I want to check the name at compile time by creating an object or class with the tree structure in it: GetValue(Vehicle.Ca...
TITLE: Compile time tree structure QUESTION: I want to retrieve values from a tree stored in another system. For example: GetValue("Vehicle.Car.Ford.Focus.Engine.Oil.Color") To avoid typing errors and invalid keys, I want to check the name at compile time by creating an object or class with the tree structure in it: G...
[ "c#", "tree", "compile-time", "class-hierarchy" ]
5
4
293
4
0
2011-06-09T07:55:00
2011-06-09T08:06:32.257000
6,289,729
6,289,764
MySQL - UPDATE query with LIMIT
I want to update rows in my table with starting from 1001 to next 1000. I tried with following query: UPDATE `oltp_db`.`users` SET p_id = 3 LIMIT 1001, 1000 This is giving me syntax error. Is this correct? am I doing any mistake here. Can we limit update in this way? Also, the rows that I am trying to update are having...
When dealing with null, = does not match the null values. You can use IS NULL or IS NOT NULL UPDATE `smartmeter_usage`.`users_reporting` SET panel_id = 3 WHERE panel_id IS NULL LIMIT can be used with UPDATE but with the row count only
MySQL - UPDATE query with LIMIT I want to update rows in my table with starting from 1001 to next 1000. I tried with following query: UPDATE `oltp_db`.`users` SET p_id = 3 LIMIT 1001, 1000 This is giving me syntax error. Is this correct? am I doing any mistake here. Can we limit update in this way? Also, the rows that ...
TITLE: MySQL - UPDATE query with LIMIT QUESTION: I want to update rows in my table with starting from 1001 to next 1000. I tried with following query: UPDATE `oltp_db`.`users` SET p_id = 3 LIMIT 1001, 1000 This is giving me syntax error. Is this correct? am I doing any mistake here. Can we limit update in this way? Al...
[ "mysql", "limit", "sql-update" ]
112
32
336,417
11
0
2011-06-09T07:55:34.633000
2011-06-09T07:58:26.077000
6,289,730
6,290,014
simplepie error on xampp
I am using Simplepie on XAMPP. I get the following error. Severity: User Warning Message: C:\xampp\htdocs\Myapp/system/cache/simplepie/ is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable. Filename: libraries/Simplepie.php Line Number: 2040 Since it is ...
I encountered the same problem on simplepie on PHP5 ON WINDOWS and fixed it as follows: 1) First thing's first. You must make sure that the path exists and it is writeable: file_put_contents('C:\\xampp\\htdocs\\Myapp\\system\\cache\\simplepie\\', 'test'); 2) If this works then you can just go ahead the edit the simplep...
simplepie error on xampp I am using Simplepie on XAMPP. I get the following error. Severity: User Warning Message: C:\xampp\htdocs\Myapp/system/cache/simplepie/ is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable. Filename: libraries/Simplepie.php Line ...
TITLE: simplepie error on xampp QUESTION: I am using Simplepie on XAMPP. I get the following error. Severity: User Warning Message: C:\xampp\htdocs\Myapp/system/cache/simplepie/ is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable. Filename: libraries/S...
[ "php", "simplepie" ]
0
2
1,525
2
0
2011-06-09T07:55:35.300000
2011-06-09T08:24:39.840000
6,289,756
6,289,875
Clear memory used by UIImage -- UIImageView.image = nil doesn't do it
I have created an UIScrollView that contains photos, like in the Photos app. Photos are downloaded. Images are set through: imageView.image = [UIImage imageWithData:downloadedImageData]; To save memory, when the user goes far from a photo, I set imageView.image = nil; This doesn't clear the memory, though. "Memory Leak...
[UIImage imageWithData:] is autoreleased object, so it will be freed somewhere in run loop. To release it for sure, use alloc/init constructor.
Clear memory used by UIImage -- UIImageView.image = nil doesn't do it I have created an UIScrollView that contains photos, like in the Photos app. Photos are downloaded. Images are set through: imageView.image = [UIImage imageWithData:downloadedImageData]; To save memory, when the user goes far from a photo, I set imag...
TITLE: Clear memory used by UIImage -- UIImageView.image = nil doesn't do it QUESTION: I have created an UIScrollView that contains photos, like in the Photos app. Photos are downloaded. Images are set through: imageView.image = [UIImage imageWithData:downloadedImageData]; To save memory, when the user goes far from a...
[ "objective-c", "cocoa-touch", "ios", "uiimage", "memory-management" ]
1
3
1,576
1
0
2011-06-09T07:57:57.170000
2011-06-09T08:10:20.167000
6,289,761
6,290,897
How to downcast from obj to option<obj>?
I have a function that takes a parameter of type object and needs to downcast it to an option. member s.Bind(x: obj, rest) = let x = x:?> Option If I pass (for example) an Option as x, the last line throws the exception: Unable to cast object of type 'Microsoft.FSharp.Core.FSharpOption'1[System.String]' to type 'Micros...
There isn't any nice way to solve this problem currently. The issue is that you'd need to introduce a new generic type parameter in the pattern matching (when matching against option<'a> ), but F# only allows you to define generic type parameters in function declarations. So, your only solution is to use some Reflectio...
How to downcast from obj to option<obj>? I have a function that takes a parameter of type object and needs to downcast it to an option. member s.Bind(x: obj, rest) = let x = x:?> Option If I pass (for example) an Option as x, the last line throws the exception: Unable to cast object of type 'Microsoft.FSharp.Core.FShar...
TITLE: How to downcast from obj to option<obj>? QUESTION: I have a function that takes a parameter of type object and needs to downcast it to an option. member s.Bind(x: obj, rest) = let x = x:?> Option If I pass (for example) an Option as x, the last line throws the exception: Unable to cast object of type 'Microsoft...
[ "f#", "casting" ]
12
9
2,929
3
0
2011-06-09T07:58:16.600000
2011-06-09T09:43:59.730000
6,289,762
6,290,006
How is numpy array organized in memory?
I am trying to get some data from an module which is a shared object wrapped with ctypes. The data is a numeric array so I used numpy array to store the data. But I learned that I don't understand how numpy organize the array in memory. If I had a C function that would fill a array like below: int filler(int* a,int len...
This would make sense if int was 32 bit, but I suppose C int are 16 bits (GCC in openSUSE in a x86 intel machine). I tried running with dtypes being 32 bits and strangely I get the result I want: Not strange at all: your supposition is wrong, and your machine is 32 bit with a 32 bit int and a 16 bit short int.. unless ...
How is numpy array organized in memory? I am trying to get some data from an module which is a shared object wrapped with ctypes. The data is a numeric array so I used numpy array to store the data. But I learned that I don't understand how numpy organize the array in memory. If I had a C function that would fill a arr...
TITLE: How is numpy array organized in memory? QUESTION: I am trying to get some data from an module which is a shared object wrapped with ctypes. The data is a numeric array so I used numpy array to store the data. But I learned that I don't understand how numpy organize the array in memory. If I had a C function tha...
[ "memory", "numpy", "ctypes" ]
1
2
335
1
0
2011-06-09T07:58:19.623000
2011-06-09T08:23:54.727000
6,289,765
6,289,799
Java Scanner why is nextLine() in my code being skipped?
Scanner kb = new Scanner(System.in); System.out.println("Inserting L"); int L = kb.nextInt(); System.out.println("Inserting N"); int N = kb.nextInt(); System.out.println("Inserting x"); String x = kb.nextLine(); System.out.println(x); System.out.println("You inputed L,N,x"); Why is there no prompt for nextLine() in thi...
Use: String x = kb.next(); instead of kb.nextLine(). This is because nextInt() reads just the number, not the end of line or anything after the number. When you call nextLine() it reads the remainder of the same line and does not wait for input. Ideally you should call kb.nextLine() the line after your code for nextInt...
Java Scanner why is nextLine() in my code being skipped? Scanner kb = new Scanner(System.in); System.out.println("Inserting L"); int L = kb.nextInt(); System.out.println("Inserting N"); int N = kb.nextInt(); System.out.println("Inserting x"); String x = kb.nextLine(); System.out.println(x); System.out.println("You inpu...
TITLE: Java Scanner why is nextLine() in my code being skipped? QUESTION: Scanner kb = new Scanner(System.in); System.out.println("Inserting L"); int L = kb.nextInt(); System.out.println("Inserting N"); int N = kb.nextInt(); System.out.println("Inserting x"); String x = kb.nextLine(); System.out.println(x); System.out...
[ "java", "java.util.scanner" ]
2
3
6,954
2
0
2011-06-09T07:58:26.617000
2011-06-09T08:01:43.427000
6,289,772
6,290,036
Navigating to a details page - shared view model or navigation query string?
When navigating from a list page to a details page, there are two high level ways of passing the selection data between the pages: sharing a view model instance and passing an identifier in the querystring of the navigation Uri. Which should I be using? Are there any issues with using one approach over the other (acces...
Personally I would recommend passing an identifier as part of the navigation URI querystring. These URIs are restored to form the back-stack when your application re-enabled after tombstoning. When your application is restored after being tombstoned, you re-create your applications view model from the application state...
Navigating to a details page - shared view model or navigation query string? When navigating from a list page to a details page, there are two high level ways of passing the selection data between the pages: sharing a view model instance and passing an identifier in the querystring of the navigation Uri. Which should I...
TITLE: Navigating to a details page - shared view model or navigation query string? QUESTION: When navigating from a list page to a details page, there are two high level ways of passing the selection data between the pages: sharing a view model instance and passing an identifier in the querystring of the navigation U...
[ "windows-phone-7", "mvvm", "navigation", "tombstoning" ]
6
8
1,572
2
0
2011-06-09T07:59:29.790000
2011-06-09T08:27:06.093000
6,289,784
6,289,827
XPath and XPathSelectElement
I have the following xml I've tried everything to read the name of the db2 (="Name2") with all possible combinations of XPath queries, but never get the expected result. My Code so far: var query = "root/databases/db2.. "; // here I've tried everything var doc = XDocument.Load("myconfig.xml"); var dbName = doc.XPathSel...
var dbName = doc.XPathSelectElement("root/databases/db2").Attribute("name");
XPath and XPathSelectElement I have the following xml I've tried everything to read the name of the db2 (="Name2") with all possible combinations of XPath queries, but never get the expected result. My Code so far: var query = "root/databases/db2.. "; // here I've tried everything var doc = XDocument.Load("myconfig.xml...
TITLE: XPath and XPathSelectElement QUESTION: I have the following xml I've tried everything to read the name of the db2 (="Name2") with all possible combinations of XPath queries, but never get the expected result. My Code so far: var query = "root/databases/db2.. "; // here I've tried everything var doc = XDocument....
[ "c#", ".net", "xml", "xpath", "linq-to-xml" ]
20
23
49,034
3
0
2011-06-09T08:00:15.593000
2011-06-09T08:04:54.720000
6,289,807
6,290,561
Print Plot in Octave in Background
Currently, I use print -dpng foo.png to print a plot to file in Octave 3.0.1 on Ubuntu. Sometimes, I generate thousands of images in a loop. Whenever a new image pops up, it grabs the mouse control precluding me from multitasking. Is there anyway to print silently or quietly?
It would be easier to answer your question with a little more information about what you are doing. But with a little guessing maybe this is what you need: f = figure set(f, "visible", "off") plot([1,2,3,4]) print("MyPNG.png", "-dpng")
Print Plot in Octave in Background Currently, I use print -dpng foo.png to print a plot to file in Octave 3.0.1 on Ubuntu. Sometimes, I generate thousands of images in a loop. Whenever a new image pops up, it grabs the mouse control precluding me from multitasking. Is there anyway to print silently or quietly?
TITLE: Print Plot in Octave in Background QUESTION: Currently, I use print -dpng foo.png to print a plot to file in Octave 3.0.1 on Ubuntu. Sometimes, I generate thousands of images in a loop. Whenever a new image pops up, it grabs the mouse control precluding me from multitasking. Is there anyway to print silently or...
[ "gnuplot", "octave" ]
8
13
4,253
1
0
2011-06-09T08:02:39.983000
2011-06-09T09:15:17.027000
6,289,813
6,289,864
Will Apple charge me for using the Push Notification Service?
I have an Apple id, and I am building an application in which I am using Apple Push Notification Service, but I am a little confused about that. Is there any charges for doing this process from Apple? Is there any limit that it can run on specific number of Devices in which my app is installed?
Apple will never charge you for using its Push Notification services. It's free and you can send notifications to any number of devices you want/have to.
Will Apple charge me for using the Push Notification Service? I have an Apple id, and I am building an application in which I am using Apple Push Notification Service, but I am a little confused about that. Is there any charges for doing this process from Apple? Is there any limit that it can run on specific number of ...
TITLE: Will Apple charge me for using the Push Notification Service? QUESTION: I have an Apple id, and I am building an application in which I am using Apple Push Notification Service, but I am a little confused about that. Is there any charges for doing this process from Apple? Is there any limit that it can run on s...
[ "apple-push-notifications" ]
3
6
928
3
0
2011-06-09T08:03:32.520000
2011-06-09T08:08:52.090000
6,289,814
6,290,078
When Extending LinearLayout Child Views are not visible
Alright. So I start my activity in Main, grab the FragmentManager and instantiate a Fragment which needs to return a View. OK. So I extended a LinearLayout in order to have something to return. My Activity and Fragment are happy but I am not. Three LinearLayouts which I create in the parent ViewGroup are there (code be...
The problem is simply because you are overriding onLayout and doing nothing with it. You only need to override this if you want to layout the children yourself (ie, you were designing some unique custom layout). In this case just remove that method, or call super.onLayout.
When Extending LinearLayout Child Views are not visible Alright. So I start my activity in Main, grab the FragmentManager and instantiate a Fragment which needs to return a View. OK. So I extended a LinearLayout in order to have something to return. My Activity and Fragment are happy but I am not. Three LinearLayouts w...
TITLE: When Extending LinearLayout Child Views are not visible QUESTION: Alright. So I start my activity in Main, grab the FragmentManager and instantiate a Fragment which needs to return a View. OK. So I extended a LinearLayout in order to have something to return. My Activity and Fragment are happy but I am not. Thr...
[ "android", "android-layout" ]
5
3
3,398
1
0
2011-06-09T08:03:40.400000
2011-06-09T08:31:48.667000
6,289,822
6,289,898
How to set the height and width of linear layout dynamically in android
I have a Linearlayout in my xml which has fill_parent for both height and width... Now i want to dynamically change the height and width... I tried Using _llChooseType.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,getWindowManager().getDefaultDisplay().getHeight()-100)); But it is giving me java.lang.ClassC...
Use this.. new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,getWindowManager().getDefaultDisplay().getHeight()-100));
How to set the height and width of linear layout dynamically in android I have a Linearlayout in my xml which has fill_parent for both height and width... Now i want to dynamically change the height and width... I tried Using _llChooseType.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,getWindowManager().get...
TITLE: How to set the height and width of linear layout dynamically in android QUESTION: I have a Linearlayout in my xml which has fill_parent for both height and width... Now i want to dynamically change the height and width... I tried Using _llChooseType.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,getW...
[ "android" ]
1
6
20,541
4
0
2011-06-09T08:04:29.277000
2011-06-09T08:13:05.223000
6,289,824
6,289,857
PHP instant messaging methods
I want to make an IM so that user's can send instant messages to each others on the same page like a chat. Users can choose that who can see their messages. Its for task management. What is the best method that I should use for. I'm using php. Is php sockets usefull for this? or Polling, Comet, php output buffer or jav...
The most frequently used method is called COMET. Here is a PHP implementation: How to implement COMET with PHP In the HTML5 specification there are something called websockets that many browsers already have implemented. Here is a PHP project supporting websockets: phpwebsocket. There are some javascript libraries whic...
PHP instant messaging methods I want to make an IM so that user's can send instant messages to each others on the same page like a chat. Users can choose that who can see their messages. Its for task management. What is the best method that I should use for. I'm using php. Is php sockets usefull for this? or Polling, C...
TITLE: PHP instant messaging methods QUESTION: I want to make an IM so that user's can send instant messages to each others on the same page like a chat. Users can choose that who can see their messages. Its for task management. What is the best method that I should use for. I'm using php. Is php sockets usefull for t...
[ "php", "sockets", "chat", "comet", "polling" ]
1
4
12,769
4
0
2011-06-09T08:04:38.123000
2011-06-09T08:08:33.130000
6,289,829
6,289,900
setTimeout First Delay does not take Effect
setTimeout doesn't work as expected because it will execute the codes below subsequently without waiting for the delay to run the first argument of 'setTimeout' (function() { var a = ['#bird','#flower','#cat']; var totalno = settings.imageArray.length; function rotateImages(start) { var nextImage = start + 1; if(nextIm...
it will execute the codes below subsequently without waiting for the delay to run the first argument of 'setTimeout' It looks like you're starting the first rotate directly. Instead of: rotateImages(0); Try to start the first rotate with a delay, like: window.setTimeout(function() { rotateImages(0); }, settings.imageAr...
setTimeout First Delay does not take Effect setTimeout doesn't work as expected because it will execute the codes below subsequently without waiting for the delay to run the first argument of 'setTimeout' (function() { var a = ['#bird','#flower','#cat']; var totalno = settings.imageArray.length; function rotateImages(s...
TITLE: setTimeout First Delay does not take Effect QUESTION: setTimeout doesn't work as expected because it will execute the codes below subsequently without waiting for the delay to run the first argument of 'setTimeout' (function() { var a = ['#bird','#flower','#cat']; var totalno = settings.imageArray.length; funct...
[ "javascript", "jquery", "delay", "settimeout" ]
0
1
565
1
0
2011-06-09T08:05:00.663000
2011-06-09T08:13:07.693000
6,289,839
6,289,865
Flex align a image to the rightmost of the HGroup?
Is there a way to align an image to the rightmost of HGroup, which is setted to 100% width? here is my code, but it aligning the image "imageZoom" just after the object before it:
I think it should work:) In a case you want to have SpriteVisualElement and Label instances on the same places you can use spacer:
Flex align a image to the rightmost of the HGroup? Is there a way to align an image to the rightmost of HGroup, which is setted to 100% width? here is my code, but it aligning the image "imageZoom" just after the object before it:
TITLE: Flex align a image to the rightmost of the HGroup? QUESTION: Is there a way to align an image to the rightmost of HGroup, which is setted to 100% width? here is my code, but it aligning the image "imageZoom" just after the object before it: ANSWER: I think it should work:) In a case you want to have SpriteVisu...
[ "apache-flex", "alignment" ]
2
5
4,558
1
0
2011-06-09T08:06:15.923000
2011-06-09T08:09:05.650000
6,289,845
6,289,849
How do I write a servlet which rotates images?
Hi just wanted to share this servlet it takes 2 arguments ( img-> image name, rot ->rotation of the images) loads the image from the images directory rotates it and outputs it to the servlet stream you can find it in the answer below
package at.buchinger.mapdisplay; import java.awt.geom.AffineTransform; import java.awt.image.AffineTransformOp; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Iterator; import javax.imageio.ImageIO; import javax.imageio.ImageWriter; import javax.servlet.ServletC...
How do I write a servlet which rotates images? Hi just wanted to share this servlet it takes 2 arguments ( img-> image name, rot ->rotation of the images) loads the image from the images directory rotates it and outputs it to the servlet stream you can find it in the answer below
TITLE: How do I write a servlet which rotates images? QUESTION: Hi just wanted to share this servlet it takes 2 arguments ( img-> image name, rot ->rotation of the images) loads the image from the images directory rotates it and outputs it to the servlet stream you can find it in the answer below ANSWER: package at.b...
[ "java", "image", "servlets", "outputstream" ]
0
2
1,770
1
0
2011-06-09T08:07:18.030000
2011-06-09T08:07:38.170000
6,289,860
6,290,377
Magento Layered Navigation on Subcategories not shown
On my store I can see the layered navigation on the top level categories pages, but not on sub-categories. How I can show the filters on the sub-categories pages? Thanks.
Probably you did not defined the subcategories as "Anchor". To do this, go to Catalog - Manage Categories. Click on a subcategory, go to Display Settings and set "Is Anchor" to "Yes".
Magento Layered Navigation on Subcategories not shown On my store I can see the layered navigation on the top level categories pages, but not on sub-categories. How I can show the filters on the sub-categories pages? Thanks.
TITLE: Magento Layered Navigation on Subcategories not shown QUESTION: On my store I can see the layered navigation on the top level categories pages, but not on sub-categories. How I can show the filters on the sub-categories pages? Thanks. ANSWER: Probably you did not defined the subcategories as "Anchor". To do th...
[ "magento", "filter", "navigation" ]
9
18
13,071
2
0
2011-06-09T08:08:44.503000
2011-06-09T08:59:38.517000
6,289,904
6,290,289
Aspen Simulator not working
I have googled for two days and still no luck. I am running a Mac OS X 10.5.5 and the iPhone SDK 3.1 beta, running the Aspen Simulator. My problem is that I can not get any app to work on the Simulator. It builds alright but the simulator shows a black screen and then returns to the main menu. I get this error on Xcode...
I think you should think about updating your system. Using an old iPhone SDK 3.1 beta nowadays is really strange, you should update to the latest stable iOS SDK 4.3.3 and test backwards compatibility of your app using the built in iOS SDK 3.2 from iPad. This will help you test the app on this older SDK while getting ac...
Aspen Simulator not working I have googled for two days and still no luck. I am running a Mac OS X 10.5.5 and the iPhone SDK 3.1 beta, running the Aspen Simulator. My problem is that I can not get any app to work on the Simulator. It builds alright but the simulator shows a black screen and then returns to the main men...
TITLE: Aspen Simulator not working QUESTION: I have googled for two days and still no luck. I am running a Mac OS X 10.5.5 and the iPhone SDK 3.1 beta, running the Aspen Simulator. My problem is that I can not get any app to work on the Simulator. It builds alright but the simulator shows a black screen and then retur...
[ "iphone", "cocoa-touch", "iphone-sdk-3.0", "springboard" ]
1
0
307
1
0
2011-06-09T08:13:52.967000
2011-06-09T08:52:06.750000
6,289,915
6,289,940
Python remove spaces and append
I am currently writing a growl notification plugin for emesene messenger on OS X. It is nearly working except to when it comes to displaying a message snippet. The message is passed to growlnotify as a variable, however growl does not accept spaces in the displayed message. So what i need help with is a script to remov...
Instead of trying to do this with os.system(), use subprocess instead, passing the program and arguments as a list.
Python remove spaces and append I am currently writing a growl notification plugin for emesene messenger on OS X. It is nearly working except to when it comes to displaying a message snippet. The message is passed to growlnotify as a variable, however growl does not accept spaces in the displayed message. So what i nee...
TITLE: Python remove spaces and append QUESTION: I am currently writing a growl notification plugin for emesene messenger on OS X. It is nearly working except to when it comes to displaying a message snippet. The message is passed to growlnotify as a variable, however growl does not accept spaces in the displayed mess...
[ "python", "string", "text", "growlnotify" ]
0
7
3,148
5
0
2011-06-09T08:15:11.087000
2011-06-09T08:17:13.730000
6,289,916
6,289,954
How to get the HostName, Ip of the machine hosting the asp.net application
How can i get the LocalhostName, Ip of the machine hosting the Application. For development it would be localhost for deployment something different. This i need to initialize the SmtpClient to send emails through application SmtpClient emailClient = new SmtpClient("host","port");//port is optional i am looking for a p...
If you want to configure SmtpClient class, you should have a look at the system.net > mailsettings entry of the web.config: http://msdn.microsoft.com/en-us/library/w355a94k.aspx And instanciate the StmpClient with parameterless constructor var client = new SmtpClient();
How to get the HostName, Ip of the machine hosting the asp.net application How can i get the LocalhostName, Ip of the machine hosting the Application. For development it would be localhost for deployment something different. This i need to initialize the SmtpClient to send emails through application SmtpClient emailCli...
TITLE: How to get the HostName, Ip of the machine hosting the asp.net application QUESTION: How can i get the LocalhostName, Ip of the machine hosting the Application. For development it would be localhost for deployment something different. This i need to initialize the SmtpClient to send emails through application S...
[ "c#", "asp.net", "email", "smtp", "localhost" ]
2
3
2,815
2
0
2011-06-09T08:15:21.973000
2011-06-09T08:18:24.163000
6,289,923
6,289,959
Why "System.arraycopy" uses "Object" instead of "Object[]"?
Just curious: Someone knows why the method System.arraycopy uses Object as type for src and dest? Would be perfectly possible to use Object[] instead? Why define: arraycopy(Object src, int srcPos, Object dest, int destPos, int length) instead of arraycopy(Object[] src, int srcPos, Object[] dest, int destPos, int length...
Primitive array types like boolean[] and double[] do not extend Object[] but they do extend Object This method allows you to copy any type of array, so the type is Object. int[] a = int[] b = System.arraycopy(a, 0, b, 0, a.length);
Why "System.arraycopy" uses "Object" instead of "Object[]"? Just curious: Someone knows why the method System.arraycopy uses Object as type for src and dest? Would be perfectly possible to use Object[] instead? Why define: arraycopy(Object src, int srcPos, Object dest, int destPos, int length) instead of arraycopy(Obje...
TITLE: Why "System.arraycopy" uses "Object" instead of "Object[]"? QUESTION: Just curious: Someone knows why the method System.arraycopy uses Object as type for src and dest? Would be perfectly possible to use Object[] instead? Why define: arraycopy(Object src, int srcPos, Object dest, int destPos, int length) instead...
[ "java", "arrays" ]
18
20
1,411
2
0
2011-06-09T08:15:57.627000
2011-06-09T08:19:00.097000
6,289,947
6,289,960
Is memcpy() safe when copy some content larger than dst?
Is it safe when the request_token.size() is larger than LEN? char dst[LEN]; memcpy(dst, request_token.c_str(), request_token.size());
No, it's not safe; you'll cause a buffer overflow. The reason is, memcpy has no way to know the size of your target buffer, other than the size you pass in the third argument.
Is memcpy() safe when copy some content larger than dst? Is it safe when the request_token.size() is larger than LEN? char dst[LEN]; memcpy(dst, request_token.c_str(), request_token.size());
TITLE: Is memcpy() safe when copy some content larger than dst? QUESTION: Is it safe when the request_token.size() is larger than LEN? char dst[LEN]; memcpy(dst, request_token.c_str(), request_token.size()); ANSWER: No, it's not safe; you'll cause a buffer overflow. The reason is, memcpy has no way to know the size o...
[ "c++", "c", "memcpy" ]
4
8
723
4
0
2011-06-09T08:17:48.520000
2011-06-09T08:19:12.550000
6,289,953
6,290,294
Copy number to another intent/app textbox
i am trying to copy a number (total sale) from my app to the credit card processing app that i am using (square). how could i do that? i am trying to use intents. chargeButton.setOnClickListener(new OnClickListener() { public void onClick(View h) { Intent intent = new Intent(Intent.ACTION_INSERT); intent.putExtra(Inten...
there is no way to use square without installing squareup on device download helper library here use code from here to make your payment
Copy number to another intent/app textbox i am trying to copy a number (total sale) from my app to the credit card processing app that i am using (square). how could i do that? i am trying to use intents. chargeButton.setOnClickListener(new OnClickListener() { public void onClick(View h) { Intent intent = new Intent(In...
TITLE: Copy number to another intent/app textbox QUESTION: i am trying to copy a number (total sale) from my app to the credit card processing app that i am using (square). how could i do that? i am trying to use intents. chargeButton.setOnClickListener(new OnClickListener() { public void onClick(View h) { Intent inte...
[ "android", "android-intent" ]
0
0
182
1
0
2011-06-09T08:18:19.663000
2011-06-09T08:52:49.973000
6,289,965
6,290,085
How to get data from Another Database into My Database?
RoR = 2.3.11 Ruby = 1.8.7 Gem = 1.3.7 I have one database (call it "First") with 4 tables. And I Have another database (call this database "Second" ), (with another password). I want take emails (field) from Second and table if there are any updates was and inserting into First database. Question: How I can do it?
You can define different databases in your database.yml. first: adapter: mysql database: first_development username: user password: pwd host: localhost second: adapter: mysql database: second_development username: user password: pwd host: localhost and then connect your models to different databases using ActiveRecord...
How to get data from Another Database into My Database? RoR = 2.3.11 Ruby = 1.8.7 Gem = 1.3.7 I have one database (call it "First") with 4 tables. And I Have another database (call this database "Second" ), (with another password). I want take emails (field) from Second and table if there are any updates was and insert...
TITLE: How to get data from Another Database into My Database? QUESTION: RoR = 2.3.11 Ruby = 1.8.7 Gem = 1.3.7 I have one database (call it "First") with 4 tables. And I Have another database (call this database "Second" ), (with another password). I want take emails (field) from Second and table if there are any upda...
[ "ruby-on-rails" ]
1
5
2,958
1
0
2011-06-09T08:19:44.600000
2011-06-09T08:32:26.043000
6,289,966
6,291,227
Images not being displayed on iOS 3.2
I have a small iPhone app which works fine on iOS 4, but when i run it on iOS 3.2 or below none of the app images are displayed. At first, i thought it was because i was missing some high res images but if that was the case then the images still would have been displayed on iOS 3.2? So, my question is: Why are my image...
It could be a problem related to the filename extension in your call: UIImage *chevronImage = [UIImage imageNamed:@"chevron"]; You could try to change this to: UIImage *chevronImage = [UIImage imageNamed:@"chevron.png"]; I suspect that iOS 4+ "automagically" infers the images extension when you do not use them.
Images not being displayed on iOS 3.2 I have a small iPhone app which works fine on iOS 4, but when i run it on iOS 3.2 or below none of the app images are displayed. At first, i thought it was because i was missing some high res images but if that was the case then the images still would have been displayed on iOS 3.2...
TITLE: Images not being displayed on iOS 3.2 QUESTION: I have a small iPhone app which works fine on iOS 4, but when i run it on iOS 3.2 or below none of the app images are displayed. At first, i thought it was because i was missing some high res images but if that was the case then the images still would have been di...
[ "iphone", "ios", "image" ]
1
2
291
1
0
2011-06-09T08:19:48.697000
2011-06-09T10:14:39.003000
6,289,970
6,290,333
failed to execute this c++ code on android
i am trying to call native opengl methods from java. Everything compiles ok but i still get this horrible error in android log cat ERROR/AndroidRuntime(536): java.lang.UnsatisfiedLinkError:init at com.deo.Glut.Init(Native Method) according to oracle UnsatisfiedLinkError is Thrown if the Java Virtual Machine cannot find...
Because your file is a cpp file, you will need extern "C" { } around your exported functions. Otherwise the compiler will mangle the function names and Java won't find the ones it's looking for.
failed to execute this c++ code on android i am trying to call native opengl methods from java. Everything compiles ok but i still get this horrible error in android log cat ERROR/AndroidRuntime(536): java.lang.UnsatisfiedLinkError:init at com.deo.Glut.Init(Native Method) according to oracle UnsatisfiedLinkError is Thr...
TITLE: failed to execute this c++ code on android QUESTION: i am trying to call native opengl methods from java. Everything compiles ok but i still get this horrible error in android log cat ERROR/AndroidRuntime(536): java.lang.UnsatisfiedLinkError:init at com.deo.Glut.Init(Native Method) according to oracle Unsatisfi...
[ "c++", "opengl-es", "java-native-interface", "android-ndk" ]
2
10
896
1
0
2011-06-09T08:20:02.513000
2011-06-09T08:56:24.457000
6,289,972
6,290,023
T4 with languages other than C# and VB
Is it posible to write T4 templates in other.NET languages? In particular I'm interested in F# and IronPython.
The doc stipulates that only VB and C# are supported: T4 Template Directive, see the language attribute.
T4 with languages other than C# and VB Is it posible to write T4 templates in other.NET languages? In particular I'm interested in F# and IronPython.
TITLE: T4 with languages other than C# and VB QUESTION: Is it posible to write T4 templates in other.NET languages? In particular I'm interested in F# and IronPython. ANSWER: The doc stipulates that only VB and C# are supported: T4 Template Directive, see the language attribute.
[ ".net", "f#", "ironpython", "t4" ]
2
2
637
2
0
2011-06-09T08:20:13.043000
2011-06-09T08:25:34.027000
6,289,988
6,290,032
FTP Server on Windows 7 Running WAMP
We are using a Windows 7 machine as our test server. The machine is configured with a static IP and WAMP is running for our PHP Sites. we can access the test sites from internet. Could you tell me how I can make the WAMP's www directory available through FTP or any other file sharing protocol in Windows 7? Kind regards...
This question should be on serverfault. Anyway, you may run a FileZilla ftp server: http://filezilla-project.org/
FTP Server on Windows 7 Running WAMP We are using a Windows 7 machine as our test server. The machine is configured with a static IP and WAMP is running for our PHP Sites. we can access the test sites from internet. Could you tell me how I can make the WAMP's www directory available through FTP or any other file sharin...
TITLE: FTP Server on Windows 7 Running WAMP QUESTION: We are using a Windows 7 machine as our test server. The machine is configured with a static IP and WAMP is running for our PHP Sites. we can access the test sites from internet. Could you tell me how I can make the WAMP's www directory available through FTP or any...
[ "windows-7", "file-sharing" ]
0
0
4,155
2
0
2011-06-09T08:21:51.593000
2011-06-09T08:26:13.760000
6,290,012
6,290,526
xslt cannot assign a param with a boolean value within `<xsl:choose>`
this code is giving me the output test when the expected output should be nothing.. Is it something wrong with my XSLT processor or..?: test Btw i need a solution for raw XSLT 1.0 (no extensions and stuff like that). Is it possible to set a boolean parameter for a param in XSLT 1.0?
Your parameter is evaluating to a string. You should use: test
xslt cannot assign a param with a boolean value within `<xsl:choose>` this code is giving me the output test when the expected output should be nothing.. Is it something wrong with my XSLT processor or..?: test Btw i need a solution for raw XSLT 1.0 (no extensions and stuff like that). Is it possible to set a boolean p...
TITLE: xslt cannot assign a param with a boolean value within `<xsl:choose>` QUESTION: this code is giving me the output test when the expected output should be nothing.. Is it something wrong with my XSLT processor or..?: test Btw i need a solution for raw XSLT 1.0 (no extensions and stuff like that). Is it possible ...
[ "xml", "xslt", "exslt" ]
2
4
8,047
3
0
2011-06-09T08:24:21.453000
2011-06-09T09:11:38.683000
6,290,013
6,290,046
Reflection: How to find a constructor that takes a list of objects?
I have a class that takes a List in the constructor; public class MyClass { private List structures; public MyClass(List structures) { this.structures = structures; } } that I need to instantiate via reflection. How do I define the call to class.getConstructor() to find this? Regards
This should work: Constructor constructor = MyClass.class.getConstructor(List.class); or Constructor constructor = MyClass.class.getConstructor(new Class[]{List.class}); for Java 1.4.x or less
Reflection: How to find a constructor that takes a list of objects? I have a class that takes a List in the constructor; public class MyClass { private List structures; public MyClass(List structures) { this.structures = structures; } } that I need to instantiate via reflection. How do I define the call to class.getC...
TITLE: Reflection: How to find a constructor that takes a list of objects? QUESTION: I have a class that takes a List in the constructor; public class MyClass { private List structures; public MyClass(List structures) { this.structures = structures; } } that I need to instantiate via reflection. How do I define the ...
[ "java", "reflection" ]
6
8
7,703
2
0
2011-06-09T08:24:21.857000
2011-06-09T08:28:18.207000
6,290,015
6,290,169
Tomcat security manager - c3p0 and hibernate
I am using a Tomcat security enabled server, and Hibernate3 with c3p0. Here are my policies in catalina.policy (I found these lines on the net and changed a bit): grant codeBase "file:${catalina.base}/webapps/omiccir/-" { /////////////// FilePermission ////////// permission java.io.FilePermission "${catalina.home}/log...
Going by the stacktraces in the exception, it looks like the failure is due the inability to find a physical connection in the connection pool, after waiting for a sufficient period of time. The reason for this could be deduced to the following two permissions granted in the policy: permission java.net.SocketPermission...
Tomcat security manager - c3p0 and hibernate I am using a Tomcat security enabled server, and Hibernate3 with c3p0. Here are my policies in catalina.policy (I found these lines on the net and changed a bit): grant codeBase "file:${catalina.base}/webapps/omiccir/-" { /////////////// FilePermission ////////// permission...
TITLE: Tomcat security manager - c3p0 and hibernate QUESTION: I am using a Tomcat security enabled server, and Hibernate3 with c3p0. Here are my policies in catalina.policy (I found these lines on the net and changed a bit): grant codeBase "file:${catalina.base}/webapps/omiccir/-" { /////////////// FilePermission ///...
[ "java", "mysql", "security", "hibernate", "tomcat" ]
1
1
3,193
2
0
2011-06-09T08:24:41.873000
2011-06-09T08:41:31.707000