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,211,810
6,211,857
Multi values parameter
Can anyone explain to me how to pass multiple values into a parameter or variable in objective-c as below and how to handle it inside method: view.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
What you're seeing is a simple disjunction between integers, the UIView autoresizing mask parameters are just typedef'ed enum values. You can create these on your own: typedef enum { IceCreamChocolateSyrup = 1 << 1, IceCreamCaramelSyrup = 1 << 2, IceCreamMapleSyrup = 1 << 3, // etc. up to 31 flavors } IceCreamSyrups; T...
Multi values parameter Can anyone explain to me how to pass multiple values into a parameter or variable in objective-c as below and how to handle it inside method: view.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
TITLE: Multi values parameter QUESTION: Can anyone explain to me how to pass multiple values into a parameter or variable in objective-c as below and how to handle it inside method: view.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin; ANSWER: What you're seeing is a si...
[ "iphone", "objective-c", "parameter-passing" ]
1
2
119
1
0
2011-06-02T07:42:44.353000
2011-06-02T07:49:08.200000
6,211,819
6,211,991
How to know the name of the fields of a list that is empty?
In a Sharepoint there is a SPList that I should check if a name of field exist. (If exist I add content, if not exist I do something else) Now I'm doing that: SPListItemCollection listItems = spList.GetItems(); SPFieldCollection spFieldCollection =listItems.Fields; foreach (SPField field in spFieldCollection) { String ...
Just check on the Fields property on the SPList: SPFieldCollection fields = spList.Fields; Use the method ContainsField to check if a field exists: return spList.Fields.ContainsField(fieldName); fieldName Type: System.String A string that contains either the display name or the internal name of the field. SPFieldCollec...
How to know the name of the fields of a list that is empty? In a Sharepoint there is a SPList that I should check if a name of field exist. (If exist I add content, if not exist I do something else) Now I'm doing that: SPListItemCollection listItems = spList.GetItems(); SPFieldCollection spFieldCollection =listItems.Fi...
TITLE: How to know the name of the fields of a list that is empty? QUESTION: In a Sharepoint there is a SPList that I should check if a name of field exist. (If exist I add content, if not exist I do something else) Now I'm doing that: SPListItemCollection listItems = spList.GetItems(); SPFieldCollection spFieldCollec...
[ "c#", "sharepoint", "sharepoint-2010", "web-parts", "splist" ]
0
4
2,887
1
0
2011-06-02T07:44:01.977000
2011-06-02T08:06:51.170000
6,211,827
6,212,756
UITableViewCell and UITableView Repeat selection over other Cells?
I am working in UITableView and trying to let the user to select cells using this code - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if(cell!= nil) { if(cell.accessoryTyp...
static NSString * cellIdentifier = @"CellIdentifier" in this place use NSString *CellIdentifier = [NSString stringWithFormat:@"Cell%i",indexPath.row];
UITableViewCell and UITableView Repeat selection over other Cells? I am working in UITableView and trying to let the user to select cells using this code - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; UITableViewCell *cell = [tableView cell...
TITLE: UITableViewCell and UITableView Repeat selection over other Cells? QUESTION: I am working in UITableView and trying to let the user to select cells using this code - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; UITableViewCell *cell...
[ "iphone", "objective-c", "uitableview" ]
2
8
1,370
3
0
2011-06-02T07:44:51.977000
2011-06-02T09:36:34.783000
6,211,828
6,211,847
Add property to object with key in JavaScript
I have a simple code like this: var name = 'line1'; var obj = {}; obj.name = [0, 1]; console.log(obj); Key of property is name. But I want to make key='line'. Can you help me?
If I understand correctly, and you want to use the value of the name variable as the property name, you can use this syntax: obj[name] = [0, 1]; //obj.line1 will be [0, 1] Object properties can also be accessed with the same syntax arrays use. It is handy in situations like this one.
Add property to object with key in JavaScript I have a simple code like this: var name = 'line1'; var obj = {}; obj.name = [0, 1]; console.log(obj); Key of property is name. But I want to make key='line'. Can you help me?
TITLE: Add property to object with key in JavaScript QUESTION: I have a simple code like this: var name = 'line1'; var obj = {}; obj.name = [0, 1]; console.log(obj); Key of property is name. But I want to make key='line'. Can you help me? ANSWER: If I understand correctly, and you want to use the value of the name va...
[ "javascript", "arrays", "object", "properties" ]
1
6
352
2
0
2011-06-02T07:44:56.033000
2011-06-02T07:47:21.400000
6,211,840
6,222,488
Default Focus Color of BlackBerry Fields
Does anyone know what is the constant code of default focus color of BlackBerry Fields(blueish)?
For the gradient highlighting, the colors I found are 0x00207CFE for the top and 0x00074CAC for the bottom.
Default Focus Color of BlackBerry Fields Does anyone know what is the constant code of default focus color of BlackBerry Fields(blueish)?
TITLE: Default Focus Color of BlackBerry Fields QUESTION: Does anyone know what is the constant code of default focus color of BlackBerry Fields(blueish)? ANSWER: For the gradient highlighting, the colors I found are 0x00207CFE for the top and 0x00074CAC for the bottom.
[ "blackberry", "focus", "field" ]
0
0
497
1
0
2011-06-02T07:46:06.130000
2011-06-03T02:48:17.193000
6,211,843
6,212,794
Mocking Internal State
I'm looking for a suitable mocking tool to mock internal states (e.g. void methods). I know Powermock and JMock can do this but I have not made a choice yet. I have more experience with EasyMock but have not tried mocking internal states. I'm not so sure if it is inherently supported. I'm still scouring its documentati...
By internal state, i assume you might be meaning some private or package-private method that your public method calls in order to do its job. In my view, if your internally-called method is so complicated that you want to mock it out, then you should really pull it out into it's own class, test that class separately, a...
Mocking Internal State I'm looking for a suitable mocking tool to mock internal states (e.g. void methods). I know Powermock and JMock can do this but I have not made a choice yet. I have more experience with EasyMock but have not tried mocking internal states. I'm not so sure if it is inherently supported. I'm still s...
TITLE: Mocking Internal State QUESTION: I'm looking for a suitable mocking tool to mock internal states (e.g. void methods). I know Powermock and JMock can do this but I have not made a choice yet. I have more experience with EasyMock but have not tried mocking internal states. I'm not so sure if it is inherently supp...
[ "java", "mocking" ]
2
3
4,213
3
0
2011-06-02T07:46:36.533000
2011-06-02T09:40:56.860000
6,211,868
6,213,293
Django view and separate processes
I would like to do something similar: f(n) calculates n!, this obviously takes a long time to do, so the calculations need to run in a separate process from the django view. Additionally I would like the view to return a response immediately (ex. progress 0% ) and subsequent polling needs to update progress, so the vie...
Andrey Fedoseev gave a great suggestion, but let me come up with a more general solution. You can create some WaitingTasks model into which where your view puts new tasks. Then, there can use any method to process those waiting tasks - cronjob, upstart daemon, whatever - writing back progress and result. (In fact celer...
Django view and separate processes I would like to do something similar: f(n) calculates n!, this obviously takes a long time to do, so the calculations need to run in a separate process from the django view. Additionally I would like the view to return a response immediately (ex. progress 0% ) and subsequent polling n...
TITLE: Django view and separate processes QUESTION: I would like to do something similar: f(n) calculates n!, this obviously takes a long time to do, so the calculations need to run in a separate process from the django view. Additionally I would like the view to return a response immediately (ex. progress 0% ) and su...
[ "python", "django", "multiprocessing" ]
1
0
537
3
0
2011-06-02T07:50:35.367000
2011-06-02T10:27:14.913000
6,211,881
6,212,146
Annoying Android - RSS problem
I'm struggling big time with a stupid problem which i can't seem to fix. Basicly what i do in my application is the following: I download all the RSS content to a local database, including the enclosure of every feed (images) but not every feed contains an image. about 10 of the 100 feeds don't contain an image What ha...
//-- Call upon the function that will download the image. if (imageURL!=null){ DownloadFromUrl(imageURL, imagePath); } else imageview.setImageDrawable(null); Try adding an else part here and clear any old image in ur imageview
Annoying Android - RSS problem I'm struggling big time with a stupid problem which i can't seem to fix. Basicly what i do in my application is the following: I download all the RSS content to a local database, including the enclosure of every feed (images) but not every feed contains an image. about 10 of the 100 feeds...
TITLE: Annoying Android - RSS problem QUESTION: I'm struggling big time with a stupid problem which i can't seem to fix. Basicly what i do in my application is the following: I download all the RSS content to a local database, including the enclosure of every feed (images) but not every feed contains an image. about 1...
[ "android", "database", "image-processing", "rss" ]
0
0
222
2
0
2011-06-02T07:52:42.350000
2011-06-02T08:27:38.963000
6,211,883
6,211,989
NSOperation and reloading the parser
I have a parser class that is subclass of NSOperation. It is used to parse the xml and table view is reloaded when the parse is completed. I have a refresh UIBarButtonItem that is used to call the parser and parse the new xml from the link again. -(void)refresh { [self.queue cancelAllOperations]; //cancel all the curre...
Your memory management is broken. And you are violating encapsulation. You are calling [self.queue release]. That is reaching into self and breaking it by releasing something self owns. If I were to reach into your abdomen and release your liver, it might be all for the good of the country, but it probably would be bad...
NSOperation and reloading the parser I have a parser class that is subclass of NSOperation. It is used to parse the xml and table view is reloaded when the parse is completed. I have a refresh UIBarButtonItem that is used to call the parser and parse the new xml from the link again. -(void)refresh { [self.queue cancelA...
TITLE: NSOperation and reloading the parser QUESTION: I have a parser class that is subclass of NSOperation. It is used to parse the xml and table view is reloaded when the parse is completed. I have a refresh UIBarButtonItem that is used to call the parser and parse the new xml from the link again. -(void)refresh { [...
[ "iphone", "uitableview", "nsxmlparser", "nsoperation" ]
0
1
357
3
0
2011-06-02T07:53:07.643000
2011-06-02T08:06:43.037000
6,211,885
6,212,057
Problem with alias in join statiment
I have problem with following query: SELECT g_contac.contid, g_contac.name, g_contac.email, f_sync.foreign_key, ( SELECT COUNT(g_cpers.cpersid) FROM g_cpers WHERE g_cpers.contid = g_contac.contid ) AS employee_count FROM f_sync FULL OUTER JOIN g_contac ON ( g_contac.contid = f_sync.external_id AND model = case when f_s...
That's because you mention f_sync.employee_count in your query, but f_sync doesn't have a column called employee_count: you just created a dynamic column in the query with the alias employee_count. Simple fix is to repeat the calculation: SELECT g_contac.contid, g_contac.name, g_contac.email, f_sync.foreign_key, ( SELE...
Problem with alias in join statiment I have problem with following query: SELECT g_contac.contid, g_contac.name, g_contac.email, f_sync.foreign_key, ( SELECT COUNT(g_cpers.cpersid) FROM g_cpers WHERE g_cpers.contid = g_contac.contid ) AS employee_count FROM f_sync FULL OUTER JOIN g_contac ON ( g_contac.contid = f_sync....
TITLE: Problem with alias in join statiment QUESTION: I have problem with following query: SELECT g_contac.contid, g_contac.name, g_contac.email, f_sync.foreign_key, ( SELECT COUNT(g_cpers.cpersid) FROM g_cpers WHERE g_cpers.contid = g_contac.contid ) AS employee_count FROM f_sync FULL OUTER JOIN g_contac ON ( g_conta...
[ "sql", "sql-server", "join", "alias" ]
2
4
1,216
2
0
2011-06-02T07:53:19.417000
2011-06-02T08:15:11.603000
6,211,886
6,211,993
How can access particular String from Resource file with using Resource.getString(id) in Android
I want to know that I have the string.xml Resource file which contains status messages. Now I want to process them according their id. I have written the following code but it fails on Message = res.getString(Msgid); and logs Resource not found Exception. Can any one help me? public void FileStatusMsg(int Msgid) { Str...
Suppose you have a value Message inside strings.xml. To access this value, in your activity give: this.getText(R.string.msg).toString()
How can access particular String from Resource file with using Resource.getString(id) in Android I want to know that I have the string.xml Resource file which contains status messages. Now I want to process them according their id. I have written the following code but it fails on Message = res.getString(Msgid); and lo...
TITLE: How can access particular String from Resource file with using Resource.getString(id) in Android QUESTION: I want to know that I have the string.xml Resource file which contains status messages. Now I want to process them according their id. I have written the following code but it fails on Message = res.getStr...
[ "android", "resources" ]
3
3
1,462
2
0
2011-06-02T07:53:21.583000
2011-06-02T08:06:58.920000
6,211,889
6,211,903
Parsing date with MySQL
I have a date of the type August 15, 2009 I'm trying to parse it with DATE_FORMAT('August 15, 2009', '%M %e, %Y') But it is not working returns NULL. Oh mighty overflowers, do you have any idea what might be the problem?
See http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format mysql> SELECT STR_TO_DATE('May 1, 2013','%M %d,%Y'); -> '2013-05-01'
Parsing date with MySQL I have a date of the type August 15, 2009 I'm trying to parse it with DATE_FORMAT('August 15, 2009', '%M %e, %Y') But it is not working returns NULL. Oh mighty overflowers, do you have any idea what might be the problem?
TITLE: Parsing date with MySQL QUESTION: I have a date of the type August 15, 2009 I'm trying to parse it with DATE_FORMAT('August 15, 2009', '%M %e, %Y') But it is not working returns NULL. Oh mighty overflowers, do you have any idea what might be the problem? ANSWER: See http://dev.mysql.com/doc/refman/5.0/en/date-...
[ "mysql", "database", "date" ]
0
8
364
1
0
2011-06-02T07:53:49.543000
2011-06-02T07:55:32.553000
6,211,892
6,211,963
problem comparing two dates in mysql
I m using below query from c# to compare current date with date stored in database as string.but it do not show the proper output even though it is not showing any error. Select * from tblconcertdetail WHERE STR_TO_DATE(Concert_Date,'%m/%d/%Y')>="+DateTime.Now.ToString("yyyy-MM-dd")+"; first argument shows as: 2011-06-...
Are you sure the first argument returns as you said YYYY-MM-DD???? Make sure the value for "Concert_Date" should look like "04/22/2011". Try the following: Select * from tblconcertdetail where date(Concert_Date) >= "+DateTime.Now.ToString("yyyy-MM-dd")+"; I think Concert_Date is of datatype "date" or "datetime" or "tim...
problem comparing two dates in mysql I m using below query from c# to compare current date with date stored in database as string.but it do not show the proper output even though it is not showing any error. Select * from tblconcertdetail WHERE STR_TO_DATE(Concert_Date,'%m/%d/%Y')>="+DateTime.Now.ToString("yyyy-MM-dd")...
TITLE: problem comparing two dates in mysql QUESTION: I m using below query from c# to compare current date with date stored in database as string.but it do not show the proper output even though it is not showing any error. Select * from tblconcertdetail WHERE STR_TO_DATE(Concert_Date,'%m/%d/%Y')>="+DateTime.Now.ToSt...
[ "mysql" ]
0
1
603
2
0
2011-06-02T07:54:21.540000
2011-06-02T08:03:22.213000
6,211,897
6,211,946
Why my ASP.NET / SQL Server web app crashes when resumed after a period of inactivity?
I wrote a simple query of a SQL Server database for my app. Multiple queries one after the other work fine. But if I leave the browser and the app active and do another query after a period of inactivity, the app crashes. It's not only slow; it actually crashes hard with the follwing error code: Validation of viewstate...
If you are using sessions perhaps your session expired and when you revisit that is the error? Can you please post the error you are recieving. Also if you are executing the query directly are you properly closing your connection. Its hard to say much more without better information like the exact error you get and how...
Why my ASP.NET / SQL Server web app crashes when resumed after a period of inactivity? I wrote a simple query of a SQL Server database for my app. Multiple queries one after the other work fine. But if I leave the browser and the app active and do another query after a period of inactivity, the app crashes. It's not on...
TITLE: Why my ASP.NET / SQL Server web app crashes when resumed after a period of inactivity? QUESTION: I wrote a simple query of a SQL Server database for my app. Multiple queries one after the other work fine. But if I leave the browser and the app active and do another query after a period of inactivity, the app cr...
[ "asp.net", "sql", "sql-server", "t-sql" ]
1
3
281
1
0
2011-06-02T07:54:43.317000
2011-06-02T08:00:56.110000
6,211,905
6,219,090
how to set values on the params attribute in export:formats element for grails export plugin
I have installed the grails export plugin. It has an element export:formats which takes a params value as attribute. I want to know how to set values from other elements onto this params attribute so that it is available to my controller action.
The params you give to the taglib will only affect the link rendered by Grails. If you want the link to contain params that change after page rendering, such as the values selected by the datepickers, then you need to use Javascript. Here's a rough example: $('.menuButton a').click(function() { var target = this.href +...
how to set values on the params attribute in export:formats element for grails export plugin I have installed the grails export plugin. It has an element export:formats which takes a params value as attribute. I want to know how to set values from other elements onto this params attribute so that it is available to my ...
TITLE: how to set values on the params attribute in export:formats element for grails export plugin QUESTION: I have installed the grails export plugin. It has an element export:formats which takes a params value as attribute. I want to know how to set values from other elements onto this params attribute so that it i...
[ "grails", "gsp" ]
0
2
1,826
1
0
2011-06-02T07:55:57.187000
2011-06-02T19:02:00.913000
6,211,908
6,212,129
NSString with \0
What is the best way to initiate NSString that contains @"\0"? NSString* foo = @"bar\0"; causes 'CFString literal contains NUL character' warning.
NSString objects are for text. Consider using an NSData or NSMutableData object if you wish to have non-text data in amongst textual data (for example, when it is to be written to a socket or saved to a file).
NSString with \0 What is the best way to initiate NSString that contains @"\0"? NSString* foo = @"bar\0"; causes 'CFString literal contains NUL character' warning.
TITLE: NSString with \0 QUESTION: What is the best way to initiate NSString that contains @"\0"? NSString* foo = @"bar\0"; causes 'CFString literal contains NUL character' warning. ANSWER: NSString objects are for text. Consider using an NSData or NSMutableData object if you wish to have non-text data in amongst text...
[ "iphone", "objective-c", "ios", "nsstring" ]
2
6
1,684
2
0
2011-06-02T07:56:08.560000
2011-06-02T08:25:44.517000
6,211,911
6,211,961
Can't get defaultRedirect to work
In my web.config, I have: In Views/Shared/Error.cshtml, I have: @model System.Web.Mvc.HandleErrorInfo @{ ViewBag.Title = "Error"; } Sorry, an error occurred while processing your request. If I put an invalid URL/route into my browser, I get this: Server Error in '/' Application. The resource cannot be found. Descriptio...
The defaultRedirect won't go directly to a view. Your defaultRedirect looks like a razor view file which it can't process. For example: Where does it get the model from? It isn't, and can't, be specified in the config file so it can't process a view. If you want more dynamic error pages in MVC you might want to read cu...
Can't get defaultRedirect to work In my web.config, I have: In Views/Shared/Error.cshtml, I have: @model System.Web.Mvc.HandleErrorInfo @{ ViewBag.Title = "Error"; } Sorry, an error occurred while processing your request. If I put an invalid URL/route into my browser, I get this: Server Error in '/' Application. The re...
TITLE: Can't get defaultRedirect to work QUESTION: In my web.config, I have: In Views/Shared/Error.cshtml, I have: @model System.Web.Mvc.HandleErrorInfo @{ ViewBag.Title = "Error"; } Sorry, an error occurred while processing your request. If I put an invalid URL/route into my browser, I get this: Server Error in '/' A...
[ "asp.net-mvc", "asp.net-mvc-3" ]
12
9
19,800
5
0
2011-06-02T07:56:30.903000
2011-06-02T08:03:12.690000
6,211,915
6,212,582
Carbon Emacs does not paste Microsoft Word's copied contents
Not Sure if Stackoverflow is right site. I'm using carbon emacs 22.0.971 on mac ox 10.6.7. And MS word 12.2.8. I have some text in MS word which i want to copy and paste into emacs. I do the normal procedure cmd C in word, C-y in emacs, but the text does not get copied in emacs, instead it looks a bitmap of the copied ...
That's because yank does not not paste from the clipboard, but from the kill ring. Try M-x clipboard-yank instead. If you do not want to type that command every time, bind it to some keyboard shortcut, e.g. C-x y, by putting the following line into your.emacs file: (global-set-key [(control x) (y)] 'clipboard-yank)
Carbon Emacs does not paste Microsoft Word's copied contents Not Sure if Stackoverflow is right site. I'm using carbon emacs 22.0.971 on mac ox 10.6.7. And MS word 12.2.8. I have some text in MS word which i want to copy and paste into emacs. I do the normal procedure cmd C in word, C-y in emacs, but the text does not ...
TITLE: Carbon Emacs does not paste Microsoft Word's copied contents QUESTION: Not Sure if Stackoverflow is right site. I'm using carbon emacs 22.0.971 on mac ox 10.6.7. And MS word 12.2.8. I have some text in MS word which i want to copy and paste into emacs. I do the normal procedure cmd C in word, C-y in emacs, but ...
[ "text", "emacs", "ms-word", "copy", "paste" ]
2
4
699
2
0
2011-06-02T07:56:51.350000
2011-06-02T09:16:43.047000
6,211,916
6,213,604
What is the meaning of 'in the same block formatting context?'
In the CSS 2.1 specification; "This property indicates which sides of an element's box(es) may not be adjacent to an earlier floating box. The 'clear' property does not consider floats inside the element itself or in other block formatting contexts." As we know, the property float can eatablish a new block formatting c...
If I may refer to the other question related to this ( for the images!): How does the CSS Block Formatting Context work? in the first 2 images all the elements, left column, right column, h3, p and the 2 x floated boxes are all in the same Block formatting Context, the root element is responsible for positioning them a...
What is the meaning of 'in the same block formatting context?' In the CSS 2.1 specification; "This property indicates which sides of an element's box(es) may not be adjacent to an earlier floating box. The 'clear' property does not consider floats inside the element itself or in other block formatting contexts." As we ...
TITLE: What is the meaning of 'in the same block formatting context?' QUESTION: In the CSS 2.1 specification; "This property indicates which sides of an element's box(es) may not be adjacent to an earlier floating box. The 'clear' property does not consider floats inside the element itself or in other block formatting...
[ "css" ]
3
1
350
1
0
2011-06-02T07:56:51.837000
2011-06-02T10:56:15.473000
6,211,919
6,211,931
ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file
When I use the command: C:\>keytool -list -alias androiddebugkey -keystore.android\debug.keystore -storepass android -keypass android I get this error: 'keytool' is not recognized as an internal or external command, operable program or batch file. I'm not able to get the certificate fingerprint(MD5) on my computer. I h...
Check that the directory the keytool executable is in is on your %PATH% environment variable. For example, on my Windows 7 machine, it is in C:\Program Files (x86)\Java\jre6\bin, and my %PATH% variable looks like C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Java\jre6\bin;C:\WINDOWS\Sy...
ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file When I use the command: C:\>keytool -list -alias androiddebugkey -keystore.android\debug.keystore -storepass android -keypass android I get this error: 'keytool' is not recognized as an internal or external command, ope...
TITLE: ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file QUESTION: When I use the command: C:\>keytool -list -alias androiddebugkey -keystore.android\debug.keystore -storepass android -keypass android I get this error: 'keytool' is not recognized as an internal or ext...
[ "android", "keytool" ]
222
280
489,119
34
0
2011-06-02T07:57:11.570000
2011-06-02T07:59:14.970000
6,211,920
6,211,953
Slideshow flashing violently
I'm trying to write some code for a slideshow background. Please not watch what I have for more than 5 seconds for fear of seizures. If you could please help me fix my problem that would be wonderful. http://ftp.gigemposters.com
EDIT: This code should work: $(function(){ $('#background').each(function(){ var $imgArray = $(this).children(); $imgArray.eq(Math.floor(Math.random()*$imgArray.length)).switchClass('hidden','visible',0); }); setInterval(function(){changeImage();},5000); function changeImage() { if($('.bg:last').hasClass('visible')) ...
Slideshow flashing violently I'm trying to write some code for a slideshow background. Please not watch what I have for more than 5 seconds for fear of seizures. If you could please help me fix my problem that would be wonderful. http://ftp.gigemposters.com
TITLE: Slideshow flashing violently QUESTION: I'm trying to write some code for a slideshow background. Please not watch what I have for more than 5 seconds for fear of seizures. If you could please help me fix my problem that would be wonderful. http://ftp.gigemposters.com ANSWER: EDIT: This code should work: $(func...
[ "jquery", "html", "css", "jquery-ui" ]
0
0
190
1
0
2011-06-02T07:57:16.240000
2011-06-02T08:02:18.590000
6,211,925
6,212,316
Text revision comparison StackOverflow-style for ASP.NET MVC?
I'd like to show revisions of text, and I love how StackOverflow does it (e.g. see below). Is there an open source.NET code that can receive two texts and output such a result? If you know of a paid solution that may also be relevant, thanks.
You may checkout the following javascript library by John Resig.
Text revision comparison StackOverflow-style for ASP.NET MVC? I'd like to show revisions of text, and I love how StackOverflow does it (e.g. see below). Is there an open source.NET code that can receive two texts and output such a result? If you know of a paid solution that may also be relevant, thanks.
TITLE: Text revision comparison StackOverflow-style for ASP.NET MVC? QUESTION: I'd like to show revisions of text, and I love how StackOverflow does it (e.g. see below). Is there an open source.NET code that can receive two texts and output such a result? If you know of a paid solution that may also be relevant, thank...
[ "asp.net-mvc", "text-comparison" ]
2
5
252
1
0
2011-06-02T07:58:15.997000
2011-06-02T08:47:26.980000
6,211,926
6,212,017
Which standard does VS2005, VS2008 follow?
Do they both follow the C++03 released in 2003?
They both target C++03, yes. But they also both have areas where they fail to comply with the standard. (So does GCC, btw, before any fanboys on either side starts frothing at the mouth). But keep in mind that C++03 is basically a very small bugfix release, nailing down a few "common sense" things that sensible compile...
Which standard does VS2005, VS2008 follow? Do they both follow the C++03 released in 2003?
TITLE: Which standard does VS2005, VS2008 follow? QUESTION: Do they both follow the C++03 released in 2003? ANSWER: They both target C++03, yes. But they also both have areas where they fail to comply with the standard. (So does GCC, btw, before any fanboys on either side starts frothing at the mouth). But keep in mi...
[ "c++", "visual-studio-2008", "visual-studio-2005" ]
7
8
4,027
3
0
2011-06-02T07:58:31.647000
2011-06-02T08:10:43.603000
6,211,927
6,211,974
Whats possible in a for loop
So today I went to an interview and one of the questions was the following (C# context). //Print the output for the following code: for (int i = 10, j = 0; j <= 10; j++, i--) { if (i > j) Console.WriteLine(j.ToString()); } I have never seen such a construct before and having asked my colleagues, 4 of 5 at my workplace ...
for (statement1; statement2; statement3) { /* body */ } (1) First the statement1 is executed. (2) Next statement2 is executed. (3) If the evaluation of statement2 is true then the body is executed (4) Then statement3 is executed. (5) Repeat from step (2) | +<-----------------+ | | ^ V V | for ( (s1); -------->(s2 true?...
Whats possible in a for loop So today I went to an interview and one of the questions was the following (C# context). //Print the output for the following code: for (int i = 10, j = 0; j <= 10; j++, i--) { if (i > j) Console.WriteLine(j.ToString()); } I have never seen such a construct before and having asked my collea...
TITLE: Whats possible in a for loop QUESTION: So today I went to an interview and one of the questions was the following (C# context). //Print the output for the following code: for (int i = 10, j = 0; j <= 10; j++, i--) { if (i > j) Console.WriteLine(j.ToString()); } I have never seen such a construct before and havi...
[ "c#", "java", "c", "loops", "for-loop" ]
16
25
1,735
8
0
2011-06-02T07:58:48.950000
2011-06-02T08:04:25.947000
6,211,929
6,212,062
Combobox change value of other combobox
I have two comboboxes on an form. Each has the values Yes and No. What I want is when one is changed the other get the opposite (if the first is Yes the other is No).I need to do it with Javascript. I saw this question How to change "selected" value in combobox using JavaScript? but it is applied to only one combobox. ...
I created a simple jsFiddle Demo. This is not perfect, just illustrates the idea. HTML: No Yes No Yes Javascript: //find the selects in the DOM var first = document.getElementById('first'); var second = document.getElementById('second'); //this is the handler function we will run when change event occurs var handler =...
Combobox change value of other combobox I have two comboboxes on an form. Each has the values Yes and No. What I want is when one is changed the other get the opposite (if the first is Yes the other is No).I need to do it with Javascript. I saw this question How to change "selected" value in combobox using JavaScript? ...
TITLE: Combobox change value of other combobox QUESTION: I have two comboboxes on an form. Each has the values Yes and No. What I want is when one is changed the other get the opposite (if the first is Yes the other is No).I need to do it with Javascript. I saw this question How to change "selected" value in combobox ...
[ "javascript", "combobox", "dom-events" ]
2
6
18,093
3
0
2011-06-02T07:59:03.800000
2011-06-02T08:15:32.447000
6,211,944
6,212,136
How to Learn advanced concepts in developing Web Servers
I recently wrote a small C code which uses sockets to listen on a port. It simply echos back the request made to it by a browser. It creates a thread for daemon process and also for servicing new requests. I am doing it simply to learn more about webservers in general. I wanted to know what to do ahead? I was planning ...
This is a really good book on HTTP. I recommend getting started with that then maybe the relevant RFC's. Also maybe check out the source of libcurl, a c library for http, https, ftp etc. Hope this helps:) Also Tiny HTTPd is a small http server someone wrote for a school project, you can learn a lot from the source from...
How to Learn advanced concepts in developing Web Servers I recently wrote a small C code which uses sockets to listen on a port. It simply echos back the request made to it by a browser. It creates a thread for daemon process and also for servicing new requests. I am doing it simply to learn more about webservers in ge...
TITLE: How to Learn advanced concepts in developing Web Servers QUESTION: I recently wrote a small C code which uses sockets to listen on a port. It simply echos back the request made to it by a browser. It creates a thread for daemon process and also for servicing new requests. I am doing it simply to learn more abou...
[ "c", "sockets", "webserver" ]
1
1
159
1
0
2011-06-02T08:00:46.640000
2011-06-02T08:26:20.303000
6,211,950
6,214,342
How to detect .o / .a / compiled object /executable c/c++ without extension? (to then issue 'what' on file to see what it was compiled with)
How can I detect if a file is a compiled object (.o.a (library)) or executable, without the file extension? I want to do this so that I can then issue the standard what command to see what.c /.h files were used to build the binary. Presumably there would be some kind of header at the beginning of the file or some other...
If you're in Unix/Linux, the file command is useful for determining file type of files without relying on a file extension. It looks at things like "is this a special device rather than a normal file", then looks for "magic numbers" which identify certain file format, etc.
How to detect .o / .a / compiled object /executable c/c++ without extension? (to then issue 'what' on file to see what it was compiled with) How can I detect if a file is a compiled object (.o.a (library)) or executable, without the file extension? I want to do this so that I can then issue the standard what command to...
TITLE: How to detect .o / .a / compiled object /executable c/c++ without extension? (to then issue 'what' on file to see what it was compiled with) QUESTION: How can I detect if a file is a compiled object (.o.a (library)) or executable, without the file extension? I want to do this so that I can then issue the standa...
[ "executable", "detection", "file-type", ".obj", ".a" ]
0
1
355
1
0
2011-06-02T08:01:25.500000
2011-06-02T12:11:41.163000
6,211,951
6,211,980
Problem with restriction in xsd
Why cant I put restriction on any type like this?
Because its meaningless, semantically it would be like the statment "You can't do nothing" More syntactically, after reading about xs:restriction, I think that xs:any is not a built in data type, simpleType element or a complexType element but rather a place holder for extending a document with any element.
Problem with restriction in xsd Why cant I put restriction on any type like this?
TITLE: Problem with restriction in xsd QUESTION: Why cant I put restriction on any type like this? ANSWER: Because its meaningless, semantically it would be like the statment "You can't do nothing" More syntactically, after reading about xs:restriction, I think that xs:any is not a built in data type, simpleType elem...
[ "xsd" ]
0
1
1,081
2
0
2011-06-02T08:01:32.177000
2011-06-02T08:05:42.707000
6,211,954
6,212,092
Removing non Printable values aftert Encoding.ASCII.GetString()
Suppose I have a Byte array and I use Encoding.ASCII.GetString() to convert the bytes into a string. Now the first few bytes will contain actual values, but the remaining ones will all have value of 0. After obtaining the string, when I show it on a WPF Form, there are some non printable characters. How can I remove th...
var buffer = new byte[] { 65, 66, 67, 68, 0, 0, 0, 0, 0 }; var length = buffer.TakeWhile(b => b!= 0).Count(); var text = Encoding.UTF8.GetString(buffer, 0, length);
Removing non Printable values aftert Encoding.ASCII.GetString() Suppose I have a Byte array and I use Encoding.ASCII.GetString() to convert the bytes into a string. Now the first few bytes will contain actual values, but the remaining ones will all have value of 0. After obtaining the string, when I show it on a WPF Fo...
TITLE: Removing non Printable values aftert Encoding.ASCII.GetString() QUESTION: Suppose I have a Byte array and I use Encoding.ASCII.GetString() to convert the bytes into a string. Now the first few bytes will contain actual values, but the remaining ones will all have value of 0. After obtaining the string, when I s...
[ "c#", "string", "encoding", "byte", "non-printing-characters" ]
2
4
4,457
2
0
2011-06-02T08:02:19.293000
2011-06-02T08:19:51.210000
6,211,959
6,233,143
HTML5 DIV flashes on tap
When receving an onclick event from a DIV as a result of a tap on the iPad, The DIV automatically flashes to a dark color to give the user feedback for the tap. Is there any way to prevent this flash from occurring?
It's because there are events on the element. Just set: div { -webkit-tap-highlight-color: rgba(0,0,0,0); }
HTML5 DIV flashes on tap When receving an onclick event from a DIV as a result of a tap on the iPad, The DIV automatically flashes to a dark color to give the user feedback for the tap. Is there any way to prevent this flash from occurring?
TITLE: HTML5 DIV flashes on tap QUESTION: When receving an onclick event from a DIV as a result of a tap on the iPad, The DIV automatically flashes to a dark color to give the user feedback for the tap. Is there any way to prevent this flash from occurring? ANSWER: It's because there are events on the element. Just s...
[ "javascript", "html", "mobile-safari" ]
23
56
6,781
2
0
2011-06-02T08:03:01.733000
2011-06-03T22:07:25.323000
6,211,960
6,212,374
jquery creating repeteable inner divs dynamically
this is a little bit complicated question. I want to achieve the following behaviour (creating sections dynamically): I'm sending the whole example: E.g. I have parent div and child div inside this parrent. In each div can be some placed some controls (inputs, buttons,...). I have following requirements: each section c...
instead of reading the html of sections you can make a template for parent section and a template for child section then adding action to get html of parent/child template with new IDs then append it to your page. like the following Remove child Add child Remove child Add child you may find the result doesn't like you ...
jquery creating repeteable inner divs dynamically this is a little bit complicated question. I want to achieve the following behaviour (creating sections dynamically): I'm sending the whole example: E.g. I have parent div and child div inside this parrent. In each div can be some placed some controls (inputs, buttons,....
TITLE: jquery creating repeteable inner divs dynamically QUESTION: this is a little bit complicated question. I want to achieve the following behaviour (creating sections dynamically): I'm sending the whole example: E.g. I have parent div and child div inside this parrent. In each div can be some placed some controls ...
[ "jquery" ]
0
1
640
1
0
2011-06-02T08:03:03.393000
2011-06-02T08:53:25.217000
6,211,990
6,224,685
Delphi 7 - TMS Intraweb DB-aware Grid ComboBox
I have an Intraweb application which is using the TTIWDBAdvWebGrid component. Two columns of the grid are comboboxes (editor is set to edCombo) - look at the picture below What I want is that when one of the comboboxes is changed the other changed it's value to opposite (if first is YES then the other is NO). I've trie...
Resolved by using the following javascript code: if (c==5) {wId = "G0D" + r + "C" + (c + 1);} else {wId = "G0D" + r + "C" + (c - 1);} myCombo = document.getElementById( wId); if (ctrl.selectedIndex==0) { wInd=1;} else {wInd=0;} myCombo.options[wInd].selected=true; Intraweb is generating the id for each combo by concate...
Delphi 7 - TMS Intraweb DB-aware Grid ComboBox I have an Intraweb application which is using the TTIWDBAdvWebGrid component. Two columns of the grid are comboboxes (editor is set to edCombo) - look at the picture below What I want is that when one of the comboboxes is changed the other changed it's value to opposite (i...
TITLE: Delphi 7 - TMS Intraweb DB-aware Grid ComboBox QUESTION: I have an Intraweb application which is using the TTIWDBAdvWebGrid component. Two columns of the grid are comboboxes (editor is set to edCombo) - look at the picture below What I want is that when one of the comboboxes is changed the other changed it's va...
[ "javascript", "delphi", "combobox", "intraweb", "tms" ]
0
0
1,130
1
0
2011-06-02T08:06:49.183000
2011-06-03T08:21:57.250000
6,212,005
6,212,563
Rails 3 image translations with i18n and tolk
I have implemented tolk engine by dhh to add translations and then create.yml files from it. It works well for text. Now what I want is same behavior over images. I create follwing structure in my en.yml file - images: logo: "/images/en/logo.png" and for hi images: logo: "/images/hi/logo.png and in my views, I have - <...
Im not familiar with tolk, but what about using the i18n in the path of an image_tag Something like: <%= image_tag("images/#{t("i18n")}/logo.png") %>
Rails 3 image translations with i18n and tolk I have implemented tolk engine by dhh to add translations and then create.yml files from it. It works well for text. Now what I want is same behavior over images. I create follwing structure in my en.yml file - images: logo: "/images/en/logo.png" and for hi images: logo: "/...
TITLE: Rails 3 image translations with i18n and tolk QUESTION: I have implemented tolk engine by dhh to add translations and then create.yml files from it. It works well for text. Now what I want is same behavior over images. I create follwing structure in my en.yml file - images: logo: "/images/en/logo.png" and for h...
[ "ruby-on-rails", "ruby-on-rails-3", "internationalization" ]
1
1
1,308
1
0
2011-06-02T08:08:55.500000
2011-06-02T09:15:08.973000
6,212,008
6,212,029
Does adding [DataContract] and [DataMember] to all classes impact performance
Lets say we got a code generating tool that creates thousands of C# classes, and we sometimes need to add those attributes to them. We are considering whether it is better to put [DataContract] and [DataMember] on all appropriate classes or we need to create a special strategy that will determine whether to do so in or...
Adding attributes would impact in performance if these are inspected in some part of the code, if not, classes would have more metadata, but this doesn't impact performance.
Does adding [DataContract] and [DataMember] to all classes impact performance Lets say we got a code generating tool that creates thousands of C# classes, and we sometimes need to add those attributes to them. We are considering whether it is better to put [DataContract] and [DataMember] on all appropriate classes or w...
TITLE: Does adding [DataContract] and [DataMember] to all classes impact performance QUESTION: Lets say we got a code generating tool that creates thousands of C# classes, and we sometimes need to add those attributes to them. We are considering whether it is better to put [DataContract] and [DataMember] on all approp...
[ "c#", "c#-4.0", "datacontract" ]
5
3
736
3
0
2011-06-02T08:09:05.583000
2011-06-02T08:12:31.813000
6,212,009
6,212,054
error C2027: use of undefined type GUITHREADINFO
during build with Visual Studio C++ I get this error: error C2027: use of undefined type 'rectAnalyzer::GUITHREADINFO' the function rectAnalyzer is the following: DWORD WINAPI rectAnalyzer(LPVOID param) { MSG msg; PARAM_PASSED *p = (PARAM_PASSED*) param; std::ostringstream ss; std::wstring str; PGUITHREADINFO g = (PGUI...
Try using sizeof(GUITHREADINFO) instead of sizeof(struct GUITHREADINFO)
error C2027: use of undefined type GUITHREADINFO during build with Visual Studio C++ I get this error: error C2027: use of undefined type 'rectAnalyzer::GUITHREADINFO' the function rectAnalyzer is the following: DWORD WINAPI rectAnalyzer(LPVOID param) { MSG msg; PARAM_PASSED *p = (PARAM_PASSED*) param; std::ostringstre...
TITLE: error C2027: use of undefined type GUITHREADINFO QUESTION: during build with Visual Studio C++ I get this error: error C2027: use of undefined type 'rectAnalyzer::GUITHREADINFO' the function rectAnalyzer is the following: DWORD WINAPI rectAnalyzer(LPVOID param) { MSG msg; PARAM_PASSED *p = (PARAM_PASSED*) param...
[ "c++", "visual-studio-2010", "undefined", "hwnd" ]
0
1
1,319
1
0
2011-06-02T08:09:17.633000
2011-06-02T08:15:01.617000
6,212,015
6,212,784
xpath assertionfor soap web service in jmeter
I need to test using JMeter XPath, I have an response text foer And I need to test if the name is equal to foer, I used XPath assertion as /example/name/entry[@key='name']/text()='foer' but I get: No Nodes Matched `/example/name/entry[@key='name']/text()='foer'
in your example xml there is no entry element and no @key attribute. Plus the example element is not the root element. try this instead for just testing the existence: //example/name/text() = "foer" or for selecting the example element: //example[name/text() = "foer"]
xpath assertionfor soap web service in jmeter I need to test using JMeter XPath, I have an response text foer And I need to test if the name is equal to foer, I used XPath assertion as /example/name/entry[@key='name']/text()='foer' but I get: No Nodes Matched `/example/name/entry[@key='name']/text()='foer'
TITLE: xpath assertionfor soap web service in jmeter QUESTION: I need to test using JMeter XPath, I have an response text foer And I need to test if the name is equal to foer, I used XPath assertion as /example/name/entry[@key='name']/text()='foer' but I get: No Nodes Matched `/example/name/entry[@key='name']/text()='...
[ "java", "web-services", "xpath", "jmeter" ]
2
3
4,726
1
0
2011-06-02T08:10:21.823000
2011-06-02T09:40:27.833000
6,212,021
6,212,069
nHiberbate: Table per hierarchy - SchemaExport problem
I am using nhibernate to map the following classes: public class DeviceConfig: EntityBase { public virtual string Name { get { return m_Name; } set { SetValue(ref m_Name, value); } } public virtual string Description { get { return m_Description; } set { SetValue(ref m_Description, EmptyStringIfValueNull(value)); } } }...
You've set the columns as not null in the mapping:.... Remove the not-null attributes.
nHiberbate: Table per hierarchy - SchemaExport problem I am using nhibernate to map the following classes: public class DeviceConfig: EntityBase { public virtual string Name { get { return m_Name; } set { SetValue(ref m_Name, value); } } public virtual string Description { get { return m_Description; } set { SetValue(r...
TITLE: nHiberbate: Table per hierarchy - SchemaExport problem QUESTION: I am using nhibernate to map the following classes: public class DeviceConfig: EntityBase { public virtual string Name { get { return m_Name; } set { SetValue(ref m_Name, value); } } public virtual string Description { get { return m_Description; ...
[ "c#", "nhibernate", "table-per-hierarchy" ]
0
0
146
1
0
2011-06-02T08:11:10.707000
2011-06-02T08:16:26.873000
6,212,028
6,212,633
Background repeat only on one side of the site layout, content centered?
How can I repeat endlessly a background color/image only on one side of my site layout and keep the content centered? The best method seems to be with tables as it will work even in IE6, however is there a method to do this without tables and javascript and be working in at least IE7+? The method with divs/display:tabl...
You can achieve cool effects like half screen background colours by using position absolute. And there are easier ways to center text than using the display: table layout - which I have also shown in my CSS. Here is a working examnple on JSFiddle and I have done my best to explain the CSS in comments below. Here is the...
Background repeat only on one side of the site layout, content centered? How can I repeat endlessly a background color/image only on one side of my site layout and keep the content centered? The best method seems to be with tables as it will work even in IE6, however is there a method to do this without tables and java...
TITLE: Background repeat only on one side of the site layout, content centered? QUESTION: How can I repeat endlessly a background color/image only on one side of my site layout and keep the content centered? The best method seems to be with tables as it will work even in IE6, however is there a method to do this witho...
[ "css", "internet-explorer", "css-tables" ]
2
4
6,850
2
0
2011-06-02T08:12:28.713000
2011-06-02T09:22:16.917000
6,212,030
6,212,053
Adding DISTINCT to a UNION query
How do I get distinct title.id's from this: SELECT Title.id, Title.title FROM titles as Title HAVING points > 0 UNION ALL SELECT Title.id, Title.title FROM titles as Title HAVING points > 1 There is more to the query but this should be enough to go on.
Just remove the ALL. Some flavors allow adding DISTINCT instead of ALL to be more explicit, but that's redundant having that the default is always to filter our duplicates. MySQL - http://dev.mysql.com/doc/refman/5.0/en/union.html MSSQL - http://msdn.microsoft.com/en-us/library/ms180026.aspx ORACLE - https://docs.oracl...
Adding DISTINCT to a UNION query How do I get distinct title.id's from this: SELECT Title.id, Title.title FROM titles as Title HAVING points > 0 UNION ALL SELECT Title.id, Title.title FROM titles as Title HAVING points > 1 There is more to the query but this should be enough to go on.
TITLE: Adding DISTINCT to a UNION query QUESTION: How do I get distinct title.id's from this: SELECT Title.id, Title.title FROM titles as Title HAVING points > 0 UNION ALL SELECT Title.id, Title.title FROM titles as Title HAVING points > 1 There is more to the query but this should be enough to go on. ANSWER: Just re...
[ "mysql", "sql", "union", "distinct", "union-all" ]
7
18
31,743
3
0
2011-06-02T08:12:33.720000
2011-06-02T08:14:51.910000
6,212,032
6,212,086
Detecting Valid URLs
Possible Duplicate: Java HTTP getResponseCode returns 200 for non-existent URL Hello, my goal is to build an application that determines the validity of HTML links, however in my following code: try { // create the HttpURLConnection URL url = new URL("http://www.thisurldoesnotexist"); HttpURLConnection connection = (Ht...
You could: Resolve the IP from the host of the page Try to connect to port 80 on the resolved IP using plain sockets This however will add complexity since you will need to make a simple GET request through the socket. Then validate the response so you're sure that its actually a HTTP server running on port 80. NMap mi...
Detecting Valid URLs Possible Duplicate: Java HTTP getResponseCode returns 200 for non-existent URL Hello, my goal is to build an application that determines the validity of HTML links, however in my following code: try { // create the HttpURLConnection URL url = new URL("http://www.thisurldoesnotexist"); HttpURLConnec...
TITLE: Detecting Valid URLs QUESTION: Possible Duplicate: Java HTTP getResponseCode returns 200 for non-existent URL Hello, my goal is to build an application that determines the validity of HTML links, however in my following code: try { // create the HttpURLConnection URL url = new URL("http://www.thisurldoesnotexis...
[ "java", "networking" ]
0
0
87
1
0
2011-06-02T08:12:47.137000
2011-06-02T08:18:57.090000
6,212,042
6,213,915
Why does the VBA IDE's Intellisense in Microsoft Word 2007 keep on changing the case of the name of a particular variable type?
This is the most bizarre question I've ever asked. I'm not even sure how to phrase it. I remember something like this happening way back in the VB6 IDE, but I've forgotten the fix. If this is the case, then this is a really old bug in the VB IDE. Here's the problem: I'm writing a simple MS Word macro when I accidently ...
Try putting a Dim Cell as Cell somewhere, then delete it and try again... I seem to recall that variable declarations take precedence in setting the casing, thus this should force the casing back to how it should be...
Why does the VBA IDE's Intellisense in Microsoft Word 2007 keep on changing the case of the name of a particular variable type? This is the most bizarre question I've ever asked. I'm not even sure how to phrase it. I remember something like this happening way back in the VB6 IDE, but I've forgotten the fix. If this is ...
TITLE: Why does the VBA IDE's Intellisense in Microsoft Word 2007 keep on changing the case of the name of a particular variable type? QUESTION: This is the most bizarre question I've ever asked. I'm not even sure how to phrase it. I remember something like this happening way back in the VB6 IDE, but I've forgotten th...
[ "vba", "ms-office" ]
7
6
903
2
0
2011-06-02T08:13:45.577000
2011-06-02T11:28:00.307000
6,212,047
6,217,869
how to pass json object to a java rest webservice using jax rs
I need help with the method signature on the updateGroup method. Here is the json im passing - its an array of actions. [{"action":"add","key":"104"}] this is the method its being passed to @PUT @Path("/group/{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public IRestResponse updateG...
You can use whatever collection type you want: List, Collection, ArrayList, HashSet etc; or, what is sometimes better, array of specified type. So, one of: public IRestResponse updateGroup(..., List groupActions); public IRestResponse updateGroup(..., GroupAction[] groupActions); public IRestResponse updateGroup(..., H...
how to pass json object to a java rest webservice using jax rs I need help with the method signature on the updateGroup method. Here is the json im passing - its an array of actions. [{"action":"add","key":"104"}] this is the method its being passed to @PUT @Path("/group/{id}") @Consumes(MediaType.APPLICATION_JSON) @Pr...
TITLE: how to pass json object to a java rest webservice using jax rs QUESTION: I need help with the method signature on the updateGroup method. Here is the json im passing - its an array of actions. [{"action":"add","key":"104"}] this is the method its being passed to @PUT @Path("/group/{id}") @Consumes(MediaType.APP...
[ "java", "json", "rest", "jax-rs", "jackson" ]
0
3
2,364
2
0
2011-06-02T08:14:17.857000
2011-06-02T17:20:24.983000
6,212,048
6,214,539
ValidateInput(false) not working
I have read all the similar question on SO already and none of the solutions seem to work for me. I am submitting HTML (from CKEditor) to a controller I have [ValidateInput(false)] on my Contoller and on my Action I also have in my web.config and the web.config for the Area my view is in. However my HTML is still getti...
Unbelievable. I see the error when I declared my instance of CKeditor on of the options set was htmlEncodeOutput: true, hangs head in shame * No idea how that line got in there. But without it everything works as expected
ValidateInput(false) not working I have read all the similar question on SO already and none of the solutions seem to work for me. I am submitting HTML (from CKEditor) to a controller I have [ValidateInput(false)] on my Contoller and on my Action I also have in my web.config and the web.config for the Area my view is i...
TITLE: ValidateInput(false) not working QUESTION: I have read all the similar question on SO already and none of the solutions seem to work for me. I am submitting HTML (from CKEditor) to a controller I have [ValidateInput(false)] on my Contoller and on my Action I also have in my web.config and the web.config for the...
[ "ckeditor" ]
0
0
570
1
0
2011-06-02T08:14:18.390000
2011-06-02T12:32:16.190000
6,212,049
6,212,088
pubDate to unixtime in javascript
Does anyone have a function which can covert an RSS feeds pubDate to a unix timestamp? I tired using a javascript version of strtotime() but it never worked correctly.
var pubDate = "Sun, 27 Mar 2011 20:17:21 +0100"; var date = new Date(pubDate); var timestamp = Math.round(date.getTime()/1000); alert(timestamp); http://jsfiddle.net/VDwVB/1/
pubDate to unixtime in javascript Does anyone have a function which can covert an RSS feeds pubDate to a unix timestamp? I tired using a javascript version of strtotime() but it never worked correctly.
TITLE: pubDate to unixtime in javascript QUESTION: Does anyone have a function which can covert an RSS feeds pubDate to a unix timestamp? I tired using a javascript version of strtotime() but it never worked correctly. ANSWER: var pubDate = "Sun, 27 Mar 2011 20:17:21 +0100"; var date = new Date(pubDate); var timesta...
[ "javascript", "date", "time", "rss" ]
1
6
854
3
0
2011-06-02T08:14:26.317000
2011-06-02T08:19:13.243000
6,212,075
6,212,254
How POCO (de)serialization works in protobuf-net?
Is it possible to (de)serialize a POCO type using neither protobuf-net attributes nor explicitly adding types into the model?
At the moment - in short, no. It needs to have a basic understanding of how you intend it to operate. I guess maybe I could add something to let you specify a default strategy for completely unadorned types (things that aren't DataContract, ProtoContract or XmlType ), but the most appropriate option there would be "all...
How POCO (de)serialization works in protobuf-net? Is it possible to (de)serialize a POCO type using neither protobuf-net attributes nor explicitly adding types into the model?
TITLE: How POCO (de)serialization works in protobuf-net? QUESTION: Is it possible to (de)serialize a POCO type using neither protobuf-net attributes nor explicitly adding types into the model? ANSWER: At the moment - in short, no. It needs to have a basic understanding of how you intend it to operate. I guess maybe I...
[ ".net", "protobuf-net" ]
2
2
682
3
0
2011-06-02T08:17:24.553000
2011-06-02T08:40:10.490000
6,212,090
6,212,854
Old file fragment understanding - For those up for a challenge
I am trying to grab PVS (rendering with line of sight) information from an old game format. It has documentation and I have been able to translate everything into C++ code up to this point. This part however confuses the heck out of me. I spent a few hours today trying to understand where to start but alas, I have noth...
This is my attempt to implement that unpacker. Not tested as there is no example data to test it with... (not even compiled, actually) std::vector regions(std::vector & data6) { int rp = 0, sz = data6.size(); std::vector result; int current_id = 0; while (rp < sz) { int c = data6[rp++]; if (c <= 0x3E) { // 0x00..0x3E: ...
Old file fragment understanding - For those up for a challenge I am trying to grab PVS (rendering with line of sight) information from an old game format. It has documentation and I have been able to translate everything into C++ code up to this point. This part however confuses the heck out of me. I spent a few hours ...
TITLE: Old file fragment understanding - For those up for a challenge QUESTION: I am trying to grab PVS (rendering with line of sight) information from an old game format. It has documentation and I have been able to translate everything into C++ code up to this point. This part however confuses the heck out of me. I ...
[ "fragment" ]
2
1
139
1
0
2011-06-02T08:19:33.163000
2011-06-02T09:46:27.240000
6,212,104
6,218,120
Protovis vs D3.js
TLDR: Does anyone have experience of both protovis & D3.js to illuminate the differences between the two? I've been playing with protovis for the last 2 weeks and it's been great so far. Except now I seem to have hit a bit of a brick wall with animation. protovis: http://vis.stanford.edu/protovis/ I want to do some qui...
I've done a fair amount of work with Protovis and a few things with D3. In addition to the points you mention, I think the following differences stand out for me: Where Protovis provides a simplified abstraction layer between the visual properties you're specifying, D3 uses the actual CSS and DOM specs - so instead of....
Protovis vs D3.js TLDR: Does anyone have experience of both protovis & D3.js to illuminate the differences between the two? I've been playing with protovis for the last 2 weeks and it's been great so far. Except now I seem to have hit a bit of a brick wall with animation. protovis: http://vis.stanford.edu/protovis/ I w...
TITLE: Protovis vs D3.js QUESTION: TLDR: Does anyone have experience of both protovis & D3.js to illuminate the differences between the two? I've been playing with protovis for the last 2 weeks and it's been great so far. Except now I seem to have hit a bit of a brick wall with animation. protovis: http://vis.stanford...
[ "javascript", "protovis", "d3.js" ]
85
118
23,146
3
0
2011-06-02T08:22:26.793000
2011-06-02T17:40:05.090000
6,212,105
6,212,508
Is it possible to access parent class's members from a nested class in an aggregation
My Question is, say i declare a class within a class, as a sort of an aggregation: class A: self.foo = 20 self.bar = 30 def someFunc(self): class B: # some code here BObject = B() is it possible to access the foo/bar variables from within class B? If yes, then how? I have run into this problem while using wxpython,...
class A(object): foo = 20 bar = 30 def build_b(self): class B(object): foo = self.foo bar = self.bar return B() Then you could do: >>> b_obj = A().build_b() >>> b_obj.foo, b_obj.bar <<< (20, 30) But, you should really break class B out of class A if you can, use it's __init__ method to initialize it...
Is it possible to access parent class's members from a nested class in an aggregation My Question is, say i declare a class within a class, as a sort of an aggregation: class A: self.foo = 20 self.bar = 30 def someFunc(self): class B: # some code here BObject = B() is it possible to access the foo/bar variables fro...
TITLE: Is it possible to access parent class's members from a nested class in an aggregation QUESTION: My Question is, say i declare a class within a class, as a sort of an aggregation: class A: self.foo = 20 self.bar = 30 def someFunc(self): class B: # some code here BObject = B() is it possible to access the foo...
[ "python", "class", "aggregation" ]
0
1
500
2
0
2011-06-02T08:22:48.137000
2011-06-02T09:10:04.700000
6,212,109
6,212,191
Can I open UNIX POSIX ports from Python?
Can I open UNIX POSIX ports from Python 2.7 ( I don't need IP port, just UNIX POSIX)? Does anybody have experience with this?
I assume you are talking about Unix domain sockets (I'm not sure what you mean by "UNIX POSIX port"... IP sockets have ports, Unix sockets don't). The standard system calls are available through a thin wrapper. import socket s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.bind("/path/to/socket") s.listen(100) w...
Can I open UNIX POSIX ports from Python? Can I open UNIX POSIX ports from Python 2.7 ( I don't need IP port, just UNIX POSIX)? Does anybody have experience with this?
TITLE: Can I open UNIX POSIX ports from Python? QUESTION: Can I open UNIX POSIX ports from Python 2.7 ( I don't need IP port, just UNIX POSIX)? Does anybody have experience with this? ANSWER: I assume you are talking about Unix domain sockets (I'm not sure what you mean by "UNIX POSIX port"... IP sockets have ports, ...
[ "python" ]
0
5
248
2
0
2011-06-02T08:23:22.447000
2011-06-02T08:32:42.237000
6,212,111
6,212,156
How and where does SSL signing apply to emails?
I am trying to find out how SSL signing of emails work and if it gets signed server side or MTA side? I know this is a bit vague maybe but any resources to read or documentation would help a lot:D Like for example I use a ezComponents mail object to send a mail object to the MTA server. DO I have to sign the mail objec...
SSL is a transport protocol, and there's no such thing as "SSL signing of e-mails". This is why you can't find anything. Signing of e-mail is done using S/MIME standard. Signing is performed by the sender application using sender's X.509 certificate with a corresponding private key. IF the SMTP server has all certifica...
How and where does SSL signing apply to emails? I am trying to find out how SSL signing of emails work and if it gets signed server side or MTA side? I know this is a bit vague maybe but any resources to read or documentation would help a lot:D Like for example I use a ezComponents mail object to send a mail object to ...
TITLE: How and where does SSL signing apply to emails? QUESTION: I am trying to find out how SSL signing of emails work and if it gets signed server side or MTA side? I know this is a bit vague maybe but any resources to read or documentation would help a lot:D Like for example I use a ezComponents mail object to send...
[ "email", "ssl", "ssl-certificate", "signing", "mta" ]
0
2
133
2
0
2011-06-02T08:23:26.437000
2011-06-02T08:28:58.900000
6,212,112
6,215,947
diff_match_patch: Generating side-by-side view
I'm using google-diff-match-patch with my Java app to create a diff. I use the method diff_prettyHtml for generating HTML output of the diff. However, I would like to have two different outputs, so I can put them side-by-side to make it a bit more easy for the user to see the differences. (For example, like Eclipse doe...
Assuming you're not attempting to diff HTML, in which case I'd suggest using DaisyDiff, what you probably want to do with diff-match-patch is line differencing, which is described on a project wiki page. Basically it involves generating an array of hash codes, one for each line of the left and right, and keeping track ...
diff_match_patch: Generating side-by-side view I'm using google-diff-match-patch with my Java app to create a diff. I use the method diff_prettyHtml for generating HTML output of the diff. However, I would like to have two different outputs, so I can put them side-by-side to make it a bit more easy for the user to see ...
TITLE: diff_match_patch: Generating side-by-side view QUESTION: I'm using google-diff-match-patch with my Java app to create a diff. I use the method diff_prettyHtml for generating HTML output of the diff. However, I would like to have two different outputs, so I can put them side-by-side to make it a bit more easy fo...
[ "java", "diff" ]
6
2
5,310
2
0
2011-06-02T08:23:27.627000
2011-06-02T14:32:34.930000
6,212,113
6,212,276
Right to Left text writing support in windows phone 7?
I m building an application for Arabic and in this i want that i should write text from right to left in textbox but i can see only the option to align the text to left or right. How can i get this feature?
Right-to-Left text support is only available in the Windows Phone 7 framework for Mango (7.1), which will not be available to consumers until November(ish) this year. You can download the current beta of the Mango tools from the App Hub and develop applications for Mango in advance of the consumer release. The document...
Right to Left text writing support in windows phone 7? I m building an application for Arabic and in this i want that i should write text from right to left in textbox but i can see only the option to align the text to left or right. How can i get this feature?
TITLE: Right to Left text writing support in windows phone 7? QUESTION: I m building an application for Arabic and in this i want that i should write text from right to left in textbox but i can see only the option to align the text to left or right. How can i get this feature? ANSWER: Right-to-Left text support is o...
[ "windows-phone-7" ]
2
3
508
2
0
2011-06-02T08:23:33.447000
2011-06-02T08:43:08.663000
6,212,116
6,214,373
iPhone: Increment badge counter automatically
Possible Duplicate: Push-Notification Badge auto increment. I have implemented Push Notification for my iPhone application. Whenever I get the message, I want to increment badge value by one so I need not to pass it in Push Notification payload. Is it possible? From here I learnt that I have to manage that from server ...
It's not really a problem. The client just needs to let the server know what messages it has seen. Everyone else is doing it, so just learn how to do it and do it. EDIT: You can set the badge counter using: [UIApplication sharedApplication].applicationIconBadgeNumber = badgeCount; Every time you do, you should send bad...
iPhone: Increment badge counter automatically Possible Duplicate: Push-Notification Badge auto increment. I have implemented Push Notification for my iPhone application. Whenever I get the message, I want to increment badge value by one so I need not to pass it in Push Notification payload. Is it possible? From here I ...
TITLE: iPhone: Increment badge counter automatically QUESTION: Possible Duplicate: Push-Notification Badge auto increment. I have implemented Push Notification for my iPhone application. Whenever I get the message, I want to increment badge value by one so I need not to pass it in Push Notification payload. Is it poss...
[ "iphone", "apple-push-notifications" ]
3
8
13,208
1
0
2011-06-02T08:23:48.620000
2011-06-02T12:15:43.360000
6,212,126
6,212,159
Cleanup old refs in Ruby Version Manager (RVM)
I need to free disk space on my local machine, which is almost allocated into my Ruby Version Manager (RVM) dir. Now, it seems I got just one ruby version ( 1.9.2p136 ): lsoave@ubuntu:~/rails/github/gitwatcher$ ruby -v ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux] lsoave@ubuntu:~/rails/github/gitwatcher$ lso...
I suppose rvm cleanup could do the trick. Other than that I don't see any reason that deleting the actual gem directories inside RVM if they aren't associated with RVM any more. If the matching entry doesn't exist in environments then it is safe to delete the accompanying gem dir. As nothing else points to it that RVM ...
Cleanup old refs in Ruby Version Manager (RVM) I need to free disk space on my local machine, which is almost allocated into my Ruby Version Manager (RVM) dir. Now, it seems I got just one ruby version ( 1.9.2p136 ): lsoave@ubuntu:~/rails/github/gitwatcher$ ruby -v ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux...
TITLE: Cleanup old refs in Ruby Version Manager (RVM) QUESTION: I need to free disk space on my local machine, which is almost allocated into my Ruby Version Manager (RVM) dir. Now, it seems I got just one ruby version ( 1.9.2p136 ): lsoave@ubuntu:~/rails/github/gitwatcher$ ruby -v ruby 1.9.2p136 (2010-12-25 revision ...
[ "ruby", "rvm", "ruby-1.9", "ruby-1.9.2" ]
10
18
8,203
2
0
2011-06-02T08:25:34.833000
2011-06-02T08:29:28
6,212,128
6,212,255
Add ExtJS code assist to IntellijIDEA
how would I enable code-completion, docs-browsing in IntelliJIDEA 10 Ultimate?
Refer to the blog post about working with JavaScript libraries. The same applies for IntelliJ IDEA product.
Add ExtJS code assist to IntellijIDEA how would I enable code-completion, docs-browsing in IntelliJIDEA 10 Ultimate?
TITLE: Add ExtJS code assist to IntellijIDEA QUESTION: how would I enable code-completion, docs-browsing in IntelliJIDEA 10 Ultimate? ANSWER: Refer to the blog post about working with JavaScript libraries. The same applies for IntelliJ IDEA product.
[ "javascript", "extjs", "intellij-idea", "code-completion", "code-assist" ]
1
3
4,888
1
0
2011-06-02T08:25:40.397000
2011-06-02T08:40:14.903000
6,212,132
6,212,241
Can not retrieve a jpg image using php
I am retrieving a jpg file from an oracle db, and trying to output it with the echo command. The jpg file is stored as a blob inside the database, and displays properly when I access it from the database. Here is the relevant code: $query = 'select * from answer where answer_id =:answer_id'; $stmt = oci_parse($conn, $...
Check for any extra output that might have snuck in before or after your image data. In particular, check for A Byte Order Mark before your opening tag Trailing whitespace on your script and any other included scripts. The easiest way to defeat this is to omit the closing?> tag or even better, execute exit; after echoi...
Can not retrieve a jpg image using php I am retrieving a jpg file from an oracle db, and trying to output it with the echo command. The jpg file is stored as a blob inside the database, and displays properly when I access it from the database. Here is the relevant code: $query = 'select * from answer where answer_id =:...
TITLE: Can not retrieve a jpg image using php QUESTION: I am retrieving a jpg file from an oracle db, and trying to output it with the echo command. The jpg file is stored as a blob inside the database, and displays properly when I access it from the database. Here is the relevant code: $query = 'select * from answer ...
[ "php", "oracle", "http" ]
1
0
275
2
0
2011-06-02T08:26:11.430000
2011-06-02T08:38:57.293000
6,212,134
6,212,161
Replacing multiple character instances from a string in Javascript
So I have this piece of code: var thisValue = $("input[id*=ID222]").val(); thisValue = thisValue.replace(',',''); Basically I want to remove all commas in this input element for taking it up for further processing. The above code works when there is only one comma in the field, but doesn't work for multiple commas. Is ...
You have to do a global replace using a regular expression. You can't do this by passing a string to replace: thisValue = thisValue.replace(/,/g,'');
Replacing multiple character instances from a string in Javascript So I have this piece of code: var thisValue = $("input[id*=ID222]").val(); thisValue = thisValue.replace(',',''); Basically I want to remove all commas in this input element for taking it up for further processing. The above code works when there is onl...
TITLE: Replacing multiple character instances from a string in Javascript QUESTION: So I have this piece of code: var thisValue = $("input[id*=ID222]").val(); thisValue = thisValue.replace(',',''); Basically I want to remove all commas in this input element for taking it up for further processing. The above code works...
[ "javascript", "string" ]
2
7
1,407
1
0
2011-06-02T08:26:18.697000
2011-06-02T08:29:30.710000
6,212,135
6,212,244
Whats the Difference between (As) and (=) in object declaration in VB.NET
I can create a new object like this: Dim sqlconn As New SqlClient.SqlConnection(cs) or like this: Dim sqlconn = New SqlClient.SqlConnection(cs) What's the difference? Since both worked fine for me!
The first one is the short form of: Dim sqlconn As SqlClient.SqlConnection = New SqlClient.SqlConnection(cs) The second one depends on what version of VB you are using. In VB 7 and VB 8 it is the same as: Dim sqlconn As Object = New SqlClient.SqlConnection(cs) In VB 9 type inference was introduced, so the compiler will...
Whats the Difference between (As) and (=) in object declaration in VB.NET I can create a new object like this: Dim sqlconn As New SqlClient.SqlConnection(cs) or like this: Dim sqlconn = New SqlClient.SqlConnection(cs) What's the difference? Since both worked fine for me!
TITLE: Whats the Difference between (As) and (=) in object declaration in VB.NET QUESTION: I can create a new object like this: Dim sqlconn As New SqlClient.SqlConnection(cs) or like this: Dim sqlconn = New SqlClient.SqlConnection(cs) What's the difference? Since both worked fine for me! ANSWER: The first one is the ...
[ "vb.net", "declaration" ]
8
14
598
1
0
2011-06-02T08:26:19.290000
2011-06-02T08:39:17.177000
6,212,143
6,212,164
Returning multiple items from a function call in PHP
Is it possible to return multiple items from a function - and assign them to several variables in a single statement - like can be done in some languages (e.g. Python)? For example, can I have something like this: a, b, c,d = foo();
A function can not return multiple values, but similar results can be obtained by returning an array. See http://php.net/manual/en/functions.returning-values.php
Returning multiple items from a function call in PHP Is it possible to return multiple items from a function - and assign them to several variables in a single statement - like can be done in some languages (e.g. Python)? For example, can I have something like this: a, b, c,d = foo();
TITLE: Returning multiple items from a function call in PHP QUESTION: Is it possible to return multiple items from a function - and assign them to several variables in a single statement - like can be done in some languages (e.g. Python)? For example, can I have something like this: a, b, c,d = foo(); ANSWER: A funct...
[ "php" ]
1
8
632
3
0
2011-06-02T08:27:20.367000
2011-06-02T08:29:52.350000
6,212,153
6,215,041
wrapping JavaScript tracking code
I have following tracking code from Piwik. I want to hide following code, so I think I can put this code in some js file, and load it using following code. But I don't know how can I do it. Help required here. Secondly, I need to change site id (in above example, is 29), which will be different for different site. How ...
var pkBaseURL = ( ( "https:" == document.location.protocol )? "https://example.com/": "http://example.com/"); var piwik_script = document. createElement ( "script" ); piwik_script. src = pkBaseURL + "piwik.js"; document. body. appendChild ( piwik_script ); function track () { try { var piwikTracker = Piwik.getTracker...
wrapping JavaScript tracking code I have following tracking code from Piwik. I want to hide following code, so I think I can put this code in some js file, and load it using following code. But I don't know how can I do it. Help required here. Secondly, I need to change site id (in above example, is 29), which will be ...
TITLE: wrapping JavaScript tracking code QUESTION: I have following tracking code from Piwik. I want to hide following code, so I think I can put this code in some js file, and load it using following code. But I don't know how can I do it. Help required here. Secondly, I need to change site id (in above example, is 2...
[ "javascript" ]
0
1
1,609
2
0
2011-06-02T08:28:43.173000
2011-06-02T13:19:04.257000
6,212,171
6,255,038
Python GTK window in Thread
I have a CLI application, which is digging some data, in case of need, fires up a thread which creates GTK window with some information. However the CLI (main thread) still analyzes the data in the background, so there could be numerous windows created. In case I close the window, the destroy event is actually fired up...
using a gtk.threads_enter() and leave around your main call should help. Take a look at the PyGtk Faq: PyGtk FAQ
Python GTK window in Thread I have a CLI application, which is digging some data, in case of need, fires up a thread which creates GTK window with some information. However the CLI (main thread) still analyzes the data in the background, so there could be numerous windows created. In case I close the window, the destro...
TITLE: Python GTK window in Thread QUESTION: I have a CLI application, which is digging some data, in case of need, fires up a thread which creates GTK window with some information. However the CLI (main thread) still analyzes the data in the background, so there could be numerous windows created. In case I close the ...
[ "python", "pygtk" ]
3
1
1,171
1
0
2011-06-02T08:30:18.417000
2011-06-06T16:23:42.927000
6,212,181
6,212,324
Adding subview to UITable
I'm trying to add as subview into a section in UITableView, It looks like the code is correct, the it doesn't show anything, just blank section. Here's the code that I use: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell";...
One of the problems is that you are trying to change the height of the cell. If you want to do so, in addition to changing its frame, you must also implement tableView:heightForRowAtIndexPath: and return appropriate values for each row. If page is properly loaded (assuming it's a view controller), you can add the view ...
Adding subview to UITable I'm trying to add as subview into a section in UITableView, It looks like the code is correct, the it doesn't show anything, just blank section. Here's the code that I use: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString ...
TITLE: Adding subview to UITable QUESTION: I'm trying to add as subview into a section in UITableView, It looks like the code is correct, the it doesn't show anything, just blank section. Here's the code that I use: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath ...
[ "ios", "uitableview", "uiview", "xcode4" ]
0
1
240
1
0
2011-06-02T08:30:57.277000
2011-06-02T08:47:56.230000
6,212,183
6,212,272
mac safari vs iphone safari
works on safari/firefox/chrome/opera for mac + pc. But not for safari iPhone. "error occurred" is the message which is better than nothing but not very helpful. Is there a quick way to determine the cause of the problem? The website itself is svg + a lot of javascript/jquery. It also uses eval() which may also be the r...
I assume the problem is with google.load(). Apparently on certain browsers, the order of includes might not be that you would expect, therefore your plugin and other code would fail to load/execute. I suggest you use the direct link to the Google CDN for your scripts: Alternatively you can attach a function to google.s...
mac safari vs iphone safari works on safari/firefox/chrome/opera for mac + pc. But not for safari iPhone. "error occurred" is the message which is better than nothing but not very helpful. Is there a quick way to determine the cause of the problem? The website itself is svg + a lot of javascript/jquery. It also uses ev...
TITLE: mac safari vs iphone safari QUESTION: works on safari/firefox/chrome/opera for mac + pc. But not for safari iPhone. "error occurred" is the message which is better than nothing but not very helpful. Is there a quick way to determine the cause of the problem? The website itself is svg + a lot of javascript/jquer...
[ "jquery", "iphone", "macos", "safari", "svg" ]
0
3
220
1
0
2011-06-02T08:32:01.537000
2011-06-02T08:42:58.033000
6,212,189
6,212,562
Optimizing queries for content popularity by hits
I've done some searching for this but haven't come up with anything, maybe someone could point me in the right direction. I have a website with lots of content in a MySQL database and a PHP script that loads the most popular content by hits. It does this by logging each content hit in a table along with the access time...
We've just come across a similar situation and this is how we got around it. We decided we didn't really care about what exact 'time' something happened, only the day it happened on. We then did this: Every record has a 'total hits' record which is incremented every time something happens A logs table records these 'to...
Optimizing queries for content popularity by hits I've done some searching for this but haven't come up with anything, maybe someone could point me in the right direction. I have a website with lots of content in a MySQL database and a PHP script that loads the most popular content by hits. It does this by logging each...
TITLE: Optimizing queries for content popularity by hits QUESTION: I've done some searching for this but haven't come up with anything, maybe someone could point me in the right direction. I have a website with lots of content in a MySQL database and a PHP script that loads the most popular content by hits. It does th...
[ "php", "mysql", "sql", "performance", "database-design" ]
4
2
212
5
0
2011-06-02T08:32:38.277000
2011-06-02T09:14:57.070000
6,212,199
6,212,828
Missing values of map(key, value) in Freemarker when access randomly?
I'm having a strange problem with Freemarker map. My example is meant to display a list of cars with the associated owners' name: Car(id,name,ownerId) User(id,name) Notice that the ownerId is the only bridge I can access owner from car. For some reasons, we don't create hibernate relation for these domains. I added to ...
Warning: contains some speculation! I believe that part of your problem is that you use map?values[car.ownerId] in order to retrieve the user's names. map?values gives you the sequence of values of your map hash (see FreeMarker documentation ), which happens to be the sequence of usernames. Then you access its elements...
Missing values of map(key, value) in Freemarker when access randomly? I'm having a strange problem with Freemarker map. My example is meant to display a list of cars with the associated owners' name: Car(id,name,ownerId) User(id,name) Notice that the ownerId is the only bridge I can access owner from car. For some reas...
TITLE: Missing values of map(key, value) in Freemarker when access randomly? QUESTION: I'm having a strange problem with Freemarker map. My example is meant to display a list of cars with the associated owners' name: Car(id,name,ownerId) User(id,name) Notice that the ownerId is the only bridge I can access owner from ...
[ "spring-mvc", "freemarker" ]
0
3
3,094
2
0
2011-06-02T08:33:30.710000
2011-06-02T09:44:15.740000
6,212,211
6,212,348
How to switch off Auto Import with IntelliJ/Scala Plugin
Simple Problem: Ever since I switched to Idea 10.5, it has this auto import feature enabled. For a Java developer, this is surely nice, but every time I type thing like var x: Float it automatically adds import java.lang.Float on the beginning of the file. Very often, it even adds imports I did not even want, from unkn...
That is plugin bug. This should be fixed soon. It's impossible to turn off in settings. Sorry for inconveniences.
How to switch off Auto Import with IntelliJ/Scala Plugin Simple Problem: Ever since I switched to Idea 10.5, it has this auto import feature enabled. For a Java developer, this is surely nice, but every time I type thing like var x: Float it automatically adds import java.lang.Float on the beginning of the file. Very o...
TITLE: How to switch off Auto Import with IntelliJ/Scala Plugin QUESTION: Simple Problem: Ever since I switched to Idea 10.5, it has this auto import feature enabled. For a Java developer, this is surely nice, but every time I type thing like var x: Float it automatically adds import java.lang.Float on the beginning o...
[ "scala", "intellij-idea" ]
2
5
4,775
4
0
2011-06-02T08:34:20.790000
2011-06-02T08:50:18.170000
6,212,216
6,212,236
how to make websites for iphone
i have a website which i want my users to access from their iphones as well. Would i need to make separate webpages for mobiles or is there a template provided in Xcode that lets developers make web applications for iphone? if i am making the website just my altering the webpages then i am limited by the functionality ...
Check for the browser's user agent using PHP and then redirect the user to a mobile version of your website. You can use the iphone simulator or a browser that can change the user agent (like safari) to test your website. Don't forget to make the UI much cleaner than on your regular website, it should to follow the des...
how to make websites for iphone i have a website which i want my users to access from their iphones as well. Would i need to make separate webpages for mobiles or is there a template provided in Xcode that lets developers make web applications for iphone? if i am making the website just my altering the webpages then i ...
TITLE: how to make websites for iphone QUESTION: i have a website which i want my users to access from their iphones as well. Would i need to make separate webpages for mobiles or is there a template provided in Xcode that lets developers make web applications for iphone? if i am making the website just my altering th...
[ "iphone" ]
0
0
94
1
0
2011-06-02T08:35:10.127000
2011-06-02T08:37:49.470000
6,212,218
6,212,234
Rails edit form not showing nested item
I got a form that have a nested link. The problem that the link field is empty on edit. Here is my form: Editing kategori <%= simple_form_for(@konkurrancer,:url => {:action => 'update',:id => @konkurrancer.id }) do |f| %> <%= f.simple_fields_for:link_attributes do |d| %> <%= d.input:link,:label => 'Tracking url',:style...
1) Remove from your Link model accepts_nested_attributes_for:konkurrancer and add to your Konkurrancer model accepts_nested_attributes_for:link 2) In controller edit action remove @konkurrancer.link_attributes.build and in controller new action add @konkurrances.build_link 3) In the view file replace <%= f.simple_field...
Rails edit form not showing nested item I got a form that have a nested link. The problem that the link field is empty on edit. Here is my form: Editing kategori <%= simple_form_for(@konkurrancer,:url => {:action => 'update',:id => @konkurrancer.id }) do |f| %> <%= f.simple_fields_for:link_attributes do |d| %> <%= d.in...
TITLE: Rails edit form not showing nested item QUESTION: I got a form that have a nested link. The problem that the link field is empty on edit. Here is my form: Editing kategori <%= simple_form_for(@konkurrancer,:url => {:action => 'update',:id => @konkurrancer.id }) do |f| %> <%= f.simple_fields_for:link_attributes ...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "simple-form" ]
5
8
4,559
1
0
2011-06-02T08:35:13.753000
2011-06-02T08:37:22.890000
6,212,219
6,212,408
Passing parameters to a Bash function
I am trying to search how to pass parameters in a Bash function, but what comes up is always how to pass parameter from the command line. I would like to pass parameters within my script. I tried: myBackupFunction("..", "...", "xx") function myBackupFunction($directory, $options, $rootPassword) {... } But the syntax i...
There are two typical ways of declaring a function. I prefer the second approach. function function_name { command... } or function_name () { command... } To call a function with arguments: function_name "$arg1" "$arg2" The function refers to passed arguments by their position (not by name), that is $1, $2, and so fort...
Passing parameters to a Bash function I am trying to search how to pass parameters in a Bash function, but what comes up is always how to pass parameter from the command line. I would like to pass parameters within my script. I tried: myBackupFunction("..", "...", "xx") function myBackupFunction($directory, $options, ...
TITLE: Passing parameters to a Bash function QUESTION: I am trying to search how to pass parameters in a Bash function, but what comes up is always how to pass parameter from the command line. I would like to pass parameters within my script. I tried: myBackupFunction("..", "...", "xx") function myBackupFunction($dir...
[ "bash", "function", "parameters", "arguments" ]
1,485
2,281
1,836,713
7
0
2011-06-02T08:35:17.493000
2011-06-02T08:57:02.240000
6,212,220
6,212,281
Getting a number of digits
I've been searching for a way in python to get only 4 digits on the right of the comma of a decimal number, but i couldn't find. Took a look on this post,---> Rounding decimals with new Python format function,but the function written there... >>> n = 4 >>> p = math.pi >>> '{0:.{1}f}'.format(p, n) '3.1416'...seems not t...
"%.3f" % math.pi I know its using the old syntax but I personally prefer it.
Getting a number of digits I've been searching for a way in python to get only 4 digits on the right of the comma of a decimal number, but i couldn't find. Took a look on this post,---> Rounding decimals with new Python format function,but the function written there... >>> n = 4 >>> p = math.pi >>> '{0:.{1}f}'.format(p...
TITLE: Getting a number of digits QUESTION: I've been searching for a way in python to get only 4 digits on the right of the comma of a decimal number, but i couldn't find. Took a look on this post,---> Rounding decimals with new Python format function,but the function written there... >>> n = 4 >>> p = math.pi >>> '{...
[ "python", "rounding", "decimal" ]
0
7
589
3
0
2011-06-02T08:35:20.097000
2011-06-02T08:43:53.453000
6,212,222
6,212,287
SQL query, three tables
So let's same I'm trying to find actors who are in two movies together (for the purpose of a degrees of separation page). I have databases as such (this is just some made up data): actors id first_name last_name gender 17 brad pitt m 2 kevin bacon m movies id name year 20 benjamin button 2008 roles a_id m_id role 17 20...
You must join twice: SELECT m.name movie_name FROM movies m join roles r1 on r1.m_id = m.id join actors a1 on r1.a_id = a1.id join roles r2 on r2.m_id = m.id join actors a2 on r2.a_id = a2.id WHERE a1.first_name = 'brad' and a1.last_name = 'pitt' and a2.first_name = 'kevin' and a2.last_name = 'bacon' Show all actor com...
SQL query, three tables So let's same I'm trying to find actors who are in two movies together (for the purpose of a degrees of separation page). I have databases as such (this is just some made up data): actors id first_name last_name gender 17 brad pitt m 2 kevin bacon m movies id name year 20 benjamin button 2008 ro...
TITLE: SQL query, three tables QUESTION: So let's same I'm trying to find actors who are in two movies together (for the purpose of a degrees of separation page). I have databases as such (this is just some made up data): actors id first_name last_name gender 17 brad pitt m 2 kevin bacon m movies id name year 20 benja...
[ "mysql", "sql" ]
1
4
197
3
0
2011-06-02T08:35:40.367000
2011-06-02T08:44:28.553000
6,212,229
6,212,331
Disable checkstyle validation for specific variables
I am working in a PHP project that uses checkstyle to validate the code. I have a problem with a part of the code that reads XML's with simplexml, the XML is all in uppercase and for example: $response = simplexml_load_string($xml); $code = $response->CODE; // checkstyle won't validate this because it is in uppercase t...
I dont know how to do that with checkstyle, but PHPCS can also create reports in CheckStyle format. So if you are not fixed on using Checkstyle, you could switch. With PHPCS you can add pseudo annotations into the code to skip checking, e.g. // @codingStandardsIgnoreFile or just portions on code $response = simplexml_l...
Disable checkstyle validation for specific variables I am working in a PHP project that uses checkstyle to validate the code. I have a problem with a part of the code that reads XML's with simplexml, the XML is all in uppercase and for example: $response = simplexml_load_string($xml); $code = $response->CODE; // checks...
TITLE: Disable checkstyle validation for specific variables QUESTION: I am working in a PHP project that uses checkstyle to validate the code. I have a problem with a part of the code that reads XML's with simplexml, the XML is all in uppercase and for example: $response = simplexml_load_string($xml); $code = $respons...
[ "php", "simplexml", "checkstyle" ]
1
5
1,577
1
0
2011-06-02T08:36:33.513000
2011-06-02T08:48:39.033000
6,212,249
6,213,979
Arabic encoding in Java Studio Creator
I'm using Java Studio Creator with a MySQL dataBase to build my new small system.. When I pass Arabic characters from the browser to the MySQL database, they appear as question marks,???, in MySQL database. I check the encoding in the JSP code, it looks like the following. That means it's UTF-8. I tried encoding like W...
For MySQL you need to specify the encoding in the JDBC URL. So, you should not use this JDBC URL syntax: jdbc:mysql://localhost:3306/db_name But you should use this JDBC URL syntax: jdbc:mysql://localhost:3306/db_name?useUnicode=yes&characterEncoding=UTF-8
Arabic encoding in Java Studio Creator I'm using Java Studio Creator with a MySQL dataBase to build my new small system.. When I pass Arabic characters from the browser to the MySQL database, they appear as question marks,???, in MySQL database. I check the encoding in the JSP code, it looks like the following. That me...
TITLE: Arabic encoding in Java Studio Creator QUESTION: I'm using Java Studio Creator with a MySQL dataBase to build my new small system.. When I pass Arabic characters from the browser to the MySQL database, they appear as question marks,???, in MySQL database. I check the encoding in the JSP code, it looks like the ...
[ "jsp", "encoding" ]
2
2
507
1
0
2011-06-02T08:39:32.393000
2011-06-02T11:34:34.423000
6,212,250
6,212,261
Jquery replacing text inside html
Is there a more elegant way replacing a text inside an html element than: $el = $("#myDiv"); $el.html( $el.html().replace("something", "something new") );
$('#myDiv').html(function(index, oldhtml) { return oldhtml.replace('something', 'something new'); });
Jquery replacing text inside html Is there a more elegant way replacing a text inside an html element than: $el = $("#myDiv"); $el.html( $el.html().replace("something", "something new") );
TITLE: Jquery replacing text inside html QUESTION: Is there a more elegant way replacing a text inside an html element than: $el = $("#myDiv"); $el.html( $el.html().replace("something", "something new") ); ANSWER: $('#myDiv').html(function(index, oldhtml) { return oldhtml.replace('something', 'something new'); });
[ "javascript", "jquery", "html" ]
2
6
172
4
0
2011-06-02T08:39:33.483000
2011-06-02T08:41:41.487000
6,212,257
6,213,039
Building a valid heap
I just need some verification on whether or not I'm doing this correctly. I checked the wiki for a heapsort, but it seems in the animation to build the heap it inserts the numbers into the nodes and orders it as it goes. The question asks to "Draw a valid heap with these elements.. {7, 12, 1, 3, 22, 5, 11} as a tree" I...
Actually, the heap data structure as only one property, which can be defined as follows: "In a heap T, for every node v other than the root, the key stored at v is greater than or equal to the key stored at v's parent." So there are many right representations of the heap based on elements (7, 12, 1, 3, 22, 5, 11). With...
Building a valid heap I just need some verification on whether or not I'm doing this correctly. I checked the wiki for a heapsort, but it seems in the animation to build the heap it inserts the numbers into the nodes and orders it as it goes. The question asks to "Draw a valid heap with these elements.. {7, 12, 1, 3, 2...
TITLE: Building a valid heap QUESTION: I just need some verification on whether or not I'm doing this correctly. I checked the wiki for a heapsort, but it seems in the animation to build the heap it inserts the numbers into the nodes and orders it as it goes. The question asks to "Draw a valid heap with these elements...
[ "heap" ]
1
3
1,447
1
0
2011-06-02T08:40:39.833000
2011-06-02T10:03:09.577000
6,212,271
6,213,436
String manipulation, removing a single comma
UPDATE 1: This is how I am attempting to build the string: header('Content-type:application/json'); function getdata($the_query) { $connection = mysql_connect('server', 'user', 'pass') or die (mysql_error()); $db = mysql_select_db('db_name', $connection) or die (mysql_error()); $results = mysql_query($the_query) or d...
Instead of fixing the error you should fix the cause and don’t insert that last comma in the first place. The best would be to build the data structure using PHP’s native data types and then use json_encode to convert it to a JSON data string: function getdata($the_query) { $connection = mysql_connect('server', 'user',...
String manipulation, removing a single comma UPDATE 1: This is how I am attempting to build the string: header('Content-type:application/json'); function getdata($the_query) { $connection = mysql_connect('server', 'user', 'pass') or die (mysql_error()); $db = mysql_select_db('db_name', $connection) or die (mysql_error...
TITLE: String manipulation, removing a single comma QUESTION: UPDATE 1: This is how I am attempting to build the string: header('Content-type:application/json'); function getdata($the_query) { $connection = mysql_connect('server', 'user', 'pass') or die (mysql_error()); $db = mysql_select_db('db_name', $connection) o...
[ "php" ]
1
1
299
6
0
2011-06-02T08:42:48.990000
2011-06-02T10:40:53.110000
6,212,278
6,212,299
jQuery $ function syntax
What is the difference between the following function definitions? 1: $(function () { //stuff here }); 2: function($){ //stuff here }
In #1, your function will be called by jQuery when the DOM is ready; passing a function into $() is a shortcut for $(document).ready(function() {... }); ( details here ). In #2, you're defining a function but neither calling it nor asking jQuery to call it. (And in fact, as shown, it's a syntax error — you'd need to be...
jQuery $ function syntax What is the difference between the following function definitions? 1: $(function () { //stuff here }); 2: function($){ //stuff here }
TITLE: jQuery $ function syntax QUESTION: What is the difference between the following function definitions? 1: $(function () { //stuff here }); 2: function($){ //stuff here } ANSWER: In #1, your function will be called by jQuery when the DOM is ready; passing a function into $() is a shortcut for $(document).ready(f...
[ "jquery", "function" ]
5
9
5,040
2
0
2011-06-02T08:43:28.820000
2011-06-02T08:45:35.287000
6,212,288
6,212,332
Self syntax in iPhone development
What is the difference between the following two approaches for the self syntax to access the object properties:- Approach 1:- self.effortView = [[EffortView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)]; self.effortView.effortTableView = [[UITableView alloc]initWithFrame:CGRectMake(25, 25, 300, 420) style:UITableVie...
In the first syntax: self.effortView = [[EffortView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)]; self.effortView.effortTableView = [[UITableView alloc]initWithFrame:CGRectMake(25, 25, 300, 420) style:UITableViewStyleGrouped]; you are accessing both ivars through their accessor methods (usually, effortView to get, s...
Self syntax in iPhone development What is the difference between the following two approaches for the self syntax to access the object properties:- Approach 1:- self.effortView = [[EffortView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)]; self.effortView.effortTableView = [[UITableView alloc]initWithFrame:CGRectMake(...
TITLE: Self syntax in iPhone development QUESTION: What is the difference between the following two approaches for the self syntax to access the object properties:- Approach 1:- self.effortView = [[EffortView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)]; self.effortView.effortTableView = [[UITableView alloc]initWit...
[ "iphone", "objective-c", "ios", "ios4" ]
1
5
405
4
0
2011-06-02T08:44:40.503000
2011-06-02T08:48:41.603000
6,212,291
6,212,308
Replace null with known value with same id
How can I do that in a optimal way? TABLE ID FLAG VALUE ---------------------------- 1 Y 52 1 N NULL 2 Y 51 3 N 54 OUTPUT ID FLAG VALUE ---------------------------- 1 Y 52 1 N 52 2 Y 51 3 N 54
UPDATE theTable SET value = (SELECT MAX(value) FROM theTable i WHERE i.id = theTable.id) WHERE value IS NULL
Replace null with known value with same id How can I do that in a optimal way? TABLE ID FLAG VALUE ---------------------------- 1 Y 52 1 N NULL 2 Y 51 3 N 54 OUTPUT ID FLAG VALUE ---------------------------- 1 Y 52 1 N 52 2 Y 51 3 N 54
TITLE: Replace null with known value with same id QUESTION: How can I do that in a optimal way? TABLE ID FLAG VALUE ---------------------------- 1 Y 52 1 N NULL 2 Y 51 3 N 54 OUTPUT ID FLAG VALUE ---------------------------- 1 Y 52 1 N 52 2 Y 51 3 N 54 ANSWER: UPDATE theTable SET value = (SELECT MAX(value) FROM theTa...
[ "t-sql" ]
2
4
567
2
0
2011-06-02T08:44:53.723000
2011-06-02T08:46:53.267000
6,212,296
6,212,875
Cannot apply animation on SVG g element
I have the following SVG file. I just want to move it to some other place with animation, but it does not work. Is there something that I am missing here? (I want to animate the g element with everything inside. I removed the rest of the elements for the sake of simplicity.)
OK, I changed to animation here with following. And it started to work. UPDATE I found a better solution. In the first one, after animation my group element is returning to its original position. With the follwing it stays where it is.
Cannot apply animation on SVG g element I have the following SVG file. I just want to move it to some other place with animation, but it does not work. Is there something that I am missing here? (I want to animate the g element with everything inside. I removed the rest of the elements for the sake of simplicity.)
TITLE: Cannot apply animation on SVG g element QUESTION: I have the following SVG file. I just want to move it to some other place with animation, but it does not work. Is there something that I am missing here? (I want to animate the g element with everything inside. I removed the rest of the elements for the sake of...
[ "javascript", "html", "svg" ]
4
10
8,199
1
0
2011-06-02T08:45:15.600000
2011-06-02T09:48:44.243000
6,212,305
6,212,346
How can I compare two time strings in the format HH:MM:SS?
I have two time strings in HH:MM:SS format. For example, str1 contains 10:20:45, str2 contains 5:10:10. How can I compare the above values?
Date.parse('01/01/2011 10:20:45') > Date.parse('01/01/2011 5:10:10') > true The 1st January is an arbitrary date, doesn't mean anything.
How can I compare two time strings in the format HH:MM:SS? I have two time strings in HH:MM:SS format. For example, str1 contains 10:20:45, str2 contains 5:10:10. How can I compare the above values?
TITLE: How can I compare two time strings in the format HH:MM:SS? QUESTION: I have two time strings in HH:MM:SS format. For example, str1 contains 10:20:45, str2 contains 5:10:10. How can I compare the above values? ANSWER: Date.parse('01/01/2011 10:20:45') > Date.parse('01/01/2011 5:10:10') > true The 1st January is...
[ "javascript" ]
119
146
249,897
18
0
2011-06-02T08:46:24.880000
2011-06-02T08:50:13.087000
6,212,309
6,212,464
Problem with jQuery mouseleave firing when container has select box
I have a two containers -- one is nested inside of another. When I hover over the parent, I want the child container to appear. When I mouseout, I want the child container to fadeout. The problem I'm having is the child container has a form that contains a "select box". When the user selects the select box -- the mouse...
Since mouseleave and mouseenter events are non-standard you can get such lags here and there. The only method I can suggest to fix that is using some hacks. Here is http://jsfiddle.net/mPDcu/1/ improved version of you code. var selectOpened = false; $('#select-grind-type').click(function(e){ selectOpened =!selectOpened...
Problem with jQuery mouseleave firing when container has select box I have a two containers -- one is nested inside of another. When I hover over the parent, I want the child container to appear. When I mouseout, I want the child container to fadeout. The problem I'm having is the child container has a form that contai...
TITLE: Problem with jQuery mouseleave firing when container has select box QUESTION: I have a two containers -- one is nested inside of another. When I hover over the parent, I want the child container to appear. When I mouseout, I want the child container to fadeout. The problem I'm having is the child container has ...
[ "javascript", "jquery" ]
13
3
15,165
9
0
2011-06-02T08:46:54.050000
2011-06-02T09:04:56.903000
6,212,326
6,238,660
Python Distributed Computing (works)
I'm using an old thread to post new code which attempts to solve the same problem. What constitutes a secure pickle? this? sock.py from socket import socket from socket import AF_INET from socket import SOCK_STREAM from socket import gethostbyname from socket import gethostname class SocketServer: def __init__(self, p...
ValueError: insecure string pickle is raised when your pickle is corrupted. Are you sure you are receiving the entire pickled object in one sock.recv() (unpack.py)? Edit: to avoid this for any size you could do (your Socket class would have to support recv to be called with an buffer size argument (i.e class Socket: de...
Python Distributed Computing (works) I'm using an old thread to post new code which attempts to solve the same problem. What constitutes a secure pickle? this? sock.py from socket import socket from socket import AF_INET from socket import SOCK_STREAM from socket import gethostbyname from socket import gethostname cla...
TITLE: Python Distributed Computing (works) QUESTION: I'm using an old thread to post new code which attempts to solve the same problem. What constitutes a secure pickle? this? sock.py from socket import socket from socket import AF_INET from socket import SOCK_STREAM from socket import gethostbyname from socket impor...
[ "python", "sockets", "multiprocessing", "pickle", "distributed-computing" ]
7
2
1,923
2
0
2011-06-02T08:48:18.523000
2011-06-04T18:42:08.030000
6,212,341
6,217,045
Call trace when loading a module in Linux
I'm writing my first Linux kernel module, which actually is a RAM disk driver plus some additional features. When I tried to insmod the module, "Segmentation fault" happened. And here is the corresponding kernel log, actually two pieces of kernel oops messages. After reading a lot of related tutorials, I still have som...
The first oopss message is actually a warning from the kernel. The important part of the warning is right here: "attempted to be registered with empty name!". It means a descriptive name string field in a kobject was not supplied. Specifically, since in the call trace of the warning we see register_disk, I assume you f...
Call trace when loading a module in Linux I'm writing my first Linux kernel module, which actually is a RAM disk driver plus some additional features. When I tried to insmod the module, "Segmentation fault" happened. And here is the corresponding kernel log, actually two pieces of kernel oops messages. After reading a ...
TITLE: Call trace when loading a module in Linux QUESTION: I'm writing my first Linux kernel module, which actually is a RAM disk driver plus some additional features. When I tried to insmod the module, "Segmentation fault" happened. And here is the corresponding kernel log, actually two pieces of kernel oops messages...
[ "linux", "linux-kernel", "linux-device-driver" ]
15
17
12,150
1
0
2011-06-02T08:49:29.833000
2011-06-02T16:02:03.087000
6,212,351
6,216,778
DotNetNuke: How to add paging to the core announcements module
Situation looks like this: I need to add paging to the core announcement module in DotNetNuke. My client is adding more and more announcements and now the page is too long. I am using the announcements module for news. The problem: The announcements module does not have a paging system. Is there any way to add a paging...
The Announcements module is missing lots of key features. I'd recommend switching from it to one of the many Articles modules available. Ventrian News Articles - probably the most popular DNN Simple Article - New, free, and open source, built by a core team member Efficion's Articles Module - My favorite, but then I bu...
DotNetNuke: How to add paging to the core announcements module Situation looks like this: I need to add paging to the core announcement module in DotNetNuke. My client is adding more and more announcements and now the page is too long. I am using the announcements module for news. The problem: The announcements module ...
TITLE: DotNetNuke: How to add paging to the core announcements module QUESTION: Situation looks like this: I need to add paging to the core announcement module in DotNetNuke. My client is adding more and more announcements and now the page is too long. I am using the announcements module for news. The problem: The ann...
[ "dotnetnuke", "paging" ]
0
2
1,165
1
0
2011-06-02T08:50:39.210000
2011-06-02T15:37:45.430000
6,212,358
6,215,203
Using the NHibernate QueryOver, how can you add a type-safe restrictions between dates
Considering the following QueryOver (quarter and centre are variables passed in): QueryOver.Of ().Where(Restrictions.On (a => a.StartDate).IsBetween(quarter.StartDate).And(quarter.EndDate) || Restrictions.On (a => a.EndDate).IsBetween(quarter.StartDate).And(quarter.EndDate) || Restrictions.And(Restrictions.Lt("StartDat...
This is what you want: Restrictions.And( Restrictions.Lt(Projections.Property (x => x.StartDate), quarter.StartDate), Restrictions.Gt(Projections.Property (x => x.EndDate), quarter.EndDate))) Sidenote: property names are not magic strings.
Using the NHibernate QueryOver, how can you add a type-safe restrictions between dates Considering the following QueryOver (quarter and centre are variables passed in): QueryOver.Of ().Where(Restrictions.On (a => a.StartDate).IsBetween(quarter.StartDate).And(quarter.EndDate) || Restrictions.On (a => a.EndDate).IsBetwee...
TITLE: Using the NHibernate QueryOver, how can you add a type-safe restrictions between dates QUESTION: Considering the following QueryOver (quarter and centre are variables passed in): QueryOver.Of ().Where(Restrictions.On (a => a.StartDate).IsBetween(quarter.StartDate).And(quarter.EndDate) || Restrictions.On (a => a...
[ "nhibernate", "queryover" ]
4
8
4,476
1
0
2011-06-02T08:51:33.027000
2011-06-02T13:31:01.157000
6,212,366
6,213,114
What is the best way to parse a tuple from a string in Python?
I tried this: def string_to_value(self, old_value, distribution_type, new_value_str): parameter_names = distribution_type.parameters # a list of string try: parameter_values = ast.literal_eval(new_value_str) # a tuple or basic type hopefully except SyntaxError: raise ValueError('Syntax error during parse') retval = cop...
Check this documentation and this PEP about evaluating inf. I guess they will help
What is the best way to parse a tuple from a string in Python? I tried this: def string_to_value(self, old_value, distribution_type, new_value_str): parameter_names = distribution_type.parameters # a list of string try: parameter_values = ast.literal_eval(new_value_str) # a tuple or basic type hopefully except SyntaxEr...
TITLE: What is the best way to parse a tuple from a string in Python? QUESTION: I tried this: def string_to_value(self, old_value, distribution_type, new_value_str): parameter_names = distribution_type.parameters # a list of string try: parameter_values = ast.literal_eval(new_value_str) # a tuple or basic type hopeful...
[ "python", "abstract-syntax-tree", "string-parsing" ]
0
1
288
3
0
2011-06-02T08:52:32.443000
2011-06-02T10:10:18.777000
6,212,379
6,278,441
OpenXML preserving formats on break lines (problems)
I'm having serious problems with the breaks in a Word document generation. this is my library funcion I'm using for send text in a BookMark: public void sentText(string _BkMk, string _text, bool _break, RunProperties _rProp) { Text text = new Text(_text) { Space = SpaceProcessingModeValues.Preserve }; Run run = new Run...
If I understand your question correctly and all you want is a blank line then all you have to do is insert a blank paragraph and it should follow the default font that you have setup. This will require you to split up your text across two different paragraphs with two different runs in order to work: public void sentTe...
OpenXML preserving formats on break lines (problems) I'm having serious problems with the breaks in a Word document generation. this is my library funcion I'm using for send text in a BookMark: public void sentText(string _BkMk, string _text, bool _break, RunProperties _rProp) { Text text = new Text(_text) { Space = Sp...
TITLE: OpenXML preserving formats on break lines (problems) QUESTION: I'm having serious problems with the breaks in a Word document generation. this is my library funcion I'm using for send text in a BookMark: public void sentText(string _BkMk, string _text, bool _break, RunProperties _rProp) { Text text = new Text(_...
[ "c#", ".net", "ms-word", "openxml", "openxml-sdk" ]
1
1
2,319
1
0
2011-06-02T08:54:15.323000
2011-06-08T12:07:57.947000
6,212,383
6,212,407
Databind value array to list datatemplate
I have a datatemplate for listbox: The ItemSource of the list is set to int[] array. What should I specify in Binding??? to make the binding path take the concrete value? Thanks.
Have you tried just {Binding}? This will take the item itself.
Databind value array to list datatemplate I have a datatemplate for listbox: The ItemSource of the list is set to int[] array. What should I specify in Binding??? to make the binding path take the concrete value? Thanks.
TITLE: Databind value array to list datatemplate QUESTION: I have a datatemplate for listbox: The ItemSource of the list is set to int[] array. What should I specify in Binding??? to make the binding path take the concrete value? Thanks. ANSWER: Have you tried just {Binding}? This will take the item itself.
[ "c#", "wpf", "xaml" ]
0
2
204
1
0
2011-06-02T08:54:22.610000
2011-06-02T08:56:48.710000
6,212,387
6,212,763
Is GHC's auto-derived `Eq` instance really *O(N)*?
I just noticed while trying to learn to read GHC Core, that the automatically derived Eq instance for enum-style data types such as data EType = ETypeA | ETypeB | ETypeC | ETypeD | ETypeE | ETypeF | ETypeG | ETypeH deriving (Eq) seems to be transformed into a O(N) -like lookup when looking at GHC's core representation:...
Equality comparison of EType is O(1) because the case construct is O(1). There might or might not be an integer tag for constructors. There are several low level representation choices, so the Core generated works for all of them. That said, you can always make an integer tag for constructors, and that's how I usually ...
Is GHC's auto-derived `Eq` instance really *O(N)*? I just noticed while trying to learn to read GHC Core, that the automatically derived Eq instance for enum-style data types such as data EType = ETypeA | ETypeB | ETypeC | ETypeD | ETypeE | ETypeF | ETypeG | ETypeH deriving (Eq) seems to be transformed into a O(N) -lik...
TITLE: Is GHC's auto-derived `Eq` instance really *O(N)*? QUESTION: I just noticed while trying to learn to read GHC Core, that the automatically derived Eq instance for enum-style data types such as data EType = ETypeA | ETypeB | ETypeC | ETypeD | ETypeE | ETypeF | ETypeG | ETypeH deriving (Eq) seems to be transforme...
[ "haskell", "ghc" ]
12
13
703
1
0
2011-06-02T08:54:52.090000
2011-06-02T09:37:50
6,212,400
6,212,439
Javascript - Multiple external files
I have a page which receives data from multiple sources and I need to create a set of handlers files to configure and display the different kinds of data. There could be 10-15 different kinds of data, each with it's own display logic. Each handler would be fairly large and not just 1 or two methods. I'm trying to figur...
Actually I prefer your first option. Combine and minify these JavaScript source files into a single one and cache it let Web browsers cache them in the client, meaning that subsequent requests wouldn't need to download this combined-and-minified large file, boosting Web site's performance and reducing network traffic.
Javascript - Multiple external files I have a page which receives data from multiple sources and I need to create a set of handlers files to configure and display the different kinds of data. There could be 10-15 different kinds of data, each with it's own display logic. Each handler would be fairly large and not just ...
TITLE: Javascript - Multiple external files QUESTION: I have a page which receives data from multiple sources and I need to create a set of handlers files to configure and display the different kinds of data. There could be 10-15 different kinds of data, each with it's own display logic. Each handler would be fairly l...
[ "javascript" ]
1
2
262
1
0
2011-06-02T08:55:50.663000
2011-06-02T09:02:33.287000
6,212,402
6,212,412
Finding a element with a fake attribute that was added
I added a fake attribute to all my elements on the page, for example myId=100, each element has a different fake id. Now i need to find an element according to the fake id, is this possible? I tried doing $("#myFrame").contents().find('a').each(function () { if ($(this).attr['myid'] === 100) { $(this).hide(); } }); Any...
$(this).attr['myid'] should be $(this).attr('myid') ( attr is a function). You can also use the attribute selector: $("#myFrame").contents().find('a[myId="100"]').hide(); You should avoid adding custom attributes to HTML elements. If you explain the problem we might be able to suggest a better way.
Finding a element with a fake attribute that was added I added a fake attribute to all my elements on the page, for example myId=100, each element has a different fake id. Now i need to find an element according to the fake id, is this possible? I tried doing $("#myFrame").contents().find('a').each(function () { if ($(...
TITLE: Finding a element with a fake attribute that was added QUESTION: I added a fake attribute to all my elements on the page, for example myId=100, each element has a different fake id. Now i need to find an element according to the fake id, is this possible? I tried doing $("#myFrame").contents().find('a').each(fu...
[ "jquery", "attributes", "find" ]
2
2
932
2
0
2011-06-02T08:55:52.390000
2011-06-02T08:58:12.110000
6,212,404
6,212,634
Problem with setting header "Content-Type" in uploading file with HttpClient4
I'm trying to a upload file (or multiple files) to my servlet, which is using Apache file-upload to handle and get post-ed files. All is going well and the file is send and recieved, when I use the following code. DefaultHttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost("http://myservice.com/ser...
If you have form data enctype, you must follow the rules as specified in RFC 2388. Data in multipart message are treated as entity so each entity must have a header (with Content-Disposition, Content-Type, etc.) and a boundary. As to answer question 1, the RFC states: As with all multipart MIME types, each part has an ...
Problem with setting header "Content-Type" in uploading file with HttpClient4 I'm trying to a upload file (or multiple files) to my servlet, which is using Apache file-upload to handle and get post-ed files. All is going well and the file is send and recieved, when I use the following code. DefaultHttpClient client = n...
TITLE: Problem with setting header "Content-Type" in uploading file with HttpClient4 QUESTION: I'm trying to a upload file (or multiple files) to my servlet, which is using Apache file-upload to handle and get post-ed files. All is going well and the file is send and recieved, when I use the following code. DefaultHtt...
[ "java", "file-upload", "httpclient" ]
3
2
13,393
2
0
2011-06-02T08:56:16.253000
2011-06-02T09:22:19.207000
6,212,413
6,212,515
Can I use a collection initializer with LINQ to return a fully populated collection?
I would like to rewrite the following code in one line, using LINQ. Is it possible? var to = new MailAddressCollection(); foreach(string recipient in recipients) { to.Add(new MailAddress(recipient)); } Something like the following would be ideal. As written it returns multiple MailAddressCollections: var to = recipien...
MailAddressCollection doesn't have a constructor that takes list of recipients. If you really want to do it in one line, you can write the following: var to = recipients.Aggregate(new MailAddressCollection(), (c, r) => { c.Add(new MailAddress(r)); return c; });
Can I use a collection initializer with LINQ to return a fully populated collection? I would like to rewrite the following code in one line, using LINQ. Is it possible? var to = new MailAddressCollection(); foreach(string recipient in recipients) { to.Add(new MailAddress(recipient)); } Something like the following wou...
TITLE: Can I use a collection initializer with LINQ to return a fully populated collection? QUESTION: I would like to rewrite the following code in one line, using LINQ. Is it possible? var to = new MailAddressCollection(); foreach(string recipient in recipients) { to.Add(new MailAddress(recipient)); } Something like...
[ "c#", "linq" ]
7
5
2,892
5
0
2011-06-02T08:58:17.923000
2011-06-02T09:11:10.693000
6,212,415
6,222,890
Compiling wmii on Fedora 15 x86_64
I'm having trouble compiling wmii v3.9.2 on Fedora 15; Here's the interesting part (things break down at the linking stage): % bmake -de MAKE all libbio/ MAKE all libfmt/ MAKE all libregexp/ MAKE all libutf/ MAKE all libixp/ MAKE all doc/ MAKE all man/ MAKE all cmd/ MAKE all cmd/wmii/ MAKE all cmd/menu/ LD cmd/wmii9men...
And the solution is as follows: --- wmii+ixp-3.9.2/config.mk 2011-06-03 14:03:22.950163074 +1000 +++ wmii+ixp-3.9.2/config.mk 2011-06-03 14:03:16.086129011 +1000 @@ -32 +32 @@ -X11PACKAGES = xft +X11PACKAGES = xft xext xrandr xrender xinerama
Compiling wmii on Fedora 15 x86_64 I'm having trouble compiling wmii v3.9.2 on Fedora 15; Here's the interesting part (things break down at the linking stage): % bmake -de MAKE all libbio/ MAKE all libfmt/ MAKE all libregexp/ MAKE all libutf/ MAKE all libixp/ MAKE all doc/ MAKE all man/ MAKE all cmd/ MAKE all cmd/wmii/...
TITLE: Compiling wmii on Fedora 15 x86_64 QUESTION: I'm having trouble compiling wmii v3.9.2 on Fedora 15; Here's the interesting part (things break down at the linking stage): % bmake -de MAKE all libbio/ MAKE all libfmt/ MAKE all libregexp/ MAKE all libutf/ MAKE all libixp/ MAKE all doc/ MAKE all man/ MAKE all cmd/ ...
[ "linux", "fedora", "ld" ]
2
1
1,525
1
0
2011-06-02T08:58:26.357000
2011-06-03T04:14:33.370000
6,212,419
6,213,733
C/C++: Easily unzip to memory
I need to find a library that allows me to easily get a directory listing of all the files inside a ZIP archive and allows me to extract any given file inside the archive to memory (a buffer). Preferably, it should be a high-level library since my requirements aren't very complex (what I mentioned above is pretty much ...
While.zip uses zlib http://zlib.net compression, it alone is not sufficient to get a directory listing from a.zip file. You also need code that can read the.zip dictionary format. Check out Minizip http://www.winimage.com/zLibDll/minizip.html. It provides a code and simple zip/unzip command line executables. edit 2 The...
C/C++: Easily unzip to memory I need to find a library that allows me to easily get a directory listing of all the files inside a ZIP archive and allows me to extract any given file inside the archive to memory (a buffer). Preferably, it should be a high-level library since my requirements aren't very complex (what I m...
TITLE: C/C++: Easily unzip to memory QUESTION: I need to find a library that allows me to easily get a directory listing of all the files inside a ZIP archive and allows me to extract any given file inside the archive to memory (a buffer). Preferably, it should be a high-level library since my requirements aren't very...
[ "c++", "c", "zip", "unzip" ]
3
3
6,660
2
0
2011-06-02T08:59:26.073000
2011-06-02T11:08:18.340000
6,212,420
6,212,452
A pattern that matches all except starting with a word
How can I set a regex pattern which matches all words but the strings which starts with /word /word/ /word/ following by anything else. I think the pattern starts with \A but I don'0t know how to tell that should not follow a word Thanks
Use this kind of negate regex and replace word by your word. ^((?!word).)*$
A pattern that matches all except starting with a word How can I set a regex pattern which matches all words but the strings which starts with /word /word/ /word/ following by anything else. I think the pattern starts with \A but I don'0t know how to tell that should not follow a word Thanks
TITLE: A pattern that matches all except starting with a word QUESTION: How can I set a regex pattern which matches all words but the strings which starts with /word /word/ /word/ following by anything else. I think the pattern starts with \A but I don'0t know how to tell that should not follow a word Thanks ANSWER: ...
[ "java", "regex" ]
4
5
4,118
4
0
2011-06-02T08:59:28.053000
2011-06-02T09:03:59.443000
6,212,422
6,231,363
Deployment error message in Jeveloper
I am deploying my BPEL project on Web-logic server through my JDeveloper 11g. its working fine. but when I selected my different environment for deployment(new one) then I got the following error. Error is due to one of my BPEL prcess "TaskProcess1". but the same setup when I deploy to my own server its deploying and r...
Is there a dependant jar file that you are accessing from your bpel process? Check the log files on the server for the soa_server. It will give you more information as to why it failed at the server
Deployment error message in Jeveloper I am deploying my BPEL project on Web-logic server through my JDeveloper 11g. its working fine. but when I selected my different environment for deployment(new one) then I got the following error. Error is due to one of my BPEL prcess "TaskProcess1". but the same setup when I deplo...
TITLE: Deployment error message in Jeveloper QUESTION: I am deploying my BPEL project on Web-logic server through my JDeveloper 11g. its working fine. but when I selected my different environment for deployment(new one) then I got the following error. Error is due to one of my BPEL prcess "TaskProcess1". but the same ...
[ "soa", "jdeveloper", "bpel" ]
0
0
2,433
1
0
2011-06-02T08:59:43.427000
2011-06-03T18:48:43.977000
6,212,430
6,212,589
Does Anyone know which all fields in an X.509 certificate is used for authenticating the digital signature?
I'm trying validate an X.509 certificate received over a network. I have understood that the digital signature is created by creating a message digest of the fields(don't know which fields) in the signature and then encrypting it using the CA(Certificate Authority) private Key.We can validate the certificate by decrypt...
From a glance at the RFC it appears to be the whole tbsCertificate field. [...] a digital signature computed upon the ASN.1 DER encoded tbsCertificate. The ASN.1 DER encoded tbsCertificate is used as the input to the signature function.
Does Anyone know which all fields in an X.509 certificate is used for authenticating the digital signature? I'm trying validate an X.509 certificate received over a network. I have understood that the digital signature is created by creating a message digest of the fields(don't know which fields) in the signature and t...
TITLE: Does Anyone know which all fields in an X.509 certificate is used for authenticating the digital signature? QUESTION: I'm trying validate an X.509 certificate received over a network. I have understood that the digital signature is created by creating a message digest of the fields(don't know which fields) in t...
[ "java", "c", "validation", "certificate", "x509certificate" ]
0
1
278
1
0
2011-06-02T09:01:02.733000
2011-06-02T09:17:26.723000
6,212,432
6,212,512
Instance variables in Java
Please explain the following behaviour. class Base { public int num = 3; public int getNum() { return num; } public void setNum(int num) { this.num = num; } } class child extends Base { public int num = 4; public child() { } public child(int i) { this.num = i; } public int getNum() { return num; } public void s...
Because the objects are declared with super class type, you get the super member variable value. If the object was declared with sub class type, the value would be overridden value. If the Base obj3 = new child(10); is modified to child obj3 = new child(10); the output would be 3 4 10 10 This is well explained here
Instance variables in Java Please explain the following behaviour. class Base { public int num = 3; public int getNum() { return num; } public void setNum(int num) { this.num = num; } } class child extends Base { public int num = 4; public child() { } public child(int i) { this.num = i; } public int getNum() { r...
TITLE: Instance variables in Java QUESTION: Please explain the following behaviour. class Base { public int num = 3; public int getNum() { return num; } public void setNum(int num) { this.num = num; } } class child extends Base { public int num = 4; public child() { } public child(int i) { this.num = i; } publi...
[ "instance-variables", "overriding" ]
1
1
118
1
0
2011-06-02T09:01:13.907000
2011-06-02T09:11:02.703000