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,186,454
6,210,785
Is there a callback on completion of a CSS3 animation?
Is there any way to implement a callback function in case of css3 animation? In case of Javascript animation its possible but not finding any way to do it in css3. One way I could see is to execute callback after the animation duration but that doesn't make sure that it will always be called right after the animation e...
Yes, there is. The callback is an event, so you must add an event listener to catch it. This is an example with jQuery: $("#sun").bind('oanimationend animationend webkitAnimationEnd', function() { alert("fin") }); Or pure js: element.addEventListener("webkitAnimationEnd", callfunction,false); element.addEventListener("...
Is there a callback on completion of a CSS3 animation? Is there any way to implement a callback function in case of css3 animation? In case of Javascript animation its possible but not finding any way to do it in css3. One way I could see is to execute callback after the animation duration but that doesn't make sure th...
TITLE: Is there a callback on completion of a CSS3 animation? QUESTION: Is there any way to implement a callback function in case of css3 animation? In case of Javascript animation its possible but not finding any way to do it in css3. One way I could see is to execute callback after the animation duration but that do...
[ "javascript", "css", "dom-events", "css-animations" ]
99
143
53,337
3
0
2011-05-31T10:51:05.780000
2011-06-02T05:28:03.570000
6,186,457
6,186,937
SQL: What's the state of ID x on date y (is there a more efficient way?)
I have two tables: one containing a list of IDs and one containing some time related information about those IDs. example ID_TABLE ID 1 2 3 INFO_TABLE ID START END STATE 1 2000-01-01 2000-01-31 A 1 2000-02-01 2000-03-31 B 3 2000-02-01 2000-02-31 A 3 2000-03-01 2000-05-31 C (please notice, that ID=2 is not present in t...
I'm not entirely sure I get your question, but if the wikipedia page that you link is anything to go by, what you're really looking for is closer to this: select t.id, '2000-01-01'::date + (m.mon || ' months')::interval as month, t.state from generate_series(0, 11) as m (mon) left join info_table t on '2000-01-15'::dat...
SQL: What's the state of ID x on date y (is there a more efficient way?) I have two tables: one containing a list of IDs and one containing some time related information about those IDs. example ID_TABLE ID 1 2 3 INFO_TABLE ID START END STATE 1 2000-01-01 2000-01-31 A 1 2000-02-01 2000-03-31 B 3 2000-02-01 2000-02-31 ...
TITLE: SQL: What's the state of ID x on date y (is there a more efficient way?) QUESTION: I have two tables: one containing a list of IDs and one containing some time related information about those IDs. example ID_TABLE ID 1 2 3 INFO_TABLE ID START END STATE 1 2000-01-01 2000-01-31 A 1 2000-02-01 2000-03-31 B 3 2000...
[ "sql", "postgresql", "date", "panel" ]
1
1
75
1
0
2011-05-31T10:51:23.603000
2011-05-31T11:34:53.503000
6,186,469
6,222,980
Alert Dialog dismissing on ScreenLock
My Alert Dialog is dismissing when screen is locked and Unlocked.In my case, 1)Starting connection in asynctask (which is inner class),here progress dialog starts saying "please wait...". 2)After completion of connection ProgressDilog is dismissed and Alert Message is shown. So,In this process when i lock the screen wh...
Correct me if am wrong.Form my observation when an activity is in paused state,the corresponding AsyncTask is stopped. So,In my case when screen is locked connection which is in doInBackground of asynctask already starts execution.But due to the screen lock reasons asyncTask is stopped and onPostExecute is not Completi...
Alert Dialog dismissing on ScreenLock My Alert Dialog is dismissing when screen is locked and Unlocked.In my case, 1)Starting connection in asynctask (which is inner class),here progress dialog starts saying "please wait...". 2)After completion of connection ProgressDilog is dismissed and Alert Message is shown. So,In ...
TITLE: Alert Dialog dismissing on ScreenLock QUESTION: My Alert Dialog is dismissing when screen is locked and Unlocked.In my case, 1)Starting connection in asynctask (which is inner class),here progress dialog starts saying "please wait...". 2)After completion of connection ProgressDilog is dismissed and Alert Messag...
[ "android" ]
2
2
2,526
3
0
2011-05-31T10:52:14.860000
2011-06-03T04:31:11.700000
6,186,472
6,189,977
Flex 3: Keeping focus on a textbox when clicking a button
Quick background. I have a series of editable text areas in which I want to be able to add a variable on the click of a button. If I click the button the textarea loses focus and so I cant code which textarea I need to add the variable into. Can anyone think of a way of keeping focus on the textbox, inserting the varia...
Sorted! public var textAreaToBeChanged: Object; public var textposition:int //when leaving focus on a textbox, record the textarea and text position. If a button is clicked to add a variable, it needs to be added at this position protected function onTextAreaLoseFocus(event:FocusEvent):void{ textAreaToBeChanged = even...
Flex 3: Keeping focus on a textbox when clicking a button Quick background. I have a series of editable text areas in which I want to be able to add a variable on the click of a button. If I click the button the textarea loses focus and so I cant code which textarea I need to add the variable into. Can anyone think of ...
TITLE: Flex 3: Keeping focus on a textbox when clicking a button QUESTION: Quick background. I have a series of editable text areas in which I want to be able to add a variable on the click of a button. If I click the button the textarea loses focus and so I cant code which textarea I need to add the variable into. Ca...
[ "apache-flex", "variables", "insert", "focus" ]
1
0
1,430
2
0
2011-05-31T10:52:24.007000
2011-05-31T15:33:31.943000
6,186,478
6,187,074
Firebug: Track what script or line of code, which made changes
Is it possible to track what script or what line of code, that ex. set a width on an element? //KennethBL
On IE you can use the onpropertychanged event to fire an event when the width element is fired. On IE 9, Chrome and FF you can use the DOMAttrModified: var elm = document.getElementById ("targetElemntId"); if (elm.addEventListener) { // all browsers except IE before version 9 elm.addEventListener ('DOMAttrModified', ch...
Firebug: Track what script or line of code, which made changes Is it possible to track what script or what line of code, that ex. set a width on an element? //KennethBL
TITLE: Firebug: Track what script or line of code, which made changes QUESTION: Is it possible to track what script or what line of code, that ex. set a width on an element? //KennethBL ANSWER: On IE you can use the onpropertychanged event to fire an event when the width element is fired. On IE 9, Chrome and FF you c...
[ "javascript", "firebug" ]
0
0
203
1
0
2011-05-31T10:53:02.597000
2011-05-31T11:46:54.893000
6,186,483
6,187,491
Apply jquery functions to loaded elements
I'm trying to apply functions on loaded element, I search the web but i don't understand what to do. Can anyone tell me what to do? Example: And this is the element to load: Echéance: * as you notice there is "datepicker-inline".. the probleme is that datepicker is not working on the loaded input Thanks:)
You should use ' live ' when binding your datepicker, like this: $('.datepicker-inline').live('click', function() { $(this).datepicker({showOn:'focus'}).focus(); }); (shamelessly lifted from this other question ) Otherwise, your datepicker-binding code will not see the new elements to convert to datepickers (they did n...
Apply jquery functions to loaded elements I'm trying to apply functions on loaded element, I search the web but i don't understand what to do. Can anyone tell me what to do? Example: And this is the element to load: Echéance: * as you notice there is "datepicker-inline".. the probleme is that datepicker is not working ...
TITLE: Apply jquery functions to loaded elements QUESTION: I'm trying to apply functions on loaded element, I search the web but i don't understand what to do. Can anyone tell me what to do? Example: And this is the element to load: Echéance: * as you notice there is "datepicker-inline".. the probleme is that datepick...
[ "jquery", "ajax", "load" ]
0
0
532
2
0
2011-05-31T10:53:29.313000
2011-05-31T12:21:35.350000
6,186,485
6,186,522
How to get value from object?
I have this code which works. $(document).ready(function(){ $('form').live('submit', function(){ // have to do it like this to simulate my problem var aform = $(this); var dat = { "TITLE": "55h5", "OWNER": "fff" }; $('#template').tmpl(dat).prependTo('#content'); return false; }); }); But what I would like is to tak...
You could use.serializeArray(), and then loop over it to create the right data structure: var data = {}, values = $(this).serializeArray(); for(var i = values.length; i--;) { data[values[i].name] = values[i].value; } You could do the same with plain JavaScript (is probably faster): var elements = $(this)[0].elements, ...
How to get value from object? I have this code which works. $(document).ready(function(){ $('form').live('submit', function(){ // have to do it like this to simulate my problem var aform = $(this); var dat = { "TITLE": "55h5", "OWNER": "fff" }; $('#template').tmpl(dat).prependTo('#content'); return false; }); }); B...
TITLE: How to get value from object? QUESTION: I have this code which works. $(document).ready(function(){ $('form').live('submit', function(){ // have to do it like this to simulate my problem var aform = $(this); var dat = { "TITLE": "55h5", "OWNER": "fff" }; $('#template').tmpl(dat).prependTo('#content'); return...
[ "javascript", "jquery", "ajax" ]
0
5
97
1
0
2011-05-31T10:53:31.573000
2011-05-31T10:57:58.950000
6,186,486
6,186,838
Wrapping text in C# dialog box
I've got a dialog box that pops up with a dynamic list of numbers, and I'd like to get the box to wrap the text because at the moment it displayed up to screen width and then cuts the rest off. I know I can use \n to declare a new line, but the list is dynamic - it could be one item, it could be 20. Is there any way to...
Create your own simple form and add a label. Do the wrapping there... You cannot do that much things with Dialog boxes. In this way you have much more flexibility to show your information to the user.
Wrapping text in C# dialog box I've got a dialog box that pops up with a dynamic list of numbers, and I'd like to get the box to wrap the text because at the moment it displayed up to screen width and then cuts the rest off. I know I can use \n to declare a new line, but the list is dynamic - it could be one item, it c...
TITLE: Wrapping text in C# dialog box QUESTION: I've got a dialog box that pops up with a dynamic list of numbers, and I'd like to get the box to wrap the text because at the moment it displayed up to screen width and then cuts the rest off. I know I can use \n to declare a new line, but the list is dynamic - it could...
[ "c#", "user-interface", "word-wrap" ]
3
3
4,108
4
0
2011-05-31T10:53:46.857000
2011-05-31T11:24:19.713000
6,186,489
6,187,467
Button.IsSelected type of Property in WPF MVVM?
I have few buttons as Menu in my WPF App. This scenario is something like menu in a website. When I click one of the button, I want that button style to be different from others, and when I select another, the previous one should be normal and a selectedstyle should apply on this selected button. Can you tell me how ca...
You can try with the RadionButton. The below sample will create a Flat button look for the RadioButton. for RadioButton with Image just have look at Matt's blog http://madprops.org/blog/wpf-killed-the-radiobutton-star/
Button.IsSelected type of Property in WPF MVVM? I have few buttons as Menu in my WPF App. This scenario is something like menu in a website. When I click one of the button, I want that button style to be different from others, and when I select another, the previous one should be normal and a selectedstyle should apply...
TITLE: Button.IsSelected type of Property in WPF MVVM? QUESTION: I have few buttons as Menu in my WPF App. This scenario is something like menu in a website. When I click one of the button, I want that button style to be different from others, and when I select another, the previous one should be normal and a selected...
[ "wpf", "mvvm", "button", "menu" ]
1
6
3,360
3
0
2011-05-31T10:54:03.433000
2011-05-31T12:19:15.737000
6,186,493
6,186,547
Problems using Select query in sql server & asp.net
SELECT * FROM [productDetail] WHERE Price BETWEEN 0 AND 2000 OR Price BETWEEN 2000 AND 12000 AND CategoryID = 2 AND caravanOffline = 0 ORDER BY price The query doesn't produce the desired output, it also shows the products whose categoryID is 3,1 etc. Can any one spot the problem in the query. Updated code: static publ...
What do you really want to do with your WHERE clause?? Without any parenthesis, it's not clear at all what you're trying to select DO you really mean: WHERE (Price BETWEEN 0 AND 2000 OR Price BETWEEN 2000 AND 12000) AND CategoryID = 2 AND caravanOffline = 0 Price is between 0 and 2000, or between 2000 and 12000 (doesn'...
Problems using Select query in sql server & asp.net SELECT * FROM [productDetail] WHERE Price BETWEEN 0 AND 2000 OR Price BETWEEN 2000 AND 12000 AND CategoryID = 2 AND caravanOffline = 0 ORDER BY price The query doesn't produce the desired output, it also shows the products whose categoryID is 3,1 etc. Can any one spot...
TITLE: Problems using Select query in sql server & asp.net QUESTION: SELECT * FROM [productDetail] WHERE Price BETWEEN 0 AND 2000 OR Price BETWEEN 2000 AND 12000 AND CategoryID = 2 AND caravanOffline = 0 ORDER BY price The query doesn't produce the desired output, it also shows the products whose categoryID is 3,1 etc...
[ "asp.net", "sql", "select" ]
0
1
441
3
0
2011-05-31T10:55:06.870000
2011-05-31T11:00:25.293000
6,186,497
6,187,320
How to insert child element referencing foreign key in NHibernate?
I am still new to Fluent NHibernate. Not sure how I should approach this. I have two entities: public class Student { public virtual Guid StudentId { get; set; } public virtual String Dept_id { get; set; } public virtual String Name { get; set; } public virtual int Age { get; set; } public virtual String Address { get;...
When you are creating your new Student you need to set the Department not just the Id. Is there a reason you need a separate property for this? I would remove this property from your entity and from your mapping class and just leave in the Department reference. If you need the Department Id you can just reference it vi...
How to insert child element referencing foreign key in NHibernate? I am still new to Fluent NHibernate. Not sure how I should approach this. I have two entities: public class Student { public virtual Guid StudentId { get; set; } public virtual String Dept_id { get; set; } public virtual String Name { get; set; } public...
TITLE: How to insert child element referencing foreign key in NHibernate? QUESTION: I am still new to Fluent NHibernate. Not sure how I should approach this. I have two entities: public class Student { public virtual Guid StudentId { get; set; } public virtual String Dept_id { get; set; } public virtual String Name { ...
[ "fluent-nhibernate" ]
0
0
259
2
0
2011-05-31T10:55:38.243000
2011-05-31T12:05:34.107000
6,186,502
6,187,122
choosing a table column when using zend db select join
so I'm using Zend DB select and the join() function to join two tables... there are two columns in the joined tables that have the same name (say it's column "id") (and I'd like to keep it that way) but then when I use Zend_Paginator::factory() on the object, the results would only have one "id" entry from one of the t...
You can specify a field or list of returned fields as second parameter of from() OR third parameter of join(), joinLeft().... I mean 'OR' because you can't return field with same name twice. You can specify returned fields using: null (none will be returned), '*' (all will be returned), array (values will be real field...
choosing a table column when using zend db select join so I'm using Zend DB select and the join() function to join two tables... there are two columns in the joined tables that have the same name (say it's column "id") (and I'd like to keep it that way) but then when I use Zend_Paginator::factory() on the object, the r...
TITLE: choosing a table column when using zend db select join QUESTION: so I'm using Zend DB select and the join() function to join two tables... there are two columns in the joined tables that have the same name (say it's column "id") (and I'd like to keep it that way) but then when I use Zend_Paginator::factory() on...
[ "php", "mysql", "zend-framework", "join" ]
1
3
2,957
1
0
2011-05-31T10:56:40.770000
2011-05-31T11:50:29.133000
6,186,506
6,199,930
ASPMvc Routing Issues with legacy url
I have got a legacy url that I cannot change, which is output on a page which needs to now post to a new MVC version of the page: http://somesite.com/somepage?some-guid=xxxx-xxxx Now I am trying to map this to a new controller but I need to get the some-guid into my controller: public class MyController: Controller { [...
I would have thought you would have done a route a bit like this.. routes.MapRoute( "RouteName", // Name the route "somepage/{some-guid}", // the Url new { controller = "MyController", action = "DisplaySomething", some-guid = UrlParameter.Optional } ); The {some-guid} part of URL matches your url parmater and passes it...
ASPMvc Routing Issues with legacy url I have got a legacy url that I cannot change, which is output on a page which needs to now post to a new MVC version of the page: http://somesite.com/somepage?some-guid=xxxx-xxxx Now I am trying to map this to a new controller but I need to get the some-guid into my controller: pub...
TITLE: ASPMvc Routing Issues with legacy url QUESTION: I have got a legacy url that I cannot change, which is output on a page which needs to now post to a new MVC version of the page: http://somesite.com/somepage?some-guid=xxxx-xxxx Now I am trying to map this to a new controller but I need to get the some-guid into ...
[ "asp.net-mvc", "url-routing", "query-string" ]
0
0
221
3
0
2011-05-31T10:56:51.587000
2011-06-01T10:46:48.320000
6,186,511
6,186,626
How to reveal that screen is locked?
In my application I need to know when device is locked (on HTC's it looks like short press on "power" button). So the question is: which event is triggered when device is locked? Or device is going to sleep?
You should extend BroadcastReceiver and implement onReceive, like this: public class YourBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_SCREEN_OFF.equalsIgnoreCase(intent.getAction())) { //screen has been switched off! } } } Then you jus...
How to reveal that screen is locked? In my application I need to know when device is locked (on HTC's it looks like short press on "power" button). So the question is: which event is triggered when device is locked? Or device is going to sleep?
TITLE: How to reveal that screen is locked? QUESTION: In my application I need to know when device is locked (on HTC's it looks like short press on "power" button). So the question is: which event is triggered when device is locked? Or device is going to sleep? ANSWER: You should extend BroadcastReceiver and implemen...
[ "android", "sleep", "power-off" ]
9
5
3,582
3
0
2011-05-31T10:57:05.343000
2011-05-31T11:06:17.330000
6,186,514
6,186,643
pass hidden variable via header with php
you know that i can manipulate the headers in php like this: header("Content-Type:..."); header('Content-Description:...'); I want to use that to send a variable which is hidden for the user. so three questions occured: Can I change add a field say: additional-content-information and set it to Hello world or will it fa...
You might use cookies. Use setcookie() for setting cookie on server (must be done before anything is printed/echoed), $_COOKIE for reading them on server, document.cookie for reading and writing them in browser (javascript). Cookies are like "variables" that are generally invisible to user and that are accessible betwe...
pass hidden variable via header with php you know that i can manipulate the headers in php like this: header("Content-Type:..."); header('Content-Description:...'); I want to use that to send a variable which is hidden for the user. so three questions occured: Can I change add a field say: additional-content-informatio...
TITLE: pass hidden variable via header with php QUESTION: you know that i can manipulate the headers in php like this: header("Content-Type:..."); header('Content-Description:...'); I want to use that to send a variable which is hidden for the user. so three questions occured: Can I change add a field say: additional-...
[ "php", "http-headers", "parameter-passing" ]
0
2
3,384
2
0
2011-05-31T10:57:34.787000
2011-05-31T11:07:16.953000
6,186,517
6,186,675
Regexp <=/> regular language?
as I know, a regexp is equivalent with a altenating finite automat (reads one symbol and then comes a transition to the next state) Than how is it possible, that this regexp works fine in c#? var input = "bla bla bla bla "; Match match = Regex.Match(input, @"<(.*)>"); because the machine must stay in the "."-state, wha...
Backtracking: http://msdn.microsoft.com/en-us/library/dsy130b4.aspx. When you use code like: Match match = Regex.Match(input, @"<(.*)>"); Regex engine parses all chars in input string (and parse ">" as ".*" match) and don't find any matches. Then, it comes back in one symbol (last ">") and try to parse it as ">" in pat...
Regexp <=/> regular language? as I know, a regexp is equivalent with a altenating finite automat (reads one symbol and then comes a transition to the next state) Than how is it possible, that this regexp works fine in c#? var input = "bla bla bla bla "; Match match = Regex.Match(input, @"<(.*)>"); because the machine m...
TITLE: Regexp <=/> regular language? QUESTION: as I know, a regexp is equivalent with a altenating finite automat (reads one symbol and then comes a transition to the next state) Than how is it possible, that this regexp works fine in c#? var input = "bla bla bla bla "; Match match = Regex.Match(input, @"<(.*)>"); bec...
[ "c#", "regex" ]
0
4
132
3
0
2011-05-31T10:57:44.927000
2011-05-31T11:10:03.210000
6,186,527
6,186,694
Confirmation with save and discard button
How can we create a confirmation alert in javascript with a save and discard button in it? If we use the code confirm('Do you want to save it?'); We will get an alert box with ok cancel. How can we make the text of ok button as save and the other as discard?
You cannot modify the default javascript method "confirm". But, you can override it, for example, with jQuery UI dialog: window.confirm = function (message) { var html = " " + message + " "; $(html).dialog({ closeOnEscape: false, open: function (event, ui) { $('.ui-dialog-titlebar-close').hide(); }, modal: true, resiz...
Confirmation with save and discard button How can we create a confirmation alert in javascript with a save and discard button in it? If we use the code confirm('Do you want to save it?'); We will get an alert box with ok cancel. How can we make the text of ok button as save and the other as discard?
TITLE: Confirmation with save and discard button QUESTION: How can we create a confirmation alert in javascript with a save and discard button in it? If we use the code confirm('Do you want to save it?'); We will get an alert box with ok cancel. How can we make the text of ok button as save and the other as discard? ...
[ "javascript", "confirmation" ]
3
4
2,300
3
0
2011-05-31T10:58:12.853000
2011-05-31T11:11:23.697000
6,186,531
6,187,058
What is the best way to parse this string in C#?
I have a string that I am reading from another system. It's basically a long string that represents a list of key value pairs that are separated by a space in between. It looks like this: key:value[space]key:value[space]key:value[space] So I wrote this code to parse it: string myString = ReadinString(); string[] tokens...
Use this regular expression: \w+:[\w\s]+(?![\w+:]) I tested it on test:testvalue test2:test value test3:testvalue3 It returns three matches: test:testvalue test2:test value test3:testvalue3 You can change \w to any character set that can occur in your input. Code for testing this: var regex = new Regex(@"\w+:[\w\s]+(?!...
What is the best way to parse this string in C#? I have a string that I am reading from another system. It's basically a long string that represents a list of key value pairs that are separated by a space in between. It looks like this: key:value[space]key:value[space]key:value[space] So I wrote this code to parse it: ...
TITLE: What is the best way to parse this string in C#? QUESTION: I have a string that I am reading from another system. It's basically a long string that represents a list of key value pairs that are separated by a space in between. It looks like this: key:value[space]key:value[space]key:value[space] So I wrote this ...
[ "c#", ".net", "string", "parsing" ]
24
22
2,860
9
0
2011-05-31T10:58:59.153000
2011-05-31T11:45:11.930000
6,186,534
6,187,998
Excel: Dependent Dropdown Lists on Dynamic Content
I've imported a list of clients and their websites from the Google Analytics (GA) API in the following format: Account Profile Client 1 www.client1.com Client 1 sub.client1.com Client 1 tst.client1.com Client 2 www.client2.com Client 3 www.client3.com Client 3 sub.client3.com What I need is a dropdown list with the uni...
As long as you have this list sorted by Account, you can use a mixture of Offset CountA to give you all the ranges you need. Steps would be: a. Get unique values from Account column (i'm using VBA for this step but you could use Frequency formula to mash this too -- I'd avoid it if you can use VBA for this). Something ...
Excel: Dependent Dropdown Lists on Dynamic Content I've imported a list of clients and their websites from the Google Analytics (GA) API in the following format: Account Profile Client 1 www.client1.com Client 1 sub.client1.com Client 1 tst.client1.com Client 2 www.client2.com Client 3 www.client3.com Client 3 sub.clie...
TITLE: Excel: Dependent Dropdown Lists on Dynamic Content QUESTION: I've imported a list of clients and their websites from the Google Analytics (GA) API in the following format: Account Profile Client 1 www.client1.com Client 1 sub.client1.com Client 1 tst.client1.com Client 2 www.client2.com Client 3 www.client3.com...
[ "excel" ]
3
3
1,793
1
0
2011-05-31T10:59:33.150000
2011-05-31T13:03:59.910000
6,186,537
6,186,613
How do I kill an Android thread completely?
I have a service that has its own thread running on background. I'd like to kill that service including the thread. I created the thread like this and run it. public class DaemonService extends Service { private DaemonThread thread; class DaemonThread extends Thread { public void run() { runDaemon(mArgv.toArray(), mCo...
to kill the thread, i think you can do like this: myService.getThread().interrupt(); NOTE: the method Thread.stop() is deprecated EDIT:: try this public void stopThread(){ if(myService.getThread()!=null){ myService.getThread().interrupt(); myService.setThread(null); } }
How do I kill an Android thread completely? I have a service that has its own thread running on background. I'd like to kill that service including the thread. I created the thread like this and run it. public class DaemonService extends Service { private DaemonThread thread; class DaemonThread extends Thread { public...
TITLE: How do I kill an Android thread completely? QUESTION: I have a service that has its own thread running on background. I'd like to kill that service including the thread. I created the thread like this and run it. public class DaemonService extends Service { private DaemonThread thread; class DaemonThread exten...
[ "android" ]
33
41
82,125
5
0
2011-05-31T10:59:40.870000
2011-05-31T11:05:09.533000
6,186,540
6,189,241
Are bcrypt salts accessible separately?
When using has_secure_password in Rails 3.1, bcrypt randomly generates a salt for each user's password. Based on this response, I understand the salt is stored as part of the password hash. Is there a method or attribute available to access that salt separately, for example to use in writing secure cookies?
You'll be able to get the salt and checksum if you need it. gem install bcrypt-ruby irb require 'bcrypt' hash = BCrypt::Password.create 'superpass' => "$2a$10$DtjuZD6nJtrBRLEySlSVm.bJyBMhEhVRAeiVk/GjmQdBNf7WhmDWi" hash.salt => "$2a$10$DtjuZD6nJtrBRLEySlSVm." hash.checksum "bJyBMhEhVRAeiVk/GjmQdBNf7WhmDWi" hash == "sta...
Are bcrypt salts accessible separately? When using has_secure_password in Rails 3.1, bcrypt randomly generates a salt for each user's password. Based on this response, I understand the salt is stored as part of the password hash. Is there a method or attribute available to access that salt separately, for example to us...
TITLE: Are bcrypt salts accessible separately? QUESTION: When using has_secure_password in Rails 3.1, bcrypt randomly generates a salt for each user's password. Based on this response, I understand the salt is stored as part of the password hash. Is there a method or attribute available to access that salt separately,...
[ "ruby-on-rails", "salt", "bcrypt" ]
10
15
4,611
1
0
2011-05-31T10:59:55.857000
2011-05-31T14:36:55.960000
6,186,550
6,186,600
Store objects of three different classes in an array
This is an interview question: how can we store the objects of let's say 3 different classes which are totally independent of each other. My answer was: create an array which stores all void pointers. like: void *array[]; and store the pointers of all the objects.the array elements can be many. but for retrieving the e...
Why are you trying to make this so complicated? struct T { T1 obj1; T2 obj2; T3 obj3; }; If you instead mean that you have an array of objects, and each element can be of any of three distinct, unrelated types, then it's a silly interview question because it's a silly thing to do. (Yes, you would consider reinterpret_c...
Store objects of three different classes in an array This is an interview question: how can we store the objects of let's say 3 different classes which are totally independent of each other. My answer was: create an array which stores all void pointers. like: void *array[]; and store the pointers of all the objects.the...
TITLE: Store objects of three different classes in an array QUESTION: This is an interview question: how can we store the objects of let's say 3 different classes which are totally independent of each other. My answer was: create an array which stores all void pointers. like: void *array[]; and store the pointers of a...
[ "c++" ]
0
5
1,091
4
0
2011-05-31T11:00:40.557000
2011-05-31T11:04:06.083000
6,186,551
6,186,876
I need add parents for childrens with XSL
Please, I need your help!! I have code – dash1 – dash2 – dash3 text 1. number1 2. number2 3. number3 text (1) abc (2) abc and I need add parent for group li dash1 dash2 dash3 text number1 number2 number3 text abc abc Thanks very much. Daria
Here is some code if you need parents for dynamic data code. However if you don't have dynamic input it's better to just put entire code into XSL stylesheet. text text
I need add parents for childrens with XSL Please, I need your help!! I have code – dash1 – dash2 – dash3 text 1. number1 2. number2 3. number3 text (1) abc (2) abc and I need add parent for group li dash1 dash2 dash3 text number1 number2 number3 text abc abc Thanks very much. Daria
TITLE: I need add parents for childrens with XSL QUESTION: Please, I need your help!! I have code – dash1 – dash2 – dash3 text 1. number1 2. number2 3. number3 text (1) abc (2) abc and I need add parent for group li dash1 dash2 dash3 text number1 number2 number3 text abc abc Thanks very much. Daria ANSWER: Here is so...
[ "xml", "xslt" ]
1
0
189
1
0
2011-05-31T11:00:42.713000
2011-05-31T11:28:40.363000
6,186,560
6,186,638
Drawing a line through finger touch on iPhone
I do not want any code but I need reference tutorial on how to draw a smooth line on iPhone through finger touch. After drawing first line when user draws second line how can I find that second line intersects with the first line or not. Thanks in advance....
I am using this: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { self.currentPath = [UIBezierPath bezierPath]; currentPath.lineWidth = 3.0; [currentPath moveToPoint:[touch locationInView:self]]; [paths addObject:self.currentPath]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { ...
Drawing a line through finger touch on iPhone I do not want any code but I need reference tutorial on how to draw a smooth line on iPhone through finger touch. After drawing first line when user draws second line how can I find that second line intersects with the first line or not. Thanks in advance....
TITLE: Drawing a line through finger touch on iPhone QUESTION: I do not want any code but I need reference tutorial on how to draw a smooth line on iPhone through finger touch. After drawing first line when user draws second line how can I find that second line intersects with the first line or not. Thanks in advance....
[ "iphone", "objective-c" ]
6
11
5,112
1
0
2011-05-31T11:01:26.883000
2011-05-31T11:07:10.233000
6,186,561
6,186,930
Count the number of vowels in a string
I simply want to count vowels in a string using recursion, but it doesn't work. #include #include #define SETSIZ 10 #define TRUE 1 #define FALSE 0 int is_empty(const char *set); int is_element(char vowel, const char *set); int is_vowel(const char *vowels, const char *set); int main(void) { int count = 0,i; char vowel...
You do not loop through set as you probably want. Should be: if(is_vowel(vowels, &set[i])) Your function is_element() is absolutely wrong, You can change it to: int is_element(char vowel, const char *set) { return (vowel == set[0]); } or even pass characters instead of pointers to characters.
Count the number of vowels in a string I simply want to count vowels in a string using recursion, but it doesn't work. #include #include #define SETSIZ 10 #define TRUE 1 #define FALSE 0 int is_empty(const char *set); int is_element(char vowel, const char *set); int is_vowel(const char *vowels, const char *set); int m...
TITLE: Count the number of vowels in a string QUESTION: I simply want to count vowels in a string using recursion, but it doesn't work. #include #include #define SETSIZ 10 #define TRUE 1 #define FALSE 0 int is_empty(const char *set); int is_element(char vowel, const char *set); int is_vowel(const char *vowels, const ...
[ "c", "string", "recursion" ]
1
0
1,808
6
0
2011-05-31T11:01:32.697000
2011-05-31T11:34:24.177000
6,186,562
6,186,701
Can you explain the elements on this image
Could you tell me what is the circled element no.1 on this image? The one that look like a submenu, but it seams it's not a submenu. What does the logo in the top left corner mean?
The selected area consists of 1) list view The listview contains 1) ImageView at the left 2) textView with image background in the middle 3) imageview at the right Thanks Deepak
Can you explain the elements on this image Could you tell me what is the circled element no.1 on this image? The one that look like a submenu, but it seams it's not a submenu. What does the logo in the top left corner mean?
TITLE: Can you explain the elements on this image QUESTION: Could you tell me what is the circled element no.1 on this image? The one that look like a submenu, but it seams it's not a submenu. What does the logo in the top left corner mean? ANSWER: The selected area consists of 1) list view The listview contains 1) ...
[ "android" ]
1
2
74
6
0
2011-05-31T11:01:37.990000
2011-05-31T11:11:39.357000
6,186,563
6,186,698
Maintaining session state when using XElement.Load
My ASP.NET web application consumes an internal RSS feed which uses the identity of the currently logged on user to customise its content. The RSS feed is generated by a standard.ashx handler in my application. When I call the RSS feed using XElement.Load(rssFeedUri), the session state is not maintained (presumably bec...
You can do the below steps: Using WebClient class load the RSS URL content in a string. While using this WebClient class set the Cookies request header value same as the current web request Cookie header which have the session ID etc. Create String Reader from the string you get above use XElement.Load(str_reader) I ho...
Maintaining session state when using XElement.Load My ASP.NET web application consumes an internal RSS feed which uses the identity of the currently logged on user to customise its content. The RSS feed is generated by a standard.ashx handler in my application. When I call the RSS feed using XElement.Load(rssFeedUri), ...
TITLE: Maintaining session state when using XElement.Load QUESTION: My ASP.NET web application consumes an internal RSS feed which uses the identity of the currently logged on user to customise its content. The RSS feed is generated by a standard.ashx handler in my application. When I call the RSS feed using XElement....
[ "c#", "asp.net", "session" ]
1
2
365
1
0
2011-05-31T11:01:40.887000
2011-05-31T11:11:29.720000
6,186,569
6,186,697
What is the difference between [0-9]+ and [0-9]++?
Can someone explain me what is the difference between [0-9]+ and [0-9]++?
The PCRE engine, which PHP uses for regular expressions, supports "possessive quantifiers": Quantifiers followed by + are "possessive". They eat as many characters as possible and don't return to match the rest of the pattern. Thus.*abc matches "aabc" but.*+abc doesn't because.*+ eats the whole string. Possessive quant...
What is the difference between [0-9]+ and [0-9]++? Can someone explain me what is the difference between [0-9]+ and [0-9]++?
TITLE: What is the difference between [0-9]+ and [0-9]++? QUESTION: Can someone explain me what is the difference between [0-9]+ and [0-9]++? ANSWER: The PCRE engine, which PHP uses for regular expressions, supports "possessive quantifiers": Quantifiers followed by + are "possessive". They eat as many characters as p...
[ "php", "regex" ]
7
15
32,190
2
0
2011-05-31T11:02:02.857000
2011-05-31T11:11:26.800000
6,186,570
6,186,624
Facebook API - Run javascript after user has logged in
at the minute I have this: login with Facebook I want to run some code to pull the email aswell, say this: FB.api('/me', function(res) { if (res!= null) { alert(res.email); } } ); When I added this under the call to FB.init(), it was run as soon as the window loaded, which is understandable but not what I wanted. I wan...
you can use the events for this: Facebook Test Login with Facebook see http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ for more events you could subscribe to. updated with full example
Facebook API - Run javascript after user has logged in at the minute I have this: login with Facebook I want to run some code to pull the email aswell, say this: FB.api('/me', function(res) { if (res!= null) { alert(res.email); } } ); When I added this under the call to FB.init(), it was run as soon as the window loade...
TITLE: Facebook API - Run javascript after user has logged in QUESTION: at the minute I have this: login with Facebook I want to run some code to pull the email aswell, say this: FB.api('/me', function(res) { if (res!= null) { alert(res.email); } } ); When I added this under the call to FB.init(), it was run as soon a...
[ "javascript", "facebook", "api" ]
1
3
462
1
0
2011-05-31T11:02:10.223000
2011-05-31T11:06:06.533000
6,186,571
6,188,007
Grails Hibernate annotations
Can any1 explain me what hibernate annotations are for? I'm learning hibernate/grails and can't understand what it does. Check here: http://grails.org/doc/1.0.x/guide/15.%20Grails%20and%20Hibernate.html.
Hibernate annotations are an alternative way to map your domain classes to the database. Generally, they should only be used if you have an existing Hibernate-annotated domain model that you want to use in a Grails app. If you don't already have an existing domain model, then using the default GORM conventions is a mor...
Grails Hibernate annotations Can any1 explain me what hibernate annotations are for? I'm learning hibernate/grails and can't understand what it does. Check here: http://grails.org/doc/1.0.x/guide/15.%20Grails%20and%20Hibernate.html.
TITLE: Grails Hibernate annotations QUESTION: Can any1 explain me what hibernate annotations are for? I'm learning hibernate/grails and can't understand what it does. Check here: http://grails.org/doc/1.0.x/guide/15.%20Grails%20and%20Hibernate.html. ANSWER: Hibernate annotations are an alternative way to map your dom...
[ "hibernate", "grails", "annotations" ]
1
3
422
2
0
2011-05-31T11:02:10.613000
2011-05-31T13:04:56.590000
6,186,580
6,186,648
IF else converting to and or in sql server
I am converting this query WHERE (Worksheet.ProjectId = ' + CONVERT(VARCHAR(10), @ProjectId) + ') IF(@StatusTypeId IS NULL) BEGIN SET @WhereClause = ' AND StatusType.StatusTypeId IS NULL' END ELSE IF (@StatusTypeId > 0) BEGIN SET @WhereClause = ' AND StatusType.StatusTypeId = ' + CONVERT(VARCHAR(10), @StatusTypeId) EN...
This code... IF(@StatusTypeId IS NULL) BEGIN SET @WhereClause = ' AND StatusType.StatusTypeId IS NULL' END..has an implicit ELSE ELSE --@StatusTypeId IS NOT NULL SET... is something always true because no condition dynamically added You missed this implied "something always true for @StatusTypeId IS NOT NULL" The same ...
IF else converting to and or in sql server I am converting this query WHERE (Worksheet.ProjectId = ' + CONVERT(VARCHAR(10), @ProjectId) + ') IF(@StatusTypeId IS NULL) BEGIN SET @WhereClause = ' AND StatusType.StatusTypeId IS NULL' END ELSE IF (@StatusTypeId > 0) BEGIN SET @WhereClause = ' AND StatusType.StatusTypeId =...
TITLE: IF else converting to and or in sql server QUESTION: I am converting this query WHERE (Worksheet.ProjectId = ' + CONVERT(VARCHAR(10), @ProjectId) + ') IF(@StatusTypeId IS NULL) BEGIN SET @WhereClause = ' AND StatusType.StatusTypeId IS NULL' END ELSE IF (@StatusTypeId > 0) BEGIN SET @WhereClause = ' AND StatusT...
[ "sql-server" ]
0
0
240
1
0
2011-05-31T11:02:39.393000
2011-05-31T11:07:33.873000
6,186,582
6,186,688
Make checkbox checked by comparing the values
I have the following Checkbox list, which is generated from server in HTML format. I also have an Javascript array like the following. I want to loop through the the array and check each value against the each checkbox. If there's a match, then make that checkbox checked. I'm using jQuery 1.4. Generated Checkbox list: ...
// jQuery wrapper (function($){ // document-ready wrapper $(function(){ var arrMonth = [ "November", "October", "December"]; //Loop through the array and check each element against the check box list //if found, make the checkbox checked $.each(arrMonth, function( intIndex, objValue) { $("label:contains('" + objVal...
Make checkbox checked by comparing the values I have the following Checkbox list, which is generated from server in HTML format. I also have an Javascript array like the following. I want to loop through the the array and check each value against the each checkbox. If there's a match, then make that checkbox checked. I...
TITLE: Make checkbox checked by comparing the values QUESTION: I have the following Checkbox list, which is generated from server in HTML format. I also have an Javascript array like the following. I want to loop through the the array and check each value against the each checkbox. If there's a match, then make that c...
[ "javascript", "jquery", "jquery-selectors" ]
0
2
1,877
1
0
2011-05-31T11:02:48.250000
2011-05-31T11:10:51.043000
6,186,588
6,202,528
Showing notification in broadcast receiver
HI, I am in a situation that I need to display notification when call arrives. For this I am using broadcast receiver. Code is below public class MyPhoneStateListener extends PhoneStateListener { public Context context; @Override public void onCallStateChanged(int state, String incomingNumber) { // TODO Auto-generated ...
I ended up playing sound manually via media player. Code Now Looks like public class MyPhoneStateListener extends PhoneStateListener { public Context context; public static final String PREFS_NAME = "ealertprefs"; @Override public void onCallStateChanged(int state, String incomingNumber) { // TODO Auto-generated method...
Showing notification in broadcast receiver HI, I am in a situation that I need to display notification when call arrives. For this I am using broadcast receiver. Code is below public class MyPhoneStateListener extends PhoneStateListener { public Context context; @Override public void onCallStateChanged(int state, Strin...
TITLE: Showing notification in broadcast receiver QUESTION: HI, I am in a situation that I need to display notification when call arrives. For this I am using broadcast receiver. Code is below public class MyPhoneStateListener extends PhoneStateListener { public Context context; @Override public void onCallStateChange...
[ "android" ]
2
2
4,595
2
0
2011-05-31T11:03:12.447000
2011-06-01T14:08:07.327000
6,186,592
6,188,001
Is there any way to display the Out of Range, Remembered WIFI network in to our android application
I wanted to display all the networks which are available in my android mobile WIFI settings, even though they are in out of range. and I am unable to get them(Not inRange, Remembered Network) with ScanResult. Is there any alternative way to Display Not in Range Remembered Network to display into my application?
Don't use getScanResults(), that's going to display only the currently in range networks. Use WifiManager#getConfiguredNetworks() to return a List of the remembered networks.
Is there any way to display the Out of Range, Remembered WIFI network in to our android application I wanted to display all the networks which are available in my android mobile WIFI settings, even though they are in out of range. and I am unable to get them(Not inRange, Remembered Network) with ScanResult. Is there an...
TITLE: Is there any way to display the Out of Range, Remembered WIFI network in to our android application QUESTION: I wanted to display all the networks which are available in my android mobile WIFI settings, even though they are in out of range. and I am unable to get them(Not inRange, Remembered Network) with ScanR...
[ "android", "android-wifi" ]
0
1
649
1
0
2011-05-31T11:03:31.830000
2011-05-31T13:04:33.363000
6,186,593
6,186,948
jQuery unbind crashes update panel
I have a jQuery dialog with update panels inside it. To make things a little more complex, I use jQuery validate. In order to disable the validation, I use jQuery unbind function in beforeClose. The problem is that unbind "crashes" the update panels. Is there other way to disable the validation without "crashing" the u...
HERE the jquery name spaced events are explained... moreover you can do something like this $("#mainForm").bind("submit.something", function(e){/*...*/}); and wher you are unbinding you can do $("#mainForm").unbind("submit.something");
jQuery unbind crashes update panel I have a jQuery dialog with update panels inside it. To make things a little more complex, I use jQuery validate. In order to disable the validation, I use jQuery unbind function in beforeClose. The problem is that unbind "crashes" the update panels. Is there other way to disable the ...
TITLE: jQuery unbind crashes update panel QUESTION: I have a jQuery dialog with update panels inside it. To make things a little more complex, I use jQuery validate. In order to disable the validation, I use jQuery unbind function in beforeClose. The problem is that unbind "crashes" the update panels. Is there other w...
[ "jquery", "asp.net", "jquery-dialog" ]
0
1
514
1
0
2011-05-31T11:03:32.360000
2011-05-31T11:35:49.060000
6,186,615
6,186,721
iPhone : Problem with Orientation
I got a sample app from internet. In which I am trying to change it's Orientation. For changing the orientation I have write following coding: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } And also made changes in xib's Auto-sizing. But still its not working...
This should work, however if you are writing an application that uses a TabBarController you have to ensure that all viewcontrollers return YES from this method (alternative could be YES for some orientations).
iPhone : Problem with Orientation I got a sample app from internet. In which I am trying to change it's Orientation. For changing the orientation I have write following coding: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } And also made changes in xib's Auto...
TITLE: iPhone : Problem with Orientation QUESTION: I got a sample app from internet. In which I am trying to change it's Orientation. For changing the orientation I have write following coding: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } And also made cha...
[ "iphone", "objective-c", "cocoa-touch", "ios4" ]
0
1
186
2
0
2011-05-31T11:05:24.460000
2011-05-31T11:13:13.967000
6,186,631
6,193,621
encrypting uri segments in Codeigniter
I want to encrypt my uri segments that are passed as IDs to query into database tables. For example I'm using $id=urlencode($this->encrypt->encode($user['id'])); which is decode on another controller using $id_decrypt=$this->encrypt->decode(urldecode($id)); I have tested the encryption and decription and it seems to wo...
Within the file./application/config/config.php there is a section for permitted uri chars. The default characters are: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-; In some projects, I have changed this too: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\'+,-='; However, as the CodeIgniter Engineers state DO NOT CHA...
encrypting uri segments in Codeigniter I want to encrypt my uri segments that are passed as IDs to query into database tables. For example I'm using $id=urlencode($this->encrypt->encode($user['id'])); which is decode on another controller using $id_decrypt=$this->encrypt->decode(urldecode($id)); I have tested the encry...
TITLE: encrypting uri segments in Codeigniter QUESTION: I want to encrypt my uri segments that are passed as IDs to query into database tables. For example I'm using $id=urlencode($this->encrypt->encode($user['id'])); which is decode on another controller using $id_decrypt=$this->encrypt->decode(urldecode($id)); I hav...
[ "url", "codeigniter", "security", "codeigniter-url" ]
2
4
5,568
2
0
2011-05-31T11:06:37.430000
2011-05-31T21:12:19.087000
6,186,650
6,186,736
How to print the console value in my Eclipse?
My Application is in some other folder, I call that function, the output is printed in my console. How can I get the value from the console?
I'm not sure if I understand the question. However, you can use this code snippet to get line of text from console (it also works in Eclipse): String val = new BufferedReader(new InputStreamReader(System.in)).readLine(); System.out.println("val = " + val);
How to print the console value in my Eclipse? My Application is in some other folder, I call that function, the output is printed in my console. How can I get the value from the console?
TITLE: How to print the console value in my Eclipse? QUESTION: My Application is in some other folder, I call that function, the output is printed in my console. How can I get the value from the console? ANSWER: I'm not sure if I understand the question. However, you can use this code snippet to get line of text from...
[ "java", "console" ]
14
14
84,728
4
0
2011-05-31T11:07:35.227000
2011-05-31T11:14:44.663000
6,186,663
6,186,801
Can't send WCF Service request as SOAP+XML
Using Visual Studio 2010, I developed a WCF service hosted on a web application for a third party to use. They're telling me that they cannot invoke it. For testing, they redirected me to Altova XmlSpy and pointed out that, when creating a new SOAP request, if they choose the "Send as SOAP+XML (SOAP 1.2)" check in the ...
BasicHttpBinding uses SOAP 1.1 so you cannot send request in SOAP 1.2 to the endpoint using this binding. HTTP status code 415 means unsupported media type which also implies this because SOAP 1.1 uses text/xml content type whereas SOAP 1.2 uses application/soap+xml content type. If you want BasicHttpBinding equivalent...
Can't send WCF Service request as SOAP+XML Using Visual Studio 2010, I developed a WCF service hosted on a web application for a third party to use. They're telling me that they cannot invoke it. For testing, they redirected me to Altova XmlSpy and pointed out that, when creating a new SOAP request, if they choose the ...
TITLE: Can't send WCF Service request as SOAP+XML QUESTION: Using Visual Studio 2010, I developed a WCF service hosted on a web application for a third party to use. They're telling me that they cannot invoke it. For testing, they redirected me to Altova XmlSpy and pointed out that, when creating a new SOAP request, i...
[ "c#", "wcf", "soap", "xmlspy" ]
0
3
5,589
1
0
2011-05-31T11:08:44.147000
2011-05-31T11:20:32.770000
6,186,664
6,186,897
corecursion and codata
Would like to get step-by-step explanation of the following function in Haskell fibs = 0: 1: zipWith (+) fibs (tail fibs) I understand that the "fibs" in general is "lazy", so next item would be calculated "on demand", however I'm not sure how the "tail" function would work on infinite list. So the illustration of how ...
At the beginning, the evalution is like this: fibs = 0: 1: zipWith (+) fibs (tail fibs) If we replace fibs by its evaluation, it looks like this: fibs = 0: 1: zipWith (+) (0: 1:?) (1:?) Where? denotes the unevaluated thunk. Let's evaluate the next element of fibs: fibs = 0: 1: zipWith (+) (0: 1:?) (1:?) ==> fibs = 0: 1...
corecursion and codata Would like to get step-by-step explanation of the following function in Haskell fibs = 0: 1: zipWith (+) fibs (tail fibs) I understand that the "fibs" in general is "lazy", so next item would be calculated "on demand", however I'm not sure how the "tail" function would work on infinite list. So t...
TITLE: corecursion and codata QUESTION: Would like to get step-by-step explanation of the following function in Haskell fibs = 0: 1: zipWith (+) fibs (tail fibs) I understand that the "fibs" in general is "lazy", so next item would be calculated "on demand", however I'm not sure how the "tail" function would work on i...
[ "haskell" ]
4
14
1,604
3
0
2011-05-31T11:08:48.877000
2011-05-31T11:30:42.173000
6,186,668
6,186,722
PHP header and refresh not working
My server running in PHP 5.2.9, When I using refresh and header functions it's not working. Here is my code header("location: index.php"); header( "Refresh: 0;" ); Previously I'm working in a different server, It's working correctly. How can I solve this problem? this is my complete code if($_POST['sign_in']) { $email...
Location and Refresh both require an absolute URI (and it's "Location" instead of "location"). Try this one: header('Location: http://absolute.uri/file.ext'); If that does not help, check my answer for any "strange" PHP problem;)
PHP header and refresh not working My server running in PHP 5.2.9, When I using refresh and header functions it's not working. Here is my code header("location: index.php"); header( "Refresh: 0;" ); Previously I'm working in a different server, It's working correctly. How can I solve this problem? this is my complete ...
TITLE: PHP header and refresh not working QUESTION: My server running in PHP 5.2.9, When I using refresh and header functions it's not working. Here is my code header("location: index.php"); header( "Refresh: 0;" ); Previously I'm working in a different server, It's working correctly. How can I solve this problem? th...
[ "php", "header", "refresh" ]
1
5
36,561
4
0
2011-05-31T11:09:21.730000
2011-05-31T11:13:20.090000
6,186,679
6,186,739
Array, extract value from array key and group together
Using Sencha Touch (not important for the question), the beneath array of data is send to my PHP script. ["slider3"] => 1 ["toggle3"] => 0 ["text3"] => "text" ["slider8"] => 5 ["toggle8"] => 0 ["text8"] => "text" ["slider11"] => 4 ["toggle11"] => 0 ["text11"] => "text" ["slider4"] => 1 ["toggle4"] => 0 ["text4"] => "te...
Try: 1, "toggle3" => 0, "text3" => "text", "slider8" => 5, "toggle8" => 0, "text8" => "text", "slider11" => 4, "toggle11" => 0, "text11" => "text", "slider4" => 1, "toggle4" => 0, "text4" => "text", ); $newData = array(); foreach ($data as $entryKey => $entry) { if (preg_match('/^(.+?)(\d+)$/', $entryKey, $matches)) {...
Array, extract value from array key and group together Using Sencha Touch (not important for the question), the beneath array of data is send to my PHP script. ["slider3"] => 1 ["toggle3"] => 0 ["text3"] => "text" ["slider8"] => 5 ["toggle8"] => 0 ["text8"] => "text" ["slider11"] => 4 ["toggle11"] => 0 ["text11"] => "t...
TITLE: Array, extract value from array key and group together QUESTION: Using Sencha Touch (not important for the question), the beneath array of data is send to my PHP script. ["slider3"] => 1 ["toggle3"] => 0 ["text3"] => "text" ["slider8"] => 5 ["toggle8"] => 0 ["text8"] => "text" ["slider11"] => 4 ["toggle11"] => ...
[ "php", "arrays", "multidimensional-array" ]
0
3
481
1
0
2011-05-31T11:10:13.433000
2011-05-31T11:14:55.410000
6,186,686
6,186,804
Converting a sting to structure in objective-c
I have this string a:10,b:xx,e:20,m:xy,w:30,z:50 But, the keys and the value change... I want to convert it to a structure in objective-c (I want the app to convert the string to structure automatically, not manually) In PHP the result will be: $array = array( 'a' => 10, // or 'a' => "10" (doesn't matter) 'b' => "xx", ...
That PHP structure looks more like a dictionary to me, so I'm going to assume it is. NSString *s = @"a:10,b:xx,e:20,m:xy,w:30,z:50"; NSArray *pairs = [s componentsSeparatedByString:@","]; NSMutableArray *keys = [NSMutableArray array]; NSMutableArray *values = [NSMutableArray array]; for (NSString *pair in pairs) { NSA...
Converting a sting to structure in objective-c I have this string a:10,b:xx,e:20,m:xy,w:30,z:50 But, the keys and the value change... I want to convert it to a structure in objective-c (I want the app to convert the string to structure automatically, not manually) In PHP the result will be: $array = array( 'a' => 10, /...
TITLE: Converting a sting to structure in objective-c QUESTION: I have this string a:10,b:xx,e:20,m:xy,w:30,z:50 But, the keys and the value change... I want to convert it to a structure in objective-c (I want the app to convert the string to structure automatically, not manually) In PHP the result will be: $array = a...
[ "php", "objective-c", "arrays", "xcode", "string" ]
0
2
182
3
0
2011-05-31T11:10:48.217000
2011-05-31T11:20:42.600000
6,186,696
6,187,948
Getting css with jquery and Internet Explorer
I'm trying to get some css with jquery in internet explorer. The css is set in a external file and looks like this: #something a { text-decoration: none; /* since I dont want underline when not hover */ } #something a:hover { text-decoration: underline; } And I want to get if underline is set or not. This works in fir...
Adding a setTimeout makes it work: $("a").hover(function() { var x = $(this); setTimeout(function() { console.log(x.css("text-decoration")); }, 1); }); http://jsfiddle.net/ZGKqC/2/
Getting css with jquery and Internet Explorer I'm trying to get some css with jquery in internet explorer. The css is set in a external file and looks like this: #something a { text-decoration: none; /* since I dont want underline when not hover */ } #something a:hover { text-decoration: underline; } And I want to get...
TITLE: Getting css with jquery and Internet Explorer QUESTION: I'm trying to get some css with jquery in internet explorer. The css is set in a external file and looks like this: #something a { text-decoration: none; /* since I dont want underline when not hover */ } #something a:hover { text-decoration: underline; }...
[ "javascript", "jquery", "internet-explorer", "dom" ]
0
1
188
4
0
2011-05-31T11:11:26.470000
2011-05-31T13:00:43.190000
6,186,732
6,187,610
Index seek with coalesce
I have a table [MyTable] with a column [MyColumn] NVarchar(50). I have a nonclustered index on this column, now while running the below two queries: SELECT 1 FROM [MyTable] M WHERE M.[MyColumn] = @MyColumn SELECT 1 FROM [MyTable] M WHERE M.[MyColumn] = COALESCE(@MyColumn, M.[MyColumn] ) I noticed the first query is us...
May I know how will I make use of index seek with coalesce or isnull? Perhaps not an answer to your question but you can have two different queries. One for the case where @MyColumn is null and one for the case where you want to use @MyColumn in the where clause. IF @MyColumn IS NULL BEGIN SELECT 1 FROM [MyTable] M END...
Index seek with coalesce I have a table [MyTable] with a column [MyColumn] NVarchar(50). I have a nonclustered index on this column, now while running the below two queries: SELECT 1 FROM [MyTable] M WHERE M.[MyColumn] = @MyColumn SELECT 1 FROM [MyTable] M WHERE M.[MyColumn] = COALESCE(@MyColumn, M.[MyColumn] ) I noti...
TITLE: Index seek with coalesce QUESTION: I have a table [MyTable] with a column [MyColumn] NVarchar(50). I have a nonclustered index on this column, now while running the below two queries: SELECT 1 FROM [MyTable] M WHERE M.[MyColumn] = @MyColumn SELECT 1 FROM [MyTable] M WHERE M.[MyColumn] = COALESCE(@MyColumn, M.[...
[ "sql-server", "sql-server-2005", "sql-server-2008", "indexing" ]
13
2
6,012
5
0
2011-05-31T11:14:22.540000
2011-05-31T12:31:33.530000
6,186,745
6,187,400
WPF UI Style partially frozen in a wrong state after Command Execution
another day, another problem. Honestly, it would be rather boring if this ever stopped, wouldn't it? EDIT: Seems all of the background-information is obsolete. Here's the boiled down version: My Command class rigs up CanExecuteChanged with the CommandManagers RequerySuggested event (as described here: WPF Custom IComma...
You could try calling CommandManager.InvalidateRequerySuggested() from here. The CommandManager only pays attention to certain conditions in determining when the command target has changed, such as change in keyboard focus. In situations where the CommandManager does not sufficiently determine a change in conditions th...
WPF UI Style partially frozen in a wrong state after Command Execution another day, another problem. Honestly, it would be rather boring if this ever stopped, wouldn't it? EDIT: Seems all of the background-information is obsolete. Here's the boiled down version: My Command class rigs up CanExecuteChanged with the Comma...
TITLE: WPF UI Style partially frozen in a wrong state after Command Execution QUESTION: another day, another problem. Honestly, it would be rather boring if this ever stopped, wouldn't it? EDIT: Seems all of the background-information is obsolete. Here's the boiled down version: My Command class rigs up CanExecuteChan...
[ "c#", "wpf", "command" ]
0
1
305
1
0
2011-05-31T11:15:21.370000
2011-05-31T12:12:48.630000
6,186,746
6,187,258
How do i split a very long string into a list of shorter strings in python
In my current django project I have a model that stores very long strings (can be 5000-10000 or even more characters per DB entry) and then i need to split them when a user is calling the record (it really need to be in one record in the DB). What i need is it to return a list (queryset? depends if in the "SQL" part or...
>>> s = "This is a very long string with many many many many and many more sentences and there is not one character that i can use to split by, just by number of words" >>> l = s.split() >>> n = 5 >>> [' '.join(l[x:x+n]) for x in xrange(0, len(l), n)] ['This is a very long', 'string with many many many', 'many and many...
How do i split a very long string into a list of shorter strings in python In my current django project I have a model that stores very long strings (can be 5000-10000 or even more characters per DB entry) and then i need to split them when a user is calling the record (it really need to be in one record in the DB). Wh...
TITLE: How do i split a very long string into a list of shorter strings in python QUESTION: In my current django project I have a model that stores very long strings (can be 5000-10000 or even more characters per DB entry) and then i need to split them when a user is calling the record (it really need to be in one rec...
[ "python", "django", "django-queryset", "python-2.6" ]
3
8
5,959
2
0
2011-05-31T11:15:24.013000
2011-05-31T12:00:10.227000
6,186,752
6,186,803
C# Func<> and extension methods question
I have seen someone write below kind of Func<> pattern. And I am trying to experiment with Funcs and Lambdas to get the concepts right. so ExperimentalSelect returns a Func (with 2 args and bool return value). But I fail to understand that how all of the 3 return statements are valid (1 at a time). public static Func, ...
Your comments above the returns are not correct. intSelector and SomeMethod are not executed there. They will only be executed, when the return value of ExperimentalSelect is executed. return (x, y) => intSelector(number, number); This defines an anonymous method with two parameters. One of type BinaryTreeNode and one ...
C# Func<> and extension methods question I have seen someone write below kind of Func<> pattern. And I am trying to experiment with Funcs and Lambdas to get the concepts right. so ExperimentalSelect returns a Func (with 2 args and bool return value). But I fail to understand that how all of the 3 return statements are ...
TITLE: C# Func<> and extension methods question QUESTION: I have seen someone write below kind of Func<> pattern. And I am trying to experiment with Funcs and Lambdas to get the concepts right. so ExperimentalSelect returns a Func (with 2 args and bool return value). But I fail to understand that how all of the 3 retu...
[ "c#", ".net", "lambda" ]
4
4
3,998
3
0
2011-05-31T11:16:04.007000
2011-05-31T11:20:37.063000
6,186,755
6,186,786
CASCADE when defining relations in InnoDB
I'm wondering what does represent CASCADE when defining relations in InnoDB? I see it's something related to actions: ON DELETE & ON UPDATE. Do I have to set it to CASCADE on every relation in my tables?
If a row is deleted and one of its member is foriegn key elsewhere then then all rows in all tables which reference it as foreign key are also deleted. Read: http://en.wikipedia.org/wiki/Foreign_key
CASCADE when defining relations in InnoDB I'm wondering what does represent CASCADE when defining relations in InnoDB? I see it's something related to actions: ON DELETE & ON UPDATE. Do I have to set it to CASCADE on every relation in my tables?
TITLE: CASCADE when defining relations in InnoDB QUESTION: I'm wondering what does represent CASCADE when defining relations in InnoDB? I see it's something related to actions: ON DELETE & ON UPDATE. Do I have to set it to CASCADE on every relation in my tables? ANSWER: If a row is deleted and one of its member is fo...
[ "mysql", "innodb", "sql-delete", "cascading-deletes", "database-relations" ]
0
5
1,350
1
0
2011-05-31T11:16:26.643000
2011-05-31T11:19:04.583000
6,186,760
6,186,789
How to use android download service in the gingerbread frame work layer?
I need the instance of DownloadManager class in the gingerbread framework layer. I tried this, mgr=(DownloadManager) getSystemService(context.DOWNLOAD_SERVICE); But it is not working. How can i download a file using the download manager from the framework layer?
it is not working On StackOverflow, people will think more highly of you if you provide a reasonable set of symptoms. how can i download a file using the download manager from the framework layer? Here is a sample project demonstrating the use of DownloadManager.
How to use android download service in the gingerbread frame work layer? I need the instance of DownloadManager class in the gingerbread framework layer. I tried this, mgr=(DownloadManager) getSystemService(context.DOWNLOAD_SERVICE); But it is not working. How can i download a file using the download manager from the f...
TITLE: How to use android download service in the gingerbread frame work layer? QUESTION: I need the instance of DownloadManager class in the gingerbread framework layer. I tried this, mgr=(DownloadManager) getSystemService(context.DOWNLOAD_SERVICE); But it is not working. How can i download a file using the download ...
[ "android" ]
0
3
809
1
0
2011-05-31T11:16:31.260000
2011-05-31T11:19:22.493000
6,186,761
6,186,837
should we delete the observer when unregister it?
Observer *o = New Observer(); Subject *s = new Subject(); s->register(o); //Is it a good practice to delete the observer in the unregister function? //I feel it is not. As the Observer object might still be in use, for example, //it might be registered to another Subject. s->unregister(o); //So it is safe to rely on ...
I agree with your observation. It is not a good practice to delete the observer in the unregister function - for the simple fact that "one who creates the resource must be responsible for deleting the resource" This will avoid Magic behavior as perceived by the creator. Code behavior will be well defined - one who crea...
should we delete the observer when unregister it? Observer *o = New Observer(); Subject *s = new Subject(); s->register(o); //Is it a good practice to delete the observer in the unregister function? //I feel it is not. As the Observer object might still be in use, for example, //it might be registered to another Subje...
TITLE: should we delete the observer when unregister it? QUESTION: Observer *o = New Observer(); Subject *s = new Subject(); s->register(o); //Is it a good practice to delete the observer in the unregister function? //I feel it is not. As the Observer object might still be in use, for example, //it might be registere...
[ "c++", "observer-pattern" ]
1
5
1,637
8
0
2011-05-31T11:16:32.617000
2011-05-31T11:24:13.987000
6,186,763
6,186,808
Accessing R.java from different packages
I have an application divided in subpackages, just for personal organization: com.myname.myapp | `- com.myname.myapp.activities | `- com.myname.myapp.whatever | `-... The problem is that the generated R.java is located at com.myname.myapp and thus when I type R.id.something in a class from the subpackage com.myname.mya...
You can import R.file where ever you want. import com.myname.myapp.R; or else use at the variable like this com.myname.myapp.R.id.test
Accessing R.java from different packages I have an application divided in subpackages, just for personal organization: com.myname.myapp | `- com.myname.myapp.activities | `- com.myname.myapp.whatever | `-... The problem is that the generated R.java is located at com.myname.myapp and thus when I type R.id.something in a...
TITLE: Accessing R.java from different packages QUESTION: I have an application divided in subpackages, just for personal organization: com.myname.myapp | `- com.myname.myapp.activities | `- com.myname.myapp.whatever | `-... The problem is that the generated R.java is located at com.myname.myapp and thus when I type R...
[ "java", "android", "eclipse", "sdk" ]
14
24
13,867
3
0
2011-05-31T11:16:42.587000
2011-05-31T11:20:55.487000
6,186,770
6,186,905
Ajax request returns 200 OK, but an error event is fired instead of success
I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns 200 OK, but jQuery executes the error event. I tried a lot of things, but I could not figure out the problem. I am adding my code below: jQuery Code var row = "1"; var json = "{'TwitterId':'" + row + "'}"; ...
jQuery.ajax attempts to convert the response body based on the specified dataType parameter or the Content-Type header sent by the server. If the conversion fails (e.g. if the JSON/XML is invalid), the error callback is fired. Your AJAX code contains: dataType: "json" In this case jQuery: Evaluates the response as JSON...
Ajax request returns 200 OK, but an error event is fired instead of success I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns 200 OK, but jQuery executes the error event. I tried a lot of things, but I could not figure out the problem. I am adding my code ...
TITLE: Ajax request returns 200 OK, but an error event is fired instead of success QUESTION: I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns 200 OK, but jQuery executes the error event. I tried a lot of things, but I could not figure out the problem. I ...
[ "javascript", "jquery", "asp.net", "ajax", "json" ]
927
1,259
456,609
14
0
2011-05-31T11:17:38.467000
2011-05-31T11:31:53.367000
6,186,772
6,187,106
Java: Is there a way to get the expected uncompressed length of a zipped byte array?
I'm using java.util.zip to compress and uncompress byte arrays, using Inflater and Deflater. Does the compressed result contain information about the expected length of the original data or do I have to store it myself? I would like to know the expected length of the uncompressed information without uncompressing all o...
If you just compress and decompress byte arrays - without storing them in a ZipEntry - you must save the size yourself, as the byte array to which you compress the data is not necessarily used to its full extent. You can see this clearly from the example in Deflater 's javadoc: try { // Encode a String into bytes Strin...
Java: Is there a way to get the expected uncompressed length of a zipped byte array? I'm using java.util.zip to compress and uncompress byte arrays, using Inflater and Deflater. Does the compressed result contain information about the expected length of the original data or do I have to store it myself? I would like to...
TITLE: Java: Is there a way to get the expected uncompressed length of a zipped byte array? QUESTION: I'm using java.util.zip to compress and uncompress byte arrays, using Inflater and Deflater. Does the compressed result contain information about the expected length of the original data or do I have to store it mysel...
[ "java", "zip" ]
1
0
998
1
0
2011-05-31T11:17:46.983000
2011-05-31T11:49:24.473000
6,186,776
6,191,598
How to validate local VM clock with NTP on Windows Azure?
NTP (Network Time Protocol) is basically the de-facto standard to adjust setup server clocks. I have already raised a question about the expectations in terms of native clock accuracy on Windows Azure. Here comes a slightly different one: how I can validate the current clock reliability with NTP? The catch is that UDP ...
Assuming that UDP outgoing packets are still blocked by Azure (I'm surprised/disappointed this is still the case!) then maybe you could drop down to a TCP service with less resolution such as TIME or DAYTIME - see descriptions of both on http://www.nist.gov/pml/div688/grp40/its.cfm - you would obviously need to measure...
How to validate local VM clock with NTP on Windows Azure? NTP (Network Time Protocol) is basically the de-facto standard to adjust setup server clocks. I have already raised a question about the expectations in terms of native clock accuracy on Windows Azure. Here comes a slightly different one: how I can validate the ...
TITLE: How to validate local VM clock with NTP on Windows Azure? QUESTION: NTP (Network Time Protocol) is basically the de-facto standard to adjust setup server clocks. I have already raised a question about the expectations in terms of native clock accuracy on Windows Azure. Here comes a slightly different one: how I...
[ "azure", "udp", "clock", "ntp" ]
1
1
3,994
3
0
2011-05-31T11:18:04.473000
2011-05-31T18:03:43.333000
6,186,780
6,187,905
Trailing Slash Behavior in Rails Application
I am currently trying to mimic folder/files behavior in rails with category/articles schema. So, I have this in routes: match '/:category/' => 'category#list_articles' match '/:category/:article.:format' => 'article#show' Basically, request urls are: http://www.example.com/category/ http://www.example.com/category/arti...
I'm not sure there isn't something in rails that does it for you, but this should do: class TrailingSlashes def initialize(app) @app = app end def call(env) if match = env['REQUEST_PATH'].match(/(.*)\/$/) response = Rack::Response.new response.redirect(match[1]) response else @app.call(env) end end end
Trailing Slash Behavior in Rails Application I am currently trying to mimic folder/files behavior in rails with category/articles schema. So, I have this in routes: match '/:category/' => 'category#list_articles' match '/:category/:article.:format' => 'article#show' Basically, request urls are: http://www.example.com/c...
TITLE: Trailing Slash Behavior in Rails Application QUESTION: I am currently trying to mimic folder/files behavior in rails with category/articles schema. So, I have this in routes: match '/:category/' => 'category#list_articles' match '/:category/:article.:format' => 'article#show' Basically, request urls are: http:/...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "nginx", "slash" ]
1
2
1,014
1
0
2011-05-31T11:18:39.987000
2011-05-31T12:57:28.617000
6,186,835
6,186,969
Excluding computed results from a map of [1..]?
I'm currently working on a program which computes amicable pairs (Project Euler Problem 21 ). I've already found the solution, however I noticed that a flaw in my program was that it evaluates all of the numbers of the set [1..] whether or not we have already found the number to be a pair. i.e. If currently evaluating ...
Your problem is, that you try to safe work by outputting both amicable numbers. But actually, you don't safe very much, because your function still calculates for both numbers, whether they are amicable. Why not do it like this: import Data.List divSum:: (Integral a) => a -> [a] divSum n = sum (filter (\a -> a `mod` n...
Excluding computed results from a map of [1..]? I'm currently working on a program which computes amicable pairs (Project Euler Problem 21 ). I've already found the solution, however I noticed that a flaw in my program was that it evaluates all of the numbers of the set [1..] whether or not we have already found the nu...
TITLE: Excluding computed results from a map of [1..]? QUESTION: I'm currently working on a program which computes amicable pairs (Project Euler Problem 21 ). I've already found the solution, however I noticed that a flaw in my program was that it evaluates all of the numbers of the set [1..] whether or not we have al...
[ "list", "haskell", "infinite", "fold" ]
3
5
177
2
0
2011-05-31T11:24:06.440000
2011-05-31T11:37:49.190000
6,186,844
6,187,098
Clear a selection in Firefox
I have this function function smth() { var container = null; var newContainer = null; if (window.getSelection) { // all browsers, except IE before version 9 alert("first if"); var selectionRange = window.getSelection(); if (selectionRange.rangeCount > 0) { var range = selectionRange.getRangeAt(0); container = range.com...
For the problematic browser: document.selection.empty() For other browsers: window.getSelection().removeAllRanges() See http://help.dottoro.com/ljigixkc.php
Clear a selection in Firefox I have this function function smth() { var container = null; var newContainer = null; if (window.getSelection) { // all browsers, except IE before version 9 alert("first if"); var selectionRange = window.getSelection(); if (selectionRange.rangeCount > 0) { var range = selectionRange.getRang...
TITLE: Clear a selection in Firefox QUESTION: I have this function function smth() { var container = null; var newContainer = null; if (window.getSelection) { // all browsers, except IE before version 9 alert("first if"); var selectionRange = window.getSelection(); if (selectionRange.rangeCount > 0) { var range = sele...
[ "javascript", "range", "selection" ]
20
65
15,620
3
0
2011-05-31T11:24:58.620000
2011-05-31T11:48:57.733000
6,186,846
6,187,188
Android import apk file problem
I have created a keystore and created a apk file for version 1.0 of the app with the same keystore. But after that due to some prob, my pc is crashed and no more usable. But I have the keystore file using which I have developed the apk for version 1.0. Now I want to release version 2.0 of the same app. I used the same ...
Not only the keystore is important, but the same key should be used to sign the apk.
Android import apk file problem I have created a keystore and created a apk file for version 1.0 of the app with the same keystore. But after that due to some prob, my pc is crashed and no more usable. But I have the keystore file using which I have developed the apk for version 1.0. Now I want to release version 2.0 o...
TITLE: Android import apk file problem QUESTION: I have created a keystore and created a apk file for version 1.0 of the app with the same keystore. But after that due to some prob, my pc is crashed and no more usable. But I have the keystore file using which I have developed the apk for version 1.0. Now I want to rel...
[ "android", "google-play", "apk", "keystore" ]
0
1
578
3
0
2011-05-31T11:25:17.950000
2011-05-31T11:55:14.280000
6,186,850
6,186,884
How to import scala class automatically in eclipse?
I use eclipse as my scala ide. And I know that in java I can use short cut by content assistent to import classes. So I do not need type in the whole class name. Just need to type the first several characters. But in scala, I can not import classes automatically. Do I need to do some set up or it is just because scala ...
There is Scala IDE for Eclipse however it is not very mature these days, however improving day by day. As far as I remember it can import automatically, or you can use Eclipse global fix import hotkey ctrl+shift+o.
How to import scala class automatically in eclipse? I use eclipse as my scala ide. And I know that in java I can use short cut by content assistent to import classes. So I do not need type in the whole class name. Just need to type the first several characters. But in scala, I can not import classes automatically. Do I...
TITLE: How to import scala class automatically in eclipse? QUESTION: I use eclipse as my scala ide. And I know that in java I can use short cut by content assistent to import classes. So I do not need type in the whole class name. Just need to type the first several characters. But in scala, I can not import classes a...
[ "eclipse", "scala" ]
4
3
3,095
2
0
2011-05-31T11:25:44.803000
2011-05-31T11:29:16
6,186,853
6,187,161
Gaelyk - How Can I pass model objects between Controller and View
I am just starting to use Gaelyk. I was expecting it to behave like Spring MVC; I create my model object in the controller.groovy, and the format the model object in the.gtpl. In the controller I do this def model = new MyModel() model.setMyId(2) and in the.gtpl I do this Test ${model.myId} Model object is ${model} How...
I think your only option is the request object (as you say). You set the variables into the request object like: def model = new MyModel() model.setMyId(2) request.model = model forward 'view.gtpl' Then, in view.gtpl you do: Test ${request.model.myId} Model object is ${request.model} As request is short-lived, I would...
Gaelyk - How Can I pass model objects between Controller and View I am just starting to use Gaelyk. I was expecting it to behave like Spring MVC; I create my model object in the controller.groovy, and the format the model object in the.gtpl. In the controller I do this def model = new MyModel() model.setMyId(2) and in ...
TITLE: Gaelyk - How Can I pass model objects between Controller and View QUESTION: I am just starting to use Gaelyk. I was expecting it to behave like Spring MVC; I create my model object in the controller.groovy, and the format the model object in the.gtpl. In the controller I do this def model = new MyModel() model....
[ "google-app-engine", "groovy", "gaelyk" ]
1
4
330
2
0
2011-05-31T11:26:09.650000
2011-05-31T11:53:26.420000
6,186,854
6,187,029
how to select lines in Mysql while a condition lasts
I have something like this: Name.....Value A...........10 B............9 C............8 Meaning, the values are in descending order. I need to create a new table that will contain the values that make up 60% of the total values. So, this could be a pseudocode: set Total = sum(value) set counter = 0 foreach line from ta...
You'll likely need to use the lead() or lag() window function, possibly with a recursive query to merge the rows together. See this related question: merge DATE-rows if episodes are in direct succession or overlapping And in case you're using MySQL, you can work around the lack of window functions by using something li...
how to select lines in Mysql while a condition lasts I have something like this: Name.....Value A...........10 B............9 C............8 Meaning, the values are in descending order. I need to create a new table that will contain the values that make up 60% of the total values. So, this could be a pseudocode: set To...
TITLE: how to select lines in Mysql while a condition lasts QUESTION: I have something like this: Name.....Value A...........10 B............9 C............8 Meaning, the values are in descending order. I need to create a new table that will contain the values that make up 60% of the total values. So, this could be a ...
[ "sql", "sorting", "handler" ]
4
1
369
2
0
2011-05-31T11:26:14.647000
2011-05-31T11:43:09.213000
6,186,859
6,190,286
WCF serialization of base64Binary not being encoded correctly
Greetings! So I have a base class that defines a base64Binary property to be returned as an embedded file in XML. I am not getting any errors, however the string being returned is not being encoded as base64. Any ideas? I have included the base class, and also the code where it is being called. Any help would be greatl...
How do you see that the string is not base64-encoded? I tried a similar scenario (see below), and the Byte() was properly encoded in base-64. Public Class StackOverflow_6186859_751090 Public Class Declarations Public Const SchemaVersion As String = "http://my.namespace" End Class 'BinaryObjectType type '-------------...
WCF serialization of base64Binary not being encoded correctly Greetings! So I have a base class that defines a base64Binary property to be returned as an embedded file in XML. I am not getting any errors, however the string being returned is not being encoded as base64. Any ideas? I have included the base class, and al...
TITLE: WCF serialization of base64Binary not being encoded correctly QUESTION: Greetings! So I have a base class that defines a base64Binary property to be returned as an embedded file in XML. I am not getting any errors, however the string being returned is not being encoded as base64. Any ideas? I have included the ...
[ "wcf", "serialization", "base64" ]
0
0
915
1
0
2011-05-31T11:26:51.337000
2011-05-31T15:58:33.617000
6,186,861
6,217,688
Using UIHint in combination with LINQ to SQL generated class
I used LINQ to SQL to generate a dbml file which contains the database model for my database table. I want to use UIHint to let MVC present some fields as DropDownLists or Checkboxes in edit mode. But if I change the file, it will be lost if it's been regenerated. How should I solve that issue? I'm quite new to MVC and...
Since Linq-to-SQL auto-generates partial classes, you'll need to create a partial 'buddy class' where you will add your Data Annotations. Your buddy class mirrors portions of the auto-generated class that you need to modify. You tie them together with [MetadataType(typeof(BuddyClassName))] The partial buddy class and t...
Using UIHint in combination with LINQ to SQL generated class I used LINQ to SQL to generate a dbml file which contains the database model for my database table. I want to use UIHint to let MVC present some fields as DropDownLists or Checkboxes in edit mode. But if I change the file, it will be lost if it's been regener...
TITLE: Using UIHint in combination with LINQ to SQL generated class QUESTION: I used LINQ to SQL to generate a dbml file which contains the database model for my database table. I want to use UIHint to let MVC present some fields as DropDownLists or Checkboxes in edit mode. But if I change the file, it will be lost if...
[ "asp.net-mvc-3", "linq-to-sql", "c#-4.0", "asp.net-4.0" ]
0
2
852
2
0
2011-05-31T11:27:10.243000
2011-06-02T17:02:59.120000
6,186,864
6,187,810
WindowsCE 5.0 safe tcp ports
What ports are safe to use for custom applications under WindowsCE? For example if I use something around 3000 (3000, 3002 tested) it works. But if I use 4000, 11000 (tested), it does not work: it appears to be successfull in the server but nobody can connect.
What do you mean by "safe"? Just "open and usable"? There aren't any ports that are inherently blocked, though some services that you might incluse in the OS image could well use a port (e.g. HTTPD uses port 80). 4000 and 11000 are not used by any CE service, so they will be open, though your network itself could be fi...
WindowsCE 5.0 safe tcp ports What ports are safe to use for custom applications under WindowsCE? For example if I use something around 3000 (3000, 3002 tested) it works. But if I use 4000, 11000 (tested), it does not work: it appears to be successfull in the server but nobody can connect.
TITLE: WindowsCE 5.0 safe tcp ports QUESTION: What ports are safe to use for custom applications under WindowsCE? For example if I use something around 3000 (3000, 3002 tested) it works. But if I use 4000, 11000 (tested), it does not work: it appears to be successfull in the server but nobody can connect. ANSWER: Wha...
[ "c#", "tcp", "windows-ce", "port" ]
1
1
385
1
0
2011-05-31T11:27:34.937000
2011-05-31T12:48:43.797000
6,186,865
6,187,014
TortoiseSVN commit specific filetypes
Is there a way to commit only specific filetypes. For example all the.php files in a project. Thnx in advance.
The window that pops up when you're committing allowing you to select which files to commit actually has a column for Extension. You may have to make the window slightly larger to do that. Once you see it you can sort by extension and make your selection.
TortoiseSVN commit specific filetypes Is there a way to commit only specific filetypes. For example all the.php files in a project. Thnx in advance.
TITLE: TortoiseSVN commit specific filetypes QUESTION: Is there a way to commit only specific filetypes. For example all the.php files in a project. Thnx in advance. ANSWER: The window that pops up when you're committing allowing you to select which files to commit actually has a column for Extension. You may have to...
[ "svn", "tortoisesvn" ]
1
1
145
1
0
2011-05-31T11:27:39.150000
2011-05-31T11:41:34.620000
6,186,866
6,187,097
java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
i am programming a soundboard from android. the problem is that some sounds works, and some dont work. here is the traceback that i get for the sounds that doesnt work 05-31 13:23:04.227 18440 18603 W System.err: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed ...
There is a limitations on opening compressed files in the assets folder. This is because uncompressed files can be directly memory mapped into the processes virtual address space, therefore avoiding needing the same amount of memory again for decompression. Dealing with Asset Compression in Android Apps discusses some ...
java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed i am programming a soundboard from android. the problem is that some sounds works, and some dont work. here is the traceback that i get for the sounds that doesnt work 05-31 13:23:04.227 18440 18603 W System.err: ...
TITLE: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed QUESTION: i am programming a soundboard from android. the problem is that some sounds works, and some dont work. here is the traceback that i get for the sounds that doesnt work 05-31 13:23:04.227 18440 18...
[ "java", "android", "cordova", "filenotfoundexception" ]
61
45
60,441
14
0
2011-05-31T11:27:40.637000
2011-05-31T11:48:55.677000
6,186,867
6,189,215
What is the best way to save an array of structures in VB.NET?
I have 2 Structures Public Structure One Public ItemOne As String Public ItemTwo As Integer End Structure Public Structure Two Public ItemOne As String Public ItemTwo As Integer Public ItemThree As Integer Public ItemFour As Integer Public ItemFive As Integer End Structure Public TestOne(0) as One Public TestTwo(19) ...
You can use the serialization BinaryFormatter and save it to a file stream with Serialize, then read it using Deserialize. You'll need to add to your structure declarations. Public Structure Two... Dim bf As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter Dim fStream As New FileStream(filename, FileM...
What is the best way to save an array of structures in VB.NET? I have 2 Structures Public Structure One Public ItemOne As String Public ItemTwo As Integer End Structure Public Structure Two Public ItemOne As String Public ItemTwo As Integer Public ItemThree As Integer Public ItemFour As Integer Public ItemFive As Inte...
TITLE: What is the best way to save an array of structures in VB.NET? QUESTION: I have 2 Structures Public Structure One Public ItemOne As String Public ItemTwo As Integer End Structure Public Structure Two Public ItemOne As String Public ItemTwo As Integer Public ItemThree As Integer Public ItemFour As Integer Publi...
[ "vb.net", "arrays", "file-io", "structure" ]
1
6
6,608
2
0
2011-05-31T11:27:41.400000
2011-05-31T14:35:17.050000
6,186,873
6,187,329
How to move the cursor to the particullar paragraph using Microsoft.Office.Interop.Word?
We are developing C#.Net 4.0 Windows form based application using Microsoft.Office.Interop.Word reference. Now I want to move the position of the cursor to the particular paragraph. How I do it?
void MoveToParagraph(Microsoft.Office.Interop.Word.Document d, int number) { Microsoft.Office.Interop.Word.Range r = d.Paragraphs[number].Range; object dir = Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseStart; r.Collapse(ref dir); r.Select(); }
How to move the cursor to the particullar paragraph using Microsoft.Office.Interop.Word? We are developing C#.Net 4.0 Windows form based application using Microsoft.Office.Interop.Word reference. Now I want to move the position of the cursor to the particular paragraph. How I do it?
TITLE: How to move the cursor to the particullar paragraph using Microsoft.Office.Interop.Word? QUESTION: We are developing C#.Net 4.0 Windows form based application using Microsoft.Office.Interop.Word reference. Now I want to move the position of the cursor to the particular paragraph. How I do it? ANSWER: void Move...
[ "c#", ".net", "ms-word", "ms-office" ]
5
4
2,472
1
0
2011-05-31T11:28:14.730000
2011-05-31T12:06:16.407000
6,186,877
6,186,958
Lambda Expressions
A point from ISO draft n3290 section 5.1.2 paragraph, point 19: The closure type associated with a lambda-expression has a deleted (8.4.3) default constructor and a deleted copy assignment operator. It has an implicitly-declared copy constructor (12.8) and may have an implicitly declared move constructor (12.8). [ Note...
The closure type associated with a lambda-expression has a deleted (8.4.3) default constructor int main() { auto closure = [](){}; typedef decltype(closure) ClosureType; ClosureType closure2; // <-- not allowed return 0; } and a deleted copy assignment operator. It has an implicitly-declared copy constructor (12.8) a...
Lambda Expressions A point from ISO draft n3290 section 5.1.2 paragraph, point 19: The closure type associated with a lambda-expression has a deleted (8.4.3) default constructor and a deleted copy assignment operator. It has an implicitly-declared copy constructor (12.8) and may have an implicitly declared move constru...
TITLE: Lambda Expressions QUESTION: A point from ISO draft n3290 section 5.1.2 paragraph, point 19: The closure type associated with a lambda-expression has a deleted (8.4.3) default constructor and a deleted copy assignment operator. It has an implicitly-declared copy constructor (12.8) and may have an implicitly dec...
[ "c++", "c++11", "lambda" ]
17
30
2,513
2
0
2011-05-31T11:28:41.617000
2011-05-31T11:36:45.197000
6,186,878
6,186,927
How to put an UIWebView inside UIAlertView?
I've tried to add a WebView to the AlertView using this code: - (void)viewDidLoad { search = [[UIAlertView alloc] initWithTitle:@"title" message:@"iGoogle" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Search", nil]; [search addSubview:googleView]; googleView = [[UIWebView alloc] initWithFrame:CGRectMake...
try to add [search addSubview:googleView]; after the googlview is allocated...
How to put an UIWebView inside UIAlertView? I've tried to add a WebView to the AlertView using this code: - (void)viewDidLoad { search = [[UIAlertView alloc] initWithTitle:@"title" message:@"iGoogle" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Search", nil]; [search addSubview:googleView]; googleView =...
TITLE: How to put an UIWebView inside UIAlertView? QUESTION: I've tried to add a WebView to the AlertView using this code: - (void)viewDidLoad { search = [[UIAlertView alloc] initWithTitle:@"title" message:@"iGoogle" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Search", nil]; [search addSubview:googleV...
[ "iphone", "objective-c" ]
3
6
6,277
5
0
2011-05-31T11:28:51
2011-05-31T11:34:01.117000
6,186,886
6,186,963
Eclipse: search for the text in Java class comments etc
I want to search for the text that is written in annotations and comments in my java classes. e.g /** * Object interface mapping for hibernate-handled table: mytable. * @author */ public interface myInterface{ } I tried to search mytable in eclipse "java search" and "file search" but it not searching these texts and I...
If you do file search on all *.java files in the current workspace/the project with keyword mytable, then this file ( myInterface.java ) should be in the search result. That's how it's supposed to work.
Eclipse: search for the text in Java class comments etc I want to search for the text that is written in annotations and comments in my java classes. e.g /** * Object interface mapping for hibernate-handled table: mytable. * @author */ public interface myInterface{ } I tried to search mytable in eclipse "java search" ...
TITLE: Eclipse: search for the text in Java class comments etc QUESTION: I want to search for the text that is written in annotations and comments in my java classes. e.g /** * Object interface mapping for hibernate-handled table: mytable. * @author */ public interface myInterface{ } I tried to search mytable in ecli...
[ "java", "eclipse", "class", "search", "rad" ]
3
5
7,533
4
0
2011-05-31T11:29:18.917000
2011-05-31T11:37:13.650000
6,186,888
6,188,254
Loop through all bindings configured in IIS with powershell
I'm looking for a way to go through all binding settings already configured in my IIS. Im using this to work with the IIS in Powershell: Import-Module WebAdministration So far I was able to get the main required information i want: $Websites = Get-ChildItem IIS:\Sites My array $Websites is filled correctly and with the...
I don't know exactly what you are trying to do, but I will try. I see that you reference $Websites[2] which is webPage3. You can do it like this: $site = $websites | Where-object { $_.Name -eq 'WebPage3' } Then when you look at $site.Bindings, you will realize that you need the Collection member: $site.bindings.Collect...
Loop through all bindings configured in IIS with powershell I'm looking for a way to go through all binding settings already configured in my IIS. Im using this to work with the IIS in Powershell: Import-Module WebAdministration So far I was able to get the main required information i want: $Websites = Get-ChildItem II...
TITLE: Loop through all bindings configured in IIS with powershell QUESTION: I'm looking for a way to go through all binding settings already configured in my IIS. Im using this to work with the IIS in Powershell: Import-Module WebAdministration So far I was able to get the main required information i want: $Websites ...
[ "windows", "powershell", "iis-7" ]
7
7
24,263
3
0
2011-05-31T11:29:39.760000
2011-05-31T13:23:02.080000
6,186,896
6,192,574
Display custom image and have the ability to catch mouse input
I am trying to display several images in the MainWindow and have the ability to perform certain actions when these images receive mousePressEvent. For this, I thought I would create a new class, derived from QWidget, which had a QImage private member. With this, I as able to override the paintEvent and the mousePressEv...
If you want to use QWidget you should take look at the mask concept to refine the space occupied by your images (be careful about the performance of this implementation). If you decide to go with the QGraphicsItems you can re-implement the virtual method QPainterPath QGraphicsItem::shape () const to return a path repre...
Display custom image and have the ability to catch mouse input I am trying to display several images in the MainWindow and have the ability to perform certain actions when these images receive mousePressEvent. For this, I thought I would create a new class, derived from QWidget, which had a QImage private member. With ...
TITLE: Display custom image and have the ability to catch mouse input QUESTION: I am trying to display several images in the MainWindow and have the ability to perform certain actions when these images receive mousePressEvent. For this, I thought I would create a new class, derived from QWidget, which had a QImage pri...
[ "c++", "qt4" ]
1
0
165
2
0
2011-05-31T11:30:39.170000
2011-05-31T19:31:13.013000
6,186,910
6,188,333
How to next next and previous ids in an ordered search when on a specific id? (MySQL)
I have an MLS site that you can search and it gives you a list of results. I then store the mysql string in a session. When you click on a result you go to the page listed by its property MLS number. From that page I have a forward and backward button that is supposed to go back and forth through properties. How do I u...
Assuming the results are ordered by id, you could modify the stored query like this: WHERE id > current_id LIMIT 1 to get the next property, where current_id is the id of the currently viewed record, and likewise: WHERE id < current_id LIMIT 1 to get the previous one.
How to next next and previous ids in an ordered search when on a specific id? (MySQL) I have an MLS site that you can search and it gives you a list of results. I then store the mysql string in a session. When you click on a result you go to the page listed by its property MLS number. From that page I have a forward an...
TITLE: How to next next and previous ids in an ordered search when on a specific id? (MySQL) QUESTION: I have an MLS site that you can search and it gives you a list of results. I then store the mysql string in a session. When you click on a result you go to the page listed by its property MLS number. From that page I...
[ "mysql" ]
1
1
72
1
0
2011-05-31T11:32:21.953000
2011-05-31T13:29:40.547000
6,186,918
6,186,979
No of Days between two dates in python 2.4
This will work in python 2.6 from datetime import datetime print (datetime.strptime('2008-12-31', "%Y-%m-%d")- datetime.strptime('2007-04-30',"%Y-%m-%d")).days But in 2.4 shows following error AttributeError: type object 'datetime.datetime' has no attribute 'strptime' Thank you for all your Support. from datetime impor...
In Python 2.4 strptime is located in time module: from time import strptime See http://docs.python.org/release/2.4/lib/module-time.html
No of Days between two dates in python 2.4 This will work in python 2.6 from datetime import datetime print (datetime.strptime('2008-12-31', "%Y-%m-%d")- datetime.strptime('2007-04-30',"%Y-%m-%d")).days But in 2.4 shows following error AttributeError: type object 'datetime.datetime' has no attribute 'strptime' Thank yo...
TITLE: No of Days between two dates in python 2.4 QUESTION: This will work in python 2.6 from datetime import datetime print (datetime.strptime('2008-12-31', "%Y-%m-%d")- datetime.strptime('2007-04-30',"%Y-%m-%d")).days But in 2.4 shows following error AttributeError: type object 'datetime.datetime' has no attribute '...
[ "python", "strptime" ]
1
7
875
1
0
2011-05-31T11:32:50.350000
2011-05-31T11:38:21.277000
6,186,919
6,186,934
How to prevent GC to collect weakly referenced object?
I have an object cache that internally uses weak references and sometimes my object get GCed even if I still need it (so it need to be reload again). My idea is to prevent a GC by adding another reference to that object: Object obj = Cache.getObject(key); Is obj a strong or a weak ref? This seems to work in my case, bu...
obj is a normal (i.e. a strong) reference. The object will not be eligible for GC as long as the variable obj is reachable. So: yes, this will prevent the object from being collected.
How to prevent GC to collect weakly referenced object? I have an object cache that internally uses weak references and sometimes my object get GCed even if I still need it (so it need to be reload again). My idea is to prevent a GC by adding another reference to that object: Object obj = Cache.getObject(key); Is obj a ...
TITLE: How to prevent GC to collect weakly referenced object? QUESTION: I have an object cache that internally uses weak references and sometimes my object get GCed even if I still need it (so it need to be reload again). My idea is to prevent a GC by adding another reference to that object: Object obj = Cache.getObje...
[ "java", "reference", "weak-references" ]
1
2
283
3
0
2011-05-31T11:33:02.937000
2011-05-31T11:34:45.070000
6,186,936
6,187,015
Error while trying to print the structure variable-Objective C
-(BOOL)ChangeTimer:(unsigned short)wTimerIds withPeriod:(uint8_t)uPeriod { stRs232Timer* pEvent; NSLog(@"Into the changeTimer"); NSLog(@"%d",wTimerIds); pEvent = (stRs232Timer*)[[m_cAppIdMap objectForKey:[NSNumber numberWithUnsignedShort:wTimerIds]]bytes]; NSLog(@"bPersistent:%d",pEvent->bPersistent); NSLog(@"wAppTimer...
When you use the "%@" format specifier, you are telling the runtime to invoke the -descriptionWithLocale: or -description methods on the associated pointer whose class is implied to be a subclass of NSObject. Structures are not Objective-C objects and therefore do not have a -descriptionWithLocale: or -description meth...
Error while trying to print the structure variable-Objective C -(BOOL)ChangeTimer:(unsigned short)wTimerIds withPeriod:(uint8_t)uPeriod { stRs232Timer* pEvent; NSLog(@"Into the changeTimer"); NSLog(@"%d",wTimerIds); pEvent = (stRs232Timer*)[[m_cAppIdMap objectForKey:[NSNumber numberWithUnsignedShort:wTimerIds]]bytes]; ...
TITLE: Error while trying to print the structure variable-Objective C QUESTION: -(BOOL)ChangeTimer:(unsigned short)wTimerIds withPeriod:(uint8_t)uPeriod { stRs232Timer* pEvent; NSLog(@"Into the changeTimer"); NSLog(@"%d",wTimerIds); pEvent = (stRs232Timer*)[[m_cAppIdMap objectForKey:[NSNumber numberWithUnsignedShort:w...
[ "objective-c" ]
0
3
381
2
0
2011-05-31T11:34:53.340000
2011-05-31T11:41:36.100000
6,186,945
6,191,260
retrieving continuous stream of xml data, decoding it and putting it in a db
I am trying to build an application that retrieves continuous streams of xml data which keeps on changing every second, then decode it and it insert it into a mysql database. So this script probably has to be executing on the server without any gui. But from the client side(from within the browser) the user should be a...
You want a process on the server to halt and restart from a different process. One way to tell the continuous process to halt is using a lock file. while (true) { if (file_exists('continue.tmp')) { // Do whatever is done } else { // do nothing for a minute sleep(60); } } The other process just throws away continue.tmp ...
retrieving continuous stream of xml data, decoding it and putting it in a db I am trying to build an application that retrieves continuous streams of xml data which keeps on changing every second, then decode it and it insert it into a mysql database. So this script probably has to be executing on the server without an...
TITLE: retrieving continuous stream of xml data, decoding it and putting it in a db QUESTION: I am trying to build an application that retrieves continuous streams of xml data which keeps on changing every second, then decode it and it insert it into a mysql database. So this script probably has to be executing on the...
[ "php", "javascript", "ajax", "client" ]
0
0
344
2
0
2011-05-31T11:35:32.227000
2011-05-31T17:31:06.427000
6,186,956
6,186,990
Need help extracting data from JSONArray
First thanks to Pentium10 for this answer! it got me one step further. I have a JSONArray which is generated in php by echo (json_encode($output)); which generates this output // linebreaks only for readability, they do not exist in the response [["Fitch's Chemist","731 Hay St","(08) 9321 6411"], ["Ferrara Karaoke Bar"...
edit: I tried your example and the code nearly works but has one little mistake. You shouldn't use list to get the JSONArray jsonList. This works (tested): // this string is just used for testing, use your response... String json = "[[\"Fitch's Chemist\",\"731 Hay St\",\"(08) 9321 6411\"]," + "[\"Ferrara Karaoke Bar\",...
Need help extracting data from JSONArray First thanks to Pentium10 for this answer! it got me one step further. I have a JSONArray which is generated in php by echo (json_encode($output)); which generates this output // linebreaks only for readability, they do not exist in the response [["Fitch's Chemist","731 Hay St",...
TITLE: Need help extracting data from JSONArray QUESTION: First thanks to Pentium10 for this answer! it got me one step further. I have a JSONArray which is generated in php by echo (json_encode($output)); which generates this output // linebreaks only for readability, they do not exist in the response [["Fitch's Chem...
[ "android", "json", "arraylist" ]
0
0
1,622
2
0
2011-05-31T11:36:39.160000
2011-05-31T11:39:38.730000
6,186,959
6,187,244
Testing Framework for Rails 3?
We actually do not use test within our application (I know that's bad and sad). I have reads a lot about Test::Unit, Shouda, minitest and the new one Bacon. But cannot make my mind yet. Basically our needs are: Use of watir (love it) Easy to learn Do not mess with the application (like Rspec generator - not against rsp...
I actually abandoned Test::Unit and switched to RSpec 2. Only developers have to read our tests, but RSpec seems to encourage better structured tests than Test::Unit. It's different to most other testing frameworks though, so there's a small learning curve, but only for the first few days. I also strongly advise that y...
Testing Framework for Rails 3? We actually do not use test within our application (I know that's bad and sad). I have reads a lot about Test::Unit, Shouda, minitest and the new one Bacon. But cannot make my mind yet. Basically our needs are: Use of watir (love it) Easy to learn Do not mess with the application (like Rs...
TITLE: Testing Framework for Rails 3? QUESTION: We actually do not use test within our application (I know that's bad and sad). I have reads a lot about Test::Unit, Shouda, minitest and the new one Bacon. But cannot make my mind yet. Basically our needs are: Use of watir (love it) Easy to learn Do not mess with the ap...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "unit-testing", "testing" ]
0
2
530
4
0
2011-05-31T11:36:46.850000
2011-05-31T11:59:07.667000
6,186,961
6,187,319
Cocoa: How to have a context menu when you right-click on a cell of NSTableView
I have a TableView with custom cells. I want a contextual menu to appear when the user right clicks (or any other Apple variants of right-click) on one of the cells (and know which cell they clicked on). I tried to subclass NSTableView and overwrite this method: - (NSMenu *)menuForEvent:(NSEvent *)theEvent; But it is n...
There's no need to muck about with event handling, all you have to do to assign a contextual menu is set the table view's menu outlet to point to the NSMenu object that you want to use for the contextual menu. You can do this in Interface Builder by dropping an NSMenu object into your nib file and control-dragging from...
Cocoa: How to have a context menu when you right-click on a cell of NSTableView I have a TableView with custom cells. I want a contextual menu to appear when the user right clicks (or any other Apple variants of right-click) on one of the cells (and know which cell they clicked on). I tried to subclass NSTableView and ...
TITLE: Cocoa: How to have a context menu when you right-click on a cell of NSTableView QUESTION: I have a TableView with custom cells. I want a contextual menu to appear when the user right clicks (or any other Apple variants of right-click) on one of the cells (and know which cell they clicked on). I tried to subclas...
[ "cocoa", "contextmenu", "nstableview" ]
19
73
21,311
2
0
2011-05-31T11:36:53.917000
2011-05-31T12:05:33.517000
6,186,962
6,187,063
SQL Query to show nearest date?
I'm trying to figure out how to write a MySQL query that will return the closest 3 events in terms of date. This is my table: EVENT_ID EVENT_NAME EVENT_START_DATE(DATETIME) 1 test 2011-06-01 23:00:00 2 test2 2011-06-03 23:00:00 3 test3 2011-07-01 23:00:00 4 test4 2011-08-09 23:00:00 5 test5 2011-06-02 23:00:00 6 test6 ...
SELECT event_id FROM Table ORDER BY ABS( DATEDIFF( EVENT_START_DATE, NOW() ) ) LIMIT 3 The ABS() means that an event 1 day ago is just as close as an event 1 day in the future. If you only want events that haven't happened yet, do SELECT event_id FROM Table WHERE EVENT_START_DATE > NOW() ORDER BY EVENT_START_DATE LIMIT...
SQL Query to show nearest date? I'm trying to figure out how to write a MySQL query that will return the closest 3 events in terms of date. This is my table: EVENT_ID EVENT_NAME EVENT_START_DATE(DATETIME) 1 test 2011-06-01 23:00:00 2 test2 2011-06-03 23:00:00 3 test3 2011-07-01 23:00:00 4 test4 2011-08-09 23:00:00 5 te...
TITLE: SQL Query to show nearest date? QUESTION: I'm trying to figure out how to write a MySQL query that will return the closest 3 events in terms of date. This is my table: EVENT_ID EVENT_NAME EVENT_START_DATE(DATETIME) 1 test 2011-06-01 23:00:00 2 test2 2011-06-03 23:00:00 3 test3 2011-07-01 23:00:00 4 test4 2011-0...
[ "mysql", "sql", "datetime" ]
42
94
69,713
5
0
2011-05-31T11:37:06.563000
2011-05-31T11:45:33.087000
6,186,966
6,187,173
Get the parent xml node based on an inner node's value in SQL Server
declare @xmlVal xml set @xmlVal = ' ABC123 2013-06-16 18:48:50.111 XYX456 2014-01-01 18:48:50.111 ' I need the entire token node as xml where id=ABC123 so the out put will be: ABC123 2013-06-16 18:48:50.111
SELECT a.b.value('id[1]','nvarchar(max)') id, a.b.value('endDate[1]','datetime') endDate FROM @xmlval.nodes('//user/token[id="ABC123"]') a(b) FOR XML PATH('token')
Get the parent xml node based on an inner node's value in SQL Server declare @xmlVal xml set @xmlVal = ' ABC123 2013-06-16 18:48:50.111 XYX456 2014-01-01 18:48:50.111 ' I need the entire token node as xml where id=ABC123 so the out put will be: ABC123 2013-06-16 18:48:50.111
TITLE: Get the parent xml node based on an inner node's value in SQL Server QUESTION: declare @xmlVal xml set @xmlVal = ' ABC123 2013-06-16 18:48:50.111 XYX456 2014-01-01 18:48:50.111 ' I need the entire token node as xml where id=ABC123 so the out put will be: ABC123 2013-06-16 18:48:50.111 ANSWER: SELECT a.b.value(...
[ "sql", "sql-server", "xpath", "xquery-sql" ]
1
1
1,120
2
0
2011-05-31T11:37:34.157000
2011-05-31T11:54:03.970000
6,186,974
6,187,697
Error building rabbitmq server
I am building rabbitmq server on ubuntu (2.6.35-28-generic-pae #50-Ubuntu SMP Fri Mar 18 20:43:15 UTC 2011 i686 GNU/Linux) I am using erlang OPT version otp_src_R14B03. I get following error while building erlc -I include -o ebin -Wall -v +debug_info -Duse_specs -pa ebin src/rabbit_networking.erl src/rabbit_networking....
Unfortunately Erlang R14B03 changed some specs in an incompatible way. So you can't compile RabbitMQ 2.4.1 against Erlang R14B03 without disabling specs (should be harmless, it's more for development). Options: Use Erlang R14B02 Use RabbitMQ from Mercurial default, where this is fixed Compile with "make USE_SPECS=false...
Error building rabbitmq server I am building rabbitmq server on ubuntu (2.6.35-28-generic-pae #50-Ubuntu SMP Fri Mar 18 20:43:15 UTC 2011 i686 GNU/Linux) I am using erlang OPT version otp_src_R14B03. I get following error while building erlc -I include -o ebin -Wall -v +debug_info -Duse_specs -pa ebin src/rabbit_networ...
TITLE: Error building rabbitmq server QUESTION: I am building rabbitmq server on ubuntu (2.6.35-28-generic-pae #50-Ubuntu SMP Fri Mar 18 20:43:15 UTC 2011 i686 GNU/Linux) I am using erlang OPT version otp_src_R14B03. I get following error while building erlc -I include -o ebin -Wall -v +debug_info -Duse_specs -pa ebin...
[ "erlang", "rabbitmq", "amqp" ]
1
3
412
1
0
2011-05-31T11:38:00.873000
2011-05-31T12:38:35.387000
6,186,980
6,187,004
Determine if a byte[] is a pdf file
Is there any way of checking if a byte[] is a pdf without opening? I have some code to display a list of byte[] as pdf thumbnails. I previously knew all the byte[] were pdf's because we filtered the servlet to only return these. Now the requirement has changed and I need to bring all file types back. Is there any way o...
Check the first 4 bytes of the array. If those are 0x25 0x50 0x44 0x46 then it's most probably a PDF file.
Determine if a byte[] is a pdf file Is there any way of checking if a byte[] is a pdf without opening? I have some code to display a list of byte[] as pdf thumbnails. I previously knew all the byte[] were pdf's because we filtered the servlet to only return these. Now the requirement has changed and I need to bring all...
TITLE: Determine if a byte[] is a pdf file QUESTION: Is there any way of checking if a byte[] is a pdf without opening? I have some code to display a list of byte[] as pdf thumbnails. I previously knew all the byte[] were pdf's because we filtered the servlet to only return these. Now the requirement has changed and I...
[ "c#", ".net", "file", "pdf", "arrays" ]
36
62
32,865
7
0
2011-05-31T11:38:22.747000
2011-05-31T11:40:49.120000
6,186,989
6,187,183
How to change font-color for disabled input?
I need to change the style for a disabled input element in CSS. How I can do this for Internet Explorer?
You can't for Internet Explorer. See this comment I wrote on a related topic: There doesn't seem to be a good way, see: How to change color of disabled html controls in IE8 using css - you can set the input to readonly instead, but that has other consequences (such as with readonly, the input will be sent to the server...
How to change font-color for disabled input? I need to change the style for a disabled input element in CSS. How I can do this for Internet Explorer?
TITLE: How to change font-color for disabled input? QUESTION: I need to change the style for a disabled input element in CSS. How I can do this for Internet Explorer? ANSWER: You can't for Internet Explorer. See this comment I wrote on a related topic: There doesn't seem to be a good way, see: How to change color of ...
[ "css", "internet-explorer", "input" ]
64
50
238,876
11
0
2011-05-31T11:39:32.013000
2011-05-31T11:54:55.950000
6,186,998
6,187,187
Converting basic Scheme functions to Haskell equivalents
I am trying to convert scheme code to Haskell code. For that, I want know how to use scheme's map lambda return port from file path read-line from port append to list regexp-match GUI in Haskell could somebody tell me how to do this in haskell? thanks
Essentially you need to learn Haskell, the language, and its library ecosystem. To find libraries and functions, start by learning the Prelude, since many things are defined there. Then move on to Hackage, where you have thousands of libraries to pick from. Specifically, most of what you need can be found in the Prelud...
Converting basic Scheme functions to Haskell equivalents I am trying to convert scheme code to Haskell code. For that, I want know how to use scheme's map lambda return port from file path read-line from port append to list regexp-match GUI in Haskell could somebody tell me how to do this in haskell? thanks
TITLE: Converting basic Scheme functions to Haskell equivalents QUESTION: I am trying to convert scheme code to Haskell code. For that, I want know how to use scheme's map lambda return port from file path read-line from port append to list regexp-match GUI in Haskell could somebody tell me how to do this in haskell? ...
[ "regex", "haskell", "scheme" ]
4
10
512
2
0
2011-05-31T11:40:11.193000
2011-05-31T11:55:14.127000
6,187,001
6,187,039
How to lock scrollbar of the browser using C#.net code behind(.cs page)?
Can anybody tell me how can i save the location of the browser scrollbar. I have a form kind of page containing some postbacks, after postback i want the page location to be same where the user was. I mean the part of the page (middle or down or up). Currently, after postback the scroll is up, ie its displaying the upp...
you can set in your code behind System.Web.UI.Page.MaintainScrollPositionOnPostBack = true; this will keep the scroll position in the page only if you wan to do it for all pages use Web.config page section
How to lock scrollbar of the browser using C#.net code behind(.cs page)? Can anybody tell me how can i save the location of the browser scrollbar. I have a form kind of page containing some postbacks, after postback i want the page location to be same where the user was. I mean the part of the page (middle or down or u...
TITLE: How to lock scrollbar of the browser using C#.net code behind(.cs page)? QUESTION: Can anybody tell me how can i save the location of the browser scrollbar. I have a form kind of page containing some postbacks, after postback i want the page location to be same where the user was. I mean the part of the page (m...
[ "c#", "asp.net" ]
0
1
1,564
3
0
2011-05-31T11:40:29.327000
2011-05-31T11:43:36.390000
6,187,005
6,187,186
Possible leaks when using Analyze-tool. No leaks while running instruments
As the title describes it. We have an application that atm shows three possible leaks when using the Analyze-tool. Yet there are no leaks what so ever when running the instruments to check for leaks. Do we have to take care of the false-positives that show up using the Analyze-tool? EDIT: aViewcontroller *anotherViewCo...
Leaks wont show leaks unless you perform the absolute exact order of events to reproduce the leak. Read the code that analyse has pointed out and carefully check what the count should be, its usually pretty good at finding simple issues, but in the event you're doing something a bit different it may show you some false...
Possible leaks when using Analyze-tool. No leaks while running instruments As the title describes it. We have an application that atm shows three possible leaks when using the Analyze-tool. Yet there are no leaks what so ever when running the instruments to check for leaks. Do we have to take care of the false-positive...
TITLE: Possible leaks when using Analyze-tool. No leaks while running instruments QUESTION: As the title describes it. We have an application that atm shows three possible leaks when using the Analyze-tool. Yet there are no leaks what so ever when running the instruments to check for leaks. Do we have to take care of ...
[ "iphone", "objective-c", "memory-leaks" ]
0
0
83
2
0
2011-05-31T11:40:58.220000
2011-05-31T11:55:02.783000
6,187,010
6,187,276
Android 2.2 Data Backup: How to backup when PreferenceActivity is used?
I'd like to use the backup agent for saving user preferences: http://developer.android.com/guide/topics/data/backup.html In the article, it's explained how to backup SharedPreferences: http://developer.android.com/guide/topics/data/backup.html#SharedPreferences However it's not explained how to backup when a Preference...
SharedPreferences is a Class with access to the preferences that the PreferenceActivity generats. In other word the default preferences use the sharedPreferences class the same way you would if you did it manualy. The key it usus is of course the key you gave it in the preferences.xml Therefore you can use SharedPrefer...
Android 2.2 Data Backup: How to backup when PreferenceActivity is used? I'd like to use the backup agent for saving user preferences: http://developer.android.com/guide/topics/data/backup.html In the article, it's explained how to backup SharedPreferences: http://developer.android.com/guide/topics/data/backup.html#Shar...
TITLE: Android 2.2 Data Backup: How to backup when PreferenceActivity is used? QUESTION: I'd like to use the backup agent for saving user preferences: http://developer.android.com/guide/topics/data/backup.html In the article, it's explained how to backup SharedPreferences: http://developer.android.com/guide/topics/dat...
[ "android", "backup", "preferenceactivity" ]
0
3
871
1
0
2011-05-31T11:41:22.823000
2011-05-31T12:01:19.613000
6,187,018
6,187,208
Abstract Class in Delphi
I am using a component suite which has many abstract classes. Now I want to apply polymorphism but I am getting Error Abstract Class when I create my object. Should I override all methods which are virtual even if I don't need it? Are there any workaround or solution?
In order to make an instance of a class, you need to override all methods that are declared as virtual abstract. Even if you don't use them. If you really want a work around, you can use empty methods. But I won't recommend that. And to add some more information on the subject: A method is abstract if it is declared wi...
Abstract Class in Delphi I am using a component suite which has many abstract classes. Now I want to apply polymorphism but I am getting Error Abstract Class when I create my object. Should I override all methods which are virtual even if I don't need it? Are there any workaround or solution?
TITLE: Abstract Class in Delphi QUESTION: I am using a component suite which has many abstract classes. Now I want to apply polymorphism but I am getting Error Abstract Class when I create my object. Should I override all methods which are virtual even if I don't need it? Are there any workaround or solution? ANSWER:...
[ "delphi", "abstract", "delphi-2009" ]
18
29
27,588
4
0
2011-05-31T11:41:43.863000
2011-05-31T11:56:26.233000
6,187,020
6,187,813
Access Base class variable from child class method
How can I access base class variable from a child method? I'm getting a segmentation fault. class Base { public: Base(); int a; }; class Child: public Base { public: void foo(); }; Child::Child():Base(){ void Child::foo(){ int b = a; //here throws segmentation fault } And in another class: Child *child = new Child()...
It's not good practice to make a class variable public. If you want to access a from Child you should have something like this: class Base { public: Base(): a(0) {} virtual ~Base() {} protected: int a; }; class Child: public Base { public: Child(): Base(), b(0) {} void foo(); private: int b; }; void Child::foo() { ...
Access Base class variable from child class method How can I access base class variable from a child method? I'm getting a segmentation fault. class Base { public: Base(); int a; }; class Child: public Base { public: void foo(); }; Child::Child():Base(){ void Child::foo(){ int b = a; //here throws segmentation fault...
TITLE: Access Base class variable from child class method QUESTION: How can I access base class variable from a child method? I'm getting a segmentation fault. class Base { public: Base(); int a; }; class Child: public Base { public: void foo(); }; Child::Child():Base(){ void Child::foo(){ int b = a; //here throws ...
[ "c++", "inheritance", "segmentation-fault" ]
12
30
62,224
3
0
2011-05-31T11:42:05.810000
2011-05-31T12:48:53.967000
6,187,040
6,187,117
Nested `include()` directives - How to include a file (which includes another) from more than one directories?
I have these three files to work with: document_root/include/config.php document_root/include/database.php document_root/index.php And the relevant part of the file contents are like below: config.php //... $MyVar = 100; //... database.php //... require('config.php'); // Aiming to use the definitions in "config.php" he...
The cause of this problem is, that include resolves relative filenames based on the working directory, not based on the directory where the file is located that does the include. The working directory is the directory of the PHP file that is launched by the webserver (in your case index.php I guess). If that file inclu...
Nested `include()` directives - How to include a file (which includes another) from more than one directories? I have these three files to work with: document_root/include/config.php document_root/include/database.php document_root/index.php And the relevant part of the file contents are like below: config.php //... $M...
TITLE: Nested `include()` directives - How to include a file (which includes another) from more than one directories? QUESTION: I have these three files to work with: document_root/include/config.php document_root/include/database.php document_root/index.php And the relevant part of the file contents are like below: c...
[ "path", "include", "php", "include-path" ]
1
4
1,204
1
0
2011-05-31T11:43:41.077000
2011-05-31T11:49:55.080000
6,187,042
6,187,064
Inheritance in python and constructor calls
The output is: Class A Class B printout Given code: class A(object): def __init__(self): print "Class A" def printout(self): print "printout" class B(A): def __init__(self): print "Class B" def main(): myA = A() myB = B() myB.printout() if __name__ == '__main__': main() I was hoping for: Class A Class A Class B prin...
It's because you did not call the superclass's __init__. class B(A): def __init__(self): A.__init__(self) # ^^^^^^^^^^^^^^^^ this have to be explicitly added print "Class B" In Python 3.x you could use super().__init__() instead of A.__init__(self), but you're still explicitly invoking the superclass's __init__.
Inheritance in python and constructor calls The output is: Class A Class B printout Given code: class A(object): def __init__(self): print "Class A" def printout(self): print "printout" class B(A): def __init__(self): print "Class B" def main(): myA = A() myB = B() myB.printout() if __name__ == '__main__': main() I ...
TITLE: Inheritance in python and constructor calls QUESTION: The output is: Class A Class B printout Given code: class A(object): def __init__(self): print "Class A" def printout(self): print "printout" class B(A): def __init__(self): print "Class B" def main(): myA = A() myB = B() myB.printout() if __name__ == '__...
[ "python" ]
2
4
172
3
0
2011-05-31T11:43:43.430000
2011-05-31T11:45:38.767000
6,187,048
6,193,371
How to separate responsibilities between parser and lexer to match a block of text?
I have a text file which I'm trying to parse. The file looks like this: A_1: - A_10: Some text. ---------- Some more text. __________ B_1: - B_5: Still more text - it may contain dashes as well. ---------- Even more text. Could be multiple sentences with newlines. Like this. __________ And so on. I'm trying to separat...
This is what lex start states were designed for. Basically, you declare a start state for each different language you need to deal with (two in your case -- headers and bodies) and then tag the rules based on which state they apply to. So you'd want something like: %s header %s body %% [ \t\n]; /* ignore */ [_a-zA-Z][_...
How to separate responsibilities between parser and lexer to match a block of text? I have a text file which I'm trying to parse. The file looks like this: A_1: - A_10: Some text. ---------- Some more text. __________ B_1: - B_5: Still more text - it may contain dashes as well. ---------- Even more text. Could be mult...
TITLE: How to separate responsibilities between parser and lexer to match a block of text? QUESTION: I have a text file which I'm trying to parse. The file looks like this: A_1: - A_10: Some text. ---------- Some more text. __________ B_1: - B_5: Still more text - it may contain dashes as well. ---------- Even more t...
[ "bison", "yacc", "lex", "flex-lexer" ]
0
3
472
2
0
2011-05-31T11:44:18.293000
2011-05-31T20:47:48.037000
6,187,051
6,187,599
Quartz calendars - including, rather than excluding, dates
Is there a way in Quartz/Quartz.NET (using the latter but I'm assuming the answer would be the same) to have a type of HolidayCalendar where rather than picking dates to exclude, dates have to be picked to be included? So if say 08/02/2012 was added to the calendar, any triggers assigned to this calendar would only exe...
I've managed to, rather easily, create my own calendar class that implements ICalendar and does exactly what I want - it was simply a case of copying and modifying the HolidayCalendar class in Quartz
Quartz calendars - including, rather than excluding, dates Is there a way in Quartz/Quartz.NET (using the latter but I'm assuming the answer would be the same) to have a type of HolidayCalendar where rather than picking dates to exclude, dates have to be picked to be included? So if say 08/02/2012 was added to the cale...
TITLE: Quartz calendars - including, rather than excluding, dates QUESTION: Is there a way in Quartz/Quartz.NET (using the latter but I'm assuming the answer would be the same) to have a type of HolidayCalendar where rather than picking dates to exclude, dates have to be picked to be included? So if say 08/02/2012 was...
[ "c#", "quartz.net" ]
0
1
844
2
0
2011-05-31T11:44:27.970000
2011-05-31T12:30:48.933000
6,187,052
6,187,191
How to safely write JSON data to file using PHP
I've got HTML form for editing images. All data is stored in JSON. When I change current image, I want to save changes, through PHP script, to a text file. If I return to previous image, this configuration will be send again from this file to the form. My question is: How to write/read this kind of data safely. Where a...
First of all: JSON is not JavaScript and vice versa. And JSON is even not a proper subset of JavaScript. Besides that, since you neither interpret some user input as PHP nor some output as JavaScript, there is no need to worry. But don’t forget to specify your output properly: header('Content-Type: application/json;cha...
How to safely write JSON data to file using PHP I've got HTML form for editing images. All data is stored in JSON. When I change current image, I want to save changes, through PHP script, to a text file. If I return to previous image, this configuration will be send again from this file to the form. My question is: How...
TITLE: How to safely write JSON data to file using PHP QUESTION: I've got HTML form for editing images. All data is stored in JSON. When I change current image, I want to save changes, through PHP script, to a text file. If I return to previous image, this configuration will be send again from this file to the form. M...
[ "php", "json", "file", "security", "code-injection" ]
16
6
40,378
3
0
2011-05-31T11:44:43.007000
2011-05-31T11:55:24.470000
6,187,054
6,187,706
Converting data to images using JQuery/CSS or possibly PHP/CSS. (Rating System)
-- link removed -- How can I convert the numbers in the above website into stars using Jquery with a for loop to add however many stars, and a round up, round down function. I prefer to round using this example: 3.0 if lower than 3.25; this will include 3 full stars, 2 empty stars 3.5 if between 3.25 and 3.75; this wil...
You would need to update your list of ratings to be in a selectable container, and the rading would need to be encapsulated in it's own selector. HTML: Overall Rating Data (no stars): 3.14285714286 Overall Grounds Data (no stars): 3.14285714286 Overall Price Data (no stars): 3.14285714286 Overall Staff Data (no stars):...
Converting data to images using JQuery/CSS or possibly PHP/CSS. (Rating System) -- link removed -- How can I convert the numbers in the above website into stars using Jquery with a for loop to add however many stars, and a round up, round down function. I prefer to round using this example: 3.0 if lower than 3.25; this...
TITLE: Converting data to images using JQuery/CSS or possibly PHP/CSS. (Rating System) QUESTION: -- link removed -- How can I convert the numbers in the above website into stars using Jquery with a for loop to add however many stars, and a round up, round down function. I prefer to round using this example: 3.0 if low...
[ "php", "jquery", "css", "image", "rating-system" ]
3
2
526
1
0
2011-05-31T11:45:00.843000
2011-05-31T12:39:35.347000
6,187,056
6,187,771
Global and static array of double values
I want to translate this java code into equal objective-c code double[] pMatrix = {50,100,150}; double[][] mMatrix = {{0.5,0.4,0.1}}; In java I have this as class properties. So I need to be able to access them everywhere in my class. I tried to put that code in the header file but it did not work. Any ideas?
Objective-C++ supports C/C++. So, you must define extern double Matrix[]; in the header and you double Matrix[] = {50,100,150}; in the.mm. Also, you can define the same values as static members of some class (C++) or return them via static public methods.
Global and static array of double values I want to translate this java code into equal objective-c code double[] pMatrix = {50,100,150}; double[][] mMatrix = {{0.5,0.4,0.1}}; In java I have this as class properties. So I need to be able to access them everywhere in my class. I tried to put that code in the header file...
TITLE: Global and static array of double values QUESTION: I want to translate this java code into equal objective-c code double[] pMatrix = {50,100,150}; double[][] mMatrix = {{0.5,0.4,0.1}}; In java I have this as class properties. So I need to be able to access them everywhere in my class. I tried to put that code ...
[ "java", "objective-c" ]
0
1
206
3
0
2011-05-31T11:45:05.570000
2011-05-31T12:46:17.240000