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,204,332 | 6,303,191 | Appcelerator. Options dialog is opening several times when refreshing table | Titanium SDK version: 1.7.0.RC1 iPhone SDK version: 4.2 I am developing an iOS app in Appcelerator. I am retrieving tweets from twitter and inserting them into a table. For each row/tweet I am also extracting the containing links for that individual tweet/row and the user can select them from an options dialog which is... | I had a similar problem. Especially on the iPhone 3G as this runs slowly and you're more tempted to tap things more than once. The way I got around it is to either remove the event listener from within the event listener itself. Or you set a variable and test for its value in the event listener. So, if you set a variab... | Appcelerator. Options dialog is opening several times when refreshing table Titanium SDK version: 1.7.0.RC1 iPhone SDK version: 4.2 I am developing an iOS app in Appcelerator. I am retrieving tweets from twitter and inserting them into a table. For each row/tweet I am also extracting the containing links for that indiv... | TITLE:
Appcelerator. Options dialog is opening several times when refreshing table
QUESTION:
Titanium SDK version: 1.7.0.RC1 iPhone SDK version: 4.2 I am developing an iOS app in Appcelerator. I am retrieving tweets from twitter and inserting them into a table. For each row/tweet I am also extracting the containing li... | [
"appcelerator-mobile"
] | 0 | 1 | 177 | 1 | 0 | 2011-06-01T16:13:32.190000 | 2011-06-10T07:22:30.230000 |
6,204,339 | 6,204,453 | Java Class.getMethods() behavior on overridden methods | While writing a simple JSON serialiser using reflection in Java I was caught off guard by the behavior of Class.getMethods(). It appears that Java Class.getMethods() returns both overriding and overridden methods if the return type of the overriding method extends that of the overridden method. So for example given the... | My understanding is that if you filter out methods for which isBridge() returns true, the unwanted method should go away. It is an artefact of how Java implements covariant return types (bridge methods are also used for generics, but that doesn't appear relevant to your use case). edit Interestingly enough, while this ... | Java Class.getMethods() behavior on overridden methods While writing a simple JSON serialiser using reflection in Java I was caught off guard by the behavior of Class.getMethods(). It appears that Java Class.getMethods() returns both overriding and overridden methods if the return type of the overriding method extends ... | TITLE:
Java Class.getMethods() behavior on overridden methods
QUESTION:
While writing a simple JSON serialiser using reflection in Java I was caught off guard by the behavior of Class.getMethods(). It appears that Java Class.getMethods() returns both overriding and overridden methods if the return type of the overridi... | [
"java",
"reflection"
] | 8 | 8 | 3,466 | 3 | 0 | 2011-06-01T16:14:08.273000 | 2011-06-01T16:21:27.690000 |
6,204,341 | 6,205,076 | What does the Web.Config file do in the views folder of a MVC project | I'm having some problems with deploying my application and while troubleshooting, I came across the Web.Config file in the Views folder. In an attempt to narrow down the possibilities of sources to my problem, I tried to find out the purpose of that Web.Config file but can't really find much information. So basically m... | No, you do not need to configure a virtual folder because of this extra web.config file. The web.config file exists in the Views folders to prevent access to your views by any means other than your controller. In the MVC design pattern, controllers are supposed to route requests and return a rendered view to the callin... | What does the Web.Config file do in the views folder of a MVC project I'm having some problems with deploying my application and while troubleshooting, I came across the Web.Config file in the Views folder. In an attempt to narrow down the possibilities of sources to my problem, I tried to find out the purpose of that ... | TITLE:
What does the Web.Config file do in the views folder of a MVC project
QUESTION:
I'm having some problems with deploying my application and while troubleshooting, I came across the Web.Config file in the Views folder. In an attempt to narrow down the possibilities of sources to my problem, I tried to find out th... | [
"asp.net-mvc",
"web-config"
] | 94 | 83 | 43,549 | 4 | 0 | 2011-06-01T16:14:14 | 2011-06-01T17:10:14.643000 |
6,204,347 | 6,206,726 | Editing Date Time Member Variables with a DropDownListFor doesn't save | So, I am trying to create a DropDownList that will edit the various member variables the DateTime class has (which I have an instance of in my model), such as Day, Month, and Year. However, when an item is selected in the DropDownList and the Save input button is clicked, the data does not save. All other edited pieces... | The DateTime properties (Day, Month, etc.) are all read-only. Hence, it is not possible to set them on a DateTime instance. You would need settable int properties in your model to be able to update the values from the drop-downs. Then you can construct a DateTime from those values later. I would probably create a separ... | Editing Date Time Member Variables with a DropDownListFor doesn't save So, I am trying to create a DropDownList that will edit the various member variables the DateTime class has (which I have an instance of in my model), such as Day, Month, and Year. However, when an item is selected in the DropDownList and the Save i... | TITLE:
Editing Date Time Member Variables with a DropDownListFor doesn't save
QUESTION:
So, I am trying to create a DropDownList that will edit the various member variables the DateTime class has (which I have an instance of in my model), such as Day, Month, and Year. However, when an item is selected in the DropDownL... | [
"c#",
"datetime",
"asp.net-mvc-3",
"drop-down-menu"
] | 0 | 0 | 735 | 1 | 0 | 2011-06-01T16:14:33.407000 | 2011-06-01T19:42:34.170000 |
6,204,351 | 6,204,899 | Twitter Streaming API with OAuth? | I've been stuck on this for awhile. Does anyone know how to authenticate the Twitter Streaming API requests using OAuth? As of right now I'm authenticating via Basic Authentication, and I would like to completely switch over to OAuth. Also, I'm using Ruby on Rails if that helps. Thanks | Connecting to the Twitter Streaming API via OAuth is done much the same as connecting via the REST API. Assuming you've already negotiated an access token, you sign and issue the request using the same signing algorithm as for a REST request. With the Streaming API, it's best to use header-based OAuth rather than query... | Twitter Streaming API with OAuth? I've been stuck on this for awhile. Does anyone know how to authenticate the Twitter Streaming API requests using OAuth? As of right now I'm authenticating via Basic Authentication, and I would like to completely switch over to OAuth. Also, I'm using Ruby on Rails if that helps. Thanks | TITLE:
Twitter Streaming API with OAuth?
QUESTION:
I've been stuck on this for awhile. Does anyone know how to authenticate the Twitter Streaming API requests using OAuth? As of right now I'm authenticating via Basic Authentication, and I would like to completely switch over to OAuth. Also, I'm using Ruby on Rails if ... | [
"ruby-on-rails",
"ruby",
"twitter",
"oauth",
"streaming"
] | 2 | 3 | 2,724 | 4 | 0 | 2011-06-01T16:14:46.883000 | 2011-06-01T16:58:07.363000 |
6,204,360 | 6,204,524 | What do the symbols '+', and '?' when referenced from resource definition signify? | Just got started w/Android on my Win 7 box after a hiatus following my first attempt. In playing with the XML layout I see that the referencing convention defined are of the following forms @[+][package:]type:name?[package:][type:]name I know name is probably the identifier for the resource referenced, and the rest of ... | From Android's documentation: The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and expand the rest of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must be created and added to our resources (in the R.java file... | What do the symbols '+', and '?' when referenced from resource definition signify? Just got started w/Android on my Win 7 box after a hiatus following my first attempt. In playing with the XML layout I see that the referencing convention defined are of the following forms @[+][package:]type:name?[package:][type:]name I... | TITLE:
What do the symbols '+', and '?' when referenced from resource definition signify?
QUESTION:
Just got started w/Android on my Win 7 box after a hiatus following my first attempt. In playing with the XML layout I see that the referencing convention defined are of the following forms @[+][package:]type:name?[pack... | [
"android",
"android-layout"
] | 1 | 1 | 94 | 2 | 0 | 2011-06-01T16:15:33.093000 | 2011-06-01T16:26:32.047000 |
6,204,365 | 6,204,568 | Are Scala parallel collections better in some ways than the parallel collections already available in Java? | I've recently been learning about various libraries for concurrency in Java such as ConcurrentHashMap and the lovely non blocking one from Cliff Click I don't know much about Scala but I've heard good things about the recent parallel collections library. I'd like to know what are some major advantages that this library... | The two collections are for different uses. Java's concurrent collections allow you to use them from a parallel context: many threads can access them simultaneously, and the collection will be sure to do the right thing (so the callers don't have to worry about locks and such). Scala's parallel collections, in contrast... | Are Scala parallel collections better in some ways than the parallel collections already available in Java? I've recently been learning about various libraries for concurrency in Java such as ConcurrentHashMap and the lovely non blocking one from Cliff Click I don't know much about Scala but I've heard good things abou... | TITLE:
Are Scala parallel collections better in some ways than the parallel collections already available in Java?
QUESTION:
I've recently been learning about various libraries for concurrency in Java such as ConcurrentHashMap and the lovely non blocking one from Cliff Click I don't know much about Scala but I've hear... | [
"java",
"scala",
"collections",
"concurrency",
"parallel-processing"
] | 12 | 26 | 1,929 | 3 | 0 | 2011-06-01T16:15:51.440000 | 2011-06-01T16:30:35.147000 |
6,204,370 | 6,204,523 | Django - Restricting ModelChoiceField to valid values | Models.py: class Comment(models.Model): user = models.ForeignKey(User) document = models.ForeignKey(Document) section = models.ForeignKey(Section, null=True, blank=True) description = models.TextField(null=True, blank=True) Forms.py: class CommentForm(ModelForm): class Meta: model = Comment fields = ('section', 'descri... | I think you want to change the ModelChoiceField's queryset and not the queryset of the formset. | Django - Restricting ModelChoiceField to valid values Models.py: class Comment(models.Model): user = models.ForeignKey(User) document = models.ForeignKey(Document) section = models.ForeignKey(Section, null=True, blank=True) description = models.TextField(null=True, blank=True) Forms.py: class CommentForm(ModelForm): cl... | TITLE:
Django - Restricting ModelChoiceField to valid values
QUESTION:
Models.py: class Comment(models.Model): user = models.ForeignKey(User) document = models.ForeignKey(Document) section = models.ForeignKey(Section, null=True, blank=True) description = models.TextField(null=True, blank=True) Forms.py: class CommentF... | [
"python",
"django",
"django-models"
] | 0 | 1 | 483 | 2 | 0 | 2011-06-01T16:16:13.447000 | 2011-06-01T16:26:29.957000 |
6,204,373 | 6,204,470 | Create New Distinct List(of T) from Existing List(of T) Using LINQ | How can I get a new distinct list from an existing list using LINQ? This is what I have so far and it is not distinct but does give me a new list. Dim tmpQryColumn = (From a In _allAudits Select New CheckBoxListItem With {.Id = a.AuditColumn,.Name = a.AuditColumn} ).Distinct() _columnList = New List(Of CheckBoxListItem... | I suspect the problem is that CheckboxListItem doesn't override Equals / GetHashCode so any two instances are effectively distinct. Try: Dim columns = (From a In _allAudits Select a.AuditColumn).Distinct()
_columnList = (From column in columns Select New CheckBoxListItem With {.Id = column,.Name = column} ).ToList() I... | Create New Distinct List(of T) from Existing List(of T) Using LINQ How can I get a new distinct list from an existing list using LINQ? This is what I have so far and it is not distinct but does give me a new list. Dim tmpQryColumn = (From a In _allAudits Select New CheckBoxListItem With {.Id = a.AuditColumn,.Name = a.A... | TITLE:
Create New Distinct List(of T) from Existing List(of T) Using LINQ
QUESTION:
How can I get a new distinct list from an existing list using LINQ? This is what I have so far and it is not distinct but does give me a new list. Dim tmpQryColumn = (From a In _allAudits Select New CheckBoxListItem With {.Id = a.Audit... | [
"vb.net",
"linq",
"list",
"distinct"
] | 1 | 1 | 7,931 | 2 | 0 | 2011-06-01T16:16:21.363000 | 2011-06-01T16:22:32.363000 |
6,204,377 | 6,204,540 | Better way of calculating sum of even ints | I'm trying to write a programme to prompt the user to input an int which is above or equal 2. From this input the programme must then calculate and print the sum of all the even integers between 2 and the entered int. It must also produce an error message if the inputted int is below 2. I've made a programme for it tha... | Note: do not use this example in a real context, it's not effective. It just shows a more clean way of doing it. // Check the input. if (number >= 2) System.out.println(sum(number)); }
// Will find the sum if the number is greater than 2. int sum(int n) { return n == 2? n - 2: n % 2 == 0? n + sum(n - 2): sum(n - 1); }... | Better way of calculating sum of even ints I'm trying to write a programme to prompt the user to input an int which is above or equal 2. From this input the programme must then calculate and print the sum of all the even integers between 2 and the entered int. It must also produce an error message if the inputted int i... | TITLE:
Better way of calculating sum of even ints
QUESTION:
I'm trying to write a programme to prompt the user to input an int which is above or equal 2. From this input the programme must then calculate and print the sum of all the even integers between 2 and the entered int. It must also produce an error message if ... | [
"java",
"int",
"sum"
] | 1 | 3 | 1,593 | 4 | 0 | 2011-06-01T16:16:30.830000 | 2011-06-01T16:27:40.517000 |
6,204,378 | 6,204,461 | C++ DLL function does not seem to work in C# | I have developed a small program using C# and bird.dll, but the birdRS232WakeUp() function seem not to be working. When I call the birdRS232WakeUp() function in C++ the program will stop for a while (8-10 seconds). It looks like it is beginning to do the process connecting with the hardware (Flock of bird). But in C#, ... | Not sure if these points will solve your problem, but: 1) pwComport should be declared as ushort[] pwComport, not ref ushort[] pwComport 2) you need to pass nGroupMode parameter from C#. You can set it to default value if you use C#4, but don't ignore it at all. | C++ DLL function does not seem to work in C# I have developed a small program using C# and bird.dll, but the birdRS232WakeUp() function seem not to be working. When I call the birdRS232WakeUp() function in C++ the program will stop for a while (8-10 seconds). It looks like it is beginning to do the process connecting w... | TITLE:
C++ DLL function does not seem to work in C#
QUESTION:
I have developed a small program using C# and bird.dll, but the birdRS232WakeUp() function seem not to be working. When I call the birdRS232WakeUp() function in C++ the program will stop for a while (8-10 seconds). It looks like it is beginning to do the pr... | [
"c#",
"c++",
"dll",
"pinvoke"
] | 0 | 1 | 255 | 1 | 0 | 2011-06-01T16:16:53.857000 | 2011-06-01T16:21:54.243000 |
6,204,395 | 6,204,513 | event handling inheritance (C++) | I am redesigning how events (related to data) are handled for existing code (in C++). The events to be handled are DataTable related events, and XmlNode related events. I'm wanting to create a general super class with virtual functions (calling it EventManager ) in order to provide consistency across the application. I... | Pass the arguments by reference, passing by value just adds an additional overhead. But by using it in the virtual functions, I will have lost information unique to the derived event args. You can use dynamic_cast and check the validity of the downcast, no information will be lost. | event handling inheritance (C++) I am redesigning how events (related to data) are handled for existing code (in C++). The events to be handled are DataTable related events, and XmlNode related events. I'm wanting to create a general super class with virtual functions (calling it EventManager ) in order to provide cons... | TITLE:
event handling inheritance (C++)
QUESTION:
I am redesigning how events (related to data) are handled for existing code (in C++). The events to be handled are DataTable related events, and XmlNode related events. I'm wanting to create a general super class with virtual functions (calling it EventManager ) in ord... | [
"c++",
"events",
"inheritance"
] | 0 | 1 | 365 | 2 | 0 | 2011-06-01T16:17:44.107000 | 2011-06-01T16:25:45.213000 |
6,204,400 | 6,211,263 | Visual C++ ListBox as Preference Chooser | So I'm building a tool that allows a user to edit a whole bunch of preferences for various things. There are several groups of settings, too many to use a TabControl without creating arrow sliders to view all of the tabs, so I decided I would try and use a ListBox to list the groups of preferences, and then when they c... | You can a vertical splitter with two panes: one which contains the list another one which contains the configuration dialogs you would normally use in a tab control Each time the list selection changes you can load the appropriate dialog in the right pane. You can find a splitter tutorial here: http://www.codeproject.c... | Visual C++ ListBox as Preference Chooser So I'm building a tool that allows a user to edit a whole bunch of preferences for various things. There are several groups of settings, too many to use a TabControl without creating arrow sliders to view all of the tabs, so I decided I would try and use a ListBox to list the gr... | TITLE:
Visual C++ ListBox as Preference Chooser
QUESTION:
So I'm building a tool that allows a user to edit a whole bunch of preferences for various things. There are several groups of settings, too many to use a TabControl without creating arrow sliders to view all of the tabs, so I decided I would try and use a List... | [
"visual-c++",
"listbox",
"preference"
] | 0 | 1 | 221 | 1 | 0 | 2011-06-01T16:17:55.700000 | 2011-06-02T06:36:18.270000 |
6,204,406 | 6,204,654 | Help me understand the performance and behavior of sleeping threads | Lets say I have created a number of threads (~100) and I have put most of them to sleep while a few of them are working on purely CPU bound problems. What is the effect on performance versus JUST creating the handful of threads that are doing work and no threads that are sleeping? Does the existence of many threads, re... | Based on the.net tags, I'm going to presume you're dealing with threads on Windows. At least in the case of the normal Windows scheduler, sleeping threads will normally affect performance extremely minimally. The threads will consume some resources -- for example, each thread you create gets its own stack, a thread inf... | Help me understand the performance and behavior of sleeping threads Lets say I have created a number of threads (~100) and I have put most of them to sleep while a few of them are working on purely CPU bound problems. What is the effect on performance versus JUST creating the handful of threads that are doing work and ... | TITLE:
Help me understand the performance and behavior of sleeping threads
QUESTION:
Lets say I have created a number of threads (~100) and I have put most of them to sleep while a few of them are working on purely CPU bound problems. What is the effect on performance versus JUST creating the handful of threads that a... | [
".net",
"multithreading",
".net-4.0",
"parallel-processing"
] | 2 | 4 | 188 | 3 | 0 | 2011-06-01T16:18:01.800000 | 2011-06-01T16:37:35.447000 |
6,204,407 | 6,205,136 | Does the PyMongo driver aggregate data | ...after it retrieves all of it from MongoDB and transferring it over the network? What I'm trying to ask is - in a traditional DB scenario, the COUNT, SUM etc are performed at the DB end. Does PyMongo transfer all the records over the network and then do the aggregation? For example, I'm looking at the query from PyMo... | The count() method of pymongo.cursor.Cursor actually sends a 'count' command to the server that only returns the count, not the documents. You can do the same thing yourself: >>> db = c.foo >>> for doc in db.things.find(): print doc... {u'_id': ObjectId('4de671821121812a0087101b'), u'foo': u'bar'} {u'_id': ObjectId('4d... | Does the PyMongo driver aggregate data ...after it retrieves all of it from MongoDB and transferring it over the network? What I'm trying to ask is - in a traditional DB scenario, the COUNT, SUM etc are performed at the DB end. Does PyMongo transfer all the records over the network and then do the aggregation? For exam... | TITLE:
Does the PyMongo driver aggregate data
QUESTION:
...after it retrieves all of it from MongoDB and transferring it over the network? What I'm trying to ask is - in a traditional DB scenario, the COUNT, SUM etc are performed at the DB end. Does PyMongo transfer all the records over the network and then do the agg... | [
"python",
"mongodb",
"pymongo"
] | 1 | 3 | 492 | 1 | 0 | 2011-06-01T16:18:03 | 2011-06-01T17:16:20.907000 |
6,204,412 | 6,213,373 | Commons File Upload Not Working In Servlet | I have a servlet which is meant to handle the upload of a very large file. I am trying to use commons fileupload to handle it. Currently, the file I am attempting to upload is 287MB. I set up the FileItemFactory and ServletFileUpload, then set a very large max file size on the ServletFileUpload. Unfortunately, when I a... | It was an incredibly stupid problem. I left the name attribute off of the FileUpload entry in the GWT UiBinder. Thanks for all of the help from everyone. | Commons File Upload Not Working In Servlet I have a servlet which is meant to handle the upload of a very large file. I am trying to use commons fileupload to handle it. Currently, the file I am attempting to upload is 287MB. I set up the FileItemFactory and ServletFileUpload, then set a very large max file size on the... | TITLE:
Commons File Upload Not Working In Servlet
QUESTION:
I have a servlet which is meant to handle the upload of a very large file. I am trying to use commons fileupload to handle it. Currently, the file I am attempting to upload is 287MB. I set up the FileItemFactory and ServletFileUpload, then set a very large ma... | [
"java",
"servlets",
"apache-commons-fileupload"
] | 1 | 2 | 5,479 | 3 | 0 | 2011-06-01T16:18:09.140000 | 2011-06-02T10:34:00.403000 |
6,204,420 | 6,205,192 | retrieving username with find_by_id(comment.user_id).name not working | I'm trying to retrieve a user name to insert into a comment on a blog post using rails if I use <%= comment.user_id %>" it will give me an id but if I try and retrieve the user then call the name it return nil class <%= User.find_by_id(comment.user_id).name %>" why is this not working if I leave.name off it returns a s... | Most likely, the dynamic finder is getting confused by the id and is returning the (Ruby) object's id (i.e. object_id ) instead of the record's id. Try calling User.find(comment.user_id).name instead. Or, better: comment.user.name. The above should answer your question, but what you really want to do is: In the control... | retrieving username with find_by_id(comment.user_id).name not working I'm trying to retrieve a user name to insert into a comment on a blog post using rails if I use <%= comment.user_id %>" it will give me an id but if I try and retrieve the user then call the name it return nil class <%= User.find_by_id(comment.user_i... | TITLE:
retrieving username with find_by_id(comment.user_id).name not working
QUESTION:
I'm trying to retrieve a user name to insert into a comment on a blog post using rails if I use <%= comment.user_id %>" it will give me an id but if I try and retrieve the user then call the name it return nil class <%= User.find_by... | [
"ruby-on-rails",
"ruby-on-rails-3",
"find"
] | 2 | 5 | 2,616 | 1 | 0 | 2011-06-01T16:18:42.987000 | 2011-06-01T17:21:33.400000 |
6,204,423 | 6,204,489 | Would a UIViewController currently in UINavigationContoller's viewController stack be unloaded? | Also would anybody tell me what's the difference between viewDidUnload and dealloc? | Yes, it could be unloaded if a memory warning occurs. As for the difference between viewDidUnload and dealloc - the former is called when your view is unloaded, typically because of a low memory situation. The latter is called when your object's retain count reaches zero (i.e. it is completely released from memory) | Would a UIViewController currently in UINavigationContoller's viewController stack be unloaded? Also would anybody tell me what's the difference between viewDidUnload and dealloc? | TITLE:
Would a UIViewController currently in UINavigationContoller's viewController stack be unloaded?
QUESTION:
Also would anybody tell me what's the difference between viewDidUnload and dealloc?
ANSWER:
Yes, it could be unloaded if a memory warning occurs. As for the difference between viewDidUnload and dealloc - t... | [
"iphone",
"ios",
"memory-management",
"uinavigationcontroller"
] | 0 | 0 | 150 | 5 | 0 | 2011-06-01T16:18:51.970000 | 2011-06-01T16:23:52.787000 |
6,204,428 | 6,204,694 | Entity Framework - NotSupportedException | var depts = ctx.Departments.OrderBy(d => d.deptName).Select(d => d.deptNo);
foreach (int deptNumber in depts) { var deptReports = from d in ctx.Departments join r in matchingIncidents on d.deptNo equals r.deptNo where r.deptNo == deptNumber select r;
int deptReportsCount = deptReports.Count(); I am completely baffled... | matchingIncidents looks like a local collection of a complex type (because you are using r.deptNo ). That's not allowed in LINQ to Entities. You could try this instead: foreach (int deptNumber in depts) { var deptReports = from d in ctx.Departments join r in matchingIncidents.Select(m => m.deptNo) on d.deptNo equals r ... | Entity Framework - NotSupportedException var depts = ctx.Departments.OrderBy(d => d.deptName).Select(d => d.deptNo);
foreach (int deptNumber in depts) { var deptReports = from d in ctx.Departments join r in matchingIncidents on d.deptNo equals r.deptNo where r.deptNo == deptNumber select r;
int deptReportsCount = dep... | TITLE:
Entity Framework - NotSupportedException
QUESTION:
var depts = ctx.Departments.OrderBy(d => d.deptName).Select(d => d.deptNo);
foreach (int deptNumber in depts) { var deptReports = from d in ctx.Departments join r in matchingIncidents on d.deptNo equals r.deptNo where r.deptNo == deptNumber select r;
int dept... | [
"asp.net",
"entity-framework",
"notsupportedexception"
] | 1 | 2 | 479 | 2 | 0 | 2011-06-01T16:19:05.040000 | 2011-06-01T16:40:08.163000 |
6,204,441 | 6,204,589 | How to migrate applications from Classic ASP to ASP.NET MVC? | Currently, we have many web applications (external & internal) developed using Classic ASP through.NET 2.0 technologies. Each of those web applications have their own login screen authenticating against their own custom database or using Windows authentication. Users have access to one or more of these applications, me... | I would set up a seperate web site which only handles the windows authentication. I would then rely on something like OpenID and/or OAuth to ask for credentials/token to make sure to user has proper access. The user that want to sign in using windows credentials go through that process because you are right in that a I... | How to migrate applications from Classic ASP to ASP.NET MVC? Currently, we have many web applications (external & internal) developed using Classic ASP through.NET 2.0 technologies. Each of those web applications have their own login screen authenticating against their own custom database or using Windows authenticatio... | TITLE:
How to migrate applications from Classic ASP to ASP.NET MVC?
QUESTION:
Currently, we have many web applications (external & internal) developed using Classic ASP through.NET 2.0 technologies. Each of those web applications have their own login screen authenticating against their own custom database or using Win... | [
"asp.net",
"asp.net-mvc-3",
"web-applications",
"asp-classic"
] | 15 | 3 | 2,236 | 3 | 0 | 2011-06-01T16:20:20.330000 | 2011-06-01T16:32:18.960000 |
6,204,443 | 6,204,810 | Python signal: reading return from signal handler function | Simple question; How do you read the return value of a function that is called as a signal handler? import signal
def SigHand(sig, frm): return 'SomeValue'
signal.signal(signal.SIGCHLD, SigHand) signal.pause() Is there a way to read the return value 'SomeValue' other than setting it as a global? | You could create a simple class with a return value attribute. >>> import signal >>> class SignalHandler(object):... def __init__(self):... self.retval = None... def handle(self, sig, frm):... self.retval = sig... >>> s = SignalHandler() >>> s.retval >>> signal.signal(signal.SIGALRM, s.handle) 0 >>> signal.alarm(1) 0 >... | Python signal: reading return from signal handler function Simple question; How do you read the return value of a function that is called as a signal handler? import signal
def SigHand(sig, frm): return 'SomeValue'
signal.signal(signal.SIGCHLD, SigHand) signal.pause() Is there a way to read the return value 'SomeValu... | TITLE:
Python signal: reading return from signal handler function
QUESTION:
Simple question; How do you read the return value of a function that is called as a signal handler? import signal
def SigHand(sig, frm): return 'SomeValue'
signal.signal(signal.SIGCHLD, SigHand) signal.pause() Is there a way to read the retu... | [
"python",
"return-value",
"signals"
] | 3 | 3 | 4,377 | 1 | 0 | 2011-06-01T16:20:41.340000 | 2011-06-01T16:50:28.300000 |
6,204,447 | 6,206,102 | boost pion comet-like httpserver | I'm trying to efficiently implement comet-like functionality using HTTPServer class of boost::pion. Basically, in my 'handleURI' function, I would like to postpone returning results to the client, until the server is ready to respond (for instance, until another user has sent a message to the first user, to use a simpl... | Setup a timeout ASIO event for your connection so that you can reap the connection after 20min or something reasonable like that. I don't know about Boost Pion, but in ASIO you'd want to register a read handler that catches when the connection closes and a timeout handler to alert you for when the connection has actual... | boost pion comet-like httpserver I'm trying to efficiently implement comet-like functionality using HTTPServer class of boost::pion. Basically, in my 'handleURI' function, I would like to postpone returning results to the client, until the server is ready to respond (for instance, until another user has sent a message ... | TITLE:
boost pion comet-like httpserver
QUESTION:
I'm trying to efficiently implement comet-like functionality using HTTPServer class of boost::pion. Basically, in my 'handleURI' function, I would like to postpone returning results to the client, until the server is ready to respond (for instance, until another user h... | [
"boost",
"comet",
"long-polling",
"httpserver",
"pion-net"
] | 1 | 2 | 447 | 1 | 0 | 2011-06-01T16:20:56.133000 | 2011-06-01T18:42:47.633000 |
6,204,449 | 6,204,579 | SqlCommand.ExecuteScalar - specify a particular data item | I have a Stored Procedure which returns 10 columns of data. Using cmd.ExecuteScalar() returns the value of the 1st column from the 1st record. How can I change this so that I can return different columns, by specifying their alias/dataitem name? I want to be able to do something like: Dim FirstName as String = cmd.Exec... | You could create a method that calls ExecuteReader, and then uses GetOrdinal with your column name to then call GetString. My VB is non-existent, but this is the C# for an extension method. public static class SqlCommandExt { public static string ExecuteScalar(this SqlCommand cmd, string columnName) { using (var reader... | SqlCommand.ExecuteScalar - specify a particular data item I have a Stored Procedure which returns 10 columns of data. Using cmd.ExecuteScalar() returns the value of the 1st column from the 1st record. How can I change this so that I can return different columns, by specifying their alias/dataitem name? I want to be abl... | TITLE:
SqlCommand.ExecuteScalar - specify a particular data item
QUESTION:
I have a Stored Procedure which returns 10 columns of data. Using cmd.ExecuteScalar() returns the value of the 1st column from the 1st record. How can I change this so that I can return different columns, by specifying their alias/dataitem name... | [
"vb.net",
"sql-server-2005",
"sqlcommand",
"executescalar"
] | 1 | 2 | 5,469 | 4 | 0 | 2011-06-01T16:21:03.060000 | 2011-06-01T16:31:26.733000 |
6,204,450 | 6,204,908 | 2 page methods on an aspx page | I'm calling a page method with jquery and it works just fine. I'm creating a second one and it's not working at all; all I get is the error function. Is it possible to put more than 1 page method in an aspx page? Here's my jquery on the client: function LoadCount() {
var TheObject = $.toJSON(CurrentForm); var TheParam... | You need to set dataType: "text" in the $.ajax() call properties if you're just returning plain text instead of a JSON encoded string. You might also want to leave the contentType unspecified (at the default value of 'application/x-www-form-urlencoded' ) if your're sending plain text instead of a JS object. | 2 page methods on an aspx page I'm calling a page method with jquery and it works just fine. I'm creating a second one and it's not working at all; all I get is the error function. Is it possible to put more than 1 page method in an aspx page? Here's my jquery on the client: function LoadCount() {
var TheObject = $.to... | TITLE:
2 page methods on an aspx page
QUESTION:
I'm calling a page method with jquery and it works just fine. I'm creating a second one and it's not working at all; all I get is the error function. Is it possible to put more than 1 page method in an aspx page? Here's my jquery on the client: function LoadCount() {
va... | [
"asp.net"
] | 0 | 0 | 211 | 1 | 0 | 2011-06-01T16:21:04.103000 | 2011-06-01T16:58:40.873000 |
6,204,455 | 6,204,757 | WPF: Groupstyle not working correctly because of Style and/or modified ListBox | I am trying to use a GroupStyle but instead of showing the groupname as a header over the items in the list it only shows the header and not the items. It works fine until I applied a special style to the list. I then decided this style was pretty bogus so I created a UserControl fro this effect. The problem persists. ... | In the ListBox template, replace: with The ItemsPresenter class has extra logic for groups, that you lose if you're directly using a panel to display the items. | WPF: Groupstyle not working correctly because of Style and/or modified ListBox I am trying to use a GroupStyle but instead of showing the groupname as a header over the items in the list it only shows the header and not the items. It works fine until I applied a special style to the list. I then decided this style was ... | TITLE:
WPF: Groupstyle not working correctly because of Style and/or modified ListBox
QUESTION:
I am trying to use a GroupStyle but instead of showing the groupname as a header over the items in the list it only shows the header and not the items. It works fine until I applied a special style to the list. I then decid... | [
"wpf",
"listbox",
"groupstyle"
] | 5 | 5 | 2,267 | 1 | 0 | 2011-06-01T16:21:28.753000 | 2011-06-01T16:45:32.800000 |
6,204,476 | 6,204,514 | php and url rewrites | so I was wondering if something like this is at all possible. I was hoping to change /?directory=$variable to something like /$variable An actual example might be easier to understand. So I want to really be /?directory=$variable or in url rewite terms i guess /?page=$1 I hope this makes sense. I am really no good with... | Yes it's possibile if your server/hosting supports it you can do it by creating an.htaccess file with: RewriteEngine On RewriteRule ^/(.+)$ /?directory=$1 [L] If you want to allow other directories/files to get accessed normally you should do something like: RewriteRule ^/([a-z]+)$ /?directory=$1 [L] This will capture ... | php and url rewrites so I was wondering if something like this is at all possible. I was hoping to change /?directory=$variable to something like /$variable An actual example might be easier to understand. So I want to really be /?directory=$variable or in url rewite terms i guess /?page=$1 I hope this makes sense. I a... | TITLE:
php and url rewrites
QUESTION:
so I was wondering if something like this is at all possible. I was hoping to change /?directory=$variable to something like /$variable An actual example might be easier to understand. So I want to really be /?directory=$variable or in url rewite terms i guess /?page=$1 I hope thi... | [
"php",
"url-rewriting"
] | 1 | 1 | 108 | 4 | 0 | 2011-06-01T16:22:57.767000 | 2011-06-01T16:25:55.037000 |
6,204,482 | 6,204,564 | Selenium fails to click | selenium.click([xpath to object]) Selenium click method seems to be screwed up for me. It recognises the button I want to click and thinks it clicks it. But nothing happens on the screen. The next line involves clicking another button on the next screen. It fails because it cant locate the button because the first clic... | I had a similar problem and this code worked for me: mouseOver(locator); mouseDownAt(locator, "10,10"); mouseUpAt(locator, "10,10"); I wrapped it up in a clickButton() method and use it instead of click() | Selenium fails to click selenium.click([xpath to object]) Selenium click method seems to be screwed up for me. It recognises the button I want to click and thinks it clicks it. But nothing happens on the screen. The next line involves clicking another button on the next screen. It fails because it cant locate the butto... | TITLE:
Selenium fails to click
QUESTION:
selenium.click([xpath to object]) Selenium click method seems to be screwed up for me. It recognises the button I want to click and thinks it clicks it. But nothing happens on the screen. The next line involves clicking another button on the next screen. It fails because it can... | [
"java",
"selenium"
] | 2 | 1 | 1,202 | 3 | 0 | 2011-06-01T16:23:15.727000 | 2011-06-01T16:29:54.530000 |
6,204,485 | 6,205,517 | Core data database design issues | I want to create a core data model to store user input questions and then entries for those questions. The questions will be 1 of 3 types. (1-10, Yes No or a number of specific units). So users will go into the app, click "add question" and will be shown a form where they will input the question title choose the questi... | There's no correct way to design it, and there are indeed many different ways to design a solution. As @dasdom suggested, you could remove the value from the Entry entity description, and make Entry abstract. Create three subclasses of Entry ( BooleanAnswer, RankedAnswer, and ValueAnswer for example). The ValueAnswer w... | Core data database design issues I want to create a core data model to store user input questions and then entries for those questions. The questions will be 1 of 3 types. (1-10, Yes No or a number of specific units). So users will go into the app, click "add question" and will be shown a form where they will input the... | TITLE:
Core data database design issues
QUESTION:
I want to create a core data model to store user input questions and then entries for those questions. The questions will be 1 of 3 types. (1-10, Yes No or a number of specific units). So users will go into the app, click "add question" and will be shown a form where t... | [
"ios",
"database-design",
"core-data"
] | 0 | 1 | 377 | 1 | 0 | 2011-06-01T16:23:26.667000 | 2011-06-01T17:50:16.427000 |
6,204,492 | 6,204,631 | Android Shared Service? | First of all i'd like to say two things. The first being, sorry if this question has already been asked, i've searched for similar questions around this topic but was unable to find a solution. Secondly sorry for the lengthy question, and please let me know of any error and I will be sure to make appropriate changes:).... | The issue I have is that when the service is started in either application, the other application is not notified of any events. That's because you have two services. Just because the service is packaged in an Android library project does not somehow magically cause two distinct applications to use the same copy. Such ... | Android Shared Service? First of all i'd like to say two things. The first being, sorry if this question has already been asked, i've searched for similar questions around this topic but was unable to find a solution. Secondly sorry for the lengthy question, and please let me know of any error and I will be sure to mak... | TITLE:
Android Shared Service?
QUESTION:
First of all i'd like to say two things. The first being, sorry if this question has already been asked, i've searched for similar questions around this topic but was unable to find a solution. Secondly sorry for the lengthy question, and please let me know of any error and I w... | [
"java",
"android",
"service"
] | 9 | 10 | 6,635 | 2 | 0 | 2011-06-01T16:24:16.210000 | 2011-06-01T16:35:21.337000 |
6,204,498 | 6,204,550 | SQL Sub query doubt | i'm a bit stuck and would appreciate the help..... i'm sure i need to use a sub query but when i try i m getting errors saying returning more than one row.... So this is the code SELECT to_char(p.releasedate, 'YYYY') AS releaseyear, t.genre, COUNT(*) AS "Number of awards" FROM dbf11.film p JOIN dbf11.genre t ON p.filmI... | SELECT to_char(p.releasedate, 'YYYY') AS releaseyear, t.genre. COUNT(*) AS "Number of awards" FROM dbf11.film p INNER JOIN dbf11.genre t ON p.filmID = t.filmID GROUP BY to_char(p.releasedate, 'YYYY'), t.genre HAVING COUNT(*) > 1 ORDER BY to_char(p.releasedate, 'YYYY'), t.genre; | SQL Sub query doubt i'm a bit stuck and would appreciate the help..... i'm sure i need to use a sub query but when i try i m getting errors saying returning more than one row.... So this is the code SELECT to_char(p.releasedate, 'YYYY') AS releaseyear, t.genre, COUNT(*) AS "Number of awards" FROM dbf11.film p JOIN dbf1... | TITLE:
SQL Sub query doubt
QUESTION:
i'm a bit stuck and would appreciate the help..... i'm sure i need to use a sub query but when i try i m getting errors saying returning more than one row.... So this is the code SELECT to_char(p.releasedate, 'YYYY') AS releaseyear, t.genre, COUNT(*) AS "Number of awards" FROM dbf1... | [
"sql",
"subquery"
] | 1 | 7 | 239 | 2 | 0 | 2011-06-01T16:24:42.487000 | 2011-06-01T16:28:25.010000 |
6,204,510 | 6,204,691 | Java/Android xml parsing causes NullPointerException | I have a problem with parsing XML file on android. My examples.xml file look like this: something And my Java code: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(getResources().openRawResource(R.xml.examples)); doc.getDocumentEl... | Try moving your xml file to the res/raw folder, then try this: Document doc = db.parse(getResources().openRawResource(R.raw.examples)); Let me know if that works. EDIT: if you look at http://developer.android.com/reference/android/content/res/Resources.html#openRawResource%28int%29 it basically says you can only use th... | Java/Android xml parsing causes NullPointerException I have a problem with parsing XML file on android. My examples.xml file look like this: something And my Java code: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(getResources(... | TITLE:
Java/Android xml parsing causes NullPointerException
QUESTION:
I have a problem with parsing XML file on android. My examples.xml file look like this: something And my Java code: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.p... | [
"java",
"android",
"xml",
"xml-parsing"
] | 0 | 2 | 924 | 3 | 0 | 2011-06-01T16:25:30.653000 | 2011-06-01T16:40:05.827000 |
6,204,511 | 6,207,117 | How to add mappings by namespace in Fluent NHibernate | In my application, I need to talk to multiple databases. I am handling this in NHibernate by creating one SessionFactory per database (I assume this is the correct thing to do). So I have two sets of models (one per database), and two sets of Fluent NHibernate ClassMap<> mappings. Both are in the same project (separate... | It's odd that FluentNHibernate supports this type of filtering for automapping, but not for ClassMap s. It shouldn't be too hard to add this feature yourself, though, via the magic of extension methods. Try this: public static FluentMappingsContainer AddFromAssemblyOf ( this FluentMappingsContainer mappings, Predicate ... | How to add mappings by namespace in Fluent NHibernate In my application, I need to talk to multiple databases. I am handling this in NHibernate by creating one SessionFactory per database (I assume this is the correct thing to do). So I have two sets of models (one per database), and two sets of Fluent NHibernate Class... | TITLE:
How to add mappings by namespace in Fluent NHibernate
QUESTION:
In my application, I need to talk to multiple databases. I am handling this in NHibernate by creating one SessionFactory per database (I assume this is the correct thing to do). So I have two sets of models (one per database), and two sets of Fluen... | [
"nhibernate",
"fluent-nhibernate",
"nhibernate-mapping",
"fluent-nhibernate-mapping"
] | 8 | 16 | 8,967 | 4 | 0 | 2011-06-01T16:25:32.980000 | 2011-06-01T20:17:07.553000 |
6,204,512 | 6,204,567 | Exporting to Outlook (.ics file) from a .NET web application | Basically I'm trying to create and export a.ics file from a C# web application so the user can save it, and open it in Outlook to add something to their calendar. Here's the code I have at the moment... string icsFile = createICSFile(description, startDate, endDate, summary);
//Get the paths required for writing the f... | It sounds like you are trying to give the user the physical path to the file instead of the virtual path. Try changing the path so it ends up in the www.yoursite.com/date.ics format instead. This will allow your users to download it. The issue is that they don't have access to the C drive on your server. Here is a link... | Exporting to Outlook (.ics file) from a .NET web application Basically I'm trying to create and export a.ics file from a C# web application so the user can save it, and open it in Outlook to add something to their calendar. Here's the code I have at the moment... string icsFile = createICSFile(description, startDate, e... | TITLE:
Exporting to Outlook (.ics file) from a .NET web application
QUESTION:
Basically I'm trying to create and export a.ics file from a C# web application so the user can save it, and open it in Outlook to add something to their calendar. Here's the code I have at the moment... string icsFile = createICSFile(descrip... | [
"c#",
".net",
"asp.net",
"outlook",
"icalendar"
] | 2 | 1 | 5,921 | 1 | 0 | 2011-06-01T16:25:34.043000 | 2011-06-01T16:30:23.633000 |
6,204,519 | 6,205,290 | How to get started developing an OPC Xi (.NET 3.0 WCF Services) Server (Service) | I would like to implement an OPC Server using the latest standard version: OPC Xi. My purpose is not providing a service for real usage, I just would like to develop a finctional server returning data from sensors of a certain industrial station (non existing: finctional). The main purpose is to create a server for aca... | The OPC Training Institute has these getting started tutorials for working with OPC Xi (which by the way has been renamed to OPC.NET 3.0) The future of OPC.NET 3.0 is very murky. The OPC Foundation seems to downplay the fact that it even exists. The OPC Foundation's position is that OPC UA is the way of the future as o... | How to get started developing an OPC Xi (.NET 3.0 WCF Services) Server (Service) I would like to implement an OPC Server using the latest standard version: OPC Xi. My purpose is not providing a service for real usage, I just would like to develop a finctional server returning data from sensors of a certain industrial s... | TITLE:
How to get started developing an OPC Xi (.NET 3.0 WCF Services) Server (Service)
QUESTION:
I would like to implement an OPC Server using the latest standard version: OPC Xi. My purpose is not providing a service for real usage, I just would like to develop a finctional server returning data from sensors of a ce... | [
".net",
"wcf",
"opc"
] | 4 | 2 | 3,074 | 1 | 0 | 2011-06-01T16:26:15.587000 | 2011-06-01T17:28:58.390000 |
6,204,526 | 6,204,849 | Understanding javascript closures and memory usage | EDIT: This is just a simple example to demontrate the concern I have with a much larger program. I wouldn't use this actual code for anything:) If I run this - The call to setTimeout presumably creates a closure which captures the contents of the parameters to the "update" function (amount, win, data). So those variabl... | In my understanding, when a closure is created, the current lexical context is bundled with it. In your case, it would be the amount, win, data. This context will be used, when the timeout fires, to execute the closure and thus call once again the function update; this call, although it might appear so, is not recursiv... | Understanding javascript closures and memory usage EDIT: This is just a simple example to demontrate the concern I have with a much larger program. I wouldn't use this actual code for anything:) If I run this - The call to setTimeout presumably creates a closure which captures the contents of the parameters to the "upd... | TITLE:
Understanding javascript closures and memory usage
QUESTION:
EDIT: This is just a simple example to demontrate the concern I have with a much larger program. I wouldn't use this actual code for anything:) If I run this - The call to setTimeout presumably creates a closure which captures the contents of the para... | [
"javascript",
"closures"
] | 15 | 7 | 2,401 | 2 | 0 | 2011-06-01T16:26:39.317000 | 2011-06-01T16:53:16.443000 |
6,204,529 | 6,204,735 | Blackberry twitter connect using oAuth and twitter API me library | I'm building an application for BB to connect to twitter. Does anyone know how to use "twitter api me library" to connect to twitter using oAuth (not xAuth), and give me an example working code? | I suggest you to read the project's wiki page. There are some good code snippets that may help you on this matter. http://kenai.com/projects/twitterapime Regards, | Blackberry twitter connect using oAuth and twitter API me library I'm building an application for BB to connect to twitter. Does anyone know how to use "twitter api me library" to connect to twitter using oAuth (not xAuth), and give me an example working code? | TITLE:
Blackberry twitter connect using oAuth and twitter API me library
QUESTION:
I'm building an application for BB to connect to twitter. Does anyone know how to use "twitter api me library" to connect to twitter using oAuth (not xAuth), and give me an example working code?
ANSWER:
I suggest you to read the projec... | [
"twitter",
"blackberry"
] | 1 | 1 | 1,072 | 1 | 0 | 2011-06-01T16:26:56.840000 | 2011-06-01T16:43:12.627000 |
6,204,533 | 6,204,593 | .openrecordsource "run-time error '91'" | I'm having an issue with the following lines of code, I feel its something simple but I can't put my finger on it. I get a Run-time error '91' object variable or with block variable not set error. The error happens on the rsc.OpenRecordSet... line. BadgeV is a number, I have the DAO reference installed, It is pulling f... | Should be set rsc = db.OpenRecordset(...) instead of rsc.OpenRecordset(...) | .openrecordsource "run-time error '91'" I'm having an issue with the following lines of code, I feel its something simple but I can't put my finger on it. I get a Run-time error '91' object variable or with block variable not set error. The error happens on the rsc.OpenRecordSet... line. BadgeV is a number, I have the ... | TITLE:
.openrecordsource "run-time error '91'"
QUESTION:
I'm having an issue with the following lines of code, I feel its something simple but I can't put my finger on it. I get a Run-time error '91' object variable or with block variable not set error. The error happens on the rsc.OpenRecordSet... line. BadgeV is a n... | [
"sql",
"sql-server-2008",
"ms-access",
"vba"
] | 2 | 3 | 1,111 | 1 | 0 | 2011-06-01T16:27:07.173000 | 2011-06-01T16:32:19.877000 |
6,204,539 | 6,206,015 | Out of process COM server works fine in the unit test harness but not in the real service | We have a WCF service hosted in IIS that currently calls a VB6 DLL to do part of its job. This works fine, but we can't deploy the service to a 64-bit target environment without configuring IIS to run it in a 32-bit worker process. I am currently investigating ways around that restriction. Porting the VB6 DLL to.NET is... | Your error is an Unauthorized access exception. Therefore, the problem is probably rights related. You could check what the security context of the 32bit worker process is. Also check your event log, they may be information there about what account is being used. | Out of process COM server works fine in the unit test harness but not in the real service We have a WCF service hosted in IIS that currently calls a VB6 DLL to do part of its job. This works fine, but we can't deploy the service to a 64-bit target environment without configuring IIS to run it in a 32-bit worker process... | TITLE:
Out of process COM server works fine in the unit test harness but not in the real service
QUESTION:
We have a WCF service hosted in IIS that currently calls a VB6 DLL to do part of its job. This works fine, but we can't deploy the service to a 64-bit target environment without configuring IIS to run it in a 32-... | [
"vb.net",
"wcf",
"iis",
"vb6",
"com-interop"
] | 1 | 2 | 497 | 1 | 0 | 2011-06-01T16:27:37.940000 | 2011-06-01T18:34:50.633000 |
6,204,541 | 6,205,188 | jquery toggle/show hide | I have following markup which is generated dynamically using C# in my asp.net MVC2 application. There could be more rows depending on data in database. I have shown two rows. one is view row other is edit row. by default I want 'view' row(s) visible and rows with id 'edit' will be invisible. I want to use jQuery so tha... | So, assuming you make the following changes: Wrap your rows in cells to conform to a table format. Use class names instead of IDs (as I mentioned in a comment, an ID must be unique across the entire page). fix your anchor tags to include some form of text. (Some of these may just be becuase you posted a demo snippet, I... | jquery toggle/show hide I have following markup which is generated dynamically using C# in my asp.net MVC2 application. There could be more rows depending on data in database. I have shown two rows. one is view row other is edit row. by default I want 'view' row(s) visible and rows with id 'edit' will be invisible. I w... | TITLE:
jquery toggle/show hide
QUESTION:
I have following markup which is generated dynamically using C# in my asp.net MVC2 application. There could be more rows depending on data in database. I have shown two rows. one is view row other is edit row. by default I want 'view' row(s) visible and rows with id 'edit' will... | [
"javascript",
"jquery",
"asp.net"
] | 1 | 0 | 4,925 | 5 | 0 | 2011-06-01T16:27:41.783000 | 2011-06-01T17:21:16.320000 |
6,204,554 | 6,204,791 | Can we use google Maps street view in ipad programming With annotations and other features of mapkit? | i was unable to implement google maps street view in my ipad.I was wondering if there is any way to implement google street view in ipad with all the features of mapkit. i already tried it with java script but no success. thanks in advance... | Street view uses Flash in the browser (not available on iOS) and is a custom job in the Maps app. It's not available for use. Send your users to the location in the Maps app using a maps URL and let them get Street View themselves. Edit But... Here's a URL that will help you get images from Street View, but in the proc... | Can we use google Maps street view in ipad programming With annotations and other features of mapkit? i was unable to implement google maps street view in my ipad.I was wondering if there is any way to implement google street view in ipad with all the features of mapkit. i already tried it with java script but no succe... | TITLE:
Can we use google Maps street view in ipad programming With annotations and other features of mapkit?
QUESTION:
i was unable to implement google maps street view in my ipad.I was wondering if there is any way to implement google street view in ipad with all the features of mapkit. i already tried it with java s... | [
"iphone",
"objective-c",
"ipad"
] | 1 | 2 | 878 | 1 | 0 | 2011-06-01T16:29:10.077000 | 2011-06-01T16:48:16.823000 |
6,204,561 | 6,204,706 | Storing lots of small files: archive vs. filesystem | I am creating an application that requires a lot of image thumbnails (~3000, 5-25KB). Because speed is essential I plan on loading these images into memory when the application starts. At runtime, new thumbnails will be downloaded and added to the collective. I could store them all in a folder, but reading thousands of... | Small files don't compress especially well, so you may not gain much compression. While loading the files will be fast because they are smaller, decompression adds time. You'd have to experiment to see which is faster. I would think the real issues would relate to the efficiency of the file system when it comes to iter... | Storing lots of small files: archive vs. filesystem I am creating an application that requires a lot of image thumbnails (~3000, 5-25KB). Because speed is essential I plan on loading these images into memory when the application starts. At runtime, new thumbnails will be downloaded and added to the collective. I could ... | TITLE:
Storing lots of small files: archive vs. filesystem
QUESTION:
I am creating an application that requires a lot of image thumbnails (~3000, 5-25KB). Because speed is essential I plan on loading these images into memory when the application starts. At runtime, new thumbnails will be downloaded and added to the co... | [
"java",
"performance",
"caching",
"storage"
] | 3 | 1 | 3,482 | 6 | 0 | 2011-06-01T16:29:40.153000 | 2011-06-01T16:41:41.290000 |
6,204,562 | 6,204,599 | java regex to filter out non-English text | I found a few references to regex filtering out non-English but none of them is in Java, aside from the fact that they are all referring to somewhat different problems than what I am trying to solve: Replace all non-English characters with a space. Create a method that returns true if a string contains any non-English ... | In fact, so simple that I suspect that I am missing something... Do you spot any caveats in the above? \W is equivalent to [^\w], and \w is equivalent to [a-zA-Z_0-9]. Using \W will replace everything which isn't a letter, a number, or an underscore — like tabs and newline characters. Whether or not that's a problem is... | java regex to filter out non-English text I found a few references to regex filtering out non-English but none of them is in Java, aside from the fact that they are all referring to somewhat different problems than what I am trying to solve: Replace all non-English characters with a space. Create a method that returns ... | TITLE:
java regex to filter out non-English text
QUESTION:
I found a few references to regex filtering out non-English but none of them is in Java, aside from the fact that they are all referring to somewhat different problems than what I am trying to solve: Replace all non-English characters with a space. Create a me... | [
"java",
"regex"
] | 2 | 5 | 15,724 | 4 | 0 | 2011-06-01T16:29:43.797000 | 2011-06-01T16:32:54.820000 |
6,204,566 | 6,218,001 | How to include required jars in project while using Maven? | I am new to Maven and using it to build a project on my local. This is working nicely on my local. Now, I want to run the same project on my server and the server does not have Maven installed. So I wanted to ask if there is any way by which, when I build a Maven project on my local, I could include all the required ja... | You can use the Maven Assembly Plugin. From the documentation: The Assembly Plugin for Maven is primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable archive. | How to include required jars in project while using Maven? I am new to Maven and using it to build a project on my local. This is working nicely on my local. Now, I want to run the same project on my server and the server does not have Maven installed. So I wanted to ask if there is any way by which, when I build a Mav... | TITLE:
How to include required jars in project while using Maven?
QUESTION:
I am new to Maven and using it to build a project on my local. This is working nicely on my local. Now, I want to run the same project on my server and the server does not have Maven installed. So I wanted to ask if there is any way by which, ... | [
"maven-2",
"maven",
"maven-3"
] | 2 | 0 | 228 | 1 | 0 | 2011-06-01T16:30:19.223000 | 2011-06-02T17:31:13.007000 |
6,204,569 | 6,204,940 | "cacher layer" for google-generated images | The question is prompted by comment to an earlier question of mine. I've never heard of a cacher layer. The suggestion was to cache google-generated images in this cacher-layer thingie. Can someone give the a pointer to the details of such a layer? "Details" = where does it live? how do I access it? and more. Thanks so... | I will explain what I meant. First of all I needed this system because Google Chart API has some requests-daily CAP so I needed something to bypass it. The engine was pretty simple. Consider the vanilla solution: in your HTML you have your img' src directly poiniting to google. With a cacher you will not point directly... | "cacher layer" for google-generated images The question is prompted by comment to an earlier question of mine. I've never heard of a cacher layer. The suggestion was to cache google-generated images in this cacher-layer thingie. Can someone give the a pointer to the details of such a layer? "Details" = where does it li... | TITLE:
"cacher layer" for google-generated images
QUESTION:
The question is prompted by comment to an earlier question of mine. I've never heard of a cacher layer. The suggestion was to cache google-generated images in this cacher-layer thingie. Can someone give the a pointer to the details of such a layer? "Details" ... | [
"image",
"caching"
] | 0 | 1 | 228 | 1 | 0 | 2011-06-01T16:30:40.517000 | 2011-06-01T17:00:52.167000 |
6,204,572 | 6,204,618 | Is there a Subversion command to reset the working copy? | Is there a single Subversion command that would “reset” a working copy exactly to the state that’s stored in the repository? Something like git reset --hard or (ha, hard Git reset does not remove unversioned files either!) rm -rf wc && svn co wc. Update: I’m not after a simple revert, as that does not delete extra file... | You can recursively revert like this: svn revert --recursive. There is no way (without writing a creative script) to remove things that aren't under source control. I think the closest you could do is to iterate over all of the files, use then grep the result of svn list, and if the grep fails, then delete it. EDIT: Th... | Is there a Subversion command to reset the working copy? Is there a single Subversion command that would “reset” a working copy exactly to the state that’s stored in the repository? Something like git reset --hard or (ha, hard Git reset does not remove unversioned files either!) rm -rf wc && svn co wc. Update: I’m not ... | TITLE:
Is there a Subversion command to reset the working copy?
QUESTION:
Is there a single Subversion command that would “reset” a working copy exactly to the state that’s stored in the repository? Something like git reset --hard or (ha, hard Git reset does not remove unversioned files either!) rm -rf wc && svn co wc... | [
"svn"
] | 132 | 198 | 127,622 | 9 | 0 | 2011-06-01T16:30:53.373000 | 2011-06-01T16:34:31.660000 |
6,204,576 | 6,215,497 | How do I prevent the creation of a new property in a Luabind class? | I'm using Luabind to bind C++ classes to Lua. From the Lua script, I can add arbitrary properties (key/value pairs) to the tables that represent my classes, even if I never told Luabind these properties exist: cheese = Cheese() cheese.type = "gouda" cheese.age = 2 cheese.hippopotamus = "monkey" -- Oops! This member was... | I don't speak from experience, but here are some email threads from the luabind-user mailing list: first, a monologue by a guy trying to do exactly what you want. Second, somewhat old (Nov 2009) email from the luabind maintainer, stating that providing custom __newindex metamethod is not currently possible, but planned... | How do I prevent the creation of a new property in a Luabind class? I'm using Luabind to bind C++ classes to Lua. From the Lua script, I can add arbitrary properties (key/value pairs) to the tables that represent my classes, even if I never told Luabind these properties exist: cheese = Cheese() cheese.type = "gouda" ch... | TITLE:
How do I prevent the creation of a new property in a Luabind class?
QUESTION:
I'm using Luabind to bind C++ classes to Lua. From the Lua script, I can add arbitrary properties (key/value pairs) to the tables that represent my classes, even if I never told Luabind these properties exist: cheese = Cheese() cheese... | [
"c++",
"lua",
"luabind"
] | 3 | 1 | 214 | 1 | 0 | 2011-06-01T16:31:07.023000 | 2011-06-02T13:54:47.420000 |
6,204,584 | 6,216,933 | how can i use javafx 2.0 palette in netbeans? | i install javafx2.0 plugin on netbeans 7.0 but i can't see the palette. if netbeans 7 has palette for javafx 2.0 similar to javafx 1.x? | No, it doesn't have any pallets just project type support and code completion and the samples. From my usage of it so far | how can i use javafx 2.0 palette in netbeans? i install javafx2.0 plugin on netbeans 7.0 but i can't see the palette. if netbeans 7 has palette for javafx 2.0 similar to javafx 1.x? | TITLE:
how can i use javafx 2.0 palette in netbeans?
QUESTION:
i install javafx2.0 plugin on netbeans 7.0 but i can't see the palette. if netbeans 7 has palette for javafx 2.0 similar to javafx 1.x?
ANSWER:
No, it doesn't have any pallets just project type support and code completion and the samples. From my usage of... | [
"java",
"javafx-2"
] | 1 | 1 | 3,392 | 3 | 0 | 2011-06-01T16:31:48.753000 | 2011-06-02T15:52:23.993000 |
6,204,590 | 6,204,682 | How to convert a link in a textarea into a link-element using php? | I was creating a script and it includes a posting script but I want users to directly copy a link from anywhere else and when they post it the link text should automatically convert the link to link-element ( ). So for example this: Ask this on http://stackoverflow.com now to become Ask this on http://stackoverflow.com... | There are several solutions out there for this, most of them being poorly written and incomplete. In this situation I would advise to use an already existing solution of one of the big frameworks, there is no need to reinvent the wheel. For example, this article on Zenverse describes the way WordPress handles this. Let... | How to convert a link in a textarea into a link-element using php? I was creating a script and it includes a posting script but I want users to directly copy a link from anywhere else and when they post it the link text should automatically convert the link to link-element ( ). So for example this: Ask this on http://s... | TITLE:
How to convert a link in a textarea into a link-element using php?
QUESTION:
I was creating a script and it includes a posting script but I want users to directly copy a link from anywhere else and when they post it the link text should automatically convert the link to link-element ( ). So for example this: As... | [
"php",
"html",
"string"
] | 4 | 4 | 4,942 | 2 | 0 | 2011-06-01T16:32:19.067000 | 2011-06-01T16:39:06.343000 |
6,204,597 | 6,204,616 | SQL Comparison on Aggregate function | When I run the following SQL in ACCESS 2007 Select Location, COUNT(ApartmentBuildings) AS TotalIBuildingsManaged From Apartments Where COUNT(ApartmentBuildings) > 3 Group By Location Order By COUNT(ApartmentBuildings) DESC; I get the following error: Cannot have aggregate function in where clause. How should I be formi... | Use having instead of where: Select Location, COUNT(ApartmentBuildings) AS TotalIBuildingsManaged From Apartments Group By Location Having COUNT(ApartmentBuildings) > 3 Order By COUNT(ApartmentBuildings) DESC; for more information see this page | SQL Comparison on Aggregate function When I run the following SQL in ACCESS 2007 Select Location, COUNT(ApartmentBuildings) AS TotalIBuildingsManaged From Apartments Where COUNT(ApartmentBuildings) > 3 Group By Location Order By COUNT(ApartmentBuildings) DESC; I get the following error: Cannot have aggregate function i... | TITLE:
SQL Comparison on Aggregate function
QUESTION:
When I run the following SQL in ACCESS 2007 Select Location, COUNT(ApartmentBuildings) AS TotalIBuildingsManaged From Apartments Where COUNT(ApartmentBuildings) > 3 Group By Location Order By COUNT(ApartmentBuildings) DESC; I get the following error: Cannot have ag... | [
"sql",
"ms-access"
] | 4 | 5 | 5,125 | 2 | 0 | 2011-06-01T16:32:38.927000 | 2011-06-01T16:34:29.613000 |
6,204,609 | 6,206,483 | How to pass property of embedded control for binding path? | I have custom control with nested (custom) control. I would like to get the property from the nested control and pass it to converter of main control. Here is my code: The second parameter is passed correctly, but the first one is not -- no matter what I do I get only DependencyProperty.UnsetValue. Firstly I had PageIn... | Chances are you are not properly adding the Button as a logical child of the NavPane. Basically, you should call AddLogicalChild on your NavPane for each item added to your UpperSlot collection. You should also call RemoveLogicalChild for anything removed from your collection. Finally, you need to override LogicalChild... | How to pass property of embedded control for binding path? I have custom control with nested (custom) control. I would like to get the property from the nested control and pass it to converter of main control. Here is my code: The second parameter is passed correctly, but the first one is not -- no matter what I do I g... | TITLE:
How to pass property of embedded control for binding path?
QUESTION:
I have custom control with nested (custom) control. I would like to get the property from the nested control and pass it to converter of main control. Here is my code: The second parameter is passed correctly, but the first one is not -- no ma... | [
"c#",
"wpf",
"xaml",
"binding",
"properties"
] | 2 | 1 | 459 | 1 | 0 | 2011-06-01T16:33:41.157000 | 2011-06-01T19:17:40.347000 |
6,204,612 | 6,204,643 | is it bad practice to parameters through a string of functions? | im building a reasonably large JS application and i wanted to get your opinions on some of the logic. i wanted to know if its considered bad practice to pass a parameter through a string of functions e.g. function start(){ var param1 = 'me'; secondFunction(param1); }
function secondFunction(param1){ //i dont want to u... | Actually, that's good practice because it avoids having any global state (i.e. ideally, the behaviour of a function would only depend on its parameters). If you have many parameters to be passed through this way, I'd batch them together in a separate object (an 'environment' object) but apart from that it's totally fin... | is it bad practice to parameters through a string of functions? im building a reasonably large JS application and i wanted to get your opinions on some of the logic. i wanted to know if its considered bad practice to pass a parameter through a string of functions e.g. function start(){ var param1 = 'me'; secondFunction... | TITLE:
is it bad practice to parameters through a string of functions?
QUESTION:
im building a reasonably large JS application and i wanted to get your opinions on some of the logic. i wanted to know if its considered bad practice to pass a parameter through a string of functions e.g. function start(){ var param1 = 'm... | [
"parameters",
"javascript"
] | 4 | 7 | 970 | 10 | 0 | 2011-06-01T16:34:10.307000 | 2011-06-01T16:36:41.397000 |
6,204,615 | 6,204,674 | How do I define a generic member variable in an enum? | I want to reference an enum method to retrieve the class of an algorithm so that I can lazy-load a new instance of the algorithm for use in the strategy design pattern. In this example, I am using an enum to reference three different strategy classes that calculate Fibonacci numbers: RecursiveFibonacciGenerator, Iterat... | public enum Algorithm { RECURSIVE(FibonacciGenerator.RecursiveFibonacciGenerator.class), ITERATIVE(FibonacciGenerator.IterativeFibonacciGenerator.class), MEMOIZED(FibonacciGenerator.MemoizedFibonacciGenerator.class);
private final Class algorithmClass;
private Algorithm(Class algorithmClass) { this.algorithmClass = a... | How do I define a generic member variable in an enum? I want to reference an enum method to retrieve the class of an algorithm so that I can lazy-load a new instance of the algorithm for use in the strategy design pattern. In this example, I am using an enum to reference three different strategy classes that calculate ... | TITLE:
How do I define a generic member variable in an enum?
QUESTION:
I want to reference an enum method to retrieve the class of an algorithm so that I can lazy-load a new instance of the algorithm for use in the strategy design pattern. In this example, I am using an enum to reference three different strategy class... | [
"java",
"generics",
"enums"
] | 4 | 7 | 4,797 | 5 | 0 | 2011-06-01T16:34:28.007000 | 2011-06-01T16:38:43.627000 |
6,204,621 | 6,218,183 | Sending an HTTP request using QNetworkAccessManager | I've got a problem trying to send a request using QNetworkAccessManager from a QObject derived class. Firstly in my constructor I do the following: QObject::connect( &mAccessManager, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( requestFinished( QNetworkReply* ) ) ); Then when I wish to send the request I do the fo... | Ok so it turns out the problem is caused byt the fact that Qt does not include SSL support by default. http://doc.qt.nokia.com/4.7/ssl.html | Sending an HTTP request using QNetworkAccessManager I've got a problem trying to send a request using QNetworkAccessManager from a QObject derived class. Firstly in my constructor I do the following: QObject::connect( &mAccessManager, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( requestFinished( QNetworkReply* ) )... | TITLE:
Sending an HTTP request using QNetworkAccessManager
QUESTION:
I've got a problem trying to send a request using QNetworkAccessManager from a QObject derived class. Firstly in my constructor I do the following: QObject::connect( &mAccessManager, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( requestFinished( ... | [
"c++",
"qt",
"post",
"https",
"qnetworkaccessmanager"
] | 0 | 0 | 11,480 | 3 | 0 | 2011-06-01T16:34:48.517000 | 2011-06-02T17:45:31.733000 |
6,204,622 | 6,216,196 | MJPEG Stream from iPhone to Server | I am writing an app to make an MJPEG-Stream from the iPhone to the Server. My problem is that the JPEG's I see are a weird collection of colored lines. I can post the specific code if more information is needed. These are the Steps: Get the frames via AVCaptureVideoDataOutput Convert them to an UIImage Get NSData UIIma... | I'm finally finished with this app. My problem was that I converted the DatagrammPacket.getBytes() first to a String and wrote it rather than with writeBytes(). Now I'm writing the bytes directly with the OutputStream. | MJPEG Stream from iPhone to Server I am writing an app to make an MJPEG-Stream from the iPhone to the Server. My problem is that the JPEG's I see are a weird collection of colored lines. I can post the specific code if more information is needed. These are the Steps: Get the frames via AVCaptureVideoDataOutput Convert ... | TITLE:
MJPEG Stream from iPhone to Server
QUESTION:
I am writing an app to make an MJPEG-Stream from the iPhone to the Server. My problem is that the JPEG's I see are a weird collection of colored lines. I can post the specific code if more information is needed. These are the Steps: Get the frames via AVCaptureVideoD... | [
"iphone",
"sockets",
"stream",
"uiimage",
"jpeg"
] | 0 | 0 | 2,182 | 1 | 0 | 2011-06-01T16:34:57.010000 | 2011-06-02T14:52:11.377000 |
6,204,624 | 6,217,539 | Difficulty Manipulating QSlider in a QGridLayout | I'm trying to create a dynamic QSlider that accepts a QVector of integer values and maps them underneath the QSlider relative to what position they represent. Here's a screenshot of what I have now: My Slider http://dev.kyleswebspace.com/images/QInteractiveSlider.jpg As you can see, the ticks don't line up with their v... | I'm not sure that a grid layout is the best way to go about this. Firstly, I would let the slider take care of itself - in a layout. And then the big job would be to place the labels where they should go. Instead of using a layout for this, I would just parent the labels to the parent QWidget and then call QWidget::mov... | Difficulty Manipulating QSlider in a QGridLayout I'm trying to create a dynamic QSlider that accepts a QVector of integer values and maps them underneath the QSlider relative to what position they represent. Here's a screenshot of what I have now: My Slider http://dev.kyleswebspace.com/images/QInteractiveSlider.jpg As ... | TITLE:
Difficulty Manipulating QSlider in a QGridLayout
QUESTION:
I'm trying to create a dynamic QSlider that accepts a QVector of integer values and maps them underneath the QSlider relative to what position they represent. Here's a screenshot of what I have now: My Slider http://dev.kyleswebspace.com/images/QInterac... | [
"qt",
"qt4",
"qslider"
] | 2 | 1 | 3,631 | 3 | 0 | 2011-06-01T16:35:04.713000 | 2011-06-02T16:47:18.997000 |
6,204,630 | 6,204,690 | Problem inserting array data into database | Would someone please have at look at the code below, which is to process data submitted via a form and insert this data into a MySQL database. ` I used a form builder called JotForm to build my form and when the form is submitted it sends the data to my process.php script above. The problem is I can't get some of this ... | You are not sending anything into the $sql statement. $_POST['name'], for example, is empty. To debug in the future, print out $sql for examination. $name=mysql_real_escape_string(serialize($_POST['fullname15'])); $bdate=mysql_real_escape_string(serialize($_POST['birthdate19'])); $email=mysql_real_escape_string(seriali... | Problem inserting array data into database Would someone please have at look at the code below, which is to process data submitted via a form and insert this data into a MySQL database. ` I used a form builder called JotForm to build my form and when the form is submitted it sends the data to my process.php script abov... | TITLE:
Problem inserting array data into database
QUESTION:
Would someone please have at look at the code below, which is to process data submitted via a form and insert this data into a MySQL database. ` I used a form builder called JotForm to build my form and when the form is submitted it sends the data to my proce... | [
"php",
"mysql",
"arrays",
"forms",
"serialization"
] | 1 | 3 | 581 | 1 | 0 | 2011-06-01T16:35:20.190000 | 2011-06-01T16:39:59.750000 |
6,204,632 | 6,204,656 | swap fails in case of int and works in case of string | #include #include #include int main() { std::string str1 = "good", str2 = "luck"; swap(str1,str2); /*Line A*/ int x = 5, y= 3; swap(x,y); /*Line B*/ } If I comment Line B the code compiles(http://www.ideone.com/hbHwf) whereas commenting Line A the code fails to compile(http://www.ideone.com/odHka) and I get the followi... | swap(str1, str2) works because of Argument dependent lookup P.S: Pitfalls of ADL | swap fails in case of int and works in case of string #include #include #include int main() { std::string str1 = "good", str2 = "luck"; swap(str1,str2); /*Line A*/ int x = 5, y= 3; swap(x,y); /*Line B*/ } If I comment Line B the code compiles(http://www.ideone.com/hbHwf) whereas commenting Line A the code fails to comp... | TITLE:
swap fails in case of int and works in case of string
QUESTION:
#include #include #include int main() { std::string str1 = "good", str2 = "luck"; swap(str1,str2); /*Line A*/ int x = 5, y= 3; swap(x,y); /*Line B*/ } If I comment Line B the code compiles(http://www.ideone.com/hbHwf) whereas commenting Line A the ... | [
"c++",
"swap"
] | 4 | 7 | 3,892 | 4 | 0 | 2011-06-01T16:35:23.767000 | 2011-06-01T16:37:46.183000 |
6,204,634 | 6,205,035 | How can I show a Notification Area Balloon and Icon from a Windows Service? | I have a Windows Service that is always running when the user starts their workstation. This Windows Service is critical and I would like to show a Balloon Notification in the Notification Area when certain things happen such as the Service Stops, Starts, Restarts etc. For example: Also, is there a way to show a Notifi... | The days of Windows services interacting directly with the desktop are over, so you have to find another way. What I have done is create a normal WinForms application that includes a NotifyIcon. The behavior of this application mimics that of Task Manager, such that it can be hidden from the task bar and only visible i... | How can I show a Notification Area Balloon and Icon from a Windows Service? I have a Windows Service that is always running when the user starts their workstation. This Windows Service is critical and I would like to show a Balloon Notification in the Notification Area when certain things happen such as the Service Sto... | TITLE:
How can I show a Notification Area Balloon and Icon from a Windows Service?
QUESTION:
I have a Windows Service that is always running when the user starts their workstation. This Windows Service is critical and I would like to show a Balloon Notification in the Notification Area when certain things happen such ... | [
"c#",
"windows-services",
"notifications",
"notification-area"
] | 6 | 12 | 22,304 | 3 | 0 | 2011-06-01T16:35:46.017000 | 2011-06-01T17:07:26.767000 |
6,204,638 | 6,204,727 | redirect to root_path | My route has root set to: root:to => "posts#index",:locale =>:en But /en/posts/ and /en/posts/index is still accessible, showing "duplicate" content from the root_path. I would like to redirect to root_path, if one of those paths is used. That way, I can avoid duplicate content in search engines and my users have a mor... | You can turn off the posts/index url by editing the posts resource in your routes.rb file to look like this: resources:posts,:except =>:index If this gives you issues with redirection, read the rails guides on routing, specifically section 3.12 Redirection | redirect to root_path My route has root set to: root:to => "posts#index",:locale =>:en But /en/posts/ and /en/posts/index is still accessible, showing "duplicate" content from the root_path. I would like to redirect to root_path, if one of those paths is used. That way, I can avoid duplicate content in search engines a... | TITLE:
redirect to root_path
QUESTION:
My route has root set to: root:to => "posts#index",:locale =>:en But /en/posts/ and /en/posts/index is still accessible, showing "duplicate" content from the root_path. I would like to redirect to root_path, if one of those paths is used. That way, I can avoid duplicate content i... | [
"ruby-on-rails-3",
"rest",
"routes"
] | 1 | 1 | 2,161 | 2 | 0 | 2011-06-01T16:36:14.753000 | 2011-06-01T16:42:45.507000 |
6,204,641 | 6,223,738 | applicationContext in Config.groovy | is possible access the applicationContext in the config file?! What I`m trying to do is get the full path(server path) for my app! Pretty much I want is: /usr/tomcat/myapp/web-inf | If @Ben's getRealPath() solution does not do the trick, try to piece together absolute path based on catalina base property: def path = System.getProperty("catalina.base") + 'relative/path/to/app' | applicationContext in Config.groovy is possible access the applicationContext in the config file?! What I`m trying to do is get the full path(server path) for my app! Pretty much I want is: /usr/tomcat/myapp/web-inf | TITLE:
applicationContext in Config.groovy
QUESTION:
is possible access the applicationContext in the config file?! What I`m trying to do is get the full path(server path) for my app! Pretty much I want is: /usr/tomcat/myapp/web-inf
ANSWER:
If @Ben's getRealPath() solution does not do the trick, try to piece together... | [
"grails",
"groovy",
"config"
] | 0 | 1 | 1,244 | 2 | 0 | 2011-06-01T16:36:30.983000 | 2011-06-03T06:31:30.413000 |
6,204,646 | 6,204,966 | Android: ImageSwitcher getImageId() | Have a question. I'm using image switcher, and this is the way how I set Image to switcher... imageSwitcher.setImageResource(some_image_id); So the question is: How to get image id that is set to image switcher? I cannot find method like imageSwitcher.getImageId(); Thanks... | ImageSwitcher is a derived class from ViewAnimator, so you can use: android.widget.ViewAnimator#getDisplayedChild () to get the index of the currently displayed child view, or: android.widget.ViewAnimator#getCurrentView () to get the View corresponding to the currently displayed child. If you look at the source code, s... | Android: ImageSwitcher getImageId() Have a question. I'm using image switcher, and this is the way how I set Image to switcher... imageSwitcher.setImageResource(some_image_id); So the question is: How to get image id that is set to image switcher? I cannot find method like imageSwitcher.getImageId(); Thanks... | TITLE:
Android: ImageSwitcher getImageId()
QUESTION:
Have a question. I'm using image switcher, and this is the way how I set Image to switcher... imageSwitcher.setImageResource(some_image_id); So the question is: How to get image id that is set to image switcher? I cannot find method like imageSwitcher.getImageId(); ... | [
"android"
] | 0 | 1 | 1,551 | 1 | 0 | 2011-06-01T16:36:50.237000 | 2011-06-01T17:02:52.383000 |
6,204,673 | 6,205,003 | Multiple Primary Keys Table - Hibernate NonUniqueObjectException | I have a table with 2 primary keys (so the combination of both of them should be unique). The schema is like this: TABLE="INVOICE_LOGS" INVOICE_NUMBER PK non-null INVOICE_TYPE PK non-null AMOUNT When I try to persist multiple records at a time, I get this hibernate exception: Caused by: javax.persistence.PersistenceExc... | Your current mapping has a single Id, invoiceNumber, not a compound key. As such, it'll demand that the invoiceNumber be unique, not the combination you want. That's what the exception is telling you, it's noticing you're trying to save a second record with the same Id value. You need to map the two fields as a composi... | Multiple Primary Keys Table - Hibernate NonUniqueObjectException I have a table with 2 primary keys (so the combination of both of them should be unique). The schema is like this: TABLE="INVOICE_LOGS" INVOICE_NUMBER PK non-null INVOICE_TYPE PK non-null AMOUNT When I try to persist multiple records at a time, I get this... | TITLE:
Multiple Primary Keys Table - Hibernate NonUniqueObjectException
QUESTION:
I have a table with 2 primary keys (so the combination of both of them should be unique). The schema is like this: TABLE="INVOICE_LOGS" INVOICE_NUMBER PK non-null INVOICE_TYPE PK non-null AMOUNT When I try to persist multiple records at ... | [
"java",
"oracle",
"hibernate",
"primary-key"
] | 1 | 3 | 8,676 | 1 | 0 | 2011-06-01T16:38:43.330000 | 2011-06-01T17:05:24.223000 |
6,204,675 | 6,205,229 | JSON String parsing in javascript? | I'm using ajax to make a request on a servletand receive json String servlet code //Server Side protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setHeader("Content-Type", "text/html;charset=UTF-8"); PrintWriter out = response.getWrit... | I just saw that you output the following header in your servlet: response.setHeader("Content-Type", "text/html;charset=UTF-8"); Try changing the content type to application/json. | JSON String parsing in javascript? I'm using ajax to make a request on a servletand receive json String servlet code //Server Side protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setHeader("Content-Type", "text/html;charset=UTF-8");... | TITLE:
JSON String parsing in javascript?
QUESTION:
I'm using ajax to make a request on a servletand receive json String servlet code //Server Side protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setHeader("Content-Type", "text/htm... | [
"javascript",
"ajax",
"json"
] | 1 | 3 | 2,241 | 3 | 0 | 2011-06-01T16:38:43.800000 | 2011-06-01T17:24:08.070000 |
6,204,679 | 6,205,113 | c++ functional programming ( boost::phoenix && boost::spirit) testing for null-ptrs in pointer placeholders | So, I have the following spirit karma rule body: base_rule = eps(_r1!= 0) [ // _r1 is a pointer_typed placeholder eps ]; which leads to a rather long error message from g++ which (helpfully) ends with: /opt/dev_64_swat/Boost/include/boost/spirit/home/phoenix/operator/comparison.hpp:37:5: error: ISO C++ forbids comparis... | Using implicit pointer-to- bool conversion, as suggested in my comment, works for me out of the box with Boost 1.46.1. The following is a minimal repro wherein parse succeeds if (and only if) p!= 0 && input == "not null" or p == 0 && input == "null": #include #include #include #include #include #include namespace spiri... | c++ functional programming ( boost::phoenix && boost::spirit) testing for null-ptrs in pointer placeholders So, I have the following spirit karma rule body: base_rule = eps(_r1!= 0) [ // _r1 is a pointer_typed placeholder eps ]; which leads to a rather long error message from g++ which (helpfully) ends with: /opt/dev_6... | TITLE:
c++ functional programming ( boost::phoenix && boost::spirit) testing for null-ptrs in pointer placeholders
QUESTION:
So, I have the following spirit karma rule body: base_rule = eps(_r1!= 0) [ // _r1 is a pointer_typed placeholder eps ]; which leads to a rather long error message from g++ which (helpfully) end... | [
"c++",
"boost",
"boost-spirit",
"boost-phoenix",
"null-pointer"
] | 0 | 2 | 647 | 2 | 0 | 2011-06-01T16:38:58.620000 | 2011-06-01T17:14:15.957000 |
6,204,681 | 6,204,709 | Switch Case not working | $("select[name=program]").change(function () { switch ($("select[name=program]").val()) { case 'Women\'s': $("tr#levelCheck").html( " Level " + " " + " " + " Senior " + " Junior " + " " + " " ); default: $("tr#levelCheck").html(""); } }); Here is my html Program {html_options name="program" output="$program" values="$p... | You need a break before your default case. Right now, you build the menu and then you fall into the default case and your HTML is cleared. $("select[name=program]").change(function () { switch ($("select[name=program]").val()) { case 'Women\'s': $("tr#levelCheck").html( " Level " + " " + " " + " Senior " + " Junior " +... | Switch Case not working $("select[name=program]").change(function () { switch ($("select[name=program]").val()) { case 'Women\'s': $("tr#levelCheck").html( " Level " + " " + " " + " Senior " + " Junior " + " " + " " ); default: $("tr#levelCheck").html(""); } }); Here is my html Program {html_options name="program" outp... | TITLE:
Switch Case not working
QUESTION:
$("select[name=program]").change(function () { switch ($("select[name=program]").val()) { case 'Women\'s': $("tr#levelCheck").html( " Level " + " " + " " + " Senior " + " Junior " + " " + " " ); default: $("tr#levelCheck").html(""); } }); Here is my html Program {html_options n... | [
"jquery"
] | 0 | 6 | 741 | 1 | 0 | 2011-06-01T16:39:05.157000 | 2011-06-01T16:41:49.710000 |
6,204,688 | 6,204,736 | SQL - Select between 3 tables | I have 3 tables: hosts (host_id, name, address, template_id); hostgroup (hostgroup_id, name); hosts_hostgroup (a, b); The first table keeps all the hosts, the second one all the groups and the last one says which group belong each host. Note that hosts_hostgroup has two different column names a and b. Which is the Quer... | SELECT h.* FROM hosts h INNER JOIN hosts_hostgroup hg ON hg.host_id = h.host_id INNER JOIN hostgroup g ON g.hostgroup_id = hg.hostgroup_id WHERE g.name = 'mygroupname' | SQL - Select between 3 tables I have 3 tables: hosts (host_id, name, address, template_id); hostgroup (hostgroup_id, name); hosts_hostgroup (a, b); The first table keeps all the hosts, the second one all the groups and the last one says which group belong each host. Note that hosts_hostgroup has two different column na... | TITLE:
SQL - Select between 3 tables
QUESTION:
I have 3 tables: hosts (host_id, name, address, template_id); hostgroup (hostgroup_id, name); hosts_hostgroup (a, b); The first table keeps all the hosts, the second one all the groups and the last one says which group belong each host. Note that hosts_hostgroup has two d... | [
"sql",
"database"
] | 0 | 2 | 162 | 2 | 0 | 2011-06-01T16:39:55.123000 | 2011-06-01T16:43:21.903000 |
6,204,692 | 6,207,095 | XMLHttpRequest: Double TCP SYN within a millisecond in Internet Explorer 9 | the XMLHttpRequest object causes two TCP SYN Packets when I try to send some POST data. This happens in less than a millisecond. I cannot reproduce this behavior in any other browser (tested with the latest Firefox and Google Chrome browser). Even the 'asynch' Flag or timeout setting does not seem to change the situati... | Just an idea, you could try adding a Connection: close header in all server responses to make sure the browser is starting a new tcp connection for every request. | XMLHttpRequest: Double TCP SYN within a millisecond in Internet Explorer 9 the XMLHttpRequest object causes two TCP SYN Packets when I try to send some POST data. This happens in less than a millisecond. I cannot reproduce this behavior in any other browser (tested with the latest Firefox and Google Chrome browser). Ev... | TITLE:
XMLHttpRequest: Double TCP SYN within a millisecond in Internet Explorer 9
QUESTION:
the XMLHttpRequest object causes two TCP SYN Packets when I try to send some POST data. This happens in less than a millisecond. I cannot reproduce this behavior in any other browser (tested with the latest Firefox and Google C... | [
"xmlhttprequest",
"webserver",
"internet-explorer-9",
"embeddedwebserver"
] | 3 | 1 | 2,361 | 2 | 0 | 2011-06-01T16:40:06.870000 | 2011-06-01T20:14:56.070000 |
6,204,696 | 6,204,780 | Custom uitableviewcell or scrollview with customviews? | I need to have some sort of scrollview which is a grid 3 x n where n is determined by the result of a call to a URL. I was wondering whether a Tableview with custom tableviewcells or a scrollview with my custom views would best serve this purpose? Any pros and cons or links to help would be great. Many thanks Jules | The choice really depends on how you want them to scroll. If the 3 columns are to be linked, and scrolled all at once, then I definitely vote for custom UITableViewCells. This reduces memory usage. The iOS UITableView implementation only keeps the currently visible cells in memory, so if you have 500 rows, you don't ha... | Custom uitableviewcell or scrollview with customviews? I need to have some sort of scrollview which is a grid 3 x n where n is determined by the result of a call to a URL. I was wondering whether a Tableview with custom tableviewcells or a scrollview with my custom views would best serve this purpose? Any pros and cons... | TITLE:
Custom uitableviewcell or scrollview with customviews?
QUESTION:
I need to have some sort of scrollview which is a grid 3 x n where n is determined by the result of a call to a URL. I was wondering whether a Tableview with custom tableviewcells or a scrollview with my custom views would best serve this purpose?... | [
"iphone",
"uitableview",
"uiscrollview"
] | 0 | 1 | 242 | 1 | 0 | 2011-06-01T16:40:23.890000 | 2011-06-01T16:47:00.317000 |
6,204,701 | 6,205,691 | Jquery ajax return exception(Request format is invalid) | I have following code snippet in which I want to return value from ajax.but I am getting following exception Request format is invalid [WebMethod] [ScriptMethod(ResponseFormat=ResponseFormat.Json)] public string HelloWorld(string name) { return "Hello World"+name; }
$(document).ready(function () { function checkUser2(... | I figured out the issue.Below is the complete source code(no changes in webservice) <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %> | Jquery ajax return exception(Request format is invalid) I have following code snippet in which I want to return value from ajax.but I am getting following exception Request format is invalid [WebMethod] [ScriptMethod(ResponseFormat=ResponseFormat.Json)] public string HelloWorld(string name) { return "Hello World"+name;... | TITLE:
Jquery ajax return exception(Request format is invalid)
QUESTION:
I have following code snippet in which I want to return value from ajax.but I am getting following exception Request format is invalid [WebMethod] [ScriptMethod(ResponseFormat=ResponseFormat.Json)] public string HelloWorld(string name) { return "... | [
"c#",
"jquery",
"asp.net",
"ajax"
] | 1 | 1 | 2,423 | 3 | 0 | 2011-06-01T16:40:40.073000 | 2011-06-01T18:04:51.983000 |
6,204,702 | 6,205,238 | JQUery: Filter select elements from a .map query | I'm sure this has been answered here but I just don't know how to word the question. I am getting all of the elements of a form using: //get all form elements $("#" + thisForm + ":input").map(function () {
//get element data var elementName = $(this).attr('name'); var elementType = $(this).attr('type'); and then stori... | If the returned elementType is undefined, you can try getting the tagName property (plain Javascript HTMLElement property) which will return the name of the tag itself (like select, textarea, etc.). So you can do something like: var elementType = $(this).attr('type'); if (typeof elementType == 'undefined') { elementTyp... | JQUery: Filter select elements from a .map query I'm sure this has been answered here but I just don't know how to word the question. I am getting all of the elements of a form using: //get all form elements $("#" + thisForm + ":input").map(function () {
//get element data var elementName = $(this).attr('name'); var e... | TITLE:
JQUery: Filter select elements from a .map query
QUESTION:
I'm sure this has been answered here but I just don't know how to word the question. I am getting all of the elements of a form using: //get all form elements $("#" + thisForm + ":input").map(function () {
//get element data var elementName = $(this).a... | [
"jquery",
"arrays",
"forms",
"html"
] | 0 | 1 | 387 | 1 | 0 | 2011-06-01T16:40:43.090000 | 2011-06-01T17:24:43.727000 |
6,204,710 | 6,204,871 | How to request List<T> data or any other data from the Controller | I need to render a DropDown list and I don't want to pass list's values to the View as a part of the model. Basically what I'm trying to do looks like that: @{ var roles = Html.Action("GetRoles"); var selectList = from r in roles select new SelectListItem { Selected = (r.Id == Model.DefaultRole.Id), Text = r.RoleName, ... | Put it in the ViewBag. In your controller you can do this: ViewBag.selectList = from r in roles select new SelectListItem { Selected = (r.Id == Model.DefaultRole.Id), Text = r.RoleName, Value = r.Id.ToString(), }; Then in your View simply change your DropDownList to this: @Html.DropDownList("roles", ViewBag.selectList)... | How to request List<T> data or any other data from the Controller I need to render a DropDown list and I don't want to pass list's values to the View as a part of the model. Basically what I'm trying to do looks like that: @{ var roles = Html.Action("GetRoles"); var selectList = from r in roles select new SelectListIte... | TITLE:
How to request List<T> data or any other data from the Controller
QUESTION:
I need to render a DropDown list and I don't want to pass list's values to the View as a part of the model. Basically what I'm trying to do looks like that: @{ var roles = Html.Action("GetRoles"); var selectList = from r in roles select... | [
"asp.net-mvc-3",
"drop-down-menu",
"controller",
"actionmethod"
] | 0 | 1 | 255 | 1 | 0 | 2011-06-01T16:41:51.257000 | 2011-06-01T16:56:11.703000 |
6,204,711 | 6,204,829 | Google Maps API V3 - Javascript Issue | I have create a site embedded Google mapusing api V3 that shows our 4 offices, you can then type your postcode and check the distance between you and an office, this works! I want to now create a radial search, I've found how to do it online, which is great and am on the final hurdle and this is where I need your help ... | Might help to make sure it is a number, not a string. distance1 = parseFloat(document.getElementById("distance").value); (parseInt would probably work fine as well, since it is in meters and fractional meters won't make much difference) | Google Maps API V3 - Javascript Issue I have create a site embedded Google mapusing api V3 that shows our 4 offices, you can then type your postcode and check the distance between you and an office, this works! I want to now create a radial search, I've found how to do it online, which is great and am on the final hurd... | TITLE:
Google Maps API V3 - Javascript Issue
QUESTION:
I have create a site embedded Google mapusing api V3 that shows our 4 offices, you can then type your postcode and check the distance between you and an office, this works! I want to now create a radial search, I've found how to do it online, which is great and am... | [
"javascript",
"google-maps-api-3"
] | 0 | 1 | 587 | 1 | 0 | 2011-06-01T16:41:52.167000 | 2011-06-01T16:51:55.227000 |
6,204,718 | 6,204,970 | Status code 0 on Google geocode API from iPhone/sim, but works fine on web (Non English characters) | Try: http://maps.googleapis.com/maps/api/geocode/json?address =Őrbottyán,Hungary&sensor=true On an iPhone 4 & simulator, -(void)requestFailed:(ASIHTTPRequest *)request { NSLog(@"geocode fail code: %d",[request responseStatusCode]); NSLog(@"geocoding failed: %@",[request responseString]); } 2011-06-01 11:36:27.343 app[1... | At some point in your code you're probably using the NSURL class, and: The NSURL class will fail to create a new NSURL object if the path being passed is not well-formed—the path must comply with RFC 2396. Examples of cases that will not succeed are strings containing space characters and high-bit characters. Should cr... | Status code 0 on Google geocode API from iPhone/sim, but works fine on web (Non English characters) Try: http://maps.googleapis.com/maps/api/geocode/json?address =Őrbottyán,Hungary&sensor=true On an iPhone 4 & simulator, -(void)requestFailed:(ASIHTTPRequest *)request { NSLog(@"geocode fail code: %d",[request responseSt... | TITLE:
Status code 0 on Google geocode API from iPhone/sim, but works fine on web (Non English characters)
QUESTION:
Try: http://maps.googleapis.com/maps/api/geocode/json?address =Őrbottyán,Hungary&sensor=true On an iPhone 4 & simulator, -(void)requestFailed:(ASIHTTPRequest *)request { NSLog(@"geocode fail code: %d",[... | [
"iphone",
"geocoding",
"google-api",
"reverse-geocoding"
] | 2 | 9 | 3,811 | 1 | 0 | 2011-06-01T16:42:18.667000 | 2011-06-01T17:03:05.007000 |
6,204,731 | 6,204,919 | Add Logout Button To be visible everywhere in an iPhone application | I am building an iPhone application that requires the user to enter his credentials in order to use the application and can sign out in any moment. I have used UITabBarController to navigate through my views, now I need to add a Logout button in a way that it is available/visible all the time. Can anybody suggest a sol... | Can you spare a tab bar item for that? It seems like the most clean way. Then you can use tabBarController:didSelectViewController: method of the UITabBarControllerDelegate. something like this (assuming that the logout tab is the 5th tab) - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewCon... | Add Logout Button To be visible everywhere in an iPhone application I am building an iPhone application that requires the user to enter his credentials in order to use the application and can sign out in any moment. I have used UITabBarController to navigate through my views, now I need to add a Logout button in a way ... | TITLE:
Add Logout Button To be visible everywhere in an iPhone application
QUESTION:
I am building an iPhone application that requires the user to enter his credentials in order to use the application and can sign out in any moment. I have used UITabBarController to navigate through my views, now I need to add a Logou... | [
"iphone",
"user-interface",
"user-experience"
] | 0 | 1 | 1,432 | 3 | 0 | 2011-06-01T15:58:28.600000 | 2011-06-01T16:59:19.627000 |
6,204,748 | 6,204,788 | Android: go back to previous activity? | Is there a way I can force the user to go back to the previous Activity? I'd like to kill my current Activity make the user "go back" possible? | Call finish in your Activity: http://d.android.com/reference/android/app/Activity.html#finish() And to make sure you started your activity correctly to have the state in the Activity Stack, check the documentation there: http://d.android.com/guide/topics/fundamentals/tasks-and-back-stack.html | Android: go back to previous activity? Is there a way I can force the user to go back to the previous Activity? I'd like to kill my current Activity make the user "go back" possible? | TITLE:
Android: go back to previous activity?
QUESTION:
Is there a way I can force the user to go back to the previous Activity? I'd like to kill my current Activity make the user "go back" possible?
ANSWER:
Call finish in your Activity: http://d.android.com/reference/android/app/Activity.html#finish() And to make su... | [
"android"
] | 4 | 12 | 10,588 | 3 | 0 | 2011-06-01T16:44:32.720000 | 2011-06-01T16:47:51.550000 |
6,204,749 | 6,204,839 | The right way to implement a progressbar in C# | I'm learning winforms and I have set myself a simple goal of making a progressbar that goes from empty to full. Here's my misshapen attempt: public partial class Form1: Form { static BackgroundWorker bw = new BackgroundWorker();
public Form1() { InitializeComponent(); bw.DoWork += bw_DoWork; bw.RunWorkerAsync(); }
vo... | You are already doing it almost right. The BackgroundWorker has a built in mechanism for reporting progress already. public Form1() { bw1.WorkerReportsProgress = true; bw1.ProgressChanged += bw1_ProgressChanged; bw1.DoWork += bw1_DoWork;
bw1.RunWorkerAsync(); }
private void bw1_DoWork(object sender, DoWorkEventArgs e... | The right way to implement a progressbar in C# I'm learning winforms and I have set myself a simple goal of making a progressbar that goes from empty to full. Here's my misshapen attempt: public partial class Form1: Form { static BackgroundWorker bw = new BackgroundWorker();
public Form1() { InitializeComponent(); bw.... | TITLE:
The right way to implement a progressbar in C#
QUESTION:
I'm learning winforms and I have set myself a simple goal of making a progressbar that goes from empty to full. Here's my misshapen attempt: public partial class Form1: Form { static BackgroundWorker bw = new BackgroundWorker();
public Form1() { Initiali... | [
"c#",
"winforms",
"multithreading",
"backgroundworker"
] | 4 | 7 | 14,004 | 3 | 0 | 2011-06-01T16:44:38.103000 | 2011-06-01T16:52:35.090000 |
6,204,759 | 6,204,790 | how to count new lines in a very big string? | The problem reduces to counting \n characters, so is there a function that can do it on a huge strings, since explode() wastes too much memory. | substr_count should do the trick: substr_count( $your_string, "\n" ); | how to count new lines in a very big string? The problem reduces to counting \n characters, so is there a function that can do it on a huge strings, since explode() wastes too much memory. | TITLE:
how to count new lines in a very big string?
QUESTION:
The problem reduces to counting \n characters, so is there a function that can do it on a huge strings, since explode() wastes too much memory.
ANSWER:
substr_count should do the trick: substr_count( $your_string, "\n" ); | [
"php",
"string",
"count"
] | 62 | 115 | 43,716 | 4 | 0 | 2011-06-01T16:45:44.483000 | 2011-06-01T16:48:06.667000 |
6,204,771 | 6,204,799 | How does serialization work without constructors? | I'm not sure how this piece of code works. [Serializable] class Blah { public Blah(int value) { this.value = value; }
public int value; }
BinaryFormatter b = new BinaryFormatter(); Blah blah = new Blah(4); MemoryStream s = new MemoryStream(); b.Serialize(s, blah); s.Seek(0, SeekOrigin.Begin); blah = null; blah = (Bla... | The deserialization process uses FormatterServices.GetUninitializedObject which gets an object without calling any constructor. | How does serialization work without constructors? I'm not sure how this piece of code works. [Serializable] class Blah { public Blah(int value) { this.value = value; }
public int value; }
BinaryFormatter b = new BinaryFormatter(); Blah blah = new Blah(4); MemoryStream s = new MemoryStream(); b.Serialize(s, blah); s.S... | TITLE:
How does serialization work without constructors?
QUESTION:
I'm not sure how this piece of code works. [Serializable] class Blah { public Blah(int value) { this.value = value; }
public int value; }
BinaryFormatter b = new BinaryFormatter(); Blah blah = new Blah(4); MemoryStream s = new MemoryStream(); b.Seria... | [
".net",
"serialization"
] | 4 | 5 | 142 | 3 | 0 | 2011-06-01T16:46:14.930000 | 2011-06-01T16:49:05.553000 |
6,204,778 | 6,207,624 | windowWillReturnFieldEditor never called for NSTextView | Per protocol ref, windowWillReturnFieldEditor should be called for any text-displaying object when it needs a field editor. Indeed, my window delegate receives a call to this method for textfields, buttons, comboboxes, etc. — but never for textviews. Is this normal? Does NSTextView carry its own field editor and never ... | Drats. Looking at memory addresses of the field editors, it is apparent that every textview does indeed have its own distinct field editor (unlike the textfields, which share a common field editor), and so textviews never request a field editor and never call this method. Which is unfortunate, since I need special rout... | windowWillReturnFieldEditor never called for NSTextView Per protocol ref, windowWillReturnFieldEditor should be called for any text-displaying object when it needs a field editor. Indeed, my window delegate receives a call to this method for textfields, buttons, comboboxes, etc. — but never for textviews. Is this norma... | TITLE:
windowWillReturnFieldEditor never called for NSTextView
QUESTION:
Per protocol ref, windowWillReturnFieldEditor should be called for any text-displaying object when it needs a field editor. Indeed, my window delegate receives a call to this method for textfields, buttons, comboboxes, etc. — but never for textvi... | [
"cocoa",
"delegates",
"nswindow",
"nstextview"
] | 2 | 1 | 726 | 1 | 0 | 2011-06-01T16:46:48.113000 | 2011-06-01T20:59:11.947000 |
6,204,783 | 6,205,886 | How do you open a file line by line in phonegap? | I'm looking to do some pretty data-intensive stuff using phonegap. The first thing I looked at was to stream-read a JSON file line by line to collect the data needed. Unfortunately, I can't seem to find a way. Is there a memory-effective way of stream-reading a file from phonegap? John. | What you are trying to do is currently not possible with the standard phonegap api. Files are written completely into a DOMString right now. If you really need this you can take a look into writing a phonegap plugin that returns files by line. Here the link to the wiki to get you starting writing plugins: http://wiki.p... | How do you open a file line by line in phonegap? I'm looking to do some pretty data-intensive stuff using phonegap. The first thing I looked at was to stream-read a JSON file line by line to collect the data needed. Unfortunately, I can't seem to find a way. Is there a memory-effective way of stream-reading a file from... | TITLE:
How do you open a file line by line in phonegap?
QUESTION:
I'm looking to do some pretty data-intensive stuff using phonegap. The first thing I looked at was to stream-read a JSON file line by line to collect the data needed. Unfortunately, I can't seem to find a way. Is there a memory-effective way of stream-r... | [
"javascript",
"iphone",
"file-io",
"cordova",
"streamreader"
] | 1 | 1 | 649 | 1 | 0 | 2011-06-01T16:47:17.270000 | 2011-06-01T18:23:03.213000 |
6,204,786 | 6,205,291 | boost::uuids::random_generator and uniqueness with multiple threads | When I generate the random number with single thread, no duplicate in 4M uuids generated but if I generate with two threads each 1M, I see roughly 16-20 duplicates. What could be the reason? class TestUuid { public: std::string GenerateUUid(){ boost::uuids::uuid uid; { boost::mutex::scoped_lock(m_mRandomGen); uid = m_o... | This is a common error when using RAII locks: you forgot to give your lock a name in the line boost::mutex::scoped_lock(m_mRandomGen); so it didn't lock anything at all. Change it to boost::mutex::scoped_lock lk(m_mRandonGen); // note the typo in mutex name EDIT: what really happened: There was no compiler error despit... | boost::uuids::random_generator and uniqueness with multiple threads When I generate the random number with single thread, no duplicate in 4M uuids generated but if I generate with two threads each 1M, I see roughly 16-20 duplicates. What could be the reason? class TestUuid { public: std::string GenerateUUid(){ boost::u... | TITLE:
boost::uuids::random_generator and uniqueness with multiple threads
QUESTION:
When I generate the random number with single thread, no duplicate in 4M uuids generated but if I generate with two threads each 1M, I see roughly 16-20 duplicates. What could be the reason? class TestUuid { public: std::string Genera... | [
"c++",
"boost",
"thread-safety",
"boost-uuid"
] | 9 | 12 | 3,983 | 1 | 0 | 2011-06-01T16:47:44.243000 | 2011-06-01T17:28:59.653000 |
6,204,797 | 6,205,579 | Adapting Shake Code from 'Beginning Iphone 4 Development' Causing Crash | The code below is a near replica of the Shake and Bake example from Beginning Iphone 4 Development. It is lacking a BOOL if statement before CMAcceleration acceleration = accelerometerData.acceleration; because I want the person to shake and refresh the results as many times as they want. I have a button that executes ... | You are trying to create and display an alert view on a thread other than the main thread. UI updates are to be done in the main thread only. You should use performSelectorOnMainThread:withObject:waitUntilDone: to create and display on the main thread. You can always add a request your UI updates like this – dispatch_a... | Adapting Shake Code from 'Beginning Iphone 4 Development' Causing Crash The code below is a near replica of the Shake and Bake example from Beginning Iphone 4 Development. It is lacking a BOOL if statement before CMAcceleration acceleration = accelerometerData.acceleration; because I want the person to shake and refres... | TITLE:
Adapting Shake Code from 'Beginning Iphone 4 Development' Causing Crash
QUESTION:
The code below is a near replica of the Shake and Bake example from Beginning Iphone 4 Development. It is lacking a BOOL if statement before CMAcceleration acceleration = accelerometerData.acceleration; because I want the person t... | [
"objective-c",
"shake",
"core-motion"
] | 1 | 1 | 1,553 | 2 | 0 | 2011-06-01T16:48:47.397000 | 2011-06-01T17:55:36.017000 |
6,204,801 | 6,206,113 | Storage of thousands of files in Rails | I am working on a Rails app which relies on large collections (1000's of files) of 50MB+ TIFF files. The trouble I'm having is determining how to handle the processing. In an older version of the app, the user had to specify a path (to preferably a mounted SAN drive in the server) in the config file, which became the r... | Instead of directly referencing a local PATH on the server where Rails app is running, it is better to use Capistrano to deploy your application, and symlink a folder under public to your file root. For example, in rails root: ln -fs /var/lib/huge_file_collection public/files Then Rails app will always have a consisten... | Storage of thousands of files in Rails I am working on a Rails app which relies on large collections (1000's of files) of 50MB+ TIFF files. The trouble I'm having is determining how to handle the processing. In an older version of the app, the user had to specify a path (to preferably a mounted SAN drive in the server)... | TITLE:
Storage of thousands of files in Rails
QUESTION:
I am working on a Rails app which relies on large collections (1000's of files) of 50MB+ TIFF files. The trouble I'm having is determining how to handle the processing. In an older version of the app, the user had to specify a path (to preferably a mounted SAN dr... | [
"ruby-on-rails",
"file",
"upload",
"storage"
] | 0 | 1 | 585 | 1 | 0 | 2011-06-01T16:49:23.017000 | 2011-06-01T18:43:33.343000 |
6,204,807 | 6,204,960 | how to see docs for jsf/facelets elements in eclipse | I am using helios 3.6.2. I have an.xhtml opened with Web Page Editor... when ever I hover over an element,e.g. f:view, I only see: Element: f:view rather than the description which suppose to be the following according to the tld: Creates a JSF View, which is a container that holds all of the components that are part o... | That depends on plugins used. Current Eclipse version (Helios) indeed doesn't support this out the box ( update: this is definitely supported since Kepler which is the first Eclipse version with builtin JSF 2.0 support). When you're using for example Glassfish 3 and use the Glassfish server plugin and the project has G... | how to see docs for jsf/facelets elements in eclipse I am using helios 3.6.2. I have an.xhtml opened with Web Page Editor... when ever I hover over an element,e.g. f:view, I only see: Element: f:view rather than the description which suppose to be the following according to the tld: Creates a JSF View, which is a conta... | TITLE:
how to see docs for jsf/facelets elements in eclipse
QUESTION:
I am using helios 3.6.2. I have an.xhtml opened with Web Page Editor... when ever I hover over an element,e.g. f:view, I only see: Element: f:view rather than the description which suppose to be the following according to the tld: Creates a JSF View... | [
"eclipse",
"jsf",
"tags",
"facelets"
] | 4 | 5 | 2,413 | 1 | 0 | 2011-06-01T16:50:01.487000 | 2011-06-01T17:02:16.770000 |
6,204,827 | 6,205,624 | XML Parsing too slow! | I wrote a java app to communicate with a web application using XML. After deployment, I found out it takes too long to parse the XML generated by the web application. For example, it takes about 2 minutes to login; the login information is included in the url. The web application does its processing and responds to the... | Using a standard XML parser a short message should be parsed in about one milli-second. Using a custom parser you can cut this to about 20 micro-seconds. Any time longer than this is not in the XML parsing | XML Parsing too slow! I wrote a java app to communicate with a web application using XML. After deployment, I found out it takes too long to parse the XML generated by the web application. For example, it takes about 2 minutes to login; the login information is included in the url. The web application does its processi... | TITLE:
XML Parsing too slow!
QUESTION:
I wrote a java app to communicate with a web application using XML. After deployment, I found out it takes too long to parse the XML generated by the web application. For example, it takes about 2 minutes to login; the login information is included in the url. The web application... | [
"java",
"xml",
"parsing",
"optimization",
"xml-parsing"
] | 9 | 3 | 12,218 | 4 | 0 | 2011-06-01T16:51:43.513000 | 2011-06-01T17:59:29.200000 |
6,204,832 | 6,204,857 | YouTube download link generator in Python | How to convert something like http://www.youtube.com/watch?v=ZYffV7qhvTc into something like http://something.flv [the downloadable file of corresponding video] in Python? | youtube-dl. On the command line: youtube-dl -g http://www.youtube.com/watch?v=ZYffV7qhvTc If you want it in pure Python, have a look at the source code and call download with the appropriate setup. | YouTube download link generator in Python How to convert something like http://www.youtube.com/watch?v=ZYffV7qhvTc into something like http://something.flv [the downloadable file of corresponding video] in Python? | TITLE:
YouTube download link generator in Python
QUESTION:
How to convert something like http://www.youtube.com/watch?v=ZYffV7qhvTc into something like http://something.flv [the downloadable file of corresponding video] in Python?
ANSWER:
youtube-dl. On the command line: youtube-dl -g http://www.youtube.com/watch?v=Z... | [
"python",
"youtube"
] | 5 | 5 | 3,392 | 1 | 0 | 2011-06-01T16:52:01.483000 | 2011-06-01T16:54:36.567000 |
6,204,834 | 6,205,036 | heap vs data segment vs stack allocation | Am looking at the following program and not sure how the memory is allocated and why: void function() { char text1[] = "SomeText"; const char* text2 = "Some Text"; char *text = (char*) malloc(strlen("Some Text") + 1 ); } In the above code, the last one is obviously in the heap. However, as I understand text2 is in the ... | // Array allocated on the stack and initialized with "SomeText" string. // It has automatic storage duration. You shouldn't care about freeing memory. char text1[] = "SomeText";
// Pointer to the constant string "Some Text". // It has static storage duration. You shouldn't care about freeing memory. // Note that it sh... | heap vs data segment vs stack allocation Am looking at the following program and not sure how the memory is allocated and why: void function() { char text1[] = "SomeText"; const char* text2 = "Some Text"; char *text = (char*) malloc(strlen("Some Text") + 1 ); } In the above code, the last one is obviously in the heap. ... | TITLE:
heap vs data segment vs stack allocation
QUESTION:
Am looking at the following program and not sure how the memory is allocated and why: void function() { char text1[] = "SomeText"; const char* text2 = "Some Text"; char *text = (char*) malloc(strlen("Some Text") + 1 ); } In the above code, the last one is obvio... | [
"c++",
"heap-memory",
"stack-memory"
] | 16 | 19 | 8,230 | 2 | 0 | 2011-06-01T16:52:20.473000 | 2011-06-01T17:07:29.993000 |
6,204,838 | 6,204,868 | jQuery addClass() not working given an ID | I have the following jQuery code: $.ajax({ type: "POST", url: "/search", data: $("form").serialize(), success: function(data) { $("#tab").addClass("loading"); // THIS LINE DOESN'T WORK //... LOAD SEARCH RESULTS HERE (USUALLY TAKES SEVERAL SECONDS)... $("#tab").removeClass("loading"); } }); And I have the following CSS:... | Try this instead. What's probably happening is that it's adding and removing the loading class quickly enough that it steps on itself // add the class before the ajax call $("#tab").addClass("loading");
$.ajax({ type: "POST", url: "/search", data: $("form").serialize(), success: function(data) { //... LOAD SEARCH RESU... | jQuery addClass() not working given an ID I have the following jQuery code: $.ajax({ type: "POST", url: "/search", data: $("form").serialize(), success: function(data) { $("#tab").addClass("loading"); // THIS LINE DOESN'T WORK //... LOAD SEARCH RESULTS HERE (USUALLY TAKES SEVERAL SECONDS)... $("#tab").removeClass("load... | TITLE:
jQuery addClass() not working given an ID
QUESTION:
I have the following jQuery code: $.ajax({ type: "POST", url: "/search", data: $("form").serialize(), success: function(data) { $("#tab").addClass("loading"); // THIS LINE DOESN'T WORK //... LOAD SEARCH RESULTS HERE (USUALLY TAKES SEVERAL SECONDS)... $("#tab")... | [
"jquery"
] | 1 | 4 | 1,263 | 4 | 0 | 2011-06-01T16:52:34.713000 | 2011-06-01T16:55:40.797000 |
6,204,843 | 6,206,271 | Could not load file or assembly 'MSHTML, Version=4.0.0.0, | So I am working on a ASP.NET/C# application. It basically scrapes a certain website based on some parameters. I open my project and try to run it. It seems to work fine until I try to actually scrape the site I get this error: Could not load file or assembly 'MSHTML, Version=4.0.0.0, Culture=neutral, PublicKeyToken=nul... | So I removed the reference to the DLL and added again. It seems to be working now. | Could not load file or assembly 'MSHTML, Version=4.0.0.0, So I am working on a ASP.NET/C# application. It basically scrapes a certain website based on some parameters. I open my project and try to run it. It seems to work fine until I try to actually scrape the site I get this error: Could not load file or assembly 'MS... | TITLE:
Could not load file or assembly 'MSHTML, Version=4.0.0.0,
QUESTION:
So I am working on a ASP.NET/C# application. It basically scrapes a certain website based on some parameters. I open my project and try to run it. It seems to work fine until I try to actually scrape the site I get this error: Could not load fi... | [
"c#",
".net",
"asp.net",
"dll"
] | 0 | 0 | 667 | 1 | 0 | 2011-06-01T16:52:46.180000 | 2011-06-01T18:58:06.807000 |
6,204,846 | 6,206,979 | Trouble in installing fast debugger on Netbeans IDE 6.9 for rails 3.0.1 | I am trying to install the fast debugger on netbeans IDE in ubuntu natty narwahl.I am receiving this error.How can i fix this? Building native extensions. This could take a while... ERROR: Error installing ruby-debug-ide: ERROR: Failed to build gem native extension.
/home/roger/.rvm/rubies/ruby-1.9.2-p180/bin/ruby mkr... | I have found the solution. hit 'gem env' on the command line and take note of the GEM paths (1)GO to project properties. (2)Select Rails (3)Click on 'Manage' button corresponding to the ruby platform (4)Now change the gem paths & home path provided in the netbeans IDE for gems to the one you noted before. This would so... | Trouble in installing fast debugger on Netbeans IDE 6.9 for rails 3.0.1 I am trying to install the fast debugger on netbeans IDE in ubuntu natty narwahl.I am receiving this error.How can i fix this? Building native extensions. This could take a while... ERROR: Error installing ruby-debug-ide: ERROR: Failed to build gem... | TITLE:
Trouble in installing fast debugger on Netbeans IDE 6.9 for rails 3.0.1
QUESTION:
I am trying to install the fast debugger on netbeans IDE in ubuntu natty narwahl.I am receiving this error.How can i fix this? Building native extensions. This could take a while... ERROR: Error installing ruby-debug-ide: ERROR: F... | [
"ruby-on-rails",
"debugging",
"netbeans-6.9",
"ubuntu-11.04"
] | 0 | 1 | 1,475 | 1 | 0 | 2011-06-01T16:53:01.967000 | 2011-06-01T20:04:30.623000 |
6,204,852 | 6,208,494 | Why does Tomcat start with 0.0.0.0:8000 open? | I know the short answer is "You told it to." But of course, I'm not sure how I told Tomcat to start with the 8000 default debug port open, but on 0.0.0.0 instead of the expected 127.0.0.1. Here's a couple of context commands directly after Ubuntu 10.10 boots. $ netstat -lnt Active Internet connections (only servers) Pr... | Time to brush up on RFC4632, memory got rusty. 0.0.0.0 is the default route, and in the case of Tomcat is used to indicate that any IP on port 8000 will be routed into Tomcat (presumably for debugging). To restate, on Tomcat 0.0.0.0:xxxx will route any request with xxxx port into Tomcat. | Why does Tomcat start with 0.0.0.0:8000 open? I know the short answer is "You told it to." But of course, I'm not sure how I told Tomcat to start with the 8000 default debug port open, but on 0.0.0.0 instead of the expected 127.0.0.1. Here's a couple of context commands directly after Ubuntu 10.10 boots. $ netstat -lnt... | TITLE:
Why does Tomcat start with 0.0.0.0:8000 open?
QUESTION:
I know the short answer is "You told it to." But of course, I'm not sure how I told Tomcat to start with the 8000 default debug port open, but on 0.0.0.0 instead of the expected 127.0.0.1. Here's a couple of context commands directly after Ubuntu 10.10 boo... | [
"debugging",
"tomcat",
"ubuntu-10.10",
"jpda"
] | 0 | 2 | 4,373 | 2 | 0 | 2011-06-01T16:54:06.023000 | 2011-06-01T22:30:17.380000 |
6,204,854 | 6,204,925 | How to link multiple HTML pages resides in assets folder in android? | I am new to Android. I want to display HTML pages in android emulator. I put my "test1.html" and "test2.html" files in the "assets" folder and managed to display "test1.html" file in Android by using the following code. package com.example.helloandroid;
import java.io.IOException; import java.io.InputStream;
import a... | Button or Link in test1.html should just work like normal html file. Make sure when you provide the path for test2.html is right with respect to test1.html since they are in assets directory. Edit your code like this Next Page | How to link multiple HTML pages resides in assets folder in android? I am new to Android. I want to display HTML pages in android emulator. I put my "test1.html" and "test2.html" files in the "assets" folder and managed to display "test1.html" file in Android by using the following code. package com.example.helloandroi... | TITLE:
How to link multiple HTML pages resides in assets folder in android?
QUESTION:
I am new to Android. I want to display HTML pages in android emulator. I put my "test1.html" and "test2.html" files in the "assets" folder and managed to display "test1.html" file in Android by using the following code. package com.e... | [
"android",
"html",
"hyperlink"
] | 2 | 2 | 5,619 | 3 | 0 | 2011-06-01T16:54:21.373000 | 2011-06-01T16:59:49.093000 |
6,204,855 | 6,214,265 | IllegalAccessError when adding Rampart to the POM's dependencies | We tried adding Rampart to our module's POM file and after doing so our ear can no longer start with the following exception: java.lang.IllegalAccessError: tried to access method org.apache.log4j.Logger. (Ljava/lang/String;)V from class org.apache.log4j.spi.RootLogger at org.apache.log4j.spi.RootLogger. (RootLogger.jav... | Eventually we modified the pom.xml manually and changed the order of dependencies to put log4j before rampart - which solved the classpath order problem. | IllegalAccessError when adding Rampart to the POM's dependencies We tried adding Rampart to our module's POM file and after doing so our ear can no longer start with the following exception: java.lang.IllegalAccessError: tried to access method org.apache.log4j.Logger. (Ljava/lang/String;)V from class org.apache.log4j.s... | TITLE:
IllegalAccessError when adding Rampart to the POM's dependencies
QUESTION:
We tried adding Rampart to our module's POM file and after doing so our ear can no longer start with the following exception: java.lang.IllegalAccessError: tried to access method org.apache.log4j.Logger. (Ljava/lang/String;)V from class ... | [
"java",
"classpath",
"weblogic-10.x",
"manifest.mf",
"rampart"
] | 0 | 2 | 2,668 | 2 | 0 | 2011-06-01T16:54:31.920000 | 2011-06-02T12:04:25.907000 |
6,204,861 | 6,205,103 | How to remove a particular content inside a div using Hpricot | I have the following html structure asdasdasdas asdasdasdas asdasdasdas asdasdasdas Content to be excluded What I need is, when I search for div id="rn_answertext" I need to get all the contents except that in the div with id=test My current code is result = doc.search("div#rn_answertext").inner_html Anyone please help... | First get the div you want, then find the div inside you'd like to remove: div = (doc/"div#rn_answertext") (div/"#test").remove puts div.to_s | How to remove a particular content inside a div using Hpricot I have the following html structure asdasdasdas asdasdasdas asdasdasdas asdasdasdas Content to be excluded What I need is, when I search for div id="rn_answertext" I need to get all the contents except that in the div with id=test My current code is result =... | TITLE:
How to remove a particular content inside a div using Hpricot
QUESTION:
I have the following html structure asdasdasdas asdasdasdas asdasdasdas asdasdasdas Content to be excluded What I need is, when I search for div id="rn_answertext" I need to get all the contents except that in the div with id=test My curren... | [
"ruby",
"hpricot"
] | 1 | 1 | 224 | 2 | 0 | 2011-06-01T16:55:05.913000 | 2011-06-01T17:13:23.583000 |
6,204,867 | 6,204,939 | Fastest way to remove hyphens from a string | I have IDs that look like: 185-51-671 but they can also have letters at the end, 175-1-7b All I want to do is remove the hyphens, as a pre-processing step. Show me some cool ways to do this in javascript? I figure there are probably quite a few questions like this one, but I'm interested to see what optimizations peopl... | You need to include the global flag: var str="185-51-671"; var newStr = str.replace(/-/g, ""); | Fastest way to remove hyphens from a string I have IDs that look like: 185-51-671 but they can also have letters at the end, 175-1-7b All I want to do is remove the hyphens, as a pre-processing step. Show me some cool ways to do this in javascript? I figure there are probably quite a few questions like this one, but I'... | TITLE:
Fastest way to remove hyphens from a string
QUESTION:
I have IDs that look like: 185-51-671 but they can also have letters at the end, 175-1-7b All I want to do is remove the hyphens, as a pre-processing step. Show me some cool ways to do this in javascript? I figure there are probably quite a few questions lik... | [
"javascript"
] | 94 | 194 | 132,481 | 6 | 0 | 2011-06-01T16:55:36.977000 | 2011-06-01T17:00:50.063000 |
6,204,870 | 6,204,965 | Disable Javascript in TinyMCE | Is there any plug-in/way to disable java-script inside tinymce? I don't want people to allow tags or any inline java-scripts. | Check out the valid_elements option: The valid_elements option defines which elements will remain in the edited text when the editor saves. You can use this to limit the returned HTML to a subset. This option contains a comma separated list of element conversion chunks. Each chunk contains information about how one ele... | Disable Javascript in TinyMCE Is there any plug-in/way to disable java-script inside tinymce? I don't want people to allow tags or any inline java-scripts. | TITLE:
Disable Javascript in TinyMCE
QUESTION:
Is there any plug-in/way to disable java-script inside tinymce? I don't want people to allow tags or any inline java-scripts.
ANSWER:
Check out the valid_elements option: The valid_elements option defines which elements will remain in the edited text when the editor save... | [
"javascript",
"tinymce"
] | 2 | 5 | 7,022 | 2 | 0 | 2011-06-01T16:56:04.167000 | 2011-06-01T17:02:48.943000 |
6,204,874 | 6,205,068 | C# Async WebRequests: OnComplete Event | The following asynchronous C# code runs through a list of 7 URLs and tries to get HTML from each one. Right now I just have it outputting simple debug responses to the console like, "Site HTML", "No Response", or "Bad URL". It seems to work fine, but I need to fire off an event once all 7 queries have been made. How wo... | You can use a CountdownEvent to find out when all the sites have been scanned. It'd be initially set to sites.Count, and then wait on that event. On each completion (either by error, timeout or success) you'd signal the event. When the event count reaches zero, the wait will return and you can have your "OnComplete" ev... | C# Async WebRequests: OnComplete Event The following asynchronous C# code runs through a list of 7 URLs and tries to get HTML from each one. Right now I just have it outputting simple debug responses to the console like, "Site HTML", "No Response", or "Bad URL". It seems to work fine, but I need to fire off an event on... | TITLE:
C# Async WebRequests: OnComplete Event
QUESTION:
The following asynchronous C# code runs through a list of 7 URLs and tries to get HTML from each one. Right now I just have it outputting simple debug responses to the console like, "Site HTML", "No Response", or "Bad URL". It seems to work fine, but I need to fi... | [
"c#",
"asynchronous",
"httpwebrequest"
] | 0 | 0 | 1,718 | 2 | 0 | 2011-06-01T16:56:32.267000 | 2011-06-01T17:09:29.940000 |
6,204,878 | 6,204,900 | Check if a file exists on the server | I am trying to check if a file is on the server with the C# code behind of my ASP.NET web page. I know the file does exist as I put it on the server in a piece of code before hand. Can anyone see why it is not finding the file. This is the code: wordDocName = "~/specifications/" + Convert.ToInt32(ViewState["projectSele... | the file path should be physical not virtual. Use if (File.Exists(Server.MapPath(wordDocName))) | Check if a file exists on the server I am trying to check if a file is on the server with the C# code behind of my ASP.NET web page. I know the file does exist as I put it on the server in a piece of code before hand. Can anyone see why it is not finding the file. This is the code: wordDocName = "~/specifications/" + C... | TITLE:
Check if a file exists on the server
QUESTION:
I am trying to check if a file is on the server with the C# code behind of my ASP.NET web page. I know the file does exist as I put it on the server in a piece of code before hand. Can anyone see why it is not finding the file. This is the code: wordDocName = "~/sp... | [
"c#",
"asp.net",
"file"
] | 16 | 48 | 51,798 | 8 | 0 | 2011-06-01T16:56:39.983000 | 2011-06-01T16:58:08.787000 |
6,204,879 | 6,204,931 | How to reuse a single class within multiple projects, with minor modifications in functionality? | I have a common library where I've put classes that are used between multiple Android projects. However, now I encountered a situation where I have to make minor changes to the functionality of the class in one project. How should I organize the classes, keeping in mind easy readability of code and future extension pos... | Definately 1. Create a library (jar) containing the base class, and then use that jar in the projects that need its base functionality. Each project should provide the specialized class that extends the base. | How to reuse a single class within multiple projects, with minor modifications in functionality? I have a common library where I've put classes that are used between multiple Android projects. However, now I encountered a situation where I have to make minor changes to the functionality of the class in one project. How... | TITLE:
How to reuse a single class within multiple projects, with minor modifications in functionality?
QUESTION:
I have a common library where I've put classes that are used between multiple Android projects. However, now I encountered a situation where I have to make minor changes to the functionality of the class i... | [
"android"
] | 1 | 2 | 290 | 3 | 0 | 2011-06-01T16:56:42.013000 | 2011-06-01T17:00:19.780000 |
6,204,880 | 6,207,577 | GAE: managing dev and production versions of my app | There are a lot of things I need to do before uploading my production app to GAE. Its becoming very tedious and error-prone, and I would like to know some best-practice how to handle following requirements, and if some tools already exist for doing this: Dev and test environment on my local machine: want to use debug v... | So you can detect whether your app is running in dev or production as follows: import os DEV = os.environ['SERVER_SOFTWARE'].startswith('Development') Pass this bool along to your Django templates, and write conditionals when you want behavior to vary: {% if DEV %} {% else %} {% endif %} To handle minification at the l... | GAE: managing dev and production versions of my app There are a lot of things I need to do before uploading my production app to GAE. Its becoming very tedious and error-prone, and I would like to know some best-practice how to handle following requirements, and if some tools already exist for doing this: Dev and test ... | TITLE:
GAE: managing dev and production versions of my app
QUESTION:
There are a lot of things I need to do before uploading my production app to GAE. Its becoming very tedious and error-prone, and I would like to know some best-practice how to handle following requirements, and if some tools already exist for doing t... | [
"google-app-engine"
] | 4 | 2 | 323 | 1 | 0 | 2011-06-01T16:56:42.433000 | 2011-06-01T20:56:23.647000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.