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,224,626
6,224,645
Clone contents of a GitHub repository (without the folder itself)
I'd like to git clone the contents of a repository I have on GitHub. When I git clone (git@github:me/name.git...) I get a folder called name/ and inside name I have my contents... How do I get JUST the contents?
If the current directory is empty, you can do that with: git clone git@github.com:me/name.git. (Note the. at the end to specify the current directory.) Of course, this also creates the.git directory in your current folder, not just the source code from your project. This optional [directory] parameter is documented in ...
Clone contents of a GitHub repository (without the folder itself) I'd like to git clone the contents of a repository I have on GitHub. When I git clone (git@github:me/name.git...) I get a folder called name/ and inside name I have my contents... How do I get JUST the contents?
TITLE: Clone contents of a GitHub repository (without the folder itself) QUESTION: I'd like to git clone the contents of a repository I have on GitHub. When I git clone (git@github:me/name.git...) I get a folder called name/ and inside name I have my contents... How do I get JUST the contents? ANSWER: If the current ...
[ "git" ]
298
407
183,121
7
0
2011-06-03T08:16:25.753000
2011-06-03T08:18:28.263000
6,224,643
6,224,689
how can i validate year textbox in javascript?
I am using a textbox on my page which is used to enter year in yyyy-yyyy format. Can you tell how can i validate textbox in this format through javascript?? Thanks in advance...
You can match it with a regular expression: var pattern = /\d{4}-\d{4}/;
how can i validate year textbox in javascript? I am using a textbox on my page which is used to enter year in yyyy-yyyy format. Can you tell how can i validate textbox in this format through javascript?? Thanks in advance...
TITLE: how can i validate year textbox in javascript? QUESTION: I am using a textbox on my page which is used to enter year in yyyy-yyyy format. Can you tell how can i validate textbox in this format through javascript?? Thanks in advance... ANSWER: You can match it with a regular expression: var pattern = /\d{4}-\d{...
[ "javascript" ]
1
4
1,862
2
0
2011-06-03T08:18:26.147000
2011-06-03T08:22:24.730000
6,224,653
6,231,040
How to refresh a eclipse project built from ant build file?
I created a new project in eclipse using an existing ant build file (using the eclipse feature). Is there a way to refresh the project, if the ant build file is modified? For example, there were new build path dependencies added to the build.xml but in eclipse those files were not added to the project build path.
I believe once the project has been created you have to keep them up to sync manually. Either that, or delete the project in eclipse and create a New project from the newly updated ant file.
How to refresh a eclipse project built from ant build file? I created a new project in eclipse using an existing ant build file (using the eclipse feature). Is there a way to refresh the project, if the ant build file is modified? For example, there were new build path dependencies added to the build.xml but in eclipse...
TITLE: How to refresh a eclipse project built from ant build file? QUESTION: I created a new project in eclipse using an existing ant build file (using the eclipse feature). Is there a way to refresh the project, if the ant build file is modified? For example, there were new build path dependencies added to the build....
[ "eclipse" ]
1
1
671
1
0
2011-06-03T08:19:12.163000
2011-06-03T18:16:45.527000
6,224,662
6,224,901
Is there a hide/show column functionality on jqGrid like in flexigrid?
Is there a hide/show column functionality on jqGrid like in flexigrid? I want the user be capable of hiding columns, so it will be easy for them to review related columns(informations)
Check out hideCol() and showCol() $('#tblId').hideCol('column'); $('#tblId').showCol('column'); Instead of the column name you can use the column index, too. But I haven't seen this feature implemented (e.g. selecting from the header directly).
Is there a hide/show column functionality on jqGrid like in flexigrid? Is there a hide/show column functionality on jqGrid like in flexigrid? I want the user be capable of hiding columns, so it will be easy for them to review related columns(informations)
TITLE: Is there a hide/show column functionality on jqGrid like in flexigrid? QUESTION: Is there a hide/show column functionality on jqGrid like in flexigrid? I want the user be capable of hiding columns, so it will be easy for them to review related columns(informations) ANSWER: Check out hideCol() and showCol() $('...
[ "jqgrid", "flexigrid" ]
4
7
8,794
2
0
2011-06-03T08:19:54.867000
2011-06-03T08:48:05.253000
6,224,670
6,232,588
jQuery Validation Callback Function
I currently have a form within a lightbox frame on my webpage. When a user submits the form with invalid data, a div appears with a list of form errors at the top of the form. The problem is: I need some sort of jQuery validation callback to resize the lightbox after the errors div appears. As far as I'm aware, there i...
you to supply the invalid callback function which you can find documented here, like so $(".selector").validate({ invalidHandler: function(form, validator) { var errors = validator.numberOfInvalids(); if (errors) { //resize code goes here } } })
jQuery Validation Callback Function I currently have a form within a lightbox frame on my webpage. When a user submits the form with invalid data, a div appears with a list of form errors at the top of the form. The problem is: I need some sort of jQuery validation callback to resize the lightbox after the errors div a...
TITLE: jQuery Validation Callback Function QUESTION: I currently have a form within a lightbox frame on my webpage. When a user submits the form with invalid data, a div appears with a list of form errors at the top of the form. The problem is: I need some sort of jQuery validation callback to resize the lightbox afte...
[ "jquery", "jquery-ui", "jquery-validate", "validation", "lightbox" ]
8
22
28,926
2
0
2011-06-03T08:20:50.390000
2011-06-03T20:55:25.967000
6,224,680
6,224,730
tab usercontrol closing event
Hi i have a tab load this usercontrol. when i wish to close this tab, i wish to call this cancelbutton_click event to pop up confirmation on closing, if OK, then close, if Cancel, the tab stays. if i use Unloaded event, it will pop up twice before closing. private void UserControl_Unloaded(object sender, RoutedEventArg...
Unloaded is called when the control is already being removed, it's not an event you want to handle often, just create a button which is supposed to close the tab, handle it's click, check if the user wants to cancel via the dialogue and close the tab if he does not.
tab usercontrol closing event Hi i have a tab load this usercontrol. when i wish to close this tab, i wish to call this cancelbutton_click event to pop up confirmation on closing, if OK, then close, if Cancel, the tab stays. if i use Unloaded event, it will pop up twice before closing. private void UserControl_Unloaded...
TITLE: tab usercontrol closing event QUESTION: Hi i have a tab load this usercontrol. when i wish to close this tab, i wish to call this cancelbutton_click event to pop up confirmation on closing, if OK, then close, if Cancel, the tab stays. if i use Unloaded event, it will pop up twice before closing. private void Us...
[ "wpf", "user-controls" ]
1
2
3,988
1
0
2011-06-03T08:21:35.630000
2011-06-03T08:28:49.843000
6,224,681
6,224,704
jQuery Fading effect occuring multiple times
I am trying to write a simple jQuery script to apply fading effect on footer. On mouseover event, it fades in with opacity = 1, and on mouse out event it fades out to opacity 0.01. I have applied this effect on parent div. The problem is, everytime I move mouse over child elements, it triggers the event and makes the d...
You should be able to use the stop() function to prevent this: http://api.jquery.com/stop/ $(this).stop().fadeTo("fast",1.00); $(this).stop().fadeTo("fast",0.01); http://jsfiddle.net/w7Vbu/7/
jQuery Fading effect occuring multiple times I am trying to write a simple jQuery script to apply fading effect on footer. On mouseover event, it fades in with opacity = 1, and on mouse out event it fades out to opacity 0.01. I have applied this effect on parent div. The problem is, everytime I move mouse over child el...
TITLE: jQuery Fading effect occuring multiple times QUESTION: I am trying to write a simple jQuery script to apply fading effect on footer. On mouseover event, it fades in with opacity = 1, and on mouse out event it fades out to opacity 0.01. I have applied this effect on parent div. The problem is, everytime I move m...
[ "jquery", "mouseover", "mouseout", "fadeto" ]
2
3
1,169
1
0
2011-06-03T08:21:35.660000
2011-06-03T08:25:10.437000
6,224,693
6,225,079
Application pause/resume state
My question is can i get to know when the entire application gets paused/resumed start/stop etc. For example if i have 5 activities in my application. Whenever any activity gets paused/resumed android notify the activity by calling the onPause/onResume methods. So there are two possible scenarios when my activity gets ...
There is no solution provided by the API because it is not needed in most cases. What you can do is to create an abstract activity and make all your activities inheriting from this abstract one. In this abstract activity, by overriding onCreate, onResume, onPause, onDestroy, you can manage to count how many of your own...
Application pause/resume state My question is can i get to know when the entire application gets paused/resumed start/stop etc. For example if i have 5 activities in my application. Whenever any activity gets paused/resumed android notify the activity by calling the onPause/onResume methods. So there are two possible s...
TITLE: Application pause/resume state QUESTION: My question is can i get to know when the entire application gets paused/resumed start/stop etc. For example if i have 5 activities in my application. Whenever any activity gets paused/resumed android notify the activity by calling the onPause/onResume methods. So there ...
[ "android" ]
7
10
18,730
4
0
2011-06-03T08:23:44.770000
2011-06-03T09:06:49.623000
6,224,709
6,224,757
Conditional Namespace in Winform application
I want to know better way to define name-spaces in my projects. We have 2 different winform projects and there are certain code files and forms which we use in both project. So the structure of project 1 and 2 is below: //Project Pro1 //------------------------------------- //Class C1 starts #if pro1 using pro1 #endif ...
I would make a common interface that contains your M2 method: interface ICommonFun { void M2(); } Then pass the implementation of that interface to your C1 class: class C1 { ICommonFun Instance; public void M1() { Instance.M2(); } public C1(ICommonFun fun) { Instance = fun; } }
Conditional Namespace in Winform application I want to know better way to define name-spaces in my projects. We have 2 different winform projects and there are certain code files and forms which we use in both project. So the structure of project 1 and 2 is below: //Project Pro1 //------------------------------------- ...
TITLE: Conditional Namespace in Winform application QUESTION: I want to know better way to define name-spaces in my projects. We have 2 different winform projects and there are certain code files and forms which we use in both project. So the structure of project 1 and 2 is below: //Project Pro1 //--------------------...
[ "winforms", "namespace-organisation", "global-namespace" ]
1
1
156
2
0
2011-06-03T08:26:09.597000
2011-06-03T08:32:02.327000
6,224,710
6,224,782
Set Imageview to show image in sdcard?
I have a image stored in SD card of my phone. I want to show it in a image view. I know the location of the file. On the oncreate of the activity is there a simple way to say something like ImageView img = (ImageView) findViewById(R.id.imageView1); String path = Environment.getExternalStorageDirectory().toString() "Ima...
Bitmap bmp = BitmapFactory.decodeFile(pathName); ImageView img; img.setImageBitmap(bmp);
Set Imageview to show image in sdcard? I have a image stored in SD card of my phone. I want to show it in a image view. I know the location of the file. On the oncreate of the activity is there a simple way to say something like ImageView img = (ImageView) findViewById(R.id.imageView1); String path = Environment.getExt...
TITLE: Set Imageview to show image in sdcard? QUESTION: I have a image stored in SD card of my phone. I want to show it in a image view. I know the location of the file. On the oncreate of the activity is there a simple way to say something like ImageView img = (ImageView) findViewById(R.id.imageView1); String path = ...
[ "android", "android-layout", "android-imageview", "android-image" ]
30
88
48,413
2
0
2011-06-03T08:26:10.183000
2011-06-03T08:35:17.980000
6,224,716
6,226,867
PyQt4 Gui designing
I just started to lear the PyQt, but I got some problem. Here is my code: class GUI( QtGui.QMainWindow ): ''' classdocs ''' """**********************************************************************""" """ Constructor """ """**********************************************************************""" def __init__( self, pa...
You can use: sendButton.setMinimumSize() and mainLayout.setRowMinimumHeight()
PyQt4 Gui designing I just started to lear the PyQt, but I got some problem. Here is my code: class GUI( QtGui.QMainWindow ): ''' classdocs ''' """**********************************************************************""" """ Constructor """ """**********************************************************************""" de...
TITLE: PyQt4 Gui designing QUESTION: I just started to lear the PyQt, but I got some problem. Here is my code: class GUI( QtGui.QMainWindow ): ''' classdocs ''' """**********************************************************************""" """ Constructor """ """**********************************************************...
[ "python", "pyqt4" ]
0
1
300
1
0
2011-06-03T08:26:44.540000
2011-06-03T12:05:00.673000
6,224,717
6,224,863
scaling database diagram in sql server
I have created a database diagram in sql server which is consist of number of tables.I need to copy the diagram in to a word document but when i copy it to the word document its not well formatted and some parts are even missing.is there any software to scale the diagram?
You can use Microsoft Visio. You should refer the below links. 1. Visio 2. Visio
scaling database diagram in sql server I have created a database diagram in sql server which is consist of number of tables.I need to copy the diagram in to a word document but when i copy it to the word document its not well formatted and some parts are even missing.is there any software to scale the diagram?
TITLE: scaling database diagram in sql server QUESTION: I have created a database diagram in sql server which is consist of number of tables.I need to copy the diagram in to a word document but when i copy it to the word document its not well formatted and some parts are even missing.is there any software to scale the...
[ "sql-server", "diagram", "scale", "visio" ]
0
2
184
1
0
2011-06-03T08:27:07.843000
2011-06-03T08:43:36.953000
6,224,728
6,225,047
Creating S/MIME from MIME?
I don't completely understand and some documentation or help would be appreciated greatly:) Using PHP I create a MIME by using ezcomponents Mail object. But what I do not understand is: Do you create an S/MIME message from a original MIME by signing it with openssl_pkcs7_sign? or do you create an S/MIME from scratch an...
Save yourself a lot of pain and route the messages you need signed through a MTA filter that is designed for the job, e.g. Gnu Anubis (SMTP proxy) or implement a milter
Creating S/MIME from MIME? I don't completely understand and some documentation or help would be appreciated greatly:) Using PHP I create a MIME by using ezcomponents Mail object. But what I do not understand is: Do you create an S/MIME message from a original MIME by signing it with openssl_pkcs7_sign? or do you creat...
TITLE: Creating S/MIME from MIME? QUESTION: I don't completely understand and some documentation or help would be appreciated greatly:) Using PHP I create a MIME by using ezcomponents Mail object. But what I do not understand is: Do you create an S/MIME message from a original MIME by signing it with openssl_pkcs7_sig...
[ "php", "openssl", "smime", "mime-message" ]
3
2
786
1
0
2011-06-03T08:28:30.400000
2011-06-03T09:04:02.680000
6,224,729
6,224,821
How can I use PartialFunctions to compose my match statements?
Consider the following: scala> object Currency extends Enumeration { | type Currency = Value | val USD = Value | val GBP = Value | val EUR = Value | val TRY = Value // Turkish lira | val NGN = Value // Nigerian naira | } defined module Currency scala> import Currency._ import Currency._ scala> val pf: (String) => Opt...
I think you just need to use it as a function, e.g.: pf("$") If you will define pf as PartialFunction[String, Option[String]] you can also use other useful stuff like pf.isDefinedAt("x"). If you will look in Scala Language Specification section 8.4 Pattern Matching Expressions, you will find following syntax: Expr::= P...
How can I use PartialFunctions to compose my match statements? Consider the following: scala> object Currency extends Enumeration { | type Currency = Value | val USD = Value | val GBP = Value | val EUR = Value | val TRY = Value // Turkish lira | val NGN = Value // Nigerian naira | } defined module Currency scala> impo...
TITLE: How can I use PartialFunctions to compose my match statements? QUESTION: Consider the following: scala> object Currency extends Enumeration { | type Currency = Value | val USD = Value | val GBP = Value | val EUR = Value | val TRY = Value // Turkish lira | val NGN = Value // Nigerian naira | } defined module Cur...
[ "scala", "pattern-matching", "partialfunction" ]
2
5
1,109
1
0
2011-06-03T08:28:38.703000
2011-06-03T08:39:08.887000
6,224,732
6,224,769
How to encrypt one entry in web.config
ASP.NET 4 I've used RSA key encryption for connection strings in web.config on my web farm. However, there's one more custom password entry that I'd like to encrypt. How should I encrypt it with RSA key without having the rest configurations being encrypted. Please advise, thanks. Example:...
You could put the password into a separate section and encrypt this section only. For example: and then (note that I am using DPAPI in my example so adapt the provider for RSA): aspnet_regiis -pef secureAppSettings. -prov DataProtectionConfigurationProvider Once encrypted the file will look like this: AQAAANCMnd..........
How to encrypt one entry in web.config ASP.NET 4 I've used RSA key encryption for connection strings in web.config on my web farm. However, there's one more custom password entry that I'd like to encrypt. How should I encrypt it with RSA key without having the rest configurations being encrypted. Please advise, thanks....
TITLE: How to encrypt one entry in web.config QUESTION: ASP.NET 4 I've used RSA key encryption for connection strings in web.config on my web farm. However, there's one more custom password entry that I'd like to encrypt. How should I encrypt it with RSA key without having the rest configurations being encrypted. Plea...
[ "asp.net", "encryption", "web-config" ]
45
64
36,208
3
0
2011-06-03T08:29:06.503000
2011-06-03T08:33:47.457000
6,224,734
6,224,774
How should I know the return type of an object in jquery?
I have a form. I am using validation and after that I submit a form.. var flag=$("#form1").validate(); The above code returns an object. I want to check that if the above code is validate, then submit a form using jquery ajax. How I can do that? Here is my fiddle: http://jsfiddle.net/anish/Q9qes/9/ Thanx
The jQuery validate function allows you to define a submit handler - that's where you'd fire off the AJAX. You should be passing validate() an object with your specifics. See http://docs.jquery.com/Plugins/Validation for documentation. Quick example... $('#form1').validate({ submitHandler: function(form) { // Do your a...
How should I know the return type of an object in jquery? I have a form. I am using validation and after that I submit a form.. var flag=$("#form1").validate(); The above code returns an object. I want to check that if the above code is validate, then submit a form using jquery ajax. How I can do that? Here is my fiddl...
TITLE: How should I know the return type of an object in jquery? QUESTION: I have a form. I am using validation and after that I submit a form.. var flag=$("#form1").validate(); The above code returns an object. I want to check that if the above code is validate, then submit a form using jquery ajax. How I can do that...
[ "jquery", "ajax", "validation", "forms" ]
1
3
93
2
0
2011-06-03T08:29:40.453000
2011-06-03T08:34:22.807000
6,224,736
6,224,857
How to write Python code that is able to properly require a minimal python version?
I would like to see if there is any way of requiring a minimal python version. I have several python modules that are requiring Python 2.6 due to the new exception handling ( as keyword). It looks that even if I check the python version at the beginning of my script, the code will not run because the interpreter will f...
import sys if sys.hexversion < 0x02060000: sys.exit("Python 2.6 or newer is required to run this program.") import module_requiring_26 Also the cool part about this is that it can be included inside the __init__ file or the module.
How to write Python code that is able to properly require a minimal python version? I would like to see if there is any way of requiring a minimal python version. I have several python modules that are requiring Python 2.6 due to the new exception handling ( as keyword). It looks that even if I check the python version...
TITLE: How to write Python code that is able to properly require a minimal python version? QUESTION: I would like to see if there is any way of requiring a minimal python version. I have several python modules that are requiring Python 2.6 due to the new exception handling ( as keyword). It looks that even if I check ...
[ "python" ]
76
12
29,876
9
0
2011-06-03T08:29:54.633000
2011-06-03T08:42:34.693000
6,224,739
6,225,177
Custom errormessages using database for dataannotations in MVC 3
I'm trying to implement a custom class for dataannotations that retrieves error messages from a database. The database part is all done using EF and LINQ to return the messages. [Required(ErrorMessageResourceType=typeof(MyTestClass), ErrorMessageResourceName="Required")] What does my class need to return for it to work...
http://blog.gauffin.org/2010/11/simplified-localization-for-dataannotations/
Custom errormessages using database for dataannotations in MVC 3 I'm trying to implement a custom class for dataannotations that retrieves error messages from a database. The database part is all done using EF and LINQ to return the messages. [Required(ErrorMessageResourceType=typeof(MyTestClass), ErrorMessageResourceN...
TITLE: Custom errormessages using database for dataannotations in MVC 3 QUESTION: I'm trying to implement a custom class for dataannotations that retrieves error messages from a database. The database part is all done using EF and LINQ to return the messages. [Required(ErrorMessageResourceType=typeof(MyTestClass), Err...
[ "asp.net-mvc-3", "data-annotations" ]
0
2
2,739
1
0
2011-06-03T08:30:05.493000
2011-06-03T09:17:18.827000
6,224,743
6,246,874
Calculate path direction (azimuth) given starting and ending coordinates easily
I just trying know how to implement in objective c an equation that gave my position in lat, long and the position of a point in lat,long returns the relative angle to the azimuth so I will be able to know when to paint this point knowing the azimuth. I also know more or less the equation but I don´t know how to do it ...
Regarding turning that equation into Objecive-C. 'man cos' and 'man sin' say they take radians, so you'll have to convert your degree values to radians. The common method seems to be this, (90 * M_PI/180), where 90 is the degree value being converted. The functions for arccos and arcsin are acos and asin respectively. ...
Calculate path direction (azimuth) given starting and ending coordinates easily I just trying know how to implement in objective c an equation that gave my position in lat, long and the position of a point in lat,long returns the relative angle to the azimuth so I will be able to know when to paint this point knowing t...
TITLE: Calculate path direction (azimuth) given starting and ending coordinates easily QUESTION: I just trying know how to implement in objective c an equation that gave my position in lat, long and the position of a point in lat,long returns the relative angle to the azimuth so I will be able to know when to paint th...
[ "iphone", "objective-c", "coordinates", "point", "azimuth" ]
0
0
638
1
0
2011-06-03T08:30:27.890000
2011-06-06T00:29:35.543000
6,224,746
6,224,993
Help me style this day schedule table
UPDATE: I have updated my HTML. Now it works in all browsers except IE7. Any ideas? Check out my updated HTML and jsFiddle link. Alright. I have a table which shows my company's cars and time intervals during which they have been reserved. Each hour is divided into four parts - each 15 minutes interval. The problem is ...
Try adding table-layout:fixed; to the table selector. I know that this makes the layout for "Car" and "Buick" a bit weird, but you can probably fix those one by wrap them in a separate div container and then positionate them relative with a fixed width or something.
Help me style this day schedule table UPDATE: I have updated my HTML. Now it works in all browsers except IE7. Any ideas? Check out my updated HTML and jsFiddle link. Alright. I have a table which shows my company's cars and time intervals during which they have been reserved. Each hour is divided into four parts - eac...
TITLE: Help me style this day schedule table QUESTION: UPDATE: I have updated my HTML. Now it works in all browsers except IE7. Any ideas? Check out my updated HTML and jsFiddle link. Alright. I have a table which shows my company's cars and time intervals during which they have been reserved. Each hour is divided int...
[ "html", "css", "xhtml", "css-tables" ]
2
0
1,322
2
0
2011-06-03T08:30:39.510000
2011-06-03T08:58:44.073000
6,224,750
6,224,838
How do I programmatically change value of a field in an Access database?
Let's say I have a list of names in an Access table. I add one column called Found with default value No/False. What I want to do is to search through the names via a query and set the Found value to Yes/True if the name contains 'abc'. How do I do this? I envision something like this: do while name contains 'abc' set ...
You can create query as follow: UPDATE MyTable SET MyTable.Found = True WHERE MyTable.NameField LIKE "*abc*";
How do I programmatically change value of a field in an Access database? Let's say I have a list of names in an Access table. I add one column called Found with default value No/False. What I want to do is to search through the names via a query and set the Found value to Yes/True if the name contains 'abc'. How do I d...
TITLE: How do I programmatically change value of a field in an Access database? QUESTION: Let's say I have a list of names in an Access table. I add one column called Found with default value No/False. What I want to do is to search through the names via a query and set the Found value to Yes/True if the name contains...
[ "database" ]
0
2
2,167
1
0
2011-06-03T08:30:54.487000
2011-06-03T08:40:17.067000
6,224,760
6,225,556
Firebird backup restore is frustrating, is there a way to avoid it?
I am using Firebird, but lately the database grows really seriously. There is really a lot of delete statements running, as well update/inserts, and the database file size grows really fast. After tons of deleting records the database size doesn't decrease, and even worse, i have the feeling that actually the query get...
We have a lot of huge databases on Firebird in production but never had an issue with a database growth. Yes, every time a record being deleted or updated an old version of it will be kept in the file. But sooner or later a garbage collector will sweap it away. Once both processes will balance each other the database f...
Firebird backup restore is frustrating, is there a way to avoid it? I am using Firebird, but lately the database grows really seriously. There is really a lot of delete statements running, as well update/inserts, and the database file size grows really fast. After tons of deleting records the database size doesn't decr...
TITLE: Firebird backup restore is frustrating, is there a way to avoid it? QUESTION: I am using Firebird, but lately the database grows really seriously. There is really a lot of delete statements running, as well update/inserts, and the database file size grows really fast. After tons of deleting records the database...
[ "sql", "database", "backup", "firebird", "interbase" ]
8
9
5,132
3
0
2011-06-03T08:32:48.777000
2011-06-03T09:55:24.917000
6,224,766
6,229,978
How to add an embedded image to an HTML message in Outlook 2010
I have Office 2003 VBA code that uses the technique described here to embed an image in an HTML message using undocumented MAPI properties and CDO 1.21. CDO 1.21 is no longer supported, but according to MSDN, most of its functionality is now incorporated into the Outlook 2010 object model. Where can I find a sample tha...
Found the answer here. The key bits being: Const PR_ATTACH_MIME_TAG = "http://schemas.microsoft.com/mapi/proptag/0x370E001E" Const PR_ATTACH_CONTENT_ID = "http://schemas.microsoft.com/mapi/proptag/0x3712001E" Const PR_ATTACHMENT_HIDDEN = "http://schemas.microsoft.com/mapi/proptag/0x7FFE000B"... Set colAttach = l_Msg.A...
How to add an embedded image to an HTML message in Outlook 2010 I have Office 2003 VBA code that uses the technique described here to embed an image in an HTML message using undocumented MAPI properties and CDO 1.21. CDO 1.21 is no longer supported, but according to MSDN, most of its functionality is now incorporated i...
TITLE: How to add an embedded image to an HTML message in Outlook 2010 QUESTION: I have Office 2003 VBA code that uses the technique described here to embed an image in an HTML message using undocumented MAPI properties and CDO 1.21. CDO 1.21 is no longer supported, but according to MSDN, most of its functionality is ...
[ "vba", "outlook", "cdo.message", "outlook-object-model" ]
2
2
23,231
4
0
2011-06-03T08:33:29.077000
2011-06-03T16:33:08.383000
6,224,773
6,225,002
NSMutableArray addObject freezes my app
Tons of similar questions, but none of their answers seem to answer mine... I'm creating my array as such: imgArray = [NSMutableArray arrayWithCapacity:10]; Later (in another function) I am trying to add an object to it: Attachment newAttachment = [[[Attachment alloc] init] autorelease]; newAttachment.fileName = filena...
just do imgArray = [[NSMutableArray arrayWithCapacity:10] retain]; all class methods if return an object is returned with retain count 1 and object already in autorelease pool so if want to use that object beyond the current working block the you should always retain that object because then reference is lost outside t...
NSMutableArray addObject freezes my app Tons of similar questions, but none of their answers seem to answer mine... I'm creating my array as such: imgArray = [NSMutableArray arrayWithCapacity:10]; Later (in another function) I am trying to add an object to it: Attachment newAttachment = [[[Attachment alloc] init] autor...
TITLE: NSMutableArray addObject freezes my app QUESTION: Tons of similar questions, but none of their answers seem to answer mine... I'm creating my array as such: imgArray = [NSMutableArray arrayWithCapacity:10]; Later (in another function) I am trying to add an object to it: Attachment newAttachment = [[[Attachment ...
[ "iphone", "debugging" ]
0
1
144
2
0
2011-06-03T08:34:05.457000
2011-06-03T09:00:12.760000
6,224,780
6,224,817
kill JavaScript recursive function
I am having recursive function. it make calls every second. I want to kill that function in certain state. function foo(){ // ajax call //in ajax success success: function(response){ setTimeout(function(){ foo(); },1000); } } This code makes recursive call if(user == "idile"){ //here i want to kill that foo() function...
Assign the timeout to a variable like this: var timer; function foo(){ // ajax call //in ajax success success: function(response){ timer = setTimeout(function(){ foo(); },1000); } } and then to kill the timer: if(user == "idile"){ clearTimeout(timer); }
kill JavaScript recursive function I am having recursive function. it make calls every second. I want to kill that function in certain state. function foo(){ // ajax call //in ajax success success: function(response){ setTimeout(function(){ foo(); },1000); } } This code makes recursive call if(user == "idile"){ //here...
TITLE: kill JavaScript recursive function QUESTION: I am having recursive function. it make calls every second. I want to kill that function in certain state. function foo(){ // ajax call //in ajax success success: function(response){ setTimeout(function(){ foo(); },1000); } } This code makes recursive call if(user =...
[ "jquery", "javascript" ]
0
6
1,794
3
0
2011-06-03T08:35:09.400000
2011-06-03T08:38:39.907000
6,224,791
6,226,331
How to handle events for dynamically created objects in MFC?
I am wondering how I can handle an event for a dynamically created variable, e.g. a list control. CListCtrl* pList = new CListCtrl(); pList->Create(...); How can I handle the event LVN_ITEMCHANGED for pList? OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult) { //do stuff } Do I have to create an extended CListCtrl o...
LVN_ITEMCHANGED is sent through WM_NOTIFY message from control to its parent so you just need to add LVN_ITEMCHANGE handler function in parent's class (e.g. CMyDlg): In header file: class CMyDlg: public CDialog {... protected: afx_msg void OnLvnItemChanged(NMHDR *pNMHDR, LRESULT *pResult);... } In source file: BEGIN_ME...
How to handle events for dynamically created objects in MFC? I am wondering how I can handle an event for a dynamically created variable, e.g. a list control. CListCtrl* pList = new CListCtrl(); pList->Create(...); How can I handle the event LVN_ITEMCHANGED for pList? OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResul...
TITLE: How to handle events for dynamically created objects in MFC? QUESTION: I am wondering how I can handle an event for a dynamically created variable, e.g. a list control. CListCtrl* pList = new CListCtrl(); pList->Create(...); How can I handle the event LVN_ITEMCHANGED for pList? OnLvnItemchangedList(NMHDR *pNMHD...
[ "c++", "events", "mfc" ]
0
1
3,621
1
0
2011-06-03T08:36:10.603000
2011-06-03T11:08:52.337000
6,224,792
6,224,887
Javascript - get strings inside a string
var str = '... text... '; I got a long string stored in var str, I need to extract the the strings inside div part="1". Can you help me please?
If you're using a library like JQuery, this is trivially easy without having to go through the horrors of parsing HTML with regex. Simply load the string into a JQuery object; then you'll be able to query it using selectors. It's as simple as this: var so = $(str).find('.so'); to get the class='so' elememnt. If you wan...
Javascript - get strings inside a string var str = '... text... '; I got a long string stored in var str, I need to extract the the strings inside div part="1". Can you help me please?
TITLE: Javascript - get strings inside a string QUESTION: var str = '... text... '; I got a long string stored in var str, I need to extract the the strings inside div part="1". Can you help me please? ANSWER: If you're using a library like JQuery, this is trivially easy without having to go through the horrors of pa...
[ "javascript", "regex" ]
1
3
640
2
0
2011-06-03T08:36:47.873000
2011-06-03T08:46:42.487000
6,224,804
6,225,109
problem in using jquery ajax
i dont know what is actual problem in the below code, but it doesn't work as i expected. In that test.php i simply tried to echo "hello world" or echo $_GET['action'] But none of this worked i got only empty message? can some one help me in this issue? Thanks!
There is no error in your code. But never pass your passwords using GET. I create two files test.html and test.php. Code of test.html: code of test.php:
problem in using jquery ajax i dont know what is actual problem in the below code, but it doesn't work as i expected. In that test.php i simply tried to echo "hello world" or echo $_GET['action'] But none of this worked i got only empty message? can some one help me in this issue? Thanks!
TITLE: problem in using jquery ajax QUESTION: i dont know what is actual problem in the below code, but it doesn't work as i expected. In that test.php i simply tried to echo "hello world" or echo $_GET['action'] But none of this worked i got only empty message? can some one help me in this issue? Thanks! ANSWER: The...
[ "ajax", "jquery" ]
0
2
106
2
0
2011-06-03T08:37:22.770000
2011-06-03T09:08:57.903000
6,224,806
6,224,880
iPad: will my book in HTML look the same on all iPads?
I am working on a beautiful book for the iPad together with an artist/designer, and we would like it to look perfect. I am using HTML to lay out the pages, and i noticed that they look slightly different in a browser, in a simulator and on the actual iPad (the paragraphs are broken into lines a bit differently, most pr...
You can never quite be 100% sure that a HTML page will look the same across all browsers on all platforms, although cross browser compatibility is generally improving with each browser version - those of us who have been doing this since the days of IE6 will remember those days with a shudder! What helps with the iPad ...
iPad: will my book in HTML look the same on all iPads? I am working on a beautiful book for the iPad together with an artist/designer, and we would like it to look perfect. I am using HTML to lay out the pages, and i noticed that they look slightly different in a browser, in a simulator and on the actual iPad (the para...
TITLE: iPad: will my book in HTML look the same on all iPads? QUESTION: I am working on a beautiful book for the iPad together with an artist/designer, and we would like it to look perfect. I am using HTML to lay out the pages, and i noticed that they look slightly different in a browser, in a simulator and on the act...
[ "html", "ipad" ]
0
2
113
2
0
2011-06-03T08:37:36.450000
2011-06-03T08:46:03.970000
6,224,808
6,225,128
Android crash dump
I have the following crash log and complete source code of app. All I see is call to abort in libc while calling free (which was probably called from libstdc++ delete which is not even shown.) How do I debug my problem? Any ideas? Can I use the information in code around pc, code around lr or addresses on stack in any ...
First you should get the symbols of your libc.so. You can find it under your "out" directory. after that run "nm –gCl libc.so", this will print out all the symbols in your lib, plus the addresses they were in. Compare those addresses with the addresses in your coredump, you will be able to recover the call stack at the...
Android crash dump I have the following crash log and complete source code of app. All I see is call to abort in libc while calling free (which was probably called from libstdc++ delete which is not even shown.) How do I debug my problem? Any ideas? Can I use the information in code around pc, code around lr or address...
TITLE: Android crash dump QUESTION: I have the following crash log and complete source code of app. All I see is call to abort in libc while calling free (which was probably called from libstdc++ delete which is not even shown.) How do I debug my problem? Any ideas? Can I use the information in code around pc, code ar...
[ "android", "crash-dumps" ]
0
0
3,234
1
0
2011-06-03T08:37:46.267000
2011-06-03T09:11:03.707000
6,224,822
6,224,924
How to use C functions from dll in .net(C#)?
If there's a dll written on C, then how is it possible to use it in.net(C#)? Is it strictly necessary to write a header file for it in order to data types be compatible between two languages?
You already know about P/invoke from your previous question. Regarding the header file, it's not used for managed interop. Instead the P/invoke declarations specify the function parameters, calling conventions etc.
How to use C functions from dll in .net(C#)? If there's a dll written on C, then how is it possible to use it in.net(C#)? Is it strictly necessary to write a header file for it in order to data types be compatible between two languages?
TITLE: How to use C functions from dll in .net(C#)? QUESTION: If there's a dll written on C, then how is it possible to use it in.net(C#)? Is it strictly necessary to write a header file for it in order to data types be compatible between two languages? ANSWER: You already know about P/invoke from your previous quest...
[ ".net", "dll", "types", "multilingual" ]
0
0
75
2
0
2011-06-03T08:39:21.700000
2011-06-03T08:50:16.847000
6,224,834
6,225,976
How to get the debuggee's command line in WinDbg?
Is there any extension command could to do so? I just want to the the whole command line including all parameters.
Information like the command line args are stored in the PEB (Process Environment Block). You can find a list of common commands here.!peb will display the PEB.
How to get the debuggee's command line in WinDbg? Is there any extension command could to do so? I just want to the the whole command line including all parameters.
TITLE: How to get the debuggee's command line in WinDbg? QUESTION: Is there any extension command could to do so? I just want to the the whole command line including all parameters. ANSWER: Information like the command line args are stored in the PEB (Process Environment Block). You can find a list of common commands...
[ "windbg" ]
10
19
7,360
2
0
2011-06-03T08:40:05.493000
2011-06-03T10:36:24.523000
6,224,836
6,224,918
test for generic method argument being a class
I have a generic method with this signature: private void MyGenericMethod (T arg) where T: class {} If I pass, say, an integer to this method, I get an ArgumentException that the passed value does not match the restriction. This is great, but how can I predetermine that what I am passing will match the "class" constrai...
The compiler will already do that for you - you should actually see: The type 'int' must be a reference type in order to use it as parameter 'T' in the generic type or method 'blah.MyGenericMethod(T)' at compile-time. The tricky scenarios are: generics upon generics upon generics - all those type-constraints stack, so ...
test for generic method argument being a class I have a generic method with this signature: private void MyGenericMethod (T arg) where T: class {} If I pass, say, an integer to this method, I get an ArgumentException that the passed value does not match the restriction. This is great, but how can I predetermine that wh...
TITLE: test for generic method argument being a class QUESTION: I have a generic method with this signature: private void MyGenericMethod (T arg) where T: class {} If I pass, say, an integer to this method, I get an ArgumentException that the passed value does not match the restriction. This is great, but how can I pr...
[ "c#", "generics", "constraints" ]
2
5
665
3
0
2011-06-03T08:40:08.080000
2011-06-03T08:49:34.320000
6,224,841
6,224,891
Determine I.P. Address of Referring Site
I am currently working on a marketing module that keeps track of sites that brings traffic to our site. Is there a way to get the domain or I.P. address of the referring site using PHP? I believe HTTP_REFERER does not always show up on the $_SERVER global.
The HTTP_REFERER header has to be sent by the client's browser. You can't rely on it being sent. Scenarios when it does not get sent include: The user enters the address by hand The user opens a link in one of the big E-Mail clients who go through great lengths to obscure the REFERER The user's browser is configured to...
Determine I.P. Address of Referring Site I am currently working on a marketing module that keeps track of sites that brings traffic to our site. Is there a way to get the domain or I.P. address of the referring site using PHP? I believe HTTP_REFERER does not always show up on the $_SERVER global.
TITLE: Determine I.P. Address of Referring Site QUESTION: I am currently working on a marketing module that keeps track of sites that brings traffic to our site. Is there a way to get the domain or I.P. address of the referring site using PHP? I believe HTTP_REFERER does not always show up on the $_SERVER global. ANS...
[ "php", "apache", "seo" ]
1
9
8,775
5
0
2011-06-03T08:40:46.217000
2011-06-03T08:46:58.920000
6,224,859
6,224,897
How to extract latitude and longitude values from the object of the class "google.maps.LatLng"?
directionsService.route (request, function (result, status) { alert(status); if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections (result); pointsArray = result.routes[0].overview_path; The problem is that the *result.routes[0].overview_path;* returns an array of type 'google.maps.LatLng'. ...
http://code.google.com/apis/maps/documentation/javascript/reference.html#LatLng The above link contains two methods: lat() and lng() which do solve the issue. The code for the same is as follows: function displayRoute () { var start = arrayMarkers [0]; var end = arrayMarkers [1]; var request = { origin:start, destinat...
How to extract latitude and longitude values from the object of the class "google.maps.LatLng"? directionsService.route (request, function (result, status) { alert(status); if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections (result); pointsArray = result.routes[0].overview_path; The probl...
TITLE: How to extract latitude and longitude values from the object of the class "google.maps.LatLng"? QUESTION: directionsService.route (request, function (result, status) { alert(status); if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections (result); pointsArray = result.routes[0].overvi...
[ "google-maps", "google-maps-api-3" ]
2
7
3,956
1
0
2011-06-03T08:42:41.247000
2011-06-03T08:47:59.543000
6,224,869
6,225,020
how to conditionally replace values in columns with value of specific column in the same line by Unix and awk commands
I want to conditionally replace values in columns with value of specific column in the same line in one file, by Unix and awk commands. For example, I have myfile.txt (3 lines, 5 columns, tab-delimited): 1 A. C. 2 C T. T 3 T C C. There are "." in columns 3 to 5. I want to replace those "." in columns 3 - 5 with the val...
This seems to do what you're asking for: % awk 'BEGIN { IFS = OFS = "\t" } { for (column = 3; column <= NF; ++column) { if ($column == ".") { $column = $2 } } print } ' test.tsv 1 A A C A 2 C T C T 3 T C C T You've asked a few questions (and accepted no answers!) on awk now. May I humbly suggest a tutorial?
how to conditionally replace values in columns with value of specific column in the same line by Unix and awk commands I want to conditionally replace values in columns with value of specific column in the same line in one file, by Unix and awk commands. For example, I have myfile.txt (3 lines, 5 columns, tab-delimited...
TITLE: how to conditionally replace values in columns with value of specific column in the same line by Unix and awk commands QUESTION: I want to conditionally replace values in columns with value of specific column in the same line in one file, by Unix and awk commands. For example, I have myfile.txt (3 lines, 5 colu...
[ "linux", "unix", "awk" ]
3
5
6,690
2
0
2011-06-03T08:44:02.943000
2011-06-03T09:01:49.623000
6,224,873
6,225,565
Problem with beep sound in iPad?
I am using the below code in my app to make a beep sound. Its working in my system iPad simulator (both 4.2 and 4.3). But it not making a beep sound in my iPad iOs 4.2. my code is: NSURL *tapSound = [[NSBundle mainBundle] URLForResource:@"BEEPJAZZ" withExtension: @"WAV"]; self.soundFileURLRef = (CFURLRef) [tapSound ret...
There is nothing wrong in your code. Still try to use following code. From one of my working project. NSString *tapSoundPath = [[NSBundle mainBundle] pathForResource:@"BEEPJAZZ" ofType:@"WAV"]; self.soundFileURLRef = (CFURLRef) [NSURL fileURLWithPath:tapSoundPath]; AudioServicesCreateSystemSoundID(knifeSoundUrl, &sound...
Problem with beep sound in iPad? I am using the below code in my app to make a beep sound. Its working in my system iPad simulator (both 4.2 and 4.3). But it not making a beep sound in my iPad iOs 4.2. my code is: NSURL *tapSound = [[NSBundle mainBundle] URLForResource:@"BEEPJAZZ" withExtension: @"WAV"]; self.soundFile...
TITLE: Problem with beep sound in iPad? QUESTION: I am using the below code in my app to make a beep sound. Its working in my system iPad simulator (both 4.2 and 4.3). But it not making a beep sound in my iPad iOs 4.2. my code is: NSURL *tapSound = [[NSBundle mainBundle] URLForResource:@"BEEPJAZZ" withExtension: @"WAV...
[ "iphone", "objective-c" ]
0
1
734
1
0
2011-06-03T08:44:26.083000
2011-06-03T09:56:13.223000
6,224,875
6,224,980
Equivalent of .try() for a hash to avoid "undefined method" errors on nil?
In Rails we can do the following in case a value doesn't exist to avoid an error: @myvar = @comment.try(:body) What is the equivalent when I'm digging deep into a hash and don't want to get an error? @myvar = session[:comments][@comment.id]["temp_value"] # [:comments] may or may not exist here In the above case, sessio...
You forgot to put a. before the try: @myvar = session[:comments].try(:[], @comment.id) since [] is the name of the method when you do [@comment.id].
Equivalent of .try() for a hash to avoid "undefined method" errors on nil? In Rails we can do the following in case a value doesn't exist to avoid an error: @myvar = @comment.try(:body) What is the equivalent when I'm digging deep into a hash and don't want to get an error? @myvar = session[:comments][@comment.id]["tem...
TITLE: Equivalent of .try() for a hash to avoid "undefined method" errors on nil? QUESTION: In Rails we can do the following in case a value doesn't exist to avoid an error: @myvar = @comment.try(:body) What is the equivalent when I'm digging deep into a hash and don't want to get an error? @myvar = session[:comments]...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "hash" ]
185
294
102,445
12
0
2011-06-03T08:44:47.890000
2011-06-03T08:57:35.630000
6,224,883
6,224,960
POST form inside an asp.net web page
A client of mine has asked for a 3rd party form to be integrated into their ASP.NET website. I've been instructed to simply copy the 3rd party code into the site where needed. However, the code is a form such as:..... As the site is an ASP.NET website the body tag looks like this:...All code here... Therefore I cannot ...
Throw the third-party form into a separate page and embed it in your page within an iframe.
POST form inside an asp.net web page A client of mine has asked for a 3rd party form to be integrated into their ASP.NET website. I've been instructed to simply copy the 3rd party code into the site where needed. However, the code is a form such as:..... As the site is an ASP.NET website the body tag looks like this:.....
TITLE: POST form inside an asp.net web page QUESTION: A client of mine has asked for a 3rd party form to be integrated into their ASP.NET website. I've been instructed to simply copy the 3rd party code into the site where needed. However, the code is a form such as:..... As the site is an ASP.NET website the body tag ...
[ "asp.net", "forms", "webforms", "asp.net-3.5", "http-post" ]
1
2
2,517
1
0
2011-06-03T08:46:24.463000
2011-06-03T08:54:54.970000
6,224,888
6,286,730
IE9 Background Image border outline (removal)
I made a page background with an image cut into small pieces to generate the background. However in internet explorer 9 I have issues with the background images having an outline. This does not occur in Firefox 4 or Chrome. What's the CSS property to remove this?.bottomright {background-image: url(../Images/Forms/form1...
http://jsfiddle.net/gNSuj/2/ In IE9, the above jfiddle isn't showing an outline. Only time I've seen it apply the outline is on links (including image links) and to get rid of that you add- a:active, a:focus { outline: none; }
IE9 Background Image border outline (removal) I made a page background with an image cut into small pieces to generate the background. However in internet explorer 9 I have issues with the background images having an outline. This does not occur in Firefox 4 or Chrome. What's the CSS property to remove this?.bottomrigh...
TITLE: IE9 Background Image border outline (removal) QUESTION: I made a page background with an image cut into small pieces to generate the background. However in internet explorer 9 I have issues with the background images having an outline. This does not occur in Firefox 4 or Chrome. What's the CSS property to remov...
[ "asp.net", "html", "css", "internet-explorer" ]
0
1
2,074
1
0
2011-06-03T08:46:43.113000
2011-06-09T00:12:59.063000
6,224,889
6,262,836
IE6 vs IE8, button vs hyperlink, CSS rendering issue
Given the following sample form code and CSS stylesheet Form Keane's delegate view Keane's delegate view css.button_red2 { background:url('../../images/button_red_left.gif') no-repeat left top; display:inline; float:left; font-size:12px; font-weight:bold; line-height:16px; height:21px; padding-left:9px; text-decoration...
I think it is caused by the button bug in IE which is rendered too wide. Have a look at this article: http://latrine.dgx.cz/the-stretched-buttons-problem-in-ie
IE6 vs IE8, button vs hyperlink, CSS rendering issue Given the following sample form code and CSS stylesheet Form Keane's delegate view Keane's delegate view css.button_red2 { background:url('../../images/button_red_left.gif') no-repeat left top; display:inline; float:left; font-size:12px; font-weight:bold; line-height...
TITLE: IE6 vs IE8, button vs hyperlink, CSS rendering issue QUESTION: Given the following sample form code and CSS stylesheet Form Keane's delegate view Keane's delegate view css.button_red2 { background:url('../../images/button_red_left.gif') no-repeat left top; display:inline; float:left; font-size:12px; font-weight...
[ "asp.net", "css", "internet-explorer-8", "internet-explorer-6", "sliding-doors" ]
4
1
1,136
1
0
2011-06-03T08:46:50.970000
2011-06-07T08:53:40.783000
6,224,893
6,225,804
replace english quotes to german quotes
is there a way to implement german quotes (so-called 'Gänsefüßchen') „ („) and “ (“) in a function to convert english-quoted strings like I say "Hallo" to I say „Hallo“ the „ should only apply at the beginning, the “ at the end of an string.
Here is the function, tested and works fine. Note: the „ applies only at the beginning, the ” only at the end of an string. (hsz's solution isn't following that rule) function germanquotes($text){ $size = strlen($text); $i=0; $replace = array(); $replace['one'] = array(); $replace['two'] = array(); while($i < $size) { ...
replace english quotes to german quotes is there a way to implement german quotes (so-called 'Gänsefüßchen') „ („) and “ (“) in a function to convert english-quoted strings like I say "Hallo" to I say „Hallo“ the „ should only apply at the beginning, the “ at the end of an string.
TITLE: replace english quotes to german quotes QUESTION: is there a way to implement german quotes (so-called 'Gänsefüßchen') „ („) and “ (“) in a function to convert english-quoted strings like I say "Hallo" to I say „Hallo“ the „ should only apply at the beginning, the “ at the end of an string. ANSWER: Here is the...
[ "php", "internationalization", "replace" ]
5
2
1,080
5
0
2011-06-03T08:47:05.717000
2011-06-03T10:19:41.257000
6,224,899
6,229,141
SerializeJSON doesn't encode UTF8 characters in ColdFusion 9
I'm having some issues with ColdFusion and JSON. My users have filenames and other key words with characters like ç in them which is causing me a pain when I have to pass them back via JSON. When I use the magic JSON command on my variable: #Trim(SerializeJSON(variables.arrGallery))# The character that gets spit out is...
You need to specify the Character Set in your CFCONTENT tag. I tried this code in Google Chrome without charset and it returned the text correctly. However, FireFox 3.6 returned the incorrect characters you listed. This correctly returns the UTF-8 characters in Chrome, FireFox and MSIE:
SerializeJSON doesn't encode UTF8 characters in ColdFusion 9 I'm having some issues with ColdFusion and JSON. My users have filenames and other key words with characters like ç in them which is causing me a pain when I have to pass them back via JSON. When I use the magic JSON command on my variable: #Trim(SerializeJSO...
TITLE: SerializeJSON doesn't encode UTF8 characters in ColdFusion 9 QUESTION: I'm having some issues with ColdFusion and JSON. My users have filenames and other key words with characters like ç in them which is causing me a pain when I have to pass them back via JSON. When I use the magic JSON command on my variable: ...
[ "json", "coldfusion", "coldfusion-9" ]
8
8
3,129
2
0
2011-06-03T08:48:00.353000
2011-06-03T15:29:16.010000
6,224,909
6,224,982
How to show current location in android mapview with accuracy?
I am working on an android geolocation app. In that I have added marker at current position in map and I have set accuracy as 10 meters but only sometimes it shows accurate current location otherwise it shows next building to current building. I am using NetworkProvider for that.
Use GPS Provider, typically its more accurate than Network provider. Network provider uses cell-id loation to track your position
How to show current location in android mapview with accuracy? I am working on an android geolocation app. In that I have added marker at current position in map and I have set accuracy as 10 meters but only sometimes it shows accurate current location otherwise it shows next building to current building. I am using Ne...
TITLE: How to show current location in android mapview with accuracy? QUESTION: I am working on an android geolocation app. In that I have added marker at current position in map and I have set accuracy as 10 meters but only sometimes it shows accurate current location otherwise it shows next building to current build...
[ "android", "geolocation" ]
0
0
938
1
0
2011-06-03T08:48:53.187000
2011-06-03T08:57:53.010000
6,224,914
6,251,560
Problem running multiple scripts from Greasemonkey4IE
//================MyJs.js========================= var objGreeting = { Greetings: function() { toolbardiv = document.createElement('toolbardiv'); // create div tag dynamically toolbardiv.setAttribute('id',"toolbar"); // give id to it toolbardiv.className="top"; // set the style classname //set the inner styling of the...
To have your script insert JS dynamically, you can use something like the following: function addJS_Node (text, s_URL) { var scriptNode = document.createElement ('script'); scriptNode.type = "text/javascript"; if (text) scriptNode.textContent = text; if (s_URL) scriptNode.src = s_URL; document.head.appendChild (scrip...
Problem running multiple scripts from Greasemonkey4IE //================MyJs.js========================= var objGreeting = { Greetings: function() { toolbardiv = document.createElement('toolbardiv'); // create div tag dynamically toolbardiv.setAttribute('id',"toolbar"); // give id to it toolbardiv.className="top"; // s...
TITLE: Problem running multiple scripts from Greasemonkey4IE QUESTION: //================MyJs.js========================= var objGreeting = { Greetings: function() { toolbardiv = document.createElement('toolbardiv'); // create div tag dynamically toolbardiv.setAttribute('id',"toolbar"); // give id to it toolbardiv.cla...
[ "javascript", "internet-explorer", "greasemonkey" ]
1
1
123
1
0
2011-06-03T08:49:18.327000
2011-06-06T11:48:10.563000
6,224,916
6,224,973
How to restrict the focus of JFrame in Swing?
I have a parent JFrame it contain a JButton. functionality of that button is to open another window. I want to restrict the focus of window, means after closing the second window's focus should come into first window(parent). And focus should not come to first window if second window is open.
You should make your second window modal. That said, you'd probably want to make it a JDialog.
How to restrict the focus of JFrame in Swing? I have a parent JFrame it contain a JButton. functionality of that button is to open another window. I want to restrict the focus of window, means after closing the second window's focus should come into first window(parent). And focus should not come to first window if sec...
TITLE: How to restrict the focus of JFrame in Swing? QUESTION: I have a parent JFrame it contain a JButton. functionality of that button is to open another window. I want to restrict the focus of window, means after closing the second window's focus should come into first window(parent). And focus should not come to f...
[ "java", "swing", "windowlistener" ]
1
1
1,017
3
0
2011-06-03T08:49:29.563000
2011-06-03T08:57:16.223000
6,224,919
6,225,096
Question regarding java syntax used in android development
I was reading a beginners tutorial on android development which had this line in it's code: TextView fortune = (TextView) findViewById(R.id.fortune_text); I'm fairly new to Java, but I understand the basics of creating variables. So making a new int variable: int someInt = 4; Looks a bit different from what is going on...
The casting in your example has to do with inheritance. The method findViewById returns an instance/object of the class View - i.e. it returns a View/widget. TextView, which is the kind of object you want to get access to, is a subclass of View. The casting bit - (TextView) - is your way to inform the compiler of your ...
Question regarding java syntax used in android development I was reading a beginners tutorial on android development which had this line in it's code: TextView fortune = (TextView) findViewById(R.id.fortune_text); I'm fairly new to Java, but I understand the basics of creating variables. So making a new int variable: i...
TITLE: Question regarding java syntax used in android development QUESTION: I was reading a beginners tutorial on android development which had this line in it's code: TextView fortune = (TextView) findViewById(R.id.fortune_text); I'm fairly new to Java, but I understand the basics of creating variables. So making a n...
[ "java", "android", "syntax" ]
0
3
446
5
0
2011-06-03T08:49:57.240000
2011-06-03T09:08:19.980000
6,224,925
6,224,942
How to compress javascript?
Possible Duplicate: How can I obfuscate JavaScript? Hi, I want to compress a JavaScript code but not just to remove whitespaces also I want to change all variable names to unintelligible names. How can I provide this? Thanks in advance,
just to add a bit http://code.google.com/closure/ can also be used
How to compress javascript? Possible Duplicate: How can I obfuscate JavaScript? Hi, I want to compress a JavaScript code but not just to remove whitespaces also I want to change all variable names to unintelligible names. How can I provide this? Thanks in advance,
TITLE: How to compress javascript? QUESTION: Possible Duplicate: How can I obfuscate JavaScript? Hi, I want to compress a JavaScript code but not just to remove whitespaces also I want to change all variable names to unintelligible names. How can I provide this? Thanks in advance, ANSWER: just to add a bit http://cod...
[ "javascript" ]
5
0
1,905
10
0
2011-06-03T08:50:20.433000
2011-06-03T08:52:15.243000
6,224,929
6,235,840
Are there any placeholder numbers in a programming context?
The terms foobar, foo, bar, baz and qux are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation....As stated here. Are there any placeholders for numbers? Update: To be more clear, here are some examples where it would be useful to ...
This Wikipedia article lists many magic numbers, in particular the famous DEADBEEF. However, it's often a bad practice to use magic numbers since they don't have a common meaning, so they aren't used as often as 'foo' or 'bar' (except, maybe, hex addressed like DEADBEEF). I tend to use all zeros or 1234567890 for thing...
Are there any placeholder numbers in a programming context? The terms foobar, foo, bar, baz and qux are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation....As stated here. Are there any placeholders for numbers? Update: To be mor...
TITLE: Are there any placeholder numbers in a programming context? QUESTION: The terms foobar, foo, bar, baz and qux are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation....As stated here. Are there any placeholders for numbers?...
[ "language-agnostic", "placeholder" ]
2
2
901
2
0
2011-06-03T08:51:14.333000
2011-06-04T09:11:06.253000
6,224,934
6,225,049
Use cached data on an action filter, to avoid another execution of an action
I would like to do the following (i will split in two points): Before execution of the action, if the viewmodel is in cache then return the view and the viewmodel without execute the action. If is not in the cache, continue with the execution of the action, and reach the OnActionExecuted to put the viewmodel in cache. ...
public override void OnActionExecuting(ActionExecutingContext filterContext) { var model = filterContext.HttpContext.Cache["viewmodel"]; if (model!= null) { var result = new ViewResult(); result.ViewData.Model = model; filterContext.Result = result; } }
Use cached data on an action filter, to avoid another execution of an action I would like to do the following (i will split in two points): Before execution of the action, if the viewmodel is in cache then return the view and the viewmodel without execute the action. If is not in the cache, continue with the execution ...
TITLE: Use cached data on an action filter, to avoid another execution of an action QUESTION: I would like to do the following (i will split in two points): Before execution of the action, if the viewmodel is in cache then return the view and the viewmodel without execute the action. If is not in the cache, continue w...
[ "asp.net-mvc", "action-filter" ]
6
7
1,993
1
0
2011-06-03T08:51:40.463000
2011-06-03T09:04:22.897000
6,224,937
6,225,012
attachment of file in compose mail in iphone
I am making a window based application. In this I have put some entries which become record for one person now I have put mailcomposer to send mail but I want to send the record in mail of that person in attachment automatically. Can I set document or excel file in mailcomposer in iphone application. If anyone know ple...
The MFMailComposeViewController protocol defines the method you need. Using the method - (void)addAttachmentData:(NSData *)attachment mimeType:(NSString *)mimeType fileName:(NSString *)filename __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); you can easily add any kind of file as an attachment to the mail. The easiest...
attachment of file in compose mail in iphone I am making a window based application. In this I have put some entries which become record for one person now I have put mailcomposer to send mail but I want to send the record in mail of that person in attachment automatically. Can I set document or excel file in mailcompo...
TITLE: attachment of file in compose mail in iphone QUESTION: I am making a window based application. In this I have put some entries which become record for one person now I have put mailcomposer to send mail but I want to send the record in mail of that person in attachment automatically. Can I set document or excel...
[ "iphone" ]
1
5
540
1
0
2011-06-03T08:51:52.383000
2011-06-03T09:01:12.300000
6,224,939
6,225,080
Metro styled Silverlight Applications
Is there any guidance available on developing Metro styled silverlight applications? How does one go about designing the UI to match the metro look and feel of WP7. Going by the way windows 8's UI & UX is, I assume the future of how we develop applications for the future versions of the win OS might be changing to look...
As you know Metro is not tied to any technology. You can reference WP7 UI guidelines to get some hints; a new version of the guideline is available from Microsoft web site. For Silverlight 4, you can download themes from Microsoft http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e9da0eb8-f31b-4490-85b8-92c2f...
Metro styled Silverlight Applications Is there any guidance available on developing Metro styled silverlight applications? How does one go about designing the UI to match the metro look and feel of WP7. Going by the way windows 8's UI & UX is, I assume the future of how we develop applications for the future versions o...
TITLE: Metro styled Silverlight Applications QUESTION: Is there any guidance available on developing Metro styled silverlight applications? How does one go about designing the UI to match the metro look and feel of WP7. Going by the way windows 8's UI & UX is, I assume the future of how we develop applications for the...
[ "silverlight-4.0", "expression-blend", "silverlight-toolkit", "windows-8", "microsoft-metro" ]
7
7
3,604
3
0
2011-06-03T08:51:58.247000
2011-06-03T09:06:56.657000
6,224,957
6,225,156
Import data from txt to Mathematica
Consider the following list in mathematica: a = { { {0, 0, 0}, {1, 0, 0}, {1, 1, 0} }, { {0, 0, 1}, {1, 0, 1}, {1, 1, 1} } }; Now, invoke: Export["test.dat", a] and then b = Import["test.dat"] You will see that at the end a doesn't equal b. Should I consider this as a feature or a bug? Furthermore, I would like to impo...
You should specify the exact format that you need to import/export in, otherwise Mathematica might not be able to guess the correct format. So your question boils down to what textual format is suitable for storing 3D arrays? If you work with Mathematica, probably the easiest thing to do is exporting the expression usi...
Import data from txt to Mathematica Consider the following list in mathematica: a = { { {0, 0, 0}, {1, 0, 0}, {1, 1, 0} }, { {0, 0, 1}, {1, 0, 1}, {1, 1, 1} } }; Now, invoke: Export["test.dat", a] and then b = Import["test.dat"] You will see that at the end a doesn't equal b. Should I consider this as a feature or a bu...
TITLE: Import data from txt to Mathematica QUESTION: Consider the following list in mathematica: a = { { {0, 0, 0}, {1, 0, 0}, {1, 1, 0} }, { {0, 0, 1}, {1, 0, 1}, {1, 1, 1} } }; Now, invoke: Export["test.dat", a] and then b = Import["test.dat"] You will see that at the end a doesn't equal b. Should I consider this as...
[ "import", "wolfram-mathematica", "data-import" ]
5
5
6,186
4
0
2011-06-03T08:54:04.490000
2011-06-03T09:14:16.013000
6,224,958
6,224,974
WPF TextBox with SpellCheck.IsEnabled="True" - No SpellChecking happening?
I just wanted to play around with WPF SpellCheck a little, but although the Attached Property is set, there's no underlining of whatever I type. SpellCheck.IsEnabled="True" If I remember correctly, SpellCheck is supposed to add Menu Items to my ContextMenu as well, isn't it? That doesn't happen either... BTW, my machin...
Make sure the required language pack is installed. refer this post for more info. http://social.msdn.microsoft.com/Forums/en/wpf/thread/c4a62da5-9a7d-4e1d-bcbc-12945046fc42
WPF TextBox with SpellCheck.IsEnabled="True" - No SpellChecking happening? I just wanted to play around with WPF SpellCheck a little, but although the Attached Property is set, there's no underlining of whatever I type. SpellCheck.IsEnabled="True" If I remember correctly, SpellCheck is supposed to add Menu Items to my ...
TITLE: WPF TextBox with SpellCheck.IsEnabled="True" - No SpellChecking happening? QUESTION: I just wanted to play around with WPF SpellCheck a little, but although the Attached Property is set, there's no underlining of whatever I type. SpellCheck.IsEnabled="True" If I remember correctly, SpellCheck is supposed to add...
[ ".net", "wpf", "spell-checking" ]
7
11
11,566
1
0
2011-06-03T08:54:25.070000
2011-06-03T08:57:21.290000
6,224,959
6,225,136
how to implement Network Reachebility status in multiple files?
I am using readability class to check network availability and it works fine with this code. But in my app I am having approx 25 view that needs to check the network. I need to know that do I have to write pieces of code in every file? or is there any way to write it once? In the code there is 3 methods that I have to ...
You can use this sample application for your requirement. Provided by APPLE. In this they have kept it under Application Delegate to be available to all the classes. Hope it helps.
how to implement Network Reachebility status in multiple files? I am using readability class to check network availability and it works fine with this code. But in my app I am having approx 25 view that needs to check the network. I need to know that do I have to write pieces of code in every file? or is there any way ...
TITLE: how to implement Network Reachebility status in multiple files? QUESTION: I am using readability class to check network availability and it works fine with this code. But in my app I am having approx 25 view that needs to check the network. I need to know that do I have to write pieces of code in every file? or...
[ "iphone", "ios4" ]
0
4
206
3
0
2011-06-03T08:54:27.473000
2011-06-03T09:12:02.493000
6,224,968
6,230,120
Calling parent method within a parent method
I have 2 classes, lets call them parentClass and childClass. parentClass has two methods, lets call them firstMethods and secondMethods. childClass inherits parentClass and implements firstMethod. parentClass implements both methods. And here is my problem. In my parentClass in side of secondMethods I want to call firs...
You dont. Change your design. To explain this here is a some code. (My example uses ruby because it's easy to read for almost any programmer, but this is not a ObjC question, its about classes and inheritance). class A def one "one" end def two self.one + "-two" end end class B < A def one "B-"+ super end end a = A.n...
Calling parent method within a parent method I have 2 classes, lets call them parentClass and childClass. parentClass has two methods, lets call them firstMethods and secondMethods. childClass inherits parentClass and implements firstMethod. parentClass implements both methods. And here is my problem. In my parentClass...
TITLE: Calling parent method within a parent method QUESTION: I have 2 classes, lets call them parentClass and childClass. parentClass has two methods, lets call them firstMethods and secondMethods. childClass inherits parentClass and implements firstMethod. parentClass implements both methods. And here is my problem....
[ "objective-c", "inheritance" ]
1
1
319
2
0
2011-06-03T08:56:39.937000
2011-06-03T16:46:20.090000
6,224,970
6,225,203
Solving equation. Counting (x,y)
I'm having a trouble with my math: Assume that we have a function: F(x,y) = P; And my question is: what would be the most efficient way of counting up suitable (x,y) plots for this function? It means that I don't need the coordinates themself, but I need a number of them. P is in a range: [0; 10^14]. "x" and "y" are in...
x*y - ((x+y)/2) + 1 == P is equivalent to (2x-1)(2y-1) == (4P-3). So, you're basically looking for the number of factorizations of 4P-3. How to factor a number in C or C++ is probably a different question, but each factorization yields a solution to the original equation. [Edit: in fact two solutions, since if A*B == C...
Solving equation. Counting (x,y) I'm having a trouble with my math: Assume that we have a function: F(x,y) = P; And my question is: what would be the most efficient way of counting up suitable (x,y) plots for this function? It means that I don't need the coordinates themself, but I need a number of them. P is in a rang...
TITLE: Solving equation. Counting (x,y) QUESTION: I'm having a trouble with my math: Assume that we have a function: F(x,y) = P; And my question is: what would be the most efficient way of counting up suitable (x,y) plots for this function? It means that I don't need the coordinates themself, but I need a number of th...
[ "c++", "c", "math", "equation-solving" ]
3
10
1,435
2
0
2011-06-03T08:56:48.033000
2011-06-03T09:20:25.717000
6,224,975
6,225,331
NSXMLParser & Problem
My xml is Baby 244 Boats & Watercraft 1026 I am getting first two nodes.My problem is the third node i am getting Boats only (parser foundCharacters) and & kills the nsxmlparser. I am searching this forum and other websites most of them post use & instead of & in xml. My xml is coming from server and i wont update xml ...
If you insist on sending invalid XML from your server this should solve it: [xmlString stringByReplacingOccurrencesOfString:@"&" withString:@"&"]: // parse xmlString [categoryName stringByReplacingOccurrencesOfString:@"&" withString:@"&"]:
NSXMLParser & Problem My xml is Baby 244 Boats & Watercraft 1026 I am getting first two nodes.My problem is the third node i am getting Boats only (parser foundCharacters) and & kills the nsxmlparser. I am searching this forum and other websites most of them post use & instead of & in xml. My xml is coming from server ...
TITLE: NSXMLParser & Problem QUESTION: My xml is Baby 244 Boats & Watercraft 1026 I am getting first two nodes.My problem is the third node i am getting Boats only (parser foundCharacters) and & kills the nsxmlparser. I am searching this forum and other websites most of them post use & instead of & in xml. My xml is c...
[ "iphone", "objective-c", "nsxmlparser" ]
3
3
892
2
0
2011-06-03T08:57:22.057000
2011-06-03T09:34:18.653000
6,224,978
6,225,064
Android sort array
i have a string array consisting of a name and a score. I want to sort that array by score. Problem is, considering it's a string array, the scores are strings which results in 13,16,2,5,6 and not 2,5,6,13,16. I am using this code: int spaceIndex; String[][] scoreboard; String[] playername; String[] score; int sbsize; ...
Cast them to int. As I recall, something like... Arrays.sort(scoreboard, new Comparator () { @Override public int compare(String[] entry1, String[] entry2) { Integer time1 = Integer.valueOf(entry1[1]); Integer time2 = Integer.valueOf(entry2[1]); return time1.compareTo(time2); } }); Also you can make simple value object...
Android sort array i have a string array consisting of a name and a score. I want to sort that array by score. Problem is, considering it's a string array, the scores are strings which results in 13,16,2,5,6 and not 2,5,6,13,16. I am using this code: int spaceIndex; String[][] scoreboard; String[] playername; String[] ...
TITLE: Android sort array QUESTION: i have a string array consisting of a name and a score. I want to sort that array by score. Problem is, considering it's a string array, the scores are strings which results in 13,16,2,5,6 and not 2,5,6,13,16. I am using this code: int spaceIndex; String[][] scoreboard; String[] pla...
[ "java", "arrays", "sorting" ]
9
19
37,563
8
0
2011-06-03T08:57:28.017000
2011-06-03T09:05:52.553000
6,224,985
6,225,021
Calling Js script function from external Scripts
Am trying to call a JS script from a function library in another script. Eg. iceCreams.Js contains ---> iceCream(iceCreams){ var profit =.54 var Total = iceCreams * profits return Total; } register.js contains --> dailyTotals(wages, iceCreams){ var total = iceCream(iceCreams); var profit = iceCreaps - wages retur...
Running the javascripts is done in client side and after rendering the full html. So, you have to add script tag for the library javascripts before consuming ones. Just add script tag for the library before the one for register:
Calling Js script function from external Scripts Am trying to call a JS script from a function library in another script. Eg. iceCreams.Js contains ---> iceCream(iceCreams){ var profit =.54 var Total = iceCreams * profits return Total; } register.js contains --> dailyTotals(wages, iceCreams){ var total = iceCream(i...
TITLE: Calling Js script function from external Scripts QUESTION: Am trying to call a JS script from a function library in another script. Eg. iceCreams.Js contains ---> iceCream(iceCreams){ var profit =.54 var Total = iceCreams * profits return Total; } register.js contains --> dailyTotals(wages, iceCreams){ var ...
[ "javascript", "function" ]
1
1
3,673
3
0
2011-06-03T08:58:12.823000
2011-06-03T09:01:57.670000
6,224,995
6,226,984
Problems with Firefox 4 new click event behavior
I have a problem with the behavior of Firefox 4 in regards to parameters passed to the function that is getting called upon a click event. Take a look at this example: Klick mich! If you open this with Firefox 4 the result is: 1 2,3 object MouseEvent undefined In any other browser the result is: 1 2 3 undefined As you ...
the problem is - this is mootools 1.11 - UNSUPPORTED AND OLD in mootools 1.11, it was accepted to use ( http://docs111.mootools.net/Native/Function.js#Function.bind ): bind optional, the object that the “this” of the function will refer to. args optional, the arguments passed. must be an array if arguments > 1 hence, d...
Problems with Firefox 4 new click event behavior I have a problem with the behavior of Firefox 4 in regards to parameters passed to the function that is getting called upon a click event. Take a look at this example: Klick mich! If you open this with Firefox 4 the result is: 1 2,3 object MouseEvent undefined In any oth...
TITLE: Problems with Firefox 4 new click event behavior QUESTION: I have a problem with the behavior of Firefox 4 in regards to parameters passed to the function that is getting called upon a click event. Take a look at this example: Klick mich! If you open this with Firefox 4 the result is: 1 2,3 object MouseEvent un...
[ "javascript", "firefox", "mootools", "click", "mouseclick-event" ]
2
1
567
1
0
2011-06-03T08:59:08.330000
2011-06-03T12:17:40.573000
6,224,997
6,225,288
Is there a way to access Stata from eclipse?
… similar to the StatET plugin that allows you to run R code from Eclipse? I tried googling it but nothing useful has turned up.
None that I know. If you're a CLI junky or willing to use Emacs, you might find limited support through the ESS package and the ado-mode. This is what I used on Mac OS X when I want to run short snippet of code, or use Stata in batch mode, but there's no interactive graphical output (you can just save graphics as PDF a...
Is there a way to access Stata from eclipse? … similar to the StatET plugin that allows you to run R code from Eclipse? I tried googling it but nothing useful has turned up.
TITLE: Is there a way to access Stata from eclipse? QUESTION: … similar to the StatET plugin that allows you to run R code from Eclipse? I tried googling it but nothing useful has turned up. ANSWER: None that I know. If you're a CLI junky or willing to use Emacs, you might find limited support through the ESS package...
[ "eclipse", "eclipse-plugin", "stata" ]
2
2
720
2
0
2011-06-03T08:59:45.223000
2011-06-03T09:30:08.573000
6,225,013
6,226,763
How do I make MySQL return UTF-8?
I'm using PHPUnit to validate XML output from my PHP code, but apparently I have problems with the character encoding MySQL returns. Here is the error I get from DOMDocument: Input is not proper UTF-8, indicate encoding! Bytes: 0xE9 0x20 0x42 0x65 I initialize the DOMDocument so it uses the correct encoding: $domDocume...
You have to define the connection to your database as UTF-8: // Set up your connection $connection = mysql_connect('localhost', 'user', 'pw'); mysql_select_db('yourdb', $connection); mysql_query("SET NAMES 'utf8'", $connection); // Now you get UTF-8 encoded stuff $query = sprintf('SELECT name FROM place where id = 1')...
How do I make MySQL return UTF-8? I'm using PHPUnit to validate XML output from my PHP code, but apparently I have problems with the character encoding MySQL returns. Here is the error I get from DOMDocument: Input is not proper UTF-8, indicate encoding! Bytes: 0xE9 0x20 0x42 0x65 I initialize the DOMDocument so it use...
TITLE: How do I make MySQL return UTF-8? QUESTION: I'm using PHPUnit to validate XML output from my PHP code, but apparently I have problems with the character encoding MySQL returns. Here is the error I get from DOMDocument: Input is not proper UTF-8, indicate encoding! Bytes: 0xE9 0x20 0x42 0x65 I initialize the DOM...
[ "php", "xml", "utf-8", "character-encoding" ]
22
53
56,862
2
0
2011-06-03T09:01:12.527000
2011-06-03T11:52:30.370000
6,225,031
6,225,168
Do I need a handler?
I am working on an Android application and I have a question. I have a listener class that runs on back ground periodically and get data from my server. I want to add that data into a data structure in the main thread. In this case, I am not touch the main U.I. but I was wondering if I should use a handler to add the d...
One way to do that (but there are others) is to use a list view and a cursor (it means you should use a database). When you receive data from server (in your background thread), you add them to the database. On the UI thread, you register a ContentObserver to be notified when data is added. When you're notified, you ju...
Do I need a handler? I am working on an Android application and I have a question. I have a listener class that runs on back ground periodically and get data from my server. I want to add that data into a data structure in the main thread. In this case, I am not touch the main U.I. but I was wondering if I should use a...
TITLE: Do I need a handler? QUESTION: I am working on an Android application and I have a question. I have a listener class that runs on back ground periodically and get data from my server. I want to add that data into a data structure in the main thread. In this case, I am not touch the main U.I. but I was wondering...
[ "android" ]
0
0
57
1
0
2011-06-03T09:02:44.410000
2011-06-03T09:16:15.317000
6,225,034
6,225,296
Payment gateway possible issues
I have implemented 2 payment gateways in my app (paypal and datatrans). In both gateways payment happens on gateway site i.e. user is redirected to payment gateway site where he pays and then redirected back to our site. I have identified some scenarios where there is some issue in entire payment flow. E.g. lost intern...
Double payment. To avoid them you need to create a unique ID for every order, after the user move from your site to the paypal or other site, this ID must be read-only, and if the user return to your site after fail or other reason, and ask to re-order the same cart, you must create a new cart, and a new order ID. For ...
Payment gateway possible issues I have implemented 2 payment gateways in my app (paypal and datatrans). In both gateways payment happens on gateway site i.e. user is redirected to payment gateway site where he pays and then redirected back to our site. I have identified some scenarios where there is some issue in entir...
TITLE: Payment gateway possible issues QUESTION: I have implemented 2 payment gateways in my app (paypal and datatrans). In both gateways payment happens on gateway site i.e. user is redirected to payment gateway site where he pays and then redirected back to our site. I have identified some scenarios where there is s...
[ "asp.net", "exception", "paypal", "payment-gateway" ]
0
3
1,910
1
0
2011-06-03T09:02:55.253000
2011-06-03T09:31:28.867000
6,225,041
6,225,140
Finding types after ilmerge
Let's say that I do ilmerge on assembly1 and assembly2. Can I use Assembly.GetExecutingAssembly.GetTypes() from assembly1 to find a type in assembly2 when running the merged assembly?
Since the types are now contained in a new assembly which has been rewritten the executing (assembly of the declaring type) is the new assembly. If you try to run the code you should see that it works fine.
Finding types after ilmerge Let's say that I do ilmerge on assembly1 and assembly2. Can I use Assembly.GetExecutingAssembly.GetTypes() from assembly1 to find a type in assembly2 when running the merged assembly?
TITLE: Finding types after ilmerge QUESTION: Let's say that I do ilmerge on assembly1 and assembly2. Can I use Assembly.GetExecutingAssembly.GetTypes() from assembly1 to find a type in assembly2 when running the merged assembly? ANSWER: Since the types are now contained in a new assembly which has been rewritten the ...
[ ".net", "reflection", "ilmerge" ]
1
1
183
1
0
2011-06-03T09:03:41.430000
2011-06-03T09:12:17.050000
6,225,043
6,225,102
How to call function with correct argument in jQuery-resizable object which is creating in a loop?
I've couple of resizable objects and I'd like to trigger function 'changeS()' when I stop resizing the object. Function changeS() should takes as first argument the name of the object for which it's called. I mean: when I stop resizing object "#resizable0" then should be called changeS(#resizable0,new_size - old_size),...
The functions you're creating in the loop are closures. They keep an enduring reference to the variables they close over, not a copy of the value as of when the function is defined. And so all of them see the last value you assign to $res, not the value during "their" loop. The usual way to solve this is to use a facto...
How to call function with correct argument in jQuery-resizable object which is creating in a loop? I've couple of resizable objects and I'd like to trigger function 'changeS()' when I stop resizing the object. Function changeS() should takes as first argument the name of the object for which it's called. I mean: when I...
TITLE: How to call function with correct argument in jQuery-resizable object which is creating in a loop? QUESTION: I've couple of resizable objects and I'd like to trigger function 'changeS()' when I stop resizing the object. Function changeS() should takes as first argument the name of the object for which it's call...
[ "javascript", "jquery", "jquery-ui", "jquery-resizable" ]
0
1
342
1
0
2011-06-03T09:03:45.037000
2011-06-03T09:08:46.267000
6,225,045
6,225,100
Please explain this PHP syntax
I've looked up the functions in the manual, but I still don't get this. According to the person who wrote the code, if the User enters "y" then the function (not shown here) will execute. However, because of the!, it looks to me like the function (not shown here) will execute if the user enters something other than "y"...
fgets(STDIN) - reads a string from standard input(keyboard in your case). trim - removes any spaces surrounding the user input. So if the user enters ' y' or a 'y ', it'll be converted to 'y' strncasecmp - The user might enter either uppercase Y or lowercase y, this function helps you to compare case insensitive way. A...
Please explain this PHP syntax I've looked up the functions in the manual, but I still don't get this. According to the person who wrote the code, if the User enters "y" then the function (not shown here) will execute. However, because of the!, it looks to me like the function (not shown here) will execute if the user ...
TITLE: Please explain this PHP syntax QUESTION: I've looked up the functions in the manual, but I still don't get this. According to the person who wrote the code, if the User enters "y" then the function (not shown here) will execute. However, because of the!, it looks to me like the function (not shown here) will ex...
[ "php", "if-statement", "string-comparison" ]
3
10
217
2
0
2011-06-03T09:03:52.990000
2011-06-03T09:08:31.647000
6,225,053
6,225,233
PubSubHubbub and Ruby on Rails: subscription verification
I am trying to implement Superfeedr subscriptions using PubSubHubbub and Ruby on Rails. The problem is, the subscriptions are never confirmed, even though my callback prints out the hub.challenge string, which it successfully receives. def push feed = Feed.find(params[:id]) if feed.present? if params['hub.mode'].presen...
The first thing you should check is the HTTP status code and the response BODY of your subscription request. I expect the code to be 422 to indicate that subscription was failed, but the body will help us know exactly what is going on. Also, do you see the verification request in the logs? A common issue with heroku is...
PubSubHubbub and Ruby on Rails: subscription verification I am trying to implement Superfeedr subscriptions using PubSubHubbub and Ruby on Rails. The problem is, the subscriptions are never confirmed, even though my callback prints out the hub.challenge string, which it successfully receives. def push feed = Feed.find(...
TITLE: PubSubHubbub and Ruby on Rails: subscription verification QUESTION: I am trying to implement Superfeedr subscriptions using PubSubHubbub and Ruby on Rails. The problem is, the subscriptions are never confirmed, even though my callback prints out the hub.challenge string, which it successfully receives. def push...
[ "heroku", "websub" ]
0
1
433
1
0
2011-06-03T09:04:43.783000
2011-06-03T09:24:06.277000
6,225,057
6,225,086
How do I count the number of hidden divs of a certain class with jquery
I have a dynamic form that I've written in rails. I want to be sure that a user can add no more than five links. I start with two links and I have another link that allows the user to add another field. I also have a link next to the links that allows the user to remove a field, which sets a hidden field and then hides...
Use the:hidden selector: if ($(".classname:hidden").length < 5) { //create element dynamically } This will return any element with that class which is not viewable to the user. If you just want to check for display:none, then use filter(): $(".classname").filter(function () { return $(this).css("display") == "none"; })...
How do I count the number of hidden divs of a certain class with jquery I have a dynamic form that I've written in rails. I want to be sure that a user can add no more than five links. I start with two links and I have another link that allows the user to add another field. I also have a link next to the links that all...
TITLE: How do I count the number of hidden divs of a certain class with jquery QUESTION: I have a dynamic form that I've written in rails. I want to be sure that a user can add no more than five links. I start with two links and I have another link that allows the user to add another field. I also have a link next to ...
[ "javascript", "jquery", "jquery-selectors" ]
3
10
3,721
2
0
2011-06-03T09:05:08.980000
2011-06-03T09:07:17.387000
6,225,070
6,226,513
Is there an equivalent of gcc's -Wshadow in visual C++
-Wshadow will "Warn whenever a local variable shadows another local variable.". Is there an equivalent in Visual C++ (2008)? I tried /W4 but it didn't pick up on it. I also tried Cppcheck but that didn't see it either. e.g. if I inadvertently do: class A { private: int memberVar; public: void fn() { int memberVar = 27;...
I am afraid no. You could perhaps try compiling your code with Clang: it has this warning (and a lot of others) it has a compatibility mode for MSVC headers (and can build most of MFC) We use gcc at work, to build our code, but compile with Clang regularly to test the code conformance to the Standard and benefit from i...
Is there an equivalent of gcc's -Wshadow in visual C++ -Wshadow will "Warn whenever a local variable shadows another local variable.". Is there an equivalent in Visual C++ (2008)? I tried /W4 but it didn't pick up on it. I also tried Cppcheck but that didn't see it either. e.g. if I inadvertently do: class A { private:...
TITLE: Is there an equivalent of gcc's -Wshadow in visual C++ QUESTION: -Wshadow will "Warn whenever a local variable shadows another local variable.". Is there an equivalent in Visual C++ (2008)? I tried /W4 but it didn't pick up on it. I also tried Cppcheck but that didn't see it either. e.g. if I inadvertently do: ...
[ "c++", "visual-c++", "compiler-warnings" ]
21
6
5,116
5
0
2011-06-03T09:06:03.473000
2011-06-03T11:26:15.723000
6,225,074
6,225,122
connecting to database
can anyone help me how to connect my java forms to my mysql database? i have this following codes but it didn't work... private void saveActionPerformed(java.awt.event.ActionEvent evt) { String value1 = textField1.getText(); String value2 = textField2.getText(); String value3 = textField3.getText(); String value4 = te...
There is problem with connection code: url = jdbc:mysql://localhost:3306/Marketing db = Marketing url + db = jdbc:mysql://localhost:3306/MarketingMarketing here you have to remove one extra marketing
connecting to database can anyone help me how to connect my java forms to my mysql database? i have this following codes but it didn't work... private void saveActionPerformed(java.awt.event.ActionEvent evt) { String value1 = textField1.getText(); String value2 = textField2.getText(); String value3 = textField3.getTex...
TITLE: connecting to database QUESTION: can anyone help me how to connect my java forms to my mysql database? i have this following codes but it didn't work... private void saveActionPerformed(java.awt.event.ActionEvent evt) { String value1 = textField1.getText(); String value2 = textField2.getText(); String value3 =...
[ "java", "mysql", "database", "forms", "button" ]
2
1
214
3
0
2011-06-03T09:06:28.697000
2011-06-03T09:10:26.750000
6,225,078
6,249,476
How to handle listView item changes in managed option menu dialogs?
I create a dialog in my activities onCreateDialog method like this ArrayAdapter adapter = new ArrayAdapter (this, android.R.layout.select_dialog_item, android.R.id.text1, items); dialog = new AlertDialog.Builder(this).setTitle(R.string.dialogTitle).setAdapter(adapter, new DialogInterface.OnClickListener() { @Override p...
Make sure that ArrayAdapter.setNotifyOnChange() is enabled, or properly call Adapter.notifyDataSetChanged() after data change.
How to handle listView item changes in managed option menu dialogs? I create a dialog in my activities onCreateDialog method like this ArrayAdapter adapter = new ArrayAdapter (this, android.R.layout.select_dialog_item, android.R.id.text1, items); dialog = new AlertDialog.Builder(this).setTitle(R.string.dialogTitle).set...
TITLE: How to handle listView item changes in managed option menu dialogs? QUESTION: I create a dialog in my activities onCreateDialog method like this ArrayAdapter adapter = new ArrayAdapter (this, android.R.layout.select_dialog_item, android.R.id.text1, items); dialog = new AlertDialog.Builder(this).setTitle(R.strin...
[ "android" ]
0
1
1,151
2
0
2011-06-03T09:06:46.923000
2011-06-06T08:37:26.917000
6,225,081
6,225,142
When and how should I obfuscate my Delphi code?
What should I know about code obfuscation in Delphi? Should I or shouldn't I do it? How it is done and is there any good tools (commercial/free) to automate it?
Why would you need to? As a whole Delphi does not decompile back, unlike.net, so, while decompilation is always a bit of a risk, Ive never found a decompiler that actually did it to a useful way, lots of areas got left as assembler and so on. If people want to rework your work, they can, no matter what, obfuscation or ...
When and how should I obfuscate my Delphi code? What should I know about code obfuscation in Delphi? Should I or shouldn't I do it? How it is done and is there any good tools (commercial/free) to automate it?
TITLE: When and how should I obfuscate my Delphi code? QUESTION: What should I know about code obfuscation in Delphi? Should I or shouldn't I do it? How it is done and is there any good tools (commercial/free) to automate it? ANSWER: Why would you need to? As a whole Delphi does not decompile back, unlike.net, so, wh...
[ "delphi", "delphi-2010", "obfuscation" ]
6
11
5,702
5
0
2011-06-03T09:06:59.137000
2011-06-03T09:12:20.320000
6,225,083
6,225,176
default radio to yes in struts 1.3
Yes No The above code defaults to No, on my jsp. Is there a way in which I can allow the Yes button to be selected by default
On your ActionForm where sendFlag attribute is found, do this: private boolean sendFlag = true; If that doesn't work, override the reset() method by setting the sendFlag to true. That way, when Struts renders the sendFlag, it will tick it.
default radio to yes in struts 1.3 Yes No The above code defaults to No, on my jsp. Is there a way in which I can allow the Yes button to be selected by default
TITLE: default radio to yes in struts 1.3 QUESTION: Yes No The above code defaults to No, on my jsp. Is there a way in which I can allow the Yes button to be selected by default ANSWER: On your ActionForm where sendFlag attribute is found, do this: private boolean sendFlag = true; If that doesn't work, override the r...
[ "java", "jsp", "struts" ]
0
1
1,049
1
0
2011-06-03T09:07:08.370000
2011-06-03T09:17:11.643000
6,225,085
6,225,534
Create NSBox runtime example
Please, could you give me examples of how to create the NSBox instance runtime to place it inside the NSView?
NSView *superview = …; // Reference to the view that will contain the box // for instance, [window contentView] NSUInteger resizeAllMask = (NSViewWidthSizable | NSViewHeightSizable | NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin); // This is the box. We use an autoresizing mask so that it ...
Create NSBox runtime example Please, could you give me examples of how to create the NSBox instance runtime to place it inside the NSView?
TITLE: Create NSBox runtime example QUESTION: Please, could you give me examples of how to create the NSBox instance runtime to place it inside the NSView? ANSWER: NSView *superview = …; // Reference to the view that will contain the box // for instance, [window contentView] NSUInteger resizeAllMask = (NSViewWidthSi...
[ "objective-c", "cocoa", "nsbox" ]
2
3
2,547
1
0
2011-06-03T09:07:12.803000
2011-06-03T09:52:57.437000
6,225,088
6,225,621
Why the difference in how Inherits works in the WebForm?
I stumbled on something that surprised me. I'm migrating a couple of WebForms from a common web project into two different web projects. The projects are treating the Inherits tag (in the source / HTML view) differently. Take this example: SomeWonderfulPage.aspx / SomeWonderfulPage.aspx.cs The code-behind is totally st...
When I copied the web pages from the first site (into which I had refactored the webforms) into the second site the SomeWonderfulPage.designer.cs files came across but weren't included in the project by default. In such cases I found (on further exploration) that I couldn't get either Inherit to work. Including the des...
Why the difference in how Inherits works in the WebForm? I stumbled on something that surprised me. I'm migrating a couple of WebForms from a common web project into two different web projects. The projects are treating the Inherits tag (in the source / HTML view) differently. Take this example: SomeWonderfulPage.aspx ...
TITLE: Why the difference in how Inherits works in the WebForm? QUESTION: I stumbled on something that surprised me. I'm migrating a couple of WebForms from a common web project into two different web projects. The projects are treating the Inherits tag (in the source / HTML view) differently. Take this example: SomeW...
[ "asp.net", "inheritance", "webforms" ]
0
0
839
1
0
2011-06-03T09:07:23.570000
2011-06-03T10:03:00.930000
6,225,094
6,225,133
where can I find a list of all the validators and filters of a Zend_Form?
I'm learning Zend Framework using their manual at framework.zend.com. where can I find the full list of all the validators and filters that can be used in a Zend_Form? Using Zend Framework 1.11.6. example: filters: 'StringTrim' validators: 'EmailAddress' thank you!
Check the following paths of your Zend Framework installation folder: /Zend/Validate/* /Zend/Filter/* Or check the corresponding manual pages: http://framework.zend.com/manual/en/zend.filter.html http://framework.zend.com/manual/en/zend.validate.html
where can I find a list of all the validators and filters of a Zend_Form? I'm learning Zend Framework using their manual at framework.zend.com. where can I find the full list of all the validators and filters that can be used in a Zend_Form? Using Zend Framework 1.11.6. example: filters: 'StringTrim' validators: 'Emai...
TITLE: where can I find a list of all the validators and filters of a Zend_Form? QUESTION: I'm learning Zend Framework using their manual at framework.zend.com. where can I find the full list of all the validators and filters that can be used in a Zend_Form? Using Zend Framework 1.11.6. example: filters: 'StringTrim' ...
[ "php", "zend-framework", "zend-form" ]
7
11
3,124
3
0
2011-06-03T09:07:57.840000
2011-06-03T09:11:43.613000
6,225,103
6,225,126
Scanning the web for links
I was just wondering if their is a way to scan the web to find out every website that has a link to my website. Say scan the web for every website that has a link to www.example.com??? Is their a tool to do this.
Massive task, don't reinvent the wheel, use google webmaster tools: https://www.google.com/webmasters/tools/ Edit: If you wanted to do it yourself you'd have to text index and datamine the whole internets. You'd be long dead before you got close to finishing this.
Scanning the web for links I was just wondering if their is a way to scan the web to find out every website that has a link to my website. Say scan the web for every website that has a link to www.example.com??? Is their a tool to do this.
TITLE: Scanning the web for links QUESTION: I was just wondering if their is a way to scan the web to find out every website that has a link to my website. Say scan the web for every website that has a link to www.example.com??? Is their a tool to do this. ANSWER: Massive task, don't reinvent the wheel, use google we...
[ "search", "web", "network-scan" ]
0
1
45
1
0
2011-06-03T09:08:46.403000
2011-06-03T09:10:56.467000
6,225,106
6,225,127
What is better way to validate business rules in ASP.NET MVC application with 3 layer architecture?
I'm developing a ASP.NET MVC application with 3 layer classic architecture 1. data access (Repositories) 2. Business logic (Services ) 3. Application layer (MVC Controller classes) The task is follow there is domain class Learner and learners can take exams, taking an exam produce an order (Order class), after that the...
I would avoid using exceptions for validation purposes but rather have methods that return true/false. Obviously for some tasks where validation is data at the data tier (for example enforcing database constraints) you could use exceptions. You may take a look at the following tutorial about validating at the service l...
What is better way to validate business rules in ASP.NET MVC application with 3 layer architecture? I'm developing a ASP.NET MVC application with 3 layer classic architecture 1. data access (Repositories) 2. Business logic (Services ) 3. Application layer (MVC Controller classes) The task is follow there is domain clas...
TITLE: What is better way to validate business rules in ASP.NET MVC application with 3 layer architecture? QUESTION: I'm developing a ASP.NET MVC application with 3 layer classic architecture 1. data access (Repositories) 2. Business logic (Services ) 3. Application layer (MVC Controller classes) The task is follow th...
[ "c#", "asp.net-mvc", "architecture", "business-rules" ]
10
7
12,791
2
0
2011-06-03T09:08:53.207000
2011-06-03T09:10:59.637000
6,225,108
6,225,283
In HTML, how can I get an input box to stretch in IE8?
I have uploaded the following simple HTML code to http://losthobbit.net/temp/anchor.html Anchor Test As you can see, I've specified the left and right, but not the width, in order to get it to stretch. In Chrome it stretches as one resizes the browser, but this does not work in IE8 or FireFox. Any ideas about how I can...
Give the a parent element, set your current styles on that and give the element width:100%. Working demo: http://jsbin.com/ayiwa5
In HTML, how can I get an input box to stretch in IE8? I have uploaded the following simple HTML code to http://losthobbit.net/temp/anchor.html Anchor Test As you can see, I've specified the left and right, but not the width, in order to get it to stretch. In Chrome it stretches as one resizes the browser, but this doe...
TITLE: In HTML, how can I get an input box to stretch in IE8? QUESTION: I have uploaded the following simple HTML code to http://losthobbit.net/temp/anchor.html Anchor Test As you can see, I've specified the left and right, but not the width, in order to get it to stretch. In Chrome it stretches as one resizes the bro...
[ "html", "internet-explorer", "firefox", "internet-explorer-8" ]
3
6
4,485
3
0
2011-06-03T09:08:58.093000
2011-06-03T09:29:36.293000
6,225,120
6,225,182
implement timer in my app
i am developing a game.i want to display score on button click.but it should be displayed only for few seconds.i want to implement timer in my app.but i dnt knw how to implement that.i searched in the google.but results were confusing me...given below is my code snippet.plz anybody help me... OnClickListener clickball=...
No need to go so deep in your case. Every view has postDelayed() method, that will run a custom code in UI thread after a set amount of time (in milliseconds). For example: ball5.postDelayed(new Runnable(){ @Override public void run() { ball5.setText(""); } }, 3000); will clear "ball5" text after 3 seconds has passed A...
implement timer in my app i am developing a game.i want to display score on button click.but it should be displayed only for few seconds.i want to implement timer in my app.but i dnt knw how to implement that.i searched in the google.but results were confusing me...given below is my code snippet.plz anybody help me... ...
TITLE: implement timer in my app QUESTION: i am developing a game.i want to display score on button click.but it should be displayed only for few seconds.i want to implement timer in my app.but i dnt knw how to implement that.i searched in the google.but results were confusing me...given below is my code snippet.plz a...
[ "android", "timer" ]
0
0
475
4
0
2011-06-03T09:10:15.500000
2011-06-03T09:17:48.433000
6,225,123
6,225,373
Simulating CTE recursion in C#
Say that have the following CTE that returns the level of some tree data (adjacency model) that I have (taken from Hierarchical data in Linq - options and performance ): WITH hierarchy_cte(id, parent_id, data, lvl) AS ( SELECT id, parent_id, data, 0 AS lvl FROM dbo.hierarchical_table WHERE (parent_id IS NULL) UNION AL...
Recursion in SQL Server is horrendously slow by comparsion but it does work. I'd have to say that T-SQL is somewhat limited but it was never meant to do all those operations in the first place. I don't believe there is any way you can make this happen with an IQueryable if you inted to run this against you SQL Server i...
Simulating CTE recursion in C# Say that have the following CTE that returns the level of some tree data (adjacency model) that I have (taken from Hierarchical data in Linq - options and performance ): WITH hierarchy_cte(id, parent_id, data, lvl) AS ( SELECT id, parent_id, data, 0 AS lvl FROM dbo.hierarchical_table WHER...
TITLE: Simulating CTE recursion in C# QUESTION: Say that have the following CTE that returns the level of some tree data (adjacency model) that I have (taken from Hierarchical data in Linq - options and performance ): WITH hierarchy_cte(id, parent_id, data, lvl) AS ( SELECT id, parent_id, data, 0 AS lvl FROM dbo.hiera...
[ "c#", "sql", "entity-framework-4", "recursion", "common-table-expression" ]
10
5
4,543
2
0
2011-06-03T09:10:28.170000
2011-06-03T09:38:30.247000
6,225,130
6,225,147
How to get GET request values in Django Views?
Suppose I have a url that has php style parameters, that is: http://example.com/blah?param1=val1&param2=val2 And, I want to place their values into the generated HTML of the template. How do I achieve this?
{{request.GET.param1}} in the template. (Using RequestContext ) request.GET.get('param1', None) in the view.
How to get GET request values in Django Views? Suppose I have a url that has php style parameters, that is: http://example.com/blah?param1=val1&param2=val2 And, I want to place their values into the generated HTML of the template. How do I achieve this?
TITLE: How to get GET request values in Django Views? QUESTION: Suppose I have a url that has php style parameters, that is: http://example.com/blah?param1=val1&param2=val2 And, I want to place their values into the generated HTML of the template. How do I achieve this? ANSWER: {{request.GET.param1}} in the template....
[ "python", "django", "django-views", "get", "url-parameters" ]
37
71
47,431
4
0
2011-06-03T09:11:20.460000
2011-06-03T09:13:37.917000
6,225,145
6,225,250
Android UI help
I want to create an Android application that has a MapView at the top of the screen and a horizontal scroll view at the bottom. The data that are going to be shown on the map should be displayed at the bottom scroll view(horizontal scroll view). Data that are current being displayed at the bottom of the scroll view wil...
Start with the android google map tutorial. It will explain you how to deal with maps and markers and this one for a similar design with buttons And in order to draw buttons on a mapview, you have to use this trick. You will already be on the right track. And for the list (use a list view in android), it depends where ...
Android UI help I want to create an Android application that has a MapView at the top of the screen and a horizontal scroll view at the bottom. The data that are going to be shown on the map should be displayed at the bottom scroll view(horizontal scroll view). Data that are current being displayed at the bottom of the...
TITLE: Android UI help QUESTION: I want to create an Android application that has a MapView at the top of the screen and a horizontal scroll view at the bottom. The data that are going to be shown on the map should be displayed at the bottom scroll view(horizontal scroll view). Data that are current being displayed at...
[ "android", "android-activity", "android-mapview" ]
1
0
109
1
0
2011-06-03T09:13:02.550000
2011-06-03T09:25:57.920000
6,225,150
6,225,479
Download file from internet within a thread in Delphi
How to download a file from internet with progress bar using threads in Delphi 2009/10 without Indy components?
This uses the clever internet suite to handle the download, I haven't so much as checked it in the IDE so I wouldn't expect it to compile and no doubt it's full of errors but it should be enough to get you started. I don't know why you don't want to use Indy but I would strongly advise getting some components to help w...
Download file from internet within a thread in Delphi How to download a file from internet with progress bar using threads in Delphi 2009/10 without Indy components?
TITLE: Download file from internet within a thread in Delphi QUESTION: How to download a file from internet with progress bar using threads in Delphi 2009/10 without Indy components? ANSWER: This uses the clever internet suite to handle the download, I haven't so much as checked it in the IDE so I wouldn't expect it ...
[ "delphi", "download" ]
4
1
6,725
2
0
2011-06-03T09:13:48.167000
2011-06-03T09:47:12.457000
6,225,155
6,229,575
Assign different roles to the same user on different databases on the same server
I've setup our postgresql server with two databases: one production and one training. I would like users to be limited to their true roles in the production database, but be given free reign in the training database. ie. Assign one set of roles to a user on one database, and another set of roles to the same user in a d...
You can GRANT different privileges to different ROLES in different databases, but ROLES are global to the entire server. You might consider using GROUPS (prod_dba group vs dev_dba group) and then assign users to the different groups.
Assign different roles to the same user on different databases on the same server I've setup our postgresql server with two databases: one production and one training. I would like users to be limited to their true roles in the production database, but be given free reign in the training database. ie. Assign one set of...
TITLE: Assign different roles to the same user on different databases on the same server QUESTION: I've setup our postgresql server with two databases: one production and one training. I would like users to be limited to their true roles in the production database, but be given free reign in the training database. ie....
[ "postgresql" ]
1
1
1,305
1
0
2011-06-03T09:14:14.770000
2011-06-03T15:58:03.597000
6,225,161
6,273,849
Apns-alert customization
I have successfully used APNS in iphone app and still have a problem the alert customization.Below is my question: 1 I can't custom the Alert view,like title and button title.I custom the alert like: - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSDictionary *a...
I find: if your app does not start, the apns-alert is provided by the iOS which you can't customize.
Apns-alert customization I have successfully used APNS in iphone app and still have a problem the alert customization.Below is my question: 1 I can't custom the Alert view,like title and button title.I custom the alert like: - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)u...
TITLE: Apns-alert customization QUESTION: I have successfully used APNS in iphone app and still have a problem the alert customization.Below is my question: 1 I can't custom the Alert view,like title and button title.I custom the alert like: - (void)application:(UIApplication *)application didReceiveRemoteNotification...
[ "ios", "apple-push-notifications" ]
1
1
1,082
1
0
2011-06-03T09:14:45.813000
2011-06-08T03:19:38.640000
6,225,172
6,225,460
Import local CSS file into a procedure
I got a PL/SQL Web Toolkit project not online (url: http://127.0.0.1:8080/dad/my_procedure ). And I just want to know how to import a local CSS file into this procedure... I tried to do something like this: htp.print(' '); or even htp.print(' '); with no success... In reality I don't know what's the root directory for ...
The CSS file has to be within the HEAD area of the webpage. You should have your htp.print statement between the htp.headopen and htp.headclose calls. Also, the CSS file path is relative to the web server processing the request, so the path should be to the directory on the web server that the CSS file resides.
Import local CSS file into a procedure I got a PL/SQL Web Toolkit project not online (url: http://127.0.0.1:8080/dad/my_procedure ). And I just want to know how to import a local CSS file into this procedure... I tried to do something like this: htp.print(' '); or even htp.print(' '); with no success... In reality I do...
TITLE: Import local CSS file into a procedure QUESTION: I got a PL/SQL Web Toolkit project not online (url: http://127.0.0.1:8080/dad/my_procedure ). And I just want to know how to import a local CSS file into this procedure... I tried to do something like this: htp.print(' '); or even htp.print(' '); with no success....
[ "css", "plsql", "import" ]
0
0
1,493
1
0
2011-06-03T09:16:56.503000
2011-06-03T09:45:49.740000
6,225,174
6,227,137
Can I use CoffeeScript in the views executed on render.js?
What do I need to do so that I can use CoffeeScript in the Rails JS views? For example: def index format.js { render:layout => false } end What would I need to do in order for Rails to use index.js.coffee?
It's not yet supported in 3.1. You will need to use Coffeebeans. Update: It is now supported in rails 3.2
Can I use CoffeeScript in the views executed on render.js? What do I need to do so that I can use CoffeeScript in the Rails JS views? For example: def index format.js { render:layout => false } end What would I need to do in order for Rails to use index.js.coffee?
TITLE: Can I use CoffeeScript in the views executed on render.js? QUESTION: What do I need to do so that I can use CoffeeScript in the Rails JS views? For example: def index format.js { render:layout => false } end What would I need to do in order for Rails to use index.js.coffee? ANSWER: It's not yet supported in 3....
[ "ruby-on-rails", "ruby", "coffeescript" ]
12
13
5,101
4
0
2011-06-03T09:17:00.197000
2011-06-03T12:33:03.143000
6,225,175
6,225,285
change color of uitableviewcell for selected cell in sectioned table
I have sectioned table view with check selection for each section(every section allows only single selection like radio button). now what i want to do is i want to change the color of cell that user has selected(not for fraction of time color change with animation using selectedBackgroundView property of cell). Please ...
when the user select a row -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath gets called. You may consider implement this method in your delegate.
change color of uitableviewcell for selected cell in sectioned table I have sectioned table view with check selection for each section(every section allows only single selection like radio button). now what i want to do is i want to change the color of cell that user has selected(not for fraction of time color change w...
TITLE: change color of uitableviewcell for selected cell in sectioned table QUESTION: I have sectioned table view with check selection for each section(every section allows only single selection like radio button). now what i want to do is i want to change the color of cell that user has selected(not for fraction of t...
[ "iphone", "uitableview" ]
2
1
19,078
8
0
2011-06-03T09:17:09.850000
2011-06-03T09:29:42.103000
6,225,180
6,225,268
Migrating an application to a service mode [java/groovy]
I've got an application written in groovy. It takes some cmd args and returns previously formatted response. As system grew, it appeared that it is required to run this app extremely frequently (like 80 times in 5 mins) which leads to certain performance issues. In particular it creates all its objects over and over ag...
For enterprise environments I would suggest a JavaEE application with EJB running in an application server. For your requirements this might be an overkill. A simple solution can be: Service: Implement a RMI server with a local RMI registry. Calculations will be done here. Script: Connect to the RMI server, invoke a me...
Migrating an application to a service mode [java/groovy] I've got an application written in groovy. It takes some cmd args and returns previously formatted response. As system grew, it appeared that it is required to run this app extremely frequently (like 80 times in 5 mins) which leads to certain performance issues. ...
TITLE: Migrating an application to a service mode [java/groovy] QUESTION: I've got an application written in groovy. It takes some cmd args and returns previously formatted response. As system grew, it appeared that it is required to run this app extremely frequently (like 80 times in 5 mins) which leads to certain pe...
[ "java", "service", "groovy", "communication" ]
0
0
113
1
0
2011-06-03T09:17:37.760000
2011-06-03T09:28:39.627000
6,225,208
6,225,235
Possible to pass a variable from jQuery with AJAX to PHP page and a session variable?
Possible Duplicate: Passing javascript variable to PHP Hi I wonder if it's possible to pass a variable from a jQuery script to a PHP-page and put the variable into a session variable like this: $_SESSION['mapZoomArea'] = (isset($_GET['mapza'])? $_GET['mapza']: ""; I'm not sure how to pass the variable and the url to th...
If you want a dedicated service specifically for writing this value into the session, you probably should make it a POST request (GET will work too, but GET requests should be for data retrieval, not for writing to the server). Therefore, simply create a new PHP page, let's say "storezoomarea.php", and have jQuery make...
Possible to pass a variable from jQuery with AJAX to PHP page and a session variable? Possible Duplicate: Passing javascript variable to PHP Hi I wonder if it's possible to pass a variable from a jQuery script to a PHP-page and put the variable into a session variable like this: $_SESSION['mapZoomArea'] = (isset($_GET[...
TITLE: Possible to pass a variable from jQuery with AJAX to PHP page and a session variable? QUESTION: Possible Duplicate: Passing javascript variable to PHP Hi I wonder if it's possible to pass a variable from a jQuery script to a PHP-page and put the variable into a session variable like this: $_SESSION['mapZoomArea...
[ "php", "jquery", "ajax" ]
1
1
11,478
4
0
2011-06-03T09:20:31.090000
2011-06-03T09:24:20.537000
6,225,211
6,226,248
Mysterious problem with floating point in LISP - time axis generation
Ok, I do know what and how works floating point. But, It doesn't stop to puzzle me whenever I deal with it. I try to do some time axis generation function. The idea is simple. To make smt like this (defun make-time-axis (start step stop)...) So, when you call it with e.g. (make-time-axis 0 0.1 1.2) result will be 0 0.1...
If you know how floating point works (you have read What Every Computer Scientist Should Know About Floating Point Arithmetic, right?), you should realize that you got exactly what you asked for. Mathematical numbers (be they integers, rationals, reals, complex, whatever) have many useful properties. For example, x/10 ...
Mysterious problem with floating point in LISP - time axis generation Ok, I do know what and how works floating point. But, It doesn't stop to puzzle me whenever I deal with it. I try to do some time axis generation function. The idea is simple. To make smt like this (defun make-time-axis (start step stop)...) So, when...
TITLE: Mysterious problem with floating point in LISP - time axis generation QUESTION: Ok, I do know what and how works floating point. But, It doesn't stop to puzzle me whenever I deal with it. I try to do some time axis generation function. The idea is simple. To make smt like this (defun make-time-axis (start step ...
[ "lisp", "floating-point" ]
3
13
246
1
0
2011-06-03T09:20:55.327000
2011-06-03T11:02:30.713000
6,225,215
6,231,094
stringWithFormat and %S problem
Here is my code. std::wstring sourceString = L"test\n newline."; NSString* transformedString = [NSString stringWithFormat:@"%S", sourceString.c_str()]; I intended two strings' contents to be same but transformedString is equivalent to @"t". How can I fix this with minimal edit? (I have to use wstring because of unicode...
On Mac OS X/iOS, wchar_t is 32 bits wide (i.e. it represents UTF-32 characters, not UTF-16 characters.) %S corresponds to a null-terminated unichar array, and unichar is 16 bits wide, not 32 bits wide, so the character 't' appears to NSString to have a trailing null character (or leading null character on Big Endian ta...
stringWithFormat and %S problem Here is my code. std::wstring sourceString = L"test\n newline."; NSString* transformedString = [NSString stringWithFormat:@"%S", sourceString.c_str()]; I intended two strings' contents to be same but transformedString is equivalent to @"t". How can I fix this with minimal edit? (I have t...
TITLE: stringWithFormat and %S problem QUESTION: Here is my code. std::wstring sourceString = L"test\n newline."; NSString* transformedString = [NSString stringWithFormat:@"%S", sourceString.c_str()]; I intended two strings' contents to be same but transformedString is equivalent to @"t". How can I fix this with minim...
[ "iphone", "nsstring", "stringwithformat" ]
0
1
1,445
1
0
2011-06-03T09:21:45.073000
2011-06-03T18:22:12.480000
6,225,216
6,225,264
datetime to timestamp
Possible Duplicates: Inverse date function? - not strtotime Is it possible to get UNIX time from such date 2011-02-27 02:04:46? hello, we have this function to convert a timestamp to datetime: $datetime = date('Y-m-d H:i:s', $timestamp); is there a function to do the opposite? datetime to timestamp. Thanks
$timestamp = strtotime($datetime); Or if you're confident of the format, split up the string with explode() or even substr and pass the necessary parts into the mktime function. Be aware that strtotime can sometimes get the timestamp wrong, if a slightly unconventional format is used. EDIT: A really accurate way of doi...
datetime to timestamp Possible Duplicates: Inverse date function? - not strtotime Is it possible to get UNIX time from such date 2011-02-27 02:04:46? hello, we have this function to convert a timestamp to datetime: $datetime = date('Y-m-d H:i:s', $timestamp); is there a function to do the opposite? datetime to timestam...
TITLE: datetime to timestamp QUESTION: Possible Duplicates: Inverse date function? - not strtotime Is it possible to get UNIX time from such date 2011-02-27 02:04:46? hello, we have this function to convert a timestamp to datetime: $datetime = date('Y-m-d H:i:s', $timestamp); is there a function to do the opposite? da...
[ "php", "datetime", "timestamp" ]
34
74
105,977
2
0
2011-06-03T09:21:51.257000
2011-06-03T09:28:15.163000
6,225,221
6,225,312
$(this).css("background", "transparent"); is not working in IE
Please help: $(this).css("background", "transparent"); is not working in IE (7 and 8). Thank You.
It's working just fine in IE 7 and IE 8. I tested this in actual IE 7 and IE 8 browsers, and it does work: jsfiddle.net/4L9RX/ If you have a situation where it doesn't work, you have to show enough of your code that it's repeatable.
$(this).css("background", "transparent"); is not working in IE Please help: $(this).css("background", "transparent"); is not working in IE (7 and 8). Thank You.
TITLE: $(this).css("background", "transparent"); is not working in IE QUESTION: Please help: $(this).css("background", "transparent"); is not working in IE (7 and 8). Thank You. ANSWER: It's working just fine in IE 7 and IE 8. I tested this in actual IE 7 and IE 8 browsers, and it does work: jsfiddle.net/4L9RX/ If yo...
[ "jquery", "css", "internet-explorer" ]
1
2
4,874
1
0
2011-06-03T09:23:11.047000
2011-06-03T09:33:01.243000
6,225,222
6,270,946
Unable to release the memory of .net serviced component object (com+) from unmanaged client
I have exposed c# dll as.net serviced component (com+). It is being consumed by an unmananged client (Unify Vision). I have deployed this component under component services. I set the pool size to 5 and the creation time out to 2 minutes. I am running the com+ under server mode. and set the idle shutdown time to 3 minu...
There are two methods _Destroy and Dispose exposed by this serviced component. Which one do I have to use for releasing the object once it is used. Since you are dealing with a Server (out of process) Application the client should not have to call Dispose(). If your component is configured properly dispose will actuall...
Unable to release the memory of .net serviced component object (com+) from unmanaged client I have exposed c# dll as.net serviced component (com+). It is being consumed by an unmananged client (Unify Vision). I have deployed this component under component services. I set the pool size to 5 and the creation time out to ...
TITLE: Unable to release the memory of .net serviced component object (com+) from unmanaged client QUESTION: I have exposed c# dll as.net serviced component (com+). It is being consumed by an unmananged client (Unify Vision). I have deployed this component under component services. I set the pool size to 5 and the cre...
[ "c#", ".net", "com-interop", "com+" ]
0
2
1,917
1
0
2011-06-03T09:23:13.767000
2011-06-07T20:02:47.427000
6,225,239
6,226,317
When I use jQuery with ajax (XMLhttpREquest), jQuery doesn't work, why?
I have a XMLhttpRequest when I get the response I want to bind a div that uses jQuery for some animation (tabs), but when I get the response the display the tabs, then the jQuery doesn't work, but if I transfer the block (div) that uses jQuery outside the position that uses Ajax, then it works fine.... function searchL...
this is a jQuery ajax call. I've simplified the whole thing: $.ajax({ type: 'GET', url: 'ajax_search_locations.php', data: { name: $('txtSearch').val(), page: page }, dataType: 'json', complete: function(XMLHttpRequest, textStatus) { if (XMLHttpRequest.status === 200) { var txt= " "+ " "+ " "+ " Tab 1 "+ " Tab 2 "+ " ...
When I use jQuery with ajax (XMLhttpREquest), jQuery doesn't work, why? I have a XMLhttpRequest when I get the response I want to bind a div that uses jQuery for some animation (tabs), but when I get the response the display the tabs, then the jQuery doesn't work, but if I transfer the block (div) that uses jQuery outs...
TITLE: When I use jQuery with ajax (XMLhttpREquest), jQuery doesn't work, why? QUESTION: I have a XMLhttpRequest when I get the response I want to bind a div that uses jQuery for some animation (tabs), but when I get the response the display the tabs, then the jQuery doesn't work, but if I transfer the block (div) tha...
[ "javascript", "jquery", "ajax", "xmlhttprequest" ]
0
2
3,616
2
0
2011-06-03T09:24:37.630000
2011-06-03T11:07:59.933000
6,225,251
6,225,662
submit button will not show the result by one click it will show it by second click
When I click the update button it will not update the table but when i Click it again it will be updated how can I correct it? pharmacy 0) { echo " Table Request".$_SESSION['s1']; echo" Id Drug Quantity Doctor pharmacy name lastname Situation "; for($i=0;$i<$num;$i++) { $row=mysql_fetch_row($result); echo " "; for($j=...
Try taking out the request list button to see it if anything changes
submit button will not show the result by one click it will show it by second click When I click the update button it will not update the table but when i Click it again it will be updated how can I correct it? pharmacy 0) { echo " Table Request".$_SESSION['s1']; echo" Id Drug Quantity Doctor pharmacy name lastname Sit...
TITLE: submit button will not show the result by one click it will show it by second click QUESTION: When I click the update button it will not update the table but when i Click it again it will be updated how can I correct it? pharmacy 0) { echo " Table Request".$_SESSION['s1']; echo" Id Drug Quantity Doctor pharmacy...
[ "php", "mysql", "post", "submit" ]
0
0
550
1
0
2011-06-03T09:26:42.277000
2011-06-03T10:06:56.470000