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,257,945 | 6,257,989 | AES decryption on Android too slow to be usable. Will NDK be faster? Other ideas? | I've implemented AES/CTR on Android using the built-in Cipher class. Decryption appears to be far too slow for my purposes, with a 128KB block taking approximately 6 seconds to decrypt on the emulator and 2.6 seconds on the Samsung Galaxy hardware. I'm wondering if building OpenSSL using the NDK and calling its methods... | Yes, heavy lifting like that in a contained function is exactly where the NDK would shine. Keep in mind that Java is interpreted, and on pre-2.2 Android, there is no JIT, so every instruction is interpreted each time - that is a huge overhead. Even with JIT, every array access does implicit bounds checking, so there is... | AES decryption on Android too slow to be usable. Will NDK be faster? Other ideas? I've implemented AES/CTR on Android using the built-in Cipher class. Decryption appears to be far too slow for my purposes, with a 128KB block taking approximately 6 seconds to decrypt on the emulator and 2.6 seconds on the Samsung Galaxy... | TITLE:
AES decryption on Android too slow to be usable. Will NDK be faster? Other ideas?
QUESTION:
I've implemented AES/CTR on Android using the built-in Cipher class. Decryption appears to be far too slow for my purposes, with a 128KB block taking approximately 6 seconds to decrypt on the emulator and 2.6 seconds on ... | [
"java",
"android",
"aes",
"performance"
] | 7 | 7 | 4,492 | 1 | 0 | 2011-06-06T20:56:13.693000 | 2011-06-06T21:02:38.283000 |
6,257,948 | 6,258,198 | Copy a list (txt) of files | I've seen some scripts examples over SO, but none of them seems to provide examples of how to read filenames from a.txt list. This example is good, so as to copy all files from A to B folder xcopy c:\olddir\*.java c:\newdir /D /E /Q /Y But I need something like the next, where I can fill actually the source and destina... | Given your list of file names in a file called File-list.txt, the following lines should do what you want: @echo off set src_folder=c:\whatever set dst_folder=c:\target for /f "tokens=*" %%i in (File-list.txt) DO ( xcopy /S/E "%src_folder%\%%i" "%dst_folder%" ) | Copy a list (txt) of files I've seen some scripts examples over SO, but none of them seems to provide examples of how to read filenames from a.txt list. This example is good, so as to copy all files from A to B folder xcopy c:\olddir\*.java c:\newdir /D /E /Q /Y But I need something like the next, where I can fill actu... | TITLE:
Copy a list (txt) of files
QUESTION:
I've seen some scripts examples over SO, but none of them seems to provide examples of how to read filenames from a.txt list. This example is good, so as to copy all files from A to B folder xcopy c:\olddir\*.java c:\newdir /D /E /Q /Y But I need something like the next, whe... | [
"batch-file",
"scripting-language"
] | 31 | 53 | 90,910 | 6 | 0 | 2011-06-06T20:56:26.523000 | 2011-06-06T21:24:48.573000 |
6,257,952 | 6,258,503 | Performance of recursively searching for indices in large sets of data | I came across a question today of search efficiency for large sets today and I've done by best to boil it down to the most basic case. I feel like this sort of thing probably relates to some classic problem or basic concept I'm missing, so a pointer to that would be great. Suppose I have a table definition like CREATE ... | Your example is a bit difficult to parse, but ill start at the top: Your first function does not return all of the elements with type = 1. It returns all of the elements that are dependent (based on references) to the element you pass in. From the PHP standpoint, since the link/handle is already open there is a non-tri... | Performance of recursively searching for indices in large sets of data I came across a question today of search efficiency for large sets today and I've done by best to boil it down to the most basic case. I feel like this sort of thing probably relates to some classic problem or basic concept I'm missing, so a pointer... | TITLE:
Performance of recursively searching for indices in large sets of data
QUESTION:
I came across a question today of search efficiency for large sets today and I've done by best to boil it down to the most basic case. I feel like this sort of thing probably relates to some classic problem or basic concept I'm mis... | [
"php",
"mysql",
"database"
] | 3 | 0 | 87 | 1 | 0 | 2011-06-06T20:57:32.763000 | 2011-06-06T21:57:38.740000 |
6,257,954 | 6,258,007 | new entry in the hashset | Is there any way to know what was the last new entries that were added to a hashset? In my program the first cycle adds [Emmy, Carl] and than on my second cycle it adds [Emmy, Dan, Carl] is there anyway I can just use dan and not the rest of them for cycle three? | HashSet s do not carry information about the order in which you add elements. You need to replace it with a Collection that does (e.g. ArrayList ). | new entry in the hashset Is there any way to know what was the last new entries that were added to a hashset? In my program the first cycle adds [Emmy, Carl] and than on my second cycle it adds [Emmy, Dan, Carl] is there anyway I can just use dan and not the rest of them for cycle three? | TITLE:
new entry in the hashset
QUESTION:
Is there any way to know what was the last new entries that were added to a hashset? In my program the first cycle adds [Emmy, Carl] and than on my second cycle it adds [Emmy, Dan, Carl] is there anyway I can just use dan and not the rest of them for cycle three?
ANSWER:
Hash... | [
"java",
"hashset"
] | 0 | 1 | 423 | 5 | 0 | 2011-06-06T20:57:41.687000 | 2011-06-06T21:04:08.527000 |
6,257,957 | 6,258,039 | Validating parameters passed through the URL | I am working on an ASP.Net MVC3 application and I'm having trouble understanding the "right way" to do the validation I'm looking for. For example, consider a model that looks like this: [Required] [StringLength(10, MinimumLength = 10)] [RegularExpression("[0-9]{10}")] public string Id { get; set; }
[Required] public ... | When you perform a GET, you are simply retrieving a model with a given ID. So there is no validation performed. If you really want to make sure that requested model IDs should be 10 numbers in length, you should define constraint in Global.asax: routes.MapRoute( "Product", "Product/{productId}", new {controller="Produc... | Validating parameters passed through the URL I am working on an ASP.Net MVC3 application and I'm having trouble understanding the "right way" to do the validation I'm looking for. For example, consider a model that looks like this: [Required] [StringLength(10, MinimumLength = 10)] [RegularExpression("[0-9]{10}")] publi... | TITLE:
Validating parameters passed through the URL
QUESTION:
I am working on an ASP.Net MVC3 application and I'm having trouble understanding the "right way" to do the validation I'm looking for. For example, consider a model that looks like this: [Required] [StringLength(10, MinimumLength = 10)] [RegularExpression("... | [
"asp.net-mvc-3"
] | 1 | 3 | 1,949 | 2 | 0 | 2011-06-06T20:58:07.613000 | 2011-06-06T21:06:23.573000 |
6,257,958 | 6,257,996 | query on iOS app deployment methods | Googling this topic I get a sense there are three ways apple allows to distribute the app to end user. However it's still quite vague how exactly each one of these methods actually work and differ. Ad Hoc Distribution - how does this really work. does this method not require the app to be submitted on app store? If Yes... | Ad Hoc Distribution - This is most commonly used for sending the applications to beta testers, you register their UDID in your Developer Portal and then send them the app bundle and a provisioning profile. They drag these into iTunes and can install the application. In-House Distribution - If I recall correctly this is... | query on iOS app deployment methods Googling this topic I get a sense there are three ways apple allows to distribute the app to end user. However it's still quite vague how exactly each one of these methods actually work and differ. Ad Hoc Distribution - how does this really work. does this method not require the app ... | TITLE:
query on iOS app deployment methods
QUESTION:
Googling this topic I get a sense there are three ways apple allows to distribute the app to end user. However it's still quite vague how exactly each one of these methods actually work and differ. Ad Hoc Distribution - how does this really work. does this method no... | [
"ios"
] | 2 | 2 | 695 | 3 | 0 | 2011-06-06T20:58:10.777000 | 2011-06-06T21:03:20.930000 |
6,257,966 | 6,258,011 | code igniter php - unserialize an array | I have previously serialized an array in PHP and submitted it to a database. Now, in my model in Code Igniter, I want to unserialize that data but I'm not sure how to reference it. Here's my code: function get_selected_member($member = null){ if($member!= NULL){ $this->db->where('id', $member); //conditions } $query = ... | You should be able to use $member_dep = unserialize($member_result->member_dep); | code igniter php - unserialize an array I have previously serialized an array in PHP and submitted it to a database. Now, in my model in Code Igniter, I want to unserialize that data but I'm not sure how to reference it. Here's my code: function get_selected_member($member = null){ if($member!= NULL){ $this->db->where(... | TITLE:
code igniter php - unserialize an array
QUESTION:
I have previously serialized an array in PHP and submitted it to a database. Now, in my model in Code Igniter, I want to unserialize that data but I'm not sure how to reference it. Here's my code: function get_selected_member($member = null){ if($member!= NULL){... | [
"php",
"codeigniter",
"serialization"
] | 2 | 8 | 4,549 | 1 | 0 | 2011-06-06T20:59:37.707000 | 2011-06-06T21:04:11.630000 |
6,257,969 | 6,258,089 | WP7 Update Tile locally | is there a possibility in WP7 to update a tile from the depending application. For example a weather service that updates the tile every hour (ShellTileSchedule). Thanks in advance. | If using the current (7.0 / pre-mango tools) the way to update the tile locally is via the ShellTileSchedule. Alternatively you could try sending the TileNotification push notification from your app. (Note that I haven't tried this myself and I've heard mixed reports of how successful this is.) You can't do this when t... | WP7 Update Tile locally is there a possibility in WP7 to update a tile from the depending application. For example a weather service that updates the tile every hour (ShellTileSchedule). Thanks in advance. | TITLE:
WP7 Update Tile locally
QUESTION:
is there a possibility in WP7 to update a tile from the depending application. For example a weather service that updates the tile every hour (ShellTileSchedule). Thanks in advance.
ANSWER:
If using the current (7.0 / pre-mango tools) the way to update the tile locally is via ... | [
"c#",
"windows-phone-7",
"tiles"
] | 4 | 2 | 505 | 1 | 0 | 2011-06-06T21:00:04.020000 | 2011-06-06T21:13:41.093000 |
6,257,971 | 6,258,002 | What's Android Equivalent of iOS's Post Notification and Delegate function? | I find the Post notification and delegate function are very useful in iOS. Once I finish a task I can notify another piece of code to do something. I am sending out notices for others to do the work. Post Notification is when you sending notice right away, whereas delegate sometime down the line it will send a notice. ... | Handler which can be fired right away or with postDelay() you can fire them later | What's Android Equivalent of iOS's Post Notification and Delegate function? I find the Post notification and delegate function are very useful in iOS. Once I finish a task I can notify another piece of code to do something. I am sending out notices for others to do the work. Post Notification is when you sending notice... | TITLE:
What's Android Equivalent of iOS's Post Notification and Delegate function?
QUESTION:
I find the Post notification and delegate function are very useful in iOS. Once I finish a task I can notify another piece of code to do something. I am sending out notices for others to do the work. Post Notification is when ... | [
"iphone",
"android"
] | 2 | 1 | 1,164 | 3 | 0 | 2011-06-06T21:00:33.137000 | 2011-06-06T21:03:53.310000 |
6,257,980 | 6,275,809 | Can't load assembly at runtime | I'm working with a 3rd party assembly to implement something in our in-house software. I can make the refence and work with the library without a problem, but when I run the program to test it i'm getting this error "Can't load file or assembly "assembly file" nor either of its dependencies. The system couldn't find th... | Assembly Binding Log Viewer: The Assembly Binding Log Viewer displays details for assembly binds. This information helps you diagnose why the.NET Framework cannot locate an assembly at run time. | Can't load assembly at runtime I'm working with a 3rd party assembly to implement something in our in-house software. I can make the refence and work with the library without a problem, but when I run the program to test it i'm getting this error "Can't load file or assembly "assembly file" nor either of its dependenci... | TITLE:
Can't load assembly at runtime
QUESTION:
I'm working with a 3rd party assembly to implement something in our in-house software. I can make the refence and work with the library without a problem, but when I run the program to test it i'm getting this error "Can't load file or assembly "assembly file" nor either... | [
"vb.net",
"visual-studio-2008",
"assemblies"
] | 0 | 1 | 1,333 | 3 | 0 | 2011-06-06T21:01:32.600000 | 2011-06-08T07:58:38.210000 |
6,257,982 | 6,258,367 | Writing a code formatting tool for a programming language | I'm looking into the feasibility of writing a code formatting tool for the Apex language, a Salesforce.com variation on Java, and perhams VisualForce, its tag based markup language. I have no idea on where to start this, apart from feeling/knowing that writing a language parser from scratch is probably not the best app... | Since Apex syntax is similar to Java, I'd look at Eclipse's JDT. Edit down the Java grammar to match Apex. Do the same w/ formatting rules/options. This is more than a few days of work. | Writing a code formatting tool for a programming language I'm looking into the feasibility of writing a code formatting tool for the Apex language, a Salesforce.com variation on Java, and perhams VisualForce, its tag based markup language. I have no idea on where to start this, apart from feeling/knowing that writing a... | TITLE:
Writing a code formatting tool for a programming language
QUESTION:
I'm looking into the feasibility of writing a code formatting tool for the Apex language, a Salesforce.com variation on Java, and perhams VisualForce, its tag based markup language. I have no idea on where to start this, apart from feeling/know... | [
"parsing",
"antlr",
"salesforce",
"lexer",
"force.com"
] | 11 | 2 | 5,936 | 4 | 0 | 2011-06-06T21:01:36.217000 | 2011-06-06T21:41:38.610000 |
6,257,984 | 6,257,999 | If I set `let x = document.getElementById("inputText").value` and update `x`, why doesn’t the value update? | In the following example, why doesn’t the value property of the input with the ID test update to "second"? document.getElementById("test").addEventListener("click", () => { let test = document.getElementById("test").value;
test = "second"; console.log(test); // Logs "second", but input value is not updated. }); Click ... | Because Javascript assigned x as a value and not a reference to the original object. For example, you could instead: function setText(x) { document.getElementById('test').value = x; }
getText = function() { return document.getElementById('test').value; } And the value you set with setText() will be reflected by getTex... | If I set `let x = document.getElementById("inputText").value` and update `x`, why doesn’t the value update? In the following example, why doesn’t the value property of the input with the ID test update to "second"? document.getElementById("test").addEventListener("click", () => { let test = document.getElementById("tes... | TITLE:
If I set `let x = document.getElementById("inputText").value` and update `x`, why doesn’t the value update?
QUESTION:
In the following example, why doesn’t the value property of the input with the ID test update to "second"? document.getElementById("test").addEventListener("click", () => { let test = document.g... | [
"javascript",
"reference"
] | 4 | 6 | 35,781 | 12 | 0 | 2011-06-06T21:01:41.330000 | 2011-06-06T21:03:44.597000 |
6,257,995 | 6,258,092 | python: What's the rationale behind not allowing * in relative imports? | What's the rationale behind not allowing * in relative imports? e.g. from..new_tool import * or doing a relative import directly: import..new_tool | The reason the latter is prohibited is that..new_tool is not usable in an expression (PEP 328): The reason import.foo is prohibited is because after import XXX.YYY.ZZZ then XXX.YYY.ZZZ is usable in an expression. But.moduleY is not usable in an expression. Since * -imports should only ever be a quick hack while in deve... | python: What's the rationale behind not allowing * in relative imports? What's the rationale behind not allowing * in relative imports? e.g. from..new_tool import * or doing a relative import directly: import..new_tool | TITLE:
python: What's the rationale behind not allowing * in relative imports?
QUESTION:
What's the rationale behind not allowing * in relative imports? e.g. from..new_tool import * or doing a relative import directly: import..new_tool
ANSWER:
The reason the latter is prohibited is that..new_tool is not usable in an ... | [
"python",
"relative-path",
"python-packaging"
] | 8 | 7 | 181 | 1 | 0 | 2011-06-06T21:03:15.600000 | 2011-06-06T21:14:03.913000 |
6,258,001 | 6,258,529 | Real Time Search in UITableView | I have implemented a UISearchBar for finding an element in UITableView. Everything seems to work fine, and now I am at the part where I need to actually perform real-time search for every key pressed in the textField, and narrow down the search with every button press. So before I start coding, I wanted to know if ther... | It so happens that there is in fact an inbuilt function that helps with RealTime Search. Phew! NSRange match = [userNameString rangeOfString:searchText options:NSCaseInsensitiveSearch]; // match.location will provide the exact location of a match of searchText with a String // match.length will provide the length of ma... | Real Time Search in UITableView I have implemented a UISearchBar for finding an element in UITableView. Everything seems to work fine, and now I am at the part where I need to actually perform real-time search for every key pressed in the textField, and narrow down the search with every button press. So before I start ... | TITLE:
Real Time Search in UITableView
QUESTION:
I have implemented a UISearchBar for finding an element in UITableView. Everything seems to work fine, and now I am at the part where I need to actually perform real-time search for every key pressed in the textField, and narrow down the search with every button press. ... | [
"iphone",
"objective-c",
"ios",
"uitableview",
"search"
] | 2 | 1 | 640 | 1 | 0 | 2011-06-06T21:03:52.323000 | 2011-06-06T22:01:07.110000 |
6,258,004 | 6,258,536 | Types and classes of variables | Two R questions: What is the difference between the type (returned by typeof ) and the class (returned by class ) of a variable? Is the difference similar to that in, say, C++ language? What are possible types and classes of variables? | In R every "object" has a mode and a class. The former represents how an object is stored in memory (numeric, character, list and function) while the later represents its abstract type. For example: d <- data.frame(V1=c(1,2)) class(d) # [1] "data.frame" mode(d) # [1] "list" typeof(d) # list As you can see data frames a... | Types and classes of variables Two R questions: What is the difference between the type (returned by typeof ) and the class (returned by class ) of a variable? Is the difference similar to that in, say, C++ language? What are possible types and classes of variables? | TITLE:
Types and classes of variables
QUESTION:
Two R questions: What is the difference between the type (returned by typeof ) and the class (returned by class ) of a variable? Is the difference similar to that in, say, C++ language? What are possible types and classes of variables?
ANSWER:
In R every "object" has a ... | [
"class",
"r",
"types"
] | 90 | 104 | 53,926 | 2 | 0 | 2011-06-06T21:03:55.407000 | 2011-06-06T22:01:47.770000 |
6,258,014 | 6,258,045 | php JSON decode with Twitter geo/search | How do I get coordinates from twitter geo/search? There are four coordinates in the JSON tree, but the result is array. How to? Thanks. API URL: https://api.twitter.com/1/geo/search.json?query=tokyo //での取得結果 json[result]['places']['0']['name']=Tokyo json[result]['places']['0']['bounding_box']['type']=Polygon json[resul... | If you have JSON contents, you can use json_decode() function - it'll return nice array you can read. http://php.net/manual/en/function.json-decode.php | php JSON decode with Twitter geo/search How do I get coordinates from twitter geo/search? There are four coordinates in the JSON tree, but the result is array. How to? Thanks. API URL: https://api.twitter.com/1/geo/search.json?query=tokyo //での取得結果 json[result]['places']['0']['name']=Tokyo json[result]['places']['0']['b... | TITLE:
php JSON decode with Twitter geo/search
QUESTION:
How do I get coordinates from twitter geo/search? There are four coordinates in the JSON tree, but the result is array. How to? Thanks. API URL: https://api.twitter.com/1/geo/search.json?query=tokyo //での取得結果 json[result]['places']['0']['name']=Tokyo json[result]... | [
"php",
"json"
] | 1 | 2 | 874 | 1 | 0 | 2011-06-06T21:04:33.917000 | 2011-06-06T21:06:49.170000 |
6,258,025 | 6,259,012 | Access exception.class.name in spring:message tag when using SimpleMappingExceptionResolver | In several previous projects (all pre-Spring 3.0), I had a single error handling jsp file (usually "message.jsp") that had a line similar to the following: This allowed me to map exceptions to this page and resolve certain localized error messages based on the exception type by defining a derivative of the SimpleMappin... | The EL implementation in Tomcat 7 has indeed been changed to disallow Java keyword literals such as class, new, static etcetera as EL properties. The only solution as far is to access them using the brace notation instead: ${exception['class'].name} See also Tomcat issue 50147. | Access exception.class.name in spring:message tag when using SimpleMappingExceptionResolver In several previous projects (all pre-Spring 3.0), I had a single error handling jsp file (usually "message.jsp") that had a line similar to the following: This allowed me to map exceptions to this page and resolve certain local... | TITLE:
Access exception.class.name in spring:message tag when using SimpleMappingExceptionResolver
QUESTION:
In several previous projects (all pre-Spring 3.0), I had a single error handling jsp file (usually "message.jsp") that had a line similar to the following: This allowed me to map exceptions to this page and res... | [
"spring",
"servlets",
"exception",
"jstl"
] | 6 | 18 | 3,226 | 1 | 0 | 2011-06-06T21:05:17.177000 | 2011-06-06T23:07:56.423000 |
6,258,027 | 6,258,147 | Draw rectangles with space between them in Android | I want to draw five rectangle bars in Android. I have the regtangles, but now I want them to be a bit spaced apart. I want them to be aligned at the bottom, and with the same distance between them. for (int i= 0; i<4; i++) { int ce = heigth[i];
Paint rectanglePaint = new Paint(); rectanglePaint.setARGB(255, 0, 0, 0); ... | Perhaps height[i] do not change? Thisn should create four 10x10 rectangles separated 35 px to the left each other. BTW, you do not need to create four Paint objects. Reuse the same for the four rectangles for improved efficiency. Paint rectanglePaint = new Paint(); rectanglePaint.setARGB(255, 0, 0, 0); rectanglePaint.s... | Draw rectangles with space between them in Android I want to draw five rectangle bars in Android. I have the regtangles, but now I want them to be a bit spaced apart. I want them to be aligned at the bottom, and with the same distance between them. for (int i= 0; i<4; i++) { int ce = heigth[i];
Paint rectanglePaint = ... | TITLE:
Draw rectangles with space between them in Android
QUESTION:
I want to draw five rectangle bars in Android. I have the regtangles, but now I want them to be a bit spaced apart. I want them to be aligned at the bottom, and with the same distance between them. for (int i= 0; i<4; i++) { int ce = heigth[i];
Paint... | [
"android",
"canvas",
"ondraw"
] | 0 | 4 | 3,911 | 1 | 0 | 2011-06-06T21:05:31.443000 | 2011-06-06T21:19:25.357000 |
6,258,028 | 6,258,246 | Mac Multi-touch in a web application | In a web application (or even in Titanium Desktop) is it possible to recognize and use multi-touch gestures (i.e pinching/3-finger swipe)? | Its all about browser support. Browsers which support HTML5 extensively, give u javascript events for gestures, take a look at this link. | Mac Multi-touch in a web application In a web application (or even in Titanium Desktop) is it possible to recognize and use multi-touch gestures (i.e pinching/3-finger swipe)? | TITLE:
Mac Multi-touch in a web application
QUESTION:
In a web application (or even in Titanium Desktop) is it possible to recognize and use multi-touch gestures (i.e pinching/3-finger swipe)?
ANSWER:
Its all about browser support. Browsers which support HTML5 extensively, give u javascript events for gestures, take ... | [
"javascript",
"macos",
"web-applications",
"titanium",
"appcelerator"
] | 5 | 2 | 820 | 1 | 0 | 2011-06-06T21:05:31.863000 | 2011-06-06T21:29:31.763000 |
6,258,033 | 6,258,067 | Firefox Scrolbar CSS issue | I have a site that has a CSS layout and shouldn't have a scrollbar appear: http://souk.gumpshen.com/ But a scrollbar appears, I can't figure it out can anyone help please? | The height in there is causing the scrollbar to appear..flower { background: url("../images/flowers.png") no-repeat scroll 0 0 transparent; height: 400px; left: 696px; position: relative; top: -360px; width: 400px; z-index: 101; } For what you're doing, change top to margin-top and it should fix it. | Firefox Scrolbar CSS issue I have a site that has a CSS layout and shouldn't have a scrollbar appear: http://souk.gumpshen.com/ But a scrollbar appears, I can't figure it out can anyone help please? | TITLE:
Firefox Scrolbar CSS issue
QUESTION:
I have a site that has a CSS layout and shouldn't have a scrollbar appear: http://souk.gumpshen.com/ But a scrollbar appears, I can't figure it out can anyone help please?
ANSWER:
The height in there is causing the scrollbar to appear..flower { background: url("../images/fl... | [
"html",
"css"
] | 0 | 2 | 46 | 2 | 0 | 2011-06-06T21:06:07.980000 | 2011-06-06T21:10:42.663000 |
6,258,037 | 6,258,100 | Not able to toggle on Firefox | <% var index = 0; foreach (var item in Model) { %> <%= index % 2 == 0? "row":"rowAlt" %> var cId = <%= item.Id %> <%= item.IsEditable? "onclick='page.toggleMe(cId)'":"" %> <% index++; } %> The code above works on IE and toggles the row by passing cId. However, the same code doesn't work in Firefox. I think it is not ab... | I'll attempt to post a fix for this, but there are quite a few mistakes in the code you posted; likewise, the way you are going about this is very awkward to say the least. Furthermore, I am unclear as to what your goal is. <% var index = 0; foreach (var item in Model) { %> <%= index % 2 == 0? "row":"rowAlt" %>" id="<%... | Not able to toggle on Firefox <% var index = 0; foreach (var item in Model) { %> <%= index % 2 == 0? "row":"rowAlt" %> var cId = <%= item.Id %> <%= item.IsEditable? "onclick='page.toggleMe(cId)'":"" %> <% index++; } %> The code above works on IE and toggles the row by passing cId. However, the same code doesn't work in... | TITLE:
Not able to toggle on Firefox
QUESTION:
<% var index = 0; foreach (var item in Model) { %> <%= index % 2 == 0? "row":"rowAlt" %> var cId = <%= item.Id %> <%= item.IsEditable? "onclick='page.toggleMe(cId)'":"" %> <% index++; } %> The code above works on IE and toggles the row by passing cId. However, the same co... | [
"asp.net",
"html",
"css",
"asp.net-mvc-2",
"firefox"
] | 0 | 1 | 53 | 1 | 0 | 2011-06-06T21:06:21.067000 | 2011-06-06T21:14:53.817000 |
6,258,050 | 6,258,094 | Help shortening repeated jQuery event listeners | My code repeats as follows: $("#school-name").autocomplete("/ajax/campus_ajax.php", { width: 218, delay: 300, selectFirst: false, resultsClass: 'ac_results_class', loadingClass: 'ac_loading', formatItem: function(data) { if (data[2]) { return data[0] + ' ' + data[2] + ' '; } else { return data[0]; } } });
$("#school-n... | IMO, shortening this code makes it less readable and as configuration parameters outside the reach of DRY (Don't Repeat Yourself). With that said, to answer your questions, there are two quick things you could do. First, break out the formatItem into a generic function instead of an anonymous function. function myForma... | Help shortening repeated jQuery event listeners My code repeats as follows: $("#school-name").autocomplete("/ajax/campus_ajax.php", { width: 218, delay: 300, selectFirst: false, resultsClass: 'ac_results_class', loadingClass: 'ac_loading', formatItem: function(data) { if (data[2]) { return data[0] + ' ' + data[2] + ' '... | TITLE:
Help shortening repeated jQuery event listeners
QUESTION:
My code repeats as follows: $("#school-name").autocomplete("/ajax/campus_ajax.php", { width: 218, delay: 300, selectFirst: false, resultsClass: 'ac_results_class', loadingClass: 'ac_loading', formatItem: function(data) { if (data[2]) { return data[0] + '... | [
"jquery"
] | 0 | 1 | 120 | 5 | 0 | 2011-06-06T21:07:42.273000 | 2011-06-06T21:14:26.690000 |
6,258,052 | 6,282,442 | Illegal read/write error when making legacy code x64 compliant | I have the following MyType::Is_Inst () function which is throwing an invalid memory access error on return in 64-bit mode but not in 32-bit: MyType MyType::Is_Inst () { unsigned char Bar=0; MyType Foo={0}; return Foo; } Looking at the disassembly + step-through, the program crashes at the line mov dword ptr [rax],ecx.... | I've posted a bug report to MS here: https://connect.microsoft.com/VisualStudio/feedback/details/674672/callee-disassembly-expects-address-which-caller-is-not-providing-in-x64-mode Again, thanks to all for your help! | Illegal read/write error when making legacy code x64 compliant I have the following MyType::Is_Inst () function which is throwing an invalid memory access error on return in 64-bit mode but not in 32-bit: MyType MyType::Is_Inst () { unsigned char Bar=0; MyType Foo={0}; return Foo; } Looking at the disassembly + step-th... | TITLE:
Illegal read/write error when making legacy code x64 compliant
QUESTION:
I have the following MyType::Is_Inst () function which is throwing an invalid memory access error on return in 64-bit mode but not in 32-bit: MyType MyType::Is_Inst () { unsigned char Bar=0; MyType Foo={0}; return Foo; } Looking at the dis... | [
"c++",
"visual-studio-2010",
"64-bit",
"unmanaged"
] | 3 | 1 | 346 | 3 | 0 | 2011-06-06T21:08:12.133000 | 2011-06-08T16:58:06.173000 |
6,258,064 | 6,258,122 | Copying files from temporary internet cache in python | I'm copying files from the temporary internet files cache into a folder, in bulk using a python script. Using shutil to copy the full path to the os.cwd, it comes up with this error: builtins.IOError: [Errno 22] Invalid argument: 'C:\\Users\\NICK\\AppData\\(no whitespace in path; only for readability) Local\\Microsoft\... | There is a backslash at the end of your file name so it is maybe treated as a path. | Copying files from temporary internet cache in python I'm copying files from the temporary internet files cache into a folder, in bulk using a python script. Using shutil to copy the full path to the os.cwd, it comes up with this error: builtins.IOError: [Errno 22] Invalid argument: 'C:\\Users\\NICK\\AppData\\(no white... | TITLE:
Copying files from temporary internet cache in python
QUESTION:
I'm copying files from the temporary internet files cache into a folder, in bulk using a python script. Using shutil to copy the full path to the os.cwd, it comes up with this error: builtins.IOError: [Errno 22] Invalid argument: 'C:\\Users\\NICK\\... | [
"python",
"shutil"
] | 0 | 1 | 416 | 1 | 0 | 2011-06-06T21:10:33.893000 | 2011-06-06T21:16:53.777000 |
6,258,081 | 6,258,166 | Pythonic get element of array or default if it doesn't exist | We have matches = re.findall(r'somewhat', 'somewhere') Can we simplify this if len(matches) > index: return matches[index] else: return 'default' or return matches[index] if len(mathes) > index else 'default' to something similar to JS's return matches[index] || 'default' that we can simply use return 'somewhere'.match... | Something like this might help: >>> reg = re.compile('-\d+-') >>> reg.findall('a-23-b-12-c') or ['default'] ['-23-', '-12-'] >>> reg.findall('a-b-c') or ['default'] ['default'] Edit Ugly one-liner (reg.findall('a-b-c')[index:] or ['default'])[0] | Pythonic get element of array or default if it doesn't exist We have matches = re.findall(r'somewhat', 'somewhere') Can we simplify this if len(matches) > index: return matches[index] else: return 'default' or return matches[index] if len(mathes) > index else 'default' to something similar to JS's return matches[index]... | TITLE:
Pythonic get element of array or default if it doesn't exist
QUESTION:
We have matches = re.findall(r'somewhat', 'somewhere') Can we simplify this if len(matches) > index: return matches[index] else: return 'default' or return matches[index] if len(mathes) > index else 'default' to something similar to JS's ret... | [
"python",
"list",
"element",
"default"
] | 2 | 4 | 548 | 3 | 0 | 2011-06-06T21:12:25.783000 | 2011-06-06T21:21:48.073000 |
6,258,088 | 6,258,125 | How to check if a given object is an instance of the class name given in a String? | I have the following variables MyObj myObj = new MyObj(); String myString = "myPackage.MyObj"; where MyObj look like this package myPackage;
class MyObj { private String one; private String two; } How can I check if myObj is an instance of the full qualified class name as represented by the string myString? | You can use Class#isInstance() for this. if (Class.forName(myString).isInstance(myObj)) { // myObj is an instance of the class as specified by myString. } | How to check if a given object is an instance of the class name given in a String? I have the following variables MyObj myObj = new MyObj(); String myString = "myPackage.MyObj"; where MyObj look like this package myPackage;
class MyObj { private String one; private String two; } How can I check if myObj is an instance... | TITLE:
How to check if a given object is an instance of the class name given in a String?
QUESTION:
I have the following variables MyObj myObj = new MyObj(); String myString = "myPackage.MyObj"; where MyObj look like this package myPackage;
class MyObj { private String one; private String two; } How can I check if my... | [
"java",
"instanceof"
] | 5 | 19 | 6,976 | 2 | 0 | 2011-06-06T21:13:37.543000 | 2011-06-06T21:17:12.170000 |
6,258,091 | 6,258,112 | In python how can I iterate through a string splitting it at different spots as I go? | I'm trying to write a quick solve for Kaprekar number's to show a friend of mine how easy it is to implement something like this in Python. I know how to do all the steps except for iterating through the squared number as a string. For example 45 is a Kaprekar number because 45 ** 2 = 2025 and 20 + 25 = 45 What I'm try... | >>> s = '2025' >>> for i in range(1, len(s)):... print s[:i], s[i:]... 2 025 20 25 202 5 | In python how can I iterate through a string splitting it at different spots as I go? I'm trying to write a quick solve for Kaprekar number's to show a friend of mine how easy it is to implement something like this in Python. I know how to do all the steps except for iterating through the squared number as a string. Fo... | TITLE:
In python how can I iterate through a string splitting it at different spots as I go?
QUESTION:
I'm trying to write a quick solve for Kaprekar number's to show a friend of mine how easy it is to implement something like this in Python. I know how to do all the steps except for iterating through the squared numb... | [
"python",
"string",
"math"
] | 2 | 7 | 244 | 2 | 0 | 2011-06-06T21:13:59.353000 | 2011-06-06T21:16:04.347000 |
6,258,093 | 6,258,620 | Remember selected ListView Items | I'm new to android and I have following problem I have a ListView. The ListView is filled with data from an ArrayList. I added a CheckBox to every row. After clicking on a "Resume-Button" I want to write the selected items to a SQLliteDB (the db works fine - I tested it with static data). My question is now: How can I ... | You can use this ListView method getCheckedItemPositions() to get all the checked positions. Make sure that the child view in your ListView actually implements the Checkable interface otherwise the checkmark information will not be passed along to the ListView. | Remember selected ListView Items I'm new to android and I have following problem I have a ListView. The ListView is filled with data from an ArrayList. I added a CheckBox to every row. After clicking on a "Resume-Button" I want to write the selected items to a SQLliteDB (the db works fine - I tested it with static data... | TITLE:
Remember selected ListView Items
QUESTION:
I'm new to android and I have following problem I have a ListView. The ListView is filled with data from an ArrayList. I added a CheckBox to every row. After clicking on a "Resume-Button" I want to write the selected items to a SQLliteDB (the db works fine - I tested i... | [
"java",
"android"
] | 2 | 4 | 968 | 3 | 0 | 2011-06-06T21:14:18.210000 | 2011-06-06T22:10:32.573000 |
6,258,095 | 6,258,129 | creating a jquery plugin on the jquery core $ object | I would like to create a plugin for jquery that doesn't work with the dom. I therefore don't need to use a jquery object from the $ function. I would like to make my own function called $.shortcut(keys,action) Icould probably just go $.prototype.shortcut = function(){//my code} but I would like to know if that's the be... | You just about have it already... $.shortcut = function(keys, action) { // code } I prefer to wrap mine in an anon function and pass jQuery as a param though. It helps avoid naming conflicts and makes for easier minification. (function($){ $.shortcut = function(keys, action) { // code } })(jQuery); | creating a jquery plugin on the jquery core $ object I would like to create a plugin for jquery that doesn't work with the dom. I therefore don't need to use a jquery object from the $ function. I would like to make my own function called $.shortcut(keys,action) Icould probably just go $.prototype.shortcut = function()... | TITLE:
creating a jquery plugin on the jquery core $ object
QUESTION:
I would like to create a plugin for jquery that doesn't work with the dom. I therefore don't need to use a jquery object from the $ function. I would like to make my own function called $.shortcut(keys,action) Icould probably just go $.prototype.sho... | [
"jquery",
"plugins"
] | 1 | 3 | 39 | 2 | 0 | 2011-06-06T21:14:30.557000 | 2011-06-06T21:17:37.443000 |
6,258,107 | 6,258,179 | Play! - max constraint doesn't work | I'm having a problem with my application and @Max constraint annotation. My controller method is defined like this: public static void save(@Required @Max(255) String content) Later in my code I have error check: if (Validation.hasErrors()) { render("Foo/bar.html", content); } The thing is, no matter what I post in the... | It sounds like you actually wanted to use @MaxSize to ensure that the length of the input was no more than 255. Right now you're using @Max, which tries to convert the argument to a number to make sure it's numerically less than or equal to the given value. Your text can't be converted to a number, so the validation al... | Play! - max constraint doesn't work I'm having a problem with my application and @Max constraint annotation. My controller method is defined like this: public static void save(@Required @Max(255) String content) Later in my code I have error check: if (Validation.hasErrors()) { render("Foo/bar.html", content); } The th... | TITLE:
Play! - max constraint doesn't work
QUESTION:
I'm having a problem with my application and @Max constraint annotation. My controller method is defined like this: public static void save(@Required @Max(255) String content) Later in my code I have error check: if (Validation.hasErrors()) { render("Foo/bar.html", ... | [
"constraints",
"playframework",
"max"
] | 2 | 3 | 91 | 1 | 0 | 2011-06-06T21:15:45.930000 | 2011-06-06T21:22:48.987000 |
6,258,127 | 6,258,240 | How do I set the common properties in subclasses? | I'm new to OO programming, and I'm trying to understand how to assign values to common properties from subclasses in a proper manner. I always end up doing it in different ways every time, so I thought it would be a good idea to ask you how you normally do. Let's say that I have a parent class, Fruit,and two subclasses... | There is no "silver bullet". In general, all the fields that are expected to be different in subclasses should be set through the parameters of the constructor to ensure that they are explicitly set. Other fields can be initialized by assigning values to the properties. For example, the color of a fruit can be set by a... | How do I set the common properties in subclasses? I'm new to OO programming, and I'm trying to understand how to assign values to common properties from subclasses in a proper manner. I always end up doing it in different ways every time, so I thought it would be a good idea to ask you how you normally do. Let's say th... | TITLE:
How do I set the common properties in subclasses?
QUESTION:
I'm new to OO programming, and I'm trying to understand how to assign values to common properties from subclasses in a proper manner. I always end up doing it in different ways every time, so I thought it would be a good idea to ask you how you normall... | [
"php"
] | 4 | 3 | 639 | 3 | 0 | 2011-06-06T21:17:19.377000 | 2011-06-06T21:28:51.130000 |
6,258,136 | 6,258,723 | using windiff inside Perforce GUI tool | Perforce diff tool is text based, instead windiff is much better. Is there a way to set windiff to be the default diff tool inside perforce? | If you're using P4V, go to Edit -> Preferences, and then to go the Diff tab. Pick the "Other application" radio button and then pick the program you want to use. | using windiff inside Perforce GUI tool Perforce diff tool is text based, instead windiff is much better. Is there a way to set windiff to be the default diff tool inside perforce? | TITLE:
using windiff inside Perforce GUI tool
QUESTION:
Perforce diff tool is text based, instead windiff is much better. Is there a way to set windiff to be the default diff tool inside perforce?
ANSWER:
If you're using P4V, go to Edit -> Preferences, and then to go the Diff tab. Pick the "Other application" radio b... | [
"diff",
"perforce"
] | 4 | 7 | 775 | 1 | 0 | 2011-06-06T21:18:13.760000 | 2011-06-06T22:23:42.030000 |
6,258,137 | 6,258,202 | How do I store this data set in C++ (which containers do I use)? | I have data represented as follows. A-> B,C,D,E,F B-> C,(D,E),F D-> (E,F) E-> (F,G) F-> (G) G-> NULL Each letter represents a string. All letters/strings are in alphabetical order. The B-> means that B is a member of every element succeeding it. So for this example row B consists of the sets (B,C), (B,D,E) and (B,F). E... | It seems a graph is what you are looking for, but the standard C++ library (STL) does not have such a data structure. The next best bet is multimap: a map is an 1:1 associated array, where as multimap is a 1:many associated array. | How do I store this data set in C++ (which containers do I use)? I have data represented as follows. A-> B,C,D,E,F B-> C,(D,E),F D-> (E,F) E-> (F,G) F-> (G) G-> NULL Each letter represents a string. All letters/strings are in alphabetical order. The B-> means that B is a member of every element succeeding it. So for th... | TITLE:
How do I store this data set in C++ (which containers do I use)?
QUESTION:
I have data represented as follows. A-> B,C,D,E,F B-> C,(D,E),F D-> (E,F) E-> (F,G) F-> (G) G-> NULL Each letter represents a string. All letters/strings are in alphabetical order. The B-> means that B is a member of every element succee... | [
"c++",
"vector",
"set",
"containers"
] | 2 | 2 | 187 | 2 | 0 | 2011-06-06T21:18:19.313000 | 2011-06-06T21:25:39.717000 |
6,258,138 | 6,259,873 | XNA dropshadow? | How can I make a dropshadow effect around a rectangle that I made out of primitives (line-strips) in XNA? I am currently making my rectangle by putting the primitives through a batch I made, and then adding textures as their background. These rectangles are supposed to symbolize "windows". I want them to have a cool dr... | easiest way? first render your object as a black silhouette, slightly offset in the opposite direction of your light source. Then when you render your object on top of it, you will have a nice little drop shadow. This is a very simple and low effort technique. | XNA dropshadow? How can I make a dropshadow effect around a rectangle that I made out of primitives (line-strips) in XNA? I am currently making my rectangle by putting the primitives through a batch I made, and then adding textures as their background. These rectangles are supposed to symbolize "windows". I want them t... | TITLE:
XNA dropshadow?
QUESTION:
How can I make a dropshadow effect around a rectangle that I made out of primitives (line-strips) in XNA? I am currently making my rectangle by putting the primitives through a batch I made, and then adding textures as their background. These rectangles are supposed to symbolize "windo... | [
"xna"
] | 2 | 11 | 1,102 | 2 | 0 | 2011-06-06T21:18:22.950000 | 2011-06-07T01:46:59.040000 |
6,258,139 | 6,258,250 | How to commit from command line to a SVN Google Code repository? | I know how to checkout but when I try to commit it gives me this message: svn: Commit failed (details follow): svn: Server sent unexpected return value (405 Method Not Allowed) in response to MKACTIVITY request for '/svn/!svn/act/25696683-c16a-45c6-9c35-9431e92548ec' | The goggle code ticket 1916 has all the possible causes for this: " 405 Method Not Allowed " usually means you have an HTTP proxy somewhere which is blocking WebDAV HTTP request such as MKCOL. The proxy might be on your network or ISP, or it might be built into Windows. Either way, this is a client-side problem (not re... | How to commit from command line to a SVN Google Code repository? I know how to checkout but when I try to commit it gives me this message: svn: Commit failed (details follow): svn: Server sent unexpected return value (405 Method Not Allowed) in response to MKACTIVITY request for '/svn/!svn/act/25696683-c16a-45c6-9c35-9... | TITLE:
How to commit from command line to a SVN Google Code repository?
QUESTION:
I know how to checkout but when I try to commit it gives me this message: svn: Commit failed (details follow): svn: Server sent unexpected return value (405 Method Not Allowed) in response to MKACTIVITY request for '/svn/!svn/act/2569668... | [
"svn"
] | 1 | 1 | 1,138 | 1 | 0 | 2011-06-06T21:18:26.093000 | 2011-06-06T21:30:25.437000 |
6,258,146 | 6,258,195 | Why do my links not work in Firefox | The links on the right side are supposed to be for categories. The first three links work but why do all the links after that not work? When you click on them nothing happens. The mouse doesn't change to a finger when you move your mouse over it. http://pinoydirectory.com/2011/directory/index.php I removed the styling,... | take out the table, tr, td { position: relative; } this is causing some overlap in your layout | Why do my links not work in Firefox The links on the right side are supposed to be for categories. The first three links work but why do all the links after that not work? When you click on them nothing happens. The mouse doesn't change to a finger when you move your mouse over it. http://pinoydirectory.com/2011/direct... | TITLE:
Why do my links not work in Firefox
QUESTION:
The links on the right side are supposed to be for categories. The first three links work but why do all the links after that not work? When you click on them nothing happens. The mouse doesn't change to a finger when you move your mouse over it. http://pinoydirecto... | [
"html",
"css",
"firefox",
"hyperlink"
] | 0 | 5 | 1,490 | 5 | 0 | 2011-06-06T21:19:21.490000 | 2011-06-06T21:24:28.183000 |
6,258,154 | 6,259,100 | MVC3 Change View from Jquery | I am new to MVC3 and Jquery. Maybe i am not taking the right approach to this, please let me know if there is a better solution. I want to use JQuery to change views in my MVC app. I have a list of products on the main page. When the user clicks a product, I Jquery to send a request to the server with the product ID an... | Try function productSelectedCallback() { var prodId = $(this).attr("id"); var targetUrl = '/Product/Details/' + prodId.toString(); $(this).load(targetUrl); } Edit: Change your action method on your controller from public ActionResult Details(string productId) { return View(); } to public ActionResult Details(int id) { ... | MVC3 Change View from Jquery I am new to MVC3 and Jquery. Maybe i am not taking the right approach to this, please let me know if there is a better solution. I want to use JQuery to change views in my MVC app. I have a list of products on the main page. When the user clicks a product, I Jquery to send a request to the ... | TITLE:
MVC3 Change View from Jquery
QUESTION:
I am new to MVC3 and Jquery. Maybe i am not taking the right approach to this, please let me know if there is a better solution. I want to use JQuery to change views in my MVC app. I have a list of products on the main page. When the user clicks a product, I Jquery to send... | [
"jquery",
"asp.net-mvc",
"asp.net-mvc-3",
"jquery-ui",
"razor"
] | 3 | 3 | 12,103 | 5 | 0 | 2011-06-06T21:20:17.247000 | 2011-06-06T23:18:30.653000 |
6,258,158 | 6,258,236 | C++/CLI: inherit from one CLR class, multiple C++ classes | In C++/CLI, I want a class hierarchy similar to the following: Foo FooA: Foo, ClrClassA FooB: Foo, ClrClassB Is it possible for FooA to share a (non CLR) base class while also inheriting from separate CLR classes? If not, what would be the best way for FooA and FooB to share common code? | Generally speaking, composition is often better than inheritance as it tends to lead to less tightly coupled designs. If you're mixing managed and unmanaged code, it's generally easier in my experience to wrap unmanaged code in managed code rather than visa versa. Multiple inheritance isn't supported for managed code a... | C++/CLI: inherit from one CLR class, multiple C++ classes In C++/CLI, I want a class hierarchy similar to the following: Foo FooA: Foo, ClrClassA FooB: Foo, ClrClassB Is it possible for FooA to share a (non CLR) base class while also inheriting from separate CLR classes? If not, what would be the best way for FooA and ... | TITLE:
C++/CLI: inherit from one CLR class, multiple C++ classes
QUESTION:
In C++/CLI, I want a class hierarchy similar to the following: Foo FooA: Foo, ClrClassA FooB: Foo, ClrClassB Is it possible for FooA to share a (non CLR) base class while also inheriting from separate CLR classes? If not, what would be the best... | [
".net",
"visual-c++",
"c++-cli",
"multiple-inheritance",
"mixed-mode"
] | 4 | 5 | 3,526 | 2 | 0 | 2011-06-06T21:21:06.887000 | 2011-06-06T21:28:23.960000 |
6,258,160 | 6,258,208 | Unloading the Assembly loaded with Assembly.LoadFrom() | I need to check the time amount to run GetTypes() after loading the dll. The code is as follows. Assembly assem = Assembly.LoadFrom(file); sw = Stopwatch.StartNew(); var types1 = assem.GetTypes(); sw.Stop(); double time1 = sw.Elapsed.TotalMilliseconds; I'd like to unload and reload the dll to check the time to spend in... | Unfortunately you can not unload an assembly once it is loaded. But you can unload an AppDomain. What you can do is to create a new AppDomain (AppDomain.CreateDomain(...) ), load the assembly into this appdomain to work with it, and then unload the AppDomain when needed. When unloading the AppDomain, all assemblies tha... | Unloading the Assembly loaded with Assembly.LoadFrom() I need to check the time amount to run GetTypes() after loading the dll. The code is as follows. Assembly assem = Assembly.LoadFrom(file); sw = Stopwatch.StartNew(); var types1 = assem.GetTypes(); sw.Stop(); double time1 = sw.Elapsed.TotalMilliseconds; I'd like to ... | TITLE:
Unloading the Assembly loaded with Assembly.LoadFrom()
QUESTION:
I need to check the time amount to run GetTypes() after loading the dll. The code is as follows. Assembly assem = Assembly.LoadFrom(file); sw = Stopwatch.StartNew(); var types1 = assem.GetTypes(); sw.Stop(); double time1 = sw.Elapsed.TotalMillisec... | [
"c#",
"garbage-collection",
"load",
"gettype"
] | 61 | 40 | 64,254 | 6 | 0 | 2011-06-06T21:21:14.370000 | 2011-06-06T21:26:08.220000 |
6,258,162 | 6,258,190 | Android close custom dialog | I am trying to get the custom dialog to close on button press //set up dialog Dialog dialog = new Dialog(BrowseActivity.this); dialog.setContentView(R.layout.about); dialog.setTitle("This is my custom dialog box"); dialog.setCancelable(true); //there are a lot of settings, for dialog, check them all out!
//set up text... | final Dialog dialog = new Dialog(BrowseActivity.this); You need lowercase dialog. public void onClick(View v) { dialog.dismiss(); } Also AlertDialog.Builder may be a better choice for you. | Android close custom dialog I am trying to get the custom dialog to close on button press //set up dialog Dialog dialog = new Dialog(BrowseActivity.this); dialog.setContentView(R.layout.about); dialog.setTitle("This is my custom dialog box"); dialog.setCancelable(true); //there are a lot of settings, for dialog, check ... | TITLE:
Android close custom dialog
QUESTION:
I am trying to get the custom dialog to close on button press //set up dialog Dialog dialog = new Dialog(BrowseActivity.this); dialog.setContentView(R.layout.about); dialog.setTitle("This is my custom dialog box"); dialog.setCancelable(true); //there are a lot of settings, ... | [
"android",
"android-dialogfragment",
"android-dialog"
] | 21 | 34 | 36,940 | 2 | 0 | 2011-06-06T21:21:22.520000 | 2011-06-06T21:24:06.520000 |
6,258,168 | 6,258,404 | Custom XML-element name for base class field in serialization | How can I change XML-element name for field inherited from base class while doing serialization? For example I have next base class: public class One { public int OneField; } Serialization code: static void Main() { One test = new One { OneField = 1 }; var serializer = new XmlSerializer(typeof (One)); TextWriter writer... | Try this: public class Two: One { private static XmlAttributeOverrides xmlOverrides; public static XmlAttributeOverrides XmlOverrides { get { if (xmlOverrides == null) { xmlOverrides = new XmlAttributeOverrides(); var attr = new XmlAttributes(); attr.XmlElements.Add(new XmlElementAttribute("FirstField")); xmlOverrides.... | Custom XML-element name for base class field in serialization How can I change XML-element name for field inherited from base class while doing serialization? For example I have next base class: public class One { public int OneField; } Serialization code: static void Main() { One test = new One { OneField = 1 }; var s... | TITLE:
Custom XML-element name for base class field in serialization
QUESTION:
How can I change XML-element name for field inherited from base class while doing serialization? For example I have next base class: public class One { public int OneField; } Serialization code: static void Main() { One test = new One { One... | [
"c#",
"xml",
"serialization",
"inheritance",
"xml-serialization"
] | 0 | 3 | 3,328 | 2 | 0 | 2011-06-06T21:21:50.397000 | 2011-06-06T21:46:18.080000 |
6,258,170 | 6,258,196 | parsing json with jquery | So I have a json object var json = {"School":{"Keywords":"HBS","SchoolName":"","SchoolUrl":"/Careers/Apply/University_recruiting/Schools/HBS.aspx"}, "School":{"Keywords":"Stanford","SchoolName":"","SchoolUrl":"/Careers/Apply/University_recruiting/Schools/Stanford.aspx"}} And I want to loop through it to find all of the... | $.each is used with arrays. What you have is not an array. It is a simple javascript object with properties. Here's how an array would look like in javascript: var json = [ { "Keywords":"HBS", "SchoolName":"", "SchoolUrl":"/Careers/Apply/University_recruiting/Schools/HBS.aspx" }, { "Keywords":"Stanford", "SchoolName":"... | parsing json with jquery So I have a json object var json = {"School":{"Keywords":"HBS","SchoolName":"","SchoolUrl":"/Careers/Apply/University_recruiting/Schools/HBS.aspx"}, "School":{"Keywords":"Stanford","SchoolName":"","SchoolUrl":"/Careers/Apply/University_recruiting/Schools/Stanford.aspx"}} And I want to loop thro... | TITLE:
parsing json with jquery
QUESTION:
So I have a json object var json = {"School":{"Keywords":"HBS","SchoolName":"","SchoolUrl":"/Careers/Apply/University_recruiting/Schools/HBS.aspx"}, "School":{"Keywords":"Stanford","SchoolName":"","SchoolUrl":"/Careers/Apply/University_recruiting/Schools/Stanford.aspx"}} And I... | [
"jquery",
"json",
"parsing"
] | 0 | 0 | 305 | 4 | 0 | 2011-06-06T21:22:21.090000 | 2011-06-06T21:24:30.407000 |
6,258,185 | 6,258,370 | String manipulation - removing an element from a list | I have a comma separated list of values, and I need to remove the one that is equal to a certain value. myList = '10,20,30'; myList.remove(20); // === '10,30' | Here is some tested and jslint ed code that does what you're asking for. if (!String.prototype.removeListItem) { String.prototype.removeListItem = function(value, delimiter) { delimiter = delimiter || ','; value = value.toString(); var arr = this.split(delimiter), index = arr.indexOf(value); while (index >= 0) { arr.sp... | String manipulation - removing an element from a list I have a comma separated list of values, and I need to remove the one that is equal to a certain value. myList = '10,20,30'; myList.remove(20); // === '10,30' | TITLE:
String manipulation - removing an element from a list
QUESTION:
I have a comma separated list of values, and I need to remove the one that is equal to a certain value. myList = '10,20,30'; myList.remove(20); // === '10,30'
ANSWER:
Here is some tested and jslint ed code that does what you're asking for. if (!St... | [
"javascript"
] | 1 | 1 | 1,459 | 5 | 0 | 2011-06-06T21:23:37.883000 | 2011-06-06T21:41:56.840000 |
6,258,187 | 6,258,248 | Using TransactionScope does not reseed identity column | I've started using TransactionScope to help with my unit tests, in order to put my test database back to it's previous state. Using this with SpecFlow, I have a base class like so: public class TransactionScopedFeature { private TransactionScope Scope { get; set; }
[BeforeScenario] public void BaseSetup() { this.Scope... | The seed value for an identity column does not get rolled back with the rest of a transaction in SQL Server. This is by design so that an exclusive lock does not have to be placed on the counter for the identity for the entire duration of the transaction. | Using TransactionScope does not reseed identity column I've started using TransactionScope to help with my unit tests, in order to put my test database back to it's previous state. Using this with SpecFlow, I have a base class like so: public class TransactionScopedFeature { private TransactionScope Scope { get; set; }... | TITLE:
Using TransactionScope does not reseed identity column
QUESTION:
I've started using TransactionScope to help with my unit tests, in order to put my test database back to it's previous state. Using this with SpecFlow, I have a base class like so: public class TransactionScopedFeature { private TransactionScope S... | [
".net",
"database",
"unit-testing",
"transactions"
] | 4 | 7 | 1,578 | 2 | 0 | 2011-06-06T21:23:59.267000 | 2011-06-06T21:29:43.247000 |
6,258,191 | 6,258,209 | How do you limit a Razor query? | I am using Webmatrix to develop a pretty nifty site ad was wondering how to limit the db query so that I only get the last 5 rows. I know php well and know how to write it for there and it looks like the query string is similar, but when I try to add the LIMIT in there it gives me mass errors. var db = Database.Open("P... | You're trying to limit a SQL Server query: var races = db.Query("SELECT TOP 5 * FROM Races ORDER BY id DESC"); | How do you limit a Razor query? I am using Webmatrix to develop a pretty nifty site ad was wondering how to limit the db query so that I only get the last 5 rows. I know php well and know how to write it for there and it looks like the query string is similar, but when I try to add the LIMIT in there it gives me mass e... | TITLE:
How do you limit a Razor query?
QUESTION:
I am using Webmatrix to develop a pretty nifty site ad was wondering how to limit the db query so that I only get the last 5 rows. I know php well and know how to write it for there and it looks like the query string is similar, but when I try to add the LIMIT in there ... | [
"razor"
] | 0 | 1 | 356 | 1 | 0 | 2011-06-06T21:24:10.833000 | 2011-06-06T21:26:09.100000 |
6,258,201 | 6,306,869 | How to Mock Subsonic ExecuteReader method? | I have a method that calls stored procedure and returns the data after executing DataReader. I am trying to test the method using mock. I am not sure how to return value? Anyone did this? Appreciate your responses. Here is my code: // Call the StoredProcedure public List GetCompletedBatchList(int fileId) { List complet... | The following link helped me... How to mock an SqlDataReader using Moq - Update I used MockDbDataReader method to mock the data [Test] public void Can_get_completedBatches_return_single_batch() { var date = DateTime.Now; var file = new File() { FileID = 202, DepositDate = DateTime.Now }; var batch1 = new Batch() { File... | How to Mock Subsonic ExecuteReader method? I have a method that calls stored procedure and returns the data after executing DataReader. I am trying to test the method using mock. I am not sure how to return value? Anyone did this? Appreciate your responses. Here is my code: // Call the StoredProcedure public List GetCo... | TITLE:
How to Mock Subsonic ExecuteReader method?
QUESTION:
I have a method that calls stored procedure and returns the data after executing DataReader. I am trying to test the method using mock. I am not sure how to return value? Anyone did this? Appreciate your responses. Here is my code: // Call the StoredProcedure... | [
"subsonic",
"inversion-of-control",
"moq",
"subsonic3"
] | 1 | 0 | 806 | 2 | 0 | 2011-06-06T21:25:23.747000 | 2011-06-10T13:16:00.897000 |
6,258,205 | 6,258,491 | Is it possible to trigger jquery tispy tooltip based on results of an ajax call? | Im doing an ajax call, that does the following on success: success: function(data) { var allok= data.success; if(allok == true) { $("#share_text").addClass('share_success').delay(2000).queue(function(next){ $(this).removeClass("share_success"); next(); }); } else { $("#share_text").addClass('share_fail').delay(2000).qu... | cant you simply use the jquery trigger() function? $('#share_text').trigger('mouseenter'); // to show it $('#share_text').trigger('mouseleave'); // to hide it Don't forget to first attach the tipsy() behaviour to #share_text before running the above code. $('#share_text').tipsy(); In your code it should look like this:... | Is it possible to trigger jquery tispy tooltip based on results of an ajax call? Im doing an ajax call, that does the following on success: success: function(data) { var allok= data.success; if(allok == true) { $("#share_text").addClass('share_success').delay(2000).queue(function(next){ $(this).removeClass("share_succe... | TITLE:
Is it possible to trigger jquery tispy tooltip based on results of an ajax call?
QUESTION:
Im doing an ajax call, that does the following on success: success: function(data) { var allok= data.success; if(allok == true) { $("#share_text").addClass('share_success').delay(2000).queue(function(next){ $(this).remove... | [
"jquery",
"triggers",
"tipsy"
] | 0 | 0 | 922 | 1 | 0 | 2011-06-06T21:25:54.947000 | 2011-06-06T21:55:40.323000 |
6,258,210 | 6,258,651 | How can I output data before I end the response? | Here is my snippet I tested it in Chrome 11, and Firefox 4: var http = require('http');
http.createServer(function(request, response){ // Write Headers response.writeHead(200);
// Write Hello World! response.write("Hello World!");
// End Response after 5 seconds setTimeout(function(){ response.end(); }, 5000);
}).l... | If you change the content type to text/plain -- e.g: // Write Headers response.writeHead(200, {'Content-Type': 'text/plain'}); then firefox will show the content immediately. Chrome still seems to buffer (if you write a bunch more content, chrome will show it immediately). | How can I output data before I end the response? Here is my snippet I tested it in Chrome 11, and Firefox 4: var http = require('http');
http.createServer(function(request, response){ // Write Headers response.writeHead(200);
// Write Hello World! response.write("Hello World!");
// End Response after 5 seconds setTi... | TITLE:
How can I output data before I end the response?
QUESTION:
Here is my snippet I tested it in Chrome 11, and Firefox 4: var http = require('http');
http.createServer(function(request, response){ // Write Headers response.writeHead(200);
// Write Hello World! response.write("Hello World!");
// End Response aft... | [
"node.js",
"response",
"flush"
] | 26 | 16 | 18,827 | 4 | 0 | 2011-06-06T21:26:11.463000 | 2011-06-06T22:15:25.470000 |
6,258,214 | 6,260,249 | Using curl/libcurl in a C Ruby extension | To preface: I am very new to C, so I am probably missing something obvious but have been running around for days trying to figure out what it is... I am trying to create a Ruby C extension that will work on both Mac and PC and that uses libcurl to download files. Basically, all the tool does is gets a list of files fro... | You need to tell mkmf to link to libcurl when building your extension. The command to use is have_library. In your exconf.rb, add have_library("curl", "curl_easy_init") before the call to create_makefile. Also, I don't think you need the dir_config(extension_name) line. (On a Mac, you can see what libraries are linked ... | Using curl/libcurl in a C Ruby extension To preface: I am very new to C, so I am probably missing something obvious but have been running around for days trying to figure out what it is... I am trying to create a Ruby C extension that will work on both Mac and PC and that uses libcurl to download files. Basically, all ... | TITLE:
Using curl/libcurl in a C Ruby extension
QUESTION:
To preface: I am very new to C, so I am probably missing something obvious but have been running around for days trying to figure out what it is... I am trying to create a Ruby C extension that will work on both Mac and PC and that uses libcurl to download file... | [
"c",
"ruby",
"curl",
"libcurl",
"ruby-c-extension"
] | 1 | 1 | 926 | 2 | 0 | 2011-06-06T21:26:37.050000 | 2011-06-07T03:05:48.867000 |
6,258,223 | 6,258,360 | How do I write my own vector structure in C | Here I have a pointer to the first element and int to hold the number of elements. How do I add in malloc and calloc for memory allocation? struct vector_new { char *start; int count; } | You are looking for a "dynamic array" implementation. You keep track of both how many objects are currently in the array and how much space is allocated for it. When you need more space you call realloc and ask for current_size * factor where factor is greater than one. Typical values for factor are between 1.4 and 2. ... | How do I write my own vector structure in C Here I have a pointer to the first element and int to hold the number of elements. How do I add in malloc and calloc for memory allocation? struct vector_new { char *start; int count; } | TITLE:
How do I write my own vector structure in C
QUESTION:
Here I have a pointer to the first element and int to hold the number of elements. How do I add in malloc and calloc for memory allocation? struct vector_new { char *start; int count; }
ANSWER:
You are looking for a "dynamic array" implementation. You keep ... | [
"c",
"optimization",
"vector"
] | 0 | 3 | 199 | 3 | 0 | 2011-06-06T21:27:17.923000 | 2011-06-06T21:41:02.197000 |
6,258,225 | 6,259,106 | Need more memory-efficient method of filtering vector of date values | Total newbie to R here (so far very pleased!). I have a large array(vector?) of date information, and I would like to remove the rows that do not fit within an my date range of interest (which is 24-sept-2003 to 10-december-2003, from 12pm to 6pm each day). I seem to be running out of memory Here's an example of the is... | Could you use POSIXct instead of POSIXlt? POSIXlt objects seem to take ~5x more memory than POSIXct objects: > set.seed(21) > x <- Sys.time() - trunc(runif(31164014)*3e8); range(x) [1] "2001-12-03 11:55:25 CST" "2011-06-06 18:15:07 CDT" > print(object.size(x), units="Mb") 237.8 Mb > print(object.size(as.POSIXlt(x)), un... | Need more memory-efficient method of filtering vector of date values Total newbie to R here (so far very pleased!). I have a large array(vector?) of date information, and I would like to remove the rows that do not fit within an my date range of interest (which is 24-sept-2003 to 10-december-2003, from 12pm to 6pm each... | TITLE:
Need more memory-efficient method of filtering vector of date values
QUESTION:
Total newbie to R here (so far very pleased!). I have a large array(vector?) of date information, and I would like to remove the rows that do not fit within an my date range of interest (which is 24-sept-2003 to 10-december-2003, fro... | [
"r",
"datetime",
"vector",
"memory-management",
"filter"
] | 1 | 1 | 422 | 2 | 0 | 2011-06-06T21:27:22.917000 | 2011-06-06T23:19:10.287000 |
6,258,234 | 6,258,281 | Name of closing button on Windows Forms | What's the name of the default red button with an X in the middle at the top right? EDIT: I want to get the event associated with clicking that button. | You cannot disable the close box on its own using in properties window like you can with the minimize and maximize boxes. You can however disable the control box which contains them all. Setting ControlBox to false will remove the minimize, maximize and close buttons. You might want to consider why you are doing this t... | Name of closing button on Windows Forms What's the name of the default red button with an X in the middle at the top right? EDIT: I want to get the event associated with clicking that button. | TITLE:
Name of closing button on Windows Forms
QUESTION:
What's the name of the default red button with an X in the middle at the top right? EDIT: I want to get the event associated with clicking that button.
ANSWER:
You cannot disable the close box on its own using in properties window like you can with the minimize... | [
"winforms"
] | 0 | 3 | 422 | 3 | 0 | 2011-06-06T21:28:16.817000 | 2011-06-06T21:34:02.550000 |
6,258,238 | 6,259,381 | Firefox/Javascript not displaying image - Joomla | I customized the content module so the title of an article displays an image before the text and the text is displayed with two colors!! The relevant part of the code is at follows: get('link_titles') &&!empty($this->item->readmore_link)):?> item->title);
for ($i=0; $i '.$this->escape($titles[$i]).' ';
}?> escape($ti... | I'm pretty sure this is caused by gantry-buildspans.js. Seems this script is needed to make the text of headings h1-h3 colored different. While doing this it replaces the contents of the headings with new span's and the span.image-title2 will be discarded. As you don't need this script, because you already do this on y... | Firefox/Javascript not displaying image - Joomla I customized the content module so the title of an article displays an image before the text and the text is displayed with two colors!! The relevant part of the code is at follows: get('link_titles') &&!empty($this->item->readmore_link)):?> item->title);
for ($i=0; $i ... | TITLE:
Firefox/Javascript not displaying image - Joomla
QUESTION:
I customized the content module so the title of an article displays an image before the text and the text is displayed with two colors!! The relevant part of the code is at follows: get('link_titles') &&!empty($this->item->readmore_link)):?> item->title... | [
"javascript",
"html",
"css",
"firefox",
"joomla"
] | 0 | 0 | 747 | 1 | 0 | 2011-06-06T21:28:39.097000 | 2011-06-07T00:01:00.517000 |
6,258,247 | 6,273,767 | How to edit timed logout in Spring security | I am trying to figure out where the timed-logout function of Spring's light security is located, and how to edit it to use my custom logout method. My understanding is that there does exist an editable timed-logout function, I have just thus far been unable to find it, and when/if I do, I am unsure how to make it use m... | The HttpSessionListener might be what you are looking for. The problem with depending on Spring's session management is that if a user simply closes his browser without logging out, the invalid-session-url will never be reached (because they never make another request). Something like this: public class MySessionListne... | How to edit timed logout in Spring security I am trying to figure out where the timed-logout function of Spring's light security is located, and how to edit it to use my custom logout method. My understanding is that there does exist an editable timed-logout function, I have just thus far been unable to find it, and wh... | TITLE:
How to edit timed logout in Spring security
QUESTION:
I am trying to figure out where the timed-logout function of Spring's light security is located, and how to edit it to use my custom logout method. My understanding is that there does exist an editable timed-logout function, I have just thus far been unable ... | [
"java",
"spring",
"logout",
"spring-security"
] | 2 | 8 | 7,133 | 2 | 0 | 2011-06-06T21:29:33.263000 | 2011-06-08T03:06:55.933000 |
6,258,255 | 6,258,296 | What kind of pattern does this static class implement? | package com.mycontainer;
public class MyContainer { private static ContainerConfig cConfig;
private MyContainer() {
}
public static ContainerConfig getConfiguration() { if (cConfig == null) cConfig = new ContainerConfig(); return cConfig; }
} | I would have to say that it is a poor implementation of the lazy initialization and Singleton pattern. There is no synchronization and hence no thread safety. Under multiple threads accessing this code you may end up with more than one instance. Update: It is better to have your code like this: package com.mycontainer;... | What kind of pattern does this static class implement? package com.mycontainer;
public class MyContainer { private static ContainerConfig cConfig;
private MyContainer() {
}
public static ContainerConfig getConfiguration() { if (cConfig == null) cConfig = new ContainerConfig(); return cConfig; }
} | TITLE:
What kind of pattern does this static class implement?
QUESTION:
package com.mycontainer;
public class MyContainer { private static ContainerConfig cConfig;
private MyContainer() {
}
public static ContainerConfig getConfiguration() { if (cConfig == null) cConfig = new ContainerConfig(); return cConfig; }
}... | [
"java",
"design-patterns"
] | 0 | 3 | 81 | 4 | 0 | 2011-06-06T21:30:46.110000 | 2011-06-06T21:35:33.113000 |
6,258,258 | 6,258,358 | SWF File loading in Firefox but Not IE | hey well I have the following code loading an swf but for some reason it's not displaying the playlist in internet explorer, does anyone have any ideas? Thanks! | Statically embedding flash into IE is a little different than firefox. If you look at the documentation here there is an extra object tag that's needed for IE. Their example is pasted below for reference. Though really you should be using SWFObject2 http://code.google.com/p/swfobject/ to embed your content. But the sta... | SWF File loading in Firefox but Not IE hey well I have the following code loading an swf but for some reason it's not displaying the playlist in internet explorer, does anyone have any ideas? Thanks! | TITLE:
SWF File loading in Firefox but Not IE
QUESTION:
hey well I have the following code loading an swf but for some reason it's not displaying the playlist in internet explorer, does anyone have any ideas? Thanks!
ANSWER:
Statically embedding flash into IE is a little different than firefox. If you look at the doc... | [
"internet-explorer",
"firefox",
"flash"
] | 0 | 1 | 6,129 | 2 | 0 | 2011-06-06T21:31:35.077000 | 2011-06-06T21:40:48.320000 |
6,258,260 | 6,258,389 | Android adding complex layout in ViewFlipper | I have complex view with more linearlayout-s and relativelayout in one child in ViewFlipper. I want to group this complex view in one child of ViewFlipper. ViewFlipper separates my layout in more child How can I add view with complex layout in one child?? Thanks | You have to have a sigle parent layout for each "page" in the view flipper. So you need to wrap your complex view in some other container layout. | Android adding complex layout in ViewFlipper I have complex view with more linearlayout-s and relativelayout in one child in ViewFlipper. I want to group this complex view in one child of ViewFlipper. ViewFlipper separates my layout in more child How can I add view with complex layout in one child?? Thanks | TITLE:
Android adding complex layout in ViewFlipper
QUESTION:
I have complex view with more linearlayout-s and relativelayout in one child in ViewFlipper. I want to group this complex view in one child of ViewFlipper. ViewFlipper separates my layout in more child How can I add view with complex layout in one child?? T... | [
"android"
] | 0 | 1 | 428 | 1 | 0 | 2011-06-06T21:31:50.037000 | 2011-06-06T21:44:30.833000 |
6,258,270 | 6,258,292 | Java replace issues with ' (apostrophe/single quote) and \ (backslash) together | I seem to be having issues. I have a query string that has values that can contain single quotes. This will break the query string. So I was trying to do a replace to change ' to \'. Here is a sample code: "This is' it".replace("'", "\'"); The output for this is still: "This is' it". It thinks I am just doing an escape... | First of all, if you are trying to encode apostophes for querystrings, they need to be URLEncoded, not escaped with a leading backslash. For that use URLEncoder.encode(String, String) (BTW: the second argument should always be "UTF-8" ). Secondly, if you want to replace all instances of apostophe with backslash apostro... | Java replace issues with ' (apostrophe/single quote) and \ (backslash) together I seem to be having issues. I have a query string that has values that can contain single quotes. This will break the query string. So I was trying to do a replace to change ' to \'. Here is a sample code: "This is' it".replace("'", "\'"); ... | TITLE:
Java replace issues with ' (apostrophe/single quote) and \ (backslash) together
QUESTION:
I seem to be having issues. I have a query string that has values that can contain single quotes. This will break the query string. So I was trying to do a replace to change ' to \'. Here is a sample code: "This is' it".re... | [
"java",
"string",
"replace",
"escaping",
"backslash"
] | 27 | 36 | 120,879 | 7 | 0 | 2011-06-06T21:32:27.203000 | 2011-06-06T21:35:22.993000 |
6,258,272 | 6,298,715 | Remove Like button from Facebook Comments plugin (iFrame version) | There are instructions on how to scrub the Like button from the Comments plugin for the XFBML version, but not the iFrame one. The Like button bundled with the Comments plugin is redundant since we already have a share bar. Anyone know how? | The first version of the Facebook comments plugin would allow you to specify a custom css style sheet where you could remove this. The newest second version of this plugin does not allow for this so you won't be able to modify, aside from shrinking the iframe that holds the comment box. | Remove Like button from Facebook Comments plugin (iFrame version) There are instructions on how to scrub the Like button from the Comments plugin for the XFBML version, but not the iFrame one. The Like button bundled with the Comments plugin is redundant since we already have a share bar. Anyone know how? | TITLE:
Remove Like button from Facebook Comments plugin (iFrame version)
QUESTION:
There are instructions on how to scrub the Like button from the Comments plugin for the XFBML version, but not the iFrame one. The Like button bundled with the Comments plugin is redundant since we already have a share bar. Anyone know ... | [
"facebook",
"facebook-graph-api"
] | 0 | 0 | 355 | 1 | 0 | 2011-06-06T21:33:02.710000 | 2011-06-09T20:14:58.773000 |
6,258,283 | 6,258,369 | Find revision in trunk that a branch was created from | I am trying to merge the latest changes from trunk into a branch of my project, but the problem is I don't know what revision of the trunk I checked out that I eventually created the branch from. I would think SVN logged this somewhere. Does anyone know how I can find the revision number? (In other words, the Subversio... | From the command line, the --stop-on-copy flag can be used to help show you where you copied a branch from: svn log --stop-on-copy --verbose --limit 1 -r0:HEAD ^/branches/feature (where feature is the name of your branch) The last line of will say something like this: Changed paths: A /branches/feature (from /trunk:123... | Find revision in trunk that a branch was created from I am trying to merge the latest changes from trunk into a branch of my project, but the problem is I don't know what revision of the trunk I checked out that I eventually created the branch from. I would think SVN logged this somewhere. Does anyone know how I can fi... | TITLE:
Find revision in trunk that a branch was created from
QUESTION:
I am trying to merge the latest changes from trunk into a branch of my project, but the problem is I don't know what revision of the trunk I checked out that I eventually created the branch from. I would think SVN logged this somewhere. Does anyone... | [
"svn",
"branch",
"revision"
] | 68 | 78 | 43,112 | 6 | 0 | 2011-06-06T21:34:18.713000 | 2011-06-06T21:41:46.067000 |
6,258,286 | 6,258,346 | Handling escape characters when using csv file format as source in SSIS | How to escape double quotes when using csv file as the input in SSIS when the csv file has default comma seprated values. | If you want to replace the double quotes within the CSV file's column data, please refer my answer in this Stack Overflow question. The example in the question explains how to replace/remove double quotes using Derived Column Transformation task. Hope that helps. | Handling escape characters when using csv file format as source in SSIS How to escape double quotes when using csv file as the input in SSIS when the csv file has default comma seprated values. | TITLE:
Handling escape characters when using csv file format as source in SSIS
QUESTION:
How to escape double quotes when using csv file as the input in SSIS when the csv file has default comma seprated values.
ANSWER:
If you want to replace the double quotes within the CSV file's column data, please refer my answer ... | [
"ssis"
] | 0 | 1 | 2,365 | 1 | 0 | 2011-06-06T21:34:43.680000 | 2011-06-06T21:39:47.307000 |
6,258,290 | 6,258,332 | Dynamic profile based website that also has hard links? | Ok, so I'm building a website that has client profiles. A web user finds these mysql profiles via a search function. The profile page is one php page that loads all the mysql data via the #id number that is passed through the address. This is all great, but my clients, based on hte business model and needs, are going t... | Assign each profile a unique-name (username, provably) and map it to the profile_id in the database. EDIT: Well here's the basic idea: You need to have.htaccess file at the doc-root containing: RewriteEngine On RewriteCond %{REQUEST_FILENAME}!-f RewriteCond %{REQUEST_FILENAME}!-d RewriteRule ^profile/([a-zA-Z0-9]*)$ pr... | Dynamic profile based website that also has hard links? Ok, so I'm building a website that has client profiles. A web user finds these mysql profiles via a search function. The profile page is one php page that loads all the mysql data via the #id number that is passed through the address. This is all great, but my cli... | TITLE:
Dynamic profile based website that also has hard links?
QUESTION:
Ok, so I'm building a website that has client profiles. A web user finds these mysql profiles via a search function. The profile page is one php page that loads all the mysql data via the #id number that is passed through the address. This is all... | [
"php",
"mysql",
"database-design"
] | 0 | 1 | 1,696 | 2 | 0 | 2011-06-06T21:35:08.933000 | 2011-06-06T21:38:25.437000 |
6,258,303 | 6,258,926 | Android API for analyzing PCM data? | Is there an Android-native API which would help me analyzing raw PCM data? (Just basic things: frequency, volume of a data piece.) If not, are there good (non-Android-specific) references to reading PCM? Thank you! | You may be interested in reading up on the AudioTrack class. From the docs: http://developer.android.com/reference/android/media/AudioTrack.html An article: http://mindtherobot.com/blog/580/android-audio-play-a-wav-file-on-an-audiotrack/ | Android API for analyzing PCM data? Is there an Android-native API which would help me analyzing raw PCM data? (Just basic things: frequency, volume of a data piece.) If not, are there good (non-Android-specific) references to reading PCM? Thank you! | TITLE:
Android API for analyzing PCM data?
QUESTION:
Is there an Android-native API which would help me analyzing raw PCM data? (Just basic things: frequency, volume of a data piece.) If not, are there good (non-Android-specific) references to reading PCM? Thank you!
ANSWER:
You may be interested in reading up on the... | [
"android",
"audio",
"audio-recording",
"pcm"
] | 0 | 0 | 2,249 | 2 | 0 | 2011-06-06T21:36:32.493000 | 2011-06-06T22:54:10.897000 |
6,258,309 | 6,258,391 | How to pinvoke GetExitCodeProcess with negative exit codes? | The pinvoke documentation fro GetExitCodeProcess shows exit codes returned as unsigned integers (uint). How do I handle a process with negative exit code values? Is LPDWORD correctly assigned to uint or is that a bug in pinvoke doc? pinvoke doc: http://www.pinvoke.net/default.aspx/kernel32.getexitcodeprocess win32 api ... | DWORD in unsigned integer. A 32-bit unsigned integer. The range is 0 through 4294967295 decimal. This type is declared in WinDef.h as follows: typedef unsigned long DWORD; No bug here. | How to pinvoke GetExitCodeProcess with negative exit codes? The pinvoke documentation fro GetExitCodeProcess shows exit codes returned as unsigned integers (uint). How do I handle a process with negative exit code values? Is LPDWORD correctly assigned to uint or is that a bug in pinvoke doc? pinvoke doc: http://www.pin... | TITLE:
How to pinvoke GetExitCodeProcess with negative exit codes?
QUESTION:
The pinvoke documentation fro GetExitCodeProcess shows exit codes returned as unsigned integers (uint). How do I handle a process with negative exit code values? Is LPDWORD correctly assigned to uint or is that a bug in pinvoke doc? pinvoke d... | [
"c#",
".net",
"winapi",
"pinvoke"
] | 2 | 3 | 1,934 | 1 | 0 | 2011-06-06T21:37:02.300000 | 2011-06-06T21:44:49.870000 |
6,258,317 | 6,258,398 | How to Thread.join() on all elements of a list of changing size? | Lets say I have a large number of worker threads all actively processing, and a supervisor thread that waits for them all to complete. Traditionally I could do something like: for(Worker w:staff){ w.start(); } for(Worker w:staff){ w.join(); }..and all would be well. However in this case the size of my worker list (Arra... | An Iterator instance is invalidated if any changes are made to the underlying collection outside of the Iterator instance. Why don't you consider using an ExecutorService instead? Make Worker implement Callable, then use one of the service's invokeAll() methods. CyclicBarrier or CountDownLatch are lower-level tools tha... | How to Thread.join() on all elements of a list of changing size? Lets say I have a large number of worker threads all actively processing, and a supervisor thread that waits for them all to complete. Traditionally I could do something like: for(Worker w:staff){ w.start(); } for(Worker w:staff){ w.join(); }..and all wou... | TITLE:
How to Thread.join() on all elements of a list of changing size?
QUESTION:
Lets say I have a large number of worker threads all actively processing, and a supervisor thread that waits for them all to complete. Traditionally I could do something like: for(Worker w:staff){ w.start(); } for(Worker w:staff){ w.join... | [
"java",
"join",
"thread-safety",
"concurrentmodification"
] | 2 | 4 | 159 | 2 | 0 | 2011-06-06T21:37:12.710000 | 2011-06-06T21:45:36.110000 |
6,258,333 | 6,258,371 | What's the Right Way to access static properties of subclasses in static methods of superclasses in PHP? | Say I've got the following: table_name}"); }
public static get_all2(){ return query("SELECT * FROM ".self::table_name); } }
class Child extends MyParent { public static $table_name = 'child'; }?> Assuming that query is correctly defined, neither of these methods does what I want: get_all() throws Fatal error: Using $... | You need to change self::table_name to self::$table_name - note the dollar sign. But the best way is to use PHP 5.3's static keyword: http://php.net/manual/en/language.oop5.late-static-bindings.php The self keyword references only the class that static proparty was defined, so it is wrong in this case, as you need to g... | What's the Right Way to access static properties of subclasses in static methods of superclasses in PHP? Say I've got the following: table_name}"); }
public static get_all2(){ return query("SELECT * FROM ".self::table_name); } }
class Child extends MyParent { public static $table_name = 'child'; }?> Assuming that que... | TITLE:
What's the Right Way to access static properties of subclasses in static methods of superclasses in PHP?
QUESTION:
Say I've got the following: table_name}"); }
public static get_all2(){ return query("SELECT * FROM ".self::table_name); } }
class Child extends MyParent { public static $table_name = 'child'; }?>... | [
"php",
"class",
"inheritance"
] | 3 | 5 | 997 | 2 | 0 | 2011-06-06T21:38:25.937000 | 2011-06-06T21:42:04.707000 |
6,258,345 | 6,258,414 | plpgsql: concatenation of variable into FROM clause | I'm new to Postgresql and struggling to build a function for looping over a series of CSV files and loading them. I can make the COPY work just fine with a single file, but I'm unable to get the FOR LOOP syntax correct. I'm trying to substitute a year number as my flies are named /path/tmp.YEAR.out.csv This is what I'v... | CREATE OR REPLACE FUNCTION test() RETURNS void as $$ BEGIN FOR i IN 1982..1983 LOOP EXECUTE 'COPY myTable FROM ''/path/tmp.' || i::text || '.out.csv'' DELIMITERS '',''; '; END LOOP; END; $$ language plpgsql; | plpgsql: concatenation of variable into FROM clause I'm new to Postgresql and struggling to build a function for looping over a series of CSV files and loading them. I can make the COPY work just fine with a single file, but I'm unable to get the FOR LOOP syntax correct. I'm trying to substitute a year number as my fli... | TITLE:
plpgsql: concatenation of variable into FROM clause
QUESTION:
I'm new to Postgresql and struggling to build a function for looping over a series of CSV files and loading them. I can make the COPY work just fine with a single file, but I'm unable to get the FOR LOOP syntax correct. I'm trying to substitute a yea... | [
"postgresql",
"plpgsql"
] | 7 | 6 | 3,971 | 2 | 0 | 2011-06-06T21:39:45.110000 | 2011-06-06T21:47:37.663000 |
6,258,350 | 6,258,535 | Entity Framework push-based change tracking | Does Entity Framework innately support any sort of change tracking in terms of detecting which records in a database were added after some date x and which were added before some date x? I know it supports tracking changes in the properties of entities themselves, but this is a bit different, I think. If not in Entity ... | The feature you're looking for are exactly Change Tracking (tracks the rows changed for sync like scenarios) and/or Change Data Capture (tracks exactly what changes, including pre-change image of data, for more complex scenarios like audit). There is a comparison of the two at Comparing Change Data Capture and Change T... | Entity Framework push-based change tracking Does Entity Framework innately support any sort of change tracking in terms of detecting which records in a database were added after some date x and which were added before some date x? I know it supports tracking changes in the properties of entities themselves, but this is... | TITLE:
Entity Framework push-based change tracking
QUESTION:
Does Entity Framework innately support any sort of change tracking in terms of detecting which records in a database were added after some date x and which were added before some date x? I know it supports tracking changes in the properties of entities thems... | [
"c#",
"sql",
"database",
"entity-framework",
"change-tracking"
] | 0 | 2 | 1,411 | 2 | 0 | 2011-06-06T21:40:20.200000 | 2011-06-06T22:01:43.060000 |
6,258,352 | 6,258,436 | Build an eclipse project from console without ant | I got an eclipse project which has more than 10 packages. I need to build it to run in an environment where there is no ant. Please provide me some support. Thanks. | Use javac http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/javac.html | Build an eclipse project from console without ant I got an eclipse project which has more than 10 packages. I need to build it to run in an environment where there is no ant. Please provide me some support. Thanks. | TITLE:
Build an eclipse project from console without ant
QUESTION:
I got an eclipse project which has more than 10 packages. I need to build it to run in an environment where there is no ant. Please provide me some support. Thanks.
ANSWER:
Use javac http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/javac.... | [
"java",
"console"
] | 0 | 1 | 1,277 | 2 | 0 | 2011-06-06T21:40:23.017000 | 2011-06-06T21:49:57.797000 |
6,258,354 | 6,258,470 | PreferenceScreen not being restored on orientation change | I had the following (minor but nagging!) problem: I've got a PreferenceActivity with a XML preference hierarchy definition with "sub PreferenceScreens ", i. e. several PreferenceScreens under the top level PreferenceScreen, and when the user clicks them, a sub hierarchy of other preferences is being displayed. If I hav... | This is by design, the state of Preference is associated with its key. If Preference has no key then it will not be able to save/restore its state. The similar behavior can be found in views withing layouts. If view has no id specified for it, it will not be able to restore state after configuration change. And to back... | PreferenceScreen not being restored on orientation change I had the following (minor but nagging!) problem: I've got a PreferenceActivity with a XML preference hierarchy definition with "sub PreferenceScreens ", i. e. several PreferenceScreens under the top level PreferenceScreen, and when the user clicks them, a sub h... | TITLE:
PreferenceScreen not being restored on orientation change
QUESTION:
I had the following (minor but nagging!) problem: I've got a PreferenceActivity with a XML preference hierarchy definition with "sub PreferenceScreens ", i. e. several PreferenceScreens under the top level PreferenceScreen, and when the user cl... | [
"android"
] | 1 | 1 | 1,389 | 1 | 0 | 2011-06-06T21:40:33.710000 | 2011-06-06T21:53:10.527000 |
6,258,356 | 6,258,534 | Tcl/Tk - automating GUI testing | I want to automate the testing of my GUI. I went through the following post but if someone can post a sample test code for the following example it would be much easier for me to understand. The following is my simple Hello World code. namespace eval Gui { }
proc Gui::hello {} { toplevel.hello wm title.hello "Hello" w... | The simplest way to make a button behave like it's been clicked is to use its invoke method:.hello.ok invoke Of course, then you've also got to capture the result of that invocation; writing to stdout not being the most useful thing in the world when it comes to testing (unless you wrap a test harness in another proces... | Tcl/Tk - automating GUI testing I want to automate the testing of my GUI. I went through the following post but if someone can post a sample test code for the following example it would be much easier for me to understand. The following is my simple Hello World code. namespace eval Gui { }
proc Gui::hello {} { topleve... | TITLE:
Tcl/Tk - automating GUI testing
QUESTION:
I want to automate the testing of my GUI. I went through the following post but if someone can post a sample test code for the following example it would be much easier for me to understand. The following is my simple Hello World code. namespace eval Gui { }
proc Gui::... | [
"testing",
"automated-tests",
"tcl",
"tk-toolkit",
"gui-testing"
] | 2 | 3 | 3,169 | 1 | 0 | 2011-06-06T21:40:45.710000 | 2011-06-06T22:01:31.517000 |
6,258,361 | 6,258,435 | "Could not find part of the path" error when copying a file | I've googled about this all over the Internet and still haven't found a solution. As an ultimate try, I hope someone can give me an exact answer. I get that error when I try to copy a file from a directory to another in an File Explorer I'm trying to do on my own. It has a treeview control to browse for directories and... | You do not show where toBeCopied is created. It looks like you are probably running past the end of the values that are set in the click event, and trying to copy a bunch of files with empty names. You should add this to the beginning of your click event toBeCopied = new string[listView1.SelectedItems.Count]; Also (as ... | "Could not find part of the path" error when copying a file I've googled about this all over the Internet and still haven't found a solution. As an ultimate try, I hope someone can give me an exact answer. I get that error when I try to copy a file from a directory to another in an File Explorer I'm trying to do on my ... | TITLE:
"Could not find part of the path" error when copying a file
QUESTION:
I've googled about this all over the Internet and still haven't found a solution. As an ultimate try, I hope someone can give me an exact answer. I get that error when I try to copy a file from a directory to another in an File Explorer I'm t... | [
"c#",
"path",
"file-copying"
] | 6 | 3 | 35,544 | 5 | 0 | 2011-06-06T21:41:07.113000 | 2011-06-06T21:49:53.137000 |
6,258,363 | 6,258,432 | Speeding up the execution of C#/.NET application | I'm searching for methods to boost up C#/.NET application. What I found so far is Use ngen. Careful when using as operator Careful when using reflection API. It takes quite a while to load dll with Assembly.LoadFrom(). What else tools/tips/good practices do you have to get the best performance out of C#/.NET program. | First be careful with ngen. It might actually end up hurting performance. See Jeff Richter's book "CLR via C#, Third Edition" for more details. Personally I will use a profiler when I need to performance tune my application. The one I prefer is Red-Gate Ants, but there are plenty of good ones on the market. However usi... | Speeding up the execution of C#/.NET application I'm searching for methods to boost up C#/.NET application. What I found so far is Use ngen. Careful when using as operator Careful when using reflection API. It takes quite a while to load dll with Assembly.LoadFrom(). What else tools/tips/good practices do you have to g... | TITLE:
Speeding up the execution of C#/.NET application
QUESTION:
I'm searching for methods to boost up C#/.NET application. What I found so far is Use ngen. Careful when using as operator Careful when using reflection API. It takes quite a while to load dll with Assembly.LoadFrom(). What else tools/tips/good practice... | [
"c#",
".net",
"performance"
] | 6 | 5 | 2,345 | 4 | 0 | 2011-06-06T21:41:17.283000 | 2011-06-06T21:49:20.477000 |
6,258,384 | 6,259,320 | Message Handling, unexpected behavior with worker threads | I'm taking a stab at a large program with a background Service and I'm implementing a (rather poorly thought out) Message handling procedure using basic Handler objects. The application has a main menu with buttons which start 6 different activities. Problem is this: if i start a worker thread which kicks off a query t... | Use sendBroadcast(), with the Activity registering a BroadcastReceiver for the broadcast via registerReceiver() in onResume() and unregistering it in onPause(). Then, it will only process the event if it is in the foreground. | Message Handling, unexpected behavior with worker threads I'm taking a stab at a large program with a background Service and I'm implementing a (rather poorly thought out) Message handling procedure using basic Handler objects. The application has a main menu with buttons which start 6 different activities. Problem is ... | TITLE:
Message Handling, unexpected behavior with worker threads
QUESTION:
I'm taking a stab at a large program with a background Service and I'm implementing a (rather poorly thought out) Message handling procedure using basic Handler objects. The application has a main menu with buttons which start 6 different activ... | [
"android",
"multithreading",
"message-queue",
"handler",
"android-service"
] | 0 | 0 | 202 | 2 | 0 | 2011-06-06T21:43:47.463000 | 2011-06-06T23:52:25.773000 |
6,258,386 | 6,259,294 | How to restrict users to subsets of data in ASP.Net 2.0+ | Imagine an ASP.Net 2.0+ app that uses the built-in role-based security to restrict users to certain pages or actions. Further suppose that rules exist that restrict individual users to subsets of data based on the user's attributes (however those are implemented). For example, a manager can only look at performance his... | Consider using your own custom attribute for these cross cutting concerns and implement possibly with a claims based identity system (ex. IClaimsIdentity - Windows Identity Foundation) for required attributes. Since you are controlling data here based on users - I would also look into the Model View Presenter pattern f... | How to restrict users to subsets of data in ASP.Net 2.0+ Imagine an ASP.Net 2.0+ app that uses the built-in role-based security to restrict users to certain pages or actions. Further suppose that rules exist that restrict individual users to subsets of data based on the user's attributes (however those are implemented)... | TITLE:
How to restrict users to subsets of data in ASP.Net 2.0+
QUESTION:
Imagine an ASP.Net 2.0+ app that uses the built-in role-based security to restrict users to certain pages or actions. Further suppose that rules exist that restrict individual users to subsets of data based on the user's attributes (however thos... | [
"asp.net",
"security",
"validation",
"restrictions"
] | 1 | 0 | 247 | 3 | 0 | 2011-06-06T21:44:07.157000 | 2011-06-06T23:49:03.707000 |
6,258,387 | 6,258,434 | How is the C++ multimap container implemented? | For example a C++ vector is implemented using a dynamic array where each element uses consecutive memory spaces. I know that a C++ multimap is a one to many relationship but what is the internal structure? | The C++ standard does not define how the standard containers should be implemented, it only gives certain constraints like the one you say for vectors. multimaps have certain runtime complexity (O(lg n) for the interesting operations) and other guarantees, and can be implemented as red-black trees. This is how they are... | How is the C++ multimap container implemented? For example a C++ vector is implemented using a dynamic array where each element uses consecutive memory spaces. I know that a C++ multimap is a one to many relationship but what is the internal structure? | TITLE:
How is the C++ multimap container implemented?
QUESTION:
For example a C++ vector is implemented using a dynamic array where each element uses consecutive memory spaces. I know that a C++ multimap is a one to many relationship but what is the internal structure?
ANSWER:
The C++ standard does not define how the... | [
"c++",
"multimap"
] | 33 | 33 | 19,536 | 4 | 0 | 2011-06-06T21:44:15.877000 | 2011-06-06T21:49:47.947000 |
6,258,401 | 6,260,251 | Session handling and signing in/out | I'm developing Rails application and I have to use authentication. I installed devise gem and trying to get used to it. Anyway - I have 2 problems, which may be connected (don't know it) When signing in, how to sign out user, that is already signed in as the same user? I mean - From machine M1 someone signed in, next f... | 1) this routes ends the session with devise destroy_user_session GET /users/sign_out(.:format) {:action=>"destroy",:controller=>"devise/sessions"} just add a link pointing to "/users/sign_out" and it will sign out the user. I dont follow the part about user in M1 and M2 but you can sign out all users at once with sign_... | Session handling and signing in/out I'm developing Rails application and I have to use authentication. I installed devise gem and trying to get used to it. Anyway - I have 2 problems, which may be connected (don't know it) When signing in, how to sign out user, that is already signed in as the same user? I mean - From ... | TITLE:
Session handling and signing in/out
QUESTION:
I'm developing Rails application and I have to use authentication. I installed devise gem and trying to get used to it. Anyway - I have 2 problems, which may be connected (don't know it) When signing in, how to sign out user, that is already signed in as the same us... | [
"ruby-on-rails",
"ruby-on-rails-3",
"session",
"authentication"
] | 0 | 1 | 567 | 1 | 0 | 2011-06-06T21:45:53.017000 | 2011-06-07T03:06:41.487000 |
6,258,406 | 6,261,212 | How can I get HBase to play nicely with sbt's dependency management? | I'm trying to get an sbt project going which uses CDH3's Hadoop and HBase. I'm trying to using a project/build/Project.scala file to declare dependencies on HBase and Hadoop. (I'll admit my grasp of sbt, maven, and ivy is a little weak. Please pardon me if I'd saying or doing something dumb.) Everything went swimmingly... | Looking at the HBase POM file, Thrift is in the repo at http://people.apache.org/~rawson/repo. You can add that to your project, and it should find Thrift. I thought that SBT would have figured that out, but this is an intersection of SBT, Ivy and Maven, so who can really say what really should happen. If you really do... | How can I get HBase to play nicely with sbt's dependency management? I'm trying to get an sbt project going which uses CDH3's Hadoop and HBase. I'm trying to using a project/build/Project.scala file to declare dependencies on HBase and Hadoop. (I'll admit my grasp of sbt, maven, and ivy is a little weak. Please pardon ... | TITLE:
How can I get HBase to play nicely with sbt's dependency management?
QUESTION:
I'm trying to get an sbt project going which uses CDH3's Hadoop and HBase. I'm trying to using a project/build/Project.scala file to declare dependencies on HBase and Hadoop. (I'll admit my grasp of sbt, maven, and ivy is a little we... | [
"scala",
"hadoop",
"hbase",
"thrift",
"sbt"
] | 2 | 4 | 2,647 | 2 | 0 | 2011-06-06T21:46:27.047000 | 2011-06-07T06:11:49.940000 |
6,258,415 | 6,258,789 | numpy: Replacing values in a recarray | I'm pretty new to numpy, and I'm trying to replace a value in a recarray. So I have this array: import numpy as np d = [('1', ''),('4', '5'),('7', '8')] a = np.array(d, dtype=[('first', 'a5'), ('second', 'a5')]) I would like to do something like this: ind = a=='' #Replace all blanks a[ind] = '12345' but that doesnt wor... | The "element-by-element" operations of numpy (with wich you can perform some function on all elements of the array at once without a loop) don't work with recarrays as far as I know. You can only do that with the individual columns. If you want to use recarrays, I think the easiest solution is to loop the different col... | numpy: Replacing values in a recarray I'm pretty new to numpy, and I'm trying to replace a value in a recarray. So I have this array: import numpy as np d = [('1', ''),('4', '5'),('7', '8')] a = np.array(d, dtype=[('first', 'a5'), ('second', 'a5')]) I would like to do something like this: ind = a=='' #Replace all blank... | TITLE:
numpy: Replacing values in a recarray
QUESTION:
I'm pretty new to numpy, and I'm trying to replace a value in a recarray. So I have this array: import numpy as np d = [('1', ''),('4', '5'),('7', '8')] a = np.array(d, dtype=[('first', 'a5'), ('second', 'a5')]) I would like to do something like this: ind = a=='' ... | [
"python",
"numpy",
"recarray"
] | 3 | 5 | 3,285 | 2 | 0 | 2011-06-06T21:47:38.290000 | 2011-06-06T22:35:32.760000 |
6,258,418 | 6,258,466 | php dynamically generate coords for image map | I have a map with a grid on it. each cell of the grid will be a clickable area on the map via image map coords. I would like to do this dynamically to save writing all this code for the image maps, but I can't quite figure out the statement or equation i need to use. Here is an example of what I have of the image map s... | $columns = 5; $rows = 5; $width = 50; $height = 50;
for( $x = 0; $x < $columns; $x++ ) { for( $y = 0; $y < $rows; $y++ ) { $a = ($x * $width); $b = ($y * $height);
$coords = array( $a, $b, ($a + $width), ($b + $height) ); echo ' '; } } You can see it in action here: http://codepad.org/MMKfY1zc | php dynamically generate coords for image map I have a map with a grid on it. each cell of the grid will be a clickable area on the map via image map coords. I would like to do this dynamically to save writing all this code for the image maps, but I can't quite figure out the statement or equation i need to use. Here i... | TITLE:
php dynamically generate coords for image map
QUESTION:
I have a map with a grid on it. each cell of the grid will be a clickable area on the map via image map coords. I would like to do this dynamically to save writing all this code for the image maps, but I can't quite figure out the statement or equation i n... | [
"php",
"html",
"imagemap"
] | 2 | 7 | 8,011 | 3 | 0 | 2011-06-06T21:47:48.900000 | 2011-06-06T21:52:46.340000 |
6,258,424 | 6,262,669 | Pressing two buttons at the same time, wp7, silverlight, c# | I'm still working with sound effects on my test app and I noticed that you can't press on two buttons at the same time. Is there a way to allow this? So that I can press the two buttons at the same time with two fingers. I was looking at multi touch support from GalaSoft and hit testing but it doesn't seem like these a... | You can't press multiple buttons at the same time but you could create your own control which detects simultaneous presses in different areas of the control and mimics separate button presses. | Pressing two buttons at the same time, wp7, silverlight, c# I'm still working with sound effects on my test app and I noticed that you can't press on two buttons at the same time. Is there a way to allow this? So that I can press the two buttons at the same time with two fingers. I was looking at multi touch support fr... | TITLE:
Pressing two buttons at the same time, wp7, silverlight, c#
QUESTION:
I'm still working with sound effects on my test app and I noticed that you can't press on two buttons at the same time. Is there a way to allow this? So that I can press the two buttons at the same time with two fingers. I was looking at mult... | [
"silverlight",
"windows-phone-7",
"multi-touch"
] | 2 | 1 | 403 | 1 | 0 | 2011-06-06T21:48:18.713000 | 2011-06-07T08:40:33.310000 |
6,258,430 | 6,260,214 | Google Maps and jQuery-UI Dialog box | I'm having an interesting problem with an assignment for my class, we're supposed to have a jQuery-UI Modal Dialog box appear when the user clicks on a Google Map. In my first example I have the jQuery-UI Modal Dialog box working just fine on the same page as the map. http://ymartino.userworld.com/map-practice3a.html H... | Here's an example to show how it's done. I've kept some of the elements of your attempt (like onload="initialize()" which I would be inclined to replace with $.ready() ) for ease of understanding. I've also stripped out some functionality that you'll likely need for your assignment, but that should be easy to restore i... | Google Maps and jQuery-UI Dialog box I'm having an interesting problem with an assignment for my class, we're supposed to have a jQuery-UI Modal Dialog box appear when the user clicks on a Google Map. In my first example I have the jQuery-UI Modal Dialog box working just fine on the same page as the map. http://ymartin... | TITLE:
Google Maps and jQuery-UI Dialog box
QUESTION:
I'm having an interesting problem with an assignment for my class, we're supposed to have a jQuery-UI Modal Dialog box appear when the user clicks on a Google Map. In my first example I have the jQuery-UI Modal Dialog box working just fine on the same page as the m... | [
"jquery-ui",
"google-maps-api-3",
"jquery-ui-dialog"
] | 0 | 1 | 5,306 | 1 | 0 | 2011-06-06T21:49:02.807000 | 2011-06-07T02:58:02.283000 |
6,258,440 | 6,258,472 | Find a Git branch containing changes to a given file | I have 57 local branches. I know I made a change to a certain file in one of them, but I'm not sure which one. Is there some kind of command I can run to find which branches contain changes to a certain file? | Find all branches which contain a change to FILENAME (even if before the (non-recorded) branch point) FILENAME=" " git log --all --format=%H $FILENAME | while read f; do git branch --contains $f; done | sort -u Manually inspect: gitk --all --date-order -- $FILENAME Find all changes to FILENAME not merged to master: git... | Find a Git branch containing changes to a given file I have 57 local branches. I know I made a change to a certain file in one of them, but I'm not sure which one. Is there some kind of command I can run to find which branches contain changes to a certain file? | TITLE:
Find a Git branch containing changes to a given file
QUESTION:
I have 57 local branches. I know I made a change to a certain file in one of them, but I'm not sure which one. Is there some kind of command I can run to find which branches contain changes to a certain file?
ANSWER:
Find all branches which contain... | [
"git"
] | 150 | 130 | 48,200 | 5 | 0 | 2011-06-06T21:50:22.723000 | 2011-06-06T21:53:22.310000 |
6,258,445 | 6,258,571 | jQuery-Cycle: border-radius property not acting as expected in Chrome 11 | Im using jQuery-cycle to power one of my slideshow and a border-radius property applied to the container div is not working as expected: The "View Content" slide has rounded corners, the other slides dont have any. #carousel {-webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px;} My cycle init cod... | You are actually getting round corners on your #carousel div (You can test this by adding a red border on #carousel). The reason you don't see it is because the images are absolutely positioned and do not have rounded corners. If you want to show the rounded corners, you add this rule to your stylesheet:.carousel_cont ... | jQuery-Cycle: border-radius property not acting as expected in Chrome 11 Im using jQuery-cycle to power one of my slideshow and a border-radius property applied to the container div is not working as expected: The "View Content" slide has rounded corners, the other slides dont have any. #carousel {-webkit-border-radius... | TITLE:
jQuery-Cycle: border-radius property not acting as expected in Chrome 11
QUESTION:
Im using jQuery-cycle to power one of my slideshow and a border-radius property applied to the container div is not working as expected: The "View Content" slide has rounded corners, the other slides dont have any. #carousel {-we... | [
"jquery",
"jquery-cycle",
"css"
] | 1 | 1 | 1,008 | 1 | 0 | 2011-06-06T21:50:46.833000 | 2011-06-06T22:05:42.403000 |
6,258,450 | 6,259,056 | Whats the equivalent of File.read(Rails.root.join('public/images/email_banner.png')) in Rails 3.1 RC? | In Rails 3.0.X, this line used to work: email_banner = File.read(Rails.root.join('public/images/email_banner.png')) Since Rails 3.1 RC moved the images dir into app/assets/images, I get the error: Errno::ENOENT: No such file or directory - /Users/Foo/Sites/foobar/public/images/email_banner.png How would I get this to w... | You kind of answered your own question, you just need to change the path you call on. email_banner = File.read(Rails.root.join('app/assets/images/email_banner.png')) | Whats the equivalent of File.read(Rails.root.join('public/images/email_banner.png')) in Rails 3.1 RC? In Rails 3.0.X, this line used to work: email_banner = File.read(Rails.root.join('public/images/email_banner.png')) Since Rails 3.1 RC moved the images dir into app/assets/images, I get the error: Errno::ENOENT: No suc... | TITLE:
Whats the equivalent of File.read(Rails.root.join('public/images/email_banner.png')) in Rails 3.1 RC?
QUESTION:
In Rails 3.0.X, this line used to work: email_banner = File.read(Rails.root.join('public/images/email_banner.png')) Since Rails 3.1 RC moved the images dir into app/assets/images, I get the error: Err... | [
"ruby-on-rails-3",
"actionmailer"
] | 8 | 20 | 9,028 | 1 | 0 | 2011-06-06T21:51:27.040000 | 2011-06-06T23:13:21.540000 |
6,258,451 | 6,258,476 | two dispatchertimer events at the same time? | i have a wpf app that is updating date/time in one dispatchertimer, another is for a mp3 player timer that tracks time and slidebar for playing time. is it possible to have 2 dispatchertimer's running? that's dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); and dispatcherTimer.Tick += new EventHandler(mp... | Yes, it's possible. What you are doing is something different: You are trying to attach two event handlers to one DispatcherTimer. Don't do that. If you want two timers for different purposes (and with different timeouts), use two DispatcherTimer objects: dateTimeTimer.Tick += new EventHandler(dateTimeTimer_Tick); mp3T... | two dispatchertimer events at the same time? i have a wpf app that is updating date/time in one dispatchertimer, another is for a mp3 player timer that tracks time and slidebar for playing time. is it possible to have 2 dispatchertimer's running? that's dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); an... | TITLE:
two dispatchertimer events at the same time?
QUESTION:
i have a wpf app that is updating date/time in one dispatchertimer, another is for a mp3 player timer that tracks time and slidebar for playing time. is it possible to have 2 dispatchertimer's running? that's dispatcherTimer.Tick += new EventHandler(dispatc... | [
"c#",
"wpf",
"dispatchertimer"
] | 1 | 1 | 2,444 | 1 | 0 | 2011-06-06T21:51:32.487000 | 2011-06-06T21:53:41.737000 |
6,258,455 | 6,259,402 | Emacs font lock mode: provide a custom color instead of a face | On this page discussing font lock mode, an example is provided which highlights a custom pattern: (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))))) Is there a way to provide a custom color instead of font-lock-warning-face and without defining a new custo... | (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 '(:foreground "blue") t))) (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 '(:foreground "#F0F0F0") t))) A full list of attributes is in the manual. | Emacs font lock mode: provide a custom color instead of a face On this page discussing font lock mode, an example is provided which highlights a custom pattern: (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))))) Is there a way to provide a custom color ins... | TITLE:
Emacs font lock mode: provide a custom color instead of a face
QUESTION:
On this page discussing font lock mode, an example is provided which highlights a custom pattern: (add-hook 'c-mode-hook (lambda () (font-lock-add-keywords nil '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))))) Is there a way to provide ... | [
"emacs",
"colors",
"elisp",
"customization",
"emacs-faces"
] | 8 | 14 | 2,355 | 1 | 0 | 2011-06-06T21:51:44.373000 | 2011-06-07T00:04:39.190000 |
6,258,456 | 6,258,504 | Passing $_SESSION in uploadify | I am using uploadify to allow images upload in a form. The issue i'm having is the following: To submit the form, the user has to be logged in. The images, will ideally be uploaded to the path /uploads/ the problem is, the php script that uploadify's swf connects to doesn't get the sessions currently active. that means... | Insecure it is: Send the session id with the request and have the server use that session id (if sent). When I used a swf uploader, I did that. Something like this: if (!empty($_POST['sess']) ) { session_id($_POST['sess']); } session_start(); And on the page you make the request, you get the session id with: Should wor... | Passing $_SESSION in uploadify I am using uploadify to allow images upload in a form. The issue i'm having is the following: To submit the form, the user has to be logged in. The images, will ideally be uploaded to the path /uploads/ the problem is, the php script that uploadify's swf connects to doesn't get the sessio... | TITLE:
Passing $_SESSION in uploadify
QUESTION:
I am using uploadify to allow images upload in a form. The issue i'm having is the following: To submit the form, the user has to be logged in. The images, will ideally be uploaded to the path /uploads/ the problem is, the php script that uploadify's swf connects to does... | [
"php",
"uploadify"
] | 4 | 4 | 436 | 2 | 0 | 2011-06-06T21:51:58.780000 | 2011-06-06T21:57:46.073000 |
6,258,458 | 6,258,560 | Trouble adding compiler to windows path | I'm having a seemingly silly problem with my gcc compiler. I have installed MinGW at location C:\MinGW... and I have added C:\MinGW\bin to my windows path. However, when I got to the command prompt and type gcc --version... it doesn't recognize it. I have to cd manually to the bin before it will recognize it. When I go... | How did you set the path? You should set it from Control Panel->System->Advanced->Environment Variables. The change will affect newly opened command consoles only. If it then does not work, in the console, when you enter the command path does the displayed path list include your path? Is it correct? Are ther other GNU ... | Trouble adding compiler to windows path I'm having a seemingly silly problem with my gcc compiler. I have installed MinGW at location C:\MinGW... and I have added C:\MinGW\bin to my windows path. However, when I got to the command prompt and type gcc --version... it doesn't recognize it. I have to cd manually to the bi... | TITLE:
Trouble adding compiler to windows path
QUESTION:
I'm having a seemingly silly problem with my gcc compiler. I have installed MinGW at location C:\MinGW... and I have added C:\MinGW\bin to my windows path. However, when I got to the command prompt and type gcc --version... it doesn't recognize it. I have to cd ... | [
"c++",
"c",
"gcc",
"mingw"
] | 4 | 2 | 11,758 | 2 | 0 | 2011-06-06T21:51:59.773000 | 2011-06-06T22:04:19.893000 |
6,258,459 | 6,263,706 | qtip2 tooltip - mouse tracker - how find content of many controls with a same class? | i have many controls like below: captcha is incorrect!!! as you see i put the ttContent of each control in the below of it (inside a div) and i have many controls with ttTarget class... the qtip2 codes for mouse tracker tooltips is like below: $('#target').qtip({ content: 'i am tool tip', position: { my: 'top left', ta... | Way 1: $(function () { $('.ttTarget').qtip({ overwrite: false, content: { text: function (api) { return $(this).parent('div').find('div.ttContent').html(); } }, position: { my: 'top left', target: 'mouse', viewport: $(window), adjust: { x: 10, y: 10 } }, hide: { fixed: true }, style: 'ui-tooltip-shadow' }); way 2: $('.... | qtip2 tooltip - mouse tracker - how find content of many controls with a same class? i have many controls like below: captcha is incorrect!!! as you see i put the ttContent of each control in the below of it (inside a div) and i have many controls with ttTarget class... the qtip2 codes for mouse tracker tooltips is lik... | TITLE:
qtip2 tooltip - mouse tracker - how find content of many controls with a same class?
QUESTION:
i have many controls like below: captcha is incorrect!!! as you see i put the ttContent of each control in the below of it (inside a div) and i have many controls with ttTarget class... the qtip2 codes for mouse track... | [
"jquery",
"asp.net",
"tooltip",
"qtip",
"qtip2"
] | 0 | 0 | 1,524 | 1 | 0 | 2011-06-06T21:51:59.937000 | 2011-06-07T10:09:38.393000 |
6,258,461 | 6,258,581 | convert foreach into while loop | Hi guys i need to convert a foreach loop into a while loop. Because the foreach loop does leaves the block when values have been iterated. I need the while loop to continue looping. I need to iterate the items of the array but not in a foreach loop. foreach($values as $event) { if($startDate >= $event['start'] && $star... | If you simply want to iterate through the array, this should do it: $array_length = count($values); $iteration = 0;
while($iteration < $array_length){ $event = $values[$iteration];... $iteration++; } This functionality is much like a for() or foreach() loop, if you only want to exit the loop when a specific condition ... | convert foreach into while loop Hi guys i need to convert a foreach loop into a while loop. Because the foreach loop does leaves the block when values have been iterated. I need the while loop to continue looping. I need to iterate the items of the array but not in a foreach loop. foreach($values as $event) { if($start... | TITLE:
convert foreach into while loop
QUESTION:
Hi guys i need to convert a foreach loop into a while loop. Because the foreach loop does leaves the block when values have been iterated. I need the while loop to continue looping. I need to iterate the items of the array but not in a foreach loop. foreach($values as $... | [
"php",
"loops"
] | 2 | 2 | 4,554 | 1 | 0 | 2011-06-06T21:52:24.903000 | 2011-06-06T22:07:03.677000 |
6,258,463 | 6,258,499 | idea to format a query string | I am trying to make a query string $sql = 'select * from table where '. $option1. $option2 etc how would I go about making that. every query will have different number of options. above have 2, but it could be as many as 10 thanks | You could hold these in an array for example. Something like: $options = array('option1', 'option2', 'etc'); $sql = 'SELECT * FROM table WHERE '. implode(' AND ', $options); You could even compose the whole query with an array, depending on the things you need to change (what I mean is, only make the things you need to... | idea to format a query string I am trying to make a query string $sql = 'select * from table where '. $option1. $option2 etc how would I go about making that. every query will have different number of options. above have 2, but it could be as many as 10 thanks | TITLE:
idea to format a query string
QUESTION:
I am trying to make a query string $sql = 'select * from table where '. $option1. $option2 etc how would I go about making that. every query will have different number of options. above have 2, but it could be as many as 10 thanks
ANSWER:
You could hold these in an array... | [
"php",
"mysql",
"cakephp-1.3"
] | 1 | 5 | 100 | 2 | 0 | 2011-06-06T21:52:33.217000 | 2011-06-06T21:56:55.830000 |
6,258,468 | 6,258,704 | Can I merge z-index layers into a single image? | Can I merge z-index layers into a single image? I am working on a painting visualizer for homes. Using Javascript, I have 40 divs, all with a unique z-index. At a given time, 1-4 layers are display:block (and the rest are display:none) in a single space, layering colored shapes over a background image (of a house). Is ... | If you use then you can use.getAsDataUrl( ), submit the contents of your layers to your backend and use a library like ImageMagik to merge them and serve a new image. Otherwise, I'm not sure how you're achieving your drawing effects, but you could "record" all the drawing events as they occur, then when you want to mer... | Can I merge z-index layers into a single image? Can I merge z-index layers into a single image? I am working on a painting visualizer for homes. Using Javascript, I have 40 divs, all with a unique z-index. At a given time, 1-4 layers are display:block (and the rest are display:none) in a single space, layering colored ... | TITLE:
Can I merge z-index layers into a single image?
QUESTION:
Can I merge z-index layers into a single image? I am working on a painting visualizer for homes. Using Javascript, I have 40 divs, all with a unique z-index. At a given time, 1-4 layers are display:block (and the rest are display:none) in a single space,... | [
"javascript"
] | 0 | 2 | 303 | 1 | 0 | 2011-06-06T21:53:01.940000 | 2011-06-06T22:20:15.797000 |
6,258,477 | 6,258,519 | Making a file readable only by JavaScript and/or Flash | I'm a bit new to web development so forgive the slightly beginner question. Can anyone give me some general pointers on how to prevent downloading of files while displaying content with JavaScript/Flash widgets? The basic dilemma is making files playable by page widgets while preventing direct downloads of the source m... | In fact, you can't. There are two types of downloads; normal (direct) one and the one via streaming. I would advise you to use the direct one but passing an authorization key with it. An example of such a URL would look like: /download?file=134&auth=A34C56E4FCD3908DA ^ ^ ^ | | '- The predefined access token | '- The re... | Making a file readable only by JavaScript and/or Flash I'm a bit new to web development so forgive the slightly beginner question. Can anyone give me some general pointers on how to prevent downloading of files while displaying content with JavaScript/Flash widgets? The basic dilemma is making files playable by page wi... | TITLE:
Making a file readable only by JavaScript and/or Flash
QUESTION:
I'm a bit new to web development so forgive the slightly beginner question. Can anyone give me some general pointers on how to prevent downloading of files while displaying content with JavaScript/Flash widgets? The basic dilemma is making files p... | [
"javascript",
"flash",
"filesystem-access"
] | 0 | 1 | 74 | 2 | 0 | 2011-06-06T21:53:47.927000 | 2011-06-06T22:00:31.573000 |
6,258,486 | 6,268,701 | How do you debug a problem in the Activator of an Eclipse plug-in? | I am trying to follow an OSGi bundle tutorial ( http://www.vogella.de/articles/OSGi/article.html ). It includes this method in the Activator class: public void start(BundleContext context) throws Exception { System.out.println("Starting de.vogella.osgi.firstbundle"); } public void stop(BundleContext context) throws Exc... | Well, I said I was confused. The tutorial mentioned above runs the first demo in Eclipse, but quickly shifts to a standalone container. I got that to work, but broke off for the night and when I came back in the morning started using the built-in OSGi console to follow the standalone instructions. This doesn't work ver... | How do you debug a problem in the Activator of an Eclipse plug-in? I am trying to follow an OSGi bundle tutorial ( http://www.vogella.de/articles/OSGi/article.html ). It includes this method in the Activator class: public void start(BundleContext context) throws Exception { System.out.println("Starting de.vogella.osgi.... | TITLE:
How do you debug a problem in the Activator of an Eclipse plug-in?
QUESTION:
I am trying to follow an OSGi bundle tutorial ( http://www.vogella.de/articles/OSGi/article.html ). It includes this method in the Activator class: public void start(BundleContext context) throws Exception { System.out.println("Startin... | [
"java",
"eclipse",
"osgi"
] | 0 | 0 | 321 | 2 | 0 | 2011-06-06T21:55:09.880000 | 2011-06-07T16:46:21.833000 |
6,258,497 | 6,258,733 | Window Phone 7 C# pass paramters in a routedeventhandler | I'm trying to pass parameters to a function that is used in a RoutedEventHandler Button start = new Button(); start.Click += new RoutedEventHandler(playSelectedAlarm_Click);
private void playSelectedAlarm_Click(object sender, EventArgs e) { NavigationService.Navigate(new Uri("/AlarmPicker.xaml", UriKind.Relative)); } ... | You could add your parameters into the Button's Tag property. Then, extract them in your event handler: Button start = new Button(); start.Tag = new string[] { "param1", "param2" }; start.Click += new RoutedEventHandler(playSelectedAlarm_Click);
private void playSelectedAlarm_Click(object sender, EventArgs e) { //extr... | Window Phone 7 C# pass paramters in a routedeventhandler I'm trying to pass parameters to a function that is used in a RoutedEventHandler Button start = new Button(); start.Click += new RoutedEventHandler(playSelectedAlarm_Click);
private void playSelectedAlarm_Click(object sender, EventArgs e) { NavigationService.Nav... | TITLE:
Window Phone 7 C# pass paramters in a routedeventhandler
QUESTION:
I'm trying to pass parameters to a function that is used in a RoutedEventHandler Button start = new Button(); start.Click += new RoutedEventHandler(playSelectedAlarm_Click);
private void playSelectedAlarm_Click(object sender, EventArgs e) { Nav... | [
"c#",
"windows-phone-7"
] | 0 | 2 | 1,224 | 2 | 0 | 2011-06-06T21:56:53.320000 | 2011-06-06T22:25:01.220000 |
6,258,505 | 6,258,946 | How To Set The Correct RadioButton.IsChecked Property True By Binding To A ViewModel? | I have the following scenario where a class like this: public class PetOwnerViewModel{ public PetOwnerStatus Status{get{return _petOwner.Status;}}
public ICommand SetStatusCommand {get{...}} } Is DataContext to a group of RadioButtons similar to this: CatLover DogLover Cat Lover Dog Lover How do I bind the View to the... | You can make this sort of thing very dynamic using data-templating, e.g. (-- Edit: It makes a lot more sense to use a ListBox which already has a SelectedItem property, see this revised answer --) public partial class MainWindow: Window, INotifyPropertyChanged { //For simplicity in put everything in the Window rather t... | How To Set The Correct RadioButton.IsChecked Property True By Binding To A ViewModel? I have the following scenario where a class like this: public class PetOwnerViewModel{ public PetOwnerStatus Status{get{return _petOwner.Status;}}
public ICommand SetStatusCommand {get{...}} } Is DataContext to a group of RadioButton... | TITLE:
How To Set The Correct RadioButton.IsChecked Property True By Binding To A ViewModel?
QUESTION:
I have the following scenario where a class like this: public class PetOwnerViewModel{ public PetOwnerStatus Status{get{return _petOwner.Status;}}
public ICommand SetStatusCommand {get{...}} } Is DataContext to a gr... | [
"c#",
"wpf",
"xaml",
"data-binding",
"radio-button"
] | 2 | 3 | 4,281 | 2 | 0 | 2011-06-06T21:57:54.970000 | 2011-06-06T22:57:12.533000 |
6,258,506 | 6,259,346 | Sourcing function file in bash_profile and bashrc but still doesn't work | It works in the interactive shell but not from in a script. This script and the trace that follows demostrates: set -x tail -n 2../.bash_profile tail -n 2../.bashrc cat../FUNC_FILE FUNC cat testfunc testfunc
***14:43:56 502 ~/work>FUNC imafunc ***14:44:02 503 ~/work>t ++ tail -n 2../.bash_profile. ~/FUNC_FILE compgen ... | The answer is here. You need to export the function after sourcing it in ~/.bash_profile. | Sourcing function file in bash_profile and bashrc but still doesn't work It works in the interactive shell but not from in a script. This script and the trace that follows demostrates: set -x tail -n 2../.bash_profile tail -n 2../.bashrc cat../FUNC_FILE FUNC cat testfunc testfunc
***14:43:56 502 ~/work>FUNC imafunc **... | TITLE:
Sourcing function file in bash_profile and bashrc but still doesn't work
QUESTION:
It works in the interactive shell but not from in a script. This script and the trace that follows demostrates: set -x tail -n 2../.bash_profile tail -n 2../.bashrc cat../FUNC_FILE FUNC cat testfunc testfunc
***14:43:56 502 ~/wo... | [
"function",
"bash"
] | 1 | 2 | 3,389 | 3 | 0 | 2011-06-06T21:57:55.017000 | 2011-06-06T23:56:05.120000 |
6,258,512 | 6,258,530 | Ruby methods without class? | Hey everyone! I was wondering how the methods in Ruby that aren't called with the syntax ClassName.method_name work. Some off the top of my head are puts, print, gets, chomp. These methods can be called without using the dot operator. Why is this? Where do they come from? And how can I see the full list of such methods... | All methods in Kernel will be available to all objects of class Object or any class derived from Object. You can use Kernel.instance_methods to list them. | Ruby methods without class? Hey everyone! I was wondering how the methods in Ruby that aren't called with the syntax ClassName.method_name work. Some off the top of my head are puts, print, gets, chomp. These methods can be called without using the dot operator. Why is this? Where do they come from? And how can I see t... | TITLE:
Ruby methods without class?
QUESTION:
Hey everyone! I was wondering how the methods in Ruby that aren't called with the syntax ClassName.method_name work. Some off the top of my head are puts, print, gets, chomp. These methods can be called without using the dot operator. Why is this? Where do they come from? A... | [
"ruby"
] | 5 | 9 | 2,593 | 2 | 0 | 2011-06-06T21:59:02.150000 | 2011-06-06T22:01:07.640000 |
6,258,521 | 6,258,628 | Clear icon inside input text | Is there a quick way to create an input text element with an icon on the right to clear the input element itself (like the google search box)? I looked around but I only found how to put an icon as background of the input element. Is there a jQuery plugin or something else? I want the icon inside the input text element... | Add a type="search" to your input The support is pretty decent but will not work in IE<10 Older browsers If you need IE9 support here are some workarounds Using a standard and some HTML elements: /** * Clearable text inputs */ $(".clearable").each(function() {
const $inp = $(this).find("input:text"), $cle = $(this).fi... | Clear icon inside input text Is there a quick way to create an input text element with an icon on the right to clear the input element itself (like the google search box)? I looked around but I only found how to put an icon as background of the input element. Is there a jQuery plugin or something else? I want the icon ... | TITLE:
Clear icon inside input text
QUESTION:
Is there a quick way to create an input text element with an icon on the right to clear the input element itself (like the google search box)? I looked around but I only found how to put an icon as background of the input element. Is there a jQuery plugin or something else... | [
"javascript",
"jquery",
"html",
"css"
] | 227 | 438 | 348,218 | 17 | 0 | 2011-06-06T22:00:35.550000 | 2011-06-06T22:11:44.043000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.