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,235,015 | 6,235,052 | How do you deal with font sizes in WPF? | I'm creating a touchscreen-optimized application. There are quite large buttons with labels inside of them. Generally, the text size should fit to the space the buttons provides, because this application needs to deal with different display resolutions. I've achieved this effect by using a ViewBox as parent control. Bu... | Here are the Microsoft Surface design guidelines for typography: http://msdn.microsoft.com/en-us/library/ff318626(v=Surface.10).aspx To answer your specific question, pick a font size that fits well with all your buttons. Don't use different sizes on different buttons. Font size indicates to users what is most importan... | How do you deal with font sizes in WPF? I'm creating a touchscreen-optimized application. There are quite large buttons with labels inside of them. Generally, the text size should fit to the space the buttons provides, because this application needs to deal with different display resolutions. I've achieved this effect ... | TITLE:
How do you deal with font sizes in WPF?
QUESTION:
I'm creating a touchscreen-optimized application. There are quite large buttons with labels inside of them. Generally, the text size should fit to the space the buttons provides, because this application needs to deal with different display resolutions. I've ach... | [
"c#",
"wpf",
"font-size"
] | 2 | 3 | 289 | 2 | 0 | 2011-06-04T05:45:52.443000 | 2011-06-04T05:57:35.993000 |
6,235,018 | 6,241,918 | Persistent object in BlackBerry Application | I have been trying to use the persistent object in BlackBerry Application. I am making a login page where I can save the username and password in the application. Below is the code I used in the login page public final class LoginScreen extends MainScreen { private BasicEditField useremailField; private PasswordEditFie... | Please go through the following sample. http://www.blackberryforums.com/developer-forum/13335-data-save-read-example.html It is better to create a utility class to use the persistent object. How To Save BlackBerry Settings in The Persistent Store | Persistent object in BlackBerry Application I have been trying to use the persistent object in BlackBerry Application. I am making a login page where I can save the username and password in the application. Below is the code I used in the login page public final class LoginScreen extends MainScreen { private BasicEditF... | TITLE:
Persistent object in BlackBerry Application
QUESTION:
I have been trying to use the persistent object in BlackBerry Application. I am making a login page where I can save the username and password in the application. Below is the code I used in the login page public final class LoginScreen extends MainScreen { ... | [
"eclipse",
"blackberry",
"data-persistence"
] | 0 | 1 | 1,198 | 2 | 0 | 2011-06-04T05:48:52.307000 | 2011-06-05T09:01:29.217000 |
6,235,019 | 6,235,270 | What is best practice on handling duplicate method calls? | Let's say I have a class loader I want to register. $loader = new ClassLoader;
$loader->register(); When the method register() is called a second time, should I: Throw an exception stating that the class loader has already been registered Silently fail Return a boolean status If I were to go with option #1, I would al... | Have you considered something like triggering a warning or a notice? trigger_error("ClassLoader already registered", E_USER_WARNING); Unlike exceptions, triggering errors is a good way to find flaws/disruptions in code without halting the execution of the program. You keep the backtrace and a get an entry in the error ... | What is best practice on handling duplicate method calls? Let's say I have a class loader I want to register. $loader = new ClassLoader;
$loader->register(); When the method register() is called a second time, should I: Throw an exception stating that the class loader has already been registered Silently fail Return a... | TITLE:
What is best practice on handling duplicate method calls?
QUESTION:
Let's say I have a class loader I want to register. $loader = new ClassLoader;
$loader->register(); When the method register() is called a second time, should I: Throw an exception stating that the class loader has already been registered Sile... | [
"php"
] | 0 | 2 | 160 | 4 | 0 | 2011-06-04T05:48:53.463000 | 2011-06-04T06:53:08.830000 |
6,235,026 | 6,238,080 | How to add a nhibernate transaction to ninject? | how can I make it so on every http request I start a transaction and at the end I commit my transactions? I am already using InRequestScope for my sessions and have this for my ninject. public class NhibernateSessionFactory { public ISessionFactory GetSessionFactory() { ISessionFactory fluentConfiguration = Fluently.Co... | Add activation/deactivaion actions to your session binding:.OnActivation(session => session.Transaction.Begin()).OnDeactivation(CommitTransaction)
public void CommitTransaction(ISession session) { try { session.Transaction.Commit(); } catch(Exception e) { // Add some exception handling (rollback, show error to user,..... | How to add a nhibernate transaction to ninject? how can I make it so on every http request I start a transaction and at the end I commit my transactions? I am already using InRequestScope for my sessions and have this for my ninject. public class NhibernateSessionFactory { public ISessionFactory GetSessionFactory() { I... | TITLE:
How to add a nhibernate transaction to ninject?
QUESTION:
how can I make it so on every http request I start a transaction and at the end I commit my transactions? I am already using InRequestScope for my sessions and have this for my ninject. public class NhibernateSessionFactory { public ISessionFactory GetSe... | [
"asp.net-mvc-3",
"ninject",
"ninject-2"
] | 3 | 2 | 1,314 | 1 | 0 | 2011-06-04T05:50:28.663000 | 2011-06-04T16:53:57.983000 |
6,235,034 | 6,241,492 | Vi keybindings for R command line like in Bash | Context I like editing and manipulating the bash command line using vi-style key bindings with the following setting: set -o vi However, when I start R on the command-line, these keybindings disappear. I know that the Vim-R plugin allows for Vim keybindings when you run R through the Conque Shell, but I'm not entirely ... | Thank you to Joshua Ulrich and progo's answers, which helped to get me started. Below I record my experience: Initial setup I tried set keymap vi and set editing-mode vi. When I started R in my Gnome Terminal, some shortcuts worked and others did not. In particular cc, and dd (i.e., delete lines) did not work at all, a... | Vi keybindings for R command line like in Bash Context I like editing and manipulating the bash command line using vi-style key bindings with the following setting: set -o vi However, when I start R on the command-line, these keybindings disappear. I know that the Vim-R plugin allows for Vim keybindings when you run R ... | TITLE:
Vi keybindings for R command line like in Bash
QUESTION:
Context I like editing and manipulating the bash command line using vi-style key bindings with the following setting: set -o vi However, when I start R on the command-line, these keybindings disappear. I know that the Vim-R plugin allows for Vim keybindin... | [
"bash",
"r",
"vim",
"keyboard-shortcuts"
] | 16 | 15 | 2,899 | 3 | 0 | 2011-06-04T05:52:52.267000 | 2011-06-05T07:10:42.670000 |
6,235,038 | 6,235,099 | PageBreak in converting HTML to doc and docx fromat - PHP | I have converted HTML to DOC format using PHP. kindly view the below screen shot. My Problem is i need to print 1st table in first page and 2nd table in second page. Here is my set of code. header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=document_name.doc"); echo $html ... | put this where you need a page break: this is working for me | PageBreak in converting HTML to doc and docx fromat - PHP I have converted HTML to DOC format using PHP. kindly view the below screen shot. My Problem is i need to print 1st table in first page and 2nd table in second page. Here is my set of code. header("Content-type: application/vnd.ms-word"); header("Content-Disposi... | TITLE:
PageBreak in converting HTML to doc and docx fromat - PHP
QUESTION:
I have converted HTML to DOC format using PHP. kindly view the below screen shot. My Problem is i need to print 1st table in first page and 2nd table in second page. Here is my set of code. header("Content-type: application/vnd.ms-word"); heade... | [
"php",
"html",
"doc"
] | 6 | 18 | 13,207 | 2 | 0 | 2011-06-04T05:53:36.803000 | 2011-06-04T06:11:45.993000 |
6,235,042 | 6,235,083 | introduction to setup test server | I uses Dreamweaver, and I have a domain hosted on a public hosting company. Currently, as I am editing my.php, I have to constantly upload to my domain to test it out. I don't really want to setup a local server like xampp as I want to be able to access to most updated of my site across multiple companies and anywhere.... | Here are your options: Develop locally, push your changes to a remote server Develop locally, use a local lamp / wamp setup to instantly see your changes Develop remotely either over ssh or remote desktop. View your changes instantly. | introduction to setup test server I uses Dreamweaver, and I have a domain hosted on a public hosting company. Currently, as I am editing my.php, I have to constantly upload to my domain to test it out. I don't really want to setup a local server like xampp as I want to be able to access to most updated of my site acros... | TITLE:
introduction to setup test server
QUESTION:
I uses Dreamweaver, and I have a domain hosted on a public hosting company. Currently, as I am editing my.php, I have to constantly upload to my domain to test it out. I don't really want to setup a local server like xampp as I want to be able to access to most update... | [
"php",
"testing",
"dreamweaver"
] | 3 | 0 | 429 | 2 | 0 | 2011-06-04T05:54:22.240000 | 2011-06-04T06:06:47.563000 |
6,235,043 | 6,235,148 | get html from a div and show them on a other page | i am struggling with the following: I have a html mainpage, on this page i have a column with a "read more"section, so a couple of lines tekst from a news message from a html page called News. when there is new news, i have to update the "read more"section by hand. Is it possible with Jquery and ajax to update the "rea... | You can look at loading page fragments using.load(). Depending on your page's markup, something like this on the main page should work. // Grab the first div in the #news element on // the news.html page and jam it into #recent $('#recent').load('/news.html #news div:first'); Demo: jsfiddle.net/SLx9c | get html from a div and show them on a other page i am struggling with the following: I have a html mainpage, on this page i have a column with a "read more"section, so a couple of lines tekst from a news message from a html page called News. when there is new news, i have to update the "read more"section by hand. Is i... | TITLE:
get html from a div and show them on a other page
QUESTION:
i am struggling with the following: I have a html mainpage, on this page i have a column with a "read more"section, so a couple of lines tekst from a news message from a html page called News. when there is new news, i have to update the "read more"sec... | [
"jquery",
"ajax",
"html"
] | 1 | 1 | 564 | 1 | 0 | 2011-06-04T05:54:27.833000 | 2011-06-04T06:25:15.737000 |
6,235,048 | 6,235,108 | Undefined Method 'path' For StringIO in Ruby | I'm using the following snippet in a Rails app: require 'open-uri' url = "http://..." uri = URI.parse(self.url) file = open(uri) puts "path: #{file.path}" Which works on some files from the web, then crashes on others with: undefined method `path' for #< StringIO:0x00000102a47240 > Any way to fix this strange, intermit... | Don't use Open::URI like that. Simply do: file = open(url) Then you can read the file because you have an IO-type object: body = file.read or body = open(url).read If you need the path, parse the URL with URI and get the path that way. | Undefined Method 'path' For StringIO in Ruby I'm using the following snippet in a Rails app: require 'open-uri' url = "http://..." uri = URI.parse(self.url) file = open(uri) puts "path: #{file.path}" Which works on some files from the web, then crashes on others with: undefined method `path' for #< StringIO:0x00000102a... | TITLE:
Undefined Method 'path' For StringIO in Ruby
QUESTION:
I'm using the following snippet in a Rails app: require 'open-uri' url = "http://..." uri = URI.parse(self.url) file = open(uri) puts "path: #{file.path}" Which works on some files from the web, then crashes on others with: undefined method `path' for #< St... | [
"ruby-on-rails",
"ruby",
"file"
] | 8 | 7 | 4,438 | 4 | 0 | 2011-06-04T05:55:35.427000 | 2011-06-04T06:14:10.560000 |
6,235,051 | 6,235,133 | chain the function as shell pipe command in python | In Unix/linux shell we can: seq 0 100 | head -10 | awk 'NF%2==0' | awk 'NF%2==1' | rev Now I defined: seqsrc = list(range(0,100))
def all(src): return src def head(src, count, offset = 0): return src[:count] def tail(src, count, offset = 0): return src[-count:] def odd(src): return [x for x in src if x % 2!= 0] def ev... | There are many questions in your post and I'm not certain to understand them all. However, here is a starting point. Chainable methods are usually implemented by designing classes with methods that return new instances of the class itself. This allows to call further methods from the return value of previous methods. T... | chain the function as shell pipe command in python In Unix/linux shell we can: seq 0 100 | head -10 | awk 'NF%2==0' | awk 'NF%2==1' | rev Now I defined: seqsrc = list(range(0,100))
def all(src): return src def head(src, count, offset = 0): return src[:count] def tail(src, count, offset = 0): return src[-count:] def od... | TITLE:
chain the function as shell pipe command in python
QUESTION:
In Unix/linux shell we can: seq 0 100 | head -10 | awk 'NF%2==0' | awk 'NF%2==1' | rev Now I defined: seqsrc = list(range(0,100))
def all(src): return src def head(src, count, offset = 0): return src[:count] def tail(src, count, offset = 0): return s... | [
"python",
"function",
"shell",
"pipe"
] | 1 | 4 | 1,131 | 1 | 0 | 2011-06-04T05:56:32.310000 | 2011-06-04T06:21:05.870000 |
6,235,057 | 6,235,182 | Interacting(get itemcount, loop, click each item) with CUSTOM listview control? | I am trying to interact with custom listview class, the class along with its instance is recognized by winapi but for sure it has problem interacting with it. What i am trying to do is get item count then click on each(when required) but WinApi is unable to do anything about this. int nMaxItems = ListView_GetItemCount(... | Since it's a custom control, and not the standard Windows control, it is under no obligation to honor the same set of messages that the standard controls respond to. If it doesn't recognize the same messages that the OS provides, then you'll just have to find out what mechanism, if any, it does provide for external cod... | Interacting(get itemcount, loop, click each item) with CUSTOM listview control? I am trying to interact with custom listview class, the class along with its instance is recognized by winapi but for sure it has problem interacting with it. What i am trying to do is get item count then click on each(when required) but Wi... | TITLE:
Interacting(get itemcount, loop, click each item) with CUSTOM listview control?
QUESTION:
I am trying to interact with custom listview class, the class along with its instance is recognized by winapi but for sure it has problem interacting with it. What i am trying to do is get item count then click on each(whe... | [
"c++",
"windows",
"winapi",
"user-interface"
] | 0 | 1 | 331 | 1 | 0 | 2011-06-04T05:58:28.353000 | 2011-06-04T06:35:30.890000 |
6,235,065 | 6,235,196 | Field assignment storing for later completion | I have two classes. The first class has someField which the second class needs to change, so the first class calls FirstClass.setSomeField(value). The second class can not change the field at that moment, so it stores this FutureChange into a list which it will go through at a later time and apply the necessary changes... | I would use reflections as you suggested. This is going to be much slower than applying the changes directly. If you really want efficiency, you are better off breaking your code into two phases/stages one which uses the current value and one which applies the changes rather than trying to store the changes. public cla... | Field assignment storing for later completion I have two classes. The first class has someField which the second class needs to change, so the first class calls FirstClass.setSomeField(value). The second class can not change the field at that moment, so it stores this FutureChange into a list which it will go through a... | TITLE:
Field assignment storing for later completion
QUESTION:
I have two classes. The first class has someField which the second class needs to change, so the first class calls FirstClass.setSomeField(value). The second class can not change the field at that moment, so it stores this FutureChange into a list which it... | [
"java",
"class-design"
] | 0 | 0 | 65 | 1 | 0 | 2011-06-04T06:01:07.877000 | 2011-06-04T06:39:26.667000 |
6,235,072 | 6,235,101 | when entering on the text area showing a submit button | I want to when entering in textarea imediately show me the submit button I can use is there any solution with php or javascript? Brettz SOLUTION: | Notice I've added a textarea with the id "mytextarea":...which you can of course change to your own name or needs. amolv's solution is convenient for quick-and-dirty building of a page. But inline JavaScript (and inline formatting or CSS) is generally frowned upon for real applications, as it is cleaner for the structu... | when entering on the text area showing a submit button I want to when entering in textarea imediately show me the submit button I can use is there any solution with php or javascript? Brettz SOLUTION: | TITLE:
when entering on the text area showing a submit button
QUESTION:
I want to when entering in textarea imediately show me the submit button I can use is there any solution with php or javascript? Brettz SOLUTION:
ANSWER:
Notice I've added a textarea with the id "mytextarea":...which you can of course change to y... | [
"php",
"javascript",
"html"
] | 1 | 3 | 1,222 | 6 | 0 | 2011-06-04T06:02:57.723000 | 2011-06-04T06:12:18.733000 |
6,235,081 | 6,235,155 | Getting specific file attributes | I've got a simple WCF service that lets clients/consumers upload image, audio or video files to it. After the upload, the service is supposed to analyze the file and somehow retrieve the following attributes: Image: width, height, date taken, program used Audio: runtime, artist, album, genre, bitrate, publication year ... | Courtesty of this thread. I've verified this gets all file attributes including the extended attributes. In your project go to 'Add Reference' -> COM -> 'Microsoft Shell Controls and Automation' Add that, and again courtesy of said thread, a C# method to read the attributes of the files in a directory. (I'm still resea... | Getting specific file attributes I've got a simple WCF service that lets clients/consumers upload image, audio or video files to it. After the upload, the service is supposed to analyze the file and somehow retrieve the following attributes: Image: width, height, date taken, program used Audio: runtime, artist, album, ... | TITLE:
Getting specific file attributes
QUESTION:
I've got a simple WCF service that lets clients/consumers upload image, audio or video files to it. After the upload, the service is supposed to analyze the file and somehow retrieve the following attributes: Image: width, height, date taken, program used Audio: runtim... | [
"c#",
"file-attributes",
"file-properties"
] | 9 | 7 | 10,407 | 2 | 0 | 2011-06-04T06:05:26.440000 | 2011-06-04T06:26:46.673000 |
6,235,091 | 6,236,700 | convert two single bits into a vector | I have the following code: module ALUControl(ALUOp, FuncCode, ALUCtl); input [1:0] ALUOp; input [5:0] FuncCode; output reg [3:0] ALUCtl; always @(ALUOp, FuncCode) begin if ( ALUOp == 2 ) case (FuncCode) 32: ALUCtl<=2; // add 34: ALUCtl<=6; //subtract 36: ALUCtl<=0; // and 37: ALUCtl<=1; // or 39: ALUCtl<=12; // nor 42:... | Instead of: output ALUOp1; output ALUOp2; You want: output [1:0] ALUOp;
wire ALUOp1; wire ALUOp2;
assign ALUOp = {ALUOp2, ALUOp1}; It uses the concatenation operator I mentioned in my Answer to your previous question. | convert two single bits into a vector I have the following code: module ALUControl(ALUOp, FuncCode, ALUCtl); input [1:0] ALUOp; input [5:0] FuncCode; output reg [3:0] ALUCtl; always @(ALUOp, FuncCode) begin if ( ALUOp == 2 ) case (FuncCode) 32: ALUCtl<=2; // add 34: ALUCtl<=6; //subtract 36: ALUCtl<=0; // and 37: ALUCt... | TITLE:
convert two single bits into a vector
QUESTION:
I have the following code: module ALUControl(ALUOp, FuncCode, ALUCtl); input [1:0] ALUOp; input [5:0] FuncCode; output reg [3:0] ALUCtl; always @(ALUOp, FuncCode) begin if ( ALUOp == 2 ) case (FuncCode) 32: ALUCtl<=2; // add 34: ALUCtl<=6; //subtract 36: ALUCtl<=0... | [
"verilog"
] | 1 | 4 | 434 | 1 | 0 | 2011-06-04T06:09:41.790000 | 2011-06-04T12:17:51.260000 |
6,235,112 | 6,237,835 | Preventing snapshot view of your app when coming back from multi-tasking | The problem is this - My app lets you passcode protect itself. I use an interface just like passcode protecting the phone. This has always worked fine, until multi-tasking came along. The passcode protection still works, but there is one issue. Apple does something special to make it look like our apps are loading quic... | I solved this. Here is the solution: - (void)applicationDidEnterBackground:(UIApplication *)application{ if (appHasPasscodeOn){ UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)]; splashView.image = [UIImage imageNamed:@"Default.png"]; [window addSubview:splashView]; [splashView rel... | Preventing snapshot view of your app when coming back from multi-tasking The problem is this - My app lets you passcode protect itself. I use an interface just like passcode protecting the phone. This has always worked fine, until multi-tasking came along. The passcode protection still works, but there is one issue. Ap... | TITLE:
Preventing snapshot view of your app when coming back from multi-tasking
QUESTION:
The problem is this - My app lets you passcode protect itself. I use an interface just like passcode protecting the phone. This has always worked fine, until multi-tasking came along. The passcode protection still works, but ther... | [
"iphone",
"passwords",
"screenshot",
"multitasking"
] | 11 | 15 | 3,028 | 3 | 0 | 2011-06-04T06:14:54.437000 | 2011-06-04T16:07:57.407000 |
6,235,115 | 6,238,052 | jquery mobile listview not filling right part of the list | I have a listview (without icons on the right) and I would like to use the whole list width. I don'tk know how to proceed. I have extra white spaces on the right??? Here is the jsFiddle: http://jsfiddle.net/fPt67/ 1st problem: the text of my paragraph is not wrapped in my listview 2nd problem: I did not succeed using t... | Well you can play with it till you get it the way you like: http://jsfiddle.net/fPt67/12/ Paris This is a description. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type an... | jquery mobile listview not filling right part of the list I have a listview (without icons on the right) and I would like to use the whole list width. I don'tk know how to proceed. I have extra white spaces on the right??? Here is the jsFiddle: http://jsfiddle.net/fPt67/ 1st problem: the text of my paragraph is not wra... | TITLE:
jquery mobile listview not filling right part of the list
QUESTION:
I have a listview (without icons on the right) and I would like to use the whole list width. I don'tk know how to proceed. I have extra white spaces on the right??? Here is the jsFiddle: http://jsfiddle.net/fPt67/ 1st problem: the text of my pa... | [
"jquery",
"jquery-mobile"
] | 1 | 0 | 2,769 | 3 | 0 | 2011-06-04T06:15:18.750000 | 2011-06-04T16:48:47.757000 |
6,235,122 | 6,235,256 | NSComboBox: How to tell user has typed in information that is not in the pop up list and read it | I have an NSComboBox with a seperate class that conforms to NSComboBox dataSource and delegate. If the user types text into the combo box that that does not match one of the items in the pop up list, how do I receieve a notification that the user has typed something in and also read the value that the user has typed? A... | Since NSComboBox is a subclass of NSTextField, and thus NSControl, you can also use the NSControlTextEditingDelegate methods such as control:textShouldEndEditing: to affect the behavior of your combo box. | NSComboBox: How to tell user has typed in information that is not in the pop up list and read it I have an NSComboBox with a seperate class that conforms to NSComboBox dataSource and delegate. If the user types text into the combo box that that does not match one of the items in the pop up list, how do I receieve a not... | TITLE:
NSComboBox: How to tell user has typed in information that is not in the pop up list and read it
QUESTION:
I have an NSComboBox with a seperate class that conforms to NSComboBox dataSource and delegate. If the user types text into the combo box that that does not match one of the items in the pop up list, how d... | [
"objective-c",
"macos",
"cocoa-bindings"
] | 3 | 5 | 1,290 | 1 | 0 | 2011-06-04T06:17:20.037000 | 2011-06-04T06:50:38.893000 |
6,235,124 | 6,235,171 | Parsing an NSString with TouchXML? | I am trying to parse thE following string that i receive from my WebService using SOAP.. Since i am not able to parse the data i receive from my web service( of which i have no idea why.. please take a look here parsing XML using Soap Web Services ) i am converting the data to an NSString and then using TOUCHXML to par... | I think you are searching catid under records (and not under root) So change NSArray *categories = [item elementsForName:@"catid"]; to NSArray *categories = [titles elementsForName:@"catid"]; I mean, search element catid under records, not under root. My above code could give you compile error, as i havent worked on To... | Parsing an NSString with TouchXML? I am trying to parse thE following string that i receive from my WebService using SOAP.. Since i am not able to parse the data i receive from my web service( of which i have no idea why.. please take a look here parsing XML using Soap Web Services ) i am converting the data to an NSSt... | TITLE:
Parsing an NSString with TouchXML?
QUESTION:
I am trying to parse thE following string that i receive from my WebService using SOAP.. Since i am not able to parse the data i receive from my web service( of which i have no idea why.. please take a look here parsing XML using Soap Web Services ) i am converting t... | [
"iphone",
"ios",
"web-services",
"touchxml"
] | 1 | 0 | 793 | 2 | 0 | 2011-06-04T06:18:20.903000 | 2011-06-04T06:30:59.590000 |
6,235,126 | 6,235,203 | comparing contents of two files using python | I have a file name exclusionlist.txt and i have contents in it like import os import re import subprocess......and many more I have another file named libraries.txt and the contents of this file are import mymodule import empmodule,os import subprocess import datetime,logging,re.......and many more My question is that ... | Use set intersection: def readImports(path): with open(path) as f: for line in f: # lines of form "import ___,___" # assuming not of form "from ___ import ___ [as ___]" if 'import' in line: modules = line.split('import')[1] for module in modules.split(','): yield module.strip()
linesInExclusion = set(readImports('excl... | comparing contents of two files using python I have a file name exclusionlist.txt and i have contents in it like import os import re import subprocess......and many more I have another file named libraries.txt and the contents of this file are import mymodule import empmodule,os import subprocess import datetime,loggin... | TITLE:
comparing contents of two files using python
QUESTION:
I have a file name exclusionlist.txt and i have contents in it like import os import re import subprocess......and many more I have another file named libraries.txt and the contents of this file are import mymodule import empmodule,os import subprocess impo... | [
"python"
] | 0 | 1 | 457 | 1 | 0 | 2011-06-04T06:19:10.723000 | 2011-06-04T06:41:13.597000 |
6,235,135 | 6,242,641 | How to get a column from selected row from jqGrid? | I am using JQGrid in my asp. And i enabled the feature multiselect:true. How to get a column from selected row from jqGrid? Now I am getting the row index using var rowRule = jQuery("#list").getGridParam('selarrrow'); Using this index of row how can i get the first column of row is there any predefined method for this?... | jQuery("#list").getGridParam('selarrrow') returns the list of rowids of selected rows. You can use getCell method in the loop to get the contain of the column which you need from every selected row and place the contain in an array: var selIds = grid.jqGrid('getGridParam','selarrrow'), selText = []; $.each(selIds,funct... | How to get a column from selected row from jqGrid? I am using JQGrid in my asp. And i enabled the feature multiselect:true. How to get a column from selected row from jqGrid? Now I am getting the row index using var rowRule = jQuery("#list").getGridParam('selarrrow'); Using this index of row how can i get the first col... | TITLE:
How to get a column from selected row from jqGrid?
QUESTION:
I am using JQGrid in my asp. And i enabled the feature multiselect:true. How to get a column from selected row from jqGrid? Now I am getting the row index using var rowRule = jQuery("#list").getGridParam('selarrrow'); Using this index of row how can i... | [
"jqgrid",
"asp-classic"
] | 1 | 2 | 1,924 | 2 | 0 | 2011-06-04T06:21:15.077000 | 2011-06-05T11:33:59.697000 |
6,235,136 | 6,235,197 | Radiobutton loses values every postback | There are Radio buttons 'Enable' and 'disable' inside an Update panel (say x) below that, I have 3 radio buttons 'Default' 'Upload Image' and 'Text' (say y) when I choose 'Disable' then 'y' will be hidden. else visible. This much works, no problem here when I choose 'Enable' it shows radio buttons in 'y' from that I ch... | You have to assign a different value for the RadioButton.GroupName for each RadioButton controls group. | Radiobutton loses values every postback There are Radio buttons 'Enable' and 'disable' inside an Update panel (say x) below that, I have 3 radio buttons 'Default' 'Upload Image' and 'Text' (say y) when I choose 'Disable' then 'y' will be hidden. else visible. This much works, no problem here when I choose 'Enable' it s... | TITLE:
Radiobutton loses values every postback
QUESTION:
There are Radio buttons 'Enable' and 'disable' inside an Update panel (say x) below that, I have 3 radio buttons 'Default' 'Upload Image' and 'Text' (say y) when I choose 'Disable' then 'y' will be hidden. else visible. This much works, no problem here when I ch... | [
"c#",
"asp.net",
"radio-button"
] | 0 | 1 | 688 | 1 | 0 | 2011-06-04T06:21:23.710000 | 2011-06-04T06:39:30.667000 |
6,235,137 | 6,235,168 | Linq data mapping: usage of Storage property on column attribute | Can somebody please explain the difference between the following 3 possibilities for using the ColumnAttribute: A: attribute on field [Column(Name="ParentId")] private int m_parentid; public int ParentId { get { return m_parentid; } set { m_parentid = value; } } B: attribute on property private int m_parentid; [Column(... | C is useful to allow the engine to understand expression trees, for example a predicate: var items = ctx.SomeTable.Where(x => x.ParentId == 21); With "a" I would expect this to fail, as it doesn't really know about the property ParentId (only the field m_parentid and the database column). Specifying the "Storage" in "c... | Linq data mapping: usage of Storage property on column attribute Can somebody please explain the difference between the following 3 possibilities for using the ColumnAttribute: A: attribute on field [Column(Name="ParentId")] private int m_parentid; public int ParentId { get { return m_parentid; } set { m_parentid = val... | TITLE:
Linq data mapping: usage of Storage property on column attribute
QUESTION:
Can somebody please explain the difference between the following 3 possibilities for using the ColumnAttribute: A: attribute on field [Column(Name="ParentId")] private int m_parentid; public int ParentId { get { return m_parentid; } set ... | [
"c#",
"linq",
"mapping"
] | 4 | 3 | 2,395 | 2 | 0 | 2011-06-04T06:21:42.423000 | 2011-06-04T06:30:27.453000 |
6,235,140 | 6,235,184 | ListView - Set first two items with a different background color | In the attached picture of a fragment layout from google's blog I have a listview in my code. My question here is to set the first two items(Henry IV and Henry V) with background colors RED and others remain as defaul backgroudn values. Is this possible? Any help would be really appreciated. Thanks, Sana. The code that... | Yes it is possible... please check below link http://www.androidpeople.com/android-custom-listview-tutorial-part-1 http://www.androidpeople.com/android-custom-listview-tutorial-part-2 And add one thing in custom listview inside used below code. public View getView(int position, View convertView, ViewGroup parent) {....... | ListView - Set first two items with a different background color In the attached picture of a fragment layout from google's blog I have a listview in my code. My question here is to set the first two items(Henry IV and Henry V) with background colors RED and others remain as defaul backgroudn values. Is this possible? ... | TITLE:
ListView - Set first two items with a different background color
QUESTION:
In the attached picture of a fragment layout from google's blog I have a listview in my code. My question here is to set the first two items(Henry IV and Henry V) with background colors RED and others remain as defaul backgroudn values. ... | [
"android",
"android-listview"
] | 0 | 1 | 6,997 | 2 | 0 | 2011-06-04T06:22:50.287000 | 2011-06-04T06:35:32.880000 |
6,235,141 | 6,292,049 | How to avoid unnecessary buffering in jPlayer | I have a jPlayer (HTML5 song player using jquery) and it starts to play a song from xx secs of a song. But the problem is it has to first buffer the XX secs and then starts to play which is waste of bandwidth. Why doesnt it start its buffering from XX secs itself? Here is the code i use: $("#jquery_jplayer_1").jPlayer(... | It's the flash polyfill that needs to buffer. Older browsers that do not support HTML5 will suffer from this problem, where the jPlayer flash fallback used instead. Your web server must support seeking a stream. See this jPlayer Google Group question about buffering and Seeking through a streamed MP3 file with HTML5 ta... | How to avoid unnecessary buffering in jPlayer I have a jPlayer (HTML5 song player using jquery) and it starts to play a song from xx secs of a song. But the problem is it has to first buffer the XX secs and then starts to play which is waste of bandwidth. Why doesnt it start its buffering from XX secs itself? Here is t... | TITLE:
How to avoid unnecessary buffering in jPlayer
QUESTION:
I have a jPlayer (HTML5 song player using jquery) and it starts to play a song from xx secs of a song. But the problem is it has to first buffer the XX secs and then starts to play which is waste of bandwidth. Why doesnt it start its buffering from XX secs... | [
"jquery",
"ajax",
"html",
"jplayer"
] | 9 | 6 | 6,941 | 1 | 0 | 2011-06-04T06:23:02.977000 | 2011-06-09T11:26:38.483000 |
6,235,143 | 6,235,202 | htaccess REGEX to accept a particular set of characters in URL | I have a particular set of characters that i want to mark as acceptable: a-z, A-Z, 0-9, *, %, /, \, _. Now i am being able to create an.htaccess file that enables this for: a-z, A-Z, 0-9, _, but the rest of the characters are not working. The url is giving a 404 error. here is the regex i am using [a-zA-Z0-9_] UPDATE P... | almost all characters lose their special meanings inside a character class, including \ * and / Try this: [a-zA-Z0-9_\/%*]+ | htaccess REGEX to accept a particular set of characters in URL I have a particular set of characters that i want to mark as acceptable: a-z, A-Z, 0-9, *, %, /, \, _. Now i am being able to create an.htaccess file that enables this for: a-z, A-Z, 0-9, _, but the rest of the characters are not working. The url is giving ... | TITLE:
htaccess REGEX to accept a particular set of characters in URL
QUESTION:
I have a particular set of characters that i want to mark as acceptable: a-z, A-Z, 0-9, *, %, /, \, _. Now i am being able to create an.htaccess file that enables this for: a-z, A-Z, 0-9, _, but the rest of the characters are not working. ... | [
"regex",
".htaccess"
] | 0 | 2 | 962 | 1 | 0 | 2011-06-04T06:23:50.450000 | 2011-06-04T06:40:46.230000 |
6,235,147 | 6,235,269 | How to call methods outside of a class | How would I call myfunc and myotherfunc below outside of the class? class Accounting::Invoice < ActiveRecord::Base def myfunc return true end
class << self def myotherfunc return false end end end | myfunc is an instance method, so you first need an instance and then you can call the function: invoice = Accounting::Invoice.new invoice.myfunc myotherfunc is class method, so you just call it on directly on the class object: Accounting::Invoice.myotherfunc By the way, this answer is not specific to Rails; it applies ... | How to call methods outside of a class How would I call myfunc and myotherfunc below outside of the class? class Accounting::Invoice < ActiveRecord::Base def myfunc return true end
class << self def myotherfunc return false end end end | TITLE:
How to call methods outside of a class
QUESTION:
How would I call myfunc and myotherfunc below outside of the class? class Accounting::Invoice < ActiveRecord::Base def myfunc return true end
class << self def myotherfunc return false end end end
ANSWER:
myfunc is an instance method, so you first need an insta... | [
"ruby-on-rails",
"ruby"
] | 1 | 8 | 4,643 | 1 | 0 | 2011-06-04T06:25:14.920000 | 2011-06-04T06:53:06.950000 |
6,235,152 | 6,235,261 | Is it possible to use NoTracking (MergeOption.NoTracking) with the EntityDatSource Control? | Can anyone tell me if it is possible to use NoTracking (MergeOption.NoTracking) with the EntityDatSource Control? If so, how? | Implement handling for ContextCreating event and set MergeOption for ObjectSet: public partial class YourPage: System.Web.UI.Page {...
protected void EntityDataSource_ContextCreating(object sender, EntityDataSourceContextCreatingEventArgs e) { e.Context = new YourContext(); // EntityDataSource handles disposing e.Cont... | Is it possible to use NoTracking (MergeOption.NoTracking) with the EntityDatSource Control? Can anyone tell me if it is possible to use NoTracking (MergeOption.NoTracking) with the EntityDatSource Control? If so, how? | TITLE:
Is it possible to use NoTracking (MergeOption.NoTracking) with the EntityDatSource Control?
QUESTION:
Can anyone tell me if it is possible to use NoTracking (MergeOption.NoTracking) with the EntityDatSource Control? If so, how?
ANSWER:
Implement handling for ContextCreating event and set MergeOption for Object... | [
"asp.net",
"entity-framework"
] | 0 | 0 | 503 | 1 | 0 | 2011-06-04T06:26:18.233000 | 2011-06-04T06:51:35.137000 |
6,235,159 | 6,236,992 | To use full calendar jquery plugin as google calendar | I am using jQuery fullcalendar plugin. Drag and resize options are given for events. I like to add events and edit event as same as google calendar. Any other plugin is there to bring out google calendar functionality in jquery How to do this? Updated....
eventClick: function(calEvent, jsEvent, view) { alert('Event: '... | here is my "add event" part inside of the fullcalendar init: select: function(start, end, allDay) { var calendars = getAjaxData('calendar/calendarsJson');
var txt = ' Add event: \n\ \n\ '+CI.lang.language.what+': \n\ '+CI.lang.language.where+': \n\ '+CI.lang.language.description+': \n\ '; txt += ' '+CI.lang.language.c... | To use full calendar jquery plugin as google calendar I am using jQuery fullcalendar plugin. Drag and resize options are given for events. I like to add events and edit event as same as google calendar. Any other plugin is there to bring out google calendar functionality in jquery How to do this? Updated....
eventClic... | TITLE:
To use full calendar jquery plugin as google calendar
QUESTION:
I am using jQuery fullcalendar plugin. Drag and resize options are given for events. I like to add events and edit event as same as google calendar. Any other plugin is there to bring out google calendar functionality in jquery How to do this? Upda... | [
"jquery",
"jquery-plugins",
"fullcalendar"
] | 2 | 1 | 1,625 | 1 | 0 | 2011-06-04T06:28:18.553000 | 2011-06-04T13:27:25.140000 |
6,235,162 | 6,235,188 | Fetching data from database | i have data in my datalogging table as shown below Name Shiftname operatorname Date plantname line machine Ashwini Shift1(7-3) Operator 1 2011-05-24 Plant 1 Line1 mc1 Deepika Shift2(3-11) Operator 2 2011-05-24 Plant 2 Line3 mc5 Pradeepa Shift2(11-7) Operator 3 2011-05-25 Plant 3 Line5 mc10 Deepika Shift1(7-3) Operator ... | Given that your plant name is "Plant 1", plantname='plant1' won't work! | Fetching data from database i have data in my datalogging table as shown below Name Shiftname operatorname Date plantname line machine Ashwini Shift1(7-3) Operator 1 2011-05-24 Plant 1 Line1 mc1 Deepika Shift2(3-11) Operator 2 2011-05-24 Plant 2 Line3 mc5 Pradeepa Shift2(11-7) Operator 3 2011-05-25 Plant 3 Line5 mc10 D... | TITLE:
Fetching data from database
QUESTION:
i have data in my datalogging table as shown below Name Shiftname operatorname Date plantname line machine Ashwini Shift1(7-3) Operator 1 2011-05-24 Plant 1 Line1 mc1 Deepika Shift2(3-11) Operator 2 2011-05-24 Plant 2 Line3 mc5 Pradeepa Shift2(11-7) Operator 3 2011-05-25 Pl... | [
"sql-server-2005"
] | 0 | 1 | 114 | 1 | 0 | 2011-06-04T06:29:28.700000 | 2011-06-04T06:38:22.500000 |
6,235,223 | 6,290,628 | How I can get a branch of registry recursively in builder c++? | Please, help anyone! I don't understand, how i could give a variable H_KEY type, it's want UnicodeString! TRegistry *reg = new TRegistry(KEY_ALL_ACCESS); reg->RootKey=HKEY_LOCAL_MACHINE; reg->OpenKey("",0); //Открываем ключ TStringList *s=new TStringList; reg->GetValueNames(s); // список параметров // ShowMessage(s->Te... | I've solved my problem. You can see code here: void Recurse(UnicodeString currentpath) { // HKEY all[]={HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CURRENT_CONFIG}; TRegistry *reg=new TRegistry(KEY_ALL_ACCESS); TStringList *l=new TStringList; TStringList *s=new TStringList; TStringList *k... | How I can get a branch of registry recursively in builder c++? Please, help anyone! I don't understand, how i could give a variable H_KEY type, it's want UnicodeString! TRegistry *reg = new TRegistry(KEY_ALL_ACCESS); reg->RootKey=HKEY_LOCAL_MACHINE; reg->OpenKey("",0); //Открываем ключ TStringList *s=new TStringList; r... | TITLE:
How I can get a branch of registry recursively in builder c++?
QUESTION:
Please, help anyone! I don't understand, how i could give a variable H_KEY type, it's want UnicodeString! TRegistry *reg = new TRegistry(KEY_ALL_ACCESS); reg->RootKey=HKEY_LOCAL_MACHINE; reg->OpenKey("",0); //Открываем ключ TStringList *s=... | [
"registry",
"c++builder"
] | 1 | 1 | 1,502 | 1 | 0 | 2011-06-04T06:45:17.867000 | 2011-06-09T09:20:47.870000 |
6,235,236 | 6,235,278 | App crashes when it reaches myMapView.getController() | For some reason this VERY simple program crashes when it reaches the getController() method. Its almost like the debugger is trying to tell me something, but its all garble.Believe it or not there isn't a clear explanation or exception given, ha. But it definitely blows up on this line. If I take it out of the code the... | You should give your MapView an android:id and feed it to findViewById(). In your code you search for a view with the Id of your whole layout. This can only return null... and give you a NullPointerException when invoking getController() on null. | App crashes when it reaches myMapView.getController() For some reason this VERY simple program crashes when it reaches the getController() method. Its almost like the debugger is trying to tell me something, but its all garble.Believe it or not there isn't a clear explanation or exception given, ha. But it definitely b... | TITLE:
App crashes when it reaches myMapView.getController()
QUESTION:
For some reason this VERY simple program crashes when it reaches the getController() method. Its almost like the debugger is trying to tell me something, but its all garble.Believe it or not there isn't a clear explanation or exception given, ha. B... | [
"java",
"android",
"maps"
] | 0 | 0 | 428 | 2 | 0 | 2011-06-04T06:47:11.970000 | 2011-06-04T06:54:16.167000 |
6,235,254 | 6,236,372 | PHP form editor? | I was told by my boss to make some plguin for the site, where people can define their own forms. And he was like There are some free ones, just find one suitible and rework it for the site. So yeah, ain't found what I was looking for. Are there any? I'd need an open form editor in PHP which allows me to make some chang... | The author here discusses about three open source form generators, may be this could be a starting lead for you: PHP Form Generator for webmasters – which one is the best? (by Drizad; 8 Mar 2007) | PHP form editor? I was told by my boss to make some plguin for the site, where people can define their own forms. And he was like There are some free ones, just find one suitible and rework it for the site. So yeah, ain't found what I was looking for. Are there any? I'd need an open form editor in PHP which allows me t... | TITLE:
PHP form editor?
QUESTION:
I was told by my boss to make some plguin for the site, where people can define their own forms. And he was like There are some free ones, just find one suitible and rework it for the site. So yeah, ain't found what I was looking for. Are there any? I'd need an open form editor in PHP... | [
"php",
"html",
"forms",
"content-management-system"
] | 2 | 1 | 1,527 | 2 | 0 | 2011-06-04T06:50:37.367000 | 2011-06-04T11:07:21.763000 |
6,235,259 | 6,235,284 | Javascript function syntax needs explanation | return this.foo("abc",function(){ //do something }); Can some one tell me what does the above line do? THanks | It grabs a reference to this, which might be the DOM Window, a DOM element, or any other JavaScript object depending on how and where the above code is being run. It (skipping ahead) prepares a new anonymous Function that //does something. It attempts to invoke a method foo on object this, passing in two parameters "ab... | Javascript function syntax needs explanation return this.foo("abc",function(){ //do something }); Can some one tell me what does the above line do? THanks | TITLE:
Javascript function syntax needs explanation
QUESTION:
return this.foo("abc",function(){ //do something }); Can some one tell me what does the above line do? THanks
ANSWER:
It grabs a reference to this, which might be the DOM Window, a DOM element, or any other JavaScript object depending on how and where the ... | [
"javascript"
] | 0 | 1 | 104 | 5 | 0 | 2011-06-04T06:51:22.943000 | 2011-06-04T06:55:44.023000 |
6,235,266 | 6,235,289 | Centre 2 Floating Elements | I have a relativly simple HTML layout where I have a heading div, then below that is a Main div that contains a NavBar on the left side & a ContentDiv on the right side. My problem is that I cannot get my NavBar & ContentDiv to be displayed in the centre (horizontally) they always sit to the left (so NavBars x position... | Try this: #navBar { display: inline; height: 700px; } #content { display: inline; height: 700px; } #main { margin: 0 auto; } EDIT: Updated code. I'm not sure if it's what you're looking for or not. | Centre 2 Floating Elements I have a relativly simple HTML layout where I have a heading div, then below that is a Main div that contains a NavBar on the left side & a ContentDiv on the right side. My problem is that I cannot get my NavBar & ContentDiv to be displayed in the centre (horizontally) they always sit to the ... | TITLE:
Centre 2 Floating Elements
QUESTION:
I have a relativly simple HTML layout where I have a heading div, then below that is a Main div that contains a NavBar on the left side & a ContentDiv on the right side. My problem is that I cannot get my NavBar & ContentDiv to be displayed in the centre (horizontally) they ... | [
"javascript",
"html",
"css"
] | 0 | 3 | 138 | 2 | 0 | 2011-06-04T06:52:29.363000 | 2011-06-04T06:56:47.757000 |
6,235,268 | 6,236,400 | a question about oracle undo segment binding | I'm no DBA, I just want to learn about Oracle's Multi-Version Concurrency model. When launching a DML operation, the first step in the MVCC protocol is to bind a undo segment. The question is why one undo segment can only serve for one active transaction? thank you for your time~~ | Multi-Version Concurrency is probably the most important concept to grasp when it comes to Oracle. It is good for programmers to understand it even if they don't want to become DBAs. There are a few aspects but to this, but they all come down to efficiency: undo management is overhead, so minimizing the number of cycle... | a question about oracle undo segment binding I'm no DBA, I just want to learn about Oracle's Multi-Version Concurrency model. When launching a DML operation, the first step in the MVCC protocol is to bind a undo segment. The question is why one undo segment can only serve for one active transaction? thank you for your ... | TITLE:
a question about oracle undo segment binding
QUESTION:
I'm no DBA, I just want to learn about Oracle's Multi-Version Concurrency model. When launching a DML operation, the first step in the MVCC protocol is to bind a undo segment. The question is why one undo segment can only serve for one active transaction? t... | [
"oracle",
"mvcc"
] | 0 | 1 | 386 | 2 | 0 | 2011-06-04T06:52:59.780000 | 2011-06-04T11:13:18.670000 |
6,235,272 | 6,235,292 | TreeMap with no unique key | I use a TreeMap class for store messages information with their priority in my application. I've used a treeMap class for do it because this class order automatically the element based on the key value, for example i have this situation: enum Priority { HIGH, MEDIUM, LOW } TreeMap tMap = new TreeMap (); I use the key (... | How can i change this behaviour and disable unique constraint on TreeMap? You can't. The uniqueness of keys is a fundamental invariant of the Map interface. Is there a class like TreeMap that allow to put the same Key for multiple element? You can implement this as a Map > and manage the lists yourself. This is a good ... | TreeMap with no unique key I use a TreeMap class for store messages information with their priority in my application. I've used a treeMap class for do it because this class order automatically the element based on the key value, for example i have this situation: enum Priority { HIGH, MEDIUM, LOW } TreeMap tMap = new ... | TITLE:
TreeMap with no unique key
QUESTION:
I use a TreeMap class for store messages information with their priority in my application. I've used a treeMap class for do it because this class order automatically the element based on the key value, for example i have this situation: enum Priority { HIGH, MEDIUM, LOW } T... | [
"java",
"java-6"
] | 5 | 10 | 7,963 | 4 | 0 | 2011-06-04T06:53:54.347000 | 2011-06-04T06:58:31.867000 |
6,235,731 | 6,235,803 | How to set progress bar in android? | I want set progress bar until the next activity start.That mean i want to remove black screen while loading next page or activity.How to solve this problem? yes I'm using button onClick and using listView to move next activity. | Button b1 = new Button(this); b1.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); if(action==0) { } else if(action == 1) { final ProgressDialog dialog = ProgressDialog.show(myFirstActivity.this,"Please wait","Loading...",true); new Thread() {... | How to set progress bar in android? I want set progress bar until the next activity start.That mean i want to remove black screen while loading next page or activity.How to solve this problem? yes I'm using button onClick and using listView to move next activity. | TITLE:
How to set progress bar in android?
QUESTION:
I want set progress bar until the next activity start.That mean i want to remove black screen while loading next page or activity.How to solve this problem? yes I'm using button onClick and using listView to move next activity.
ANSWER:
Button b1 = new Button(this);... | [
"android"
] | 0 | 1 | 4,375 | 3 | 0 | 2011-06-04T08:48:14.720000 | 2011-06-04T09:05:39.750000 |
6,235,733 | 6,253,872 | how to overcome"java.sql.Clob is an interface, and JAXB can't handle interfaces" issue | I am making an jaxbcontext newInstance, passing DO as a class.My DO contains java.sql.clob as one of the fields. This clob field is creating an issue while creating a new Instance. Giving error as Exception occured While capturing clob com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotati... | You could use an XmlAdapter for this use case. The XML adapter will convert the unmappable object java.sql.Clob to a mappable object such as String: ClobAdapter import java.sql.Clob;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class ClobAdapter extends XmlAdapter {
@Override public Clob unmarshal(St... | how to overcome"java.sql.Clob is an interface, and JAXB can't handle interfaces" issue I am making an jaxbcontext newInstance, passing DO as a class.My DO contains java.sql.clob as one of the fields. This clob field is creating an issue while creating a new Instance. Giving error as Exception occured While capturing cl... | TITLE:
how to overcome"java.sql.Clob is an interface, and JAXB can't handle interfaces" issue
QUESTION:
I am making an jaxbcontext newInstance, passing DO as a class.My DO contains java.sql.clob as one of the fields. This clob field is creating an issue while creating a new Instance. Giving error as Exception occured ... | [
"jaxb"
] | 2 | 3 | 3,663 | 1 | 0 | 2011-06-04T08:49:01.220000 | 2011-06-06T14:52:46.867000 |
6,235,734 | 6,235,753 | Python, iterated list comprehension | The class Item has a member function text() that returns a list of strings. The class Dictionary has a member function items() that returns a list of Items. dict is an instance of Dictionary. I want to test if all characters in all strings in all items in dict are ASCII. I tried all(ord(ch) < 128 for ch in s for s in i... | The order of the for clauses needs to be the other way around. The innermost loop comes last, the outmost loop comes first. all(ord(ch) < 128 for item in dict.items() for s in item.text() for ch in s) | Python, iterated list comprehension The class Item has a member function text() that returns a list of strings. The class Dictionary has a member function items() that returns a list of Items. dict is an instance of Dictionary. I want to test if all characters in all strings in all items in dict are ASCII. I tried all(... | TITLE:
Python, iterated list comprehension
QUESTION:
The class Item has a member function text() that returns a list of strings. The class Dictionary has a member function items() that returns a list of Items. dict is an instance of Dictionary. I want to test if all characters in all strings in all items in dict are A... | [
"python",
"list-comprehension"
] | 5 | 5 | 359 | 1 | 0 | 2011-06-04T08:49:27.183000 | 2011-06-04T08:53:46.333000 |
6,235,735 | 6,275,102 | How to add Social login services from Google, Facebook, Yahoo etc. to my website? | I want to add the following buttons to my website for providing users with option to login using more services like Google, Facebook etc. Please answer the following questions: How can I add various services like this free of cost? (Please note that I do not want to use any paid service like Janrain and ) How can I sto... | You'll be using the APIs of the respective services (Google, Facebook, Twitter) or may be OpenID if you plan to add that as well. Some links: http://code.google.com/apis/accounts/docs/OpenID.html https://developers.facebook.com/docs/authentication/ http://dev.twitter.com/pages/auth http://openid.net/add-openid/ Also ta... | How to add Social login services from Google, Facebook, Yahoo etc. to my website? I want to add the following buttons to my website for providing users with option to login using more services like Google, Facebook etc. Please answer the following questions: How can I add various services like this free of cost? (Pleas... | TITLE:
How to add Social login services from Google, Facebook, Yahoo etc. to my website?
QUESTION:
I want to add the following buttons to my website for providing users with option to login using more services like Google, Facebook etc. Please answer the following questions: How can I add various services like this fr... | [
"authentication",
"openid",
"single-sign-on"
] | 41 | 35 | 57,198 | 2 | 0 | 2011-06-04T08:50:01.893000 | 2011-06-08T06:43:29.223000 |
6,235,757 | 6,235,953 | Route doesn't get displayed, after passing it the screen coordinates resulting from the clicks on Google Map, displayed on the Qt widget | And I am using Qt, so the map is shown on the widget. Global variables: var arrayMarkers = new Array(); var arrayIndex = 0; This function "gets" called and also "displays" markers on the map where I click. Also it duly calls the displayRoute function when I click the second time. function Open (x, y) { google.maps.even... | I had included some values in < script src > without knowing what they are:banghead::banghead::banghead: The original was: I had modified it to: Changing it back to normal displays the route! | Route doesn't get displayed, after passing it the screen coordinates resulting from the clicks on Google Map, displayed on the Qt widget And I am using Qt, so the map is shown on the widget. Global variables: var arrayMarkers = new Array(); var arrayIndex = 0; This function "gets" called and also "displays" markers on ... | TITLE:
Route doesn't get displayed, after passing it the screen coordinates resulting from the clicks on Google Map, displayed on the Qt widget
QUESTION:
And I am using Qt, so the map is shown on the widget. Global variables: var arrayMarkers = new Array(); var arrayIndex = 0; This function "gets" called and also "dis... | [
"google-maps",
"google-maps-api-3",
"routes",
"qwebview"
] | 1 | 1 | 267 | 1 | 0 | 2011-06-04T08:55:01.163000 | 2011-06-04T09:36:40.343000 |
6,235,759 | 6,235,780 | Convert recordes in database to Drupal database | Hi I have news website and I want to migrate to Drupal. please help me, How to convert ma Database to Drupal Database? Is there any module to do this? or write a program? I am C# developer. help me to write this program. | Either do it writing your own script, mapping your structures to Drupal nodes and saving them, or use something like the Migrate module. Just take a look at Migration: Not Just for the Birds for an overview (quite detailed) on how to do the latter. | Convert recordes in database to Drupal database Hi I have news website and I want to migrate to Drupal. please help me, How to convert ma Database to Drupal Database? Is there any module to do this? or write a program? I am C# developer. help me to write this program. | TITLE:
Convert recordes in database to Drupal database
QUESTION:
Hi I have news website and I want to migrate to Drupal. please help me, How to convert ma Database to Drupal Database? Is there any module to do this? or write a program? I am C# developer. help me to write this program.
ANSWER:
Either do it writing you... | [
"c#",
"database",
"drupal",
"database-design",
"data-migration"
] | 0 | 2 | 65 | 1 | 0 | 2011-06-04T08:55:41.250000 | 2011-06-04T09:01:55.407000 |
6,235,761 | 6,235,765 | Is Server.Transfer invisible to Google? | I want to make some changes to my web site that requires some URL rewriting to keep my old URLs. I can't use proper URL rewriting because I have very limited control from my hosting provider. As I'm using ASP.NET and all of my pages have the.aspx extension, one idea I had is to put something in the global.asax under th... | Server.Transfer happens entirely on the server side, so any client (including Google) will not be aware of it. | Is Server.Transfer invisible to Google? I want to make some changes to my web site that requires some URL rewriting to keep my old URLs. I can't use proper URL rewriting because I have very limited control from my hosting provider. As I'm using ASP.NET and all of my pages have the.aspx extension, one idea I had is to p... | TITLE:
Is Server.Transfer invisible to Google?
QUESTION:
I want to make some changes to my web site that requires some URL rewriting to keep my old URLs. I can't use proper URL rewriting because I have very limited control from my hosting provider. As I'm using ASP.NET and all of my pages have the.aspx extension, one ... | [
"asp.net"
] | 5 | 9 | 773 | 3 | 0 | 2011-06-04T08:56:18.867000 | 2011-06-04T08:58:03.237000 |
6,235,762 | 6,235,782 | Truncate string to the first n words | What's the best way to truncate a string to the first n words? | n = 3 str = "your long long input string or whatever" str.split[0...n].join(' ') => "your long long"
str.split[0...n] # note that there are three dots, which excludes n => ["your", "long", "long"] | Truncate string to the first n words What's the best way to truncate a string to the first n words? | TITLE:
Truncate string to the first n words
QUESTION:
What's the best way to truncate a string to the first n words?
ANSWER:
n = 3 str = "your long long input string or whatever" str.split[0...n].join(' ') => "your long long"
str.split[0...n] # note that there are three dots, which excludes n => ["your", "long", "lo... | [
"ruby",
"string"
] | 26 | 41 | 14,499 | 4 | 0 | 2011-06-04T08:56:39.500000 | 2011-06-04T09:02:14.457000 |
6,235,772 | 6,277,857 | C++ Web-framework with cookie and SQL support | Good Evening, I'm building a website which will will look something like this: So probably a widget-centred web-framework would be best... Which C++ web-framework supports cookies (for user-login [session] storage+config storage) and SQL (MySQL or SQLite)? My information about Wt was outdated, it looks like they now ha... | I recognise these Wt (http://webtoolkit.eu/wt) widgets you can use for your app: charts: WCartesianChart dropdown boxes: WComboBox models and filter proxy models: WSortFilterProxyModel, WAbstractItemModel the lists (views): WTableView layout managers with draggable splitters: WHBoxLayout tabs: WTabWidget panel on the r... | C++ Web-framework with cookie and SQL support Good Evening, I'm building a website which will will look something like this: So probably a widget-centred web-framework would be best... Which C++ web-framework supports cookies (for user-login [session] storage+config storage) and SQL (MySQL or SQLite)? My information ab... | TITLE:
C++ Web-framework with cookie and SQL support
QUESTION:
Good Evening, I'm building a website which will will look something like this: So probably a widget-centred web-framework would be best... Which C++ web-framework supports cookies (for user-login [session] storage+config storage) and SQL (MySQL or SQLite)?... | [
"wt",
"cppcms"
] | 1 | 1 | 1,894 | 4 | 0 | 2011-06-04T09:00:03.087000 | 2011-06-08T11:13:48.590000 |
6,235,779 | 6,235,797 | How to get the name of attribute in python object? | For example I have next python class class Myclass(): a = int b = int Imagine that I don't know the name this class, so I need to get the names of attributes? ("a" and "b") | If you want all (including private) attributes, just dir(Myclass) Attributes starting with _ are private/internal, though. For example, even your simple Myclass will have a __module__ and an empty __doc__ attribute. To filter these out, use filter(lambda aname: not aname.startswith('_'), dir(Myclass)) | How to get the name of attribute in python object? For example I have next python class class Myclass(): a = int b = int Imagine that I don't know the name this class, so I need to get the names of attributes? ("a" and "b") | TITLE:
How to get the name of attribute in python object?
QUESTION:
For example I have next python class class Myclass(): a = int b = int Imagine that I don't know the name this class, so I need to get the names of attributes? ("a" and "b")
ANSWER:
If you want all (including private) attributes, just dir(Myclass) Att... | [
"python",
"object",
"attributes"
] | 4 | 10 | 8,193 | 1 | 0 | 2011-06-04T09:01:54.990000 | 2011-06-04T09:04:34.197000 |
6,235,785 | 6,235,868 | Run a shell script with an html button | I want to launch a bash script when a button is pressed on a website. This is my first attempt: Click Me! But no luck. Any suggestions? | As stated by Luke you need to use a server side language, like php. This is a really simple php example: Click Me! Save this as myfilename.php and place it on a machine with a web server with php installed. The same thing can be accomplished with asp, java, ruby, python,... | Run a shell script with an html button I want to launch a bash script when a button is pressed on a website. This is my first attempt: Click Me! But no luck. Any suggestions? | TITLE:
Run a shell script with an html button
QUESTION:
I want to launch a bash script when a button is pressed on a website. This is my first attempt: Click Me! But no luck. Any suggestions?
ANSWER:
As stated by Luke you need to use a server side language, like php. This is a really simple php example: Click Me! Sav... | [
"html",
"shell",
"button"
] | 38 | 35 | 257,712 | 4 | 0 | 2011-06-04T09:02:40.950000 | 2011-06-04T09:17:37.123000 |
6,235,790 | 6,235,988 | How to execute function in MVC with Entity Framework? | how to use following function Generic Function: public T GetSingle(Expression > whereCondition) { return this.ObjectSet.Where(whereCondition).FirstOrDefault<>(); } Business logic wise: //Now in the following function i would like to call Generic function. public TabMasterViewModel GetSingle(Expression > whereCondition)... | Either you modify your first generic function as public T GetSingle(Expression > whereCondition) { return context.CreateObjectSet ().Where(whereCondition).FirstOrDefault(); } or create a genetic repository public class RepositoryGeneric { public RepositoryGeneric(Context context) { Context = context; }
protected Objec... | How to execute function in MVC with Entity Framework? how to use following function Generic Function: public T GetSingle(Expression > whereCondition) { return this.ObjectSet.Where(whereCondition).FirstOrDefault<>(); } Business logic wise: //Now in the following function i would like to call Generic function. public Tab... | TITLE:
How to execute function in MVC with Entity Framework?
QUESTION:
how to use following function Generic Function: public T GetSingle(Expression > whereCondition) { return this.ObjectSet.Where(whereCondition).FirstOrDefault<>(); } Business logic wise: //Now in the following function i would like to call Generic fu... | [
"asp.net-mvc"
] | 0 | 1 | 733 | 1 | 0 | 2011-06-04T09:03:40.747000 | 2011-06-04T09:43:46.557000 |
6,235,794 | 6,237,462 | jQuery mobile- For every live tap event should there be an equivalent click event? | I have replaced the jQuery live click events to jQuery mobile tap events to increase responsiveness. I have a feeling this was a bad idea for compatibility reasons. Is it necessary to have both events, and is there any way to write them both for the same function? Such as ('click','tap') | Billy's answer is incredibly complete and actually worked quite well the few times I used it. Additionally however, you may want to look at the vmouse plugin in JQuery Mobile, it is an attempt to abstract mouse events: // This plugin is an experiment for abstracting away the touch and mouse // events so that developers... | jQuery mobile- For every live tap event should there be an equivalent click event? I have replaced the jQuery live click events to jQuery mobile tap events to increase responsiveness. I have a feeling this was a bad idea for compatibility reasons. Is it necessary to have both events, and is there any way to write them ... | TITLE:
jQuery mobile- For every live tap event should there be an equivalent click event?
QUESTION:
I have replaced the jQuery live click events to jQuery mobile tap events to increase responsiveness. I have a feeling this was a bad idea for compatibility reasons. Is it necessary to have both events, and is there any ... | [
"jquery",
"jquery-selectors",
"jquery-mobile"
] | 27 | 34 | 39,152 | 5 | 0 | 2011-06-04T09:04:14.267000 | 2011-06-04T15:01:08.687000 |
6,235,795 | 6,241,742 | switching to gradle from maven to manage a osgi big project (>200 bundles) | We have a big (~215 bundles and counting) osgi (felix+springdm) project, build with maven and maven-osgi plugin. We've several problems with maven way: 1. submodules pom have to inherit from parent pom to take advantage of common variables and dependencies (that's ok) but then parent pom has to include all bundles pom ... | You can separate the parent and the aggregate maven modules, because currently your parent pom have two roles as you correctly observed. More information can be found in the Maven Introduction to POM. I'm afraid that bundles version management cannot be become easier unless you use API Tools. Perhaps it would be great ... | switching to gradle from maven to manage a osgi big project (>200 bundles) We have a big (~215 bundles and counting) osgi (felix+springdm) project, build with maven and maven-osgi plugin. We've several problems with maven way: 1. submodules pom have to inherit from parent pom to take advantage of common variables and d... | TITLE:
switching to gradle from maven to manage a osgi big project (>200 bundles)
QUESTION:
We have a big (~215 bundles and counting) osgi (felix+springdm) project, build with maven and maven-osgi plugin. We've several problems with maven way: 1. submodules pom have to inherit from parent pom to take advantage of comm... | [
"java",
"maven",
"osgi",
"apache-felix",
"cradle"
] | 14 | 2 | 3,318 | 1 | 0 | 2011-06-04T09:04:33.537000 | 2011-06-05T08:21:43.847000 |
6,235,800 | 6,235,812 | how to get only last value in a foreach? php | foreach ($data['data'] as $data) { echo $data['title'][0]; //echo ' '; } this will print out: melon apple... banana pear Now, how to jump all, only get the last value in a foreach? only need pear. Thanks. | If you only need the last value, then you don't need to loop. You can use end(): $lastItem = end($data['data']); echo $lastItem['title'][0]; Note that this will set the internal array pointer to the last element. It might be necessary that you call reset($data) afterwards. | how to get only last value in a foreach? php foreach ($data['data'] as $data) { echo $data['title'][0]; //echo ' '; } this will print out: melon apple... banana pear Now, how to jump all, only get the last value in a foreach? only need pear. Thanks. | TITLE:
how to get only last value in a foreach? php
QUESTION:
foreach ($data['data'] as $data) { echo $data['title'][0]; //echo ' '; } this will print out: melon apple... banana pear Now, how to jump all, only get the last value in a foreach? only need pear. Thanks.
ANSWER:
If you only need the last value, then you d... | [
"php",
"foreach"
] | 2 | 8 | 1,434 | 2 | 0 | 2011-06-04T09:05:14.913000 | 2011-06-04T09:07:08.073000 |
6,235,801 | 6,235,861 | Binary search for specific value in array of structs | I wrote this function that uses a binary search to look for a specific value in an array of structs. Why doesn't it compile? I'm getting this error: prog.c:224: error: subscripted value is neither array nor pointer prog.c:226: error: subscripted value is neither array nor pointer This is the function: int FieldSearch(F... | If you want to search the "array" pArr, you need to put the brackets directly behind the identitifier. This should work: pArr[middle].Id | Binary search for specific value in array of structs I wrote this function that uses a binary search to look for a specific value in an array of structs. Why doesn't it compile? I'm getting this error: prog.c:224: error: subscripted value is neither array nor pointer prog.c:226: error: subscripted value is neither arra... | TITLE:
Binary search for specific value in array of structs
QUESTION:
I wrote this function that uses a binary search to look for a specific value in an array of structs. Why doesn't it compile? I'm getting this error: prog.c:224: error: subscripted value is neither array nor pointer prog.c:226: error: subscripted val... | [
"struct",
"binary-search"
] | 1 | 1 | 1,990 | 2 | 0 | 2011-06-04T09:05:16.810000 | 2011-06-04T09:15:30.950000 |
6,235,808 | 6,238,863 | How can I restart mongodb with --auth option in Ubuntu 10.04? | Well, restarting works with stop and start command, but I cannot seem to execute the mongodb command with --auth option. root@random:/home/random/public_html# mongodb stop root@random:/home/random/public_html# start mongodb --auth start: invalid option: --auth root@random:/home/random/public_html# start mongodb mongodb... | Edit /etc/mongod.conf and add a line like this: auth=true Then: service mongod restart See this page for more configuration options: http://www.mongodb.org/display/DOCS/File+Based+Configuration For MongoDB latest versions 3.x above code wont work, below code in mongod.conf if you are using mongodb 3.x security: authori... | How can I restart mongodb with --auth option in Ubuntu 10.04? Well, restarting works with stop and start command, but I cannot seem to execute the mongodb command with --auth option. root@random:/home/random/public_html# mongodb stop root@random:/home/random/public_html# start mongodb --auth start: invalid option: --au... | TITLE:
How can I restart mongodb with --auth option in Ubuntu 10.04?
QUESTION:
Well, restarting works with stop and start command, but I cannot seem to execute the mongodb command with --auth option. root@random:/home/random/public_html# mongodb stop root@random:/home/random/public_html# start mongodb --auth start: in... | [
"mongodb"
] | 22 | 69 | 30,563 | 5 | 0 | 2011-06-04T09:06:36.317000 | 2011-06-04T19:17:46.557000 |
6,235,815 | 6,238,610 | ASIHTTPRequest POST iPhone | Here's a portion of the html code I'm trying to submit the textarea, much this textarea this forum uses to type in questions. It's not working, nothing gets sent and the type of response i get back is NSHTTPURLResponse: 0x617bb20 Though I managed to get it working for the login except i replaced body=%@ with user=%@&pa... | ASIHTTPRequest is the way to go here. It's difficult to understand what is exactly wrong with the code you've written (except that it looks like a synchronous request, which is a no-no). In ASIHTTPRequest you can do this: ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:someUrl]; [request setRequestMeth... | ASIHTTPRequest POST iPhone Here's a portion of the html code I'm trying to submit the textarea, much this textarea this forum uses to type in questions. It's not working, nothing gets sent and the type of response i get back is NSHTTPURLResponse: 0x617bb20 Though I managed to get it working for the login except i repla... | TITLE:
ASIHTTPRequest POST iPhone
QUESTION:
Here's a portion of the html code I'm trying to submit the textarea, much this textarea this forum uses to type in questions. It's not working, nothing gets sent and the type of response i get back is NSHTTPURLResponse: 0x617bb20 Though I managed to get it working for the lo... | [
"iphone",
"objective-c",
"ios",
"asihttprequest"
] | 6 | 16 | 22,850 | 3 | 0 | 2011-06-04T09:07:54.133000 | 2011-06-04T18:29:22.513000 |
6,235,818 | 6,237,553 | What are the differences and benefits from class level methods in Objective-C compared to Java | For instance, I know Objective-C class methods could be overridden and Java's not. What's the benefit of this and what other diferences are there? | In a nutshell, static methods in Java are just functions that are attached to a class. They don't work like instance methods in that you can't use this or super. They effectively have no real concept of them being in a class. Objective-C class methods are very different though. They are exactly the same as instance met... | What are the differences and benefits from class level methods in Objective-C compared to Java For instance, I know Objective-C class methods could be overridden and Java's not. What's the benefit of this and what other diferences are there? | TITLE:
What are the differences and benefits from class level methods in Objective-C compared to Java
QUESTION:
For instance, I know Objective-C class methods could be overridden and Java's not. What's the benefit of this and what other diferences are there?
ANSWER:
In a nutshell, static methods in Java are just func... | [
"java",
"objective-c",
"class-method"
] | 3 | 11 | 1,504 | 3 | 0 | 2011-06-04T09:08:20.260000 | 2011-06-04T15:18:14.770000 |
6,235,824 | 6,235,845 | Eclipse: start new java project in one step? | I'm a total newbie to programming and just started learning JAVA i order to program Android apps. I started out with netbeans and got familiar with it quickly. I then changed to eclipse because of the Android support. But if I just want to make a simple java project in eclipse then the wizard doesn't ask for a package ... | Take a look at this. http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm You can do it while creating a class i.e. specify the name of the package. | Eclipse: start new java project in one step? I'm a total newbie to programming and just started learning JAVA i order to program Android apps. I started out with netbeans and got familiar with it quickly. I then changed to eclipse because of the Android support. But if I just want to make a simple java project in eclip... | TITLE:
Eclipse: start new java project in one step?
QUESTION:
I'm a total newbie to programming and just started learning JAVA i order to program Android apps. I started out with netbeans and got familiar with it quickly. I then changed to eclipse because of the Android support. But if I just want to make a simple jav... | [
"android",
"eclipse"
] | 0 | 1 | 636 | 3 | 0 | 2011-06-04T09:08:58.557000 | 2011-06-04T09:11:41.003000 |
6,235,825 | 6,237,819 | How to add the functionality of a gift certificate in VirtueMart? | I am creating an online shop using VirtueMart. Now I want to add facility of a gift card as we have in Magento and OsCommerce. So is there any plugin available in VirtueMart or do I have to customize VirtueMart? | VM does not do Magento/OSC style gift certificates without an extension. It does support simple coupons, but they are pretty limited in how they work. Your best bet is to use AwoCoupon, it's free. http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-coupons/11629 | How to add the functionality of a gift certificate in VirtueMart? I am creating an online shop using VirtueMart. Now I want to add facility of a gift card as we have in Magento and OsCommerce. So is there any plugin available in VirtueMart or do I have to customize VirtueMart? | TITLE:
How to add the functionality of a gift certificate in VirtueMart?
QUESTION:
I am creating an online shop using VirtueMart. Now I want to add facility of a gift card as we have in Magento and OsCommerce. So is there any plugin available in VirtueMart or do I have to customize VirtueMart?
ANSWER:
VM does not do ... | [
"joomla",
"virtuemart"
] | 1 | 2 | 2,383 | 3 | 0 | 2011-06-04T09:09:02.410000 | 2011-06-04T16:02:28.497000 |
6,235,826 | 6,238,839 | How much CPU/RAM would I need to host 5 Ruby on Rails 3 applications? | How much CPU/RAM would I need to host 5 Ruby on Rails 3 applications? I am talking about applications that will not get more than 300 hits per day each. | That's only a few hits per minute, even after allowing for peak hours and bursts. It's hard for me to imagine a reasonably new machine that would have any problems with that. But to answer your question, it depends a bit on which web server you choose but about 300 MB / Rails server is a starting point for planning a b... | How much CPU/RAM would I need to host 5 Ruby on Rails 3 applications? How much CPU/RAM would I need to host 5 Ruby on Rails 3 applications? I am talking about applications that will not get more than 300 hits per day each. | TITLE:
How much CPU/RAM would I need to host 5 Ruby on Rails 3 applications?
QUESTION:
How much CPU/RAM would I need to host 5 Ruby on Rails 3 applications? I am talking about applications that will not get more than 300 hits per day each.
ANSWER:
That's only a few hits per minute, even after allowing for peak hours ... | [
"ruby-on-rails-3",
"hosting"
] | 3 | 2 | 2,754 | 1 | 0 | 2011-06-04T09:09:11.250000 | 2011-06-04T19:12:19.877000 |
6,235,828 | 6,235,855 | Hide the button and show again on touch | I am working on an application where I want to hide the button, or, say, make the button invisible when I touch the screen and again make the button visible when I again touch the screen. How I can make it? | Implement an onTouchListener // Catch touch events here @Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { System.out.println("Touch Down X:" + event.getX() + " Y:" + event.getY()); } if (event.getAction() == MotionEvent.ACTION_UP) { System.out.println("Touch ... | Hide the button and show again on touch I am working on an application where I want to hide the button, or, say, make the button invisible when I touch the screen and again make the button visible when I again touch the screen. How I can make it? | TITLE:
Hide the button and show again on touch
QUESTION:
I am working on an application where I want to hide the button, or, say, make the button invisible when I touch the screen and again make the button visible when I again touch the screen. How I can make it?
ANSWER:
Implement an onTouchListener // Catch touch ev... | [
"android",
"touch",
"hide",
"visible",
"invisible"
] | 6 | 9 | 9,990 | 2 | 0 | 2011-06-04T09:09:16.590000 | 2011-06-04T09:14:21.980000 |
6,235,829 | 6,235,903 | Force and convert an ASP.NET MVC3 and Entity Framework 4 property to uppercase | I have a database field (postcode) that I want to contain upper case characters, spaces and numbers. No lower case or other punctuation. I'd like to deal with that as declaratively as possible. One way would be to use a regular expression DataAnnotation to validate, [A-Z][0-9]\w (or similar - I'm not a regular expressi... | CSS text-transform: uppercase? http://www.w3schools.com/css/pr_text_text-transform.asp UPDATE: Try implementing a custom ModelBinder. Here's an example: http://www.agileatwork.com/custom-model-binder-in-asp-net-mvc/ Instead of AddRoles just set the property to uppercase. No need to touch your EF classes. | Force and convert an ASP.NET MVC3 and Entity Framework 4 property to uppercase I have a database field (postcode) that I want to contain upper case characters, spaces and numbers. No lower case or other punctuation. I'd like to deal with that as declaratively as possible. One way would be to use a regular expression Da... | TITLE:
Force and convert an ASP.NET MVC3 and Entity Framework 4 property to uppercase
QUESTION:
I have a database field (postcode) that I want to contain upper case characters, spaces and numbers. No lower case or other punctuation. I'd like to deal with that as declaratively as possible. One way would be to use a reg... | [
"c#",
"asp.net-mvc",
"asp.net-mvc-3",
"entity-framework",
"validation"
] | 3 | 2 | 2,193 | 2 | 0 | 2011-06-04T09:09:29.587000 | 2011-06-04T09:27:00.943000 |
6,235,847 | 6,235,877 | How to generate NaN, -Infinity and +Infinity in ANSI C? | I use ANSI C89 (not C++), and I want to generate NaN, -Infinity and +Infinity. Is there any standard way (eg. standard macro)? Or is there any platform and compiler independent way to generate these numbers? float f = 0.0 / 0.0; // Is f ALWAYS in any platform is NaN? | There is in C99, but not in previous standards AFAIK. In C99, you'll have NAN and INFINITY macros. From "Mathematics " (§7.12) section The macro INFINITY expands to a constant expression of type float representing positive or unsigned infinity, if available;... If you're stuck with ANSI C89, you're out of luck. See C-FA... | How to generate NaN, -Infinity and +Infinity in ANSI C? I use ANSI C89 (not C++), and I want to generate NaN, -Infinity and +Infinity. Is there any standard way (eg. standard macro)? Or is there any platform and compiler independent way to generate these numbers? float f = 0.0 / 0.0; // Is f ALWAYS in any platform is N... | TITLE:
How to generate NaN, -Infinity and +Infinity in ANSI C?
QUESTION:
I use ANSI C89 (not C++), and I want to generate NaN, -Infinity and +Infinity. Is there any standard way (eg. standard macro)? Or is there any platform and compiler independent way to generate these numbers? float f = 0.0 / 0.0; // Is f ALWAYS in... | [
"c",
"nan",
"c89",
"infinity"
] | 50 | 44 | 38,417 | 4 | 0 | 2011-06-04T09:12:01.223000 | 2011-06-04T09:19:48.313000 |
6,235,854 | 6,236,025 | Rails, Globalize 3 and CRUD operations | How am I supposed to write the forms for my models where I'm using globalize3 for translations. I cannot find any examples and I don't find any helpers in the code. The idea would be to have everything in one form like text_field:title text_field:title_fr text_field:title_en etc.... Thanks for pointing me to some code ... | It looks like everything I need is in batch_translations fork adapted to Rails3/Globalize3: https://github.com/fidel/batch_translations I don't know if I supposed to delete this question or leave it for the future. Moderators please decide:) | Rails, Globalize 3 and CRUD operations How am I supposed to write the forms for my models where I'm using globalize3 for translations. I cannot find any examples and I don't find any helpers in the code. The idea would be to have everything in one form like text_field:title text_field:title_fr text_field:title_en etc..... | TITLE:
Rails, Globalize 3 and CRUD operations
QUESTION:
How am I supposed to write the forms for my models where I'm using globalize3 for translations. I cannot find any examples and I don't find any helpers in the code. The idea would be to have everything in one form like text_field:title text_field:title_fr text_fi... | [
"ruby-on-rails",
"forms",
"localization",
"models"
] | 3 | 6 | 1,444 | 1 | 0 | 2011-06-04T09:13:32.190000 | 2011-06-04T09:51:24.980000 |
6,235,856 | 6,235,863 | Getting an array of a property from an object array | I need to extract an array of a single property from a custom object array. eg. @interface MyClass: NSObject { int sampleNumber; NSString *sampleName; } I have an array of MyClass instances called myArray. I want to then get an array of the sampleName strings. Is there a way to do it without stepping through the whole ... | Use Key-Value Coding: NSArray *stringArray = [myArray valueForKey:@"sampleName"]; | Getting an array of a property from an object array I need to extract an array of a single property from a custom object array. eg. @interface MyClass: NSObject { int sampleNumber; NSString *sampleName; } I have an array of MyClass instances called myArray. I want to then get an array of the sampleName strings. Is ther... | TITLE:
Getting an array of a property from an object array
QUESTION:
I need to extract an array of a single property from a custom object array. eg. @interface MyClass: NSObject { int sampleNumber; NSString *sampleName; } I have an array of MyClass instances called myArray. I want to then get an array of the sampleNam... | [
"objective-c",
"cocoa",
"cocoa-touch",
"nsarray"
] | 3 | 4 | 813 | 1 | 0 | 2011-06-04T09:14:23.357000 | 2011-06-04T09:16:01.777000 |
6,235,870 | 6,240,941 | Last build number of mercurial in cruise control .net | We are using cruise control.net with mercurial version control for continuous integration. I want to get the latest build number in the ccnet dashboard. While using toroise svn as version control we added to get the latest build number. So while using mercurial hg, what tag should be added in order to get the latest bu... | I don't know what it looks like in cruise control (people still use cruise control?!), but from mercurial you can use: hg log -r. --template '{node}-{latesttag}-{latesttagdistance}' to get the string you want. You can exec that and get the value either in CC or in your build scripts. | Last build number of mercurial in cruise control .net We are using cruise control.net with mercurial version control for continuous integration. I want to get the latest build number in the ccnet dashboard. While using toroise svn as version control we added to get the latest build number. So while using mercurial hg, ... | TITLE:
Last build number of mercurial in cruise control .net
QUESTION:
We are using cruise control.net with mercurial version control for continuous integration. I want to get the latest build number in the ccnet dashboard. While using toroise svn as version control we added to get the latest build number. So while us... | [
"mercurial",
"cruisecontrol.net"
] | 2 | 2 | 281 | 1 | 0 | 2011-06-04T09:18:11.737000 | 2011-06-05T04:05:58.923000 |
6,235,871 | 6,235,891 | Can we have a ASP.NET Webservice on WordPress Site? | I want to use ASP.NET webservice on a WordPress Site. So, if the site is www.abc.com, can I access the service at www.abc.com/WS/serv.asmx? If it is not possible to do so, what can be a workaround for this, as I MUST use that asp.net webservice at all cost. Please guide me. Thanks! | If you're running IIS with both PHP and ASP.NET installed, there's no reason why you shouldn't be able to run both within the same site. | Can we have a ASP.NET Webservice on WordPress Site? I want to use ASP.NET webservice on a WordPress Site. So, if the site is www.abc.com, can I access the service at www.abc.com/WS/serv.asmx? If it is not possible to do so, what can be a workaround for this, as I MUST use that asp.net webservice at all cost. Please gui... | TITLE:
Can we have a ASP.NET Webservice on WordPress Site?
QUESTION:
I want to use ASP.NET webservice on a WordPress Site. So, if the site is www.abc.com, can I access the service at www.abc.com/WS/serv.asmx? If it is not possible to do so, what can be a workaround for this, as I MUST use that asp.net webservice at al... | [
"c#",
"php",
"asp.net",
"web-services",
"wordpress"
] | 1 | 1 | 437 | 1 | 0 | 2011-06-04T09:18:52.920000 | 2011-06-04T09:24:00.557000 |
6,235,875 | 6,236,088 | Finding an element in partially sorted array | I had a following interview question. There is an array of nxn elements. The array is partially sorted i.e the biggest element in row i is smaller than the smallest element in row i+1. How can you find a given element with complexity O(n) Here is my take on this: You should go to the row n/2.And start compare for examp... | Your solution indeed takes O(n log n) assuming you're searching each row you parse. If you don't search each row, then you can't accurately perform the binary step. O(n) solution: Pick the n/2 row, instead of searching the entire row, we simply take the first element of the previous row, and the first element of the ne... | Finding an element in partially sorted array I had a following interview question. There is an array of nxn elements. The array is partially sorted i.e the biggest element in row i is smaller than the smallest element in row i+1. How can you find a given element with complexity O(n) Here is my take on this: You should ... | TITLE:
Finding an element in partially sorted array
QUESTION:
I had a following interview question. There is an array of nxn elements. The array is partially sorted i.e the biggest element in row i is smaller than the smallest element in row i+1. How can you find a given element with complexity O(n) Here is my take on... | [
"c++",
"arrays",
"algorithm"
] | 16 | 15 | 1,748 | 2 | 0 | 2011-06-04T09:19:41.607000 | 2011-06-04T10:06:21.857000 |
6,235,878 | 6,235,904 | How to create a .Plist that contains key ==> Value? | In my application I need to read data from plist also I need to know how to create the plist that contains the key-value data. And is there a better way to read info (key-value)? | The easiest way to read plist data is to use NSDictionary: NSMutableDictionary *myDict = [NSMutableDictionary dictionaryWithContentsOfFile:path]; Similarly you can write it out using: [myDict writeToFile:path atomically:NO]; | How to create a .Plist that contains key ==> Value? In my application I need to read data from plist also I need to know how to create the plist that contains the key-value data. And is there a better way to read info (key-value)? | TITLE:
How to create a .Plist that contains key ==> Value?
QUESTION:
In my application I need to read data from plist also I need to know how to create the plist that contains the key-value data. And is there a better way to read info (key-value)?
ANSWER:
The easiest way to read plist data is to use NSDictionary: NSM... | [
"ios",
"iphone",
"ipad",
"plist",
"key-value"
] | 0 | 4 | 352 | 1 | 0 | 2011-06-04T09:19:56.067000 | 2011-06-04T09:27:11.357000 |
6,235,880 | 6,235,905 | How to read or store integers, by reading line by line in C? | I'm trying to read line of numbers and do some calculations on them. However, I need to them to be separated line by line somehow, but I can't figure out how to do that. Here's my code: int main() { int infor[1024]; //2-d array perhaps?? int n, i;
i=0;
int imgWidth, imgHeight, safeRegionStart, safeRegionWidth; FILE *... | I think your 2D array idea is probably correct, especially if you want to keep the data points separate. Use fgets to bring in each line as a string, then use a loop with sscanf to parse out the individual numbers into a single row of the array. A function like strtol can be used in place of the sscanf step to get the ... | How to read or store integers, by reading line by line in C? I'm trying to read line of numbers and do some calculations on them. However, I need to them to be separated line by line somehow, but I can't figure out how to do that. Here's my code: int main() { int infor[1024]; //2-d array perhaps?? int n, i;
i=0;
int ... | TITLE:
How to read or store integers, by reading line by line in C?
QUESTION:
I'm trying to read line of numbers and do some calculations on them. However, I need to them to be separated line by line somehow, but I can't figure out how to do that. Here's my code: int main() { int infor[1024]; //2-d array perhaps?? int... | [
"c",
"io",
"stdin"
] | 1 | 3 | 242 | 1 | 0 | 2011-06-04T09:21:01.950000 | 2011-06-04T09:27:25.990000 |
6,235,897 | 6,235,962 | No address space for Linux Kernel threads | Why the Linux kernel threads do not have an address space. For any task to execute, it should have a memory region right? Where do the text and data of kernel threads go? | Kernel threads do have an address space. It's just that they all share the same one. This does not prevent them from each having a different stack. Text and data are laid out in the kernel address space (the one that is shared by all the threads), depending on how and when it was allocated, and what it's used for. The ... | No address space for Linux Kernel threads Why the Linux kernel threads do not have an address space. For any task to execute, it should have a memory region right? Where do the text and data of kernel threads go? | TITLE:
No address space for Linux Kernel threads
QUESTION:
Why the Linux kernel threads do not have an address space. For any task to execute, it should have a memory region right? Where do the text and data of kernel threads go?
ANSWER:
Kernel threads do have an address space. It's just that they all share the same ... | [
"multithreading",
"memory",
"linux-kernel"
] | 6 | 7 | 2,695 | 2 | 0 | 2011-06-04T09:25:17.447000 | 2011-06-04T09:37:48.667000 |
6,235,907 | 6,236,167 | How is `>>>` lexed in C++0x? | >>> is lexed as >> >. But what happens if the first > closes a template argument list, should the result be equivalent to > > > or > >>? It does matter in the following code: template struct X { };
void operator >>(const X &, int) { }
int main() { *new X >> 1; } | The text of the FDIS says Similarly, the first non-nested >> is treated as two consecutive but distinct > tokens It cannot unlex tokens and relex. So this will be a > > >. Note that the input to a C++ implementation is first lexed into preprocessing tokens, and then those tokens are converted into C++ tokens. So first ... | How is `>>>` lexed in C++0x? >>> is lexed as >> >. But what happens if the first > closes a template argument list, should the result be equivalent to > > > or > >>? It does matter in the following code: template struct X { };
void operator >>(const X &, int) { }
int main() { *new X >> 1; } | TITLE:
How is `>>>` lexed in C++0x?
QUESTION:
>>> is lexed as >> >. But what happens if the first > closes a template argument list, should the result be equivalent to > > > or > >>? It does matter in the following code: template struct X { };
void operator >>(const X &, int) { }
int main() { *new X >> 1; }
ANSWER:... | [
"c++",
"c++11"
] | 26 | 11 | 1,089 | 2 | 0 | 2011-06-04T09:28:49.007000 | 2011-06-04T10:22:46.657000 |
6,235,910 | 6,235,939 | xml writer/editor -- use python's version? | I need to learn/write XML and I already have python downloaded as I am also learning python. I did notice that there was another question on stackoverflow about xml writers and python but I didn't get the idea that there was real consensus on what's easiest to use? That is, I would ideally like an XML editor that highl... | I use IntelliJ (community edition should be fine) and emacs for XML editing. I used the Altova XMLSpy family back in the days I used windows. | xml writer/editor -- use python's version? I need to learn/write XML and I already have python downloaded as I am also learning python. I did notice that there was another question on stackoverflow about xml writers and python but I didn't get the idea that there was real consensus on what's easiest to use? That is, I ... | TITLE:
xml writer/editor -- use python's version?
QUESTION:
I need to learn/write XML and I already have python downloaded as I am also learning python. I did notice that there was another question on stackoverflow about xml writers and python but I didn't get the idea that there was real consensus on what's easiest t... | [
"python",
"xml"
] | 1 | 1 | 177 | 2 | 0 | 2011-06-04T09:28:53.150000 | 2011-06-04T09:33:32.760000 |
6,235,918 | 6,235,937 | request for the JavaScript regex for pattern | following is the string i have and i would like to read the number "10" (last inside the () )using regex. I am using Javascript. "test me 234 and the (another) and test (10)" | Something like this: var str = "test me 234 and the (another) and test (10)"; result = str.match(/\((\d+)\)$/); console.log(result[1]); | request for the JavaScript regex for pattern following is the string i have and i would like to read the number "10" (last inside the () )using regex. I am using Javascript. "test me 234 and the (another) and test (10)" | TITLE:
request for the JavaScript regex for pattern
QUESTION:
following is the string i have and i would like to read the number "10" (last inside the () )using regex. I am using Javascript. "test me 234 and the (another) and test (10)"
ANSWER:
Something like this: var str = "test me 234 and the (another) and test (1... | [
"javascript"
] | 0 | 2 | 35 | 1 | 0 | 2011-06-04T09:29:54.807000 | 2011-06-04T09:33:14.540000 |
6,235,924 | 6,236,012 | Force derived class to override at least one virtual function | Imagine this simple base class: struct simple_http_service { virtual reply http_get(…); virtual reply http_post(…); virtual reply http_delete(…); // etc. }; I'd like to prevent the user from deriving from this class without overriding at least one of these and prevent them from instantiang simple_http_service Is there ... | That sounds like a really odd constraint. By all means protect the user from incorrect usage, but don't try to prohibit things that you just "can't see the point of". If there's no point in deriving from your class without overriding any of the three functions, then let the user override as many or as few function as h... | Force derived class to override at least one virtual function Imagine this simple base class: struct simple_http_service { virtual reply http_get(…); virtual reply http_post(…); virtual reply http_delete(…); // etc. }; I'd like to prevent the user from deriving from this class without overriding at least one of these a... | TITLE:
Force derived class to override at least one virtual function
QUESTION:
Imagine this simple base class: struct simple_http_service { virtual reply http_get(…); virtual reply http_post(…); virtual reply http_delete(…); // etc. }; I'd like to prevent the user from deriving from this class without overriding at le... | [
"c++",
"overriding",
"virtual-functions"
] | 4 | 5 | 1,558 | 5 | 0 | 2011-06-04T09:30:24.417000 | 2011-06-04T09:48:34.480000 |
6,235,925 | 6,236,035 | How do I create a instance for Constructor? | I cannot create object for this coding. How can I access this values I want to return the msg value in this coding? package com.my;
import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.VectorAppender; import org.apache.log4j.spi.LoggingEvent; import java.util.Vector; public class LogC... | I'm not sure that I understand the question, but it sounds easy. You create an instance like this: new LogCapture(Level.INFO); You can find the other log levels here: Documentation for Level Edit (since the OP has added some more code): Change the code in the main method so that it says LogCapture logCapture = new LogC... | How do I create a instance for Constructor? I cannot create object for this coding. How can I access this values I want to return the msg value in this coding? package com.my;
import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.VectorAppender; import org.apache.log4j.spi.LoggingEvent... | TITLE:
How do I create a instance for Constructor?
QUESTION:
I cannot create object for this coding. How can I access this values I want to return the msg value in this coding? package com.my;
import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.VectorAppender; import org.apache.log4... | [
"java",
"constructor"
] | 0 | 0 | 144 | 1 | 0 | 2011-06-04T09:30:37.160000 | 2011-06-04T09:54:25.183000 |
6,235,929 | 6,237,704 | Remove username from recent content block Drupal 7 | I'm using Drupal 7 and Garland theme. The Recent Content block is currently displaying the name of the title of the node recently modified plus the username of the corresponding user. I would like to remove the username from display. I won't accept solutions which use the Views module. Thanks a lot! | You need to modify the Garland theme so it doesn't show user name as part of that block. You can do so directly in the Garland theme by adding the following code to the end of /themes/garland/template.php: /** * Returns HTML for a recent node to be displayed in the recent content block. * * @param $variables * An assoc... | Remove username from recent content block Drupal 7 I'm using Drupal 7 and Garland theme. The Recent Content block is currently displaying the name of the title of the node recently modified plus the username of the corresponding user. I would like to remove the username from display. I won't accept solutions which use ... | TITLE:
Remove username from recent content block Drupal 7
QUESTION:
I'm using Drupal 7 and Garland theme. The Recent Content block is currently displaying the name of the title of the node recently modified plus the username of the corresponding user. I would like to remove the username from display. I won't accept so... | [
"css",
"drupal",
"drupal-7"
] | 2 | 3 | 1,812 | 1 | 0 | 2011-06-04T09:31:13.030000 | 2011-06-04T15:43:04.790000 |
6,235,935 | 6,237,795 | Restrict joomla 1.5 manager from accessing componets | I want to restrict components to access by Manager role in Joomla 1.5. And it will be good if it is possible by just some line of code rather using any component / extension. Any help will be appreciated. Thanks | You are not going to be able to achieve access control levels with just a few lines of code. If it was that simple, ACL would not be such a big deal. You need an extension that allows you to manage the admin access levels. Take a look at these - http://extensions.joomla.org/extensions/access-a-security/backend-a-full-a... | Restrict joomla 1.5 manager from accessing componets I want to restrict components to access by Manager role in Joomla 1.5. And it will be good if it is possible by just some line of code rather using any component / extension. Any help will be appreciated. Thanks | TITLE:
Restrict joomla 1.5 manager from accessing componets
QUESTION:
I want to restrict components to access by Manager role in Joomla 1.5. And it will be good if it is possible by just some line of code rather using any component / extension. Any help will be appreciated. Thanks
ANSWER:
You are not going to be able... | [
"php",
"joomla",
"components",
"joomla1.5"
] | 1 | 1 | 1,174 | 3 | 0 | 2011-06-04T09:32:58.423000 | 2011-06-04T15:59:16.413000 |
6,235,936 | 6,236,537 | IOC Container build in code vs configuration.Advice needed | I have not done much IOC but from what I read and the examples I see on the internet it has confused me. My understanding is that you should use IOC to promote loosely coupled system. Now building the container in code (Unity) the one my company uses how can this be decoupled if I have to have a hard reference to my se... | Container is helping you build loosely coupled applications, but loosely coupled doesn't mean "no hard references on other assemblies" as you seem to be suggesting. Interface and class that implements it may live in the same assembly, in the same namespace, event in the same.cs file, and that has nothing to do with loo... | IOC Container build in code vs configuration.Advice needed I have not done much IOC but from what I read and the examples I see on the internet it has confused me. My understanding is that you should use IOC to promote loosely coupled system. Now building the container in code (Unity) the one my company uses how can th... | TITLE:
IOC Container build in code vs configuration.Advice needed
QUESTION:
I have not done much IOC but from what I read and the examples I see on the internet it has confused me. My understanding is that you should use IOC to promote loosely coupled system. Now building the container in code (Unity) the one my compa... | [
"c#",
"inversion-of-control",
"unity-container"
] | 1 | 2 | 325 | 3 | 0 | 2011-06-04T09:33:03.787000 | 2011-06-04T11:43:18.573000 |
6,235,938 | 6,236,019 | Centering floating list items <li> inside a div or their <ul> | HTML:..... I'm coding a simple gallery page by creating unordered list and each list item of it contains an image. ul li { float: left; } I set the width of the container as "max-width" so I can make possible to fit the list items (images) to the browser width.. meaning that they will be re-arranged when the browser wi... | Remove float:left and use display:inline so that you can use text-align:center. Set the font size to zero so that you don't have white-space between the images. ul { font-size:0; text-align:center } ul li { display:inline; zoom:1 }.imgcontainer { max-width:750px; margin:0 auto } The zoom is a hack for old IE versions. ... | Centering floating list items <li> inside a div or their <ul> HTML:..... I'm coding a simple gallery page by creating unordered list and each list item of it contains an image. ul li { float: left; } I set the width of the container as "max-width" so I can make possible to fit the list items (images) to the browser wid... | TITLE:
Centering floating list items <li> inside a div or their <ul>
QUESTION:
HTML:..... I'm coding a simple gallery page by creating unordered list and each list item of it contains an image. ul li { float: left; } I set the width of the container as "max-width" so I can make possible to fit the list items (images) ... | [
"css",
"gallery",
"css-float",
"center",
"listitem"
] | 16 | 21 | 25,504 | 2 | 0 | 2011-06-04T09:33:27.140000 | 2011-06-04T09:49:23.513000 |
6,235,949 | 6,235,964 | Where can i find collection of various common File Extension structure? | Suppose i want to fstream some image file like jpeg, i'd need to know its internal structure, and how it is stored. Therefore, i just want to know if there exist some website that collect information on structure of each file extension? There's only website such as filext.com that tell us about what kind of file it is.... | http://www.wotsit.org/ Has descriptions for many file formats. You will have a hard time implementing parsers for "all common file extensions" though. You are probably going to have better success using libraries, or depending what you are trying to do, using OS-specific file info functions. Maybe even supporting an ex... | Where can i find collection of various common File Extension structure? Suppose i want to fstream some image file like jpeg, i'd need to know its internal structure, and how it is stored. Therefore, i just want to know if there exist some website that collect information on structure of each file extension? There's onl... | TITLE:
Where can i find collection of various common File Extension structure?
QUESTION:
Suppose i want to fstream some image file like jpeg, i'd need to know its internal structure, and how it is stored. Therefore, i just want to know if there exist some website that collect information on structure of each file exte... | [
"c++",
"file-io"
] | 0 | 0 | 61 | 1 | 0 | 2011-06-04T09:35:28.450000 | 2011-06-04T09:38:08.153000 |
6,235,954 | 6,236,497 | encrypting web.config | Here is my c# code: System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/Web.config");
ConfigurationSection section = config.GetSection("appSettings"); section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider"); section.SectionInformat... | The error is on the ~/web.config, the OpenWebConfiguration needs the full application path, not the name of the web.config as appears on web. Try this (tested and working for the opening): OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); or (base on msdn sample code) OpenWebConfiguration(/web.config);... | encrypting web.config Here is my c# code: System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/Web.config");
ConfigurationSection section = config.GetSection("appSettings"); section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider"); s... | TITLE:
encrypting web.config
QUESTION:
Here is my c# code: System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~/Web.config");
ConfigurationSection section = config.GetSection("appSettings"); section.SectionInformation.ProtectSection("RsaProtectedConfigur... | [
"c#",
"asp.net",
"web-config",
"asp.net-4.0"
] | 3 | 3 | 1,053 | 1 | 0 | 2011-06-04T09:36:42.137000 | 2011-06-04T11:33:44.387000 |
6,235,963 | 6,236,021 | MongoDB taking too much space? | I have been using mongodb recently, and I have found out that it is taking a lot of space. For example, in its db directory /var/lib/mongodb/, if I type "du -sh", then result turns out to be 417M. The thing is that there are only few entries in database, and I do not know how that can take up to 400M of space. Is it no... | Databases typically expand space automatically but do not return it when no longer needed. This can happen during tests or running queries. Similarly if you have indexes or created aggregates with map-reduce they need to go somewhere next to "your" data. Special tools must be run manually to reclaim the space. Checkout... | MongoDB taking too much space? I have been using mongodb recently, and I have found out that it is taking a lot of space. For example, in its db directory /var/lib/mongodb/, if I type "du -sh", then result turns out to be 417M. The thing is that there are only few entries in database, and I do not know how that can tak... | TITLE:
MongoDB taking too much space?
QUESTION:
I have been using mongodb recently, and I have found out that it is taking a lot of space. For example, in its db directory /var/lib/mongodb/, if I type "du -sh", then result turns out to be 417M. The thing is that there are only few entries in database, and I do not kno... | [
"mongodb"
] | 4 | 1 | 4,422 | 2 | 0 | 2011-06-04T09:38:07.157000 | 2011-06-04T09:49:57.027000 |
6,235,965 | 6,236,099 | Web server (httpd): how to update/upload the served content remotely? | Running Apache httpd on Windows, what is the usual method / tool to update / upload the served content from another Windows host? I think of SFTP or SSH, but is there a module for httpd that is alrady ready for that? Thks. | I think you should use webdav for this purpose. Apache already supports it through the mod_dav module. Windows machine can mount webdav folders directly through "Map Network Drive" option I think. | Web server (httpd): how to update/upload the served content remotely? Running Apache httpd on Windows, what is the usual method / tool to update / upload the served content from another Windows host? I think of SFTP or SSH, but is there a module for httpd that is alrady ready for that? Thks. | TITLE:
Web server (httpd): how to update/upload the served content remotely?
QUESTION:
Running Apache httpd on Windows, what is the usual method / tool to update / upload the served content from another Windows host? I think of SFTP or SSH, but is there a module for httpd that is alrady ready for that? Thks.
ANSWER:
... | [
"windows",
"file-upload",
"apache"
] | 0 | 0 | 134 | 1 | 0 | 2011-06-04T09:38:23.140000 | 2011-06-04T10:08:33.940000 |
6,235,972 | 6,236,175 | problem with parsing Json return object | I have the following json output when i call a sample webservice [{"Name":"Ajay Singh","Company":"Birlasoft Ltd.","Address":"LosAngeles California","Phone":"1204675","Country":"US"},{"Name":"Ajay Singh","Company":"Birlasoft Ltd.","Address":"D-195 Sector Noida","Phone":"1204675","Country":"India"}] I am facing problem i... | This should work. Change testJson like this. function testJson() { $.ajax({ type: "POST", url: "JsonWebService.asmx/TestJSON", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { msg = msg.hasOwnProperty("d")? msg.d: msg; $("#jsonResponse").html(msg); var data = JSON.... | problem with parsing Json return object I have the following json output when i call a sample webservice [{"Name":"Ajay Singh","Company":"Birlasoft Ltd.","Address":"LosAngeles California","Phone":"1204675","Country":"US"},{"Name":"Ajay Singh","Company":"Birlasoft Ltd.","Address":"D-195 Sector Noida","Phone":"1204675","... | TITLE:
problem with parsing Json return object
QUESTION:
I have the following json output when i call a sample webservice [{"Name":"Ajay Singh","Company":"Birlasoft Ltd.","Address":"LosAngeles California","Phone":"1204675","Country":"US"},{"Name":"Ajay Singh","Company":"Birlasoft Ltd.","Address":"D-195 Sector Noida","... | [
"jquery",
"asp.net",
"json"
] | 1 | 1 | 2,084 | 1 | 0 | 2011-06-04T09:40:24.457000 | 2011-06-04T10:24:40.250000 |
6,235,974 | 6,236,059 | jQuery .find() fails to find occasionally | I am trying to parse the HTML of a webpage to DOM by loading it into an iframe and do some searching on the DOM afterwards. Here's the code function f(callback) { var tmp = document.createElement('iframe'); $(tmp).hide(); $(tmp).insertAfter($('foo')); $(tmp).attr('src', url);
$(tmp).load(function() { var bdy = tmp.con... | Check this question out, along with its many answers and related questions. Update; here's some code that waits for #bar to get loaded: function f(callback) { var tmp = document.createElement('iframe'), $tmp = $(tmp); $tmp.hide().insertAfter($('foo')).attr('src', url);
$tmp.load(function() { var bdy = tmp.contentDocum... | jQuery .find() fails to find occasionally I am trying to parse the HTML of a webpage to DOM by loading it into an iframe and do some searching on the DOM afterwards. Here's the code function f(callback) { var tmp = document.createElement('iframe'); $(tmp).hide(); $(tmp).insertAfter($('foo')); $(tmp).attr('src', url);
... | TITLE:
jQuery .find() fails to find occasionally
QUESTION:
I am trying to parse the HTML of a webpage to DOM by loading it into an iframe and do some searching on the DOM afterwards. Here's the code function f(callback) { var tmp = document.createElement('iframe'); $(tmp).hide(); $(tmp).insertAfter($('foo')); $(tmp).a... | [
"javascript",
"jquery",
"iframe",
"load"
] | 0 | 0 | 734 | 1 | 0 | 2011-06-04T09:40:47.577000 | 2011-06-04T09:59:46.130000 |
6,235,975 | 6,236,089 | Hibernate and resource utilization | I was having a discussion at our office whether to use Hibernate or not. Currently our code uses pure jdbc and sql statements in order to get the data we need. As you can imagine this makes our code hard to maintain. I suggested to switch to Hibernate to make our code look and work better. However, our application need... | First of all, for most applications there is a tradeoff between high performance and low memory. If you want both, you usually have to consider other tradeoffs, e.g. maintainability like in your application with JDBC. You can argue to your colleagues, that for all relationships the fetch type can be specified: EAGER - ... | Hibernate and resource utilization I was having a discussion at our office whether to use Hibernate or not. Currently our code uses pure jdbc and sql statements in order to get the data we need. As you can imagine this makes our code hard to maintain. I suggested to switch to Hibernate to make our code look and work be... | TITLE:
Hibernate and resource utilization
QUESTION:
I was having a discussion at our office whether to use Hibernate or not. Currently our code uses pure jdbc and sql statements in order to get the data we need. As you can imagine this makes our code hard to maintain. I suggested to switch to Hibernate to make our cod... | [
"java",
"database",
"hibernate"
] | 1 | 5 | 137 | 1 | 0 | 2011-06-04T09:41:03.367000 | 2011-06-04T10:06:37.873000 |
6,235,981 | 6,236,031 | How can i echo a variable like this from db? | kHow can i echo $tags like this: tag1 tag2 tag3 tag4 inside the $string? $sql = dbquery("SELECT id,tags FROM videos WHERE views > 4 ORDER BY id DESC LIMIT 0,10");
while($row = mysql_fetch_array($sql)){ $new_id = $row["id"]; $tags = $row["tags"];
// other code for the other variables //
$string.=' '.$url.' '.$vimg.' ... | $tagString = ' '.implode(' ', explode(",", $tags)).' '; And then in your $string: $string.= 'blablabla '.$tagString.' blabla'; | How can i echo a variable like this from db? kHow can i echo $tags like this: tag1 tag2 tag3 tag4 inside the $string? $sql = dbquery("SELECT id,tags FROM videos WHERE views > 4 ORDER BY id DESC LIMIT 0,10");
while($row = mysql_fetch_array($sql)){ $new_id = $row["id"]; $tags = $row["tags"];
// other code for the other... | TITLE:
How can i echo a variable like this from db?
QUESTION:
kHow can i echo $tags like this: tag1 tag2 tag3 tag4 inside the $string? $sql = dbquery("SELECT id,tags FROM videos WHERE views > 4 ORDER BY id DESC LIMIT 0,10");
while($row = mysql_fetch_array($sql)){ $new_id = $row["id"]; $tags = $row["tags"];
// other ... | [
"php",
"mysql",
"database"
] | 0 | 1 | 137 | 1 | 0 | 2011-06-04T09:42:46.813000 | 2011-06-04T09:52:42.750000 |
6,235,984 | 6,238,678 | UITextView in a UITableViewCell: first responder problem | I have a UITextView in a UITableViewCell which grows together with it. Using [myTableView beginUpdates]; [myTableView endUpdates]; in textViewDidChange and setting the height of the cell properly, I'm getting close to the solution. But I've a problem tied to the first responder. I set the textview in my custom cell to ... | I resolved putting [myTextView becomeFirstResponder]; in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; | UITextView in a UITableViewCell: first responder problem I have a UITextView in a UITableViewCell which grows together with it. Using [myTableView beginUpdates]; [myTableView endUpdates]; in textViewDidChange and setting the height of the cell properly, I'm getting close to the solution. But I've a problem tied to the ... | TITLE:
UITextView in a UITableViewCell: first responder problem
QUESTION:
I have a UITextView in a UITableViewCell which grows together with it. Using [myTableView beginUpdates]; [myTableView endUpdates]; in textViewDidChange and setting the height of the cell properly, I'm getting close to the solution. But I've a pr... | [
"uitableview",
"uitextview",
"first-responder"
] | 0 | 0 | 983 | 1 | 0 | 2011-06-04T09:43:13.270000 | 2011-06-04T18:44:48.533000 |
6,235,989 | 6,236,130 | How to merge the remote branch and ignore the config setting? | I working on a cms project and using a open source cms that hosted on github, how can I fetch the latest commit remotely to my working copy without overwrite some of my local setting? example my database setting etc? | I always recommend a filter driver with: a template for those setting files (versioned in Git) some files with the right values depending on the environment a script able to build the actual setting files (as a 'smudge' script) See " How to keep different content of one file in my local and github repository? " for mor... | How to merge the remote branch and ignore the config setting? I working on a cms project and using a open source cms that hosted on github, how can I fetch the latest commit remotely to my working copy without overwrite some of my local setting? example my database setting etc? | TITLE:
How to merge the remote branch and ignore the config setting?
QUESTION:
I working on a cms project and using a open source cms that hosted on github, how can I fetch the latest commit remotely to my working copy without overwrite some of my local setting? example my database setting etc?
ANSWER:
I always recom... | [
"git",
"github"
] | 3 | 2 | 1,297 | 2 | 0 | 2011-06-04T09:44:09.597000 | 2011-06-04T10:15:26.857000 |
6,235,990 | 6,240,752 | How can i get the full path in local.xml file | Here is my code: checkout/cart Here how can i get full path of checkout/cart in? | If you want to remove that link from the header of the whole site, I would just copy the checkout.xml layout file to my custom theme directory to override it, and comment/delete the line where it is added: But if you really need to remove the link via removeLinkByUrl(), looking through the core code they usually do thi... | How can i get the full path in local.xml file Here is my code: checkout/cart Here how can i get full path of checkout/cart in? | TITLE:
How can i get the full path in local.xml file
QUESTION:
Here is my code: checkout/cart Here how can i get full path of checkout/cart in?
ANSWER:
If you want to remove that link from the header of the whole site, I would just copy the checkout.xml layout file to my custom theme directory to override it, and com... | [
"layout",
"magento"
] | 0 | 2 | 2,312 | 1 | 0 | 2011-06-04T09:44:39.023000 | 2011-06-05T03:02:46.840000 |
6,235,995 | 6,236,145 | Markdown/Github: syntax highlighting of code block as a child of a list | In Github/MD, if we want to enable code block when it is a child of list, we need to intent it by 8 spaces. But how to make that code block has the syntax highlighting feature? The following code does not work as expected... 1. foo
```python print 'bar' ```
2. bar | ```python print 'bar' ``` without spaces should work: from GitHub help page: Just wrap your code blocks in ``` and you won't need to indent manually to trigger a code block. As illustrated in hilz 's answer below, you need to indent the ```` with the same indentation level + 2 spaces than your list. The content of the ... | Markdown/Github: syntax highlighting of code block as a child of a list In Github/MD, if we want to enable code block when it is a child of list, we need to intent it by 8 spaces. But how to make that code block has the syntax highlighting feature? The following code does not work as expected... 1. foo
```python print... | TITLE:
Markdown/Github: syntax highlighting of code block as a child of a list
QUESTION:
In Github/MD, if we want to enable code block when it is a child of list, we need to intent it by 8 spaces. But how to make that code block has the syntax highlighting feature? The following code does not work as expected... 1. fo... | [
"github",
"markdown"
] | 27 | 20 | 25,437 | 3 | 0 | 2011-06-04T09:45:07.587000 | 2011-06-04T10:18:40.303000 |
6,235,996 | 6,236,036 | Can we say that "C language operators are polymorphic"? | Can we say that "C language operators are polymorphic"? For example if int a, b; float p, q;
a+b; a+p; p+q; etc will generate different code when assembled, as the type conversion is needed the floating point coprocessor instruction needs to be executed to make the conversion and the floating point additions. So the o... | If we consider the operator + a function, then it matches the definition of a polymorphic function because it can "evaluate to or be applied to values of different types". So yes, it's a polymorphic function. | Can we say that "C language operators are polymorphic"? Can we say that "C language operators are polymorphic"? For example if int a, b; float p, q;
a+b; a+p; p+q; etc will generate different code when assembled, as the type conversion is needed the floating point coprocessor instruction needs to be executed to make t... | TITLE:
Can we say that "C language operators are polymorphic"?
QUESTION:
Can we say that "C language operators are polymorphic"? For example if int a, b; float p, q;
a+b; a+p; p+q; etc will generate different code when assembled, as the type conversion is needed the floating point coprocessor instruction needs to be ... | [
"c"
] | 2 | 4 | 222 | 2 | 0 | 2011-06-04T09:45:14.747000 | 2011-06-04T09:54:25.183000 |
6,236,000 | 6,236,064 | Uninstalling app which created widgets leaves "Problem loading widget" placeholder where they used to be | My app suffers from this and it turns out so does the Wiktionary sample from http://developer.android.com/resources/samples/Wiktionary/index.html. Install the app, create a widget, uninstall the app - observe text as stated where widget used to be. Tried on Android 2.3.4. I understand Widgets can't be rendered unless a... | No, I don't think it does. see here How to remove widget when the app is uninstalled in Android? (edited - sorry cut/paste failure) | Uninstalling app which created widgets leaves "Problem loading widget" placeholder where they used to be My app suffers from this and it turns out so does the Wiktionary sample from http://developer.android.com/resources/samples/Wiktionary/index.html. Install the app, create a widget, uninstall the app - observe text a... | TITLE:
Uninstalling app which created widgets leaves "Problem loading widget" placeholder where they used to be
QUESTION:
My app suffers from this and it turns out so does the Wiktionary sample from http://developer.android.com/resources/samples/Wiktionary/index.html. Install the app, create a widget, uninstall the ap... | [
"android",
"widget",
"uninstallation"
] | 0 | 0 | 1,482 | 1 | 0 | 2011-06-04T09:45:52.027000 | 2011-06-04T10:01:08.400000 |
6,236,014 | 6,236,077 | Create gray IplImage from gray UIImage | I'm a trying to create a gray IplImage from a gray scaled UIImage and Im using the method below. - (IplImage *)createGrayIplImageFromUIImage:(UIImage *)image {
CGImageRef imageRef = [image CGImage];
CFDataRef dat = CGDataProviderCopyData(CGImageGetDataProvider(imageRef));
const unsigned char *buffer = CFDataGetByteP... | A byte is a byte is a byte. The data itself doesn't know whether it's signed or unsigned -- it's all in how you interpret the data. Change your NSLog() statement to use %u (unsigned int) instead of %d (signed int) for the format specifier and your data will be displayed unsigned. | Create gray IplImage from gray UIImage I'm a trying to create a gray IplImage from a gray scaled UIImage and Im using the method below. - (IplImage *)createGrayIplImageFromUIImage:(UIImage *)image {
CGImageRef imageRef = [image CGImage];
CFDataRef dat = CGDataProviderCopyData(CGImageGetDataProvider(imageRef));
const... | TITLE:
Create gray IplImage from gray UIImage
QUESTION:
I'm a trying to create a gray IplImage from a gray scaled UIImage and Im using the method below. - (IplImage *)createGrayIplImageFromUIImage:(UIImage *)image {
CGImageRef imageRef = [image CGImage];
CFDataRef dat = CGDataProviderCopyData(CGImageGetDataProvider(... | [
"ios",
"opencv",
"uiimage",
"grayscale",
"iplimage"
] | 1 | 1 | 866 | 1 | 0 | 2011-06-04T09:48:46.460000 | 2011-06-04T10:04:22.540000 |
6,236,017 | 6,236,455 | Retrieve Coordinates from google maps api | I have a list of addresses, i now want to retrieve their longitudes and latitudes. i would like to use the google maps api through java. How would i go about retrieving just one set of co-ords for one address. (cause i could then easily implement for multiple) | This is how i did it in the end public static String getCordinates(String address,String county) throws IOException, ParserConfigurationException, SAXException{ String thisLine;
address = address.replace(",", "+"); address = address.replace(" ", "+"); county = county.replace(" ", "");
String fullAddress = address+"+"... | Retrieve Coordinates from google maps api I have a list of addresses, i now want to retrieve their longitudes and latitudes. i would like to use the google maps api through java. How would i go about retrieving just one set of co-ords for one address. (cause i could then easily implement for multiple) | TITLE:
Retrieve Coordinates from google maps api
QUESTION:
I have a list of addresses, i now want to retrieve their longitudes and latitudes. i would like to use the google maps api through java. How would i go about retrieving just one set of co-ords for one address. (cause i could then easily implement for multiple)... | [
"java",
"google-maps"
] | 0 | 2 | 14,475 | 4 | 0 | 2011-06-04T09:49:04.213000 | 2011-06-04T11:22:58.933000 |
6,236,020 | 6,236,573 | transfer int over network | I am new to network programming so I have a question: is it safe to send an integer (let's assume 16 bit integer because 32 has issue with "endianess") in my case between C++ and C# and how do that? In my program I cast int to char (I know is is lower than 255) and send it. However, I would like to send 32 int. I tried... | If you are writing with protobuf-net, the WithLengthPrefix methods will do this for you. I'd be more than happy to help with this (I'm the author). Btw, the reason it is throwing an exception is that a varint value by itself is not normally valid in a protobuf stream. The system will override this in the case of WithLe... | transfer int over network I am new to network programming so I have a question: is it safe to send an integer (let's assume 16 bit integer because 32 has issue with "endianess") in my case between C++ and C# and how do that? In my program I cast int to char (I know is is lower than 255) and send it. However, I would li... | TITLE:
transfer int over network
QUESTION:
I am new to network programming so I have a question: is it safe to send an integer (let's assume 16 bit integer because 32 has issue with "endianess") in my case between C++ and C# and how do that? In my program I cast int to char (I know is is lower than 255) and send it. H... | [
"c#",
"c++",
"network-programming",
"protocol-buffers",
"protobuf-net"
] | 1 | 0 | 565 | 3 | 0 | 2011-06-04T09:49:29.730000 | 2011-06-04T11:51:20.340000 |
6,236,032 | 6,236,041 | best practice for passing values between functions in Python | What is pythonic best practice for allowing one function to use another function's returned values? e.g. Is it better to call one function within another, or better that function1 returns to the class, and class variables are assigned that are then used by function2? Secondly, how many different ways could you pass val... | As import this would say, "explicit is better than implicit"; so go with the first form. If the number of return values becomes large, let use_value take a sequence argument instead. | best practice for passing values between functions in Python What is pythonic best practice for allowing one function to use another function's returned values? e.g. Is it better to call one function within another, or better that function1 returns to the class, and class variables are assigned that are then used by fu... | TITLE:
best practice for passing values between functions in Python
QUESTION:
What is pythonic best practice for allowing one function to use another function's returned values? e.g. Is it better to call one function within another, or better that function1 returns to the class, and class variables are assigned that a... | [
"function",
"return-value",
"python"
] | 11 | 9 | 19,752 | 3 | 0 | 2011-06-04T09:53:54.790000 | 2011-06-04T09:56:43.327000 |
6,236,039 | 6,236,978 | Rule of thumb for when to store objects in Db for iPhone | Is there a good rule of thumb for when you should switch from having your objects in memory to store them in a database like Core Data/Sqlite on the iPhone/iPad? I've heard (I think it was in Big Nerd Ranch, book) that 10.000 of simple objects is no problem at all to save and store from Document directory on iPhone 3GS... | See this previous answer to a similar question. Short summary: When data set is relatively small and with low complexity, you can use collections (NSArray, NSDictionary, NSSet) written to disk as plist. When data sets are very large but with low complexity e.g. a library card file where all the cards are exactly the sa... | Rule of thumb for when to store objects in Db for iPhone Is there a good rule of thumb for when you should switch from having your objects in memory to store them in a database like Core Data/Sqlite on the iPhone/iPad? I've heard (I think it was in Big Nerd Ranch, book) that 10.000 of simple objects is no problem at al... | TITLE:
Rule of thumb for when to store objects in Db for iPhone
QUESTION:
Is there a good rule of thumb for when you should switch from having your objects in memory to store them in a database like Core Data/Sqlite on the iPhone/iPad? I've heard (I think it was in Big Nerd Ranch, book) that 10.000 of simple objects i... | [
"iphone",
"sqlite",
"core-data"
] | 1 | 1 | 211 | 2 | 0 | 2011-06-04T09:55:22.340000 | 2011-06-04T13:24:08.697000 |
6,236,050 | 6,236,128 | Hard to explain, angle and rectangle involved | I have a rectangle and an angle. I need to provide the start and end points of a LinearGradientBrush in C# so that the gradient always fits perfectly within this rectangle and never under or over-extends the rectangle. Could some of you mathletes out there help me out? I'm sure there's a really simple solution to this. | Would the following work (I am unable to test it): var myBrush = new LinearGradientBrush(Color.Red, Color.Black, myAngle); myBrush.StartPoint = new Point(myRectangle.X, myRectangle.Y); myBrush.EndPoint = new Point(myRectangle.X+myRectangle.Width, myRectangle.Y+myRectangle.height); | Hard to explain, angle and rectangle involved I have a rectangle and an angle. I need to provide the start and end points of a LinearGradientBrush in C# so that the gradient always fits perfectly within this rectangle and never under or over-extends the rectangle. Could some of you mathletes out there help me out? I'm ... | TITLE:
Hard to explain, angle and rectangle involved
QUESTION:
I have a rectangle and an angle. I need to provide the start and end points of a LinearGradientBrush in C# so that the gradient always fits perfectly within this rectangle and never under or over-extends the rectangle. Could some of you mathletes out there... | [
"c#",
"wpf",
"gradient",
"trigonometry"
] | 0 | 0 | 445 | 1 | 0 | 2011-06-04T09:58:15.390000 | 2011-06-04T10:15:12.207000 |
6,236,052 | 6,236,117 | How can I change language of my application? | In my application I have a option of language selection. There are three languages: English, German & Spanish. When I select an option, the entire application language should be changed. How can I make this possible? | Do you mean that you want to use another language than the default language in the phone? I have that in one application, and this is what I had to do. Add this to your activity declaration in the AndroidManifest.xml And then invoke a method like this from onCreate in your activity: public static void setLanguage(Conte... | How can I change language of my application? In my application I have a option of language selection. There are three languages: English, German & Spanish. When I select an option, the entire application language should be changed. How can I make this possible? | TITLE:
How can I change language of my application?
QUESTION:
In my application I have a option of language selection. There are three languages: English, German & Spanish. When I select an option, the entire application language should be changed. How can I make this possible?
ANSWER:
Do you mean that you want to us... | [
"android"
] | 10 | 22 | 13,525 | 2 | 0 | 2011-06-04T09:58:23.280000 | 2011-06-04T10:12:26.313000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.