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,270,677
6,271,562
How to run sudo with Paramiko? (Python)
What I've tried: invoke_shell() then channel.send su and then sending the password resulted in not being root invoke_shell() and then channel.exec_command resulted in a "Channel Closed" error _transport.open_session() then channel.exec_command resulted in not being root invoke_shell() then writing to stdin and flushing...
check this example out: ssh.connect('127.0.0.1', username='jesse', password='lol') stdin, stdout, stderr = ssh.exec_command( "sudo dmesg") stdin.write('lol\n') stdin.flush() data = stdout.read.splitlines() for line in data: if line.split(':')[0] == 'AirPort': print line Example found here with more explanations: http:/...
How to run sudo with Paramiko? (Python) What I've tried: invoke_shell() then channel.send su and then sending the password resulted in not being root invoke_shell() and then channel.exec_command resulted in a "Channel Closed" error _transport.open_session() then channel.exec_command resulted in not being root invoke_sh...
TITLE: How to run sudo with Paramiko? (Python) QUESTION: What I've tried: invoke_shell() then channel.send su and then sending the password resulted in not being root invoke_shell() and then channel.exec_command resulted in a "Channel Closed" error _transport.open_session() then channel.exec_command resulted in not be...
[ "python", "ssh", "sudo", "paramiko" ]
19
27
67,078
8
0
2011-06-07T19:39:50.870000
2011-06-07T20:57:24.760000
6,270,679
6,270,743
Github .pdf diffs
In one of my GitHub repositories I have a.pdf file, which gets updated frequently. The problem is in the GitHub commits page, which shows the diff for this pdf. As pdfs are mostly binary the diff is long and so the page works very slowly and is useless for a quick peek as to what has changed between commits. Is there a...
Try adding this to your.gitattributes: *.pdf binary Then commit the attributes file.
Github .pdf diffs In one of my GitHub repositories I have a.pdf file, which gets updated frequently. The problem is in the GitHub commits page, which shows the diff for this pdf. As pdfs are mostly binary the diff is long and so the page works very slowly and is useless for a quick peek as to what has changed between c...
TITLE: Github .pdf diffs QUESTION: In one of my GitHub repositories I have a.pdf file, which gets updated frequently. The problem is in the GitHub commits page, which shows the diff for this pdf. As pdfs are mostly binary the diff is long and so the page works very slowly and is useless for a quick peek as to what has...
[ "git", "pdf", "github" ]
9
11
682
1
0
2011-06-07T19:39:55.300000
2011-06-07T19:45:48.323000
6,270,683
6,270,834
Does all POST data need to be sanitized?
I realize that user input POST data needs to be escaped, but what about non-user post data? I would believe that one could take a snapshot of a webpage and insert new malicious code into a form that would be submitted along with a $_POST that could potentially cause issues like if $_POST contained PHP code. Is this a c...
Does all POST data need to be sanitized? No. But all external data you use somewhere always needs to be sanitized, no matter whether it comes from a human being, a robot posing as one, or some other source. Before you inject a string into a SQL query, it needs to be escaped with the right function, or put into a parame...
Does all POST data need to be sanitized? I realize that user input POST data needs to be escaped, but what about non-user post data? I would believe that one could take a snapshot of a webpage and insert new malicious code into a form that would be submitted along with a $_POST that could potentially cause issues like ...
TITLE: Does all POST data need to be sanitized? QUESTION: I realize that user input POST data needs to be escaped, but what about non-user post data? I would believe that one could take a snapshot of a webpage and insert new malicious code into a form that would be submitted along with a $_POST that could potentially ...
[ "html", "post" ]
0
3
891
6
0
2011-06-07T19:40:21.640000
2011-06-07T19:52:17.307000
6,270,684
6,270,739
Slicing of python os.listdir()
Can I make a slicing in os.listdir()? To take only a number of elements.
I don't see why not: >>> os.listdir(os.getcwd()) ['CVS', 'library.bin', 'man', 'PyLpr-0.2a.zip', 'pylpr.exe', 'python26.dll', 'text'] >>> os.listdir(os.getcwd())[3:] ['PyLpr-0.2a.zip', 'pylpr.exe', 'python26.dll', 'text']
Slicing of python os.listdir() Can I make a slicing in os.listdir()? To take only a number of elements.
TITLE: Slicing of python os.listdir() QUESTION: Can I make a slicing in os.listdir()? To take only a number of elements. ANSWER: I don't see why not: >>> os.listdir(os.getcwd()) ['CVS', 'library.bin', 'man', 'PyLpr-0.2a.zip', 'pylpr.exe', 'python26.dll', 'text'] >>> os.listdir(os.getcwd())[3:] ['PyLpr-0.2a.zip', 'pyl...
[ "python", "slice" ]
0
3
1,954
2
0
2011-06-07T19:40:29.700000
2011-06-07T19:45:15.393000
6,270,690
6,270,708
non-static method cannot be referenced in static context
I researched this around and still can't seem to solve this problem. I have the following in my program: public void InsertDB(double price, double shares, String ticker, int id)throws Exception { //do some stuff } I tried the following within my main class(and got the above error non-static method cannot be referenced ...
You need to instantiate the class itself, not the method InsertDB(). You instantiate a class by using the key word new. You can refer to the official tutorial on the oracle/sun docs. Example: Testingground myObject = new Testingground(); myObject.InsertDB(constants[i], variables[i], ticker[i], count); Methods can also ...
non-static method cannot be referenced in static context I researched this around and still can't seem to solve this problem. I have the following in my program: public void InsertDB(double price, double shares, String ticker, int id)throws Exception { //do some stuff } I tried the following within my main class(and go...
TITLE: non-static method cannot be referenced in static context QUESTION: I researched this around and still can't seem to solve this problem. I have the following in my program: public void InsertDB(double price, double shares, String ticker, int id)throws Exception { //do some stuff } I tried the following within my...
[ "java" ]
0
5
4,319
5
0
2011-06-07T19:41:01.833000
2011-06-07T19:42:56.327000
6,270,702
6,270,761
Problems with jQuery bind()
I'm getting an Unexpected TOKEN illegal error on the following javascript: $(function() { $(‘.delete_post’).bind(‘ajax:success’, function() { $(this).closest(‘tr’).fadeOut(); }); }); I've done quite a bit of research and can't seem to find any issue with this code. The error is being thrown on the 2nd line. The.delete_...
It looks like you're using back-tics instead of single quotes (apostrophes). -- Per comments -- They're not backticks, they're left single quotes (thanks Gabi). Unfortunately, That's still probably enough to throw off the JS Engine. If you didn't mean to type them that way your editor is doing it automagically. What pl...
Problems with jQuery bind() I'm getting an Unexpected TOKEN illegal error on the following javascript: $(function() { $(‘.delete_post’).bind(‘ajax:success’, function() { $(this).closest(‘tr’).fadeOut(); }); }); I've done quite a bit of research and can't seem to find any issue with this code. The error is being thrown ...
TITLE: Problems with jQuery bind() QUESTION: I'm getting an Unexpected TOKEN illegal error on the following javascript: $(function() { $(‘.delete_post’).bind(‘ajax:success’, function() { $(this).closest(‘tr’).fadeOut(); }); }); I've done quite a bit of research and can't seem to find any issue with this code. The erro...
[ "jquery" ]
0
3
160
2
0
2011-06-07T19:42:15.350000
2011-06-07T19:46:49.653000
6,270,707
6,271,076
Using an array as a key for a dictionary in javascript
What is the best way, in Javascript, to use an array as a key that I can match against to get a value? What I want to be able to do is get a value that may map to multiple keys. Using a switch it would look like this: switch(item) { case "table": // fall through case "desk": // fall through case "chair": // fall throug...
Why can't you just use a normal object? var store = { "table":"office", "desk":"office", "chair":"office" }; console.log(store["desk"]); If the problem is duplication, you can make the value a reference type. var office = {value:"office"}; var store = { "table":office, "desk":office, "chair":office };
Using an array as a key for a dictionary in javascript What is the best way, in Javascript, to use an array as a key that I can match against to get a value? What I want to be able to do is get a value that may map to multiple keys. Using a switch it would look like this: switch(item) { case "table": // fall through ca...
TITLE: Using an array as a key for a dictionary in javascript QUESTION: What is the best way, in Javascript, to use an array as a key that I can match against to get a value? What I want to be able to do is get a value that may map to multiple keys. Using a switch it would look like this: switch(item) { case "table": ...
[ "javascript", "arrays", "dictionary" ]
0
1
284
2
0
2011-06-07T19:42:48.853000
2011-06-07T20:15:52.487000
6,270,718
6,270,781
Javascript array containing object logic failing. What is going wrong?
I have two arrays, one of the arrays holds all the unique values of another array. The second array holds the unique values of the duplicate values found of another array. The following code below loops through the first array and checks to see if a value in that array index matches a value in the second array index fo...
if ($.inArray(aos[i], dennis)) { The return value from "$.inArray()" is not a boolean. It's an index. Thus to get a boolean "is it in the array?" answer, you compare to -1, which is returned when the item is not found. if ($.inArray(aos[i], dennis) > -1) { You could also write just ~$.inArray(aos[i], dennis) to get a b...
Javascript array containing object logic failing. What is going wrong? I have two arrays, one of the arrays holds all the unique values of another array. The second array holds the unique values of the duplicate values found of another array. The following code below loops through the first array and checks to see if a...
TITLE: Javascript array containing object logic failing. What is going wrong? QUESTION: I have two arrays, one of the arrays holds all the unique values of another array. The second array holds the unique values of the duplicate values found of another array. The following code below loops through the first array and ...
[ "javascript", "jquery", "arrays", "contains", "underscore.js" ]
0
2
169
1
0
2011-06-07T19:43:45.597000
2011-06-07T19:47:58.880000
6,270,729
6,270,770
Javascript to Prevent ASP.NET button click
Without using jQuery (can't get into why NOT right now) how do I disable an ASP.NET button from being "clickable" if a certain client-side condition is not met?
You can do something like this with pure javascript. if(someCondition) document.getElementById("buttonClientID").disable = true; else document.getElementById("buttonClientID").disable = false;
Javascript to Prevent ASP.NET button click Without using jQuery (can't get into why NOT right now) how do I disable an ASP.NET button from being "clickable" if a certain client-side condition is not met?
TITLE: Javascript to Prevent ASP.NET button click QUESTION: Without using jQuery (can't get into why NOT right now) how do I disable an ASP.NET button from being "clickable" if a certain client-side condition is not met? ANSWER: You can do something like this with pure javascript. if(someCondition) document.getElemen...
[ "javascript", "asp.net" ]
0
2
394
4
0
2011-06-07T19:44:43.367000
2011-06-07T19:47:23.220000
6,270,731
6,270,783
Releasing an NSString that I am done with causes a crash
Note the commented-out [printvolfirst release]; line below. If I un-comment it, the program crashes. I can't figure out why. The printvolfirst variable is not used anywhere else except in the lines of code you see here. After it is assigned to printvol I'm done with it. So why not release it? vol = vol / 1000000; NSNum...
stringFromNumber: autoreleases the returned object. If you release it again, it's released after it has been deallocated. In fact, you don't even need this code: NSString*printvolfirst=[[NSString alloc]init]; You can turn on 'Run Static Analyser' in the build settings to get warned about such things.
Releasing an NSString that I am done with causes a crash Note the commented-out [printvolfirst release]; line below. If I un-comment it, the program crashes. I can't figure out why. The printvolfirst variable is not used anywhere else except in the lines of code you see here. After it is assigned to printvol I'm done w...
TITLE: Releasing an NSString that I am done with causes a crash QUESTION: Note the commented-out [printvolfirst release]; line below. If I un-comment it, the program crashes. I can't figure out why. The printvolfirst variable is not used anywhere else except in the lines of code you see here. After it is assigned to p...
[ "objective-c", "cocoa", "memory-management", "nsstring" ]
0
4
124
2
0
2011-06-07T19:44:50.823000
2011-06-07T19:48:06.653000
6,270,734
6,270,871
SQL Query to Count Number of Days, Excluding Holidays/Weekends
I have a "workDate" field and a "receivedDate" field in table "tblExceptions." I need to count the number of days beteen the two. workDate always comes first - so, in effect, it's kind of like workDate is "begin date" and receivedDate is "end date". Some exclusions make it tricky to me though: First, I need to exclude ...
Something like this should give you the number of days with the holidays subtracted: select days = datediff(day, workDate, receivedDate) - (select count(*) from tblHolidays where holidayDate >= workDate and holidayDate < receivedDate) from tblExceptions Note that the date functions differ between database systems. This...
SQL Query to Count Number of Days, Excluding Holidays/Weekends I have a "workDate" field and a "receivedDate" field in table "tblExceptions." I need to count the number of days beteen the two. workDate always comes first - so, in effect, it's kind of like workDate is "begin date" and receivedDate is "end date". Some ex...
TITLE: SQL Query to Count Number of Days, Excluding Holidays/Weekends QUESTION: I have a "workDate" field and a "receivedDate" field in table "tblExceptions." I need to count the number of days beteen the two. workDate always comes first - so, in effect, it's kind of like workDate is "begin date" and receivedDate is "...
[ "sql" ]
1
2
6,461
2
0
2011-06-07T19:44:53.893000
2011-06-07T19:55:43.317000
6,270,749
6,270,784
Combine Select SQL into Single Query w/ Mutiple Columns
This multiple SELECT QUERY runs consecutively. I need one report with multiple columns for [GBPMID] and [EURMID]. Query 1 SELECT (([askPrice] - [bidPrice]) / 2) + [bidPrice] AS [EURMID] FROM TicksForex WHERE [Symbol] = 'EUR/USD' AND [Time] >= CONVERT(datetime, '6/6/2011 12:00 AM') Query 2 SELECT [Time],[askPrice],[bidP...
Make use of Case...when will resolve you issue easily SELECT [Time],[askPrice],[bidPrice], ( CASE WHEN Symbol = 'GBP/USD' THEN ((([askPrice] - [bidPrice]) / 2) + [bidPrice]) ELSE 0 END) AS [GBPMID], ( CASE WHEN Symbol = 'EUR/USD' THEN ((([askPrice] - [bidPrice]) / 2) + [bidPrice]) ELSE 0 END) AS [EURMID] FROM TicksFo...
Combine Select SQL into Single Query w/ Mutiple Columns This multiple SELECT QUERY runs consecutively. I need one report with multiple columns for [GBPMID] and [EURMID]. Query 1 SELECT (([askPrice] - [bidPrice]) / 2) + [bidPrice] AS [EURMID] FROM TicksForex WHERE [Symbol] = 'EUR/USD' AND [Time] >= CONVERT(datetime, '6/...
TITLE: Combine Select SQL into Single Query w/ Mutiple Columns QUESTION: This multiple SELECT QUERY runs consecutively. I need one report with multiple columns for [GBPMID] and [EURMID]. Query 1 SELECT (([askPrice] - [bidPrice]) / 2) + [bidPrice] AS [EURMID] FROM TicksForex WHERE [Symbol] = 'EUR/USD' AND [Time] >= CON...
[ "sql", "t-sql", "sql-server-2008", "select" ]
1
1
505
2
0
2011-06-07T19:46:18.917000
2011-06-07T19:48:08.447000
6,270,762
6,270,886
Did I just find a bug in rails Date format?
In trying to parse a date, I have been racking my brain for hours: Date.today.to_s => "06/07/2011" Date.today => Tue, 07 Jun 2011 Date.parse Date.today.to_s => Wed, 06 Jul 2011 Date::DATE_FORMATS[:default] => "%m/%d/%Y" The default format for to_s is different than the default format for parsing? Why would they do t...
Normally, Date.today.to_s would return "2011-06-07", but since you set a default date format, it's using "06/07/2011" instead. Date.parse easily recognizes the YYYY-MM-DD format, but when it sees 06/07/2011 it thinks that's really DD/MM/YYYY (not MM/DD/YYYY as you're expecting -- keep in mind that Date.parse knows noth...
Did I just find a bug in rails Date format? In trying to parse a date, I have been racking my brain for hours: Date.today.to_s => "06/07/2011" Date.today => Tue, 07 Jun 2011 Date.parse Date.today.to_s => Wed, 06 Jul 2011 Date::DATE_FORMATS[:default] => "%m/%d/%Y" The default format for to_s is different than the def...
TITLE: Did I just find a bug in rails Date format? QUESTION: In trying to parse a date, I have been racking my brain for hours: Date.today.to_s => "06/07/2011" Date.today => Tue, 07 Jun 2011 Date.parse Date.today.to_s => Wed, 06 Jul 2011 Date::DATE_FORMATS[:default] => "%m/%d/%Y" The default format for to_s is diff...
[ "ruby-on-rails", "date", "format" ]
1
5
1,129
3
0
2011-06-07T19:46:51.610000
2011-06-07T19:57:34.517000
6,270,764
6,270,815
WPF/Attached Properties - Please explain why this works
Please help me understand where the value "ABC" gets stored. When I run memory profilers I don't see any instance of MyClass, and in fact the binding works and the GroupBox.Header gets the value ABC... Thanks for your help. public class MyClass { public static readonly DependencyProperty Tag1Property = DependencyProper...
Dependency properties maintain a dictionary internally. Values are stored using sparse storage mechanism. These properties are associated at the class level - being static. The value ABC is stored in the dictionary as key value pairs
WPF/Attached Properties - Please explain why this works Please help me understand where the value "ABC" gets stored. When I run memory profilers I don't see any instance of MyClass, and in fact the binding works and the GroupBox.Header gets the value ABC... Thanks for your help. public class MyClass { public static rea...
TITLE: WPF/Attached Properties - Please explain why this works QUESTION: Please help me understand where the value "ABC" gets stored. When I run memory profilers I don't see any instance of MyClass, and in fact the binding works and the GroupBox.Header gets the value ABC... Thanks for your help. public class MyClass {...
[ "wpf", "dependency-properties", "attached-properties" ]
3
2
365
2
0
2011-06-07T19:47:00.213000
2011-06-07T19:50:22.083000
6,270,767
6,270,875
jquery - Disable / Simulate "enter" behavior for submit button
EDIT ** To try to make this a little clearer.... When I click the input put button with the mouse, it posts via ajax, like I want it to: mysite.com:8888/save/1?val=&val2=&val3=... When I'm in a textfield and I hit "enter", it submits to itself, not via ajax... It just works like a regular submission form... I'm just tr...
Generally speaking, hitting enter when any form element has focus can cause the form's submit event to fire. $('form#my-custom-form').submit(...your handler function here...) so handle this event in the same way you handle the button
jquery - Disable / Simulate "enter" behavior for submit button EDIT ** To try to make this a little clearer.... When I click the input put button with the mouse, it posts via ajax, like I want it to: mysite.com:8888/save/1?val=&val2=&val3=... When I'm in a textfield and I hit "enter", it submits to itself, not via ajax...
TITLE: jquery - Disable / Simulate "enter" behavior for submit button QUESTION: EDIT ** To try to make this a little clearer.... When I click the input put button with the mouse, it posts via ajax, like I want it to: mysite.com:8888/save/1?val=&val2=&val3=... When I'm in a textfield and I hit "enter", it submits to it...
[ "jquery", "preventdefault" ]
0
1
2,566
3
0
2011-06-07T19:47:08.603000
2011-06-07T19:56:01.410000
6,270,777
6,271,685
Changing the domain name for a store in Magento
I'm trying to change a domain name for one of for websites in a Magento multistore setup. Each Store has it's own website, store, and view. We're replacing the old domain (domain1) with a new domain, and we're going to switch to a new domain (domain2). I haven' been able to find information on changing a domain, except...
I used to have such a problem when moving from the sub-dir into root. Turned out to be caching issue. If you are not able to get into administrator interface to clear your cache, just delete /var/cache directory.
Changing the domain name for a store in Magento I'm trying to change a domain name for one of for websites in a Magento multistore setup. Each Store has it's own website, store, and view. We're replacing the old domain (domain1) with a new domain, and we're going to switch to a new domain (domain2). I haven' been able ...
TITLE: Changing the domain name for a store in Magento QUESTION: I'm trying to change a domain name for one of for websites in a Magento multistore setup. Each Store has it's own website, store, and view. We're replacing the old domain (domain1) with a new domain, and we're going to switch to a new domain (domain2). I...
[ "php", "mysql", "magento" ]
2
1
1,935
1
0
2011-06-07T19:47:42.333000
2011-06-07T21:07:48.887000
6,270,778
6,270,943
ConvexHull in Graphics - Mathematica
Trying to plot a ConvexHull Using PlanarGraphPlot from the ComputationalGeometry package, it does not work when used in graphics. Any Idea on how to plot the ConvexHull using Graphics?
Needs["ComputationalGeometry`"] pts = RandomReal[{0, 10}, {60, 2}]; Graphics[ { Point@pts, FaceForm[], EdgeForm[Red], Polygon@pts[[ConvexHull[pts]]] } ] or cpts = pts[[ConvexHull[pts]]]; AppendTo[cpts, cpts[[1]]]; Graphics[ { Point@pts, Red, Line@cpts } ]
ConvexHull in Graphics - Mathematica Trying to plot a ConvexHull Using PlanarGraphPlot from the ComputationalGeometry package, it does not work when used in graphics. Any Idea on how to plot the ConvexHull using Graphics?
TITLE: ConvexHull in Graphics - Mathematica QUESTION: Trying to plot a ConvexHull Using PlanarGraphPlot from the ComputationalGeometry package, it does not work when used in graphics. Any Idea on how to plot the ConvexHull using Graphics? ANSWER: Needs["ComputationalGeometry`"] pts = RandomReal[{0, 10}, {60, 2}]; Gr...
[ "graphics", "wolfram-mathematica", "convex-hull" ]
5
9
1,231
2
0
2011-06-07T19:47:43.443000
2011-06-07T20:02:36.053000
6,270,782
6,270,987
How to send an email with Python?
This code works and sends me an email just fine: import smtplib #SERVER = "localhost" FROM = 'monty@python.com' TO = ["jon@mycompany.com"] # must be a list SUBJECT = "Hello!" TEXT = "This message was sent with Python's smtplib." # Prepare actual message message = """\ From: %s To: %s Subject: %s %s """ % (FROM, ...
I recommend that you use the standard packages email and smtplib together to send email. Please look at the following example (reproduced from the Python documentation ). Notice that if you follow this approach, the "simple" task is indeed simple, and the more complex tasks (like attaching binary objects or sending pla...
How to send an email with Python? This code works and sends me an email just fine: import smtplib #SERVER = "localhost" FROM = 'monty@python.com' TO = ["jon@mycompany.com"] # must be a list SUBJECT = "Hello!" TEXT = "This message was sent with Python's smtplib." # Prepare actual message message = """\ From: %s To...
TITLE: How to send an email with Python? QUESTION: This code works and sends me an email just fine: import smtplib #SERVER = "localhost" FROM = 'monty@python.com' TO = ["jon@mycompany.com"] # must be a list SUBJECT = "Hello!" TEXT = "This message was sent with Python's smtplib." # Prepare actual message message ...
[ "python", "email", "function", "smtplib" ]
256
266
562,966
20
0
2011-06-07T19:48:05.047000
2011-06-07T20:07:33.873000
6,270,792
6,273,168
Re-positioning Jquery UI Autocomplete Results Box
I am using the Jquery UI Autocomplete plugin for a straight forward search term suggestion tool. It is up and running with no problems except that I cannot move the results box. I basically need to move it 20 pixels to the left and 4 pixels down. I have attempted to overwrite the Jquery UI CSS, but have not been able t...
Here's one way you could do it, tapping into the open event and changing the position of the menu when that event occurs: $("#autocomplete").autocomplete({ appendTo: "#results", open: function() { var position = $("#results").position(), left = position.left, top = position.top; $("#results > ul").css({left: left + 20...
Re-positioning Jquery UI Autocomplete Results Box I am using the Jquery UI Autocomplete plugin for a straight forward search term suggestion tool. It is up and running with no problems except that I cannot move the results box. I basically need to move it 20 pixels to the left and 4 pixels down. I have attempted to ove...
TITLE: Re-positioning Jquery UI Autocomplete Results Box QUESTION: I am using the Jquery UI Autocomplete plugin for a straight forward search term suggestion tool. It is up and running with no problems except that I cannot move the results box. I basically need to move it 20 pixels to the left and 4 pixels down. I hav...
[ "jquery", "css", "jquery-ui", "jquery-plugins", "autocomplete" ]
23
26
34,472
4
0
2011-06-07T19:48:28.950000
2011-06-08T00:53:53.517000
6,270,812
6,270,864
How to disable application request validation in asp.net
I want to be able to save things like:
If you're using ASP.NET 4.0 you may also have to make a change to web.config: But it should be avoided if possible.
How to disable application request validation in asp.net I want to be able to save things like:
TITLE: How to disable application request validation in asp.net QUESTION: I want to be able to save things like: ANSWER: If you're using ASP.NET 4.0 you may also have to make a change to web.config: But it should be avoided if possible.
[ "asp.net", "vb.net" ]
0
1
2,726
4
0
2011-06-07T19:50:05.110000
2011-06-07T19:55:00.500000
6,270,823
6,270,981
How is this done. Javascript?
http://www.dennys.com I'm wondering how the top navigation was programmed, From the source code I see javascript but I am hoping someone could recommend a resource / tutorial in learning how they built both the top navigation and the siding feature. Many thanks.
I doubt anyone has written a tutorial on how Denny's made a website. But through some playing in the console, I found they use jQuery, which comes with many effects. To bring the navigation down, they probably use something like.. $('#navigation-button').mouseenter(function () { $('#navigation').slideDown(); }); I have...
How is this done. Javascript? http://www.dennys.com I'm wondering how the top navigation was programmed, From the source code I see javascript but I am hoping someone could recommend a resource / tutorial in learning how they built both the top navigation and the siding feature. Many thanks.
TITLE: How is this done. Javascript? QUESTION: http://www.dennys.com I'm wondering how the top navigation was programmed, From the source code I see javascript but I am hoping someone could recommend a resource / tutorial in learning how they built both the top navigation and the siding feature. Many thanks. ANSWER: ...
[ "javascript", "navigation", "scroll" ]
2
1
250
4
0
2011-06-07T19:51:09.197000
2011-06-07T20:07:15.413000
6,270,830
6,270,974
Retrieving Custom Button Property in Objective-C
I've created a custom button called TaskUIButton that inherits from UIButton. The only difference I have right now is a "va" property. Here's the interface // TaskUIButton.h @interface TaskUIButton: UIButton { NSString *va; } @property(nonatomic, retain) NSString *va; @end And the implementation file //TaskUIButton.m @...
You are getting this because buttonWithType: is returning a new object which is a UIRoundedRectButton object which is a subclass of UIButton. You can't alter this behavior of the method unless you override but you are unlikely to get what you want. You should take the alloc-init approach. Using Associative References Y...
Retrieving Custom Button Property in Objective-C I've created a custom button called TaskUIButton that inherits from UIButton. The only difference I have right now is a "va" property. Here's the interface // TaskUIButton.h @interface TaskUIButton: UIButton { NSString *va; } @property(nonatomic, retain) NSString *va; @e...
TITLE: Retrieving Custom Button Property in Objective-C QUESTION: I've created a custom button called TaskUIButton that inherits from UIButton. The only difference I have right now is a "va" property. Here's the interface // TaskUIButton.h @interface TaskUIButton: UIButton { NSString *va; } @property(nonatomic, retain...
[ "objective-c", "button", "properties" ]
0
4
954
2
0
2011-06-07T19:51:52.753000
2011-06-07T20:06:19.230000
6,270,831
6,271,013
How to make CheckBoxFor only POST data back when value is true
I have a model which has a boolean property and some other properties that have the DataAnnotations Required attribute. In my view I have @Html.CheckBoxFor(model => model.MyProduct.BloodTestEnabled, new { @class = "cb" }) However if the checkbox is not checked the value is false and this gets posted back to the control...
Simply use an input tag instead. The CheckBoxFor method creates a hidden input that returns a value of True/False. It's designed to function exactly how you are asking it not to. CheckBoxFor also does not work with lists or non Boolean values. CheckBoxFor renders like this: Your code should be something like: You can t...
How to make CheckBoxFor only POST data back when value is true I have a model which has a boolean property and some other properties that have the DataAnnotations Required attribute. In my view I have @Html.CheckBoxFor(model => model.MyProduct.BloodTestEnabled, new { @class = "cb" }) However if the checkbox is not chec...
TITLE: How to make CheckBoxFor only POST data back when value is true QUESTION: I have a model which has a boolean property and some other properties that have the DataAnnotations Required attribute. In my view I have @Html.CheckBoxFor(model => model.MyProduct.BloodTestEnabled, new { @class = "cb" }) However if the ch...
[ "c#", ".net", "asp.net-mvc", "http", "asp.net-mvc-3" ]
0
2
1,675
1
0
2011-06-07T19:51:55.913000
2011-06-07T20:09:24.477000
6,270,837
6,273,436
How to debug a runtime stack underflow error?
I'm really struggling to resolve a stack underflow that I'm getting. The traceback I get at runtime is: VerifyError: Error #1024: Stack underflow occurred. at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() This is particularly...
Stack underflow basically means the compiler messed up. You can use SWFWire Inspector to look at the bytecode of the event handler, if you want to know exactly how it messed up. You can also use SWFWire Debugger to see which methods were called, but in this case, you already knew where it was happening. If you post the...
How to debug a runtime stack underflow error? I'm really struggling to resolve a stack underflow that I'm getting. The traceback I get at runtime is: VerifyError: Error #1024: Stack underflow occurred. at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.ne...
TITLE: How to debug a runtime stack underflow error? QUESTION: I'm really struggling to resolve a stack underflow that I'm getting. The traceback I get at runtime is: VerifyError: Error #1024: Stack underflow occurred. at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchE...
[ "actionscript-3", "flash", "debugging", "apache-flex", "stackunderflow" ]
12
4
9,700
9
0
2011-06-07T19:52:34.313000
2011-06-08T01:56:08.193000
6,270,849
6,270,923
Placing Python objects in shared memory
Is there a Python module that would enable me to place instances of non-trivial user classes into shared memory? By that I mean allocating directly in shared memory as opposed to pickling into and out of it. multiprocessing.Value and multiprocessing.Array wouldn't work for my use case as they only seem to support primi...
That's kind of a tough one. The best solution I can think of is pickling your objects and using a c_char_p with multiprocessing.sharedctypes. You'd still have to make sure no null bytes got into the c_char_p, either by escaping them or converting to hex. On second thought, maybe you should go with POSH.
Placing Python objects in shared memory Is there a Python module that would enable me to place instances of non-trivial user classes into shared memory? By that I mean allocating directly in shared memory as opposed to pickling into and out of it. multiprocessing.Value and multiprocessing.Array wouldn't work for my use...
TITLE: Placing Python objects in shared memory QUESTION: Is there a Python module that would enable me to place instances of non-trivial user classes into shared memory? By that I mean allocating directly in shared memory as opposed to pickling into and out of it. multiprocessing.Value and multiprocessing.Array wouldn...
[ "python", "shared-memory", "allocation" ]
14
1
1,258
1
0
2011-06-07T19:53:22.257000
2011-06-07T20:00:36.370000
6,270,857
6,271,338
Are SELECT FOR XML querys slow?
I have a stored procedure which returns XML to the caller using a SELECT FOR XML PATH statement. As more rows have been added to the main table in the query I have noticed that the performance of this query has degraded. On investigation I found that running the query in SQL management studio without the FOR XML statem...
Just to make sure that you're not taking client rendering time into the equation, assign the result to a variable and see if the execution time is the same. Here's an example I just ran on my server: SET STATISTICS TIME ON go DECLARE @x XML PRINT '------------' SELECT @x = (SELECT * FROM sys.[dm_exec_connections] AS d...
Are SELECT FOR XML querys slow? I have a stored procedure which returns XML to the caller using a SELECT FOR XML PATH statement. As more rows have been added to the main table in the query I have noticed that the performance of this query has degraded. On investigation I found that running the query in SQL management s...
TITLE: Are SELECT FOR XML querys slow? QUESTION: I have a stored procedure which returns XML to the caller using a SELECT FOR XML PATH statement. As more rows have been added to the main table in the query I have noticed that the performance of this query has degraded. On investigation I found that running the query i...
[ "sql-server", "xml" ]
3
3
7,256
2
0
2011-06-07T19:54:21.503000
2011-06-07T20:38:36.987000
6,270,859
6,270,988
XPath to count the child nodes based on complex filter
I have an XML in the following format: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 I have a requirement to get the count of the 'component' nodes that have more than 10 'compLine' elements. Till now I have the following XPath query - count(//*[local-name()='ComRequest']/*[local-name()='root']/*[local-name(...
How about count(//ComRequest/root/component[count(compLine)>10])?
XPath to count the child nodes based on complex filter I have an XML in the following format: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 I have a requirement to get the count of the 'component' nodes that have more than 10 'compLine' elements. Till now I have the following XPath query - count(//*[local-na...
TITLE: XPath to count the child nodes based on complex filter QUESTION: I have an XML in the following format: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 I have a requirement to get the count of the 'component' nodes that have more than 10 'compLine' elements. Till now I have the following XPath query - ...
[ "xml", "xpath" ]
8
11
25,742
2
0
2011-06-07T19:54:24.517000
2011-06-07T20:07:37.150000
6,270,861
6,271,144
Require Authenticated User to Change Password
Using ASP.Net Forms and ASP.Net MVC 3 (combined - we are in process of changing Web Forms to MVC), I have a scenario where a person authenticates (user name / password) but due to a specific condition existing on their account, they are required to change their password before proceeding. Since the user is already auth...
In Application_AuthenticateRequest check for the specific condition. If not met (ie they must change pwd), redirect to the proper page. This should work for MVC and WebForms.
Require Authenticated User to Change Password Using ASP.Net Forms and ASP.Net MVC 3 (combined - we are in process of changing Web Forms to MVC), I have a scenario where a person authenticates (user name / password) but due to a specific condition existing on their account, they are required to change their password bef...
TITLE: Require Authenticated User to Change Password QUESTION: Using ASP.Net Forms and ASP.Net MVC 3 (combined - we are in process of changing Web Forms to MVC), I have a scenario where a person authenticates (user name / password) but due to a specific condition existing on their account, they are required to change ...
[ "asp.net", "asp.net-mvc-3", "authentication" ]
1
2
630
3
0
2011-06-07T19:54:53.333000
2011-06-07T20:21:16.437000
6,270,866
6,271,703
uninitialized constant ActiveSupport::SecureRandom
I'm having this strange error for the devise_invitable extension: uninitialized constant ActiveSupport::SecureRandom But the strange thing is that I don't know how to load that module anyway, like if in my console I execute ActiveSupport, thats fine and responds with true but not that SecureRandom class, or ActiveSuppo...
I fixed this by switching to the master branch of Devise on my 3-1-stable Rails application. gem 'devise',:git => "git://github.com/plataformatec/devise"
uninitialized constant ActiveSupport::SecureRandom I'm having this strange error for the devise_invitable extension: uninitialized constant ActiveSupport::SecureRandom But the strange thing is that I don't know how to load that module anyway, like if in my console I execute ActiveSupport, thats fine and responds with t...
TITLE: uninitialized constant ActiveSupport::SecureRandom QUESTION: I'm having this strange error for the devise_invitable extension: uninitialized constant ActiveSupport::SecureRandom But the strange thing is that I don't know how to load that module anyway, like if in my console I execute ActiveSupport, thats fine a...
[ "ruby-on-rails" ]
1
3
2,048
2
0
2011-06-07T19:55:21.643000
2011-06-07T21:10:03.047000
6,270,882
6,271,807
how to make nested double quotes survive the bash interpreter?
given the context below.. does any magic syntax exist that can be inserted in the definition of $WGETOPT to allow the $USERAGENT variable to be 'absorbed', and still allow for a call to the wget command as in syntax 1? i've currently resorted to using 'eval' which i'm not happy with, but maybe this is the only way i ca...
To amplify @Ignacio's answer: if I understand the goal here, the best answer is to store the options in an array. #params USERAGENT="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" PROXYSWITCH=off WGET=wget WGETOPT=(--cut-dirs=3 -r -l10 -dnv -x -H --timestamping --limit-rate=100K --proxy=$PROXYSWITCH -U "$USERAGENT...
how to make nested double quotes survive the bash interpreter? given the context below.. does any magic syntax exist that can be inserted in the definition of $WGETOPT to allow the $USERAGENT variable to be 'absorbed', and still allow for a call to the wget command as in syntax 1? i've currently resorted to using 'eval...
TITLE: how to make nested double quotes survive the bash interpreter? QUESTION: given the context below.. does any magic syntax exist that can be inserted in the definition of $WGETOPT to allow the $USERAGENT variable to be 'absorbed', and still allow for a call to the wget command as in syntax 1? i've currently resor...
[ "bash" ]
4
4
2,254
1
0
2011-06-07T19:56:56.547000
2011-06-07T21:21:51.043000
6,270,889
6,270,971
Facebook Mobile App. Like to continue
I want to make a mobile app that makes a user like a certain page to continue. I know that to check if a user has liked a page for a regular app you can make the app a tab of that page, and then use the signed_request to see if the user has like the page. How would this work in mobile? I have looked to see if you can i...
try this You can subscribe to events. Following event will be raised when some user clicks "Like" button. FB.Event.subscribe('edge.create', function(response) { //redirect or perform some action }); Source: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
Facebook Mobile App. Like to continue I want to make a mobile app that makes a user like a certain page to continue. I know that to check if a user has liked a page for a regular app you can make the app a tab of that page, and then use the signed_request to see if the user has like the page. How would this work in mob...
TITLE: Facebook Mobile App. Like to continue QUESTION: I want to make a mobile app that makes a user like a certain page to continue. I know that to check if a user has liked a page for a regular app you can make the app a tab of that page, and then use the signed_request to see if the user has like the page. How woul...
[ "javascript", "facebook", "mobile", "jquery-mobile" ]
0
0
828
1
0
2011-06-07T19:57:39.783000
2011-06-07T20:05:58.130000
6,270,901
6,298,856
Adhoc Provisioning profile generated from provisioning portal showing expiry date of June 25, 2079
I generated an ad-hoc profile which shows up the expiry date of June 25, 2079. Is this correct or a bug in the provisioning portal? Thanks
It appears that sometime this week Apple changed the rules on expiration for new distribution certificates. Instead of expiring when your program period runs out they are expiring in 2079. I've been able to successfully submit an app using the new certificate so at least right now this seems to be just fine.
Adhoc Provisioning profile generated from provisioning portal showing expiry date of June 25, 2079 I generated an ad-hoc profile which shows up the expiry date of June 25, 2079. Is this correct or a bug in the provisioning portal? Thanks
TITLE: Adhoc Provisioning profile generated from provisioning portal showing expiry date of June 25, 2079 QUESTION: I generated an ad-hoc profile which shows up the expiry date of June 25, 2079. Is this correct or a bug in the provisioning portal? Thanks ANSWER: It appears that sometime this week Apple changed the ru...
[ "iphone", "provisioning-profile" ]
2
0
747
4
0
2011-06-07T19:58:37.380000
2011-06-09T20:29:02.393000
6,270,904
6,270,984
How to "comma" format the output of a django variable?
I have this variable: {{ object.article.rating.get_percent|floatformat }} that outputs this: 540787 Is there a way to format it so it shows as: 540,787
this should help you out: http://twigstechtips.blogspot.com/2010/02/django-formatting-numbers-with-commas.html details: add "django.contrib.humanize" to your INSTALLED_APPS setting. then in the template: {% load humanize %} {{ price|intcomma }}
How to "comma" format the output of a django variable? I have this variable: {{ object.article.rating.get_percent|floatformat }} that outputs this: 540787 Is there a way to format it so it shows as: 540,787
TITLE: How to "comma" format the output of a django variable? QUESTION: I have this variable: {{ object.article.rating.get_percent|floatformat }} that outputs this: 540787 Is there a way to format it so it shows as: 540,787 ANSWER: this should help you out: http://twigstechtips.blogspot.com/2010/02/django-formatting-...
[ "python", "django" ]
5
12
2,839
1
0
2011-06-07T19:58:59.943000
2011-06-07T20:07:20.007000
6,270,905
6,301,044
C++/CLI Start-up code
I need to write a program for my computer to run at startup, and its doing fine. However, I need the program to hide(); when it starts up, so my friends don't see it open up. I am currently using Microsoft Visual C++. I've tried placing the code in many places of my project, which includes: the Form1(void) thingy, righ...
OK everyone, I know what I have to do. I Googled this for days and finally... I just have to put the line on the Load thingy on the properties window. That's it! So simple but I missed it... Thanks, though!
C++/CLI Start-up code I need to write a program for my computer to run at startup, and its doing fine. However, I need the program to hide(); when it starts up, so my friends don't see it open up. I am currently using Microsoft Visual C++. I've tried placing the code in many places of my project, which includes: the Fo...
TITLE: C++/CLI Start-up code QUESTION: I need to write a program for my computer to run at startup, and its doing fine. However, I need the program to hide(); when it starts up, so my friends don't see it open up. I am currently using Microsoft Visual C++. I've tried placing the code in many places of my project, whic...
[ "c++-cli", "startup" ]
0
0
250
1
0
2011-06-07T19:59:04.493000
2011-06-10T01:20:14.387000
6,270,906
6,270,964
WCF Restful Web Service Client Limits
I would like to implement a high-traffic restful.NET 4.0 WCF service which can handle a large number (maybe 2,000) requests a minute. I understand I will need to have the hardware to handle this number of connections, but where can I expect to see bottlenecks when hosting in either IIS or a Windows service? What sort o...
Some Useful Links: Using ServiceThrottlingBehavior to Control WCF Service Performance WCF service may scale up slowly under load(KB) Optimizing WCF Performance
WCF Restful Web Service Client Limits I would like to implement a high-traffic restful.NET 4.0 WCF service which can handle a large number (maybe 2,000) requests a minute. I understand I will need to have the hardware to handle this number of connections, but where can I expect to see bottlenecks when hosting in either...
TITLE: WCF Restful Web Service Client Limits QUESTION: I would like to implement a high-traffic restful.NET 4.0 WCF service which can handle a large number (maybe 2,000) requests a minute. I understand I will need to have the hardware to handle this number of connections, but where can I expect to see bottlenecks when...
[ "c#", "wcf", ".net-4.0", "scalability", "wcf-rest" ]
2
0
1,287
1
0
2011-06-07T19:59:08.290000
2011-06-07T20:05:28.523000
6,270,909
6,276,384
Is it possible to implement a dynamic tree of components in JSF?
I am attempting to construct a component tree in JSF 1.2 (Mojarra) where the tree consists of multiple types of junction and leaf nodes. Each leaf node needs to render in a unique way and needs to be posted-back with potential changes. The purpose is to allow the user to update processing logic where each leaf node rep...
It is possible to build a component tree programmatically, but this would be the wrong approach for your use-case. It would generally be unsecure to allow the user-agent to manipulate such server-side code. It would be better to use a model to manage your tree structure (which is essentially the approach Don Roby is su...
Is it possible to implement a dynamic tree of components in JSF? I am attempting to construct a component tree in JSF 1.2 (Mojarra) where the tree consists of multiple types of junction and leaf nodes. Each leaf node needs to render in a unique way and needs to be posted-back with potential changes. The purpose is to a...
TITLE: Is it possible to implement a dynamic tree of components in JSF? QUESTION: I am attempting to construct a component tree in JSF 1.2 (Mojarra) where the tree consists of multiple types of junction and leaf nodes. Each leaf node needs to render in a unique way and needs to be posted-back with potential changes. T...
[ "java", "jsf", "components", "facelets" ]
4
1
2,020
2
0
2011-06-07T19:59:26.217000
2011-06-08T08:56:34.810000
6,270,913
6,270,968
Tips/Suggestions for Handling Multiple Buttons in an ASP.NET MVC3 Form?
I have a page that dynamically generates any number of divs. Inside the div is a bunch of user information with a text area and a button to close out the record. Please take a look at the HTML here (I've stripped out all the stuff not required to answer my quest): Click Here Click Here Click Here And finally here's the...
If you are only interested in the data from one "div", you could create a form for every div. Only the data from the form the submit button is in, will be posted. Also: The ID's of every element should be unique. So you should work on that to. You do not have to supply an ID. The names do not have to be unique. If you ...
Tips/Suggestions for Handling Multiple Buttons in an ASP.NET MVC3 Form? I have a page that dynamically generates any number of divs. Inside the div is a bunch of user information with a text area and a button to close out the record. Please take a look at the HTML here (I've stripped out all the stuff not required to a...
TITLE: Tips/Suggestions for Handling Multiple Buttons in an ASP.NET MVC3 Form? QUESTION: I have a page that dynamically generates any number of divs. Inside the div is a bunch of user information with a text area and a button to close out the record. Please take a look at the HTML here (I've stripped out all the stuff...
[ "jquery", "asp.net", "asp.net-mvc-3", "razor" ]
1
1
406
1
0
2011-06-07T19:59:51.983000
2011-06-07T20:05:40.047000
6,270,938
6,271,058
How to animate text change in TextView?
Trying to do the following: animTimeChange = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left); itemTime.startAnimation(animTimeChange); itemTime.setText("new text"); but the animation happens thru blank screen (i.e. original text is cleared, then new text appears with animation). How to avoid that blank...
TextSwitcher is exactly what you should be using for this. Check out the API Demo for TextSwitcher. The way you should implement this is in your ListAdapter, provide TextSwitcher views to the ListView instead of TextViews. Then you can just call TextSwitcher.setText() on the list item you want to change. Note that you ...
How to animate text change in TextView? Trying to do the following: animTimeChange = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left); itemTime.startAnimation(animTimeChange); itemTime.setText("new text"); but the animation happens thru blank screen (i.e. original text is cleared, then new text appears ...
TITLE: How to animate text change in TextView? QUESTION: Trying to do the following: animTimeChange = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left); itemTime.startAnimation(animTimeChange); itemTime.setText("new text"); but the animation happens thru blank screen (i.e. original text is cleared, then...
[ "android", "textview", "android-listview", "android-animation" ]
13
14
18,730
1
0
2011-06-07T20:02:10.380000
2011-06-07T20:14:43.020000
6,270,952
6,270,993
How to do for loop when accessing each row returned by mysql_fetch_object?
I want to be able to do something like this: function x(){....blablabla.. return mysql_fetch_object($result); } $entries = x(); foreach($entries as $entry){ echo "$entry->member_1"; } when i did this, it gave me 0 result and printed nothing on the screen. I have seen the while-loop solutions too many times already, I ...
You either want: function x(){....blablabla.. $return = array(); while($object = mysql_fetch_object($result)) $return[] = $object; return $return; } $entries = x(); foreach($entries as $entry){ echo $entry->member_1; } Or: function x(){....blablabla.. return mysql_fetch_object($result); } $entries = x(); foreach(get_...
How to do for loop when accessing each row returned by mysql_fetch_object? I want to be able to do something like this: function x(){....blablabla.. return mysql_fetch_object($result); } $entries = x(); foreach($entries as $entry){ echo "$entry->member_1"; } when i did this, it gave me 0 result and printed nothing on ...
TITLE: How to do for loop when accessing each row returned by mysql_fetch_object? QUESTION: I want to be able to do something like this: function x(){....blablabla.. return mysql_fetch_object($result); } $entries = x(); foreach($entries as $entry){ echo "$entry->member_1"; } when i did this, it gave me 0 result and p...
[ "php", "mysql" ]
1
2
316
2
0
2011-06-07T20:03:42.313000
2011-06-07T20:08:12.573000
6,270,956
6,271,027
Timer speeding up
I wrote a simple WinForm program in C# that displays the time, updating every second by creating an event. Although it starts off fine, after some time I notice that it's updating more quickly than every second. As more time passes, it continues to increase its updating speed. Any thoughts? public static void Update(){...
If you call update multiple times you will be subscribing multiple times to the same event. So make sure you only do the aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); once (when the page is constructed for example)
Timer speeding up I wrote a simple WinForm program in C# that displays the time, updating every second by creating an event. Although it starts off fine, after some time I notice that it's updating more quickly than every second. As more time passes, it continues to increase its updating speed. Any thoughts? public sta...
TITLE: Timer speeding up QUESTION: I wrote a simple WinForm program in C# that displays the time, updating every second by creating an event. Although it starts off fine, after some time I notice that it's updating more quickly than every second. As more time passes, it continues to increase its updating speed. Any th...
[ "c#", "winforms", "timer" ]
1
2
749
1
0
2011-06-07T20:04:13.767000
2011-06-07T20:10:41.380000
6,270,957
6,271,151
Anyone know of a jquery plug-in for creating a select with a text input that appears for some choices?
I.e. a regular select, but when I choose "Custom", a text input appears, and I can use that instead, as in this crude drawing: [Choice A ^] becomes [Custom ^] ____________ [Choice A ] [Choice B ] [Choice C ] I can build it, but it's a common pattern.... Note: I'm not talking about a combo box.
The trickier part here is, that presumably you want the input and select box to both use the same name, so whatever is processing the form data, won't have to wonder what was selected, but instead just read the value from the one and same name. My take on this: var i; var b = false; $("select").change(function(){ if($(...
Anyone know of a jquery plug-in for creating a select with a text input that appears for some choices? I.e. a regular select, but when I choose "Custom", a text input appears, and I can use that instead, as in this crude drawing: [Choice A ^] becomes [Custom ^] ____________ [Choice A ] [Choice B ] [Choice C ] I can bui...
TITLE: Anyone know of a jquery plug-in for creating a select with a text input that appears for some choices? QUESTION: I.e. a regular select, but when I choose "Custom", a text input appears, and I can use that instead, as in this crude drawing: [Choice A ^] becomes [Custom ^] ____________ [Choice A ] [Choice B ] [Ch...
[ "javascript", "jquery", "user-interface" ]
2
0
60
1
0
2011-06-07T20:04:18.380000
2011-06-07T20:21:48.467000
6,270,975
6,271,024
Why can't I get the value of this text input field?
I have a div, which contains a text input field: Submit submitAge() looks like this: function submitAge() { var ageVal = document.getElementById("age").text; alert(ageVal); } But in Google Chrome and Webkit Nightly I see an alert with the text "undefined" (I can't test in any other browsers because the page contains we...
You have redefined the id "age". Rename either your div or input and you should be fine.
Why can't I get the value of this text input field? I have a div, which contains a text input field: Submit submitAge() looks like this: function submitAge() { var ageVal = document.getElementById("age").text; alert(ageVal); } But in Google Chrome and Webkit Nightly I see an alert with the text "undefined" (I can't tes...
TITLE: Why can't I get the value of this text input field? QUESTION: I have a div, which contains a text input field: Submit submitAge() looks like this: function submitAge() { var ageVal = document.getElementById("age").text; alert(ageVal); } But in Google Chrome and Webkit Nightly I see an alert with the text "undef...
[ "javascript", "html", "forms", "input" ]
1
7
23,511
6
0
2011-06-07T20:06:28.527000
2011-06-07T20:10:11.867000
6,271,000
6,271,131
JQUERY LIVE Confirm issue
My issue is relating to dynamically applied elements to a page that I am running a confirm against. The code correctly targets the element and asks the confirmation part, however the problem is if I select Yes, I have no idea where the return value is hidden, it is not set in the class like my thoughts below, nor does ...
From my understanding of the examples on the plug-in page, it should be like this: Assign the click handler that should run if confirmation is successful, then assign the confirm plugin. $('.deleteMe').live('click',function() { // Code here for when they click YES on the confirm box. // This only executes in 2 scenario...
JQUERY LIVE Confirm issue My issue is relating to dynamically applied elements to a page that I am running a confirm against. The code correctly targets the element and asks the confirmation part, however the problem is if I select Yes, I have no idea where the return value is hidden, it is not set in the class like my...
TITLE: JQUERY LIVE Confirm issue QUESTION: My issue is relating to dynamically applied elements to a page that I am running a confirm against. The code correctly targets the element and asks the confirmation part, however the problem is if I select Yes, I have no idea where the return value is hidden, it is not set in...
[ "jquery", "confirm" ]
0
1
498
1
0
2011-06-07T20:08:38.447000
2011-06-07T20:20:42.167000
6,271,003
6,271,085
JQuery UI Autocomplete - extra item info when hovered/focussed? HOWTO?
I have the following plan in mind: I have a AutoComplete UI element on my website with several autocomplete options but what i want is the following and i cant get it to work: if the user hovers (mouseover or arrow-keys) over an item the items text should change into the item value of course and extra information. To m...
focus:function(e,ui) { $("input").val($("#ui-active-menuitem").text()); q = $("#ui-active-menuitem").html(); $("#ui-active-menuitem").html(" "+q+" "); }, Do you mean something like this? When your user hovers over the option in the list it changes the value of the input area? here is a working fiddle: http://jsfiddle....
JQuery UI Autocomplete - extra item info when hovered/focussed? HOWTO? I have the following plan in mind: I have a AutoComplete UI element on my website with several autocomplete options but what i want is the following and i cant get it to work: if the user hovers (mouseover or arrow-keys) over an item the items text ...
TITLE: JQuery UI Autocomplete - extra item info when hovered/focussed? HOWTO? QUESTION: I have the following plan in mind: I have a AutoComplete UI element on my website with several autocomplete options but what i want is the following and i cant get it to work: if the user hovers (mouseover or arrow-keys) over an it...
[ "jquery", "jquery-ui", "autocomplete", "hover" ]
2
1
2,784
2
0
2011-06-07T20:08:40.703000
2011-06-07T20:16:33.843000
6,271,021
6,271,036
How can I have two <div> elements side-by-side (2 columns)
I would like to have two tags side-by-side as if being two columns. So far I have text here text here What I'm having difficulty with is the CSS for the divs. Any help?
Check out the float property. Quick example: #1, #2 { float: left; width: 49%; } Check out this beginner tutorial on CSS Floats.
How can I have two <div> elements side-by-side (2 columns) I would like to have two tags side-by-side as if being two columns. So far I have text here text here What I'm having difficulty with is the CSS for the divs. Any help?
TITLE: How can I have two <div> elements side-by-side (2 columns) QUESTION: I would like to have two tags side-by-side as if being two columns. So far I have text here text here What I'm having difficulty with is the CSS for the divs. Any help? ANSWER: Check out the float property. Quick example: #1, #2 { float: left...
[ "css" ]
2
6
40,753
7
0
2011-06-07T20:09:51.207000
2011-06-07T20:12:23.123000
6,271,032
6,275,920
How do I add and subtract probability disributions like real numbers?
I'd like your advice: could you recommend a library that allows you to add/subtract/multiply/divide PDFs (Probability Density Functions) like real numbers? Behind the scenes, it would have to do a Monte Carlo to work the result out, so I'd probably prefer something fast and efficient, that can take advantage of any GPU...
The @Risk Developer Kit allows you to start with a set of probability density functions, then perform algebra on the inputs to get some output, i.e. P = A + B. The keywords on this page can be used to find other competing offerings, e.g. try searching for: "monte carlo simulation model C++" "monte carlo simulation mode...
How do I add and subtract probability disributions like real numbers? I'd like your advice: could you recommend a library that allows you to add/subtract/multiply/divide PDFs (Probability Density Functions) like real numbers? Behind the scenes, it would have to do a Monte Carlo to work the result out, so I'd probably p...
TITLE: How do I add and subtract probability disributions like real numbers? QUESTION: I'd like your advice: could you recommend a library that allows you to add/subtract/multiply/divide PDFs (Probability Density Functions) like real numbers? Behind the scenes, it would have to do a Monte Carlo to work the result out,...
[ "c#", ".net", "probability" ]
9
2
3,761
3
0
2011-06-07T20:11:55.633000
2011-06-08T08:10:45.047000
6,271,053
6,271,264
REST URL error handling using the Play framework
Currently when I (or more importantly, a user) type in one of my rest functions into the URL, it works, with the 200 status code. But if you type a wrong one or mispell it, a 404 page is generated, with a 404 status code when looking at it through a REST client. Instead of getting a 404 page when the bad URL is sent, I...
I am not very familiar with the Play Framework, but I was interested. This discussion seemed at least similar to what you want: Gaëtan Renaudeau... You can customize errors pages depending of the http code error (404, 500, 403,...) by editing app/views/errors/{code}.html files where {code} is you http code. If you are ...
REST URL error handling using the Play framework Currently when I (or more importantly, a user) type in one of my rest functions into the URL, it works, with the 200 status code. But if you type a wrong one or mispell it, a 404 page is generated, with a 404 status code when looking at it through a REST client. Instead ...
TITLE: REST URL error handling using the Play framework QUESTION: Currently when I (or more importantly, a user) type in one of my rest functions into the URL, it works, with the 200 status code. But if you type a wrong one or mispell it, a 404 page is generated, with a 404 status code when looking at it through a RES...
[ "java", "json", "model-view-controller", "rest", "playframework" ]
6
7
1,987
1
0
2011-06-07T20:14:13.090000
2011-06-07T20:32:09.113000
6,271,065
6,273,398
Local synonymous variable to non exact type
I'm a little bit new to C so I'm not familiar with how I would approach a solution to this issue. As you read on, you will notice its not critical that I find a solution, but it sure would be nice for this application and future reference.:) I have a parameter int hello and I wan't to make a synonomous copy of not it. ...
In general, in C, you want to write the code that most clearly expresses your intentions, and allow the optimiser to figure out the most efficient way to implement that. In your example of a frequently-reused calculation, storing the result in a const -qualified variable is the most appropriate way to do this - somethi...
Local synonymous variable to non exact type I'm a little bit new to C so I'm not familiar with how I would approach a solution to this issue. As you read on, you will notice its not critical that I find a solution, but it sure would be nice for this application and future reference.:) I have a parameter int hello and I...
TITLE: Local synonymous variable to non exact type QUESTION: I'm a little bit new to C so I'm not familiar with how I would approach a solution to this issue. As you read on, you will notice its not critical that I find a solution, but it sure would be nice for this application and future reference.:) I have a paramet...
[ "c", "function", "gcc", "constants", "typedef" ]
0
1
78
3
0
2011-06-07T20:15:00.577000
2011-06-08T01:46:57.837000
6,271,069
6,271,181
MySql COUNT(*) is different in Stored Procedure
I am working on a 'grading' system, and am trying to make sure that a person is not able to submit a grade twice by using a stored procedure that will check if a person has graded a particular item before allowing a new grade to be saved. The odd thing is, I am passing a user ID and object ID, but when my stored proced...
Even if this code worked (I don't know why it does not) it is not the proper way to make sure something is only entered once. The proper way is to apply a unique constraint on the objectID and grader columns. Then try inserting the row. If the row inserts then the values are unique. If you get a unique violation then t...
MySql COUNT(*) is different in Stored Procedure I am working on a 'grading' system, and am trying to make sure that a person is not able to submit a grade twice by using a stored procedure that will check if a person has graded a particular item before allowing a new grade to be saved. The odd thing is, I am passing a ...
TITLE: MySql COUNT(*) is different in Stored Procedure QUESTION: I am working on a 'grading' system, and am trying to make sure that a person is not able to submit a grade twice by using a stored procedure that will check if a person has graded a particular item before allowing a new grade to be saved. The odd thing i...
[ "mysql", "sql", "stored-procedures" ]
4
12
8,000
2
0
2011-06-07T20:15:26.300000
2011-06-07T20:24:07.773000
6,271,075
6,271,253
how to get the base url from jsp request object?
How to get the base url from the jsp request object? http://localhost:8080/SOMETHING/index.jsp, but I want the part till index.jsp, how is it possible in jsp?
So, you want the base URL? You can get it in a servlet as follows: String url = request.getRequestURL().toString(); String baseURL = url.substring(0, url.length() - request.getRequestURI().length()) + request.getContextPath() + "/"; //... Or in a JSP, as, with little help of JSTL: <%@taglib prefix="c" uri="http://java....
how to get the base url from jsp request object? How to get the base url from the jsp request object? http://localhost:8080/SOMETHING/index.jsp, but I want the part till index.jsp, how is it possible in jsp?
TITLE: how to get the base url from jsp request object? QUESTION: How to get the base url from the jsp request object? http://localhost:8080/SOMETHING/index.jsp, but I want the part till index.jsp, how is it possible in jsp? ANSWER: So, you want the base URL? You can get it in a servlet as follows: String url = reque...
[ "java", "jsp", "url", "servlets" ]
32
56
99,996
6
0
2011-06-07T20:15:49.740000
2011-06-07T20:30:59.053000
6,271,077
6,273,624
Detecting ASP.NET Page In RadWindow
I have a control in a master page that I want to display only when the master page is not in a RadWindow; when in a RadWindow, it should be hidden. Is that possible to do, to detect when the page request is inside the RadWindow? Thanks.
Try to use Firefox's Firebug's Net tab or Fiddler to review the http requests being made when you open a page in the RadWindow. Just monitor requests on this RadWindow demo http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window Telerik passes rwndrnd to the page t...
Detecting ASP.NET Page In RadWindow I have a control in a master page that I want to display only when the master page is not in a RadWindow; when in a RadWindow, it should be hidden. Is that possible to do, to detect when the page request is inside the RadWindow? Thanks.
TITLE: Detecting ASP.NET Page In RadWindow QUESTION: I have a control in a master page that I want to display only when the master page is not in a RadWindow; when in a RadWindow, it should be hidden. Is that possible to do, to detect when the page request is inside the RadWindow? Thanks. ANSWER: Try to use Firefox's...
[ ".net", "asp.net", "telerik", "radwindow", "telerik-window" ]
1
2
2,290
2
0
2011-06-07T20:15:57.283000
2011-06-08T02:36:16.680000
6,271,078
6,271,135
f#: windows form in a compiled program
To visualize data from F# interactive console, I can do the following: open System.Windows.Forms let testgrid (x) = let form = new Form(Visible = true) let data = new DataGridView(Dock = DockStyle.Fill) form.Controls.Add(data) data.DataSource <- x testgrid [|(1,1);(2,2)|] But if put the above in a compiled F# program ...
You need a message pump; FSI already has one, which is why your code works from the FSI console, but a standalone program won't have one unless you make one: open System open System.Windows.Forms let testgrid x = use form = new Form() new DataGridView(Dock = DockStyle.Fill, DataSource = x) |> form.Controls.Add Applica...
f#: windows form in a compiled program To visualize data from F# interactive console, I can do the following: open System.Windows.Forms let testgrid (x) = let form = new Form(Visible = true) let data = new DataGridView(Dock = DockStyle.Fill) form.Controls.Add(data) data.DataSource <- x testgrid [|(1,1);(2,2)|] But if ...
TITLE: f#: windows form in a compiled program QUESTION: To visualize data from F# interactive console, I can do the following: open System.Windows.Forms let testgrid (x) = let form = new Form(Visible = true) let data = new DataGridView(Dock = DockStyle.Fill) form.Controls.Add(data) data.DataSource <- x testgrid [|(1,...
[ ".net", "f#" ]
3
3
443
1
0
2011-06-07T20:16:04.993000
2011-06-07T20:20:46.807000
6,271,079
6,271,120
Assign to NSString after alloc/init
This doesn't seem to work: NSString *string = [[NSString alloc] init]; string = @"%@M", anotherstring; I expect this to make "string" equal to "5M" if "anotherstring" is "5". Is this not the right syntax? Now, I could use initWithFormat and it would work, but how can you separate it into two different lines and also wo...
There are two mistakes in your code. Firstly, NSString s are immutable, and once you allocate and initialize them, they're set, and there's no way to change them. For that, you'd have to look into NSMutableString. Secondly, the syntax of your code makes no sense. @"%@M", anotherString is not a valid Objective-C method ...
Assign to NSString after alloc/init This doesn't seem to work: NSString *string = [[NSString alloc] init]; string = @"%@M", anotherstring; I expect this to make "string" equal to "5M" if "anotherstring" is "5". Is this not the right syntax? Now, I could use initWithFormat and it would work, but how can you separate it ...
TITLE: Assign to NSString after alloc/init QUESTION: This doesn't seem to work: NSString *string = [[NSString alloc] init]; string = @"%@M", anotherstring; I expect this to make "string" equal to "5M" if "anotherstring" is "5". Is this not the right syntax? Now, I could use initWithFormat and it would work, but how ca...
[ "objective-c" ]
0
3
2,891
4
0
2011-06-07T20:16:18.713000
2011-06-07T20:19:39.367000
6,271,087
6,271,162
Rails 3 - how to organize / split up bloated controllers?
I've been working on a CMS app to sharpen up my skills and the controllers are getting quite bloated with the definitions. I know it's possible to store stuff in lib/whatever.rb and then use require and include, but that doesn't quite work with controllers - at least, in my case, where I have before_filters. Without th...
You can do a lot of things with mixin modules that will add behavior to an existing controller, or you can try and come up with a class hierarchy that will allow the controllers to inherit the required methods from their parent class. In most applications I sub-class ApplicationController at least once in order to enfo...
Rails 3 - how to organize / split up bloated controllers? I've been working on a CMS app to sharpen up my skills and the controllers are getting quite bloated with the definitions. I know it's possible to store stuff in lib/whatever.rb and then use require and include, but that doesn't quite work with controllers - at ...
TITLE: Rails 3 - how to organize / split up bloated controllers? QUESTION: I've been working on a CMS app to sharpen up my skills and the controllers are getting quite bloated with the definitions. I know it's possible to store stuff in lib/whatever.rb and then use require and include, but that doesn't quite work with...
[ "ruby-on-rails", "ruby", "organization" ]
4
2
1,348
2
0
2011-06-07T20:16:45.013000
2011-06-07T20:22:39.513000
6,271,104
6,271,404
How do I know if my AJAX request is vulnerable to XSS?
A security firm surprise audited a web app I work on, and told me that there are XSS vulnerabilities. I don't really know where to begin. This is the AJAX: new Form.Observer('filter', 0.5, function(element, value) { startLoad('proposals');; new Ajax.Updater('proposals', 'http://acme.example.dev/stuff/filter', { asynchr...
It's hard to say for sure how to track down the vulnerability, since it's not clear what user input your page is displaying. Since you're using RoR, the best place to start is probably the XSS section of the RoR security guide. You could also try running a scanner like skipfish. It will try to automatically detect XSS ...
How do I know if my AJAX request is vulnerable to XSS? A security firm surprise audited a web app I work on, and told me that there are XSS vulnerabilities. I don't really know where to begin. This is the AJAX: new Form.Observer('filter', 0.5, function(element, value) { startLoad('proposals');; new Ajax.Updater('propos...
TITLE: How do I know if my AJAX request is vulnerable to XSS? QUESTION: A security firm surprise audited a web app I work on, and told me that there are XSS vulnerabilities. I don't really know where to begin. This is the AJAX: new Form.Observer('filter', 0.5, function(element, value) { startLoad('proposals');; new Aj...
[ "ruby-on-rails", "ajax", "security", "xss" ]
2
0
444
1
0
2011-06-07T20:18:16.593000
2011-06-07T20:44:46.197000
6,271,108
6,271,180
How to add same method to multiple classes (activity)
I have 3 classes A, B, and C. These extend another class D. Class D has a method that is used in all classes A, B, and C. Now the problem is that classes A, B, and C should extend different classes and use just the same method from class D. I can't believe that I should copy and paste the method in all my classes. Is t...
If your method doesn't need to access private state, add a static method in class D, and call the static method from A, B, C. If your method does need to access private state, see if you can factor out the need to use private state by adding a package-private getter to each class, and then use the method in A. Otherwis...
How to add same method to multiple classes (activity) I have 3 classes A, B, and C. These extend another class D. Class D has a method that is used in all classes A, B, and C. Now the problem is that classes A, B, and C should extend different classes and use just the same method from class D. I can't believe that I sh...
TITLE: How to add same method to multiple classes (activity) QUESTION: I have 3 classes A, B, and C. These extend another class D. Class D has a method that is used in all classes A, B, and C. Now the problem is that classes A, B, and C should extend different classes and use just the same method from class D. I can't...
[ "java", "android" ]
5
7
9,367
3
0
2011-06-07T20:18:38.370000
2011-06-07T20:24:00.847000
6,271,110
6,271,156
Basic security mistakes to avoid in C
As a beginner to C, i want to know what are the basic security tips every C programmer should be familiar with. Strictly referring to C.
Think that the main problem is buffer overflow. It may happen using function like fgets, or scanf, without specifying the max number of bytes to read. A malicious input string larger than allocated buffer may overrite the return address in the stack causing the execution of the supplied exploit.
Basic security mistakes to avoid in C As a beginner to C, i want to know what are the basic security tips every C programmer should be familiar with. Strictly referring to C.
TITLE: Basic security mistakes to avoid in C QUESTION: As a beginner to C, i want to know what are the basic security tips every C programmer should be familiar with. Strictly referring to C. ANSWER: Think that the main problem is buffer overflow. It may happen using function like fgets, or scanf, without specifying ...
[ "c++", "c", "security" ]
0
0
234
3
0
2011-06-07T20:18:40.503000
2011-06-07T20:22:00.867000
6,271,117
6,271,546
Is something forcing the FullCalendar to scroll to the top?
in $(document).ready I'm adding a class to one of the #calendar tr's to represent the "current" time, then I'm calling the jQuery function scrollTop() to scroll.fc-agenda-body to that position. It works, but it looks as though.fc-agenda-body is being force back to the top after the events render. Can I unbind this even...
You have the firstHour property set, which determines which hour the calendar will initially display, it won't prevent the user from scrolling up. If you want to prevent that, then use minTime instead.
Is something forcing the FullCalendar to scroll to the top? in $(document).ready I'm adding a class to one of the #calendar tr's to represent the "current" time, then I'm calling the jQuery function scrollTop() to scroll.fc-agenda-body to that position. It works, but it looks as though.fc-agenda-body is being force bac...
TITLE: Is something forcing the FullCalendar to scroll to the top? QUESTION: in $(document).ready I'm adding a class to one of the #calendar tr's to represent the "current" time, then I'm calling the jQuery function scrollTop() to scroll.fc-agenda-body to that position. It works, but it looks as though.fc-agenda-body ...
[ "fullcalendar" ]
1
4
1,610
1
0
2011-06-07T20:19:12.570000
2011-06-07T20:56:04.127000
6,271,143
6,271,174
removing appended items
I have in my form a listbox. I have a function which reads all options in the listbox and then appends it in a div. function displayOptions(){ var list = document.getElementById('submission_author_ids'); //$j('#spanSubmitters').remove(); for(var i = 0; i < list.options.length; ++i) $j('#spanSubmitters').append(list.op...
Use empty(). remove() removes the whole element. empty() just removes all child nodes inside it. $j('#spanSubmitters').empty();
removing appended items I have in my form a listbox. I have a function which reads all options in the listbox and then appends it in a div. function displayOptions(){ var list = document.getElementById('submission_author_ids'); //$j('#spanSubmitters').remove(); for(var i = 0; i < list.options.length; ++i) $j('#spanSub...
TITLE: removing appended items QUESTION: I have in my form a listbox. I have a function which reads all options in the listbox and then appends it in a div. function displayOptions(){ var list = document.getElementById('submission_author_ids'); //$j('#spanSubmitters').remove(); for(var i = 0; i < list.options.length;...
[ "jquery" ]
3
4
576
2
0
2011-06-07T20:21:15.393000
2011-06-07T20:23:34.813000
6,271,153
6,271,213
Sum of a count field to get overall total
I am very new to this and am looking for some help. I am replicating a report in my current system with the following code. $currentSanctionDetailsArray) { $tableHeadersArray = array ('Home Office',' Total'); $query = "SELECT home_office, COUNT(file_id) FROM cases WHERE ".$currentSanction."='Yes' and ($refdate>='$begi...
I misunderstood the question at first. This should work: $query = "SELECT home_office, COUNT(file_id) FROM cases WHERE ".$currentSanction."='Yes' and ($refdate>='$begindate' AND $refdate<='$enddate') GROUP BY home_office UNION SELECT 'Overall Total' AS home_office, COUNT(file_id) FROM cases WHERE ".$currentSanction."='...
Sum of a count field to get overall total I am very new to this and am looking for some help. I am replicating a report in my current system with the following code. $currentSanctionDetailsArray) { $tableHeadersArray = array ('Home Office',' Total'); $query = "SELECT home_office, COUNT(file_id) FROM cases WHERE ".$cur...
TITLE: Sum of a count field to get overall total QUESTION: I am very new to this and am looking for some help. I am replicating a report in my current system with the following code. $currentSanctionDetailsArray) { $tableHeadersArray = array ('Home Office',' Total'); $query = "SELECT home_office, COUNT(file_id) FROM ...
[ "php", "count", "sum" ]
1
1
620
4
0
2011-06-07T20:21:51.460000
2011-06-07T20:26:43.187000
6,271,177
6,271,239
Mechanism of clipboard of xwindow
Can anybody explain the mechanism of clipboard of xwindow to me? For example, if I make a operation of open a file from gedit and copy the content of this file using ctrl+c. And then I open vim and use ctrl+v to paste the content into the new opened file. I know that it will use the buffer of xwindow to store the conte...
Everything you could possibly want to know about X selections but were afraid to ask.
Mechanism of clipboard of xwindow Can anybody explain the mechanism of clipboard of xwindow to me? For example, if I make a operation of open a file from gedit and copy the content of this file using ctrl+c. And then I open vim and use ctrl+v to paste the content into the new opened file. I know that it will use the bu...
TITLE: Mechanism of clipboard of xwindow QUESTION: Can anybody explain the mechanism of clipboard of xwindow to me? For example, if I make a operation of open a file from gedit and copy the content of this file using ctrl+c. And then I open vim and use ctrl+v to paste the content into the new opened file. I know that ...
[ "linux", "clipboard", "x11", "system-calls", "xorg" ]
5
4
1,632
1
0
2011-06-07T20:23:52.630000
2011-06-07T20:29:47.350000
6,271,190
6,271,235
Creating image list from random folder
I have this PHP code below that i would like to adapt a little with some help. I need to produce a list of images based on the URL pointing to a specific folder (using expression engine). Currently this code works really well but i need it to do two more things... To move up a folder if it doesn't find one... e.g if it...
On the first issue, you can use dirname php function. For the other issue, the one of getting all the files instead of one, you already have the whole array in $bgimagearray, so you can iterate it with a foreach.
Creating image list from random folder I have this PHP code below that i would like to adapt a little with some help. I need to produce a list of images based on the URL pointing to a specific folder (using expression engine). Currently this code works really well but i need it to do two more things... To move up a fol...
TITLE: Creating image list from random folder QUESTION: I have this PHP code below that i would like to adapt a little with some help. I need to produce a list of images based on the URL pointing to a specific folder (using expression engine). Currently this code works really well but i need it to do two more things.....
[ "php", "background-image", "expressionengine" ]
1
0
232
1
0
2011-06-07T20:24:49.833000
2011-06-07T20:29:19.383000
6,271,194
6,271,232
URL scheme reference for the Keynote iPad app?
I'm trying to launch the Keynote app from the application that I'm building. How can I know the URL scheme supported by Keynote (if any)?
In iTunes, sync apps, then go to apps in the navigation bar, Ctrl-click Keynote, show in Finder, copy it over to the desktop, change it's name to end with.zip, unzip it, open the payload folder, Ctrl-click Keynote.app, select Show Package Contents and view its Info.plist.:)
URL scheme reference for the Keynote iPad app? I'm trying to launch the Keynote app from the application that I'm building. How can I know the URL scheme supported by Keynote (if any)?
TITLE: URL scheme reference for the Keynote iPad app? QUESTION: I'm trying to launch the Keynote app from the application that I'm building. How can I know the URL scheme supported by Keynote (if any)? ANSWER: In iTunes, sync apps, then go to apps in the navigation bar, Ctrl-click Keynote, show in Finder, copy it ove...
[ "iphone", "objective-c", "ios", "ipad", "keynote" ]
4
4
1,852
2
0
2011-06-07T20:25:19.797000
2011-06-07T20:28:56.290000
6,271,196
6,271,274
Table is not styling correctly when name is long
I'm having an issue with styling a table on my site. check out my site and if you search for "Rochester, mn", scroll down and you can see that if the name is long, as in the case for Tilson's Automotive and Goodyear, it falls below the image. I would rather have the text wrap than have the entire thing drop below the i...
Set the max-width on the tag that is the mechanic's name to be the widest it can be (around 175px).
Table is not styling correctly when name is long I'm having an issue with styling a table on my site. check out my site and if you search for "Rochester, mn", scroll down and you can see that if the name is long, as in the case for Tilson's Automotive and Goodyear, it falls below the image. I would rather have the text...
TITLE: Table is not styling correctly when name is long QUESTION: I'm having an issue with styling a table on my site. check out my site and if you search for "Rochester, mn", scroll down and you can see that if the name is long, as in the case for Tilson's Automotive and Goodyear, it falls below the image. I would ra...
[ "html", "css", "xhtml" ]
0
1
43
3
0
2011-06-07T20:25:26.827000
2011-06-07T20:32:55.437000
6,271,204
6,271,352
Relocating and renaming classes using namespaces
I have a number of older classes that I'd like to transition into a PSR-0 style directory. I'd like a sanity check on my process. Rename and relocate the existing FooPerson.class.php file to Foo/Person.php. Create namespace Foo in Person.php, and update all class references to be namespace-compatible as appropriate. Fo...
I don't see any pitfalls. However, I suggest to use another approach, because this one may let you miss the one or another old classname. Either you remove FooPerson completely, in which case you will realize the hard way, where you forgot to change the classname, or create a dummy class, that helps you keep track with...
Relocating and renaming classes using namespaces I have a number of older classes that I'd like to transition into a PSR-0 style directory. I'd like a sanity check on my process. Rename and relocate the existing FooPerson.class.php file to Foo/Person.php. Create namespace Foo in Person.php, and update all class referen...
TITLE: Relocating and renaming classes using namespaces QUESTION: I have a number of older classes that I'd like to transition into a PSR-0 style directory. I'd like a sanity check on my process. Rename and relocate the existing FooPerson.class.php file to Foo/Person.php. Create namespace Foo in Person.php, and update...
[ "php", "namespaces", "psr-0" ]
4
4
1,891
1
0
2011-06-07T20:26:07.247000
2011-06-07T20:39:42.750000
6,271,218
6,280,191
Magento: make PDO results into a Varien Object
I have a stored procedure that I call upon using 'core_read' and query method. The results are then gathered using fetchAll(PDO::FETCH_ASSOC). The data comes out perfectly. I can do a foreach on the array, and access data by array keys ($row['name']). I would like to convert the associative array into a Varien_Object, ...
Thank you for your suggestions, and I think it would have worked if I had one line coming back from the stored procedure. Here's what I ended up doing: foreach($rows as $row) { $orders[] = new Varien_Object($row); }
Magento: make PDO results into a Varien Object I have a stored procedure that I call upon using 'core_read' and query method. The results are then gathered using fetchAll(PDO::FETCH_ASSOC). The data comes out perfectly. I can do a foreach on the array, and access data by array keys ($row['name']). I would like to conve...
TITLE: Magento: make PDO results into a Varien Object QUESTION: I have a stored procedure that I call upon using 'core_read' and query method. The results are then gathered using fetchAll(PDO::FETCH_ASSOC). The data comes out perfectly. I can do a foreach on the array, and access data by array keys ($row['name']). I w...
[ "mysql", "stored-procedures", "magento", "pdo" ]
3
1
1,120
3
0
2011-06-07T20:26:53.927000
2011-06-08T14:17:31.157000
6,271,219
6,271,355
How should I create a Class that has access to the same variables/scope as the Controller it's in? - Rails Presenter Pattern
As the application grows, I'm starting to use a Presenter Pattern similar to what's outlined here: http://blog.jayfields.com/2007/03/rails-presenter-pattern.html I would like the presenter to be able to access the same scope of the controller it's in, in a way that minimally impacts application performance, and that ha...
An approach to work around method_missing: Enumerate all instance methods of the controller and define methods in the eigenclass of your presenter (in the initializer). However I doubt that it's better performance-wise when compared to method_missing. Also this won't work for methods that were added to the controller v...
How should I create a Class that has access to the same variables/scope as the Controller it's in? - Rails Presenter Pattern As the application grows, I'm starting to use a Presenter Pattern similar to what's outlined here: http://blog.jayfields.com/2007/03/rails-presenter-pattern.html I would like the presenter to be ...
TITLE: How should I create a Class that has access to the same variables/scope as the Controller it's in? - Rails Presenter Pattern QUESTION: As the application grows, I'm starting to use a Presenter Pattern similar to what's outlined here: http://blog.jayfields.com/2007/03/rails-presenter-pattern.html I would like th...
[ "ruby-on-rails", "design-patterns" ]
1
1
77
1
0
2011-06-07T20:27:04.137000
2011-06-07T20:39:56.043000
6,271,220
6,284,415
Programmatically enumerate symbols in a dynamic library on Mac OS X
I need a way to enumerate symbols and their addresses exported from dylibs on Mac OS X. From the shell I would normally use nm for this - is there a library which I can use from my code to get the same things that nm provides? Similar to the dbghelp API on Windows. As a last resort I suppose I could spawn nm and parse ...
nm (and otool) have the knowledge built into them rather than using an API. The best you will get is header files defining the file format (see 'man Mach-O'). I would invoke nm and parse the output; there's nothing wrong with reusing an existing component just because the interface is program execution rather than func...
Programmatically enumerate symbols in a dynamic library on Mac OS X I need a way to enumerate symbols and their addresses exported from dylibs on Mac OS X. From the shell I would normally use nm for this - is there a library which I can use from my code to get the same things that nm provides? Similar to the dbghelp AP...
TITLE: Programmatically enumerate symbols in a dynamic library on Mac OS X QUESTION: I need a way to enumerate symbols and their addresses exported from dylibs on Mac OS X. From the shell I would normally use nm for this - is there a library which I can use from my code to get the same things that nm provides? Similar...
[ "c", "macos", "symbols", "nm" ]
3
3
879
1
0
2011-06-07T20:27:17.070000
2011-06-08T19:53:35.700000
6,271,226
6,271,246
UIScrollView user interaction
I have a UIScrollView where I have a button. I need that scrollview is blocked. (much larger than the screen). To do this I did: scrollView.userInteractionEnabled = NO; but in doing so the button is not active. there is a way to make it possible to interact with what's in the scrollview, but not to scroll? thanks!
You could change the contentSize of the scrollView to a size smaller than the screen of the device. Then, the OS won't scroll simply because it has no need to. So instead of disabling user interaction, just change the content size to smaller. Then, instead of re-enabling interaction, just change the content size back t...
UIScrollView user interaction I have a UIScrollView where I have a button. I need that scrollview is blocked. (much larger than the screen). To do this I did: scrollView.userInteractionEnabled = NO; but in doing so the button is not active. there is a way to make it possible to interact with what's in the scrollview, b...
TITLE: UIScrollView user interaction QUESTION: I have a UIScrollView where I have a button. I need that scrollview is blocked. (much larger than the screen). To do this I did: scrollView.userInteractionEnabled = NO; but in doing so the button is not active. there is a way to make it possible to interact with what's in...
[ "objective-c", "xcode" ]
1
2
1,127
1
0
2011-06-07T20:28:00.317000
2011-06-07T20:30:25.730000
6,271,236
6,271,391
TStringList problem with values at index
So I have several summary files that I want to read and get the values from. I am doing the following: OutputSummary:= TStringList.Create; for idx:= 0 to 82 do OutputSummary.Insert(idx, ''); to initialize the values I'm using then, I have a loop: for idx:= 0 to SummaryFiles.Count - 1 do begin AssignFile(finp, SummaryFi...
It looks to me like you're trying to create a table of some sort, with one column per input file and one row per line in the file, with the columns separated by the delimiter. If so, calling.Insert on the string list isn't going to quite work right, since you'll end up inserting 83 * SummaryFiles.Count rows. Instead of...
TStringList problem with values at index So I have several summary files that I want to read and get the values from. I am doing the following: OutputSummary:= TStringList.Create; for idx:= 0 to 82 do OutputSummary.Insert(idx, ''); to initialize the values I'm using then, I have a loop: for idx:= 0 to SummaryFiles.Coun...
TITLE: TStringList problem with values at index QUESTION: So I have several summary files that I want to read and get the values from. I am doing the following: OutputSummary:= TStringList.Create; for idx:= 0 to 82 do OutputSummary.Insert(idx, ''); to initialize the values I'm using then, I have a loop: for idx:= 0 to...
[ "delphi", "loops", "tstringlist" ]
1
3
1,170
1
0
2011-06-07T20:29:36.973000
2011-06-07T20:43:39.207000
6,271,237
6,271,466
Detecting when user scrolls to bottom of div with jQuery
I have a div box (called flux) with a variable amount of content inside. This divbox has overflow set to auto. Now, what I am trying to do, is, when the use scroll to the bottom of this DIV-box, load more content into the page, I know how to do this (load the content) but I don't know how to detect when the user has sc...
There are some properties/methods you can use: $().scrollTop()//how much has been scrolled $().innerHeight()// inner height of the element DOMElement.scrollHeight//height of the content of the element So you can take the sum of the first two properties, and when it equals to the last property, you've reached the end: j...
Detecting when user scrolls to bottom of div with jQuery I have a div box (called flux) with a variable amount of content inside. This divbox has overflow set to auto. Now, what I am trying to do, is, when the use scroll to the bottom of this DIV-box, load more content into the page, I know how to do this (load the con...
TITLE: Detecting when user scrolls to bottom of div with jQuery QUESTION: I have a div box (called flux) with a variable amount of content inside. This divbox has overflow set to auto. Now, what I am trying to do, is, when the use scroll to the bottom of this DIV-box, load more content into the page, I know how to do ...
[ "javascript", "jquery" ]
239
464
343,295
16
0
2011-06-07T20:29:37.060000
2011-06-07T20:49:44.750000
6,271,238
6,271,430
Looping Through Multiple Arrays in Ruby
I have multiple arrays of instances of ActiveRecord subclass Item that I need to loop through an print in accordance to earliest event. In this case, I need to print print out payment and maintenance dates as follows: Item A maintenance required in 5 days Item B payment required in 6 days Item A payment required in 7 d...
This is quick and dirty (i.e. not optimized): # In your controller: @items = @items_p.map{ |item| {:item => item,:days => item.paymt,:description => "payment"} } @items += @items_m.map{ |item| {:item => item,:days => item.maint,:description => "maintenance"} } @items = @items.sort_by{ |item| item[:day] } # In your vie...
Looping Through Multiple Arrays in Ruby I have multiple arrays of instances of ActiveRecord subclass Item that I need to loop through an print in accordance to earliest event. In this case, I need to print print out payment and maintenance dates as follows: Item A maintenance required in 5 days Item B payment required ...
TITLE: Looping Through Multiple Arrays in Ruby QUESTION: I have multiple arrays of instances of ActiveRecord subclass Item that I need to loop through an print in accordance to earliest event. In this case, I need to print print out payment and maintenance dates as follows: Item A maintenance required in 5 days Item B...
[ "ruby-on-rails", "ruby", "refactoring" ]
5
2
537
3
0
2011-06-07T20:29:42.500000
2011-06-07T20:47:16.613000
6,271,240
6,273,947
Same Webpart added multiple times on a Site page
I have 2 instances of same webpart deployed on same page. Webpart has a property named Network, which will take values Internal or External. Webpart1 is setup as internal. and Network on WebPart2 is setup as external. After adding webpart, on any event on first webpart is working fine. Any event on Second Webpart shows...
Share your code related to the Web Part Property in order to give a solution. One possible scenario might be that the property or encapsulated field might have been declared as static in the web part source.
Same Webpart added multiple times on a Site page I have 2 instances of same webpart deployed on same page. Webpart has a property named Network, which will take values Internal or External. Webpart1 is setup as internal. and Network on WebPart2 is setup as external. After adding webpart, on any event on first webpart i...
TITLE: Same Webpart added multiple times on a Site page QUESTION: I have 2 instances of same webpart deployed on same page. Webpart has a property named Network, which will take values Internal or External. Webpart1 is setup as internal. and Network on WebPart2 is setup as external. After adding webpart, on any event ...
[ "sharepoint-2010", "web-parts", "webpart-connection" ]
0
0
1,055
1
0
2011-06-07T20:30:00.643000
2011-06-08T03:39:29.517000
6,271,249
6,271,427
Facebook user information using only an OAuth Token
Due to user error, a situation has arisen in which my database holds an Oauth token for a facebook user without that person's facebook id, proper name, or the email linked with the facebook account. Using only the Oauth token, is it possible to get the user's facebook id or other information?
The token holds all the information you need - as explained by Ben Biddington (and probably many other places) part of the token (between the pipes ( | )) is the session-key, in this format: 2.{secret}.3600.{expires_at_seconds_after_epoch}-{user_id} so if your token looks something like 1234567890|2.3onmAQCJpDQDrbT6.36...
Facebook user information using only an OAuth Token Due to user error, a situation has arisen in which my database holds an Oauth token for a facebook user without that person's facebook id, proper name, or the email linked with the facebook account. Using only the Oauth token, is it possible to get the user's facebook...
TITLE: Facebook user information using only an OAuth Token QUESTION: Due to user error, a situation has arisen in which my database holds an Oauth token for a facebook user without that person's facebook id, proper name, or the email linked with the facebook account. Using only the Oauth token, is it possible to get t...
[ "facebook", "oauth" ]
1
2
846
2
0
2011-06-07T20:30:39.857000
2011-06-07T20:46:56.753000
6,271,251
6,271,343
Is there a way to set a Jquery UI sliders background image to only the left half side of the slider button?
In a nutshell, I want my JQuery UI Slider to look like this: Is there a way to only color the left half of the slider and then adjust it's color when it slides either way? http://denniswaltermartinez.com/jqueryslider.png image if the web hosting isn't working.
The image showed up fine for me. Here's some css to style the background of the slider (which only colors the left side). #idOfSlider.ui-slider-range { background: #ef2929; } To adjust it's color: function refresh() { $('#idOfSlider').find('.ui-slider-range').css('background-color', 'red'); } $( "#idOfSlider" ).slider...
Is there a way to set a Jquery UI sliders background image to only the left half side of the slider button? In a nutshell, I want my JQuery UI Slider to look like this: Is there a way to only color the left half of the slider and then adjust it's color when it slides either way? http://denniswaltermartinez.com/jquerysl...
TITLE: Is there a way to set a Jquery UI sliders background image to only the left half side of the slider button? QUESTION: In a nutshell, I want my JQuery UI Slider to look like this: Is there a way to only color the left half of the slider and then adjust it's color when it slides either way? http://denniswaltermar...
[ "jquery", "jquery-ui-slider" ]
0
1
744
1
0
2011-06-07T20:30:54.500000
2011-06-07T20:39:01.510000
6,271,252
6,271,309
Why does Windows Service not launch external App?
I am trying to get a Windows Service to launch an external application. When I start my service it doesn't load the application up. There are no errors reported in the event view either. It just says the service started and stopped successfully. The following is the OnStart and OnStop code: public partial class TestSer...
If you are running on Vista, Windows 7 or Server 2008 and your executable is a windows application (Not Command-Line), then it will not run due to Session 0 Isolation, meaning there are no graphical handles available to services in the newest Windows OS's. The only workaround we have found is to launch an RDP Session, ...
Why does Windows Service not launch external App? I am trying to get a Windows Service to launch an external application. When I start my service it doesn't load the application up. There are no errors reported in the event view either. It just says the service started and stopped successfully. The following is the OnS...
TITLE: Why does Windows Service not launch external App? QUESTION: I am trying to get a Windows Service to launch an external application. When I start my service it doesn't load the application up. There are no errors reported in the event view either. It just says the service started and stopped successfully. The fo...
[ "c#", "windows-services" ]
0
5
3,061
2
0
2011-06-07T20:30:55.497000
2011-06-07T20:36:16.597000
6,271,260
6,271,441
UPDATEing both referenced and referencing columns in a foreign key relationship
I have the following test case: DROP SCHEMA IF EXISTS test CASCADE; CREATE SCHEMA test; CREATE TABLE test.quz ( foo int, bar int, PRIMARY KEY ( foo, bar ) ); CREATE TABLE test.quuz ( foo int, bar int, baz int, PRIMARY KEY ( foo, bar ), FOREIGN KEY ( foo, bar ) REFERENCES test.quz MATCH FULL ); INSERT INTO test.quz VA...
DEFERRABLE means that constraints are checked at the end of each statement. DEFERRABLE INITIALLY DEFERRED, means that constraints are checked at the end of the transaction. This should work in your case: CREATE TABLE test.quuz ( foo int, bar int, baz int, PRIMARY KEY ( foo, bar ), FOREIGN KEY ( foo, bar ) REFERENCES te...
UPDATEing both referenced and referencing columns in a foreign key relationship I have the following test case: DROP SCHEMA IF EXISTS test CASCADE; CREATE SCHEMA test; CREATE TABLE test.quz ( foo int, bar int, PRIMARY KEY ( foo, bar ) ); CREATE TABLE test.quuz ( foo int, bar int, baz int, PRIMARY KEY ( foo, bar ), FOR...
TITLE: UPDATEing both referenced and referencing columns in a foreign key relationship QUESTION: I have the following test case: DROP SCHEMA IF EXISTS test CASCADE; CREATE SCHEMA test; CREATE TABLE test.quz ( foo int, bar int, PRIMARY KEY ( foo, bar ) ); CREATE TABLE test.quuz ( foo int, bar int, baz int, PRIMARY KEY...
[ "postgresql", "foreign-keys", "constraints" ]
1
1
73
1
0
2011-06-07T20:31:35.733000
2011-06-07T20:48:10
6,271,270
6,271,431
Determining the string to buy your app from within the app.(Chicken and egg)
Is there away to programmatically find what the URL to buy an app should be maybe based off the bundle ID? Can you query itunes for it? If not, how do you go about obtaining it before you have you App approved by Apple? The reason I ask was that I was reading a thread on requesting app ratings from the user etc and a p...
Once you create the app in iTunesConnect (Manage Applications/Add New App) and before you upload the binary, you can get the ID from iTunesConnect. Click on the icon for the new, not yet uploaded app. Under "Links", hover the mouse over "View In App Store" and snag the URL. This contains a string like this: http://itun...
Determining the string to buy your app from within the app.(Chicken and egg) Is there away to programmatically find what the URL to buy an app should be maybe based off the bundle ID? Can you query itunes for it? If not, how do you go about obtaining it before you have you App approved by Apple? The reason I ask was th...
TITLE: Determining the string to buy your app from within the app.(Chicken and egg) QUESTION: Is there away to programmatically find what the URL to buy an app should be maybe based off the bundle ID? Can you query itunes for it? If not, how do you go about obtaining it before you have you App approved by Apple? The r...
[ "iphone", "objective-c" ]
3
3
75
1
0
2011-06-07T20:32:41.097000
2011-06-07T20:47:17.990000
6,271,271
6,271,301
How to use forked jekyll repository
I forked jekyll and made some changes in my repository. How can I use my forked version of jekyll instead of the main jekyll repository that I used to initially create my blog? I guess this is more of a general github question than something specific to jekyll. Thanks, Scott
First build your modified Jekyll gem: $ gem build jekyll.gemspec Then install it: $ gem install jekyll-0.10.0.gem
How to use forked jekyll repository I forked jekyll and made some changes in my repository. How can I use my forked version of jekyll instead of the main jekyll repository that I used to initially create my blog? I guess this is more of a general github question than something specific to jekyll. Thanks, Scott
TITLE: How to use forked jekyll repository QUESTION: I forked jekyll and made some changes in my repository. How can I use my forked version of jekyll instead of the main jekyll repository that I used to initially create my blog? I guess this is more of a general github question than something specific to jekyll. Than...
[ "ruby", "github", "jekyll" ]
0
2
176
1
0
2011-06-07T20:32:44.330000
2011-06-07T20:35:48.430000
6,271,283
6,271,361
Changing the position of list items with jQuery
I have a tag cloud widget in my sidebar and I also have a search box in my sidebar. I want to take the search box and move it underneath the in the widget tag cloud, so that it appears before the actual tags. This is the Jquery I tried. I tried to prepend the search box before class tagcloud (which has the actual tags....
This can work for you. $(function() { var searchHtml = $("#search").html(); $("#search").remove(); $(".tagcloud").before(searchHtml); }); Bonus: For some extra info, your "other jquery functions" should be changed. You really should remove the $(function() calls. you should only use it once on a page. This function cal...
Changing the position of list items with jQuery I have a tag cloud widget in my sidebar and I also have a search box in my sidebar. I want to take the search box and move it underneath the in the widget tag cloud, so that it appears before the actual tags. This is the Jquery I tried. I tried to prepend the search box b...
TITLE: Changing the position of list items with jQuery QUESTION: I have a tag cloud widget in my sidebar and I also have a search box in my sidebar. I want to take the search box and move it underneath the in the widget tag cloud, so that it appears before the actual tags. This is the Jquery I tried. I tried to prepen...
[ "jquery" ]
1
2
92
2
0
2011-06-07T20:34:10.630000
2011-06-07T20:40:10.803000
6,271,284
6,273,732
Can I add other attributes to magento's flat product catalog table?
I am in the process of optimizing magento store, and I've run across a couple of posts that recommend using the Flat Product Catalog for stores with a large amount of SKUs. As I have over 10K products I thought I'd give it a try. However, when using the Flat Product Catalog only a select few attributes are loaded in pr...
1.4.x.x, just go into the attributes you want to be used in the "Flat Product Catalog" and make sure the property "Used in Product Listing" is set to Yes. Upon making changes, reindex "Flat Product Data" The following properties cause the attribute to be included in the "Flat Product Catalog": "Use in Layered Navigatio...
Can I add other attributes to magento's flat product catalog table? I am in the process of optimizing magento store, and I've run across a couple of posts that recommend using the Flat Product Catalog for stores with a large amount of SKUs. As I have over 10K products I thought I'd give it a try. However, when using th...
TITLE: Can I add other attributes to magento's flat product catalog table? QUESTION: I am in the process of optimizing magento store, and I've run across a couple of posts that recommend using the Flat Product Catalog for stores with a large amount of SKUs. As I have over 10K products I thought I'd give it a try. Howe...
[ "php", "magento" ]
19
45
19,277
4
0
2011-06-07T20:34:12.220000
2011-06-08T02:57:51.053000
6,271,285
6,273,620
Does Haskell have something like gensym in Racket?
It seems that Haskell does not the type of symbol as that in Racket? Is there something that can generate symbols like gensym in Racket? e.g. in Racket, (gensym 'label) can give 'label2391
The standard unique supply is Data.Unique. For meta-programming purposes, Template Haskell also provides unique names.
Does Haskell have something like gensym in Racket? It seems that Haskell does not the type of symbol as that in Racket? Is there something that can generate symbols like gensym in Racket? e.g. in Racket, (gensym 'label) can give 'label2391
TITLE: Does Haskell have something like gensym in Racket? QUESTION: It seems that Haskell does not the type of symbol as that in Racket? Is there something that can generate symbols like gensym in Racket? e.g. in Racket, (gensym 'label) can give 'label2391 ANSWER: The standard unique supply is Data.Unique. For meta-p...
[ "haskell", "compiler-construction", "uniqueidentifier" ]
3
0
931
1
0
2011-06-07T20:34:21.673000
2011-06-08T02:35:24.760000
6,271,288
6,271,572
Why doesn’t Amazon S3 automatically serve /foo/index.html when I ask for /foo or /foo/?
I am looking into serving my static site with Amazon S3. I have created a bucket and uploaded my files; under the “Website” tab in the AWS Management Console I have checked “Enabled” and entered index.html in the “Index Document” field. I have the following bucket policy: { "Version": "2008-10-17", "Id": "924a2348-de0e...
Looks like you need to configure a root (index) document: http://docs.amazonwebservices.com/AmazonS3/latest/dev/IndexDocumentSupport.html http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html
Why doesn’t Amazon S3 automatically serve /foo/index.html when I ask for /foo or /foo/? I am looking into serving my static site with Amazon S3. I have created a bucket and uploaded my files; under the “Website” tab in the AWS Management Console I have checked “Enabled” and entered index.html in the “Index Document” fi...
TITLE: Why doesn’t Amazon S3 automatically serve /foo/index.html when I ask for /foo or /foo/? QUESTION: I am looking into serving my static site with Amazon S3. I have created a bucket and uploaded my files; under the “Website” tab in the AWS Management Console I have checked “Enabled” and entered index.html in the “...
[ "amazon-s3", "amazon-web-services" ]
28
16
20,400
1
0
2011-06-07T20:34:34.907000
2011-06-07T20:58:24.930000
6,271,302
6,276,585
QTMovie index of out bounds exception when trying to addImage:forDuration:withAttributes
I am trying to create a movie in Cocoa using QTKit. This movie should consist of a bunch of NSImage's that I have created. I'm running into some problems with this. The overall problem is that the movie isn't created. I get a file which appears to be empty, only contains a couple of hundred bytes, but no movie to speak...
Your code is fine. There seems to be a problem with the NSImage instance that is returned by [NSImage imageNamed:]. Try to replace that line with (assuming you image is copied into the bundle's resource folder): NSString* imagePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"screen-1.jpg"];...
QTMovie index of out bounds exception when trying to addImage:forDuration:withAttributes I am trying to create a movie in Cocoa using QTKit. This movie should consist of a bunch of NSImage's that I have created. I'm running into some problems with this. The overall problem is that the movie isn't created. I get a file ...
TITLE: QTMovie index of out bounds exception when trying to addImage:forDuration:withAttributes QUESTION: I am trying to create a movie in Cocoa using QTKit. This movie should consist of a bunch of NSImage's that I have created. I'm running into some problems with this. The overall problem is that the movie isn't crea...
[ "objective-c", "cocoa", "movie", "qtkit" ]
3
2
438
1
0
2011-06-07T20:35:54.917000
2011-06-08T09:17:12.960000
6,271,304
6,272,941
Regex - nested patterns - within outer pattern but exclude inner pattern
I have a file with the content below. ${ dontReplaceMe } ReplaceMe ${dontReplaceMeEither} I want to match 'ReplaceMe' if it is in the td tag, but NOT if it is in the ${... } expression. Can I do this with regex? Currently have: sed '/\${.*?ReplaceMe.*?}/!s/ReplaceMe/REPLACED/g' data.txt
This is not possible. Regex can be used for Type-3 Chomsky languages (regular language). Your sample code however is a Type-2 Chomsky language (context-free language). Pretty much as soon as any kind of nesting (brackets) is involved you're dealing with context free languages, which are not covered by regular expressio...
Regex - nested patterns - within outer pattern but exclude inner pattern I have a file with the content below. ${ dontReplaceMe } ReplaceMe ${dontReplaceMeEither} I want to match 'ReplaceMe' if it is in the td tag, but NOT if it is in the ${... } expression. Can I do this with regex? Currently have: sed '/\${.*?Replace...
TITLE: Regex - nested patterns - within outer pattern but exclude inner pattern QUESTION: I have a file with the content below. ${ dontReplaceMe } ReplaceMe ${dontReplaceMeEither} I want to match 'ReplaceMe' if it is in the td tag, but NOT if it is in the ${... } expression. Can I do this with regex? Currently have: s...
[ "regex", "bash", "sed", "grep", "pattern-matching" ]
1
8
2,495
5
0
2011-06-07T20:36:08.553000
2011-06-08T00:07:14.197000
6,271,311
6,280,457
jquery ajax post of dataType: 'JSON' works on Android but fails on iPhone4
I am building a phonegap application that interfaces with a web service I've set up. Having a strange problem that I cannot explain. The same exact code works properly on Android but fails on iPhone. It's just jQuery. Here is the code: $.ajax({ url: app_domain + '/sessions', type: 'POST', dataType: 'json', data: { sess...
You probably need to modify the outgoing HTTP headers to indicate that you are in fact sending JSON. Add headers to your ajax map: headers: {'Content-Type': 'application/json'}
jquery ajax post of dataType: 'JSON' works on Android but fails on iPhone4 I am building a phonegap application that interfaces with a web service I've set up. Having a strange problem that I cannot explain. The same exact code works properly on Android but fails on iPhone. It's just jQuery. Here is the code: $.ajax({ ...
TITLE: jquery ajax post of dataType: 'JSON' works on Android but fails on iPhone4 QUESTION: I am building a phonegap application that interfaces with a web service I've set up. Having a strange problem that I cannot explain. The same exact code works properly on Android but fails on iPhone. It's just jQuery. Here is t...
[ "jquery", "iphone", "ajax", "json", "cordova" ]
2
2
3,198
1
0
2011-06-07T20:36:22.393000
2011-06-08T14:32:24.253000
6,271,313
6,271,333
pass a javascript variable from an iframe to the parent frame
So I have a variable in my iframe like so: Now I want to pass that variable to the parent frame after the iframe is loaded. What is the simplest way to do that?
If the pages are both on the same domain, you could call a function of the parent window: window.parent.zipPhoneCallback(zipphone); In the parent window, you could define a function like this: function zipPhoneCallback(zipphone) { ((console&&console.log)||alert)("zipphone = " + zipphone); }
pass a javascript variable from an iframe to the parent frame So I have a variable in my iframe like so: Now I want to pass that variable to the parent frame after the iframe is loaded. What is the simplest way to do that?
TITLE: pass a javascript variable from an iframe to the parent frame QUESTION: So I have a variable in my iframe like so: Now I want to pass that variable to the parent frame after the iframe is loaded. What is the simplest way to do that? ANSWER: If the pages are both on the same domain, you could call a function of...
[ "javascript" ]
7
14
18,148
2
0
2011-06-07T20:36:43.103000
2011-06-07T20:38:16.637000
6,271,315
6,271,757
Can WCF REST (WebHttpBinding) honor PROGRAMMATIC outputcache policies?
I know all about the AspNetCacheProfileAttribute. But is there any way to hook into the cache programmatically? I've tried using Response.Cache in global.asax which seems to set the correct client-side headers but the response is never cached on the server.
I don't think you can do it unless you build your own solution. I just checked implementation of AspNetCahceProfileAttribute which only add internal CachingParameterInspector to the operation dispatcher. This has two problems: Parameter inspector is assigned when the service host starts = during first request and until...
Can WCF REST (WebHttpBinding) honor PROGRAMMATIC outputcache policies? I know all about the AspNetCacheProfileAttribute. But is there any way to hook into the cache programmatically? I've tried using Response.Cache in global.asax which seems to set the correct client-side headers but the response is never cached on the...
TITLE: Can WCF REST (WebHttpBinding) honor PROGRAMMATIC outputcache policies? QUESTION: I know all about the AspNetCacheProfileAttribute. But is there any way to hook into the cache programmatically? I've tried using Response.Cache in global.asax which seems to set the correct client-side headers but the response is n...
[ "wcf", "outputcache", "wcf-rest", "webhttpbinding" ]
2
1
470
1
0
2011-06-07T20:36:46.307000
2011-06-07T21:15:40.580000
6,271,316
6,271,795
Returning the View Model to a Controller from a Form.Submit client action
I have a controller with 2 Index methods: public ActionResult Index() { viewModel.PipelineIndex pivm = new viewModel.PipelineIndex(null, User.Identity.Name); return View(pivm); } [HttpPost] public ActionResult Index(viewModel.PipelineIndex model, FormCollection collection) { viewModel.PipelineIndex pivm = null; if (Mo...
I think the rendered HTML form will have a select with the name "GroupDropDown", is that right? If so, the selected value will be posted back on submit with that name and would be bound to either a parameter called groupDropDown or to a string property GroupDropDown on your model class. Do you have such a property on y...
Returning the View Model to a Controller from a Form.Submit client action I have a controller with 2 Index methods: public ActionResult Index() { viewModel.PipelineIndex pivm = new viewModel.PipelineIndex(null, User.Identity.Name); return View(pivm); } [HttpPost] public ActionResult Index(viewModel.PipelineIndex model...
TITLE: Returning the View Model to a Controller from a Form.Submit client action QUESTION: I have a controller with 2 Index methods: public ActionResult Index() { viewModel.PipelineIndex pivm = new viewModel.PipelineIndex(null, User.Identity.Name); return View(pivm); } [HttpPost] public ActionResult Index(viewModel.P...
[ "c#", "asp.net-mvc-3", "viewmodel" ]
0
0
2,898
2
0
2011-06-07T20:36:57.503000
2011-06-07T21:20:28.487000
6,271,321
6,271,617
On-demand function sharing
I need to convert from strings to the code named references. The only currently known option is a script that makes a script, and I was thinking it could be inline like exec. class finder: def __init__(self, parent): self.parent = parent def isin(self, what): return what in self.parent def find(self, what): if self.isi...
I may be wrong, but I think what you're looking for is the ability to find the symbol for a method or attribute based on a string that is determined at runtime. If that's the case, I would pursue a different approach than a strategy based around exec or eval which have problems, like potential python injection attacks ...
On-demand function sharing I need to convert from strings to the code named references. The only currently known option is a script that makes a script, and I was thinking it could be inline like exec. class finder: def __init__(self, parent): self.parent = parent def isin(self, what): return what in self.parent def fi...
TITLE: On-demand function sharing QUESTION: I need to convert from strings to the code named references. The only currently known option is a script that makes a script, and I was thinking it could be inline like exec. class finder: def __init__(self, parent): self.parent = parent def isin(self, what): return what in ...
[ "python" ]
1
4
142
2
0
2011-06-07T20:37:34.053000
2011-06-07T21:02:19.297000
6,271,324
6,290,505
Android sound record problem
I'm trying to record sound on android, using code basically just copied from the developer docs, here it is: mFileName = Environment.getExternalStorageDirectory().getAbsolutePath(); mFileName += "/audiorecordtest.3gp"; mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.s...
Top tip: - Always check you've given your app the appropriate permissions! I forgot to let my app record sound.
Android sound record problem I'm trying to record sound on android, using code basically just copied from the developer docs, here it is: mFileName = Environment.getExternalStorageDirectory().getAbsolutePath(); mFileName += "/audiorecordtest.3gp"; mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder....
TITLE: Android sound record problem QUESTION: I'm trying to record sound on android, using code basically just copied from the developer docs, here it is: mFileName = Environment.getExternalStorageDirectory().getAbsolutePath(); mFileName += "/audiorecordtest.3gp"; mRecorder = new MediaRecorder(); mRecorder.setAudioSou...
[ "android", "audio" ]
0
0
266
1
0
2011-06-07T20:37:38.313000
2011-06-09T09:10:14.307000
6,271,330
6,271,382
Custom getters/setters in .NET - MVC
[DisplayFormat(DataFormatString = "{0:c}")] [DataType(DataType.Currency)] public decimal? PotentialFutureExposure { get { return STPData.MaximumCreditExposure; } set { STPData.MaximumCreditExposure = value; this.PotentialFutureExposureOverride = value; } } public decimal? PotentialFutureExposureOverride { get; set; } ...
Does this work? private decimal? _override = null; public decimal? PotentialFutureExposure { get { return PotentialFutureExposureOverride?? STPData.MaximumCreditExposure; } set { STPData.MaximumCreditExposure = value; this.PotentialFutureExposureOverride = value; } } public decimal? PotentialFutureExposureOverride { ...
Custom getters/setters in .NET - MVC [DisplayFormat(DataFormatString = "{0:c}")] [DataType(DataType.Currency)] public decimal? PotentialFutureExposure { get { return STPData.MaximumCreditExposure; } set { STPData.MaximumCreditExposure = value; this.PotentialFutureExposureOverride = value; } } public decimal? Potential...
TITLE: Custom getters/setters in .NET - MVC QUESTION: [DisplayFormat(DataFormatString = "{0:c}")] [DataType(DataType.Currency)] public decimal? PotentialFutureExposure { get { return STPData.MaximumCreditExposure; } set { STPData.MaximumCreditExposure = value; this.PotentialFutureExposureOverride = value; } } public ...
[ ".net", "asp.net-mvc-2", "getter-setter" ]
0
0
3,142
3
0
2011-06-07T20:38:11.173000
2011-06-07T20:42:40.547000
6,271,340
6,271,406
CakePHP $this->set() don't works in Pages Controller
I am developing with CakePHP and this is my Page Controller: redirect('/'); } $page = $subpage = $title_for_layout = null; if (!empty($path[0])) { $page = $path[0]; } if (!empty($path[1])) { $subpage = $path[1]; } if (!empty($path[$count - 1])) { $title_for_layout = Inflector::humanize($path[$count - 1]); } $this->set...
That's because you're setting it after the $this->render() call. The render call is when the view gets loaded and executed.
CakePHP $this->set() don't works in Pages Controller I am developing with CakePHP and this is my Page Controller: redirect('/'); } $page = $subpage = $title_for_layout = null; if (!empty($path[0])) { $page = $path[0]; } if (!empty($path[1])) { $subpage = $path[1]; } if (!empty($path[$count - 1])) { $title_for_layout =...
TITLE: CakePHP $this->set() don't works in Pages Controller QUESTION: I am developing with CakePHP and this is my Page Controller: redirect('/'); } $page = $subpage = $title_for_layout = null; if (!empty($path[0])) { $page = $path[0]; } if (!empty($path[1])) { $subpage = $path[1]; } if (!empty($path[$count - 1])) { $...
[ "php", "cakephp" ]
1
7
2,959
2
0
2011-06-07T20:38:47.367000
2011-06-07T20:44:58.613000
6,271,348
6,271,410
Regex to replace last occurrence of a string in each line
I am using sed -e 's/\(.*\)ABC/\1DEF/' myfile to replace the last occurrence of ABC with DEF in a file. I want to modify it to replace the last occurrence of ABC with DEF in each line in the file. Is it possible to do with regex? Thanks
You need to add 'g' to the end of your sed: sed -e 's/\(.*\)ABC/\1DEF/g' This tells sed to replace every occurrence of your regex ("globally") instead of only the first occurrence. EDIT: You should also add a $, if you want to ensure that it is replacing the last occurrence of ABC on the line: sed -e 's/\(.*\)ABC$/\1DE...
Regex to replace last occurrence of a string in each line I am using sed -e 's/\(.*\)ABC/\1DEF/' myfile to replace the last occurrence of ABC with DEF in a file. I want to modify it to replace the last occurrence of ABC with DEF in each line in the file. Is it possible to do with regex? Thanks
TITLE: Regex to replace last occurrence of a string in each line QUESTION: I am using sed -e 's/\(.*\)ABC/\1DEF/' myfile to replace the last occurrence of ABC with DEF in a file. I want to modify it to replace the last occurrence of ABC with DEF in each line in the file. Is it possible to do with regex? Thanks ANSWER...
[ "regex", "linux", "shell", "scripting", "sed" ]
11
5
20,067
1
0
2011-06-07T20:39:26.587000
2011-06-07T20:45:41.933000
6,271,358
6,271,375
How can I tell if a value in Request.Form is a number? (C#)
Suppose I must call a function with the following signature: doStuff(Int32?) I want to pass to doStuff a value that is read from Request.Form. However, if the value passed in is blank, missing, or not a number, I want doStuff to be passed a null argument. This should not result in a error; it is a operation. I have to ...
If you want to check whether or not it's an integer, try parsing it: int value; if (int.TryParse(Request.Form["foo"], out value)) { // it's a number use the variable 'value' } else { // not a number }
How can I tell if a value in Request.Form is a number? (C#) Suppose I must call a function with the following signature: doStuff(Int32?) I want to pass to doStuff a value that is read from Request.Form. However, if the value passed in is blank, missing, or not a number, I want doStuff to be passed a null argument. This...
TITLE: How can I tell if a value in Request.Form is a number? (C#) QUESTION: Suppose I must call a function with the following signature: doStuff(Int32?) I want to pass to doStuff a value that is read from Request.Form. However, if the value passed in is blank, missing, or not a number, I want doStuff to be passed a n...
[ "c#", "asp.net", "string", "string-parsing", "request.form" ]
3
8
3,144
3
0
2011-06-07T20:40:05.493000
2011-06-07T20:41:59.937000
6,271,360
6,271,702
Use of IFrame inside JSF Composite Component Generates Error
I am trying to implement a File Uploader until the PF 3.X FileUpload becomes stable. I am leveraging an IFrame inside a composite component to perform the file upload. Essentially this... Your browser does not support iframes. Note that the included file, excel_uploader.xhtml, is... Smart Sheet: And request-scoped back...
As per issue 1764, this has been fixed in Mojarra 2.1.1. Upgrade accordingly.
Use of IFrame inside JSF Composite Component Generates Error I am trying to implement a File Uploader until the PF 3.X FileUpload becomes stable. I am leveraging an IFrame inside a composite component to perform the file upload. Essentially this... Your browser does not support iframes. Note that the included file, exc...
TITLE: Use of IFrame inside JSF Composite Component Generates Error QUESTION: I am trying to implement a File Uploader until the PF 3.X FileUpload becomes stable. I am leveraging an IFrame inside a composite component to perform the file upload. Essentially this... Your browser does not support iframes. Note that the ...
[ "file", "jsf", "iframe", "upload", "primefaces" ]
1
1
2,671
1
0
2011-06-07T20:40:10.487000
2011-06-07T21:10:01.673000
6,271,374
6,271,413
Can silverlight wcf service calls be cache?
This is a wcf binaryencoding service that the application is calling. It takes 3 parameters. I know you could do this is javascript ajax stacks, but I never tried it with Silverlight. Is this possible because I am making the same long running web service call 5 times.
Can you cache on the server side? Certainly, and depending on the nature of the actual service, you may get a lot of it "for free" using the web caching mechanisms. Can you cache on the Silverlight side? Certainly, and if you have to make the call numerous times for the same data, grabbing it once and saving it client ...
Can silverlight wcf service calls be cache? This is a wcf binaryencoding service that the application is calling. It takes 3 parameters. I know you could do this is javascript ajax stacks, but I never tried it with Silverlight. Is this possible because I am making the same long running web service call 5 times.
TITLE: Can silverlight wcf service calls be cache? QUESTION: This is a wcf binaryencoding service that the application is calling. It takes 3 parameters. I know you could do this is javascript ajax stacks, but I never tried it with Silverlight. Is this possible because I am making the same long running web service cal...
[ "ajax", "silverlight", "web-services" ]
0
0
180
1
0
2011-06-07T20:41:58.900000
2011-06-07T20:46:12.827000
6,271,386
6,271,565
How do you serialize a Map to JSON in Scala?
So I have a Map in Scala like this: val m = Map[String, String]( "a" -> "theA", "b" -> "theB", "c" -> "theC", "d" -> "theD", "e" -> "theE" ) and I want to serialize this structure into a JSON string using lift-json. Do any of you know how to do this?
How about this? implicit val formats = net.liftweb.json.DefaultFormats import net.liftweb.json.JsonAST._ import net.liftweb.json.Extraction._ import net.liftweb.json.Printer._ val m = Map[String, String]( "a" -> "theA", "b" -> "theB", "c" -> "theC", "d" -> "theD", "e" -> "theE" ) println(compact(render(decompose(m)))) ...
How do you serialize a Map to JSON in Scala? So I have a Map in Scala like this: val m = Map[String, String]( "a" -> "theA", "b" -> "theB", "c" -> "theC", "d" -> "theD", "e" -> "theE" ) and I want to serialize this structure into a JSON string using lift-json. Do any of you know how to do this?
TITLE: How do you serialize a Map to JSON in Scala? QUESTION: So I have a Map in Scala like this: val m = Map[String, String]( "a" -> "theA", "b" -> "theB", "c" -> "theC", "d" -> "theD", "e" -> "theE" ) and I want to serialize this structure into a JSON string using lift-json. Do any of you know how to do this? ANSWE...
[ "json", "scala", "serialization", "dictionary", "lift" ]
29
28
48,640
7
0
2011-06-07T20:43:06.757000
2011-06-07T20:57:41.030000
6,271,392
6,271,534
Best way to find a specific pattern in a 2D array
I have a 2D array of random characters. I want to match specific patterns of these characters: eg: ABA, BACKA, going up/down/left/right. What is the best algorithm to find this pattern?
If this is like a word-search in that you can only go one direction (once you start left, you can only continue to go left), the answer should be pretty simple, just go ahead and test every possible start location and go each direction. In the worst case this will be O(mn^2) for a n by n If you can go up/left/etc any n...
Best way to find a specific pattern in a 2D array I have a 2D array of random characters. I want to match specific patterns of these characters: eg: ABA, BACKA, going up/down/left/right. What is the best algorithm to find this pattern?
TITLE: Best way to find a specific pattern in a 2D array QUESTION: I have a 2D array of random characters. I want to match specific patterns of these characters: eg: ABA, BACKA, going up/down/left/right. What is the best algorithm to find this pattern? ANSWER: If this is like a word-search in that you can only go one...
[ "algorithm", "puzzle" ]
7
1
2,857
1
0
2011-06-07T20:43:46.803000
2011-06-07T20:54:37.840000
6,271,396
6,271,559
How to set Font for TextView in android?
Possible Duplicate: how to change the font on the text view in android? I tried a lot to set font for the TextView in my app. But there is no way seems to set font in android. I want to set Arial font for all of my TextView through xml. I added Arial.ttf to my assets still unable to set style in xml. Please find me a w...
AFAIK you can't do it in xml, you have to do it in code: Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Arial.otf"); TextView tv = (TextView) findViewById(R.id.CustomFontText); tv.setTypeface(tf)
How to set Font for TextView in android? Possible Duplicate: how to change the font on the text view in android? I tried a lot to set font for the TextView in my app. But there is no way seems to set font in android. I want to set Arial font for all of my TextView through xml. I added Arial.ttf to my assets still unabl...
TITLE: How to set Font for TextView in android? QUESTION: Possible Duplicate: how to change the font on the text view in android? I tried a lot to set font for the TextView in my app. But there is no way seems to set font in android. I want to set Arial font for all of my TextView through xml. I added Arial.ttf to my ...
[ "android", "android-layout" ]
8
23
20,250
1
0
2011-06-07T20:44:03.320000
2011-06-07T20:57:11.900000