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,201,966 | 6,202,157 | How to escape JavaScript in an HTML String while keeping the HTML unescaped? | We have a webapplication. At some points there is a JavaScript based WSIWYG / RichText Editor. It filters some JavaScript but uses HTML text to format it's content. Unfortunately it does not filter all JavaScript. I was able to proof a XSS attack with an event handler. I think the JavaScript client side filtering of Ja... | It is difficult to state what escaping schemes have to be used to escape JavaScript without knowing whether the application is vulnerable to DOM-based XSS attacks or the run-of-the-mill (reflected and persistent) XSS attacks. ESAPI for Java will help in both cases though. In the case of DOM-based XSS attacks, you would... | How to escape JavaScript in an HTML String while keeping the HTML unescaped? We have a webapplication. At some points there is a JavaScript based WSIWYG / RichText Editor. It filters some JavaScript but uses HTML text to format it's content. Unfortunately it does not filter all JavaScript. I was able to proof a XSS att... | TITLE:
How to escape JavaScript in an HTML String while keeping the HTML unescaped?
QUESTION:
We have a webapplication. At some points there is a JavaScript based WSIWYG / RichText Editor. It filters some JavaScript but uses HTML text to format it's content. Unfortunately it does not filter all JavaScript. I was able ... | [
"java",
"javascript",
"security",
"escaping",
"xss"
] | 2 | 2 | 4,160 | 2 | 0 | 2011-06-01T13:30:56.370000 | 2011-06-01T13:43:30.020000 |
6,201,983 | 6,202,561 | Is it sufficient to create a new NSManagedObjectContext for every new NSOperation or Thread? | I need to use Core Data inside NSOperationQueue operations. I've heard that it's sufficient to create an NSManagedObject instance for every single NSOperation or Thread, and then Core Data won't have multithreading-problems. Is this correct? Would the other MOC's be updated automatically when others get modified in NSO... | You are correct that you need a new MOC (Managed Object Context) for each thread/operation. Give the new context the same persistant store coordinator as your main context, and then when saving the contexts you need to handle the merge. See my previous answer here which explains how to perform the merge: How to Deal wi... | Is it sufficient to create a new NSManagedObjectContext for every new NSOperation or Thread? I need to use Core Data inside NSOperationQueue operations. I've heard that it's sufficient to create an NSManagedObject instance for every single NSOperation or Thread, and then Core Data won't have multithreading-problems. Is... | TITLE:
Is it sufficient to create a new NSManagedObjectContext for every new NSOperation or Thread?
QUESTION:
I need to use Core Data inside NSOperationQueue operations. I've heard that it's sufficient to create an NSManagedObject instance for every single NSOperation or Thread, and then Core Data won't have multithre... | [
"iphone",
"multithreading",
"ios",
"core-data",
"nsoperation"
] | 0 | 2 | 548 | 2 | 0 | 2011-06-01T13:31:55.170000 | 2011-06-01T14:10:27.063000 |
6,201,986 | 6,202,865 | iPhone camera application running fine in iPhone but crashing in iPod | i made an iPhone app that uses camera. It works fine in iPhone, no memory warnings at all. It is also running on iPod touch 4G but gives memory warnings and crashes after some time after getting level 2 warning. If someone can point me the possible reason for this. Thanks. | The only way you are going to fix this is by being able to debug it on the device. I wrote this blog to explain how to debug EXC_BAD_ACCESS, which is what I assume you are getting http://loufranco.com/blog/files/Understanding-EXC_BAD_ACCESS.html The simplest things to do: Run a Build and Analyze and fix every problem i... | iPhone camera application running fine in iPhone but crashing in iPod i made an iPhone app that uses camera. It works fine in iPhone, no memory warnings at all. It is also running on iPod touch 4G but gives memory warnings and crashes after some time after getting level 2 warning. If someone can point me the possible r... | TITLE:
iPhone camera application running fine in iPhone but crashing in iPod
QUESTION:
i made an iPhone app that uses camera. It works fine in iPhone, no memory warnings at all. It is also running on iPod touch 4G but gives memory warnings and crashes after some time after getting level 2 warning. If someone can point... | [
"iphone",
"memory",
"warnings",
"ipod-touch"
] | 1 | 0 | 296 | 2 | 0 | 2011-06-01T13:32:14.373000 | 2011-06-01T14:32:08.587000 |
6,201,992 | 6,202,214 | Optimal way to create a histogram/frequency distribution in Oracle? | I have an events table with two columns eventkey (unique, primary-key) and createtime, which stores the creation time of the event as the number of milliseconds since Jan 1 1970 in a NUMBER column. I would like to create a "histogram" or frequency distribution that shows me how many events were created in each hour of ... | If your createtime were a date column, this would be trivial: SELECT TO_CHAR(CREATE_TIME, 'DAY:HH24'), COUNT(*) FROM EVENTS GROUP BY TO_CHAR(CREATE_TIME, 'DAY:HH24'); As it is, casting the createtime column isn't too hard: select TO_CHAR( TO_DATE('19700101', 'YYYYMMDD') + createtime / 86400000), 'DAY:HH24') AS BUCKET, ... | Optimal way to create a histogram/frequency distribution in Oracle? I have an events table with two columns eventkey (unique, primary-key) and createtime, which stores the creation time of the event as the number of milliseconds since Jan 1 1970 in a NUMBER column. I would like to create a "histogram" or frequency dist... | TITLE:
Optimal way to create a histogram/frequency distribution in Oracle?
QUESTION:
I have an events table with two columns eventkey (unique, primary-key) and createtime, which stores the creation time of the event as the number of milliseconds since Jan 1 1970 in a NUMBER column. I would like to create a "histogram"... | [
"sql",
"oracle",
"histogram",
"frequency-distribution"
] | 7 | 11 | 23,139 | 4 | 0 | 2011-06-01T13:32:42.173000 | 2011-06-01T13:47:22.577000 |
6,201,997 | 6,202,071 | finding sublist in lists with map/select in mathematica | I have, in Wolfram Mathematica 8.0, a nested list like nList = {{a,b},{f,g},{n,o}} and a normal list like lList = {a,b,c,k,m,n,o,z} and i want to check if all the sublists in nList are in lList (in the example a,b and n,o are there but not f,g) I've done it using For[,,,] and using index... can someone enlighten me in ... | Assuming that you don't care about element ordering, here is one way: In[20]:= Complement[Flatten[nList],lList] ==={}
Out[20]= False EDIT If the order matters, then here is one way: In[29]:= And@@(MatchQ[lList,{___,PatternSequence[##],___}]&@@@nList)
Out[29]= False For large number of sub-lists, this may be faster: I... | finding sublist in lists with map/select in mathematica I have, in Wolfram Mathematica 8.0, a nested list like nList = {{a,b},{f,g},{n,o}} and a normal list like lList = {a,b,c,k,m,n,o,z} and i want to check if all the sublists in nList are in lList (in the example a,b and n,o are there but not f,g) I've done it using ... | TITLE:
finding sublist in lists with map/select in mathematica
QUESTION:
I have, in Wolfram Mathematica 8.0, a nested list like nList = {{a,b},{f,g},{n,o}} and a normal list like lList = {a,b,c,k,m,n,o,z} and i want to check if all the sublists in nList are in lList (in the example a,b and n,o are there but not f,g) I... | [
"list",
"wolfram-mathematica"
] | 7 | 9 | 2,549 | 2 | 0 | 2011-06-01T13:33:01.907000 | 2011-06-01T13:38:10.920000 |
6,202,006 | 6,202,179 | Plotting financial data | I'm implementing some simple machine learning algorithms on some financial data in c++, and would like to be able to present this in a 'professionel' way to a potential customer. Does anyone know a good framework for displaying financial charts? Or is there a simple way to do something else like embed gnuplot in a qt w... | If your customer is in finance, speak to them on their terms. Financial people do things in Excel and Powerpoint. Write your data in comma-separated value format, import this into Excel, create some Excel plots, and pull this into a Powerpoint presentation. You might think of Excel and Powerpoint as being beneath someo... | Plotting financial data I'm implementing some simple machine learning algorithms on some financial data in c++, and would like to be able to present this in a 'professionel' way to a potential customer. Does anyone know a good framework for displaying financial charts? Or is there a simple way to do something else like... | TITLE:
Plotting financial data
QUESTION:
I'm implementing some simple machine learning algorithms on some financial data in c++, and would like to be able to present this in a 'professionel' way to a potential customer. Does anyone know a good framework for displaying financial charts? Or is there a simple way to do s... | [
"c++",
"qt",
"plot",
"gnuplot",
"financial"
] | 1 | 3 | 668 | 1 | 0 | 2011-06-01T13:33:21.440000 | 2011-06-01T13:45:11.237000 |
6,202,015 | 6,202,029 | How can i wait that a method or function finish to run its code? | I need to find a solution for wait for a method or function finish to run its code. How can i do this? Example: Method a, Method b. I have to run b when a is finished! Thanks. | a(); b(); // will run only after a() is finished Or you run them asynchronously? | How can i wait that a method or function finish to run its code? I need to find a solution for wait for a method or function finish to run its code. How can i do this? Example: Method a, Method b. I have to run b when a is finished! Thanks. | TITLE:
How can i wait that a method or function finish to run its code?
QUESTION:
I need to find a solution for wait for a method or function finish to run its code. How can i do this? Example: Method a, Method b. I have to run b when a is finished! Thanks.
ANSWER:
a(); b(); // will run only after a() is finished Or ... | [
"objective-c"
] | 0 | 5 | 596 | 1 | 0 | 2011-06-01T13:33:47.847000 | 2011-06-01T13:35:13.843000 |
6,202,021 | 6,202,320 | Detecting function object (functor) and lambda traits | How can I detect the return type and parameter types of nullary and unary function pointers, std::function objects, and functors (including lambdas)? Boost's function_traits and functional traits don't quite get me there out of the box, but I'm open to supplementing or replacing them. I could do something like this: na... | It's not possible in the general case for functors, i.e. class types using operator(). This includes lambda objects, too. Consider a case where operator() is overloaded: struct functor { double operator()(double) const;
int operator()(int) const; };
typedef function_traits::result_type result_type; What should result... | Detecting function object (functor) and lambda traits How can I detect the return type and parameter types of nullary and unary function pointers, std::function objects, and functors (including lambdas)? Boost's function_traits and functional traits don't quite get me there out of the box, but I'm open to supplementing... | TITLE:
Detecting function object (functor) and lambda traits
QUESTION:
How can I detect the return type and parameter types of nullary and unary function pointers, std::function objects, and functors (including lambdas)? Boost's function_traits and functional traits don't quite get me there out of the box, but I'm ope... | [
"c++",
"lambda",
"function-pointers",
"functor",
"function-object"
] | 8 | 6 | 4,660 | 2 | 0 | 2011-06-01T13:34:11.547000 | 2011-06-01T13:54:51.337000 |
6,202,032 | 6,202,165 | Adding tempdb items on startup in SQL Server | How could I add some items to the tempdb anytime SQL Server starts up? I'm no expert at this, but our ASP SessionState is stored in the DB and for some reason the tempdb items used for the session state get dropped anytime the server restarts. Not only do I need to recreate the items, but I also have to recreate the Us... | Um, if you've used the standard settings to enable ASP.Net session state in tempdb, the system should have generated a stored proc ( ASPState_Startup ) as follows in the master database. This stored proc is configured to run automatically on SQL Server startup: USE master GO
DECLARE @sstype nvarchar(128) SET @sstype =... | Adding tempdb items on startup in SQL Server How could I add some items to the tempdb anytime SQL Server starts up? I'm no expert at this, but our ASP SessionState is stored in the DB and for some reason the tempdb items used for the session state get dropped anytime the server restarts. Not only do I need to recreate ... | TITLE:
Adding tempdb items on startup in SQL Server
QUESTION:
How could I add some items to the tempdb anytime SQL Server starts up? I'm no expert at this, but our ASP SessionState is stored in the DB and for some reason the tempdb items used for the session state get dropped anytime the server restarts. Not only do I... | [
"asp.net",
"sql-server-2005",
"session-state"
] | 2 | 2 | 1,946 | 1 | 0 | 2011-06-01T13:35:22.353000 | 2011-06-01T13:44:19.537000 |
6,202,046 | 6,202,134 | setting selectedindex of html.dropdownlist | I have a dropdownlist in my asp.net MVC2 view like this: foreach (var whiteout in Model.Whiteouts) { <%= Html.DropDownList("drprepeat", new SelectList(Model.RepeatList))%> } I want to make drprepeat's one item selected based on value of whiteout.field. How can I do this? Please suggest. | I was able to fix it using: <%= Html.DropDownList("drpFields", new SelectList(Model.Fields, "FieldID", "NiceName", whiteout.FieldID)) %> | setting selectedindex of html.dropdownlist I have a dropdownlist in my asp.net MVC2 view like this: foreach (var whiteout in Model.Whiteouts) { <%= Html.DropDownList("drprepeat", new SelectList(Model.RepeatList))%> } I want to make drprepeat's one item selected based on value of whiteout.field. How can I do this? Pleas... | TITLE:
setting selectedindex of html.dropdownlist
QUESTION:
I have a dropdownlist in my asp.net MVC2 view like this: foreach (var whiteout in Model.Whiteouts) { <%= Html.DropDownList("drprepeat", new SelectList(Model.RepeatList))%> } I want to make drprepeat's one item selected based on value of whiteout.field. How ca... | [
"asp.net",
"asp.net-mvc-2"
] | 0 | 0 | 266 | 1 | 0 | 2011-06-01T13:36:26.370000 | 2011-06-01T13:41:33.997000 |
6,202,049 | 6,202,125 | Compare table with a table variable in a Stored procedure in SQL Server 2005 | How to compare a table against a table variable in a Stored Procedure? Normally to compare the two tables we used this query: SELECT * FROM Table A WHERE NOT EXISTS(SELECT * FROM Table B WHERE Table A.ID = Table B.ID) But here, I have Table A and one table variable @Item like Table B. In this scenario, how to compare T... | If works just the same (altough using table aliases will make it easier) SELECT * FROM Table A WHERE NOT EXISTS( SELECT * FROM @Item sub WHERE Table A.ID = sub.ID ) | Compare table with a table variable in a Stored procedure in SQL Server 2005 How to compare a table against a table variable in a Stored Procedure? Normally to compare the two tables we used this query: SELECT * FROM Table A WHERE NOT EXISTS(SELECT * FROM Table B WHERE Table A.ID = Table B.ID) But here, I have Table A ... | TITLE:
Compare table with a table variable in a Stored procedure in SQL Server 2005
QUESTION:
How to compare a table against a table variable in a Stored Procedure? Normally to compare the two tables we used this query: SELECT * FROM Table A WHERE NOT EXISTS(SELECT * FROM Table B WHERE Table A.ID = Table B.ID) But her... | [
"sql",
"sql-server",
"sql-server-2005"
] | 2 | 2 | 3,909 | 6 | 0 | 2011-06-01T13:36:38.223000 | 2011-06-01T13:41:09.443000 |
6,202,053 | 6,208,431 | ASP.NET MVC - Extending TextBoxFor without re-writing the method | Is there any possible way to extend the basic html helpers ( TextBoxFor, TextAreaFor, etc) using extension methods on their output, instead of just re-writing the entire methods completely? For instance, adding in... @Html.TextBoxFor( model => model.Name ).Identity("idName") I know I can achieve this using the followin... | As @AaronShockley says, because TextBoxFor() returns an MvcHtmlString, your only option for developing a 'fluid API' style of amending the output would be to operate on the MvcHtmlString s returned by the helper methods. A slightly different way of doing this which I think approaches what you're after would be to use a... | ASP.NET MVC - Extending TextBoxFor without re-writing the method Is there any possible way to extend the basic html helpers ( TextBoxFor, TextAreaFor, etc) using extension methods on their output, instead of just re-writing the entire methods completely? For instance, adding in... @Html.TextBoxFor( model => model.Name ... | TITLE:
ASP.NET MVC - Extending TextBoxFor without re-writing the method
QUESTION:
Is there any possible way to extend the basic html helpers ( TextBoxFor, TextAreaFor, etc) using extension methods on their output, instead of just re-writing the entire methods completely? For instance, adding in... @Html.TextBoxFor( mo... | [
"asp.net-mvc-3"
] | 8 | 9 | 7,474 | 2 | 0 | 2011-06-01T13:36:58.033000 | 2011-06-01T22:20:59.850000 |
6,202,058 | 6,202,249 | queries in entity framework | i have written the following query and it is giving error Unable to cast object of type System.Data.Objects.ObjectQuery'[ITClassifieds.Models.Viewsearch]' to type 'ITClassifieds.Models.Viewsearch'. my code is as follows if (zipcode.Contains(","))//opening of zipcode conatins comma { do { zipcode = zipcode.Replace(" ", ... | The Distinct method returns an enumerable collection (in your case, and ObjectQuery, which may contain more than one element. You can't typecast that directly to an item in the collection, you need to use one of the IEnumerable methods to get it: Viewsearch vs = zipcd.SingleOrDefault(); if ( vs!= null ) { zipcode = vs.... | queries in entity framework i have written the following query and it is giving error Unable to cast object of type System.Data.Objects.ObjectQuery'[ITClassifieds.Models.Viewsearch]' to type 'ITClassifieds.Models.Viewsearch'. my code is as follows if (zipcode.Contains(","))//opening of zipcode conatins comma { do { zip... | TITLE:
queries in entity framework
QUESTION:
i have written the following query and it is giving error Unable to cast object of type System.Data.Objects.ObjectQuery'[ITClassifieds.Models.Viewsearch]' to type 'ITClassifieds.Models.Viewsearch'. my code is as follows if (zipcode.Contains(","))//opening of zipcode conatin... | [
"asp.net",
"asp.net-mvc"
] | 1 | 0 | 69 | 3 | 0 | 2011-06-01T13:37:13 | 2011-06-01T13:50:18.967000 |
6,202,060 | 6,218,945 | How does it happen Azure web role entry point and .aspx page handler are run in different processes? | I'm playing with this Azure web role sample. It contains a class derived from RoleEntryPoint and a.aspx page that contains a button click handler. I test it in Azure Emulator. I put the following code (taken from here ) string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name; in both role OnStart(... | David is correct. In addition to that, you can turn off this behavior and run everything in the hostable web core (as it worked before SDK 1.4). You just need to comment out the "Sites" section in the services definition like in the example below: | How does it happen Azure web role entry point and .aspx page handler are run in different processes? I'm playing with this Azure web role sample. It contains a class derived from RoleEntryPoint and a.aspx page that contains a button click handler. I test it in Azure Emulator. I put the following code (taken from here )... | TITLE:
How does it happen Azure web role entry point and .aspx page handler are run in different processes?
QUESTION:
I'm playing with this Azure web role sample. It contains a class derived from RoleEntryPoint and a.aspx page that contains a button click handler. I test it in Azure Emulator. I put the following code ... | [
"windows",
"iis",
"deployment",
"azure",
"cloud"
] | 3 | 3 | 1,316 | 2 | 0 | 2011-06-01T13:37:21.713000 | 2011-06-02T18:48:42.213000 |
6,202,070 | 6,202,216 | So how does nginx changes process title? | This function implements the API to change process title: http://lxr.evanmiller.org/http/source/os/unix/ngx_setproctitle.c 59 for (i = 0; environ[i]; i++) { 60 if (ngx_os_argv_last == environ[i]) { 61 62 size = ngx_strlen(environ[i]) + 1; 63 ngx_os_argv_last = environ[i] + size; 64 65 ngx_cpystrn(p, (u_char *) environ[... | The comment at the beginning of the module seems to explain a lot, have you read it? http://lxr.evanmiller.org/http/source/os/unix/ngx_setproctitle.c#L14 It appears the ngx_init_setproctitle() function simply sets up the memory for setting the process title and does no real changes to the title. The comment at the begi... | So how does nginx changes process title? This function implements the API to change process title: http://lxr.evanmiller.org/http/source/os/unix/ngx_setproctitle.c 59 for (i = 0; environ[i]; i++) { 60 if (ngx_os_argv_last == environ[i]) { 61 62 size = ngx_strlen(environ[i]) + 1; 63 ngx_os_argv_last = environ[i] + size;... | TITLE:
So how does nginx changes process title?
QUESTION:
This function implements the API to change process title: http://lxr.evanmiller.org/http/source/os/unix/ngx_setproctitle.c 59 for (i = 0; environ[i]; i++) { 60 if (ngx_os_argv_last == environ[i]) { 61 62 size = ngx_strlen(environ[i]) + 1; 63 ngx_os_argv_last = ... | [
"c",
"nginx"
] | 0 | 1 | 850 | 1 | 0 | 2011-06-01T13:38:09.287000 | 2011-06-01T13:47:23.570000 |
6,202,072 | 6,202,152 | Create a class instance on Application_Start | Is it possible to create a class instance on Application_Start that can be used in all controllers? I would like to be able to create for example: var globalHelper = new LoadsStuff(); and then in my Action methods: globalHelper.GetInfoFor("key"); My Helper class loads a fairly big XML file to memory and I would like to... | Use application variables: Application["GlobalHelper"] = new LoadsStuff();
((LoadsStuff) Application["GlobalHelper"]).GetInfoFor("key"); Refer to: ASP.NET Application State Overview | Create a class instance on Application_Start Is it possible to create a class instance on Application_Start that can be used in all controllers? I would like to be able to create for example: var globalHelper = new LoadsStuff(); and then in my Action methods: globalHelper.GetInfoFor("key"); My Helper class loads a fair... | TITLE:
Create a class instance on Application_Start
QUESTION:
Is it possible to create a class instance on Application_Start that can be used in all controllers? I would like to be able to create for example: var globalHelper = new LoadsStuff(); and then in my Action methods: globalHelper.GetInfoFor("key"); My Helper ... | [
"c#",
"asp.net",
"asp.net-mvc"
] | 3 | 4 | 1,468 | 3 | 0 | 2011-06-01T13:38:11.200000 | 2011-06-01T13:43:14.957000 |
6,202,074 | 6,202,469 | Convert string to int if string is a number | I need to convert a string, obtained from excel, in VBA to an interger. To do so I'm using CInt() which works well. However there is a chance that the string could be something other than a number, in this case I need to set the integer to 0. Currently I have: If oXLSheet2.Cells(4, 6).Value <> "example string" Then cur... | Use IsNumeric. It returns true if it's a number or false otherwise. Public Sub NumTest() On Error GoTo MyErrorHandler
Dim myVar As Variant myVar = 11.2 'Or whatever
Dim finalNumber As Integer If IsNumeric(myVar) Then finalNumber = CInt(myVar) Else finalNumber = 0 End If
Exit Sub
MyErrorHandler: MsgBox "NumTest" & v... | Convert string to int if string is a number I need to convert a string, obtained from excel, in VBA to an interger. To do so I'm using CInt() which works well. However there is a chance that the string could be something other than a number, in this case I need to set the integer to 0. Currently I have: If oXLSheet2.Ce... | TITLE:
Convert string to int if string is a number
QUESTION:
I need to convert a string, obtained from excel, in VBA to an interger. To do so I'm using CInt() which works well. However there is a chance that the string could be something other than a number, in this case I need to set the integer to 0. Currently I hav... | [
"excel",
"vba"
] | 74 | 113 | 666,979 | 6 | 0 | 2011-06-01T13:38:15.617000 | 2011-06-01T14:04:19.003000 |
6,202,079 | 6,202,210 | How to capture clicked button in js functions? | I have to buttons like this: Now I have two js function. First function is called when ajax request is started and seconf function is called when ajax request is completed. this.showLoading = function () { backupsource = $('.processAnimation').attr('class'); $('.processAnimation').removeAttr('class').addClass('disabled... | Since you haven't posted your click event binding I am going to take a quick guess and say that your selector is not set right or conflicts with another element. try something like this: $('input').click(function(){ switch( $(this).attr('id') ){ case 'submit': ShowLoading(); break; case 'reset': HideLoading(); break; }... | How to capture clicked button in js functions? I have to buttons like this: Now I have two js function. First function is called when ajax request is started and seconf function is called when ajax request is completed. this.showLoading = function () { backupsource = $('.processAnimation').attr('class'); $('.processAni... | TITLE:
How to capture clicked button in js functions?
QUESTION:
I have to buttons like this: Now I have two js function. First function is called when ajax request is started and seconf function is called when ajax request is completed. this.showLoading = function () { backupsource = $('.processAnimation').attr('class... | [
"javascript",
"jquery"
] | 1 | 2 | 3,069 | 3 | 0 | 2011-06-01T13:38:26.957000 | 2011-06-01T13:47:04.553000 |
6,202,080 | 6,202,188 | Unable to remove text display if value = <null> | I am trying to display some text in a label via the following code: if (thisPhoto.userBio!= NULL) { thisUserBioLabel.text = [NSString stringWithFormat:@"%@",thisPhoto.userBio]; } else { thisUserBioLabel.text = @""; } However, I am having difficulty in removing the display if the value for thisPhoto.userBio is equal to ... | is what happens when the value is NSNull not nil. To do this you need to add an extra check to your first if. if (thisPhoto.userBio &&![thisPhoto.userBio isEqual:[NSNull null]]) That will check for both cases. | Unable to remove text display if value = <null> I am trying to display some text in a label via the following code: if (thisPhoto.userBio!= NULL) { thisUserBioLabel.text = [NSString stringWithFormat:@"%@",thisPhoto.userBio]; } else { thisUserBioLabel.text = @""; } However, I am having difficulty in removing the display... | TITLE:
Unable to remove text display if value = <null>
QUESTION:
I am trying to display some text in a label via the following code: if (thisPhoto.userBio!= NULL) { thisUserBioLabel.text = [NSString stringWithFormat:@"%@",thisPhoto.userBio]; } else { thisUserBioLabel.text = @""; } However, I am having difficulty in re... | [
"objective-c",
"cocoa-touch",
"ios",
"null",
"uilabel"
] | 2 | 4 | 433 | 2 | 0 | 2011-06-01T13:38:36.080000 | 2011-06-01T13:45:46.643000 |
6,202,092 | 6,202,164 | Simple login for private user-files | I want to create a simple login with only a few hard-coded username/password combos which gives access to individual private directories with files that I upload. (mysite.com/user1/, mysite.com/anotheruser/...) Below are the contents of my mylogin.php. What approaches are there for me to "password protect" files for do... | You will find this very useful: header('Content-disposition:attachment; filename.pdf'); Just read the file (using readfile for example), dump the data and set the header as an attachement. Store the originals where that cannot be accessed by http (or use an HTACCESS to protect them). | Simple login for private user-files I want to create a simple login with only a few hard-coded username/password combos which gives access to individual private directories with files that I upload. (mysite.com/user1/, mysite.com/anotheruser/...) Below are the contents of my mylogin.php. What approaches are there for m... | TITLE:
Simple login for private user-files
QUESTION:
I want to create a simple login with only a few hard-coded username/password combos which gives access to individual private directories with files that I upload. (mysite.com/user1/, mysite.com/anotheruser/...) Below are the contents of my mylogin.php. What approach... | [
"php",
"authentication",
"passwords"
] | 0 | 2 | 496 | 2 | 0 | 2011-06-01T13:39:13.773000 | 2011-06-01T13:44:10.953000 |
6,202,093 | 6,202,208 | What is the common bugzilla hook for GIT? | I am looking for to find a git hook which submits posts to bugzilla when comit message includes fix/comment tags. However, I couldn't find a common tool. Here is a list of alternatives on the Git wiki. Does anyone know which tools are being used by Fedora or KDE? | I don't know which tools are used by Fedora or KDE but this one can be used as a hook for intergration of bugzilla and GIT. Hope it can help you. | What is the common bugzilla hook for GIT? I am looking for to find a git hook which submits posts to bugzilla when comit message includes fix/comment tags. However, I couldn't find a common tool. Here is a list of alternatives on the Git wiki. Does anyone know which tools are being used by Fedora or KDE? | TITLE:
What is the common bugzilla hook for GIT?
QUESTION:
I am looking for to find a git hook which submits posts to bugzilla when comit message includes fix/comment tags. However, I couldn't find a common tool. Here is a list of alternatives on the Git wiki. Does anyone know which tools are being used by Fedora or K... | [
"git",
"githooks"
] | 3 | 1 | 4,779 | 1 | 0 | 2011-06-01T13:39:28.070000 | 2011-06-01T13:46:51.633000 |
6,202,113 | 6,202,172 | Is there any other payment module other than Paypal? | I am developing an e-commerce application in which I want to implement a payment module. Looking for payment modules I found that there is a Paypal library available for Android. I want to know if there are any other payment libraries? | I'm currently using CreditCall... it has an XML API to do it. It also offers a Java library that automates the XML parsing. It allows you to pay using credit or debit card, as well as Paypal, all that through eKashu. Documentation + a basic example CardEaseXML API Download | Is there any other payment module other than Paypal? I am developing an e-commerce application in which I want to implement a payment module. Looking for payment modules I found that there is a Paypal library available for Android. I want to know if there are any other payment libraries? | TITLE:
Is there any other payment module other than Paypal?
QUESTION:
I am developing an e-commerce application in which I want to implement a payment module. Looking for payment modules I found that there is a Paypal library available for Android. I want to know if there are any other payment libraries?
ANSWER:
I'm ... | [
"android",
"paypal",
"e-commerce",
"payment"
] | 7 | 3 | 951 | 2 | 0 | 2011-06-01T13:40:35.707000 | 2011-06-01T13:44:39.237000 |
6,202,114 | 6,202,787 | Spring @PersistenceContext how to inject manually the entity manager in my GenericDao | Hallo all: I read the spring reference about this point. I would choose to use the @PersistenceContext in my DAO to inject a shared transactional entity manager, but since I use the GenericDaoJpaImpl pattern over two entityManagerFactories that point to 2 different persistence units I cannot use it. So right now in my ... | You can use SharedEntityManagerBean to construct a transactional EntityManager from the EntityManagerFactory:... | Spring @PersistenceContext how to inject manually the entity manager in my GenericDao Hallo all: I read the spring reference about this point. I would choose to use the @PersistenceContext in my DAO to inject a shared transactional entity manager, but since I use the GenericDaoJpaImpl pattern over two entityManagerFact... | TITLE:
Spring @PersistenceContext how to inject manually the entity manager in my GenericDao
QUESTION:
Hallo all: I read the spring reference about this point. I would choose to use the @PersistenceContext in my DAO to inject a shared transactional entity manager, but since I use the GenericDaoJpaImpl pattern over two... | [
"spring",
"entitymanager"
] | 1 | 5 | 6,799 | 2 | 0 | 2011-06-01T13:40:36.597000 | 2011-06-01T14:27:16.500000 |
6,202,115 | 6,212,263 | css border radius bug in chrome with percentages | Hi I'm having troubles with a problem in chrome. I think it might be a bug but I can't find much info on it. Basically I want to apply border radius on an image. The border-radius will be 50% forming a circle. The reason I've set it as a % is because i wont explicity know the width/hieghtt of the image. Any ideas why c... | I figured out a way around it, by adding the border and the border-radius onto the parent. I then applied the border radius to the image too. Although there is a minute gap It works in chrome now. I haven't tested it in FF3.6. But FF4 displays the same result | css border radius bug in chrome with percentages Hi I'm having troubles with a problem in chrome. I think it might be a bug but I can't find much info on it. Basically I want to apply border radius on an image. The border-radius will be 50% forming a circle. The reason I've set it as a % is because i wont explicity kno... | TITLE:
css border radius bug in chrome with percentages
QUESTION:
Hi I'm having troubles with a problem in chrome. I think it might be a bug but I can't find much info on it. Basically I want to apply border radius on an image. The border-radius will be 50% forming a circle. The reason I've set it as a % is because i ... | [
"html",
"css",
"google-chrome"
] | 0 | 1 | 1,015 | 3 | 0 | 2011-06-01T13:40:36.833000 | 2011-06-02T08:41:43.917000 |
6,202,116 | 6,202,300 | Restrict some action access with count? | This is more like a security question. What is best practice to implement something like "counting specific page visits per x time by IP" and blocking that IP address if limit is exceeded? Some steps: user enters website user selects product to buy fills out forms and submits form redirected to payment gateway How can ... | You are going to want to store actions or requests in a database along with the time() they were made. Then it's a matter of running a simple mysql_query() to check if the user has exceeded their limit. Eg. "SELECT * FROM `requests` WHERE `request_time` > '".(time() - (30 * 60))."' AND `ip_address` = '".$_SERVER['REMOT... | Restrict some action access with count? This is more like a security question. What is best practice to implement something like "counting specific page visits per x time by IP" and blocking that IP address if limit is exceeded? Some steps: user enters website user selects product to buy fills out forms and submits for... | TITLE:
Restrict some action access with count?
QUESTION:
This is more like a security question. What is best practice to implement something like "counting specific page visits per x time by IP" and blocking that IP address if limit is exceeded? Some steps: user enters website user selects product to buy fills out for... | [
"php"
] | 1 | 1 | 202 | 1 | 0 | 2011-06-01T13:40:37.923000 | 2011-06-01T13:54:02.163000 |
6,202,121 | 6,213,762 | Sys.WebForms.PageRequestManager pageLoaded event caching function? | I've got a master page that contains this code at the bottom of the page: the parseData() function I'm creating inside the main page and I'm adding functions to it based on each page load. parseData IS called after every AJAX refresh, but it appears to only call the contents of the function from BEFORE the request. If ... | According to the research I did, this is a problem with MS AJAX UpdatePanels and you are really better off not using them. I revised my JavaScript to pull data from hidden form fields instead so the JavaScript functions never changed and was able to get this working. | Sys.WebForms.PageRequestManager pageLoaded event caching function? I've got a master page that contains this code at the bottom of the page: the parseData() function I'm creating inside the main page and I'm adding functions to it based on each page load. parseData IS called after every AJAX refresh, but it appears to ... | TITLE:
Sys.WebForms.PageRequestManager pageLoaded event caching function?
QUESTION:
I've got a master page that contains this code at the bottom of the page: the parseData() function I'm creating inside the main page and I'm adding functions to it based on each page load. parseData IS called after every AJAX refresh, ... | [
"c#",
"asp.net",
"ajax"
] | 2 | 0 | 1,354 | 1 | 0 | 2011-06-01T13:40:47.490000 | 2011-06-02T11:11:32.197000 |
6,202,132 | 6,202,183 | Email id validation | I have made an iphone application in which I have used email id validation. The code which I have used is as below: NSString *valid = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", valid];
if ([emailTest evaluateWithObject:Id.text] == NO... | -(IBAction)idValidator:(id)sender { NSString *str=idField.text;
NSString *regex =@"\\b([a-zA-Z0-9%_.+\\-]+)\\b";
NSPredicate * regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
BOOL x= [regextest evaluateWithObject:str];
if (x==FALSE) { //do something
} else { //do something } } | Email id validation I have made an iphone application in which I have used email id validation. The code which I have used is as below: NSString *valid = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", valid];
if ([emailTest evaluateWithO... | TITLE:
Email id validation
QUESTION:
I have made an iphone application in which I have used email id validation. The code which I have used is as below: NSString *valid = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", valid];
if ([email... | [
"iphone"
] | 0 | 1 | 615 | 4 | 0 | 2011-06-01T13:41:30.687000 | 2011-06-01T13:45:30.340000 |
6,202,137 | 6,203,003 | Does @synchronize protect against race conditions in this case? | I want to use Core Data in background threads and NSOperationQueue. Now I thought why shouldn't I just create a class holding all the Core Data stack things with a property of NSManagedObjectContext, and then just make this property atomic? One thing I'm not sure about @synchronize(self) {...} is this: Assume I have a ... | @synchronized(self) { /* lock is effective inside here only */ } | Does @synchronize protect against race conditions in this case? I want to use Core Data in background threads and NSOperationQueue. Now I thought why shouldn't I just create a class holding all the Core Data stack things with a property of NSManagedObjectContext, and then just make this property atomic? One thing I'm n... | TITLE:
Does @synchronize protect against race conditions in this case?
QUESTION:
I want to use Core Data in background threads and NSOperationQueue. Now I thought why shouldn't I just create a class holding all the Core Data stack things with a property of NSManagedObjectContext, and then just make this property atomi... | [
"iphone",
"multithreading",
"ios",
"ipad",
"nsoperationqueue"
] | 2 | 4 | 2,083 | 2 | 0 | 2011-06-01T13:41:46.007000 | 2011-06-01T14:41:43.703000 |
6,202,140 | 6,202,246 | Messaging system. Question about database design | I'm designing a messaging system that will have to support a huge amount of messages and users. I was thinking about two solutions. Usertable -> id, username.... Messagetable -> id, from_id, to_id, message... Or: Usertable -> id, username.... Messagetable -> id, message... HasMessagetable -> id, from_id, to_id... I'm w... | I did the same not too long ago and started out with approach 1. But then users were supposed to be able to send messages to multiple users. Suddenly approach 1 saved each message n times if n recipients were addressed. So if this is ever a possibility, I think 2 is better. | Messaging system. Question about database design I'm designing a messaging system that will have to support a huge amount of messages and users. I was thinking about two solutions. Usertable -> id, username.... Messagetable -> id, from_id, to_id, message... Or: Usertable -> id, username.... Messagetable -> id, message.... | TITLE:
Messaging system. Question about database design
QUESTION:
I'm designing a messaging system that will have to support a huge amount of messages and users. I was thinking about two solutions. Usertable -> id, username.... Messagetable -> id, from_id, to_id, message... Or: Usertable -> id, username.... Messagetab... | [
"php",
"mysql",
"database",
"database-design"
] | 5 | 1 | 1,130 | 3 | 0 | 2011-06-01T13:42:16.350000 | 2011-06-01T13:50:01.313000 |
6,202,144 | 6,202,242 | Is there a way to remove all controls from a row in TableLayoutPanel? | I generate controls for a TableLayoutPanel dynamically. I have a delete button in each row. When I click that, that row has to be removed. Dim removeBtn As New Button AddHandler removeBtn.Click, AddressOf DeleteRow tlp.Controls.Add(removeBtn, 5, rowCount) I have not shown the code to add text boxes which are similar to... | Basically you have to: Get the list of controls from that row and delete them from the TLP Remove the corresponding row style from the TLP Set the new row index for every control in every row after the deleted one Decrement the RowCount Here is the VB.NET code to do the same. Public Sub RemoveRow(ByRef panel As TableLa... | Is there a way to remove all controls from a row in TableLayoutPanel? I generate controls for a TableLayoutPanel dynamically. I have a delete button in each row. When I click that, that row has to be removed. Dim removeBtn As New Button AddHandler removeBtn.Click, AddressOf DeleteRow tlp.Controls.Add(removeBtn, 5, rowC... | TITLE:
Is there a way to remove all controls from a row in TableLayoutPanel?
QUESTION:
I generate controls for a TableLayoutPanel dynamically. I have a delete button in each row. When I click that, that row has to be removed. Dim removeBtn As New Button AddHandler removeBtn.Click, AddressOf DeleteRow tlp.Controls.Add(... | [
".net",
"vb.net",
"tablelayoutpanel"
] | 8 | 21 | 15,618 | 3 | 0 | 2011-06-01T13:42:28.177000 | 2011-06-01T13:49:50.183000 |
6,202,148 | 6,202,206 | IOS: stop a loop of UIAlert | I have this code: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex == 0) {
} else if(buttonIndex == 1) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Danger" message:@"war" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView s... | Set the delegate of the second alertView to nil. UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Danger" message:@"war" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; However, if you wish to add options to the second on in the future, you can set a tag value to the alertView and check the ta... | IOS: stop a loop of UIAlert I have this code: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex == 0) {
} else if(buttonIndex == 1) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Danger" message:@"war" delegate:self cancelButtonTitle:@"OK" otherBut... | TITLE:
IOS: stop a loop of UIAlert
QUESTION:
I have this code: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex == 0) {
} else if(buttonIndex == 1) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Danger" message:@"war" delegate:self cancelButtonTi... | [
"objective-c",
"xcode",
"ios",
"uialertview"
] | 0 | 3 | 466 | 3 | 0 | 2011-06-01T13:43:05.613000 | 2011-06-01T13:46:45.060000 |
6,202,161 | 6,202,425 | How to make a dropdown list change multiple properties of a view model? | I code (see this jsfiddle ) as follows: Knockout with jQuery UI Widget Bindings Date From: (with datepicker) Date To: (with datepicker) And this Javascript: var viewModel = { ranges: [ {name:'Yesterday',value:'Yesterday'}, {name:'Last7Days',value:'Last 7 Days'}, {name:'Last14Days',value:'Last 14 Days'}, {name:'LastFull... | Manual subscriptions are a good option. Something like: http://jsfiddle.net/rniemeyer/N58rf/ Basic idea is like: viewModel.range.subscribe(function(newValue) { if (newValue && newValue.value!== 'Select') { this.from('').to(''); } }, viewModel); | How to make a dropdown list change multiple properties of a view model? I code (see this jsfiddle ) as follows: Knockout with jQuery UI Widget Bindings Date From: (with datepicker) Date To: (with datepicker) And this Javascript: var viewModel = { ranges: [ {name:'Yesterday',value:'Yesterday'}, {name:'Last7Days',value:'... | TITLE:
How to make a dropdown list change multiple properties of a view model?
QUESTION:
I code (see this jsfiddle ) as follows: Knockout with jQuery UI Widget Bindings Date From: (with datepicker) Date To: (with datepicker) And this Javascript: var viewModel = { ranges: [ {name:'Yesterday',value:'Yesterday'}, {name:'... | [
"knockout.js"
] | 1 | 1 | 327 | 1 | 0 | 2011-06-01T13:43:56.630000 | 2011-06-01T14:01:26.927000 |
6,202,169 | 6,202,449 | PHP code to present information from RIPE XML file | Here is a tool for WHOIS lookups that I use: http://apps.db.ripe.net/search/lookup.html It can present information in an XML file, like this: http://apps.db.ripe.net/whois/lookup/ripe/inetnum/192.36.171.155.xml Let's say I wanted to read the XML file by using PHP and present the netname and descr fields in an HTML docu... | Take a look at SimpleXML. Once you've loaded the file it's easy to traverse... $xml = simplexml_load_file('http://apps.db.ripe.net/whois/lookup/ripe/inetnum/192.36.171.155.xml'); echo $xml->objects->object->attributes->attribute[1]->attributes()->value; | PHP code to present information from RIPE XML file Here is a tool for WHOIS lookups that I use: http://apps.db.ripe.net/search/lookup.html It can present information in an XML file, like this: http://apps.db.ripe.net/whois/lookup/ripe/inetnum/192.36.171.155.xml Let's say I wanted to read the XML file by using PHP and p... | TITLE:
PHP code to present information from RIPE XML file
QUESTION:
Here is a tool for WHOIS lookups that I use: http://apps.db.ripe.net/search/lookup.html It can present information in an XML file, like this: http://apps.db.ripe.net/whois/lookup/ripe/inetnum/192.36.171.155.xml Let's say I wanted to read the XML file ... | [
"php",
"xml",
"lookup",
"whois"
] | 0 | 2 | 1,360 | 2 | 0 | 2011-06-01T13:44:29.343000 | 2011-06-01T14:03:05.627000 |
6,202,170 | 6,202,213 | Is there any way of to know how many seconds elapsed since the ajax call init? | I'm developing an ajax application using jQuery. And my question is the next one. Is there any way of to know how many seconds elapsed since the ajax call init? I just want to change the loader message to "Still working..." when the ajax call is taking more than 10 seconds. Thanks! | $(window).ajaxInit(function() { clearTimeout($.ns.tooLongTimer); $.ns.tooLongTimer = setTimeout(function() { $("#foo").text("TOO LONG"); }, 10000); }).ajaxComplete(function() { clearTimeout($.ns.tooLongTimer); }); | Is there any way of to know how many seconds elapsed since the ajax call init? I'm developing an ajax application using jQuery. And my question is the next one. Is there any way of to know how many seconds elapsed since the ajax call init? I just want to change the loader message to "Still working..." when the ajax cal... | TITLE:
Is there any way of to know how many seconds elapsed since the ajax call init?
QUESTION:
I'm developing an ajax application using jQuery. And my question is the next one. Is there any way of to know how many seconds elapsed since the ajax call init? I just want to change the loader message to "Still working..."... | [
"jquery",
"ajax"
] | 0 | 4 | 296 | 2 | 0 | 2011-06-01T13:44:29.203000 | 2011-06-01T13:47:13.053000 |
6,202,187 | 6,205,778 | Parsing Text Files in Irregular Formats | I have a very large text file that was created by converting a PDF to text format using the XPDF 'pdftotext' utility. The document contains abandoned property data that I'd like to be able to parse into a database-friendly format. The file is formatted as follows: DOE JANE H STATE 1994 0002 SAVINGS 52 33.99 0 EMPLOYEES... | Here's a start in Python. Something similar can probably be done in perl. col_start_pat = re.compile( r'\s+\s(?=\S)' ) for row in ( r.rstrip() for r in data.splitlines() ): if not row: continue def matches( row ): offset= 0 for m in col_start_pat.finditer( row ): yield offset, row[offset:m.end(0)].rstrip() offset= m.en... | Parsing Text Files in Irregular Formats I have a very large text file that was created by converting a PDF to text format using the XPDF 'pdftotext' utility. The document contains abandoned property data that I'd like to be able to parse into a database-friendly format. The file is formatted as follows: DOE JANE H STAT... | TITLE:
Parsing Text Files in Irregular Formats
QUESTION:
I have a very large text file that was created by converting a PDF to text format using the XPDF 'pdftotext' utility. The document contains abandoned property data that I'd like to be able to parse into a database-friendly format. The file is formatted as follow... | [
"pdf",
"text-parsing"
] | 0 | 2 | 629 | 1 | 0 | 2011-06-01T13:45:41.603000 | 2011-06-01T18:12:26.280000 |
6,202,190 | 6,202,260 | Auto save - WPF C# | Is there a way in which I can save details from a ListView that doesnt require me to use the save dialog box everytime and allows me to call it within a certain time span. So 'save' rather than 'save as' everytime. | You can use a DispatchTimer with a callback to a method to perform your save. DispatcherTimer autosaveTimer = new DispatcherTimer(TimeSpan.FromSeconds(autosaveInterval), DispatcherPriority.Background, new EventHandler(DoAutoSave), Application.Current.Dispatcher);
private void DoAutoSave(object sender, EventArgs e) { /... | Auto save - WPF C# Is there a way in which I can save details from a ListView that doesnt require me to use the save dialog box everytime and allows me to call it within a certain time span. So 'save' rather than 'save as' everytime. | TITLE:
Auto save - WPF C#
QUESTION:
Is there a way in which I can save details from a ListView that doesnt require me to use the save dialog box everytime and allows me to call it within a certain time span. So 'save' rather than 'save as' everytime.
ANSWER:
You can use a DispatchTimer with a callback to a method to ... | [
"c#",
"wpf"
] | 6 | 7 | 1,943 | 1 | 0 | 2011-06-01T13:45:48.233000 | 2011-06-01T13:50:57.673000 |
6,202,195 | 6,225,452 | Silverlight & WPF: VisualStateManager in ControlTemplate does not work | So, hello everybody. I've made two test programs for creating a own control. One in Silverlight, one in WPF. I created a kind of RangeSlider. This Slider has of course two Orientations, Horizontal and Vertical. First I used two different techniques to create my RangeSlider. In WPF I used Triggers, in Silverlight (u kno... | So, I got a solution on it. In the 'inner' template I added to the element I want to toggle a DataTrigger. This DataTrigger is bound to the PART_HorizontalTemplate Visibility and contains a Storyboard that do the action I need. Maybe it's not really the kind of solution I was looking for, because it stretches the code ... | Silverlight & WPF: VisualStateManager in ControlTemplate does not work So, hello everybody. I've made two test programs for creating a own control. One in Silverlight, one in WPF. I created a kind of RangeSlider. This Slider has of course two Orientations, Horizontal and Vertical. First I used two different techniques ... | TITLE:
Silverlight & WPF: VisualStateManager in ControlTemplate does not work
QUESTION:
So, hello everybody. I've made two test programs for creating a own control. One in Silverlight, one in WPF. I created a kind of RangeSlider. This Slider has of course two Orientations, Horizontal and Vertical. First I used two dif... | [
"wpf",
"silverlight",
"controltemplate",
"visualstatemanager"
] | 0 | 0 | 1,474 | 2 | 0 | 2011-06-01T13:46:14.397000 | 2011-06-03T09:45:17.683000 |
6,202,202 | 6,202,239 | How to set an input (text) value to a PHP variable on the fly | Basically I'm using datepicker from jQuery to have my client pick a date. I then want to take that date (once they select it) and process it through the DB to pre-fill a timepicker. Problem is, I don't know how to take the value of that input box and process it without actually having to submit a form. I want to deal w... | To actually have the server process the value of the date picker without submitting a form you would have to pass that value to the server via AJAX. $('.datepicker').datepicker({ onSelect: function(dateText, inst) { $.ajax({ url: "yourscript.php", type: "POST", data: ({date: dateText}), success: function(data){ alert(d... | How to set an input (text) value to a PHP variable on the fly Basically I'm using datepicker from jQuery to have my client pick a date. I then want to take that date (once they select it) and process it through the DB to pre-fill a timepicker. Problem is, I don't know how to take the value of that input box and process... | TITLE:
How to set an input (text) value to a PHP variable on the fly
QUESTION:
Basically I'm using datepicker from jQuery to have my client pick a date. I then want to take that date (once they select it) and process it through the DB to pre-fill a timepicker. Problem is, I don't know how to take the value of that inp... | [
"php",
"javascript",
"jquery",
"jquery-ui"
] | 2 | 1 | 1,240 | 4 | 0 | 2011-06-01T13:46:35.893000 | 2011-06-01T13:49:32.117000 |
6,202,203 | 6,202,269 | What is the difference between (*p)[8] and *p[8] in C? | The two declarations are as follows: int (*p)[8]; int *p[8]; | The first is a single pointer to an array of 8 integers, while the second is an array of 8 pointers, each to an integer. If you just kick up cdecl, it's wonderful for this sort of thing: pax$ cdecl Type `help' or `?' for help
cdecl> explain int (*p)[8]; declare p as pointer to array 8 of int
cdecl> explain int *p[8];... | What is the difference between (*p)[8] and *p[8] in C? The two declarations are as follows: int (*p)[8]; int *p[8]; | TITLE:
What is the difference between (*p)[8] and *p[8] in C?
QUESTION:
The two declarations are as follows: int (*p)[8]; int *p[8];
ANSWER:
The first is a single pointer to an array of 8 integers, while the second is an array of 8 pointers, each to an integer. If you just kick up cdecl, it's wonderful for this sort ... | [
"c",
"programming-languages"
] | 4 | 10 | 705 | 2 | 0 | 2011-06-01T13:46:37.570000 | 2011-06-01T13:51:44.363000 |
6,202,217 | 6,203,097 | Accessing and using .jsf files from the database | What is the best way to enable my webapplication to use JSF files stored in the database? I'd like to be able to dynamically (during runtime) create new JSF pages which will be made available without having to redeploy the application. So in other words: I would like to store the bigger part of my JSF pages in the data... | 1: Whenever a new page has to be added/removed: manipulate the files in the classpath (e.g. remove or add a file to the.war file) This is definitely possible if the WAR is expanded. I am not sure about Jetty, but it works for me with Mojarra 2.x on Tomcat 7 and Glassfish 3. Just writing the file to the expanded WAR fol... | Accessing and using .jsf files from the database What is the best way to enable my webapplication to use JSF files stored in the database? I'd like to be able to dynamically (during runtime) create new JSF pages which will be made available without having to redeploy the application. So in other words: I would like to ... | TITLE:
Accessing and using .jsf files from the database
QUESTION:
What is the best way to enable my webapplication to use JSF files stored in the database? I'd like to be able to dynamically (during runtime) create new JSF pages which will be made available without having to redeploy the application. So in other words... | [
"java",
"resources",
"jsf-2",
"runtime"
] | 4 | 2 | 2,713 | 2 | 0 | 2011-06-01T13:47:28.030000 | 2011-06-01T14:47:24.057000 |
6,202,219 | 6,202,332 | array_filter ,array_map ,array_walk ,call,pass parameter,return? | $origarray1 = array(2.4, 2.6, 3.5); $origarray2 = array(2.4, 2.6, 3.5);
print_r(array_map('floor', $origarray1)); //$origarray1 stays the same
//changes $origarray2 function callback_array_walk(&$v, $k) { $v = floor($v); } array_walk($origarray2, callback_array_walk(&$v, $k)); print_r($origarray2);
//this is a more ... | Try passing the callback function to array_walk as a string without any arguments: function callback_array_walk(&$v, $k) { $v = floor($v); } array_walk($origarray2, 'callback_array_walk'); ^^^^^^^^^^^^^^^^^^^^^ Similarly for array_map and array_filter functions pass the callback function as a string. | array_filter ,array_map ,array_walk ,call,pass parameter,return? $origarray1 = array(2.4, 2.6, 3.5); $origarray2 = array(2.4, 2.6, 3.5);
print_r(array_map('floor', $origarray1)); //$origarray1 stays the same
//changes $origarray2 function callback_array_walk(&$v, $k) { $v = floor($v); } array_walk($origarray2, callba... | TITLE:
array_filter ,array_map ,array_walk ,call,pass parameter,return?
QUESTION:
$origarray1 = array(2.4, 2.6, 3.5); $origarray2 = array(2.4, 2.6, 3.5);
print_r(array_map('floor', $origarray1)); //$origarray1 stays the same
//changes $origarray2 function callback_array_walk(&$v, $k) { $v = floor($v); } array_walk($... | [
"php",
"arrays"
] | 1 | 1 | 435 | 2 | 0 | 2011-06-01T13:47:30.840000 | 2011-06-01T13:55:31.667000 |
6,202,223 | 6,203,060 | Auto code completion on Eclipse | I want Eclipse to automatically suggest to me all possible options, while I'm writing some variable/class name or keyword, like in Flash Develop or Visual Studio. Is it possible? If not, with which Java IDE can I get this? I'm specifically asking about a way to automatically get the same thing I get using CTRL + Space,... | You can also set auto completion to open automatically while typing. Go to Preferences > Java > Editor > Content Assist and write.abcdefghijklmnopqrstuvwxyz in the Auto activation triggers for Java field. See this question for more details. | Auto code completion on Eclipse I want Eclipse to automatically suggest to me all possible options, while I'm writing some variable/class name or keyword, like in Flash Develop or Visual Studio. Is it possible? If not, with which Java IDE can I get this? I'm specifically asking about a way to automatically get the same... | TITLE:
Auto code completion on Eclipse
QUESTION:
I want Eclipse to automatically suggest to me all possible options, while I'm writing some variable/class name or keyword, like in Flash Develop or Visual Studio. Is it possible? If not, with which Java IDE can I get this? I'm specifically asking about a way to automati... | [
"java",
"eclipse"
] | 125 | 262 | 239,820 | 14 | 0 | 2011-06-01T13:48:07.453000 | 2011-06-01T14:45:47.560000 |
6,202,225 | 6,202,292 | Java: FontMetrics ascent incorrect? | When I look at the javadoc for FontMetric.getAscent() I see: The font ascent is the distance from the font's baseline to the top of most alphanumeric characters. Some characters in the Font might extend above the font ascent line. But I wrote a quick demo program and I see this: where the 4 horizontal lines for each ro... | One possible reason is that this value takes into accounts letters with diacritics. For example, adding the umlauts ÄÖÜ shows that their trema are much closer to the ascent (although they still don't quite reach it). Looking for a more general definition of ascent I find the definition in Wikipedia: [..] the ascent spa... | Java: FontMetrics ascent incorrect? When I look at the javadoc for FontMetric.getAscent() I see: The font ascent is the distance from the font's baseline to the top of most alphanumeric characters. Some characters in the Font might extend above the font ascent line. But I wrote a quick demo program and I see this: wher... | TITLE:
Java: FontMetrics ascent incorrect?
QUESTION:
When I look at the javadoc for FontMetric.getAscent() I see: The font ascent is the distance from the font's baseline to the top of most alphanumeric characters. Some characters in the Font might extend above the font ascent line. But I wrote a quick demo program an... | [
"java",
"fontmetrics"
] | 20 | 15 | 8,894 | 3 | 0 | 2011-06-01T13:48:12.080000 | 2011-06-01T13:53:35.980000 |
6,202,226 | 6,202,424 | How to select color file based on filetype? | I want to source a color file based on the filetype python. How can I do that in.vimrc? | EDIT: ZyX makes a valid point that the use of Buf* events will not ensure that the colorscheme is set correctly for python files where the filetype is set after the file is loaded (e.g., python files without the.py extension or if you begin writing a script in a new buffer and manually set filetype=python ). As per ZyX... | How to select color file based on filetype? I want to source a color file based on the filetype python. How can I do that in.vimrc? | TITLE:
How to select color file based on filetype?
QUESTION:
I want to source a color file based on the filetype python. How can I do that in.vimrc?
ANSWER:
EDIT: ZyX makes a valid point that the use of Buf* events will not ensure that the colorscheme is set correctly for python files where the filetype is set after ... | [
"vim"
] | 2 | 4 | 910 | 2 | 0 | 2011-06-01T13:48:23.163000 | 2011-06-01T14:01:24.787000 |
6,202,231 | 6,202,448 | transferring two dimensional array with attributes into an another page | I have a 2 dimensional array which is like that; $results[$i][$j]->title; $results[$i][$j]->snippet; $results[$i][$j]->link; It is full with values. I have to use this variable with its values into a different page. I try it with session but it gives errors. How can I solve this problem? Thanks for your help. | If you attempt to serialize the object within a session (as previously suggested) then remember that the member functions __sleep and __wakeup will automatically be called. Moreover, you will need to ensure that the constructor of the object's class is available on the subsequent page. (This is a very common wall peopl... | transferring two dimensional array with attributes into an another page I have a 2 dimensional array which is like that; $results[$i][$j]->title; $results[$i][$j]->snippet; $results[$i][$j]->link; It is full with values. I have to use this variable with its values into a different page. I try it with session but it giv... | TITLE:
transferring two dimensional array with attributes into an another page
QUESTION:
I have a 2 dimensional array which is like that; $results[$i][$j]->title; $results[$i][$j]->snippet; $results[$i][$j]->link; It is full with values. I have to use this variable with its values into a different page. I try it with ... | [
"php",
"arrays",
"session"
] | 2 | 1 | 162 | 3 | 0 | 2011-06-01T13:48:45.913000 | 2011-06-01T14:03:04.847000 |
6,202,233 | 6,202,324 | asp.net url value causes error | I have a string parameter I pass around using the querystring, I'll call it: Request.QueryString["x"]. If i manually enter a URL like: mypage.aspx?x=co%3Csub%3E2, asp.net doesn't have the chance to get its hands on the value before throwing an error. Is there a way to safely allow this value to be pulled down and valid... | I don't think you can do that without turning validateinput off. Could you encode your querystring somehow so that ASP will validate it? | asp.net url value causes error I have a string parameter I pass around using the querystring, I'll call it: Request.QueryString["x"]. If i manually enter a URL like: mypage.aspx?x=co%3Csub%3E2, asp.net doesn't have the chance to get its hands on the value before throwing an error. Is there a way to safely allow this va... | TITLE:
asp.net url value causes error
QUESTION:
I have a string parameter I pass around using the querystring, I'll call it: Request.QueryString["x"]. If i manually enter a URL like: mypage.aspx?x=co%3Csub%3E2, asp.net doesn't have the chance to get its hands on the value before throwing an error. Is there a way to sa... | [
"asp.net",
"validation",
"query-string"
] | 2 | 0 | 207 | 2 | 0 | 2011-06-01T13:49:00.637000 | 2011-06-01T13:54:59.900000 |
6,202,251 | 6,202,335 | Images in app_offline file | Is there a way to use an image with an app_offline file? I'd like to keep the app_offline looking like the rest of the website - same header, etc, which includes an image. I did try finding a way to do this but I can't seem to do so. The forum posts that I've ran across say it's not possible, since the app_offline forc... | You could try base64 encoding the image, ie. The reason you need to do it like this is that IIS sees the image as a request and app_offline.htm being present in the root is telling IIS to redirect ALL requests therefore this includes any MIME types from images to music etc | Images in app_offline file Is there a way to use an image with an app_offline file? I'd like to keep the app_offline looking like the rest of the website - same header, etc, which includes an image. I did try finding a way to do this but I can't seem to do so. The forum posts that I've ran across say it's not possible,... | TITLE:
Images in app_offline file
QUESTION:
Is there a way to use an image with an app_offline file? I'd like to keep the app_offline looking like the rest of the website - same header, etc, which includes an image. I did try finding a way to do this but I can't seem to do so. The forum posts that I've ran across say ... | [
"asp.net"
] | 29 | 47 | 6,802 | 1 | 0 | 2011-06-01T13:50:23.477000 | 2011-06-01T13:55:41.070000 |
6,202,254 | 6,210,323 | deploying zend framework application in mediatemple GS | i am having trouble deploying my zend framework application to mediatemple GS hosting. I uploaded my application folder to ~/domains and renamed it to mysite.net folder. Inside it, i created a symbolic link html which points to public directory in zend framework application folder. But the application is not working so... | I've found the solution myself: create a.htaccess file in application root folder: SetEnv APPLICATION_ENV development
RewriteEngine On RewriteRule ^\.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /public/index.php [NC,L] RewriteCond %{REQUEST_URI}!^/public/.*$ RewriteRule ^(.*)$ /public/$1 RewriteCon... | deploying zend framework application in mediatemple GS i am having trouble deploying my zend framework application to mediatemple GS hosting. I uploaded my application folder to ~/domains and renamed it to mysite.net folder. Inside it, i created a symbolic link html which points to public directory in zend framework ap... | TITLE:
deploying zend framework application in mediatemple GS
QUESTION:
i am having trouble deploying my zend framework application to mediatemple GS hosting. I uploaded my application folder to ~/domains and renamed it to mysite.net folder. Inside it, i created a symbolic link html which points to public directory in... | [
"zend-framework",
"web-applications"
] | 1 | 1 | 639 | 1 | 0 | 2011-06-01T13:50:29.980000 | 2011-06-02T04:21:05.943000 |
6,202,263 | 6,208,210 | How do I detect if a new microphone is available? | It appears that if one has a mic available, then one can add an event listener for the StatusEvent. However, this only tells you if the mic has been allowed or disallowed. What I'd really like to do is detect if the static Microphone.names property changes. I would have expected this property to be bindable. If I right... | I ran a little test script: var ta:TextArea = new TextArea(); ta.width = ta.height = 500; addChild(ta); var t:Timer = new Timer(5000); t.addEventListener(TimerEvent.TIMER, function(e:Event):void{ var t0:uint = getTimer();
var m:* = Microphone.getMicrophone();
ta.text += "mic found: "+(m?true:false)+" "+(getTimer()-t0... | How do I detect if a new microphone is available? It appears that if one has a mic available, then one can add an event listener for the StatusEvent. However, this only tells you if the mic has been allowed or disallowed. What I'd really like to do is detect if the static Microphone.names property changes. I would have... | TITLE:
How do I detect if a new microphone is available?
QUESTION:
It appears that if one has a mic available, then one can add an event listener for the StatusEvent. However, this only tells you if the mic has been allowed or disallowed. What I'd really like to do is detect if the static Microphone.names property cha... | [
"flash",
"apache-flex",
"actionscript-3",
"microphone"
] | 2 | 0 | 1,295 | 3 | 0 | 2011-06-01T13:51:14.577000 | 2011-06-01T21:56:27.170000 |
6,202,267 | 6,202,370 | How to zip only files and not the full path hierarchy with DotNetZip in powershell? | I'm trying to zip up log using DotNetZip and powershell. The files are in C:\user\temp\logs When I loop through the logs in the directory and add them to the zip file, I end up with the folder hierarchy and the log files when I only want the log files. So the zip ends up containing: -user └temp └logs └log1.log log2.log... | There is an AddFile where you can override the filename in the archive: public ZipEntry AddFile( string fileName, string directoryPathInArchive ) fileName ( String ) The name of the file to add. The name of the file may be a relative path or a fully-qualified path. directoryPathInArchive ( String ) Specifies a director... | How to zip only files and not the full path hierarchy with DotNetZip in powershell? I'm trying to zip up log using DotNetZip and powershell. The files are in C:\user\temp\logs When I loop through the logs in the directory and add them to the zip file, I end up with the folder hierarchy and the log files when I only wan... | TITLE:
How to zip only files and not the full path hierarchy with DotNetZip in powershell?
QUESTION:
I'm trying to zip up log using DotNetZip and powershell. The files are in C:\user\temp\logs When I loop through the logs in the directory and add them to the zip file, I end up with the folder hierarchy and the log fil... | [
"powershell",
"dotnetzip"
] | 17 | 22 | 14,191 | 2 | 0 | 2011-06-01T13:51:32.897000 | 2011-06-01T13:57:47.093000 |
6,202,284 | 6,202,423 | GAE bulk upload programmatically | I have a python script that is intended to run on my local machine every night. It's goal is to pull data from a third party server, do some processing on it, and execute bulk upload to GAE datastore. My issue though is hot to run bulk upload from a python script. All examples I have seen (including Google's documentat... | Appengine can run cron jobs. All you need is to write is a single script which pulls the data from third party server and upload it to appengine engine, Appenigne will do the rest for you. Appengine cron this has everything you need to know about running a cron job in appengine | GAE bulk upload programmatically I have a python script that is intended to run on my local machine every night. It's goal is to pull data from a third party server, do some processing on it, and execute bulk upload to GAE datastore. My issue though is hot to run bulk upload from a python script. All examples I have se... | TITLE:
GAE bulk upload programmatically
QUESTION:
I have a python script that is intended to run on my local machine every night. It's goal is to pull data from a third party server, do some processing on it, and execute bulk upload to GAE datastore. My issue though is hot to run bulk upload from a python script. All ... | [
"python",
"google-app-engine",
"google-cloud-datastore"
] | 1 | 2 | 339 | 2 | 0 | 2011-06-01T13:53:23.567000 | 2011-06-01T14:01:20.613000 |
6,202,289 | 6,202,355 | A simple regex, extract what is between "/d/" and "/" | I need to extract the xxxx in the following string in a url: {anything}/d/xxxx/{anything} That is, get whatever is between "/d/" and the first "/" after that, and forget the rest. | You haven't noticed what language you are using..+\/d\/([^\/]+).+ will do it and have the searched part in $1 (in perl) | A simple regex, extract what is between "/d/" and "/" I need to extract the xxxx in the following string in a url: {anything}/d/xxxx/{anything} That is, get whatever is between "/d/" and the first "/" after that, and forget the rest. | TITLE:
A simple regex, extract what is between "/d/" and "/"
QUESTION:
I need to extract the xxxx in the following string in a url: {anything}/d/xxxx/{anything} That is, get whatever is between "/d/" and the first "/" after that, and forget the rest.
ANSWER:
You haven't noticed what language you are using..+\/d\/([^\... | [
"regex"
] | 1 | 5 | 101 | 3 | 0 | 2011-06-01T13:53:30.450000 | 2011-06-01T13:56:38.630000 |
6,202,294 | 6,202,361 | Checking for existing URLs before being added to database | I'm trying to test if for existing URLs in a user form field and need a little guidance. I am a placement student and told the place I'm working for I'm not great with PHP and here I am working with PHP. This is looking like the best I've tried thus far: $file = [url]; $file_headers = @get_headers($file); if($file_head... | You should use CURL to test the existing url. From How can one check to see if a remote file exists using PHP?: $ch = curl_init($_POST[url]);
curl_setopt($ch, CURLOPT_NOBODY, true); curl_exec($ch); $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); // $retcode > 400 -> not found, $retcode = 200, found. curl_close($ch);... | Checking for existing URLs before being added to database I'm trying to test if for existing URLs in a user form field and need a little guidance. I am a placement student and told the place I'm working for I'm not great with PHP and here I am working with PHP. This is looking like the best I've tried thus far: $file =... | TITLE:
Checking for existing URLs before being added to database
QUESTION:
I'm trying to test if for existing URLs in a user form field and need a little guidance. I am a placement student and told the place I'm working for I'm not great with PHP and here I am working with PHP. This is looking like the best I've tried... | [
"php",
"url"
] | 1 | 0 | 257 | 4 | 0 | 2011-06-01T13:53:43.880000 | 2011-06-01T13:57:09.003000 |
6,202,299 | 6,202,697 | How to get combo-box display values using the Data field? | I have set the combo-box data to "first;second;third" in the resource editor, but when I compile the program, the combo-box is totally empty, I can't see there any items at all. Also, how do I set which item is selected by default? And how do I change the currently selected item programmatically? | Checkout this tutorial on Win32 Combo boxes: Introduction to Combo Boxes If you are using MFC CComboBox class then you need to use the methods AddString() or InsertString() to add elements in the combo box list. | How to get combo-box display values using the Data field? I have set the combo-box data to "first;second;third" in the resource editor, but when I compile the program, the combo-box is totally empty, I can't see there any items at all. Also, how do I set which item is selected by default? And how do I change the curren... | TITLE:
How to get combo-box display values using the Data field?
QUESTION:
I have set the combo-box data to "first;second;third" in the resource editor, but when I compile the program, the combo-box is totally empty, I can't see there any items at all. Also, how do I set which item is selected by default? And how do I... | [
"c++",
"winapi",
"visual-studio-2008",
"combobox"
] | 2 | 0 | 8,621 | 4 | 0 | 2011-06-01T13:53:54.413000 | 2011-06-01T14:21:18.550000 |
6,202,310 | 6,202,466 | Putty Shift arrows | I want to make Putty recognize shift arrow sequences as i know for example ^[[A means up and ^[[1;2A is shift+up I've modified putty source code as following if (shift_state == 1) if (app_flg) p += sprintf((char *) p, "\x1BO1;2%c", xkey); else p += sprintf((char *) p, "\x1B[1;2%c", xkey); else if (app_flg) p += sprintf... | I've added emacs as a tag as my opinion is that the problem is in emacs not recognizing your escape sequence and not in your modification of putty. Could you try with (define-key input-decode-map "\e[1;2A" [S-up]) in your.emacs, relaunch emacs, press shift up and then CTRL-H L. Emacs should then show you how it interpr... | Putty Shift arrows I want to make Putty recognize shift arrow sequences as i know for example ^[[A means up and ^[[1;2A is shift+up I've modified putty source code as following if (shift_state == 1) if (app_flg) p += sprintf((char *) p, "\x1BO1;2%c", xkey); else p += sprintf((char *) p, "\x1B[1;2%c", xkey); else if (ap... | TITLE:
Putty Shift arrows
QUESTION:
I want to make Putty recognize shift arrow sequences as i know for example ^[[A means up and ^[[1;2A is shift+up I've modified putty source code as following if (shift_state == 1) if (app_flg) p += sprintf((char *) p, "\x1BO1;2%c", xkey); else p += sprintf((char *) p, "\x1B[1;2%c", ... | [
"c",
"emacs",
"keyboard",
"terminal",
"putty"
] | 4 | 1 | 4,891 | 2 | 0 | 2011-06-01T13:54:22.787000 | 2011-06-01T14:04:10.667000 |
6,202,323 | 6,202,490 | Change rectangle background on mouse hover | So I have a rectangle with no background and I want to give it a background gradient when the user hovers their mouse over it, and then remove the gradient when the mouse leaves the rectangle. Please can someone post the code that is needed for this, and tell me where to put it in the.cs/xaml file? Thanks. | This: (Note that if you set Fill="Transparent" on the Rectangle itself the Trigger will not work because of dependency property value precedence ) | Change rectangle background on mouse hover So I have a rectangle with no background and I want to give it a background gradient when the user hovers their mouse over it, and then remove the gradient when the mouse leaves the rectangle. Please can someone post the code that is needed for this, and tell me where to put i... | TITLE:
Change rectangle background on mouse hover
QUESTION:
So I have a rectangle with no background and I want to give it a background gradient when the user hovers their mouse over it, and then remove the gradient when the mouse leaves the rectangle. Please can someone post the code that is needed for this, and tell... | [
"c#",
"wpf"
] | 5 | 11 | 15,902 | 5 | 0 | 2011-06-01T13:54:59.770000 | 2011-06-01T14:05:29.263000 |
6,202,325 | 6,202,366 | App.Exit does not exit immediately? | I assumed that Application.Exit causes app to exit imemdiately but I can see that according to example below, it will exit after the for cycle ends. Also when this command will force the app to exit? for (int I = 0; I < 1000; I++) { if (I == 1) Application.Exit(); } | Application.Exit() will cause the application to exit once it returns to the underlying message pump. If you're running code in the UI thread, this won't be until you return from whatever UI method you're in (such as a button click handler.) | App.Exit does not exit immediately? I assumed that Application.Exit causes app to exit imemdiately but I can see that according to example below, it will exit after the for cycle ends. Also when this command will force the app to exit? for (int I = 0; I < 1000; I++) { if (I == 1) Application.Exit(); } | TITLE:
App.Exit does not exit immediately?
QUESTION:
I assumed that Application.Exit causes app to exit imemdiately but I can see that according to example below, it will exit after the for cycle ends. Also when this command will force the app to exit? for (int I = 0; I < 1000; I++) { if (I == 1) Application.Exit(); }... | [
"c#",
"winforms",
"loops",
"exit"
] | 8 | 6 | 2,697 | 5 | 0 | 2011-06-01T13:55:00.013000 | 2011-06-01T13:57:35.993000 |
6,202,336 | 6,202,382 | Delete HTML Table and paste it in another portion of the webpage, Is this possible using JQuery? | I have a HTML table in a page I want to automatically on page load: DELETE the HTML TABLE TAG from one location in a webpage Paste it at another location below this SPAN tag test Is this possible in Jquery? | You just need to append it. First, give the span an ID: test Then use the following jQuery snippet: $('#afterMe').after($('#options_table')); Here is a simple example: http://jsfiddle.net/vAewz/ jQuery will automatically move the node. No need to call.detach(). | Delete HTML Table and paste it in another portion of the webpage, Is this possible using JQuery? I have a HTML table in a page I want to automatically on page load: DELETE the HTML TABLE TAG from one location in a webpage Paste it at another location below this SPAN tag test Is this possible in Jquery? | TITLE:
Delete HTML Table and paste it in another portion of the webpage, Is this possible using JQuery?
QUESTION:
I have a HTML table in a page I want to automatically on page load: DELETE the HTML TABLE TAG from one location in a webpage Paste it at another location below this SPAN tag test Is this possible in Jquery... | [
"javascript",
"jquery",
"html-table"
] | 1 | 2 | 134 | 5 | 0 | 2011-06-01T13:55:41.470000 | 2011-06-01T13:58:48.533000 |
6,202,351 | 6,202,387 | is there a simple way to check if given selector string point to only one element? | example $('div.mydiv').checkifonlyone().css('background-color', 'red'); or maybe $('div.mydiv').filter(':checkifonlyone').css('background-color', 'red'); I expect that there is only one div with that class in document, otherwise an error msg should be displayed and script should cease to execute? | Could either look like: $('div.mydiv:eq(0)').css('background-color', 'red'); That one would always select the first element if there are multiple. or var $mydiv = $('div.mydiv'); if($mydiv.length === 1) { $mydiv.css('background-color', 'red'); } Which infact only would change the background color if there is exactly on... | is there a simple way to check if given selector string point to only one element? example $('div.mydiv').checkifonlyone().css('background-color', 'red'); or maybe $('div.mydiv').filter(':checkifonlyone').css('background-color', 'red'); I expect that there is only one div with that class in document, otherwise an error... | TITLE:
is there a simple way to check if given selector string point to only one element?
QUESTION:
example $('div.mydiv').checkifonlyone().css('background-color', 'red'); or maybe $('div.mydiv').filter(':checkifonlyone').css('background-color', 'red'); I expect that there is only one div with that class in document, ... | [
"javascript",
"jquery"
] | 1 | 1 | 72 | 6 | 0 | 2011-06-01T13:56:31.023000 | 2011-06-01T13:59:00.370000 |
6,202,356 | 6,202,407 | Setting up a new separate navigationcontroller in my app? | My app runs using a navigationcontroller, but there's a button on the home screen which will take the user to a preferences viewcontroller. I want the preferences to open and use it's own navigation controller, so there won't be a 'back' style button and it'll slide up from the bottom (like a modalviewcontroller). How ... | You should be able to create your navigation controller and present it modally - this post is mostly what you might do first. Remember to account for dismissing the modal view controller with say a Close or Done button in the navigation bar. | Setting up a new separate navigationcontroller in my app? My app runs using a navigationcontroller, but there's a button on the home screen which will take the user to a preferences viewcontroller. I want the preferences to open and use it's own navigation controller, so there won't be a 'back' style button and it'll s... | TITLE:
Setting up a new separate navigationcontroller in my app?
QUESTION:
My app runs using a navigationcontroller, but there's a button on the home screen which will take the user to a preferences viewcontroller. I want the preferences to open and use it's own navigation controller, so there won't be a 'back' style ... | [
"iphone",
"objective-c"
] | 0 | 1 | 56 | 1 | 0 | 2011-06-01T13:56:40.540000 | 2011-06-01T14:00:16.470000 |
6,202,358 | 6,202,767 | WCF data contracts with base class and derived classes - what are the consequences of changes to the base class? | As I understand it you should use the Order property of the DataMember attribute so that you can add things to the data contract without the change in order causing things to break, but how should you approach this when you have base and sub types? If I have datacontracts such as this: [DataContract] [KnownType(typeof(... | This is a breaking change. When adding new members to base classes WCF data contract serialization rules always serialize all members from the base class before any of the subclass' members. You can read more about those rules in this MSDN page titled Data Member Order. | WCF data contracts with base class and derived classes - what are the consequences of changes to the base class? As I understand it you should use the Order property of the DataMember attribute so that you can add things to the data contract without the change in order causing things to break, but how should you approa... | TITLE:
WCF data contracts with base class and derived classes - what are the consequences of changes to the base class?
QUESTION:
As I understand it you should use the Order property of the DataMember attribute so that you can add things to the data contract without the change in order causing things to break, but how... | [
"wcf",
"datacontract"
] | 6 | 5 | 4,640 | 1 | 0 | 2011-06-01T13:56:45.563000 | 2011-06-01T14:25:14.627000 |
6,202,367 | 6,202,406 | Strange character result in xml by java code | I generate the XML by reading the text form.txt file. But I got strange character results. I want to see my text in xml same as it is shown in.txt file. here is my text from.txt file žena muškarac devojčica dečak automobil autobus drvo kuća avion mačka pas cvet and here is my xml strange result. žena muÅ¡karac devo... | You need to provide the correct Charset/Encoding when using the InputStreamReader. Try this:... new InputStreamReader(in, "UTF-8"); | Strange character result in xml by java code I generate the XML by reading the text form.txt file. But I got strange character results. I want to see my text in xml same as it is shown in.txt file. here is my text from.txt file žena muškarac devojčica dečak automobil autobus drvo kuća avion mačka pas cvet and here is m... | TITLE:
Strange character result in xml by java code
QUESTION:
I generate the XML by reading the text form.txt file. But I got strange character results. I want to see my text in xml same as it is shown in.txt file. here is my text from.txt file žena muškarac devojčica dečak automobil autobus drvo kuća avion mačka pas ... | [
"java",
"xml",
"encoding",
"utf-8"
] | 2 | 4 | 1,160 | 3 | 0 | 2011-06-01T13:57:41.880000 | 2011-06-01T14:00:16.470000 |
6,202,381 | 6,202,415 | jQuery search each table row for a particular td | Consider there's a table with rows to which a td with class x is added by jQuery on the fly (during DOM manipulation). Later when the user submit's this table (table being part of a form), i want to search all the rows for existence of this particular td. If this td is found then the function should return false, else ... | function validate() { return ($('form#newuser table tr td.x').length == 0); }; $( ).length returns the number of DOM elements matched by the. | jQuery search each table row for a particular td Consider there's a table with rows to which a td with class x is added by jQuery on the fly (during DOM manipulation). Later when the user submit's this table (table being part of a form), i want to search all the rows for existence of this particular td. If this td is f... | TITLE:
jQuery search each table row for a particular td
QUESTION:
Consider there's a table with rows to which a td with class x is added by jQuery on the fly (during DOM manipulation). Later when the user submit's this table (table being part of a form), i want to search all the rows for existence of this particular t... | [
"javascript",
"jquery"
] | 1 | 6 | 971 | 3 | 0 | 2011-06-01T13:58:48.073000 | 2011-06-01T14:00:55.897000 |
6,202,384 | 6,202,716 | uiactivityindicator when page is loading | How can I show an uiactivityindicator when I click a cell in my tableview as sometimes it takes a few moments for it to get pushed to the next view since it's getting information from the internet. I have successfully done it for my uiwebview but just stuck on this. Thanks. | -(void)viewDidLoad { webPage.self = delegate; indicator.hidesWhenStopped = TRUE; } –(void)webViewDidStartLoad:(UIWebView *)webView { [indicator startAnimating]; } –(void)webViewDidFinishLoad:(UIWebView *)webView { [indicator stopAnimating]; } | uiactivityindicator when page is loading How can I show an uiactivityindicator when I click a cell in my tableview as sometimes it takes a few moments for it to get pushed to the next view since it's getting information from the internet. I have successfully done it for my uiwebview but just stuck on this. Thanks. | TITLE:
uiactivityindicator when page is loading
QUESTION:
How can I show an uiactivityindicator when I click a cell in my tableview as sometimes it takes a few moments for it to get pushed to the next view since it's getting information from the internet. I have successfully done it for my uiwebview but just stuck on ... | [
"iphone",
"ios",
"uitableview",
"uiactivityindicatorview"
] | 0 | 1 | 598 | 4 | 0 | 2011-06-01T13:58:53.330000 | 2011-06-01T14:22:29.170000 |
6,202,392 | 6,202,472 | IE 7 Float drop bug | I've had this problem numerous times with even the simplest layouts. It seems that every floated element on my site (in IE 7, IE 8 is fine) drops progressively further down. Bug: http://img232.imageshack.us/img232/4239/floatdrop.jpg Basically all I have is a list with 3 items inside an unordered list. (as seen in the s... | Attached screenshot is rendered properly. Since the LI s are not floated, they default to 100% width. Floating the LI s rather than the A s should solve the problem. | IE 7 Float drop bug I've had this problem numerous times with even the simplest layouts. It seems that every floated element on my site (in IE 7, IE 8 is fine) drops progressively further down. Bug: http://img232.imageshack.us/img232/4239/floatdrop.jpg Basically all I have is a list with 3 items inside an unordered lis... | TITLE:
IE 7 Float drop bug
QUESTION:
I've had this problem numerous times with even the simplest layouts. It seems that every floated element on my site (in IE 7, IE 8 is fine) drops progressively further down. Bug: http://img232.imageshack.us/img232/4239/floatdrop.jpg Basically all I have is a list with 3 items insid... | [
"internet-explorer-7",
"css-float"
] | 0 | 0 | 738 | 2 | 0 | 2011-06-01T13:59:13.677000 | 2011-06-01T14:04:22.337000 |
6,202,396 | 6,202,875 | Using is_dst in mktime() in PHP 5.3 (parameter is deprecated) | From 5.3 the is_dst parameter is deprecated in mktime. But I need two previous time in timestamp, one of them with dst and the other without that. E.g.: first time mktime("03","15","00","08","08","2008",1) and the other mktime("03","15","00","08","08","2008",0) Can you help me to solve that problem? | Not a full answer, just some ideas I could think of... The DateTime::format() method accepts a format code that tells whether DST is on effect: $now = new DateTime; $is_dst = $now->format('I')==1; Now, in order to know what time it'd be if DST was the other way round, you have to find out when such change happens. This... | Using is_dst in mktime() in PHP 5.3 (parameter is deprecated) From 5.3 the is_dst parameter is deprecated in mktime. But I need two previous time in timestamp, one of them with dst and the other without that. E.g.: first time mktime("03","15","00","08","08","2008",1) and the other mktime("03","15","00","08","08","2008"... | TITLE:
Using is_dst in mktime() in PHP 5.3 (parameter is deprecated)
QUESTION:
From 5.3 the is_dst parameter is deprecated in mktime. But I need two previous time in timestamp, one of them with dst and the other without that. E.g.: first time mktime("03","15","00","08","08","2008",1) and the other mktime("03","15","00... | [
"php",
"date",
"time",
"dst",
"mktime"
] | 1 | 0 | 5,446 | 2 | 0 | 2011-06-01T13:59:30.840000 | 2011-06-01T14:33:02.573000 |
6,202,397 | 6,204,073 | Authentication to display my Wall on my website | I'm trying to get a JSON object of my Facebook wall posts to display on my website but it seems to be ridiculously complicated for such a simple task. Do I need to implement server-side redirects and then post data back 'pretending' to be a user just so that I can get a token or am I misunderstanding something here?! H... | First, you need to get an access token (there is no getting around this). This is done via an OAuth Dialog where the user signs-in and provides the required permission. You will have to request the "offline_access" and "read_stream" permissions to do what you are trying to. Getting the access_token is pretty simple. Fo... | Authentication to display my Wall on my website I'm trying to get a JSON object of my Facebook wall posts to display on my website but it seems to be ridiculously complicated for such a simple task. Do I need to implement server-side redirects and then post data back 'pretending' to be a user just so that I can get a t... | TITLE:
Authentication to display my Wall on my website
QUESTION:
I'm trying to get a JSON object of my Facebook wall posts to display on my website but it seems to be ridiculously complicated for such a simple task. Do I need to implement server-side redirects and then post data back 'pretending' to be a user just so ... | [
"asp.net",
"facebook",
"facebook-c#-sdk"
] | 0 | 4 | 3,707 | 1 | 0 | 2011-06-01T13:59:39.753000 | 2011-06-01T15:55:49.890000 |
6,202,398 | 6,202,429 | jquery plugin with tons of html | I'm working on a jQuery project right now that will essentially dump a bunch of HTML on someone's page when they incorporate our plugin. This little widget has a decent amount of HTML. So, is it best to put 150+ lines of HTML inside the plugin itself? I had a thought that was basically "have the plugin use jQuery's aja... | If you need flexibility in your plugin, you should pull the HTML separately, as this will allow you to easily change out the text, and use the same plugin for different purposes. If the text will never change, or changes infrequently, you might as well leave it in the plugin. | jquery plugin with tons of html I'm working on a jQuery project right now that will essentially dump a bunch of HTML on someone's page when they incorporate our plugin. This little widget has a decent amount of HTML. So, is it best to put 150+ lines of HTML inside the plugin itself? I had a thought that was basically "... | TITLE:
jquery plugin with tons of html
QUESTION:
I'm working on a jQuery project right now that will essentially dump a bunch of HTML on someone's page when they incorporate our plugin. This little widget has a decent amount of HTML. So, is it best to put 150+ lines of HTML inside the plugin itself? I had a thought th... | [
"jquery",
"html",
"ajax",
"plugins"
] | 1 | 1 | 74 | 3 | 0 | 2011-06-01T13:59:41.140000 | 2011-06-01T14:01:49.773000 |
6,202,418 | 6,202,848 | capture navigation events from WebView | I have a webview that has some custom HTML loaded into it. In this HTML there is a link to an image. Right now when the user clicks the link, it automatically opens the image in the default android browser. I would instead like to capture that click event and open the URL in my own view as to preserve branding within t... | Create a subclass of WebViewClient and override shouldOverrideUrlLoading(). Then, attach an instance of that class to your WebView via setWebViewClient(). This works for simple hyperlinks and server-issued redirects. | capture navigation events from WebView I have a webview that has some custom HTML loaded into it. In this HTML there is a link to an image. Right now when the user clicks the link, it automatically opens the image in the default android browser. I would instead like to capture that click event and open the URL in my ow... | TITLE:
capture navigation events from WebView
QUESTION:
I have a webview that has some custom HTML loaded into it. In this HTML there is a link to an image. Right now when the user clicks the link, it automatically opens the image in the default android browser. I would instead like to capture that click event and ope... | [
"android",
"webview"
] | 2 | 4 | 1,701 | 1 | 0 | 2011-06-01T14:00:58.897000 | 2011-06-01T14:31:08.917000 |
6,202,419 | 6,202,773 | how to make the app running well | i have some UIViews,and there are some buttons on the first UIView,the click function of them likes this -(IBAction)securityClicked:(id)sender {
SwitchViewController* switchViewController = (SwitchViewController*)[wangfan_chevyAppDelegate App].viewController; [switchViewController.wtccviewcontroller.scrollView1 setCon... | First of all, if you call [alloc] you create an object (for each controller) then you must release it. You can do this after adding the subview since this retains it. I see you commented out the [controller release] some times and then totally forgot about it. Also you're adding a lot of controllers here. You could add... | how to make the app running well i have some UIViews,and there are some buttons on the first UIView,the click function of them likes this -(IBAction)securityClicked:(id)sender {
SwitchViewController* switchViewController = (SwitchViewController*)[wangfan_chevyAppDelegate App].viewController; [switchViewController.wtcc... | TITLE:
how to make the app running well
QUESTION:
i have some UIViews,and there are some buttons on the first UIView,the click function of them likes this -(IBAction)securityClicked:(id)sender {
SwitchViewController* switchViewController = (SwitchViewController*)[wangfan_chevyAppDelegate App].viewController; [switchV... | [
"iphone",
"uiview",
"uiviewcontroller"
] | 0 | 1 | 185 | 2 | 0 | 2011-06-01T14:00:59.690000 | 2011-06-01T14:26:07.317000 |
6,202,445 | 6,202,630 | Android: TextView margin bottom | I have an image with a square... In layout I want to set text inside square, so I set property margin bottom 100dp to 'TextView' and in HDPI phone my text is in square. That's cool. But when I run my app on MDPI device Text looks a little bit higher then it should be. And its understandable, because MDPI and HDPI has d... | Why don't you just wrap the image and the text inside a FrameLayout, and give the TextView a layout_gravity="center" attribute? With your current method, different aspect ratios will give you different positioning. | Android: TextView margin bottom I have an image with a square... In layout I want to set text inside square, so I set property margin bottom 100dp to 'TextView' and in HDPI phone my text is in square. That's cool. But when I run my app on MDPI device Text looks a little bit higher then it should be. And its understanda... | TITLE:
Android: TextView margin bottom
QUESTION:
I have an image with a square... In layout I want to set text inside square, so I set property margin bottom 100dp to 'TextView' and in HDPI phone my text is in square. That's cool. But when I run my app on MDPI device Text looks a little bit higher then it should be. A... | [
"android"
] | 0 | 1 | 2,237 | 2 | 0 | 2011-06-01T14:02:47.717000 | 2011-06-01T14:15:40.617000 |
6,202,446 | 6,202,481 | Does twill run javascript correctly/at all? | If I run a twill script to download a web page, will the twill script run any javascript (inline or otherwise) on the page? Will it do it correctly? The official twill site doesn't seem to indicate whether or not twill supports js (which makes me guess that it doesn't) | From the twill website: twill strives to be a complete implementation of a Web browser, omitting only JavaScript support. (that's the very first sentence in the page I linked above) So I guess the answer to your question is "no, it doesn't". If that's a problem for you, have you considered using an automated testing pl... | Does twill run javascript correctly/at all? If I run a twill script to download a web page, will the twill script run any javascript (inline or otherwise) on the page? Will it do it correctly? The official twill site doesn't seem to indicate whether or not twill supports js (which makes me guess that it doesn't) | TITLE:
Does twill run javascript correctly/at all?
QUESTION:
If I run a twill script to download a web page, will the twill script run any javascript (inline or otherwise) on the page? Will it do it correctly? The official twill site doesn't seem to indicate whether or not twill supports js (which makes me guess that ... | [
"javascript",
"http",
"twill"
] | 1 | 3 | 2,093 | 1 | 0 | 2011-06-01T14:02:56.547000 | 2011-06-01T14:04:59.583000 |
6,202,454 | 6,206,705 | Operation now in progress error on connect( function) error | I want to set timeout value of function connect but I get this error: "Operation now in progress" My code: if ((he = gethostbyname(authdefhost)) == NULL) { snprintf(errbuf, CERRBUFSIZ - 1, "cannot resolve %s: %s\n", authdefhost, hstrerror(h_errno)); return -1; }
sin.sin_family = AF_INET; memcpy(&sin.sin_addr, he->h_ad... | When you call connect() on a non-blocking socket, you'll get EINPROGRESS instead of blocking waiting for the connection handshake to complete. Then, you have to select() for writability, and check the socket error to see if the connection has completed. From Linux's connect() manpage: EINPROGRESS
The socket is nonbloc... | Operation now in progress error on connect( function) error I want to set timeout value of function connect but I get this error: "Operation now in progress" My code: if ((he = gethostbyname(authdefhost)) == NULL) { snprintf(errbuf, CERRBUFSIZ - 1, "cannot resolve %s: %s\n", authdefhost, hstrerror(h_errno)); return -1;... | TITLE:
Operation now in progress error on connect( function) error
QUESTION:
I want to set timeout value of function connect but I get this error: "Operation now in progress" My code: if ((he = gethostbyname(authdefhost)) == NULL) { snprintf(errbuf, CERRBUFSIZ - 1, "cannot resolve %s: %s\n", authdefhost, hstrerror(h_e... | [
"c",
"sockets",
"network-programming"
] | 25 | 43 | 63,059 | 1 | 0 | 2011-06-01T14:03:28.693000 | 2011-06-01T19:40:39.983000 |
6,202,459 | 6,203,174 | CustomTaskPanes explanation required | It seems, custom task panes are shared among all workbooks within Excel process, as CustomTaskPanes property is on the add-in object level and thus it's shared among all workbooks. (am I right?) I need to show different contents in the task pane for different workbooks, how can I achieve that? | You are right, custom task panes are registered at an application level. Out of the box you must use the Ribbon Designer, it doesnt matter if you don't create a ribbon, but it is the best way to achieve what you want. In the loaded event of the ribbon, you need to access Globals.ThisAddin.CustomTaskPanes to register yo... | CustomTaskPanes explanation required It seems, custom task panes are shared among all workbooks within Excel process, as CustomTaskPanes property is on the add-in object level and thus it's shared among all workbooks. (am I right?) I need to show different contents in the task pane for different workbooks, how can I ac... | TITLE:
CustomTaskPanes explanation required
QUESTION:
It seems, custom task panes are shared among all workbooks within Excel process, as CustomTaskPanes property is on the add-in object level and thus it's shared among all workbooks. (am I right?) I need to show different contents in the task pane for different workb... | [
"excel",
"vsto"
] | 0 | 1 | 268 | 2 | 0 | 2011-06-01T14:03:59.553000 | 2011-06-01T14:53:08.797000 |
6,202,462 | 6,204,521 | viper-mode changes <delete> key | I want to use the key (C-d, I think) for forward-deletion in viper-mode. Before starting viper-mode, works correctly. In viper-mode, jumps to the buffer's last line. I have added (setq viper-ex-style-editing nil) to.viper and works in all modes. | Try this: (define-key viper-vi-basic-map "\C-d" 'viper-delete-char) (define-key viper-insert-basic-map "\C-d" 'viper-delete-char) Now, that uses the viper-delete-char command to be consistent with viper. If you want the regular emacs deletion behavior, use delete-char instead. viper is implemented using a bunch of diff... | viper-mode changes <delete> key I want to use the key (C-d, I think) for forward-deletion in viper-mode. Before starting viper-mode, works correctly. In viper-mode, jumps to the buffer's last line. I have added (setq viper-ex-style-editing nil) to.viper and works in all modes. | TITLE:
viper-mode changes <delete> key
QUESTION:
I want to use the key (C-d, I think) for forward-deletion in viper-mode. Before starting viper-mode, works correctly. In viper-mode, jumps to the buffer's last line. I have added (setq viper-ex-style-editing nil) to.viper and works in all modes.
ANSWER:
Try this: (defi... | [
"emacs",
"viper",
"viper-mode"
] | 0 | 2 | 355 | 3 | 0 | 2011-06-01T14:04:03.827000 | 2011-06-01T16:26:21.160000 |
6,202,470 | 6,202,509 | Set » HTML entity in JavaScript's document.title? | I'm setting document.title with JavaScript, and I can't find a way to supply » ( » ) without it appearing as literal text. Here's my code: document.title = 'Home » site.com'; If I use »; in the title tag of the document it works great and displays correctly as », but it seems to be unescaping when I include it in docum... | Try document.title = 'Home \u00bb site.com'; Generally you can look up your special character at a site like this and then, once you know the numeric code, you can construct a Unicode escape sequence in your JavaScript string. Here, that character is code 187, which is "bb" in hex. JavaScript Unicode escapes look like ... | Set » HTML entity in JavaScript's document.title? I'm setting document.title with JavaScript, and I can't find a way to supply » ( » ) without it appearing as literal text. Here's my code: document.title = 'Home » site.com'; If I use »; in the title tag of the document it works great and displays correctly as », ... | TITLE:
Set » HTML entity in JavaScript's document.title?
QUESTION:
I'm setting document.title with JavaScript, and I can't find a way to supply » ( » ) without it appearing as literal text. Here's my code: document.title = 'Home » site.com'; If I use »; in the title tag of the document it works great and display... | [
"javascript",
"html",
"escaping"
] | 13 | 17 | 10,899 | 3 | 0 | 2011-06-01T14:04:19.090000 | 2011-06-01T14:07:03.600000 |
6,202,471 | 6,202,566 | DJango Passing in POST as a Context Argument | When making views in django, is it allowable to pass in POST data as context? That is: def view( request ): #view operations here #...
c = Context({ 'POST':request.POST, }) return render_to_response("/templatePath/", c, context_instance=RequestContext(request)) My goal is to maintain data in fields already filled with... | Although nothing is inherently bad about passing the request.POST variable to the template, everything you're trying to achieve is already handled by the stereotypical form view. If you go down your current path, you will end up with a buggy version of the recommended way to handle forms in Django. See using a form in ... | DJango Passing in POST as a Context Argument When making views in django, is it allowable to pass in POST data as context? That is: def view( request ): #view operations here #...
c = Context({ 'POST':request.POST, }) return render_to_response("/templatePath/", c, context_instance=RequestContext(request)) My goal is t... | TITLE:
DJango Passing in POST as a Context Argument
QUESTION:
When making views in django, is it allowable to pass in POST data as context? That is: def view( request ): #view operations here #...
c = Context({ 'POST':request.POST, }) return render_to_response("/templatePath/", c, context_instance=RequestContext(requ... | [
"django",
"post",
"django-context"
] | 0 | 4 | 2,532 | 1 | 0 | 2011-06-01T14:04:22.197000 | 2011-06-01T14:10:53.367000 |
6,202,477 | 6,202,675 | Dijkstra algorithm problem | How to apply Dijkstra algorithm for a graph to find the MST in such a way that the resulting tree must have an edge between two given vertices? (ex: MST must include an edge between X and Y) Thanks | Dijkstra's algorithm is for shortest paths (not MST), but something similar to Dijkstra's algorithm, as modified to find a minimum spanning tree, is called Prim's algorithm. Prim's algorithm keeps a tree that grows until it spans the entire graph. The additional constraint introduced here does not pose much difficulty:... | Dijkstra algorithm problem How to apply Dijkstra algorithm for a graph to find the MST in such a way that the resulting tree must have an edge between two given vertices? (ex: MST must include an edge between X and Y) Thanks | TITLE:
Dijkstra algorithm problem
QUESTION:
How to apply Dijkstra algorithm for a graph to find the MST in such a way that the resulting tree must have an edge between two given vertices? (ex: MST must include an edge between X and Y) Thanks
ANSWER:
Dijkstra's algorithm is for shortest paths (not MST), but something ... | [
"algorithm",
"dijkstra",
"greedy"
] | 1 | 5 | 762 | 1 | 0 | 2011-06-01T14:04:49.100000 | 2011-06-01T14:18:56.707000 |
6,202,478 | 6,202,522 | Is it possible to override print_r's behavior on an ArrayIterator object in PHP? | I've got a PHP class which extends ArrayIterator, and has all the necessary methods implemented so that it behaves like an array. This works fine for things like foreach loops, but calling print_r on it still prints out the object's variables, rather than printing it as it would an array. Is there some way of overridin... | No, because it is designed to give information about the variable (i.e. it is used for debugging) and not just to give some string representation of it. You can overwrite __toString though and use echo. | Is it possible to override print_r's behavior on an ArrayIterator object in PHP? I've got a PHP class which extends ArrayIterator, and has all the necessary methods implemented so that it behaves like an array. This works fine for things like foreach loops, but calling print_r on it still prints out the object's variab... | TITLE:
Is it possible to override print_r's behavior on an ArrayIterator object in PHP?
QUESTION:
I've got a PHP class which extends ArrayIterator, and has all the necessary methods implemented so that it behaves like an array. This works fine for things like foreach loops, but calling print_r on it still prints out t... | [
"php",
"arrays"
] | 3 | 7 | 2,679 | 4 | 0 | 2011-06-01T14:04:53.547000 | 2011-06-01T14:07:51.367000 |
6,202,486 | 6,202,511 | In JSF, Is there any benefit to splitting <h:form>s? | A general best-practices question. Say I have a search box and a web form on the same page. Is there any benefit to splitting the so they each get their own? Or put them all in the same? | Yes, definitely each form needs to go in its own. You're not interested in the data of the other form. This also saves bandwidth and improves speed. It would potentially unnecessarily trigger validators on the other form. This is bad for UX. Note that you cannot nest forms. This is disallowed as per HTML spec, so also ... | In JSF, Is there any benefit to splitting <h:form>s? A general best-practices question. Say I have a search box and a web form on the same page. Is there any benefit to splitting the so they each get their own? Or put them all in the same? | TITLE:
In JSF, Is there any benefit to splitting <h:form>s?
QUESTION:
A general best-practices question. Say I have a search box and a web form on the same page. Is there any benefit to splitting the so they each get their own? Or put them all in the same?
ANSWER:
Yes, definitely each form needs to go in its own. You... | [
"html",
"jsf"
] | 7 | 10 | 272 | 3 | 0 | 2011-06-01T14:05:13.183000 | 2011-06-01T14:07:11.423000 |
6,202,503 | 6,202,532 | What are Android dialog notifications? | I read an article that said there are 3 types of notification in Android: Toast notifications Status bar notifications Dialog notifications I know what status bar notification and toast notifications are, but I don't know about dialog notifications. Can anyone give me an example? | A dialog notification is: A dialog is usually a small window that appears in front of the current Activity. The underlying Activity loses focus and the dialog accepts all user interaction. Dialogs are normally used for notifications and short activities that directly relate to the application in progress. (See the link... | What are Android dialog notifications? I read an article that said there are 3 types of notification in Android: Toast notifications Status bar notifications Dialog notifications I know what status bar notification and toast notifications are, but I don't know about dialog notifications. Can anyone give me an example? | TITLE:
What are Android dialog notifications?
QUESTION:
I read an article that said there are 3 types of notification in Android: Toast notifications Status bar notifications Dialog notifications I know what status bar notification and toast notifications are, but I don't know about dialog notifications. Can anyone gi... | [
"android",
"dialog",
"notifications"
] | 0 | 2 | 4,865 | 1 | 0 | 2011-06-01T14:06:40.533000 | 2011-06-01T14:08:19.033000 |
6,202,508 | 6,202,694 | Need help with regular expression to transform code | I have an enormous list of the following items: _tags.Add(Foo.Bar, new Baz(... ));
_tagNames.Add("Bar", _tags[Foo.Bar]); where Bar and Baz(...) vary, and _tags, _tagNames and Foo stay the same. I want to transform to case "Bar": _tags.Add(Foo.Bar, new Baz(... ));
_tagNames.Add("Bar", _tags[Foo.Bar]);
break; I am usi... | Tested on VS 2008: _tags\.Add\((.|\n)@_tags\[Foo\.{(.@)}\]\); Whith this as replacement string: case "\1":\n\0\nbreak; You might have to insert some tab-characters to keep your indention (or use auto-format). UPDATE: Tested and fixed regex for usage in vs | Need help with regular expression to transform code I have an enormous list of the following items: _tags.Add(Foo.Bar, new Baz(... ));
_tagNames.Add("Bar", _tags[Foo.Bar]); where Bar and Baz(...) vary, and _tags, _tagNames and Foo stay the same. I want to transform to case "Bar": _tags.Add(Foo.Bar, new Baz(... ));
_t... | TITLE:
Need help with regular expression to transform code
QUESTION:
I have an enormous list of the following items: _tags.Add(Foo.Bar, new Baz(... ));
_tagNames.Add("Bar", _tags[Foo.Bar]); where Bar and Baz(...) vary, and _tags, _tagNames and Foo stay the same. I want to transform to case "Bar": _tags.Add(Foo.Bar, n... | [
"regex",
"visual-studio"
] | 1 | 1 | 55 | 1 | 0 | 2011-06-01T14:06:57.290000 | 2011-06-01T14:20:56.990000 |
6,202,519 | 6,202,562 | Help with SQL query using dates | I am a little rusty on my SQL and am having a little trouble with my SQL query. Here is my current query: SELECT DISTINCT restriction FROM restrictions WHERE id =? AND start_date BETWEEN TO_DATE(?, 'yyyy/mm/dd') and TO_DATE(?, 'yyyy/mm/dd'); The question marks are being set depending on a user defined parameter, but th... | SELECT DISTINCT restriction FROM restrictions WHERE id =? AND (start_date BETWEEN TO_DATE(?, 'yyyy/mm/dd') and TO_DATE(?, 'yyyy/mm/dd') OR start_date < TO_DATE(?, 'yyyy/mm/dd') and end_date is NULL); | Help with SQL query using dates I am a little rusty on my SQL and am having a little trouble with my SQL query. Here is my current query: SELECT DISTINCT restriction FROM restrictions WHERE id =? AND start_date BETWEEN TO_DATE(?, 'yyyy/mm/dd') and TO_DATE(?, 'yyyy/mm/dd'); The question marks are being set depending on ... | TITLE:
Help with SQL query using dates
QUESTION:
I am a little rusty on my SQL and am having a little trouble with my SQL query. Here is my current query: SELECT DISTINCT restriction FROM restrictions WHERE id =? AND start_date BETWEEN TO_DATE(?, 'yyyy/mm/dd') and TO_DATE(?, 'yyyy/mm/dd'); The question marks are being... | [
"sql"
] | 0 | 1 | 245 | 2 | 0 | 2011-06-01T14:07:48.717000 | 2011-06-01T14:10:30.167000 |
6,202,523 | 6,202,596 | Is list[i] an alias for list.get_item(i) in C#? | I'm passing a lambda expression as a parameter. In this case, someObject has a property called property accessible with someObject.property. When I pass: o => o.childListOfObjects[0].property, where childListOfObjects is a List and, expression.Body returns o => o.childListOfObjects.get_Item(0).property. Skip to the end... | Yes, properties in general are just syntactic sugar around get_PropertyName and set_PropertyName methods. Indexers -- for example, list[i] -- are just a special type of property, basically syntactic sugar around get_Item(i) and set_Item(i) methods. (Note that the indexer property doesn't necessarily have to be called I... | Is list[i] an alias for list.get_item(i) in C#? I'm passing a lambda expression as a parameter. In this case, someObject has a property called property accessible with someObject.property. When I pass: o => o.childListOfObjects[0].property, where childListOfObjects is a List and, expression.Body returns o => o.childLis... | TITLE:
Is list[i] an alias for list.get_item(i) in C#?
QUESTION:
I'm passing a lambda expression as a parameter. In this case, someObject has a property called property accessible with someObject.property. When I pass: o => o.childListOfObjects[0].property, where childListOfObjects is a List and, expression.Body retur... | [
"c#",
"list",
"lambda",
"alias"
] | 4 | 8 | 2,428 | 4 | 0 | 2011-06-01T14:07:54.183000 | 2011-06-01T14:13:03.993000 |
6,202,527 | 6,202,588 | How to rotate the image with two fingers and zoom in/out with pinch gesture in android? | Please provide any useful tutorial to handle image with multi-touch user interface to handle image rotation zoom in/out. I have already find out something but not so satisfactory. | I found this tutorial very useful, it does ZOOM & TRANSLATION but not ROTATE How to use MulltiTouch in Android I suspect you would have to calculate the ACTION_POINTER rotation when it moves & apply the same rotation to the transformation matrix. | How to rotate the image with two fingers and zoom in/out with pinch gesture in android? Please provide any useful tutorial to handle image with multi-touch user interface to handle image rotation zoom in/out. I have already find out something but not so satisfactory. | TITLE:
How to rotate the image with two fingers and zoom in/out with pinch gesture in android?
QUESTION:
Please provide any useful tutorial to handle image with multi-touch user interface to handle image rotation zoom in/out. I have already find out something but not so satisfactory.
ANSWER:
I found this tutorial ver... | [
"android",
"user-interface",
"gesture"
] | 3 | 1 | 4,990 | 2 | 0 | 2011-06-01T14:08:03.090000 | 2011-06-01T14:12:19.853000 |
6,202,530 | 6,202,584 | SQL: Is it possible to join on the same sub-select? | I'd like to know if it possible to join the same sub-select to itself within the same query without actually having to execute the query again? The following query is the actual obfuscated query I want to run select * from
(
-- Sub query A - same as sub query B select bc.service_type, bc.cid, min(bc.last_modified_dat... | Use a with statement: with bar as ( select * from foo where... ) select bar.* from bar join bar barian on... | SQL: Is it possible to join on the same sub-select? I'd like to know if it possible to join the same sub-select to itself within the same query without actually having to execute the query again? The following query is the actual obfuscated query I want to run select * from
(
-- Sub query A - same as sub query B sele... | TITLE:
SQL: Is it possible to join on the same sub-select?
QUESTION:
I'd like to know if it possible to join the same sub-select to itself within the same query without actually having to execute the query again? The following query is the actual obfuscated query I want to run select * from
(
-- Sub query A - same a... | [
"sql",
"oracle"
] | 1 | 10 | 167 | 3 | 0 | 2011-06-01T14:08:15.440000 | 2011-06-01T14:11:50.913000 |
6,202,547 | 6,202,623 | Win32 - Get Main Wnd Handle of application | I have injected my dll into process. How can I get Main window handle of host application? | The host application may have multiple 'main windows'. To detect them, you could Call GetCurrentProcessId to get the PID of the current process Call EnumWindows to iterate over all toplevel windows of the desktop For each window on the desktop, call GetWindowThreadProcessId to get the PID of the process which created t... | Win32 - Get Main Wnd Handle of application I have injected my dll into process. How can I get Main window handle of host application? | TITLE:
Win32 - Get Main Wnd Handle of application
QUESTION:
I have injected my dll into process. How can I get Main window handle of host application?
ANSWER:
The host application may have multiple 'main windows'. To detect them, you could Call GetCurrentProcessId to get the PID of the current process Call EnumWindow... | [
"c++",
"windows",
"winapi"
] | 11 | 37 | 25,743 | 2 | 0 | 2011-06-01T14:09:35.283000 | 2011-06-01T14:14:41.790000 |
6,202,549 | 6,203,000 | Word tokenization using python regular expressions | I am trying to split strings into lists of "tags" in python. The splitting should handle strings such as "HappyBirthday" and remove most punctuation but preserve hyphens, and apostrophes. My starting point is: tags = re.findall("([A-Z]{2,}(?=[A-Z]|$)|[A-Z][a-z]*)|\w+-\w+|[\w']+" I would want to turn this sample data: J... | I suggest the following: re.findall("[A-Z]{2,}(?![a-z])|[A-Z][a-z]+(?=[A-Z])|[\'\w\-]+",s) This yields for your example: ["Jeff's", 'dog', 'is', 'un-American', 'Some', 'Times', 'BUT', 'NOT', 'Always'] Explanation: The RegExp is made up of 3 alternatives: [A-Z]{2,}(?![a-z]) matches words with all letters capital [A-Z][a... | Word tokenization using python regular expressions I am trying to split strings into lists of "tags" in python. The splitting should handle strings such as "HappyBirthday" and remove most punctuation but preserve hyphens, and apostrophes. My starting point is: tags = re.findall("([A-Z]{2,}(?=[A-Z]|$)|[A-Z][a-z]*)|\w+-\... | TITLE:
Word tokenization using python regular expressions
QUESTION:
I am trying to split strings into lists of "tags" in python. The splitting should handle strings such as "HappyBirthday" and remove most punctuation but preserve hyphens, and apostrophes. My starting point is: tags = re.findall("([A-Z]{2,}(?=[A-Z]|$)|... | [
"python",
"regex",
"string",
"tags"
] | 15 | 24 | 21,701 | 2 | 0 | 2011-06-01T14:09:45.117000 | 2011-06-01T14:41:37.363000 |
6,202,560 | 6,202,732 | Avoid stretching photos | How can I avoid the stretching of my photos? PHP selects 2 photos at random from a folder and displays them using echo. But right now, all photos in portrait, are stretched. ";
unset($images[$rand_key]); $rand_key = array_rand($images, 1); $src = $images[$rand_key]; echo " "; } else { echo 'Error'; }?> And the CSS:.fl... | I'd just check if the orientation is protrait or not and add a css class; ";
unset($images[$rand_key]); $rand_key = array_rand($images, 1); $src = $images[$rand_key]; echo " "; } else { echo 'Error'; }?> and in your css somthing like this: img.flickrphoto { max-width: 100px; max-height: 100px; overflow: hidden; } img.... | Avoid stretching photos How can I avoid the stretching of my photos? PHP selects 2 photos at random from a folder and displays them using echo. But right now, all photos in portrait, are stretched. ";
unset($images[$rand_key]); $rand_key = array_rand($images, 1); $src = $images[$rand_key]; echo " "; } else { echo 'Err... | TITLE:
Avoid stretching photos
QUESTION:
How can I avoid the stretching of my photos? PHP selects 2 photos at random from a folder and displays them using echo. But right now, all photos in portrait, are stretched. ";
unset($images[$rand_key]); $rand_key = array_rand($images, 1); $src = $images[$rand_key]; echo " "; ... | [
"php",
"css",
"image",
"resize",
"stretch"
] | 2 | 5 | 980 | 4 | 0 | 2011-06-01T14:10:21.587000 | 2011-06-01T14:23:27.983000 |
6,202,563 | 6,202,883 | Would it be possible to change literals in the model below to reference values from an external file for localization or quick user changes? | Given users who change their minds a thousand times. How could I change the literals below to come from a config file or something similar? namespace mvc3test.Models {
public class ChangePasswordModel { [Required] [DataType(DataType.Password)] [Display(Name = "Current password")] public string OldPassword { get; set; ... | These attributes(eg DisplayAttribute ) have ResourceType and Name properties. These can be used with a Resource file to externalize the literals and thereby localizing and/or changing literals. Have a look at this example. | Would it be possible to change literals in the model below to reference values from an external file for localization or quick user changes? Given users who change their minds a thousand times. How could I change the literals below to come from a config file or something similar? namespace mvc3test.Models {
public cla... | TITLE:
Would it be possible to change literals in the model below to reference values from an external file for localization or quick user changes?
QUESTION:
Given users who change their minds a thousand times. How could I change the literals below to come from a config file or something similar? namespace mvc3test.Mo... | [
"asp.net-mvc"
] | 0 | 1 | 85 | 1 | 0 | 2011-06-01T14:10:42.977000 | 2011-06-01T14:33:29.823000 |
6,202,571 | 6,202,678 | Using SQL Server Temp tables | I am rewriting an Access application that uses a lot of Temp tables. Meaning the data gets added to the table, massaged, used for updates in other tables and then the data is deleted. I am trying to figure out when I move this to SQL server if it is better practice to use a similar process of a staging/temp table or a ... | This is one of those "it depends" situations. By and large, if there will be multiple users (or automated sources) concurrently running a process that uses a "temp table methodology", you are better off using temp tables, as then each instance will have its own unique set of (one or more) temp tables. However, if there... | Using SQL Server Temp tables I am rewriting an Access application that uses a lot of Temp tables. Meaning the data gets added to the table, massaged, used for updates in other tables and then the data is deleted. I am trying to figure out when I move this to SQL server if it is better practice to use a similar process ... | TITLE:
Using SQL Server Temp tables
QUESTION:
I am rewriting an Access application that uses a lot of Temp tables. Meaning the data gets added to the table, massaged, used for updates in other tables and then the data is deleted. I am trying to figure out when I move this to SQL server if it is better practice to use ... | [
"ms-access",
"sql-server-2005",
"temp-tables"
] | 0 | 1 | 283 | 1 | 0 | 2011-06-01T14:11:06.383000 | 2011-06-01T14:19:19.250000 |
6,202,573 | 6,202,985 | Performance issue with SQL Server query | This is my query: SELECT ID, [type], naam, adresl1, adresl2, tel, fax, email, contactpersoon FROM ------------------------ START -------------------------- (SELECT av.personID as [id], 'P' as [type], av.firstname + ' ' + av.lastname as 'naam', av.straat as 'adresl1', c.zipCode + ' ' + c.City as 'adresl2', av.phone as '... | Please remove the IN and replace it with join as mentioned below. In this way we can avoid the looping which is happening due to IN SELECT ID, [type], naam, adresl1, adresl2, tel, fax, email, contactpersoon FROM( ------------------------ START -------------------------- SELECT av.personID as [id], 'P' as [type], av.fir... | Performance issue with SQL Server query This is my query: SELECT ID, [type], naam, adresl1, adresl2, tel, fax, email, contactpersoon FROM ------------------------ START -------------------------- (SELECT av.personID as [id], 'P' as [type], av.firstname + ' ' + av.lastname as 'naam', av.straat as 'adresl1', c.zipCode + ... | TITLE:
Performance issue with SQL Server query
QUESTION:
This is my query: SELECT ID, [type], naam, adresl1, adresl2, tel, fax, email, contactpersoon FROM ------------------------ START -------------------------- (SELECT av.personID as [id], 'P' as [type], av.firstname + ' ' + av.lastname as 'naam', av.straat as 'adre... | [
"sql-server"
] | 1 | 3 | 178 | 4 | 0 | 2011-06-01T14:11:12.730000 | 2011-06-01T14:40:17.557000 |
6,202,574 | 6,202,629 | Are there any solutions for testing android applications other than using the default emulator? | Is there any other solution for testing android applications other than using that slow emulator which comes with the android SDK? I'm not interested in the testing service providers. | Perhaps the obvious one, but use an actual, physical device. It's a good idea anyway if you plan on releasing it to the public. But really - If you intend to make an app of any reasonable quality, you're going to need to test on a device. If you want to distribute it on a wide scale I would really opine that you should... | Are there any solutions for testing android applications other than using the default emulator? Is there any other solution for testing android applications other than using that slow emulator which comes with the android SDK? I'm not interested in the testing service providers. | TITLE:
Are there any solutions for testing android applications other than using the default emulator?
QUESTION:
Is there any other solution for testing android applications other than using that slow emulator which comes with the android SDK? I'm not interested in the testing service providers.
ANSWER:
Perhaps the o... | [
"android",
"testing",
"android-emulator",
"device"
] | 0 | 4 | 123 | 2 | 0 | 2011-06-01T14:11:16.587000 | 2011-06-01T14:15:20.090000 |
6,202,576 | 6,202,709 | Get all Work Days in a Week for a given date | So I have one date as a string: 2011/06/01 I need to get the 5 DateTime objects from it that correspond to the five weekdays (Monday to Friday) in that week, e.g. for the date above I need 2011-05-30 to 2011-06-03. How to do that? I know I can do: $dateTime = new DateTime('2011/06/01'); But I am kinda stuck there:) I k... | Can use DatePeriod: $firstMondayThisWeek= new DateTime('2011/06/01'); $firstMondayThisWeek->modify('tomorrow'); $firstMondayThisWeek->modify('last Monday');
$nextFiveWeekDays = new DatePeriod( $firstMondayThisWeek, DateInterval::createFromDateString('+1 weekdays'), 4 );
print_r(iterator_to_array($nextFiveWeekDays)); ... | Get all Work Days in a Week for a given date So I have one date as a string: 2011/06/01 I need to get the 5 DateTime objects from it that correspond to the five weekdays (Monday to Friday) in that week, e.g. for the date above I need 2011-05-30 to 2011-06-03. How to do that? I know I can do: $dateTime = new DateTime('2... | TITLE:
Get all Work Days in a Week for a given date
QUESTION:
So I have one date as a string: 2011/06/01 I need to get the 5 DateTime objects from it that correspond to the five weekdays (Monday to Friday) in that week, e.g. for the date above I need 2011-05-30 to 2011-06-03. How to do that? I know I can do: $dateTime... | [
"php",
"datetime"
] | 3 | 7 | 5,091 | 5 | 0 | 2011-06-01T14:11:18.317000 | 2011-06-01T14:22:09.450000 |
6,202,587 | 6,202,853 | Controlling motor which does not give serial commands in documentation | I am using a motor connected to a serial port (RS-232). I need to use it as part of an automation set-up in a lab. The motor was part of a larger set-up which can be purchased, and it is the only part of the set-up that I am using. The set-up came with a piece of GUI software used for analysis, I can use this applicati... | Rather than pulling apart the serial cable, is it possible that something like PORTMON would help. That is if you are working with a Windows application. This should show the SERIAL commands going back and forth and perhaps give you some insight in to how they are controlling the motor. | Controlling motor which does not give serial commands in documentation I am using a motor connected to a serial port (RS-232). I need to use it as part of an automation set-up in a lab. The motor was part of a larger set-up which can be purchased, and it is the only part of the set-up that I am using. The set-up came w... | TITLE:
Controlling motor which does not give serial commands in documentation
QUESTION:
I am using a motor connected to a serial port (RS-232). I need to use it as part of an automation set-up in a lab. The motor was part of a larger set-up which can be purchased, and it is the only part of the set-up that I am using.... | [
"c#",
".net",
"automation",
"serial-port"
] | 3 | 3 | 802 | 3 | 0 | 2011-06-01T14:12:16.860000 | 2011-06-01T14:31:26.480000 |
6,202,593 | 6,202,737 | How to draw a small image on Top of Larger Image by press and clear by Touch | Wanted to create a fun app with photo. This is the scenario: I have a photo of size 640X 480 in the page ( as the background) Display Thumbnail pn the left-side 100x100 This are the problems I wanted to solve: User select a Thumbnail photo 100x100 on the left-side User press or click any where in the large photo ( 640x... | a) The easy way would be to simply handle the thumbnail's ManipulationStarted method and set that thumbnail to be the current thumbnail. Also, handle the larger photo's ManipulationStarted method and check if a current thumbnail exists. If so, set the larger photo's image source to be that of the thumbnail stream. b) I... | How to draw a small image on Top of Larger Image by press and clear by Touch Wanted to create a fun app with photo. This is the scenario: I have a photo of size 640X 480 in the page ( as the background) Display Thumbnail pn the left-side 100x100 This are the problems I wanted to solve: User select a Thumbnail photo 100... | TITLE:
How to draw a small image on Top of Larger Image by press and clear by Touch
QUESTION:
Wanted to create a fun app with photo. This is the scenario: I have a photo of size 640X 480 in the page ( as the background) Display Thumbnail pn the left-side 100x100 This are the problems I wanted to solve: User select a T... | [
"windows-phone-7"
] | 1 | 1 | 740 | 1 | 0 | 2011-06-01T14:12:40.640000 | 2011-06-01T14:23:45.463000 |
6,202,607 | 6,202,790 | Extend mysqli with query logging, but don't lose insert_id | I have a class that extends mysqli so that queries are logged. Unfortunately, I can't figure out how not to lose the insert_id property. I'd like to be able to do this $sql = sprintf(" INSERT INTO picture SET nm_picture = '%s'
", Db::instance()->escape_string($_POST['nm_picture']) );
$result = Db::instance()->queri($... | You have two possibilities: Don't use an auto-increment in your activity log. There really is no need for it. There isn't even a need for a primary key in that table, cause what are you going to link it with? Insert the activity log before the actual query, wrap everything in a transaction and rollback when the query i... | Extend mysqli with query logging, but don't lose insert_id I have a class that extends mysqli so that queries are logged. Unfortunately, I can't figure out how not to lose the insert_id property. I'd like to be able to do this $sql = sprintf(" INSERT INTO picture SET nm_picture = '%s'
", Db::instance()->escape_string(... | TITLE:
Extend mysqli with query logging, but don't lose insert_id
QUESTION:
I have a class that extends mysqli so that queries are logged. Unfortunately, I can't figure out how not to lose the insert_id property. I'd like to be able to do this $sql = sprintf(" INSERT INTO picture SET nm_picture = '%s'
", Db::instance... | [
"php",
"mysqli",
"auto-increment"
] | 1 | 1 | 949 | 2 | 0 | 2011-06-01T14:13:29.690000 | 2011-06-01T14:27:26.583000 |
6,202,608 | 6,211,256 | How to define an optional entry point into custom Mac OS X framework / dynamic library? | In Windows there is a DllMain and DLL_PROCESS_ATTACH / DLL_PROCESS_DETACH flags, which allow to initialize / free resources after DLL is attached to a process... So how can I specify an entry point in case of OS X? As always, I can't find anything useful in Apple documentation:( | Wouldn't that work? __attribute__((constructor)) void DllMain() { // code } | How to define an optional entry point into custom Mac OS X framework / dynamic library? In Windows there is a DllMain and DLL_PROCESS_ATTACH / DLL_PROCESS_DETACH flags, which allow to initialize / free resources after DLL is attached to a process... So how can I specify an entry point in case of OS X? As always, I can'... | TITLE:
How to define an optional entry point into custom Mac OS X framework / dynamic library?
QUESTION:
In Windows there is a DllMain and DLL_PROCESS_ATTACH / DLL_PROCESS_DETACH flags, which allow to initialize / free resources after DLL is attached to a process... So how can I specify an entry point in case of OS X?... | [
"c++",
"macos",
"dll",
"frameworks",
"entry-point"
] | 6 | 4 | 3,505 | 4 | 0 | 2011-06-01T14:13:33.910000 | 2011-06-02T06:35:44.463000 |
6,202,616 | 6,203,792 | how to set pixels according to device in blackberry? | I have developed a blackberry application, but I have to one issue, that the images and output is different of different devices, like in 9000 bold it is perfect, but in blackberry curve 8520, it is enlarging, what should I do? | Different screens are different sizes with different resolutions. There are multiple things that you can do here: Create multiple projects/versions of your application, each one for a different screen resolution. Each project will have images of the appropriate size for the targeted resolution. In the res/ folder of yo... | how to set pixels according to device in blackberry? I have developed a blackberry application, but I have to one issue, that the images and output is different of different devices, like in 9000 bold it is perfect, but in blackberry curve 8520, it is enlarging, what should I do? | TITLE:
how to set pixels according to device in blackberry?
QUESTION:
I have developed a blackberry application, but I have to one issue, that the images and output is different of different devices, like in 9000 bold it is perfect, but in blackberry curve 8520, it is enlarging, what should I do?
ANSWER:
Different sc... | [
"blackberry",
"java-me"
] | 1 | 2 | 242 | 1 | 0 | 2011-06-01T14:14:10.883000 | 2011-06-01T15:33:47.857000 |
6,202,618 | 6,204,714 | Using Google Maps API to Estimate Future Trip Duration | Is it possible to ask Google Maps for an estimated travel time between two points at an arbitrary time in the future? I routinely use the Google Maps Navigation app on my Droid phone while driving, and it's amazingly useful, especially since it's aware of traffic delays. However, I'd like to get these notifications of ... | Doesn't look like it. The Google Maps API Direction class has a getDuration() method, which the number seconds of the trip duration. The GDirectionsOptions class doesn't include any temporal methods. It has things like specifying trip type (drive, walk, bus), 'avoid highways' flags, etc. Even if there were some way to ... | Using Google Maps API to Estimate Future Trip Duration Is it possible to ask Google Maps for an estimated travel time between two points at an arbitrary time in the future? I routinely use the Google Maps Navigation app on my Droid phone while driving, and it's amazingly useful, especially since it's aware of traffic d... | TITLE:
Using Google Maps API to Estimate Future Trip Duration
QUESTION:
Is it possible to ask Google Maps for an estimated travel time between two points at an arbitrary time in the future? I routinely use the Google Maps Navigation app on my Droid phone while driving, and it's amazingly useful, especially since it's ... | [
"javascript",
"google-maps"
] | 4 | 2 | 2,057 | 1 | 0 | 2011-06-01T14:14:13.447000 | 2011-06-01T16:41:57.073000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.