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,206,516 | 6,206,549 | Table Row onClick Overriding Checkbox | I'm having some issues with checkboxes in a table being "overridden" by the onClick attribute of the table row they are placed in. I have a column with checkboxes as the leftmost column of a table, and I also have an onClick function defined for each table row. As a result, when I click any of the checkboxes, the onCli... | Take a look at event.stopPropagation() event.stopPropagation You'll want to call this in your checkbox click handler. | Table Row onClick Overriding Checkbox I'm having some issues with checkboxes in a table being "overridden" by the onClick attribute of the table row they are placed in. I have a column with checkboxes as the leftmost column of a table, and I also have an onClick function defined for each table row. As a result, when I ... | TITLE:
Table Row onClick Overriding Checkbox
QUESTION:
I'm having some issues with checkboxes in a table being "overridden" by the onClick attribute of the table row they are placed in. I have a column with checkboxes as the leftmost column of a table, and I also have an onClick function defined for each table row. As... | [
"javascript",
"jquery",
"html",
"checkbox",
"dhtml"
] | 1 | 6 | 2,312 | 3 | 0 | 2011-06-01T19:21:00.203000 | 2011-06-01T19:24:51.207000 |
6,206,517 | 6,208,239 | How does WCF + SSL working with load balancing? | If SSL is handled by a load balancer, do I still need to configure it in the WCF serviceCertificate node? My scenario is to use message level security. If someone can explain how load balancing with wcf and ssl works, that would be very nice. | WCF requires security tokens to be passed over a secure transport if the message itself is not signed/encrypted. Since traffic is HTTP between your Big-IP and your individual web servers, you need a way to have security tokens that you know are secured between the client and the Big-IP up front still be passed to your ... | How does WCF + SSL working with load balancing? If SSL is handled by a load balancer, do I still need to configure it in the WCF serviceCertificate node? My scenario is to use message level security. If someone can explain how load balancing with wcf and ssl works, that would be very nice. | TITLE:
How does WCF + SSL working with load balancing?
QUESTION:
If SSL is handled by a load balancer, do I still need to configure it in the WCF serviceCertificate node? My scenario is to use message level security. If someone can explain how load balancing with wcf and ssl works, that would be very nice.
ANSWER:
WC... | [
"wcf",
"ssl",
"load-balancing"
] | 5 | 4 | 3,466 | 3 | 0 | 2011-06-01T19:21:00.377000 | 2011-06-01T21:59:11.250000 |
6,206,523 | 6,206,608 | Communication between the View and Model in MVC | After reading from many different sources, I am very confused about how View and Model should communicate in the MVC pattern. To my understanding, the accepted answer of this post and this article from Apple are saying the communication of the two should be done through controller. While the MVC page in Wikipedia, the ... | There is more than one answer. Eventually you can do whatever you thing suits your needs. I use a controller + ViewModels to connect to the view. The view never use the model. just what the controller gives him. There is a nice explanation of all models in steven sandarson book, Page 49 (variation on MVC). | Communication between the View and Model in MVC After reading from many different sources, I am very confused about how View and Model should communicate in the MVC pattern. To my understanding, the accepted answer of this post and this article from Apple are saying the communication of the two should be done through c... | TITLE:
Communication between the View and Model in MVC
QUESTION:
After reading from many different sources, I am very confused about how View and Model should communicate in the MVC pattern. To my understanding, the accepted answer of this post and this article from Apple are saying the communication of the two should... | [
"model-view-controller",
"view",
"model",
"communication"
] | 10 | 2 | 5,166 | 1 | 0 | 2011-06-01T19:21:45.743000 | 2011-06-01T19:31:38.373000 |
6,206,524 | 6,206,681 | more virtualizing stack panel height/slowness issues | I need a scrollviewer around a virtualizing stackpanel populated by an items control. Clearly the height is infinity and that's why it's not virtualizing. Why? ( ) | Take a look at this answer. There's more to making an ItemsControl Virtualizing than just setting the VirtualizingStackPanel Basically, put the ScrollViewer in your ItemsControl Template around your ItemsPresenter, and set VirtualizingStackPanel.IsVirtualizing="True" and ScrollViewer.CanContentScroll="True" on your Ite... | more virtualizing stack panel height/slowness issues I need a scrollviewer around a virtualizing stackpanel populated by an items control. Clearly the height is infinity and that's why it's not virtualizing. Why? ( ) | TITLE:
more virtualizing stack panel height/slowness issues
QUESTION:
I need a scrollviewer around a virtualizing stackpanel populated by an items control. Clearly the height is infinity and that's why it's not virtualizing. Why? ( )
ANSWER:
Take a look at this answer. There's more to making an ItemsControl Virtualiz... | [
"wpf"
] | 1 | 3 | 1,570 | 2 | 0 | 2011-06-01T19:21:45.930000 | 2011-06-01T19:39:04.260000 |
6,206,527 | 6,212,591 | Querying a hierarchy of parent->children - I want to sum an amount, but make sure I only count rows which have the same parent once | I have an n-level hierarchy of categories, and a set of products which can be arbitrarily mapped into categories. The same product can be in multiple categories, including multiple children of the same parent. What I'm trying to do is write a report that shows the total ordered amount of a product in a parent category.... | Can try changing this line: from hierarchy h to: from (select distinct * from hierarchy) h | Querying a hierarchy of parent->children - I want to sum an amount, but make sure I only count rows which have the same parent once I have an n-level hierarchy of categories, and a set of products which can be arbitrarily mapped into categories. The same product can be in multiple categories, including multiple childre... | TITLE:
Querying a hierarchy of parent->children - I want to sum an amount, but make sure I only count rows which have the same parent once
QUESTION:
I have an n-level hierarchy of categories, and a set of products which can be arbitrarily mapped into categories. The same product can be in multiple categories, includin... | [
"sql",
"sql-server"
] | 2 | 2 | 1,174 | 1 | 0 | 2011-06-01T19:22:22.300000 | 2011-06-02T09:17:50.283000 |
6,206,529 | 6,206,960 | Dynamics CRM 2011 - Processes updating non-form fields? | I'm evaulating Dynamics CRM 2011 currently so I'm still learning how things work. If a field marked as read-only on a form, is it possible to update it via a process step "update record"? I was trying to have some sort view-only fields that get dynamically updated via a process but in the interface those fields are not... | In order to update a readonly field with a workflow, you have to set it writable until you have the workflow configured. The field will then be accessible and you can add your update action. After that you can set the field to readonly again. Plugins are not affected by this setting because it is only used for the form... | Dynamics CRM 2011 - Processes updating non-form fields? I'm evaulating Dynamics CRM 2011 currently so I'm still learning how things work. If a field marked as read-only on a form, is it possible to update it via a process step "update record"? I was trying to have some sort view-only fields that get dynamically updated... | TITLE:
Dynamics CRM 2011 - Processes updating non-form fields?
QUESTION:
I'm evaulating Dynamics CRM 2011 currently so I'm still learning how things work. If a field marked as read-only on a form, is it possible to update it via a process step "update record"? I was trying to have some sort view-only fields that get d... | [
"dynamics-crm",
"dynamics-crm-2011"
] | 0 | 5 | 1,409 | 1 | 0 | 2011-06-01T19:22:36.553000 | 2011-06-01T20:02:29.373000 |
6,206,537 | 6,206,944 | Creating a local SVN branch | I am working on an SVN repository and do not want to create a new SVN branch. Instead of that, I want to create a branch local to my machine, something which could be done easily with Git. But I am currently using SVN and need to branch out from an already-modified SVN version. In essence, I want following: svn_repo_ve... | Subversion is a centralized version control system. Some of the advantages of a centralized system is that it forces everyone to play with the same codebase. You can't hide your work for months at a time, then suddenly plop it down two days before a major release. The bad part is that you can't truly have a private bra... | Creating a local SVN branch I am working on an SVN repository and do not want to create a new SVN branch. Instead of that, I want to create a branch local to my machine, something which could be done easily with Git. But I am currently using SVN and need to branch out from an already-modified SVN version. In essence, I... | TITLE:
Creating a local SVN branch
QUESTION:
I am working on an SVN repository and do not want to create a new SVN branch. Instead of that, I want to create a branch local to my machine, something which could be done easily with Git. But I am currently using SVN and need to branch out from an already-modified SVN vers... | [
"svn",
"version-control",
"repository",
"tortoisesvn"
] | 20 | 22 | 20,102 | 2 | 0 | 2011-06-01T19:23:24.730000 | 2011-06-01T20:01:07.627000 |
6,206,546 | 6,239,274 | How to do left outer joins with DbLinq and SQLite? | I tried db.Table1.GroupJoin(db.Table2, t1 => t1.Id, t2 => t2.t1Id, (t1,g) => new { t1, g }).Where(item =>!item.g.Any()).Select(item => item.t1); But it returned 0 results. I'm trying to write something that generated the following SQL code (or something similar) SELECT t1.* FROM Table1 as t1 LEFT OUTER JOIN Table2 as t... | It looks like your desired result is to identify the items from Table1 that had no results during the left outer join with Table2. In fluent notation, the approach would be similar to this: var query = db.Table1.GroupJoin(db.Table2, t1 => t1.Id, t2 => t2.t1Id, (t1, joined) => new { t1, joined } ).SelectMany(r => r.join... | How to do left outer joins with DbLinq and SQLite? I tried db.Table1.GroupJoin(db.Table2, t1 => t1.Id, t2 => t2.t1Id, (t1,g) => new { t1, g }).Where(item =>!item.g.Any()).Select(item => item.t1); But it returned 0 results. I'm trying to write something that generated the following SQL code (or something similar) SELECT... | TITLE:
How to do left outer joins with DbLinq and SQLite?
QUESTION:
I tried db.Table1.GroupJoin(db.Table2, t1 => t1.Id, t2 => t2.t1Id, (t1,g) => new { t1, g }).Where(item =>!item.g.Any()).Select(item => item.t1); But it returned 0 results. I'm trying to write something that generated the following SQL code (or somethi... | [
"c#",
"linq-to-sql",
"sqlite",
"left-join",
"dblinq"
] | 4 | 3 | 792 | 1 | 0 | 2011-06-01T19:24:35.150000 | 2011-06-04T20:42:26.780000 |
6,206,558 | 6,206,621 | How to save a picture in WPF application | Goal: Save a picture from the harddrive into my WPF application. The picture should be available if copying the WPF application. The address to the picture located in the WPF application should be saved in the database. Problem: How should I do it in a course of action? private void btnBrowse_Click(object sender, Route... | There are several image encoders available. A simple example for PNG files can be found here, or a more complete sample here. The same concept applies for the other supported image file types. | How to save a picture in WPF application Goal: Save a picture from the harddrive into my WPF application. The picture should be available if copying the WPF application. The address to the picture located in the WPF application should be saved in the database. Problem: How should I do it in a course of action? private ... | TITLE:
How to save a picture in WPF application
QUESTION:
Goal: Save a picture from the harddrive into my WPF application. The picture should be available if copying the WPF application. The address to the picture located in the WPF application should be saved in the database. Problem: How should I do it in a course o... | [
"c#",
"wpf",
"save",
"image"
] | 2 | 0 | 2,349 | 1 | 0 | 2011-06-01T19:25:37.103000 | 2011-06-01T19:32:43.623000 |
6,206,565 | 6,213,827 | Maven - Sharing libraries between projects | I'm working on a multi-project, and right now I have a structure that resembles this (actually there are a couple of jar projects and a couple of war projects) /myProj |_______projA (jar) | |____pom.xml | |____target/jar files |_______projB (war) | |___pom.xml | |___web-inf/lib/jarfiles |_______projEar | |___pom.xml |_... | You should be able to do this by adding the JAR as a dependency to your EAR's pom.xml: com.mycompany myapp-web 1.0-SNAPSHOT war com.mycompany myapp-utils 0.0.1-SNAPSHOT jar...and specifying the dependency as provided in your WARs' pom.xml: com.mycompany myapp-utils 0.0.1-SNAPSHOT provided If Maven/other tooling has alr... | Maven - Sharing libraries between projects I'm working on a multi-project, and right now I have a structure that resembles this (actually there are a couple of jar projects and a couple of war projects) /myProj |_______projA (jar) | |____pom.xml | |____target/jar files |_______projB (war) | |___pom.xml | |___web-inf/li... | TITLE:
Maven - Sharing libraries between projects
QUESTION:
I'm working on a multi-project, and right now I have a structure that resembles this (actually there are a couple of jar projects and a couple of war projects) /myProj |_______projA (jar) | |____pom.xml | |____target/jar files |_______projB (war) | |___pom.xm... | [
"maven",
"jakarta-ee",
"maven-2",
"maven-3",
"ear"
] | 6 | 7 | 9,099 | 2 | 0 | 2011-06-01T19:26:31.577000 | 2011-06-02T11:19:31.107000 |
6,206,568 | 6,206,685 | How can I inspect the window object for mobile safari? | How can I inspect the window object for mobile safari? Or more specifically window.navigator - trying to convert to string doesn't work and I can't explore it within the console either. Thanks! EDIT: console.log(window.navigator); console.log(String(window.navigator)); console.log(JSON.stringify(window.navigator)); con... | I like jsconsole.com. Also, you can use the json2.js library (https://github.com/douglascrockford/JSON-js), which will give you JSON.stringify() function. console.log(JSON.stringify({a:'a',b:'b'}); | How can I inspect the window object for mobile safari? How can I inspect the window object for mobile safari? Or more specifically window.navigator - trying to convert to string doesn't work and I can't explore it within the console either. Thanks! EDIT: console.log(window.navigator); console.log(String(window.navigato... | TITLE:
How can I inspect the window object for mobile safari?
QUESTION:
How can I inspect the window object for mobile safari? Or more specifically window.navigator - trying to convert to string doesn't work and I can't explore it within the console either. Thanks! EDIT: console.log(window.navigator); console.log(Stri... | [
"javascript",
"jquery",
"iphone",
"mobile",
"safari"
] | 12 | 4 | 21,243 | 5 | 0 | 2011-06-01T19:26:45.257000 | 2011-06-01T19:39:22.707000 |
6,206,579 | 6,206,943 | How to display particular position on the MapView? | I have a position, which I need to display. The format is like: lat: 59.915494, lng: 30.409456 Also I need to display current position of the user. The following code: MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mapView); mapView.getOverlays().add(myLocationOverlay); myLocationOverlay.enableMyLoca... | In order to adjust where the map is centered on or zoomed into you need to get the MapController. MapController controller = mMapView.getController(); controller.animateTo(geoPoint); // Or if you just want it to snap there controller.setCenter(geoPoint);
controller.setZoom(5); That point that you want to show you're g... | How to display particular position on the MapView? I have a position, which I need to display. The format is like: lat: 59.915494, lng: 30.409456 Also I need to display current position of the user. The following code: MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mapView); mapView.getOverlays().add... | TITLE:
How to display particular position on the MapView?
QUESTION:
I have a position, which I need to display. The format is like: lat: 59.915494, lng: 30.409456 Also I need to display current position of the user. The following code: MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, mapView); mapView... | [
"android",
"android-mapview"
] | 0 | 2 | 1,328 | 1 | 0 | 2011-06-01T19:27:53.823000 | 2011-06-01T20:01:05.633000 |
6,206,588 | 6,208,036 | How to automate this process? | It involves rewriting.htm to.txt (output file) then using a parser (stanford grammar parser) (output file) for all the files in a directory. MY QUESTION: I would like to get all the files in the directory, without doing it manually, and find a way to run the parser, without having to type it into the Terminal for each ... | I take it from your question that what you want to do is to apply this script to all the (html-) files in a certain folder, and output text versions of them. So a simple solution is to simply replace the hardcoded file names with variables, and loop the script around the @ARGV, e.g. the arguments to the script, like so... | How to automate this process? It involves rewriting.htm to.txt (output file) then using a parser (stanford grammar parser) (output file) for all the files in a directory. MY QUESTION: I would like to get all the files in the directory, without doing it manually, and find a way to run the parser, without having to type ... | TITLE:
How to automate this process?
QUESTION:
It involves rewriting.htm to.txt (output file) then using a parser (stanford grammar parser) (output file) for all the files in a directory. MY QUESTION: I would like to get all the files in the directory, without doing it manually, and find a way to run the parser, witho... | [
"perl",
"macos",
"terminal"
] | 1 | 1 | 279 | 5 | 0 | 2011-06-01T19:29:10.910000 | 2011-06-01T21:38:05.933000 |
6,206,589 | 6,306,656 | spring - Unsatisfied dependency expressed through object property | I am receiving the following error when attempting to inject my dao into a unit test class using spring. UnitTest.DataAccess.FruitDaoTest.GetAllVitaminC: SetUp: Spring.Objects.Factory.UnsatisfiedDependencyException: Error creating object with name 'FruitDaoTest': Unsatisfied dependency expressed through object property... | It seems your test does not use the context where you defined your FruitDao bean, thus preventing its autowiring... Check the GetContext/ConfigLocations methods to be sure you load the expected XML files. | spring - Unsatisfied dependency expressed through object property I am receiving the following error when attempting to inject my dao into a unit test class using spring. UnitTest.DataAccess.FruitDaoTest.GetAllVitaminC: SetUp: Spring.Objects.Factory.UnsatisfiedDependencyException: Error creating object with name 'Fruit... | TITLE:
spring - Unsatisfied dependency expressed through object property
QUESTION:
I am receiving the following error when attempting to inject my dao into a unit test class using spring. UnitTest.DataAccess.FruitDaoTest.GetAllVitaminC: SetUp: Spring.Objects.Factory.UnsatisfiedDependencyException: Error creating objec... | [
"c#",
"dependency-injection",
"spring.net"
] | 3 | 2 | 2,067 | 1 | 0 | 2011-06-01T19:29:18.163000 | 2011-06-10T12:54:48.410000 |
6,206,590 | 6,207,285 | Using WebSockets... Efficiently? | I've read pretty much every guide and tutorial I can find on WebSockets, but not one of them has covered how to use them efficiently. Does anyone have any sort of guide on how to do this? I'm concerned about the amount of bandwidth a single connection can take up, especially when applications have hundrends of connecti... | The efficiency in WebSocket depends on the implementation and architecture of the webserver that handles them. WebSocket is a very efficient protocol with only 2 byte (!) overhead, compare to the all different HTTP header fields and HTTP cookies that is sent in every Ajax request. Usually an efficient webserver for web... | Using WebSockets... Efficiently? I've read pretty much every guide and tutorial I can find on WebSockets, but not one of them has covered how to use them efficiently. Does anyone have any sort of guide on how to do this? I'm concerned about the amount of bandwidth a single connection can take up, especially when applic... | TITLE:
Using WebSockets... Efficiently?
QUESTION:
I've read pretty much every guide and tutorial I can find on WebSockets, but not one of them has covered how to use them efficiently. Does anyone have any sort of guide on how to do this? I'm concerned about the amount of bandwidth a single connection can take up, espe... | [
"javascript",
"networking",
"websocket"
] | 16 | 28 | 8,356 | 1 | 0 | 2011-06-01T19:29:19.537000 | 2011-06-01T20:32:51.030000 |
6,206,592 | 6,206,908 | STL + typedefs vs. OOP, best practices? | I "grew up" learning to set up data structures using OOP. But now as I learn more about C++, STL, and Boost, I find that many of my data structure needs can be met by combining STL classes into more complex composites like: typedef std::map > CSVData; Obviously there are limits to this when I need to mix data types, bu... | If this is for some one-off code: sure, use typedefs, why not? But code rarely is. And the problem with reusable code (or code that will, potentially, at some future point be reused) is: there are 1000 different ways of using it wrongly. Don’t artificially add reasons 1001–1255. Code should be easy to use, and hard to ... | STL + typedefs vs. OOP, best practices? I "grew up" learning to set up data structures using OOP. But now as I learn more about C++, STL, and Boost, I find that many of my data structure needs can be met by combining STL classes into more complex composites like: typedef std::map > CSVData; Obviously there are limits t... | TITLE:
STL + typedefs vs. OOP, best practices?
QUESTION:
I "grew up" learning to set up data structures using OOP. But now as I learn more about C++, STL, and Boost, I find that many of my data structure needs can be met by combining STL classes into more complex composites like: typedef std::map > CSVData; Obviously ... | [
"c++",
"oop",
"stl",
"typedef"
] | 5 | 7 | 1,538 | 6 | 0 | 2011-06-01T19:29:54.360000 | 2011-06-01T19:57:41.653000 |
6,206,594 | 6,206,703 | Specify font size in webview via dip | Is there a way to programmatically convert dip to px as I need to set a font size in a webview but dip will be no good I am assuming. | From the description of Density-independent pixel (dp) from Overview of Screens Support The conversion of dp units to screen pixels is simple: px = dp * (dpi / 160). For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels. I'm not sure how well that will work for you in a WebView but worth looking at. | Specify font size in webview via dip Is there a way to programmatically convert dip to px as I need to set a font size in a webview but dip will be no good I am assuming. | TITLE:
Specify font size in webview via dip
QUESTION:
Is there a way to programmatically convert dip to px as I need to set a font size in a webview but dip will be no good I am assuming.
ANSWER:
From the description of Density-independent pixel (dp) from Overview of Screens Support The conversion of dp units to scre... | [
"android"
] | 1 | 1 | 2,274 | 1 | 0 | 2011-06-01T19:30:10.873000 | 2011-06-01T19:40:26.417000 |
6,206,598 | 6,206,655 | Javascript: Proper way to separate metadata from HTML? | What is the proper way of separating my meta-data from the HTML? As my projects grow bigger and bigger tying up meta-data with HTML becomes more and more messy. Any good alternatives? Meta Data: Everything the JS needs to know about an HTML element which isn't straight-forwardly encoded in the HTML elements and their a... | If you want to attach metadata to DOM elements then use HTML5 data- attributes or use jQuery's.data() method to do it programmatically. Here's a real world example I just used it on that really helped. I sent a request to the server to upload a file and I get a JSON response with the File Name, Content Type, Size and a... | Javascript: Proper way to separate metadata from HTML? What is the proper way of separating my meta-data from the HTML? As my projects grow bigger and bigger tying up meta-data with HTML becomes more and more messy. Any good alternatives? Meta Data: Everything the JS needs to know about an HTML element which isn't stra... | TITLE:
Javascript: Proper way to separate metadata from HTML?
QUESTION:
What is the proper way of separating my meta-data from the HTML? As my projects grow bigger and bigger tying up meta-data with HTML becomes more and more messy. Any good alternatives? Meta Data: Everything the JS needs to know about an HTML elemen... | [
"javascript",
"jquery",
"metadata"
] | 1 | 2 | 230 | 2 | 0 | 2011-06-01T19:30:26.070000 | 2011-06-01T19:36:55.557000 |
6,206,599 | 6,206,635 | git report files changed on which I did not work | git status reports a large set of file to be “new”, “modified” and “deleted” in a directory tree I never worked in. In Subversion I would do a svn revert --recursive iPhone (I don't work on the iPhone version of the App) and be done with. But with Git things are not easy. With Git everything it is always complicated. S... | The equivalent Git command is: git reset --hard HEAD Be aware that this will throw away any local changes you have made in the whole tree (since the last commit). Be careful with this, it's a good idea to take a backup of your entire repository until you check that this really does what you want. | git report files changed on which I did not work git status reports a large set of file to be “new”, “modified” and “deleted” in a directory tree I never worked in. In Subversion I would do a svn revert --recursive iPhone (I don't work on the iPhone version of the App) and be done with. But with Git things are not easy... | TITLE:
git report files changed on which I did not work
QUESTION:
git status reports a large set of file to be “new”, “modified” and “deleted” in a directory tree I never worked in. In Subversion I would do a svn revert --recursive iPhone (I don't work on the iPhone version of the App) and be done with. But with Git t... | [
"git"
] | 3 | 2 | 547 | 2 | 0 | 2011-06-01T19:30:34.433000 | 2011-06-01T19:34:12.783000 |
6,206,600 | 6,211,630 | SQLAlchemy - subquery in a WHERE clause | I've just recently started using SQLAlchemy and am still having trouble wrapping my head around some of the concepts. Boiled down to the essential elements, I have two tables like this (this is through Flask-SQLAlchemy): class User(db.Model): __tablename__ = 'users' user_id = db.Column(db.Integer, primary_key=True)
cl... | This should work (different SQL, same result): t = Session.query( Posts.user_id, func.max(Posts.post_time).label('max_post_time'), ).group_by(Posts.user_id).subquery('t')
query = Session.query(User, Posts).filter(and_( User.user_id == Posts.user_id, User.user_id == t.c.user_id, Posts.post_time == t.c.max_post_time, ))... | SQLAlchemy - subquery in a WHERE clause I've just recently started using SQLAlchemy and am still having trouble wrapping my head around some of the concepts. Boiled down to the essential elements, I have two tables like this (this is through Flask-SQLAlchemy): class User(db.Model): __tablename__ = 'users' user_id = db.... | TITLE:
SQLAlchemy - subquery in a WHERE clause
QUESTION:
I've just recently started using SQLAlchemy and am still having trouble wrapping my head around some of the concepts. Boiled down to the essential elements, I have two tables like this (this is through Flask-SQLAlchemy): class User(db.Model): __tablename__ = 'us... | [
"python",
"sqlalchemy",
"subquery"
] | 66 | 80 | 88,413 | 3 | 0 | 2011-06-01T19:30:43.137000 | 2011-06-02T07:21:28.657000 |
6,206,615 | 6,206,639 | Rails: accept first search result | I'm using MetaSearch in a Rails 3 project although I imagine the search method doesn't really matter that much. My controller looks like this: def index @search = Household.search(params[:search]) @households = @search.all end If there is only a single search result, I want to go directly to the "show" action for that ... | you could add something like if @households.count == 1 redirect_to household_path(@households.first) end | Rails: accept first search result I'm using MetaSearch in a Rails 3 project although I imagine the search method doesn't really matter that much. My controller looks like this: def index @search = Household.search(params[:search]) @households = @search.all end If there is only a single search result, I want to go direc... | TITLE:
Rails: accept first search result
QUESTION:
I'm using MetaSearch in a Rails 3 project although I imagine the search method doesn't really matter that much. My controller looks like this: def index @search = Household.search(params[:search]) @households = @search.all end If there is only a single search result, ... | [
"ruby-on-rails",
"ruby-on-rails-3"
] | 0 | 1 | 75 | 2 | 0 | 2011-06-01T19:32:13.627000 | 2011-06-01T19:34:53.433000 |
6,206,620 | 6,206,672 | The importance of design in a spring app | I've been taking a look into using the spring framework for my java apps. It is such a different way of looking at programming in general, i'm talking about DI and AOP! The level of breaking the fundamental parts up into reusable components to me seems like a lot of work up front(in the design process). Im questioning ... | Ive never seen an app that was completely designed (on the implementation level) up front. On the contrary, refactoring is (well should be) part of the process, regardless of whether or not you use Spring. Perhaps you are overcome by the scope of the Spring framework. Don't be. The main goal is to use dependency inject... | The importance of design in a spring app I've been taking a look into using the spring framework for my java apps. It is such a different way of looking at programming in general, i'm talking about DI and AOP! The level of breaking the fundamental parts up into reusable components to me seems like a lot of work up fron... | TITLE:
The importance of design in a spring app
QUESTION:
I've been taking a look into using the spring framework for my java apps. It is such a different way of looking at programming in general, i'm talking about DI and AOP! The level of breaking the fundamental parts up into reusable components to me seems like a l... | [
"java",
"spring",
"dependency-injection",
"aop"
] | 1 | 3 | 206 | 2 | 0 | 2011-06-01T19:32:35.670000 | 2011-06-01T19:38:18.013000 |
6,206,622 | 6,206,755 | Cross-Thread Exception - Environment Only | A control can only be accessed by the thread that created it - this much I know. I have a DataGridView with a DataSource based on a BindingList<>. I have a worker thread (non-GUI) that runs some fancy calculations/comparisons/etc and then adds/edits an object to/in the BindingList<>. On a timer, the GUI thread refreshe... | The error may occur only in VS if it is a MDA ( Managed Debugging Assistant ), not a runtime exception. MDAs are there to tell you when you are doing something that is usually, but not 100% always, something that will get you in trouble in production code (which this will, eventually, even if it seems to work 99% of th... | Cross-Thread Exception - Environment Only A control can only be accessed by the thread that created it - this much I know. I have a DataGridView with a DataSource based on a BindingList<>. I have a worker thread (non-GUI) that runs some fancy calculations/comparisons/etc and then adds/edits an object to/in the BindingL... | TITLE:
Cross-Thread Exception - Environment Only
QUESTION:
A control can only be accessed by the thread that created it - this much I know. I have a DataGridView with a DataSource based on a BindingList<>. I have a worker thread (non-GUI) that runs some fancy calculations/comparisons/etc and then adds/edits an object ... | [
"c#",
"winforms",
"multithreading",
"marshalling"
] | 5 | 4 | 599 | 3 | 0 | 2011-06-01T19:32:43.813000 | 2011-06-01T19:44:47.630000 |
6,206,630 | 6,206,690 | git - pushing only the top most commit to server | I have a situation where I: (1) Merged a patch by user X (2) Made some changes to some other code and committed. Now I want to push my commit to the server. However, when I do git push origin HEAD:refs/for/mybranch I get an error regarding the patch that I merged, saying that I am not the author. Is there a way to do w... | Second revision: git reset --soft HEAD^ (to undo your commit) git stash (to stash away your changes) git reset --soft HEAD^ (to undo the merge commit from X) git stash (stash away X) git stash apply stash@{1} (apply your changes) git add. (add and commit and push..) git commit -m "some changes" git push git stash apply... | git - pushing only the top most commit to server I have a situation where I: (1) Merged a patch by user X (2) Made some changes to some other code and committed. Now I want to push my commit to the server. However, when I do git push origin HEAD:refs/for/mybranch I get an error regarding the patch that I merged, saying... | TITLE:
git - pushing only the top most commit to server
QUESTION:
I have a situation where I: (1) Merged a patch by user X (2) Made some changes to some other code and committed. Now I want to push my commit to the server. However, when I do git push origin HEAD:refs/for/mybranch I get an error regarding the patch tha... | [
"git"
] | 1 | 1 | 1,788 | 3 | 0 | 2011-06-01T19:33:33.500000 | 2011-06-01T19:39:44.043000 |
6,206,632 | 6,207,750 | Another Rails 3 Nested Forms Issue | So I have the following: class ComplexAssertion < ActiveRecord::Base has_many:assertion_groups has_many:assertions,:through =>:assertion_group
class AssertionGroup < ActiveRecord::Base belongs_to:complex_assertion has_many:assertions,:dependent =>:destroy,:autosave=>true
class Assertion < ActiveRecord::Base belongs_t... | Your ComplexAssertion class should look like this class ComplexAssertion < ActiveRecord::Base has_many:assertion_groups has_many:assertions,:through =>:assertion_group
accepts_nested_attributes_for:assertion_groups # <= add this Your AssertionGroup class should look like this class AssertionGroup < ActiveRecord::Base ... | Another Rails 3 Nested Forms Issue So I have the following: class ComplexAssertion < ActiveRecord::Base has_many:assertion_groups has_many:assertions,:through =>:assertion_group
class AssertionGroup < ActiveRecord::Base belongs_to:complex_assertion has_many:assertions,:dependent =>:destroy,:autosave=>true
class Asser... | TITLE:
Another Rails 3 Nested Forms Issue
QUESTION:
So I have the following: class ComplexAssertion < ActiveRecord::Base has_many:assertion_groups has_many:assertions,:through =>:assertion_group
class AssertionGroup < ActiveRecord::Base belongs_to:complex_assertion has_many:assertions,:dependent =>:destroy,:autosave=... | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-3"
] | 0 | 2 | 583 | 1 | 0 | 2011-06-01T19:33:50.360000 | 2011-06-01T21:10:55.110000 |
6,206,637 | 6,211,093 | RichFaces: Does navigation from one page to the next page using panelMenuItem needs to be enclosed in <h:form> | Since i'm just navigating from one page to the next using richfaces panelMenuItem, do those panels/panelMenuGroup/panelMenuItem needs to be enclosed in the in order for it to navigate successfully? I noticed that if i do not enclose those panels elements in the, nothing happens. But why do i need to enclose it in a for... | Yes!! You need to enclose it into tag because you are navigating from one page to another. To navigate from one page to another you need to send request to the server and to send request to the server for page where you want to navigate you need a form:). | RichFaces: Does navigation from one page to the next page using panelMenuItem needs to be enclosed in <h:form> Since i'm just navigating from one page to the next using richfaces panelMenuItem, do those panels/panelMenuGroup/panelMenuItem needs to be enclosed in the in order for it to navigate successfully? I noticed t... | TITLE:
RichFaces: Does navigation from one page to the next page using panelMenuItem needs to be enclosed in <h:form>
QUESTION:
Since i'm just navigating from one page to the next using richfaces panelMenuItem, do those panels/panelMenuGroup/panelMenuItem needs to be enclosed in the in order for it to navigate success... | [
"richfaces"
] | 0 | 1 | 1,287 | 1 | 0 | 2011-06-01T19:34:41.793000 | 2011-06-02T06:11:50.743000 |
6,206,641 | 6,211,178 | TD works center and left align but not right align | My code add one row of a table dinamicaly. The alignment wrks for the firs row that is static but not for the other rows. Intead of this I have tested the dinamic content with center align attribute and it works. Here is the part of the code that I am refering, and below the complete function. colsfila=document.createE... | You're spelling right incorrectly in multiple places. Do a search and replace for rigth to right. | TD works center and left align but not right align My code add one row of a table dinamicaly. The alignment wrks for the firs row that is static but not for the other rows. Intead of this I have tested the dinamic content with center align attribute and it works. Here is the part of the code that I am refering, and bel... | TITLE:
TD works center and left align but not right align
QUESTION:
My code add one row of a table dinamicaly. The alignment wrks for the firs row that is static but not for the other rows. Intead of this I have tested the dinamic content with center align attribute and it works. Here is the part of the code that I am... | [
"coding-style",
"alignment",
"html-table",
"dynamic-html"
] | 0 | 0 | 2,548 | 2 | 0 | 2011-06-01T19:34:56.880000 | 2011-06-02T06:23:30.753000 |
6,206,642 | 6,206,659 | How to remove the first character of a variable | HI All, In my js file i am getting an array of records (negetive values ) like this deletedDetailIds = $.map(eformDetailIds, function(e) { return e < 0? e: null; }); For example the deletedDetailIds = -1234,-1235,-1256 like this. Now i have to create an array and add these values with out negetive symbols. like newArra... | The correct way would be to use Math.abs: $.map(eformDetailIds, function(e) { return e < 0? Math.abs(e): null; }); You could also multiply with -1. You are dealing with numbers. Only the string representation contains a - to indicate the negative value, so you cannot really remove the first character here. | How to remove the first character of a variable HI All, In my js file i am getting an array of records (negetive values ) like this deletedDetailIds = $.map(eformDetailIds, function(e) { return e < 0? e: null; }); For example the deletedDetailIds = -1234,-1235,-1256 like this. Now i have to create an array and add thes... | TITLE:
How to remove the first character of a variable
QUESTION:
HI All, In my js file i am getting an array of records (negetive values ) like this deletedDetailIds = $.map(eformDetailIds, function(e) { return e < 0? e: null; }); For example the deletedDetailIds = -1234,-1235,-1256 like this. Now i have to create an ... | [
"javascript",
"jquery"
] | 2 | 6 | 365 | 9 | 0 | 2011-06-01T19:34:57.343000 | 2011-06-01T19:37:20.843000 |
6,206,649 | 6,206,750 | Lambda or LINQ to Sort List<Employee> by Shift, C# | I have a List of Employee that I need to filter, and I'd like to see how to do this using a lambda and/or LINQ expression. I want to return ALL of the Employees in the List, but I want them returned in order of Shift, Lastname, and Firstname. List empList = GetEmployeesInOtherCode(); //... int MAX_SHIFT = 5; List sorte... | For this I like query expression syntax better: List sortedNames = (from e in empList orderby e.Shift, e.LastName, e.FirstName select string.Format("{0}, {1}", e.Lastname, e.Firstname)).ToList(); | Lambda or LINQ to Sort List<Employee> by Shift, C# I have a List of Employee that I need to filter, and I'd like to see how to do this using a lambda and/or LINQ expression. I want to return ALL of the Employees in the List, but I want them returned in order of Shift, Lastname, and Firstname. List empList = GetEmployee... | TITLE:
Lambda or LINQ to Sort List<Employee> by Shift, C#
QUESTION:
I have a List of Employee that I need to filter, and I'd like to see how to do this using a lambda and/or LINQ expression. I want to return ALL of the Employees in the List, but I want them returned in order of Shift, Lastname, and Firstname. List emp... | [
"c#",
"linq",
"lambda"
] | 2 | 3 | 732 | 3 | 0 | 2011-06-01T19:35:58.283000 | 2011-06-01T19:44:25.477000 |
6,206,650 | 6,206,695 | or [self dealloc] work? | I make a object that use the camera to decode a bar code. If it was successful it send a delegate message to next action, if not, it only go out, and next screen start to work. If am I in the last command of the object, can I send [self release] to free the memory? But, the problem is: the retainCount can be more than ... | There are a couple of instances where I have seen classes that retain themselves in order to keep themselves around until they perform work. NEVER, EVER, EVER CALL DEALLOC*. Dealloc is not for you, but the runtime. If you no longer need an object, just appropriately release it. It is only the runtime's duty to call tha... | or [self dealloc] work? I make a object that use the camera to decode a bar code. If it was successful it send a delegate message to next action, if not, it only go out, and next screen start to work. If am I in the last command of the object, can I send [self release] to free the memory? But, the problem is: the retai... | TITLE:
or [self dealloc] work?
QUESTION:
I make a object that use the camera to decode a bar code. If it was successful it send a delegate message to next action, if not, it only go out, and next screen start to work. If am I in the last command of the object, can I send [self release] to free the memory? But, the pro... | [
"objective-c",
"cocoa-touch"
] | 1 | 5 | 385 | 2 | 0 | 2011-06-01T19:36:07.817000 | 2011-06-01T19:40:01.343000 |
6,206,662 | 6,225,000 | .Net interface with AutoCad - how to make a selection | How to select all object within the drawing? Sometthing related to AcadSelectionSet select = _acadCurrentDocument.SelectionSets.Add("my"); select.Select(AcSelect.acSelectionSetAll); But cannot make it working. | In real.NET AutoCAD API (in process, not C#/COM like in your exemple): Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; PromptSelectionResult psr = ed.GetSelection(); if (psr.Status!= PromptStatus.OK) return; using (Transaction tr = db.TransactionManager.... | .Net interface with AutoCad - how to make a selection How to select all object within the drawing? Sometthing related to AcadSelectionSet select = _acadCurrentDocument.SelectionSets.Add("my"); select.Select(AcSelect.acSelectionSetAll); But cannot make it working. | TITLE:
.Net interface with AutoCad - how to make a selection
QUESTION:
How to select all object within the drawing? Sometthing related to AcadSelectionSet select = _acadCurrentDocument.SelectionSets.Add("my"); select.Select(AcSelect.acSelectionSetAll); But cannot make it working.
ANSWER:
In real.NET AutoCAD API (in p... | [
"c#",
".net",
"autocad"
] | 1 | 4 | 3,163 | 2 | 0 | 2011-06-01T19:37:31.063000 | 2011-06-03T09:00:01.557000 |
6,206,678 | 6,206,718 | Performance of operator| vs operators+ | Is there any major difference between | and + that would affect a code's performance in the long run? or are both O(1)? the code i am working with is something like this: uint64_t dostuff(uint64_t a,uint64_t b){ // the max values of the inputs are 2^32 - 1
// lots of stuff involving boolean operators // that have no w... | No performance difference on any modern computer. The two operators have different meaning though. If the bit is already set, | will do nothing, but + will clear the bit and all the following non-zero bits and set the next zero bit to 1. | Performance of operator| vs operators+ Is there any major difference between | and + that would affect a code's performance in the long run? or are both O(1)? the code i am working with is something like this: uint64_t dostuff(uint64_t a,uint64_t b){ // the max values of the inputs are 2^32 - 1
// lots of stuff involv... | TITLE:
Performance of operator| vs operators+
QUESTION:
Is there any major difference between | and + that would affect a code's performance in the long run? or are both O(1)? the code i am working with is something like this: uint64_t dostuff(uint64_t a,uint64_t b){ // the max values of the inputs are 2^32 - 1
// lo... | [
"c++",
"math",
"boolean-operations"
] | 2 | 5 | 268 | 8 | 0 | 2011-06-01T19:38:49.130000 | 2011-06-01T19:41:46.990000 |
6,206,680 | 6,207,153 | Parsing Google Analytics API XML Response | I cannot seem to parse out the metrics for an organic keyword. I am using simplexml_load_string to load the whole response string and then when I print_r the object I can see this: [0] => SimpleXMLElement Object ( [id] => http://www.google.com/analytics/feeds/data?ids=ga:480&ga:keyword=cats&start-date=2011-04-10&end-da... | Edit: the easy way out is this: var_dump($object->xpath('dxp:metric')); The problem is that simplexml has a 'gotcha' with namespaces. As kudo's to squirrel, you indeed need to use namespaces, but I have a hunch that you only posted a part of the xml response and not the whole response. There is an excellent post about ... | Parsing Google Analytics API XML Response I cannot seem to parse out the metrics for an organic keyword. I am using simplexml_load_string to load the whole response string and then when I print_r the object I can see this: [0] => SimpleXMLElement Object ( [id] => http://www.google.com/analytics/feeds/data?ids=ga:480&ga... | TITLE:
Parsing Google Analytics API XML Response
QUESTION:
I cannot seem to parse out the metrics for an organic keyword. I am using simplexml_load_string to load the whole response string and then when I print_r the object I can see this: [0] => SimpleXMLElement Object ( [id] => http://www.google.com/analytics/feeds/... | [
"php",
"xml-parsing"
] | 1 | 1 | 1,314 | 2 | 0 | 2011-06-01T19:38:57.880000 | 2011-06-01T20:20:49.017000 |
6,206,682 | 6,215,547 | Should I not be subclassing the Cocos2d CCDirector class? | I'm trying to make cocos2d work as an RPG engine. I'm thinking of making a class that will coordinate the movements of the characters, the map loading/unloading etc. Should I make a CCNode for this, or just extend the CCDirector? Is there a reason not to subclass the CCDirector? | I have never seen a subclass of CCDirector except the subclasses in cocos2d (CCDirectorDisplayLink, CCDirectorTimer or so on). Subclasses of CCDirector are allowed to create, but it is not really needed. If you want a method that is invoked for every frame, you can use CCScheduler -scheduleSelector:forTarget:interval:p... | Should I not be subclassing the Cocos2d CCDirector class? I'm trying to make cocos2d work as an RPG engine. I'm thinking of making a class that will coordinate the movements of the characters, the map loading/unloading etc. Should I make a CCNode for this, or just extend the CCDirector? Is there a reason not to subclas... | TITLE:
Should I not be subclassing the Cocos2d CCDirector class?
QUESTION:
I'm trying to make cocos2d work as an RPG engine. I'm thinking of making a class that will coordinate the movements of the characters, the map loading/unloading etc. Should I make a CCNode for this, or just extend the CCDirector? Is there a rea... | [
"architecture",
"cocos2d-iphone",
"subclass",
"program-structure"
] | 1 | 1 | 251 | 1 | 0 | 2011-06-01T19:39:10.030000 | 2011-06-02T13:57:22.257000 |
6,206,689 | 6,206,760 | Inspecting HTTP POST headers in Python without downloading body | A web server responds to a POST request with a file to download (has Content-Disposition header). Using urllib or mechanize opener at what point will the response body be downloaded? opener = mechanize.build_opener(HTTPRefererProcessor, HTTPEquivProcessor, HTTPRefreshProcessor) r = make_post_request() # makes Request o... | Well, when you just want headers, you should be using HTTP HEAD. POST and GET will by definition return content. In terms of stopping the download, the web server won't wait to start sending you data, and everything from Python to your network card will start receiving and buffering the data immediately. So your best b... | Inspecting HTTP POST headers in Python without downloading body A web server responds to a POST request with a file to download (has Content-Disposition header). Using urllib or mechanize opener at what point will the response body be downloaded? opener = mechanize.build_opener(HTTPRefererProcessor, HTTPEquivProcessor,... | TITLE:
Inspecting HTTP POST headers in Python without downloading body
QUESTION:
A web server responds to a POST request with a file to download (has Content-Disposition header). Using urllib or mechanize opener at what point will the response body be downloaded? opener = mechanize.build_opener(HTTPRefererProcessor, H... | [
"python",
"http",
"urllib2"
] | 1 | 1 | 562 | 2 | 0 | 2011-06-01T19:39:38.910000 | 2011-06-01T19:44:59.830000 |
6,206,698 | 6,206,725 | printing array not working | hello everyone i am printing array from the database in the following format Array ( [0] => 14 [task_id] => 14 [1] => 123 [user_id] => 123 [2] => 456 [employee_id] => 456 [3] => 2 [service_id] => 2 [4] => 2:00 AM [starttime] => 2:00 AM [5] => 4:00 AM [endtime] => 4:00 AM [6] => se a [servicename] => se a [7] => ddsdsd ... | You need quotes around the key for this to work: echo $row['task_id']; Good-luck! | printing array not working hello everyone i am printing array from the database in the following format Array ( [0] => 14 [task_id] => 14 [1] => 123 [user_id] => 123 [2] => 456 [employee_id] => 456 [3] => 2 [service_id] => 2 [4] => 2:00 AM [starttime] => 2:00 AM [5] => 4:00 AM [endtime] => 4:00 AM [6] => se a [servicen... | TITLE:
printing array not working
QUESTION:
hello everyone i am printing array from the database in the following format Array ( [0] => 14 [task_id] => 14 [1] => 123 [user_id] => 123 [2] => 456 [employee_id] => 456 [3] => 2 [service_id] => 2 [4] => 2:00 AM [starttime] => 2:00 AM [5] => 4:00 AM [endtime] => 4:00 AM [6]... | [
"php"
] | 0 | 4 | 536 | 6 | 0 | 2011-06-01T19:40:11.033000 | 2011-06-01T19:42:30.320000 |
6,206,702 | 6,207,161 | NodeJS - Child node process? | I'm using NodeJS to run a socket server (using socket.io). When a client connects, I want am opening and running a module which does a bunch of stuff. Even though I am careful to try and catch as much as possible, when this module throws an error, it obviously takes down the entire socket server with it. Is there a way... | I'm assuming these modules you're talking about are JS code. If so, you might want to try the vm module. This lets you run code in a separate context, and also gives you the ability to do a try / catch around execution of the specific code. You can run node as a separate process and watch the data go by using spawn, th... | NodeJS - Child node process? I'm using NodeJS to run a socket server (using socket.io). When a client connects, I want am opening and running a module which does a bunch of stuff. Even though I am careful to try and catch as much as possible, when this module throws an error, it obviously takes down the entire socket s... | TITLE:
NodeJS - Child node process?
QUESTION:
I'm using NodeJS to run a socket server (using socket.io). When a client connects, I want am opening and running a module which does a bunch of stuff. Even though I am careful to try and catch as much as possible, when this module throws an error, it obviously takes down t... | [
"node.js"
] | 5 | 5 | 2,025 | 2 | 0 | 2011-06-01T19:40:22.240000 | 2011-06-01T20:21:28.310000 |
6,206,717 | 6,207,804 | ASIHTTPRequest and ASIWebPageRequest loading local html file error | I'm trying to use the ASIWebPageRequest to load a local html file so that I can use the built-in caching in ASIWebPageRequest. I know this might sound a bit pointless however I want to use remote images in my local files that only get updated once a week or so. If that makes sense. Here is what I'm doing in code: //OUT... | ASIWebPageRequest is a subclass of ASIHTTPRequest, and unfortunately ASIHTTPRequest doesn't support fetching file: URLs - only http and https ones. Basically you have all the code you need, you just need to find a way to plumb it together. You could create a subclass of ASIHTTPRequest that can load file: URLs (essentia... | ASIHTTPRequest and ASIWebPageRequest loading local html file error I'm trying to use the ASIWebPageRequest to load a local html file so that I can use the built-in caching in ASIWebPageRequest. I know this might sound a bit pointless however I want to use remote images in my local files that only get updated once a wee... | TITLE:
ASIHTTPRequest and ASIWebPageRequest loading local html file error
QUESTION:
I'm trying to use the ASIWebPageRequest to load a local html file so that I can use the built-in caching in ASIWebPageRequest. I know this might sound a bit pointless however I want to use remote images in my local files that only get ... | [
"iphone",
"http-status-code-404",
"asihttprequest"
] | 4 | 1 | 1,579 | 2 | 0 | 2011-06-01T19:41:45.213000 | 2011-06-01T21:16:05.503000 |
6,206,727 | 6,217,358 | What are the performance considerations of storing files in MySQL? | I'm creating an application where users can edit their "files" for various purposes. Each user will have his / her own sandbox of files. The question is whether these files should actually exist on a drive or as long pieces of text in a MySQL DB? | Okay, based on my research, here's what I found... Based on these two articles mainly (and other research): http://sietch.net/ViewNewsItem.aspx?NewsItemID=124 http://blog.druva.com/2009/01/25/file-systems-vs-databases/ I think a DB would be better than a file system. The DB is optimized for fast reads and writes and is... | What are the performance considerations of storing files in MySQL? I'm creating an application where users can edit their "files" for various purposes. Each user will have his / her own sandbox of files. The question is whether these files should actually exist on a drive or as long pieces of text in a MySQL DB? | TITLE:
What are the performance considerations of storing files in MySQL?
QUESTION:
I'm creating an application where users can edit their "files" for various purposes. Each user will have his / her own sandbox of files. The question is whether these files should actually exist on a drive or as long pieces of text in ... | [
"mysql"
] | 1 | 1 | 522 | 2 | 0 | 2011-06-01T19:42:40.820000 | 2011-06-02T16:30:30.303000 |
6,206,738 | 6,206,797 | jquery animate scrolltop callback | I have the following jquery that scrolls the page to the top, then performs a callback function. The problem is that even if the page is already at the top, it still waits for the '1000' to elapse before performing the callback, which i dont want it to. $('html').animate({scrollTop:0}, 1000, 'swing', function(){
//do ... | It doesn't wait It animates your document from top to the top... Funny but that's how it is. You have other alternatives. Either: check your page position before scrolling (as others suggested by providing some code) or use some jQuery plugin that works differently My.scrollintoview() jQuery plugin works that way. It s... | jquery animate scrolltop callback I have the following jquery that scrolls the page to the top, then performs a callback function. The problem is that even if the page is already at the top, it still waits for the '1000' to elapse before performing the callback, which i dont want it to. $('html').animate({scrollTop:0},... | TITLE:
jquery animate scrolltop callback
QUESTION:
I have the following jquery that scrolls the page to the top, then performs a callback function. The problem is that even if the page is already at the top, it still waits for the '1000' to elapse before performing the callback, which i dont want it to. $('html').anim... | [
"jquery",
"callback",
"jquery-animate",
"scrolltop"
] | 3 | 4 | 10,852 | 3 | 0 | 2011-06-01T19:43:46.057000 | 2011-06-01T19:48:26.527000 |
6,206,745 | 6,206,849 | Prevent CSS Inheritance | I am trying to write a jQuery plugin that can be ported to any site. What my plugin does is create a div and applies a style to it. It works well in standalone but when I put it into the context of a site, there is a css class that it is inheriting from. The thing is, I can't modify the web site's existing CSS... so I ... | CSS isn't inheritance-based, but rather "cascading" (it's the first C in "CSS"). Understanding that, there are a few ways you could work around the issue you describe: 1) Add inline styles to your element via script. Inline styles take precedence over CSS rules, either from classes, ids, or elements. 2) Add your own CS... | Prevent CSS Inheritance I am trying to write a jQuery plugin that can be ported to any site. What my plugin does is create a div and applies a style to it. It works well in standalone but when I put it into the context of a site, there is a css class that it is inheriting from. The thing is, I can't modify the web site... | TITLE:
Prevent CSS Inheritance
QUESTION:
I am trying to write a jQuery plugin that can be ported to any site. What my plugin does is create a div and applies a style to it. It works well in standalone but when I put it into the context of a site, there is a css class that it is inheriting from. The thing is, I can't m... | [
"html",
"coding-style"
] | 1 | 1 | 2,314 | 1 | 0 | 2011-06-01T19:44:07.817000 | 2011-06-01T19:52:20.713000 |
6,206,749 | 6,206,812 | gmaps4rails add image to infowindow | I have enjoyed using you gmaps_4_rails gem and am impressed with the ease of configuring it. The only problem that I have had and I have spent a great deal of time trying to get it working is how to add an image to an infowindow. I cant get the example: def gmaps4rails_infowindow " #{self.name}" end to work. I want to ... | Simply do this: def gmaps4rails_infowindow " #{name}" end Have a look here to be sure of what you do: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Security-Warning | gmaps4rails add image to infowindow I have enjoyed using you gmaps_4_rails gem and am impressed with the ease of configuring it. The only problem that I have had and I have spent a great deal of time trying to get it working is how to add an image to an infowindow. I cant get the example: def gmaps4rails_infowindow " #... | TITLE:
gmaps4rails add image to infowindow
QUESTION:
I have enjoyed using you gmaps_4_rails gem and am impressed with the ease of configuring it. The only problem that I have had and I have spent a great deal of time trying to get it working is how to add an image to an infowindow. I cant get the example: def gmaps4ra... | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-3",
"google-maps",
"gmaps4rails"
] | 1 | 1 | 1,048 | 1 | 0 | 2011-06-01T19:44:25.463000 | 2011-06-01T19:50:09.330000 |
6,206,757 | 6,207,975 | How do I do an IF in Microsoft SQL SELECT query? | I am an absolute beginner in SQL. Example: I want to do a query to select people whose names begin with X if the result is 0, I want to select people whose names begin with Y. How do I do this? Thanks. | May be this is a better solution: select * from table where name like 'X%'
if @@ROWCOUNT = 0 select * from table where name like 'Y%' | How do I do an IF in Microsoft SQL SELECT query? I am an absolute beginner in SQL. Example: I want to do a query to select people whose names begin with X if the result is 0, I want to select people whose names begin with Y. How do I do this? Thanks. | TITLE:
How do I do an IF in Microsoft SQL SELECT query?
QUESTION:
I am an absolute beginner in SQL. Example: I want to do a query to select people whose names begin with X if the result is 0, I want to select people whose names begin with Y. How do I do this? Thanks.
ANSWER:
May be this is a better solution: select *... | [
"sql",
"sql-server",
"t-sql"
] | 3 | 1 | 159 | 4 | 0 | 2011-06-01T19:44:55.553000 | 2011-06-01T21:32:24.763000 |
6,206,762 | 6,208,420 | how to detect logout of asp.net 4 session | How do you detect when a user logs out using the ASP.Net 4 session management? I have a site that is using the with a control. When the user clicks the "Log out" link, it should fire the LoggingOut event of the LoginStatus, but I cannot get it to do so. Is there another way to detect when the user logs out of the appli... | OK, I found my problem. The LoginTemplate control obliterates the LoginStatus's LoggingOut event. Once I created my own header it works | how to detect logout of asp.net 4 session How do you detect when a user logs out using the ASP.Net 4 session management? I have a site that is using the with a control. When the user clicks the "Log out" link, it should fire the LoggingOut event of the LoginStatus, but I cannot get it to do so. Is there another way to ... | TITLE:
how to detect logout of asp.net 4 session
QUESTION:
How do you detect when a user logs out using the ASP.Net 4 session management? I have a site that is using the with a control. When the user clicks the "Log out" link, it should fire the LoggingOut event of the LoginStatus, but I cannot get it to do so. Is the... | [
"asp.net"
] | 1 | 0 | 1,463 | 4 | 0 | 2011-06-01T19:45:09.207000 | 2011-06-01T22:19:10.783000 |
6,206,763 | 6,206,774 | What does &H57 represent and how can I translate it for C#? | I'm trying to convert old VB.NET code into C# and I'm not sure about the current line and what it means really. VB.NET: Const REQUEST_EFI As Byte = &H57 What would this be in c#? I tried: const byte request_efi = &H57 But it says "H57 is not part of the current context". First of all, how is &H57 a byte? Second, it see... | I guess it is a hexadecimal number. The syntax for that would be 0x57 in C#. | What does &H57 represent and how can I translate it for C#? I'm trying to convert old VB.NET code into C# and I'm not sure about the current line and what it means really. VB.NET: Const REQUEST_EFI As Byte = &H57 What would this be in c#? I tried: const byte request_efi = &H57 But it says "H57 is not part of the curren... | TITLE:
What does &H57 represent and how can I translate it for C#?
QUESTION:
I'm trying to convert old VB.NET code into C# and I'm not sure about the current line and what it means really. VB.NET: Const REQUEST_EFI As Byte = &H57 What would this be in c#? I tried: const byte request_efi = &H57 But it says "H57 is not ... | [
"c#",
"vb.net",
"syntax"
] | 2 | 5 | 1,182 | 5 | 0 | 2011-06-01T19:45:10.937000 | 2011-06-01T19:46:23.433000 |
6,206,768 | 6,217,894 | JSTree JSON_DATA on IE7 and IE8 | Having some problems getting JSTree to work with IE7 and 8. It works great on IE9, FF4 and Chrome. It is loading data via the JSON_DATA plugin backed by an ASP.NET MVC3 controller action. The problem is that the data is not getting loaded into the tree on IE7-8. I can verify the action is getting requested and no error... | Turns out I had a self closing span tag in the html aka Make this in to a well formed tag aka And everything works perfectly. Sigh, a whole day fighting this | JSTree JSON_DATA on IE7 and IE8 Having some problems getting JSTree to work with IE7 and 8. It works great on IE9, FF4 and Chrome. It is loading data via the JSON_DATA plugin backed by an ASP.NET MVC3 controller action. The problem is that the data is not getting loaded into the tree on IE7-8. I can verify the action i... | TITLE:
JSTree JSON_DATA on IE7 and IE8
QUESTION:
Having some problems getting JSTree to work with IE7 and 8. It works great on IE9, FF4 and Chrome. It is loading data via the JSON_DATA plugin backed by an ASP.NET MVC3 controller action. The problem is that the data is not getting loaded into the tree on IE7-8. I can v... | [
"javascript",
"internet-explorer",
"jstree"
] | 1 | 1 | 1,658 | 1 | 0 | 2011-06-01T19:45:47.427000 | 2011-06-02T17:22:13.297000 |
6,206,777 | 6,206,815 | A generic Intent to launch Calendar app on Android? | For stock Android ROMs, we can launch the Google Calendar app by: Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "Some title");
intent.putExtra("description", "Some description");
startActivity(intent); However, it looks like manufacturers w... | There is currently no supported API for the calendar. What you are doing is relying on private implementation details (the need to hand-write a string literal for the MIME type indicates this), so you are going to get different behavior on different devices depending their implementation. | A generic Intent to launch Calendar app on Android? For stock Android ROMs, we can launch the Google Calendar app by: Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "Some title");
intent.putExtra("description", "Some description");
startActi... | TITLE:
A generic Intent to launch Calendar app on Android?
QUESTION:
For stock Android ROMs, we can launch the Google Calendar app by: Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "Some title");
intent.putExtra("description", "Some descrip... | [
"android",
"calendar",
"android-intent"
] | 1 | 3 | 1,250 | 1 | 0 | 2011-06-01T19:46:51.050000 | 2011-06-01T19:50:12.980000 |
6,206,781 | 6,206,864 | SQL Duplicate Key Help | I have a statement that looks something like this: insert table_name(...) select.... from... join... How can I use where not exists or something of that effect with this insert and select statement so that if this exact code is reran with the same values, it won't throw an error. I don't want to have to copy and paste ... | Trying to keep this as generic as you did and still have it make sense. Hopefully, this is understandable. insert table_name(...) select.... from... join... WHERE NOT EXISTS(SELECT NULL FROM table_name WHERE PKColumn = YourOuterSelectTable.PKColumn) To try to put some more meat on it: /* Assume Column1 is primary key *... | SQL Duplicate Key Help I have a statement that looks something like this: insert table_name(...) select.... from... join... How can I use where not exists or something of that effect with this insert and select statement so that if this exact code is reran with the same values, it won't throw an error. I don't want to ... | TITLE:
SQL Duplicate Key Help
QUESTION:
I have a statement that looks something like this: insert table_name(...) select.... from... join... How can I use where not exists or something of that effect with this insert and select statement so that if this exact code is reran with the same values, it won't throw an error... | [
"sql",
"sql-server",
"syntax"
] | 1 | 1 | 82 | 4 | 0 | 2011-06-01T19:47:09.297000 | 2011-06-01T19:53:30.530000 |
6,206,787 | 6,210,534 | Creating a button in Java, causes getLayoutParams to return null | I need to create a button in Java. Below is my code: Button b = new Button(MyClass.this); b.requestLayout(); LayoutParams lp = b.getLayoutParams(); lp.height = LayoutParams.WRAP_CONTENT; lp.width = LayoutParams.WRAP_CONTENT; b.setLayoutParams(lp); b.setText("bla"); b.setTextSize(16); b.setOnClickListener(myListener); I... | Because I'm adding this button via ListView::addFooterView, it turns out I had to use the ListView type. b.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.WRAP_CONTENT, ListView.LayoutParams.WRAP_CONTENT)); Using this instead of just LayoutParams resolves my crash. Hope this helps others. | Creating a button in Java, causes getLayoutParams to return null I need to create a button in Java. Below is my code: Button b = new Button(MyClass.this); b.requestLayout(); LayoutParams lp = b.getLayoutParams(); lp.height = LayoutParams.WRAP_CONTENT; lp.width = LayoutParams.WRAP_CONTENT; b.setLayoutParams(lp); b.setTe... | TITLE:
Creating a button in Java, causes getLayoutParams to return null
QUESTION:
I need to create a button in Java. Below is my code: Button b = new Button(MyClass.this); b.requestLayout(); LayoutParams lp = b.getLayoutParams(); lp.height = LayoutParams.WRAP_CONTENT; lp.width = LayoutParams.WRAP_CONTENT; b.setLayoutP... | [
"android",
"button",
"size",
"layoutparams"
] | 0 | 0 | 4,948 | 3 | 0 | 2011-06-01T19:47:20.520000 | 2011-06-02T04:50:00.593000 |
6,206,798 | 6,206,913 | Splitting a string with regular expressions in .NET | I am in need of a regular expression that I can use to examine a string and return specific items when I do a RegEx.Split() in.NET. I've been trying to do this on my own, but I can never seem to get what I need, and the results never make any sense. Obviously I do not have a good handle on writing regular expressions. ... | Instead of using Regex.Split, it might be easier to match the tokens you need: MatchCollection matches = Regex.Matches(s, @"%([\w\-]+)"); string[] words = matches.Cast ().Select(m => m.Groups[1].Value).ToArray(); Split may add empty matches, as you've witnessed, that will have to be filtered out. | Splitting a string with regular expressions in .NET I am in need of a regular expression that I can use to examine a string and return specific items when I do a RegEx.Split() in.NET. I've been trying to do this on my own, but I can never seem to get what I need, and the results never make any sense. Obviously I do not... | TITLE:
Splitting a string with regular expressions in .NET
QUESTION:
I am in need of a regular expression that I can use to examine a string and return specific items when I do a RegEx.Split() in.NET. I've been trying to do this on my own, but I can never seem to get what I need, and the results never make any sense. ... | [
"c#",
".net",
"regex"
] | 3 | 4 | 2,427 | 2 | 0 | 2011-06-01T19:48:44.687000 | 2011-06-01T19:58:14.463000 |
6,206,804 | 6,206,877 | Regex to replace %variables% | I've been yanking clumps of hair out for 30 minutes doing this one... I have a dictionary, like so: {'search': 'replace', 'foo': 'bar'} And a string like this: Foo bar %foo% % search %. I'd like to replace each variable with it's equivalent text from the dictionary: Foo bar bar replace. My current regex fails, so here ... | If you're flexible with your syntax in your string, Python has a built in mechanism for that: >>> print 'Hello, %(your_name)s, my name is %(my_name)s' % {'your_name': 'Blender', 'my_name': 'Ken'} Hello, Blender, my name is Ken Alternatively, if you want that syntax, I'd avoid regular expressions and just do this: >>> v... | Regex to replace %variables% I've been yanking clumps of hair out for 30 minutes doing this one... I have a dictionary, like so: {'search': 'replace', 'foo': 'bar'} And a string like this: Foo bar %foo% % search %. I'd like to replace each variable with it's equivalent text from the dictionary: Foo bar bar replace. My ... | TITLE:
Regex to replace %variables%
QUESTION:
I've been yanking clumps of hair out for 30 minutes doing this one... I have a dictionary, like so: {'search': 'replace', 'foo': 'bar'} And a string like this: Foo bar %foo% % search %. I'd like to replace each variable with it's equivalent text from the dictionary: Foo ba... | [
"python",
"regex"
] | 7 | 8 | 7,628 | 4 | 0 | 2011-06-01T19:49:41.480000 | 2011-06-01T19:54:48.300000 |
6,206,807 | 6,206,886 | echoing text field value in a while loop | echo " ";
while ($row = mysql_fetch_array($result)) {
echo ' '; $numq2=$row['username'];
{ echo ' '; }
echo ' '; } i want to output $numq2 Var's data into the value of the textfield.but something is wrong with my code.it prinout the value of textfield as "$numq2".what's wrong with my script? | This echo ' '; should become echo ' '; Notice the '. and.' around your $numq2 | echoing text field value in a while loop echo " ";
while ($row = mysql_fetch_array($result)) {
echo ' '; $numq2=$row['username'];
{ echo ' '; }
echo ' '; } i want to output $numq2 Var's data into the value of the textfield.but something is wrong with my code.it prinout the value of textfield as "$numq2".what's wron... | TITLE:
echoing text field value in a while loop
QUESTION:
echo " ";
while ($row = mysql_fetch_array($result)) {
echo ' '; $numq2=$row['username'];
{ echo ' '; }
echo ' '; } i want to output $numq2 Var's data into the value of the textfield.but something is wrong with my code.it prinout the value of textfield as "$... | [
"php"
] | 2 | 1 | 699 | 6 | 0 | 2011-06-01T19:49:44.903000 | 2011-06-01T19:55:17.490000 |
6,206,810 | 6,206,837 | How to find acrued billing charges for Windows Azure | Is there a way or place to go to find out how much usage and ultimately costs have accrued against your Windows Azure account? I am really interested in usage details so that I can get an estimate of costs for our application in test and try to predict when I scale it out. | You cannot get a complete picture of metering / billing info programatically. However, your Windows Azure account has detailed monthly billing statements that break everything down: compute time per role, bandwidth, storage consumption, etc. Here's the link on the portal, at windows.azure.com: Then, sign in: Finally: v... | How to find acrued billing charges for Windows Azure Is there a way or place to go to find out how much usage and ultimately costs have accrued against your Windows Azure account? I am really interested in usage details so that I can get an estimate of costs for our application in test and try to predict when I scale i... | TITLE:
How to find acrued billing charges for Windows Azure
QUESTION:
Is there a way or place to go to find out how much usage and ultimately costs have accrued against your Windows Azure account? I am really interested in usage details so that I can get an estimate of costs for our application in test and try to pred... | [
"windows",
"azure",
"billing"
] | 2 | 2 | 1,006 | 2 | 0 | 2011-06-01T19:50:00.237000 | 2011-06-01T19:51:41.843000 |
6,206,820 | 6,207,485 | Functions In CoffeeScript | I'm trying to convert a function from Javascript to CoffeeScript. This is the code: function convert(num1, num2, num3) { return num1 + num2 * num3; } But how I can do that in CoffeeScript? I'm trying to run the function from an HTML source like this: But it won't work and I get an error saying: ReferenceError: Can't fi... | You need to export the convert function to the global scope. See How can Coffescript access functions from other assets? window.convert = (num1, num2, num3) -> num1 + num2 * num3 | Functions In CoffeeScript I'm trying to convert a function from Javascript to CoffeeScript. This is the code: function convert(num1, num2, num3) { return num1 + num2 * num3; } But how I can do that in CoffeeScript? I'm trying to run the function from an HTML source like this: But it won't work and I get an error saying... | TITLE:
Functions In CoffeeScript
QUESTION:
I'm trying to convert a function from Javascript to CoffeeScript. This is the code: function convert(num1, num2, num3) { return num1 + num2 * num3; } But how I can do that in CoffeeScript? I'm trying to run the function from an HTML source like this: But it won't work and I g... | [
"javascript",
"coffeescript"
] | 48 | 78 | 34,824 | 6 | 0 | 2011-06-01T19:50:29.983000 | 2011-06-01T20:50:01.337000 |
6,206,821 | 6,206,978 | Lua arrays question | I'm a PHP guy so I don't know how to solve this problem. I know how I'd do this in PHP but I have no clue what the constraints are for Lua regarding this problem. T = { clocktable = {}, beancabinet = {}, --...etc }
T.clocktable[674] = 1 T.clocktable[660] = 1 --...etc Q: How would I loop through "T" to quickly know tha... | I'm not sure what the question exactly is. If you know the key, ponzao's answer is right, otherwise use a for loop: for key, value in pairs(T.clocktable) do -- do something with key and value end | Lua arrays question I'm a PHP guy so I don't know how to solve this problem. I know how I'd do this in PHP but I have no clue what the constraints are for Lua regarding this problem. T = { clocktable = {}, beancabinet = {}, --...etc }
T.clocktable[674] = 1 T.clocktable[660] = 1 --...etc Q: How would I loop through "T"... | TITLE:
Lua arrays question
QUESTION:
I'm a PHP guy so I don't know how to solve this problem. I know how I'd do this in PHP but I have no clue what the constraints are for Lua regarding this problem. T = { clocktable = {}, beancabinet = {}, --...etc }
T.clocktable[674] = 1 T.clocktable[660] = 1 --...etc Q: How would ... | [
"arrays",
"multidimensional-array",
"lua",
"lua-table"
] | 1 | 6 | 356 | 3 | 0 | 2011-06-01T19:50:30.823000 | 2011-06-01T20:04:24.133000 |
6,206,850 | 6,217,959 | OpenGL Framebuffer Render to Texture not Working | I'm experimenting with framebuffers to create a glow effect using Java and JOGL, but I am having problems. At the moment, my goal is to render my spaceship model, textured with an illumination texture, to a framebuffer texture and then draw the framebuffer texture to a triangle fan quad. I'm running with OpenGL 2.1 and... | As Bethor pointed out, I was passing in GL_TEXTURE_MIN_FILTER twice to my makeTextureBuffer method. This was resolving to the glTexParameteri() calls of: gl.glTexParameteri(GL2GL3.GL_TEXTURE_2D, GL2GL3.GL_TEXTURE_MIN_FILTER, GL2GL2.GL_TEXTURE_MIN_FILTER); gl.glTexParameteri(GL2GL3.GL_TEXTURE_2D, GL2GL3.GL_TEXTURE_MAG_F... | OpenGL Framebuffer Render to Texture not Working I'm experimenting with framebuffers to create a glow effect using Java and JOGL, but I am having problems. At the moment, my goal is to render my spaceship model, textured with an illumination texture, to a framebuffer texture and then draw the framebuffer texture to a t... | TITLE:
OpenGL Framebuffer Render to Texture not Working
QUESTION:
I'm experimenting with framebuffers to create a glow effect using Java and JOGL, but I am having problems. At the moment, my goal is to render my spaceship model, textured with an illumination texture, to a framebuffer texture and then draw the framebuf... | [
"java",
"opengl",
"textures",
"jogl",
"framebuffer"
] | 5 | 2 | 3,160 | 1 | 0 | 2011-06-01T19:52:31.467000 | 2011-06-02T17:28:30.987000 |
6,206,860 | 6,206,938 | How to remove or disable the slash at the end of the URL? | I don't know exactly what is the problem, but I have done a lot of research about trailing slash in PHP. My problem is that when I visit my site I always see trailing slash and it causes all the resources to fail to load. How do I disable trailing slash that's being added in.htaccess. Thanks! | PHP does not add / to URLs by default, it's your script doing that. If you want to use the style.css regardless, use the absolute or the full path - so if your style.css is on http://domain.com/style.css, then you can either use or With your file.php thing, it looks in http://domain.com/file.php/style.css, while either... | How to remove or disable the slash at the end of the URL? I don't know exactly what is the problem, but I have done a lot of research about trailing slash in PHP. My problem is that when I visit my site I always see trailing slash and it causes all the resources to fail to load. How do I disable trailing slash that's b... | TITLE:
How to remove or disable the slash at the end of the URL?
QUESTION:
I don't know exactly what is the problem, but I have done a lot of research about trailing slash in PHP. My problem is that when I visit my site I always see trailing slash and it causes all the resources to fail to load. How do I disable trail... | [
"url",
"web",
"slash"
] | 1 | 3 | 5,733 | 4 | 0 | 2011-06-01T19:53:09.063000 | 2011-06-01T20:00:31.583000 |
6,206,861 | 6,206,898 | Read a very long line of text C# | I want to read a very long line of text using C#. The length of the line is about 100000 chars. I am using StreamReader.ReadLine() method. I also want to write this long string to a file. One of them or both are not working properly. I could only write 99328 characters to a file. How can I read and write a very long li... | I suspect that you did not close your output buffer and it's not completing the file write. Consider using File.ReadAllText http://msdn.microsoft.com/en-us/library/ms143368.aspx and File.WriteAllText http://msdn.microsoft.com/en-us/library/ms143375.aspx | Read a very long line of text C# I want to read a very long line of text using C#. The length of the line is about 100000 chars. I am using StreamReader.ReadLine() method. I also want to write this long string to a file. One of them or both are not working properly. I could only write 99328 characters to a file. How ca... | TITLE:
Read a very long line of text C#
QUESTION:
I want to read a very long line of text using C#. The length of the line is about 100000 chars. I am using StreamReader.ReadLine() method. I also want to write this long string to a file. One of them or both are not working properly. I could only write 99328 characters... | [
"c#"
] | 0 | 4 | 926 | 2 | 0 | 2011-06-01T19:53:18.847000 | 2011-06-01T19:56:44.397000 |
6,206,866 | 6,207,369 | How to register this in xml configuration | How do I register something like this in the xml configuration (i know, i know, convention over config, but I'm supporting legacy code, so i need to do it in the xml config). Specifically, I'm unclear on how to register AssignTechniciansFactory with the abstract base class AND the interface type. Normally, i get how to... | In addition to what @adymitruk said, you can specify additional services for a component via forwardedTypes element in XML configuration. | How to register this in xml configuration How do I register something like this in the xml configuration (i know, i know, convention over config, but I'm supporting legacy code, so i need to do it in the xml config). Specifically, I'm unclear on how to register AssignTechniciansFactory with the abstract base class AND ... | TITLE:
How to register this in xml configuration
QUESTION:
How do I register something like this in the xml configuration (i know, i know, convention over config, but I'm supporting legacy code, so i need to do it in the xml config). Specifically, I'm unclear on how to register AssignTechniciansFactory with the abstra... | [
"xml",
"castle-windsor"
] | 0 | 1 | 202 | 2 | 0 | 2011-06-01T19:53:44.100000 | 2011-06-01T20:39:49.900000 |
6,206,868 | 6,219,639 | desktop application / script to interact with javascript on web application | My work has tasked me with determining the feasibility of migrating our existing in-house built change management services(web based) to a Sharepoint solution. I've found everything to be easy except I've run into the issue that for each change management issue (several thousand) there may be any number of attachment f... | Thank you everyone. I was able to get what I needed using htmlunit and java to traverse a report I made of all change items with attachments, go to each one, copy the source code, traverse that to find instances of the download method, and copy the unique IDs of each attachment and build an.xls of all items and their a... | desktop application / script to interact with javascript on web application My work has tasked me with determining the feasibility of migrating our existing in-house built change management services(web based) to a Sharepoint solution. I've found everything to be easy except I've run into the issue that for each change... | TITLE:
desktop application / script to interact with javascript on web application
QUESTION:
My work has tasked me with determining the feasibility of migrating our existing in-house built change management services(web based) to a Sharepoint solution. I've found everything to be easy except I've run into the issue th... | [
"java",
"javascript",
"web-services",
"web-applications"
] | 0 | 0 | 694 | 3 | 0 | 2011-06-01T19:53:54.137000 | 2011-06-02T19:53:27.887000 |
6,206,869 | 6,206,927 | Hide/Show divs within a dynamic data driven form using jQuery in MVC 3 | I have a data driven form generated on the fly from a database. The requirement is that certain form elements can become hidden depending on answers from previous form fields. For e.g. if we have 3 fields, field 1 is a radiobutton list and if the 1st selection is made then field 3 needs to be hidden as its no longer ne... | If you don't want to use jQuery to hard-code the rules into the page, you can use Ajax on the various "trigger" elements to go back to the server and hit the database to determine which elements to show, based on that. You could simply return a string, for example, containing the form elements you wish to show/hide. Th... | Hide/Show divs within a dynamic data driven form using jQuery in MVC 3 I have a data driven form generated on the fly from a database. The requirement is that certain form elements can become hidden depending on answers from previous form fields. For e.g. if we have 3 fields, field 1 is a radiobutton list and if the 1s... | TITLE:
Hide/Show divs within a dynamic data driven form using jQuery in MVC 3
QUESTION:
I have a data driven form generated on the fly from a database. The requirement is that certain form elements can become hidden depending on answers from previous form fields. For e.g. if we have 3 fields, field 1 is a radiobutton ... | [
"jquery",
"asp.net-mvc",
"asp.net-mvc-3"
] | 1 | 1 | 868 | 2 | 0 | 2011-06-01T19:54:01.123000 | 2011-06-01T19:59:38.110000 |
6,206,875 | 6,206,912 | How do I use C++ STL list without iterator? | I need to get to the items in the STL list. I believe those items are of type list_item or ListItem. I need 'next' and 'prev' of each item. how do I do that? | std::list does not support next or prev by itself. The iterator is used to go from element to element, and you cannot traverse a standard list without it. | How do I use C++ STL list without iterator? I need to get to the items in the STL list. I believe those items are of type list_item or ListItem. I need 'next' and 'prev' of each item. how do I do that? | TITLE:
How do I use C++ STL list without iterator?
QUESTION:
I need to get to the items in the STL list. I believe those items are of type list_item or ListItem. I need 'next' and 'prev' of each item. how do I do that?
ANSWER:
std::list does not support next or prev by itself. The iterator is used to go from element ... | [
"c++",
"stl"
] | 0 | 7 | 2,987 | 5 | 0 | 2011-06-01T19:54:37.593000 | 2011-06-01T19:58:11.667000 |
6,206,876 | 6,207,122 | Was there a good reason for redundant try catch code in original Microsoft Membership and Role Provider code? | I know that this is redundant (per Why does resharper say 'Catch clause with single 'throw' statement is redundant'? ). try { bla bla bla } catch { throw } So, I'm going through the old Microsoft Membership and Role Provider code (made available since 2006 per http://weblogs.asp.net/scottgu/archive/2006/04/13/442772.as... | This is a lazy way to put a breakpoint on that throw line, without turning on any of the debugger features that break on all exceptions. | Was there a good reason for redundant try catch code in original Microsoft Membership and Role Provider code? I know that this is redundant (per Why does resharper say 'Catch clause with single 'throw' statement is redundant'? ). try { bla bla bla } catch { throw } So, I'm going through the old Microsoft Membership and... | TITLE:
Was there a good reason for redundant try catch code in original Microsoft Membership and Role Provider code?
QUESTION:
I know that this is redundant (per Why does resharper say 'Catch clause with single 'throw' statement is redundant'? ). try { bla bla bla } catch { throw } So, I'm going through the old Micros... | [
"c#"
] | 0 | 0 | 183 | 2 | 0 | 2011-06-01T19:54:45.980000 | 2011-06-01T20:17:34.023000 |
6,206,892 | 6,206,995 | Qt - unresolved overload function type | I am getting the following error when trying to build my app in Qt Creator: error (line 3): no matching function for call to ‘QGraphicsScene::QGraphicsScene()’ The source for this is simply (file name is gamscene.cpp): #include "gamescene.h"
GameScene::GameScene(): QGraphicsScene(parent) {
} I have googled around and... | We've derived from the QGraphicsScene class like so class ImprintTemplateScene: public QGraphicsScene { Q_OBJECT public: ImprintTemplateScene(QObject *parent = 0);... }; Notice the parent is a parameter passed to the constructor. The constructor implementation looks like: ImprintTemplateScene::ImprintTemplateScene(QObj... | Qt - unresolved overload function type I am getting the following error when trying to build my app in Qt Creator: error (line 3): no matching function for call to ‘QGraphicsScene::QGraphicsScene()’ The source for this is simply (file name is gamscene.cpp): #include "gamescene.h"
GameScene::GameScene(): QGraphicsScene... | TITLE:
Qt - unresolved overload function type
QUESTION:
I am getting the following error when trying to build my app in Qt Creator: error (line 3): no matching function for call to ‘QGraphicsScene::QGraphicsScene()’ The source for this is simply (file name is gamscene.cpp): #include "gamescene.h"
GameScene::GameScene... | [
"c++",
"qt"
] | 1 | 2 | 1,914 | 2 | 0 | 2011-06-01T19:56:00.937000 | 2011-06-01T20:05:36.657000 |
6,206,893 | 6,207,232 | How to implement (char-ready?) in C | I'm currently implementing Scheme R5RS in C, and I am stuck trying to implement the (char-ready?) function. I have the specs for the function quoted below. The function is guaranteed not to block. The standard C functions like fgetc() all block on input when called when there is no input ready. Does anyone know if ther... | You will need to go below the stdio level. On UNIX, you can use fileno() to get the file descriptor associated with the stream, and then you can use select() and read() system calls to do non-blocking reads. | How to implement (char-ready?) in C I'm currently implementing Scheme R5RS in C, and I am stuck trying to implement the (char-ready?) function. I have the specs for the function quoted below. The function is guaranteed not to block. The standard C functions like fgetc() all block on input when called when there is no i... | TITLE:
How to implement (char-ready?) in C
QUESTION:
I'm currently implementing Scheme R5RS in C, and I am stuck trying to implement the (char-ready?) function. I have the specs for the function quoted below. The function is guaranteed not to block. The standard C functions like fgetc() all block on input when called ... | [
"c",
"io",
"scheme"
] | 9 | 5 | 516 | 3 | 0 | 2011-06-01T19:56:01.637000 | 2011-06-01T20:28:35.937000 |
6,206,897 | 6,206,945 | lang.NumberFormatException in android | I have the following code which does nothing but reading some values from a DB in a background thread and using the values I draw a Line chart using a jar.For the line chart I use for value for each array and the problem is that the third that I pass to the constructor that draws the LineChart is float.... float[] vite... | I'm not sure just by looking at this, but I can tell you, this is where Log.v is extremely handy. Put a Log.v(TAG,"\""+values[]+"\""), and you'll see exactly what's getting to that function. If it's anything other than a pure number, that'd be what's causing the exception to occur. | lang.NumberFormatException in android I have the following code which does nothing but reading some values from a DB in a background thread and using the values I draw a Line chart using a jar.For the line chart I use for value for each array and the problem is that the third that I pass to the constructor that draws t... | TITLE:
lang.NumberFormatException in android
QUESTION:
I have the following code which does nothing but reading some values from a DB in a background thread and using the values I draw a Line chart using a jar.For the line chart I use for value for each array and the problem is that the third that I pass to the constr... | [
"java",
"android",
"exception"
] | 2 | 1 | 2,690 | 3 | 0 | 2011-06-01T19:56:32.367000 | 2011-06-01T20:01:15.973000 |
6,206,903 | 6,206,981 | How do I handle a ManyToMany relationship in JSON? | This is a follow-up question to my previous question on " Managing employee contracts in a many-to-many relationship? " and this question I have a relationship that can be explained thusly: company --< contracts >-- employees I am importing the data through JSON. For simplicity sake it is shown below. { "companies": [ ... | The only way to accomplish this without foreign keys is to duplicate one side of the 'many' entities in your relationship. Based on your example above, this would mean duplicating employees throughout the data structure. You can really only get around this problem the same way that your relational database gets around ... | How do I handle a ManyToMany relationship in JSON? This is a follow-up question to my previous question on " Managing employee contracts in a many-to-many relationship? " and this question I have a relationship that can be explained thusly: company --< contracts >-- employees I am importing the data through JSON. For s... | TITLE:
How do I handle a ManyToMany relationship in JSON?
QUESTION:
This is a follow-up question to my previous question on " Managing employee contracts in a many-to-many relationship? " and this question I have a relationship that can be explained thusly: company --< contracts >-- employees I am importing the data t... | [
"json",
"core-data",
"many-to-many"
] | 4 | 5 | 7,175 | 2 | 0 | 2011-06-01T19:57:17.410000 | 2011-06-01T20:04:32.780000 |
6,206,905 | 6,207,073 | Patching nant 0.91 to use mono 4.0 | The Nant doesn't support mono 4, but fortunately there's a patch for it. I download the patch - http://sourceforge.net/tracker/download.php?group_id=31650&atid=402870&file_id=404197&aid=3206199 I also download the source. I unzip the source and copy the patch inside the directory. I run patch < mono-4.0.diff, but I got... | According to comments, this patch has been merged into the NAnt source tree, wouldn't you be better off to simply use the latest nightly? It's been built after the 'already merged' comment. | Patching nant 0.91 to use mono 4.0 The Nant doesn't support mono 4, but fortunately there's a patch for it. I download the patch - http://sourceforge.net/tracker/download.php?group_id=31650&atid=402870&file_id=404197&aid=3206199 I also download the source. I unzip the source and copy the patch inside the directory. I r... | TITLE:
Patching nant 0.91 to use mono 4.0
QUESTION:
The Nant doesn't support mono 4, but fortunately there's a patch for it. I download the patch - http://sourceforge.net/tracker/download.php?group_id=31650&atid=402870&file_id=404197&aid=3206199 I also download the source. I unzip the source and copy the patch inside ... | [
"mono",
"diff",
"nant",
"patch"
] | 2 | 2 | 188 | 1 | 0 | 2011-06-01T19:57:34.227000 | 2011-06-01T20:12:48.440000 |
6,206,917 | 6,206,973 | Rails order by foreign key (including nil) | I'm trying to sort column Foo that has one Bar. Currently, I'm using a join so that in the foos#index action is ordered by bars.name *: @foos = Foo.joins(:bar).order("bars.name") The problem is, not all foos have a bar, and it seems as though this join ignores any Foo with no Bar. I don't want these records ignored. Is... | You need to use SQL LEFT JOIN in your joins statement. This will fetch all Foos (with Foos that have Bars) To use 'Rails way' you can wrap it into the scope: scope:some_scope_name, joins("LEFT JOIN bars ON foos.id = bars.foo_id") | Rails order by foreign key (including nil) I'm trying to sort column Foo that has one Bar. Currently, I'm using a join so that in the foos#index action is ordered by bars.name *: @foos = Foo.joins(:bar).order("bars.name") The problem is, not all foos have a bar, and it seems as though this join ignores any Foo with no ... | TITLE:
Rails order by foreign key (including nil)
QUESTION:
I'm trying to sort column Foo that has one Bar. Currently, I'm using a join so that in the foos#index action is ordered by bars.name *: @foos = Foo.joins(:bar).order("bars.name") The problem is, not all foos have a bar, and it seems as though this join ignore... | [
"ruby-on-rails",
"activerecord"
] | 2 | 0 | 1,296 | 1 | 0 | 2011-06-01T19:58:28.190000 | 2011-06-01T20:03:46.003000 |
6,206,918 | 6,206,966 | add methods to org.w3c.dom.Node | I tried adding a custom method to the Node class but ended up creating a new class that holds a node object in a variable. so the question is. is it even possible? I did this: public class Trip implements org.w3c.dom.Node { [...generated methods...] public String myMethod(){ return ""; } } but I was getting lots of err... | org.w3c.dom.Node is an interface, therefore your posted code won't work. You don't want to start trying to implement your own DOM, so I suggest you think of a different approach. What is it you want to do? You might be able to make use of get and setUserData to accomplish your goal. | add methods to org.w3c.dom.Node I tried adding a custom method to the Node class but ended up creating a new class that holds a node object in a variable. so the question is. is it even possible? I did this: public class Trip implements org.w3c.dom.Node { [...generated methods...] public String myMethod(){ return ""; }... | TITLE:
add methods to org.w3c.dom.Node
QUESTION:
I tried adding a custom method to the Node class but ended up creating a new class that holds a node object in a variable. so the question is. is it even possible? I did this: public class Trip implements org.w3c.dom.Node { [...generated methods...] public String myMeth... | [
"java",
"android",
"xml",
"dom"
] | 2 | 1 | 499 | 1 | 0 | 2011-06-01T19:58:28.450000 | 2011-06-01T20:03:24.727000 |
6,206,922 | 6,206,967 | Rails 3 Creating an Object in a Foreign Model | I have a Transaction object and want to: Check if a Cart session exists. If yes, associate the Transaction with that Cart's ID from the session. If no, create a new Cart object and assign its ID to a session variable. The relationship is: Cart has_many Transactions Transaction belongs_to Cart My question is: How do you... | Cart.new... will only instantiate a new Cart but will not persist it into the database. The Cart object needs to be stored in the database if it is to be used across requests. Use this to persist the Cart object: Cart.create(params[:cart]) or @cart.save! For this: session[:cart] = @cart.id... you've done the right thin... | Rails 3 Creating an Object in a Foreign Model I have a Transaction object and want to: Check if a Cart session exists. If yes, associate the Transaction with that Cart's ID from the session. If no, create a new Cart object and assign its ID to a session variable. The relationship is: Cart has_many Transactions Transact... | TITLE:
Rails 3 Creating an Object in a Foreign Model
QUESTION:
I have a Transaction object and want to: Check if a Cart session exists. If yes, associate the Transaction with that Cart's ID from the session. If no, create a new Cart object and assign its ID to a session variable. The relationship is: Cart has_many Tra... | [
"ruby-on-rails-3",
"session"
] | 0 | 2 | 695 | 1 | 0 | 2011-06-01T19:58:48.600000 | 2011-06-01T20:03:27.080000 |
6,206,930 | 6,207,118 | Adding a watermark to a listview | Is it possible to have a watermark background for a listview control in Android? Basically I want a stationary background image with a listview on top of the image. When I scroll, I want the listview to scroll like normal, but the image stay stationary. Since there doesn't seem to be any z-order in Android, I'm wonderi... | Have you tried ListView.setBackgroundResource(int resId)? Or for the whole screen use... getWindow().getDecorView().setBackgroundResource(int resId) You'll need to use setCacheColorHint(0) to prevent 'blackouts' when scrolling the list though. | Adding a watermark to a listview Is it possible to have a watermark background for a listview control in Android? Basically I want a stationary background image with a listview on top of the image. When I scroll, I want the listview to scroll like normal, but the image stay stationary. Since there doesn't seem to be an... | TITLE:
Adding a watermark to a listview
QUESTION:
Is it possible to have a watermark background for a listview control in Android? Basically I want a stationary background image with a listview on top of the image. When I scroll, I want the listview to scroll like normal, but the image stay stationary. Since there doe... | [
"android",
"android-listview",
"watermark"
] | 1 | 2 | 963 | 1 | 0 | 2011-06-01T19:59:58.377000 | 2011-06-01T20:17:08.567000 |
6,206,933 | 6,207,338 | Select a JQuery UI Tab after client validation | I have Tab1, Tab2 and Tab3... All tabs have inputs that are validated... My save method validates the required inputs: var validator = $("form").validate(); // obtain validator var anyError = false; $('#tabs').find(":input").each(function () { if (!validator.element(this)) { // validate every input element inside this ... | Untested but could you not do this: $('#tabs').find(":input").each(function () { if (!validator.element(this)) { // validate every input element inside this step anyError = true; // trigger click on the tab that is linked to $(this).parents('yourtabcontainername') here return false; // ends each } }); if (anyError) ret... | Select a JQuery UI Tab after client validation I have Tab1, Tab2 and Tab3... All tabs have inputs that are validated... My save method validates the required inputs: var validator = $("form").validate(); // obtain validator var anyError = false; $('#tabs').find(":input").each(function () { if (!validator.element(this))... | TITLE:
Select a JQuery UI Tab after client validation
QUESTION:
I have Tab1, Tab2 and Tab3... All tabs have inputs that are validated... My save method validates the required inputs: var validator = $("form").validate(); // obtain validator var anyError = false; $('#tabs').find(":input").each(function () { if (!valida... | [
"jquery",
"jquery-ui",
"jquery-tabs"
] | 0 | 1 | 775 | 1 | 0 | 2011-06-01T20:00:05.490000 | 2011-06-01T20:37:41.213000 |
6,206,940 | 6,207,035 | Should I use jquery or jquery mobile or iPad web pages? | I am making a web page "app" for the iPad or ios devices. Should I use jquery mobile or just regular jquery? After all they're only web pages aren't they? Is jquery proper no good for me? Do I need mobile jquery? Thanks. | I would look into two frameworks. Both are open source unless you are incorporated them into your own framework and offering this up as a service or an API. These frameworks are Sencha Touch and JQuery Mobile. Sencha Touch is great. It looks fantastic, is an official release (out of beta unlike JQMobile), and pretty ea... | Should I use jquery or jquery mobile or iPad web pages? I am making a web page "app" for the iPad or ios devices. Should I use jquery mobile or just regular jquery? After all they're only web pages aren't they? Is jquery proper no good for me? Do I need mobile jquery? Thanks. | TITLE:
Should I use jquery or jquery mobile or iPad web pages?
QUESTION:
I am making a web page "app" for the iPad or ios devices. Should I use jquery mobile or just regular jquery? After all they're only web pages aren't they? Is jquery proper no good for me? Do I need mobile jquery? Thanks.
ANSWER:
I would look int... | [
"jquery",
"ios",
"ipad",
"jquery-mobile"
] | 3 | 5 | 2,477 | 6 | 0 | 2011-06-01T20:00:51.293000 | 2011-06-01T20:09:12.017000 |
6,206,949 | 6,207,653 | jquery, submit form after google maps geocoding | I have a form which collects a persons address. When they click submit I want to geocode their address, and use that to fill lat and lng fields. Here is what I am doing now which is based on the 2nd answer here submit form does not stop in jquery ajax call and the form Street Street2 (optional) City State...a bunch of ... | I just figured it out. I accidentally omitted my submit button from the form I posted. It was named submit. Apparently that mucks things up for jquery (thanks here: jQuery doesn't submit a form ). The simple example I posted still isn't working and I'm not sure why but my actual problem is solved. | jquery, submit form after google maps geocoding I have a form which collects a persons address. When they click submit I want to geocode their address, and use that to fill lat and lng fields. Here is what I am doing now which is based on the 2nd answer here submit form does not stop in jquery ajax call and the form St... | TITLE:
jquery, submit form after google maps geocoding
QUESTION:
I have a form which collects a persons address. When they click submit I want to geocode their address, and use that to fill lat and lng fields. Here is what I am doing now which is based on the 2nd answer here submit form does not stop in jquery ajax ca... | [
"javascript",
"jquery",
"google-maps"
] | 2 | 0 | 2,130 | 1 | 0 | 2011-06-01T20:01:31.107000 | 2011-06-01T21:02:30.257000 |
6,206,955 | 6,207,015 | PHP MySQL insert values from multiple checkboxes into one column in table | I have a form that a user would fill out while creating a ticket for a bug they have found on our website. In the form there is currently an input field where the user would enter in the designs that the bug is affecting (ex., "Design1, Design2, Design3, Design4"...etc). When the form is submitted the value is stored i... | I would avoid to store all values within a single field. You'll have a lot of problems once you'll have to do some query because you violate normalization rules. | PHP MySQL insert values from multiple checkboxes into one column in table I have a form that a user would fill out while creating a ticket for a bug they have found on our website. In the form there is currently an input field where the user would enter in the designs that the bug is affecting (ex., "Design1, Design2, ... | TITLE:
PHP MySQL insert values from multiple checkboxes into one column in table
QUESTION:
I have a form that a user would fill out while creating a ticket for a bug they have found on our website. In the form there is currently an input field where the user would enter in the designs that the bug is affecting (ex., "... | [
"php",
"mysql",
"checkbox"
] | 0 | 2 | 4,409 | 7 | 0 | 2011-06-01T20:02:00 | 2011-06-01T20:06:51.043000 |
6,206,959 | 6,269,163 | Integrating openID and oauth as website login, signin and authentication system | First of all let me start by saying that this question is not about different openID and oAuth implementations. There are many classes about these. My question is what to do after authenticating a user: How to add this user to the user table in the database? How to handle different logins for the same user? (Remy Sharp... | Your question has to main parts to it: Authentication Authorization Usually the two are not treated differently if the identity provider (IP) is your own, which has been the most common setup in web apps until now. When using an OpenId Provider such as Google, the authentication part is seperated from your control. You... | Integrating openID and oauth as website login, signin and authentication system First of all let me start by saying that this question is not about different openID and oAuth implementations. There are many classes about these. My question is what to do after authenticating a user: How to add this user to the user tabl... | TITLE:
Integrating openID and oauth as website login, signin and authentication system
QUESTION:
First of all let me start by saying that this question is not about different openID and oAuth implementations. There are many classes about these. My question is what to do after authenticating a user: How to add this use... | [
"php",
"sql",
"oauth",
"openid"
] | 16 | 12 | 2,485 | 3 | 0 | 2011-06-01T20:02:21.310000 | 2011-06-07T17:24:36.610000 |
6,206,971 | 6,207,233 | Redis-cli - Selecting which instance? | I'm currently running multiple redis instances on one box. Each have their own config, init.d, and listen on different ports. My application(s) have no problem connecting via the redis clients, but I'd like to be able to connect to each one using redis-cli. I couldn't find any information on $:redis-cli [options] in ei... | You can specify the server host and port using -h and -p parameters. E.g.: redis-cli -h 127.0.0.1 -p 6379 | Redis-cli - Selecting which instance? I'm currently running multiple redis instances on one box. Each have their own config, init.d, and listen on different ports. My application(s) have no problem connecting via the redis clients, but I'd like to be able to connect to each one using redis-cli. I couldn't find any info... | TITLE:
Redis-cli - Selecting which instance?
QUESTION:
I'm currently running multiple redis instances on one box. Each have their own config, init.d, and listen on different ports. My application(s) have no problem connecting via the redis clients, but I'd like to be able to connect to each one using redis-cli. I coul... | [
"database",
"nosql",
"redis"
] | 28 | 84 | 20,924 | 2 | 0 | 2011-06-01T20:03:45.303000 | 2011-06-01T20:28:41.667000 |
6,206,977 | 6,207,071 | copying c++ abstract classes | Ok heres some code. #include #include using namespace std; class A { public: virtual void Execute() { cout << "Hello from class A" << endl; } }; class B: public A { public: void Execute() { cout << "Hello from class B" << endl; } }; void Main() { deque aclasses = deque (0); deque aclasses2 = deque (0); A a1 = A(); B b1... | The common pattern for handling that is through a virtual clone() method in the base class that will create a new object of the appropriate type: struct base { virtual ~base() {} // don't forget the virtual destructor virtual base* clone() const { return new base(*this); } }; struct derived: base { virtual derived* clo... | copying c++ abstract classes Ok heres some code. #include #include using namespace std; class A { public: virtual void Execute() { cout << "Hello from class A" << endl; } }; class B: public A { public: void Execute() { cout << "Hello from class B" << endl; } }; void Main() { deque aclasses = deque (0); deque aclasses2 ... | TITLE:
copying c++ abstract classes
QUESTION:
Ok heres some code. #include #include using namespace std; class A { public: virtual void Execute() { cout << "Hello from class A" << endl; } }; class B: public A { public: void Execute() { cout << "Hello from class B" << endl; } }; void Main() { deque aclasses = deque (0)... | [
"c++",
"arrays",
"inheritance"
] | 1 | 10 | 2,144 | 4 | 0 | 2011-06-01T20:04:15.897000 | 2011-06-01T20:12:31.577000 |
6,206,983 | 6,207,016 | If not Microsoft.Office.Interop.Excel then what? | Ok, I have a problem with the MSDN documentation for the namespace Microsoft.Office.Interop.Excel. It states in the documentation in MSDN that the code in this namespace is not intended to be used by ones application directly but it's code for supporting features in the.NET Framework. Nowhere says what functionality th... | So I think they mean the actual implementation. It doesn't say the same thing if you look at the _Application interface: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._application.aspx | If not Microsoft.Office.Interop.Excel then what? Ok, I have a problem with the MSDN documentation for the namespace Microsoft.Office.Interop.Excel. It states in the documentation in MSDN that the code in this namespace is not intended to be used by ones application directly but it's code for supporting features in the.... | TITLE:
If not Microsoft.Office.Interop.Excel then what?
QUESTION:
Ok, I have a problem with the MSDN documentation for the namespace Microsoft.Office.Interop.Excel. It states in the documentation in MSDN that the code in this namespace is not intended to be used by ones application directly but it's code for supportin... | [
".net",
"excel",
"ms-office"
] | 2 | 2 | 350 | 1 | 0 | 2011-06-01T20:04:40.123000 | 2011-06-01T20:06:52.827000 |
6,206,985 | 6,207,155 | What can make jQuery's unbind function not work as expected? | Have a look at the following code (additionally, you will need jquery.js, jquery.viewport.js and jquery.scrollTo.js ). The behaviour I would expect from this script is that whenever I scroll the page, the red rows ( elements with class alwaysVisible ) should be inserted just underneath the top-most visible row ( elemen... | I think you're problem is that scrollTo uses animate: // From the plugin's source function animate( callback ){ $elem.animate( attr, duration, settings.easing, callback && function(){ callback.call(this, target, settings); }); }; And animate uses a timer to perform the animation. The result is that.scrollTo will return... | What can make jQuery's unbind function not work as expected? Have a look at the following code (additionally, you will need jquery.js, jquery.viewport.js and jquery.scrollTo.js ). The behaviour I would expect from this script is that whenever I scroll the page, the red rows ( elements with class alwaysVisible ) should ... | TITLE:
What can make jQuery's unbind function not work as expected?
QUESTION:
Have a look at the following code (additionally, you will need jquery.js, jquery.viewport.js and jquery.scrollTo.js ). The behaviour I would expect from this script is that whenever I scroll the page, the red rows ( elements with class alway... | [
"jquery",
"jquery-plugins",
"scroll",
"unbind"
] | 2 | 0 | 617 | 1 | 0 | 2011-06-01T20:04:43.607000 | 2011-06-01T20:21:07.813000 |
6,206,986 | 6,207,269 | Find nid from node's internal path in Drupal? | I have a path like this: /news/2011/05/26/some-story-path How do I find the nid for the node that the path points to? Edit The path above is simply a string value that I have on another page. I need to obtain information about the node that the path links to. | You could use menu_get_object: $node = menu_get_object(); See http://api.drupal.org/api/drupal/includes--menu.inc/function/menu_get_object/6 edit I think you can specify your path like this menu_get_object($type = 'node', $position = 1, $path = '/news/2011/05/26/some-story-path'); | Find nid from node's internal path in Drupal? I have a path like this: /news/2011/05/26/some-story-path How do I find the nid for the node that the path points to? Edit The path above is simply a string value that I have on another page. I need to obtain information about the node that the path links to. | TITLE:
Find nid from node's internal path in Drupal?
QUESTION:
I have a path like this: /news/2011/05/26/some-story-path How do I find the nid for the node that the path points to? Edit The path above is simply a string value that I have on another page. I need to obtain information about the node that the path links ... | [
"drupal",
"drupal-6"
] | 2 | 3 | 4,921 | 2 | 0 | 2011-06-01T20:04:48.047000 | 2011-06-01T20:30:48.590000 |
6,206,988 | 6,207,028 | Apache Has Default URL Rewrites | So I just ran across this oddity. It appears that Ubuntu has a "feature" (or bug) that allows you to access the same file using differing methods. /phpinfo.php /phpinfo/somthinghere It seems that both of these load the same file. I would like to turn this off but so far haven't found a way to do so. Any Debian/Ubuntu f... | Can you paste the virtual hosts file? My bet is Content Negotiation, you need to remove the Options -MultiViews MultiViews from the option section, or put a - before it. | Apache Has Default URL Rewrites So I just ran across this oddity. It appears that Ubuntu has a "feature" (or bug) that allows you to access the same file using differing methods. /phpinfo.php /phpinfo/somthinghere It seems that both of these load the same file. I would like to turn this off but so far haven't found a w... | TITLE:
Apache Has Default URL Rewrites
QUESTION:
So I just ran across this oddity. It appears that Ubuntu has a "feature" (or bug) that allows you to access the same file using differing methods. /phpinfo.php /phpinfo/somthinghere It seems that both of these load the same file. I would like to turn this off but so far... | [
"php",
"apache2"
] | 1 | 3 | 64 | 2 | 0 | 2011-06-01T20:05:04.023000 | 2011-06-01T20:08:07.890000 |
6,206,991 | 6,207,206 | Find and Return found string in an array | I am looking for a function that suits the following situation. What the script does: It retrieves the server.log from a minecraft server, and breaks it into sections from user chats, to server notifications etc. I have an array containing the users information, it is set by another file called users.yml and it is conv... | If you're using preg_match() to search each line for a username, make sure you first sort the list of usernames in reverse order using rsort(): $users = array_map('preg_quote', array_keys($userconfig)); rsort($users); $pattern = '/'. implode('|', $users);. '/'; if preg_match($pattern, $line, $matches) { return matches[... | Find and Return found string in an array I am looking for a function that suits the following situation. What the script does: It retrieves the server.log from a minecraft server, and breaks it into sections from user chats, to server notifications etc. I have an array containing the users information, it is set by ano... | TITLE:
Find and Return found string in an array
QUESTION:
I am looking for a function that suits the following situation. What the script does: It retrieves the server.log from a minecraft server, and breaks it into sections from user chats, to server notifications etc. I have an array containing the users information... | [
"php",
"arrays"
] | 1 | 1 | 279 | 3 | 0 | 2011-06-01T20:05:15.337000 | 2011-06-01T20:26:29.340000 |
6,206,996 | 6,207,042 | Tomcat Java Servlet - Initialize Class on Application Startup | I have a class that takes a bit of time to start up (makes some JNI calls and what not), so it is not feasable to initialize this class everytime a page loads. Is it possible to initialize this class on application startup, then access its methods as pages are being served up? For Example: I have MyClass. When the appl... | You have two choices: Initialize your class in servlet's init() method. You may add attribute to make sure your servlet is created at application startup and not on first access. Add ServletContextListener and use contextInitialized() callback method. Use ServletContext#setAttribute to store created object for future u... | Tomcat Java Servlet - Initialize Class on Application Startup I have a class that takes a bit of time to start up (makes some JNI calls and what not), so it is not feasable to initialize this class everytime a page loads. Is it possible to initialize this class on application startup, then access its methods as pages a... | TITLE:
Tomcat Java Servlet - Initialize Class on Application Startup
QUESTION:
I have a class that takes a bit of time to start up (makes some JNI calls and what not), so it is not feasable to initialize this class everytime a page loads. Is it possible to initialize this class on application startup, then access its ... | [
"java",
"tomcat",
"classloader"
] | 10 | 21 | 19,444 | 3 | 0 | 2011-06-01T20:05:37.143000 | 2011-06-01T20:09:59.980000 |
6,206,998 | 6,207,084 | The timeout period elapsed prior to obtaining a connection from the pool - but the pool is not full | I hate even bringing this up b/c there are so many hundreds of pages talking about this error dating back 7-8 years... However, I cant quite figure this out. I have a report service running on server A which connects to SQL Server 2008 R2 on Server B. Both servers are running Windows Server 2008. The report service is ... | This is known bug as shown here Posted by Microsoft on 8/15/2008 at 11:31 AM Thanks for your feedback. The fix was submitted to the source branch of the next major.Net release. | The timeout period elapsed prior to obtaining a connection from the pool - but the pool is not full I hate even bringing this up b/c there are so many hundreds of pages talking about this error dating back 7-8 years... However, I cant quite figure this out. I have a report service running on server A which connects to ... | TITLE:
The timeout period elapsed prior to obtaining a connection from the pool - but the pool is not full
QUESTION:
I hate even bringing this up b/c there are so many hundreds of pages talking about this error dating back 7-8 years... However, I cant quite figure this out. I have a report service running on server A ... | [
".net",
"sql-server",
"database",
"timeout",
"connection-pooling"
] | 11 | 5 | 14,588 | 1 | 0 | 2011-06-01T20:05:39.970000 | 2011-06-01T20:13:25.073000 |
6,207,011 | 6,207,169 | How to Build Dynamic SQl for this? | I have to create a Procedure with dynamic SQL and generate the Update Statements. I have tables Col.TMap.T_Mp ID M_Type ID_F SF1 SF2 1 Acc ACC_ID AC_ID NULL 1 STA STA_ID ST_ID NULL 1 CHa Cha_ID CH_ID NULL ACC ID AC_ID SV1 SV2 SO1 SO2 1 12 6 NULL = NULL STA ID STA_ID SV1 SV2 SO1 SO2 1 1 Open NULL = NULL 1 2 CLosed NULL ... | select 'UPDATE mt SET ' + ID_F + ' = ac.' + ID_F + ' FROM Ms.AT.AT_CRAW t INNER JOIN ' + M_Type + ' ac ON t.' + SF1 + '=SV1 AND ac.ID = 1 INNER JOIN Ms.AT.AT_CRAW_Dmtemp mt ON mt.[SRID] = t.[RID]' as SQL from Col.TMap.T_Mp | How to Build Dynamic SQl for this? I have to create a Procedure with dynamic SQL and generate the Update Statements. I have tables Col.TMap.T_Mp ID M_Type ID_F SF1 SF2 1 Acc ACC_ID AC_ID NULL 1 STA STA_ID ST_ID NULL 1 CHa Cha_ID CH_ID NULL ACC ID AC_ID SV1 SV2 SO1 SO2 1 12 6 NULL = NULL STA ID STA_ID SV1 SV2 SO1 SO2 1 ... | TITLE:
How to Build Dynamic SQl for this?
QUESTION:
I have to create a Procedure with dynamic SQL and generate the Update Statements. I have tables Col.TMap.T_Mp ID M_Type ID_F SF1 SF2 1 Acc ACC_ID AC_ID NULL 1 STA STA_ID ST_ID NULL 1 CHa Cha_ID CH_ID NULL ACC ID AC_ID SV1 SV2 SO1 SO2 1 12 6 NULL = NULL STA ID STA_ID ... | [
"sql",
"sql-server",
"sql-server-2008",
"stored-procedures",
"dynamic-sql"
] | 1 | 2 | 136 | 1 | 0 | 2011-06-01T20:06:44.390000 | 2011-06-01T20:22:35.913000 |
6,207,019 | 6,207,037 | Why do undefined constants evaluate to true? | Stupid question - I'm surprised this one has bitten me. Why do undefined constants in PHP evaluate to true? Test case: The above example prints 'Huh?' Thanks so much for your help!:) | Try defined('WHATEVER_THIS_ISNT_DEFINED') When PHP encounters a constant that is not defined, it throws an E_NOTICE, and uses the constant name you've tried to use as a string. That's why your snippet prints Huh!, because a non-empty string (which is not "0" ) will evaluate to true. From the manual: If you use an undef... | Why do undefined constants evaluate to true? Stupid question - I'm surprised this one has bitten me. Why do undefined constants in PHP evaluate to true? Test case: The above example prints 'Huh?' Thanks so much for your help!:) | TITLE:
Why do undefined constants evaluate to true?
QUESTION:
Stupid question - I'm surprised this one has bitten me. Why do undefined constants in PHP evaluate to true? Test case: The above example prints 'Huh?' Thanks so much for your help!:)
ANSWER:
Try defined('WHATEVER_THIS_ISNT_DEFINED') When PHP encounters a c... | [
"php",
"constants"
] | 19 | 26 | 4,018 | 7 | 0 | 2011-06-01T20:06:58.313000 | 2011-06-01T20:09:18.030000 |
6,207,022 | 6,207,034 | need help understanding this code | this code in book jQuery in action page 131 i don't understand.trigger('adjustName'); what is adjustName and Simple explanation for trigger() thanks:) $('#addFilterButton').click( function() { var filterItem = $(' ').addClass('filterItem').appendTo('#filterPane').data('suffix','.' + (filterCount++)); $('div.template.fi... | It is a string, the name of a custom event you defined. E.g. it would trigger the event handler bound by: el.bind('adjustName', function(){...}); For more information I suggest to have a look at the documentation: Any event handlers attached with.bind() or one of its shortcut methods are triggered when the correspondin... | need help understanding this code this code in book jQuery in action page 131 i don't understand.trigger('adjustName'); what is adjustName and Simple explanation for trigger() thanks:) $('#addFilterButton').click( function() { var filterItem = $(' ').addClass('filterItem').appendTo('#filterPane').data('suffix','.' + (f... | TITLE:
need help understanding this code
QUESTION:
this code in book jQuery in action page 131 i don't understand.trigger('adjustName'); what is adjustName and Simple explanation for trigger() thanks:) $('#addFilterButton').click( function() { var filterItem = $(' ').addClass('filterItem').appendTo('#filterPane').data... | [
"javascript",
"jquery"
] | 1 | 3 | 147 | 3 | 0 | 2011-06-01T20:07:17.360000 | 2011-06-01T20:08:53.693000 |
6,207,023 | 6,216,297 | Keeping track of refreshes in Crystal Reports 2008 | I am curious to know if there is a way to tell if a report has been printed or ran. For example, the user enters in a inspectionnumber and hits apply and then clicks print and then prints the report. Can i know if the report has been printed? is there a way to use local variables to track that, some sort of loop? | I've never tested this, but here's a theory you can try. In your Database Expert, go to your Current Connections and Add Command. Use this to write up a SQL query to save the usage data to a table in your data source (If your data source is read only, just add a delimited text file as an additional data source and outp... | Keeping track of refreshes in Crystal Reports 2008 I am curious to know if there is a way to tell if a report has been printed or ran. For example, the user enters in a inspectionnumber and hits apply and then clicks print and then prints the report. Can i know if the report has been printed? is there a way to use loca... | TITLE:
Keeping track of refreshes in Crystal Reports 2008
QUESTION:
I am curious to know if there is a way to tell if a report has been printed or ran. For example, the user enters in a inspectionnumber and hits apply and then clicks print and then prints the report. Can i know if the report has been printed? is there... | [
"crystal-reports",
"crystal-reports-2008"
] | 0 | 2 | 135 | 1 | 0 | 2011-06-01T20:07:33.883000 | 2011-06-02T15:00:19.460000 |
6,207,036 | 6,207,255 | How to properly handle client "Connection: close" request on HTTP file server? | How do I handle properly a client Connection: close request field? As of now if I get this particular field I close the socket and wait for a following request from the client than reply again and start serving the data. I don't know why my client/server communication is not working as the Apache Server I tested with. ... | Yes closing the socket is the right action to take. If the client is using this header properly, they are closing the socket on their end once they receive your response. What I'm noticing here is that your server is not returning a Content-Length header. Even though the client is issuing a HEAD request, based on the W... | How to properly handle client "Connection: close" request on HTTP file server? How do I handle properly a client Connection: close request field? As of now if I get this particular field I close the socket and wait for a following request from the client than reply again and start serving the data. I don't know why my ... | TITLE:
How to properly handle client "Connection: close" request on HTTP file server?
QUESTION:
How do I handle properly a client Connection: close request field? As of now if I get this particular field I close the socket and wait for a following request from the client than reply again and start serving the data. I ... | [
"java",
"http"
] | 4 | 5 | 39,934 | 4 | 0 | 2011-06-01T20:09:12.933000 | 2011-06-01T20:30:01.123000 |
6,207,039 | 6,207,082 | In subversion I want to Revert back to a revison then step through each revision to see where it broke | My project broke somewhere in the past 25 revisions. I need to isolate the file causing the problem, and would like to find the revision where the problem was introduced. I was thinking of using svn update -r 404 and then each one after that 405,406... etc Is there a better way? | I'd suggest using the git-svn bridge (git is excellent for quick local branching) and using git bisect to quickly find the revision that broke it. | In subversion I want to Revert back to a revison then step through each revision to see where it broke My project broke somewhere in the past 25 revisions. I need to isolate the file causing the problem, and would like to find the revision where the problem was introduced. I was thinking of using svn update -r 404 and ... | TITLE:
In subversion I want to Revert back to a revison then step through each revision to see where it broke
QUESTION:
My project broke somewhere in the past 25 revisions. I need to isolate the file causing the problem, and would like to find the revision where the problem was introduced. I was thinking of using svn ... | [
"svn",
"version-control",
"branching-and-merging"
] | 3 | 0 | 217 | 3 | 0 | 2011-06-01T20:09:32.920000 | 2011-06-01T20:13:19.110000 |
6,207,046 | 6,207,058 | Can Windows and Linux developers work together on the same project using C# and ASP.net? | If a group of developers are working on a project written using ASP.net and C# in a Windows environment with Visual Studio, is there any way a developer can join their team and work with them on the project in a Linux environment? I know about the open source, cross-platform development framework Mono, could this be an... | Is the best option for a Linux developer to just install a Windows partition Yes, by far. Even better, just get a PC. I've run into so many headaches trying to develop in.NET on Linux. Mono isn't perfect, and never will be. | Can Windows and Linux developers work together on the same project using C# and ASP.net? If a group of developers are working on a project written using ASP.net and C# in a Windows environment with Visual Studio, is there any way a developer can join their team and work with them on the project in a Linux environment? ... | TITLE:
Can Windows and Linux developers work together on the same project using C# and ASP.net?
QUESTION:
If a group of developers are working on a project written using ASP.net and C# in a Windows environment with Visual Studio, is there any way a developer can join their team and work with them on the project in a L... | [
"c#",
"asp.net",
"linux",
"monodevelop"
] | 3 | 2 | 393 | 4 | 0 | 2011-06-01T20:10:18.017000 | 2011-06-01T20:11:43.480000 |
6,207,074 | 6,207,103 | Rails : rake db:create mysql error | I am trying to setup a mysql database, but I am getting this error message: rake db:create (in /Users/yookd/Desktop/rails/blog) WARNING: Global access to Rake DSL methods is deprecated. Please Include... Rake::DSL into classes and modules which use the Rake DSL methods. WARNING: DSL method Blog::Application#task called... | This is a known issue. See: Rails - rake db:create error BUT note that Rake 0.9.1 has been released which supposedly fixes things. So first try upgrading rake with: gem update rake And update your bundle: bundle update rake | Rails : rake db:create mysql error I am trying to setup a mysql database, but I am getting this error message: rake db:create (in /Users/yookd/Desktop/rails/blog) WARNING: Global access to Rake DSL methods is deprecated. Please Include... Rake::DSL into classes and modules which use the Rake DSL methods. WARNING: DSL m... | TITLE:
Rails : rake db:create mysql error
QUESTION:
I am trying to setup a mysql database, but I am getting this error message: rake db:create (in /Users/yookd/Desktop/rails/blog) WARNING: Global access to Rake DSL methods is deprecated. Please Include... Rake::DSL into classes and modules which use the Rake DSL metho... | [
"mysql",
"ruby-on-rails"
] | 0 | 2 | 3,950 | 2 | 0 | 2011-06-01T20:12:54.570000 | 2011-06-01T20:15:44.193000 |
6,207,075 | 6,207,104 | Font-size that expands when you resize the window | How do I make my font in HTML such that when I expand the window, the size of the text expands also. Sort of like setting a percentage for the text that will take on a percentage of the size of the box it is in. Here is an illustration of what I would like to happen: #box #text { font-size: 50%; } Now lets say #box is ... | Do it in jquery. $(window).resize(function(){ $('#box #text').css('font-size',($(window).width()*0.5)+'px'); }); | Font-size that expands when you resize the window How do I make my font in HTML such that when I expand the window, the size of the text expands also. Sort of like setting a percentage for the text that will take on a percentage of the size of the box it is in. Here is an illustration of what I would like to happen: #b... | TITLE:
Font-size that expands when you resize the window
QUESTION:
How do I make my font in HTML such that when I expand the window, the size of the text expands also. Sort of like setting a percentage for the text that will take on a percentage of the size of the box it is in. Here is an illustration of what I would ... | [
"javascript",
"jquery",
"html",
"css"
] | 8 | 9 | 6,735 | 3 | 0 | 2011-06-01T20:12:58.347000 | 2011-06-01T20:15:57.287000 |
6,207,077 | 6,207,263 | Querying attributes and node values from XML stored in an XML data type | I have written an interface to interact with the CubeIQ BlackBox (www.magiclogic.com) and I have an SQL Server 2005 database table where I store some regular text fields, dates, and two pieces of XML in columns that have an XML data type. There are a few values I want to pick out of the XML, and I cannot figure out how... | Not knowing what your XML looks like, here's a general purpose piece of code to give you an idea of what it would look like: SELECT [regular_table_field1], [regular_table_field2], [opt_resposne_xml].value('(/rootnode/wrapper/child/@someattribute)[1]', 'int') AS 'someattribute', [opt_resposne_xml].value('(/rootnode/wrap... | Querying attributes and node values from XML stored in an XML data type I have written an interface to interact with the CubeIQ BlackBox (www.magiclogic.com) and I have an SQL Server 2005 database table where I store some regular text fields, dates, and two pieces of XML in columns that have an XML data type. There are... | TITLE:
Querying attributes and node values from XML stored in an XML data type
QUESTION:
I have written an interface to interact with the CubeIQ BlackBox (www.magiclogic.com) and I have an SQL Server 2005 database table where I store some regular text fields, dates, and two pieces of XML in columns that have an XML da... | [
"sql-server",
"xml",
"t-sql"
] | 2 | 2 | 4,006 | 1 | 0 | 2011-06-01T20:13:04.240000 | 2011-06-01T20:30:25.913000 |
6,207,079 | 6,207,097 | Is DbProviderFactories.GetFactory(string providerName) expensive? | I'm trying to figure out if DbProviderFactories.GetFactory(string providerName) is expensive, or if I can safely create a new instance every time I need one. The reason for this is that I have a situation where the provider name can change and it would be more convenient just to recreate the factory every time if that'... | Expensive is a relative term. Getting the Factory itself does not involve making a connection over the network, so from my vantage point it is inexpensive, even if there is a small amount of reflection behind the scenes. | Is DbProviderFactories.GetFactory(string providerName) expensive? I'm trying to figure out if DbProviderFactories.GetFactory(string providerName) is expensive, or if I can safely create a new instance every time I need one. The reason for this is that I have a situation where the provider name can change and it would b... | TITLE:
Is DbProviderFactories.GetFactory(string providerName) expensive?
QUESTION:
I'm trying to figure out if DbProviderFactories.GetFactory(string providerName) is expensive, or if I can safely create a new instance every time I need one. The reason for this is that I have a situation where the provider name can cha... | [
"performance",
"ado.net"
] | 2 | 0 | 350 | 1 | 0 | 2011-06-01T20:13:07.223000 | 2011-06-01T20:15:03.347000 |
6,207,080 | 6,207,229 | How to force error reporting from django management commands? | We are running custom management commands periodically on the server. Is there any way to get something like error reporting via email working for the command? | You could use django logging handler AdminEmailHandler: https://docs.djangoproject.com/en/dev/topics/logging/#django.utils.log.AdminEmailHandler As the docs say: This handler sends an email to the site admins for each log message it receives. So you could use this to log an error on any exception raised in the manageme... | How to force error reporting from django management commands? We are running custom management commands periodically on the server. Is there any way to get something like error reporting via email working for the command? | TITLE:
How to force error reporting from django management commands?
QUESTION:
We are running custom management commands periodically on the server. Is there any way to get something like error reporting via email working for the command?
ANSWER:
You could use django logging handler AdminEmailHandler: https://docs.dj... | [
"django",
"django-email",
"django-errors",
"django-command-extensions"
] | 6 | 5 | 1,326 | 2 | 0 | 2011-06-01T20:13:09.843000 | 2011-06-01T20:28:24.603000 |
6,207,083 | 6,208,298 | Java: How do you enforce a class type parameter to be the same as generic type specified in a generic method? | I created a NotificationManager class, which let's you register a generic listener to some generic notification service. In the NotificationManager class I have a generic method for registering a listener with a service: public static void registerNotify(Class type, INotificationListener listener) { @SuppressWarnings("... | I figured this out. I changed the signature of: public static void broadcastNotify(Class type, E data) to: public static void broadcastNotify(Class type, INotification data) where INotification is some interface that wraps the data I'm trying to return in the notification. This enforces that the class type must exactly... | Java: How do you enforce a class type parameter to be the same as generic type specified in a generic method? I created a NotificationManager class, which let's you register a generic listener to some generic notification service. In the NotificationManager class I have a generic method for registering a listener with ... | TITLE:
Java: How do you enforce a class type parameter to be the same as generic type specified in a generic method?
QUESTION:
I created a NotificationManager class, which let's you register a generic listener to some generic notification service. In the NotificationManager class I have a generic method for registerin... | [
"java",
"generics"
] | 7 | 1 | 1,455 | 3 | 0 | 2011-06-01T20:13:20.980000 | 2011-06-01T22:05:08.863000 |
6,207,087 | 6,207,098 | Passing a variable to setIntervall function | i am calling a jQuery plugin every 5 seconds with the following code var now = new Date();
setInterval('$("#id").myplugin(now)', 1000); The Plugin looks like this so far: (function( $ ){ $.fn.myplugin = function(now) { return this.each(function() { alert(now.getTime()); }); } })( jQuery ); However I get the error: Unc... | Use a function like this: var now = new Date();
setInterval(function() { $("#id").myplugin(now); }, 1000); This way, the so-called scope of now is set to the function in which you call setInterval. Otherwise, it is just the global object ( window ) you're referring to, which doesn't have a now. Secondly, passing a str... | Passing a variable to setIntervall function i am calling a jQuery plugin every 5 seconds with the following code var now = new Date();
setInterval('$("#id").myplugin(now)', 1000); The Plugin looks like this so far: (function( $ ){ $.fn.myplugin = function(now) { return this.each(function() { alert(now.getTime()); }); ... | TITLE:
Passing a variable to setIntervall function
QUESTION:
i am calling a jQuery plugin every 5 seconds with the following code var now = new Date();
setInterval('$("#id").myplugin(now)', 1000); The Plugin looks like this so far: (function( $ ){ $.fn.myplugin = function(now) { return this.each(function() { alert(no... | [
"javascript",
"setinterval"
] | 2 | 5 | 515 | 2 | 0 | 2011-06-01T20:13:44.740000 | 2011-06-01T20:15:04.183000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.