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,296,403
6,296,533
c# Regex question
I have a problem dealing with the @ symbol in Regex, I am trying to remove @sometext from a text string can't seem to find anywhere where it uses the @ as a literal. I have tried myself but doesn't remove the word from the string. Any ideas? public string removeAtSymbol(string input) { Regex findWords = new Regex(_____...
You can remove all occurences of "@sometext" from string test via the method Regex.Replace(test, "@sometext", "") or for any word starting with "@" you can use Regex.Replace(test, "@\\w+", "") If you need specifically a separate word (i.e. nothing like @comp within tom@comp.com ) you may preceed the regex with a specia...
c# Regex question I have a problem dealing with the @ symbol in Regex, I am trying to remove @sometext from a text string can't seem to find anywhere where it uses the @ as a literal. I have tried myself but doesn't remove the word from the string. Any ideas? public string removeAtSymbol(string input) { Regex findWords...
TITLE: c# Regex question QUESTION: I have a problem dealing with the @ symbol in Regex, I am trying to remove @sometext from a text string can't seem to find anywhere where it uses the @ as a literal. I have tried myself but doesn't remove the word from the string. Any ideas? public string removeAtSymbol(string input)...
[ "c#", "regex", "twitter" ]
2
1
279
4
0
2011-06-09T16:49:13.567000
2011-06-09T16:59:26.997000
6,296,414
6,296,448
HTML button that reloads refering page
I have created a HTML error page which has a button with text Try Again. When the user clicks this button I would like to reload the refering page. Looking on Google there are a few ways to do this, but I am unsure of which is the best way that will work in the majority of browsers. Anyone help? Thanks, AJ
Your code that handled the original HTTP request resulting in the error knows that URL, so it should simply create a link back on the error page; just a simple link, or whatever else that's appropriate for your overall site design. Do not rely on the HTTP "REFERER" value.
HTML button that reloads refering page I have created a HTML error page which has a button with text Try Again. When the user clicks this button I would like to reload the refering page. Looking on Google there are a few ways to do this, but I am unsure of which is the best way that will work in the majority of browser...
TITLE: HTML button that reloads refering page QUESTION: I have created a HTML error page which has a button with text Try Again. When the user clicks this button I would like to reload the refering page. Looking on Google there are a few ways to do this, but I am unsure of which is the best way that will work in the m...
[ "javascript", "html" ]
0
2
821
4
0
2011-06-09T16:49:54.830000
2011-06-09T16:53:03.240000
6,296,434
6,296,484
No route matches for something that should be working
I have: <%= button_to 'Remove', remove_attendee_event_path(:event_id => @event.id,:user_id => user.id),:method =>:post %> in one partial and it works fine. Then, in another partial in the same view, I tried to copy/paste this code while changing @event.id to event.id and user.id to current_user.id and it doesn't work. ...
It's not the route it is your object. You are padding nil objects to the method. Check which object is nil with: <%= debug @event %> <%= debug user #most likely this one %> Local variables need to be sent to views like this: <%= render:partial => 'somethign':user => user %>
No route matches for something that should be working I have: <%= button_to 'Remove', remove_attendee_event_path(:event_id => @event.id,:user_id => user.id),:method =>:post %> in one partial and it works fine. Then, in another partial in the same view, I tried to copy/paste this code while changing @event.id to event.i...
TITLE: No route matches for something that should be working QUESTION: I have: <%= button_to 'Remove', remove_attendee_event_path(:event_id => @event.id,:user_id => user.id),:method =>:post %> in one partial and it works fine. Then, in another partial in the same view, I tried to copy/paste this code while changing @e...
[ "ruby-on-rails" ]
1
1
327
2
0
2011-06-09T16:51:38.480000
2011-06-09T16:56:02.053000
6,296,436
6,296,614
Clearing echo text on page refresh
I am designing an image file upload page for a website and, on Submit, the script echoes an 'Upload Successful' message. That all works fine. My problem is that once the success message is on the page, it won't go away! If the user wants to upload another file, I want him to be able to refresh the page and get rid of t...
2 ways I can think of doing what you want. First, put a link back to the upload script underneath your upload successful text. echo ' Upload Successful '; echo ' Upload another file '; The second way involves sending a refresh header which will redirect to the upload page after a few seconds. header( "refresh:3;url=upl...
Clearing echo text on page refresh I am designing an image file upload page for a website and, on Submit, the script echoes an 'Upload Successful' message. That all works fine. My problem is that once the success message is on the page, it won't go away! If the user wants to upload another file, I want him to be able t...
TITLE: Clearing echo text on page refresh QUESTION: I am designing an image file upload page for a website and, on Submit, the script echoes an 'Upload Successful' message. That all works fine. My problem is that once the success message is on the page, it won't go away! If the user wants to upload another file, I wan...
[ "php" ]
1
1
2,870
1
0
2011-06-09T16:51:59.650000
2011-06-09T17:06:32.777000
6,296,447
6,296,568
How to disable outside clicks while an element is visible?
I have a div, divDialog, that contains a simple dialog box. It begins life invisible, but at a certain point I make it visible. The page has several other elements on it (menus, etc.) that have event listeners for the click event. My question is, once divDialog is visible, how can I disable all click events for everyth...
You should place a transparent, fixed div over the window. That way any clicks on the screen will be that div and not elements underneath it. This is popularly used as the background overlay for a modal dialog. In IE, you'll need to make sure there's a!DOCTYPE declared for position:fixed to work. div#overlay { position...
How to disable outside clicks while an element is visible? I have a div, divDialog, that contains a simple dialog box. It begins life invisible, but at a certain point I make it visible. The page has several other elements on it (menus, etc.) that have event listeners for the click event. My question is, once divDialog...
TITLE: How to disable outside clicks while an element is visible? QUESTION: I have a div, divDialog, that contains a simple dialog box. It begins life invisible, but at a certain point I make it visible. The page has several other elements on it (menus, etc.) that have event listeners for the click event. My question ...
[ "javascript", "html", "events", "cross-platform" ]
1
5
4,462
2
0
2011-06-09T16:52:53.527000
2011-06-09T17:02:48.317000
6,296,455
6,298,509
Calculating expectation for a custom distribution in Mathematica
This question builds on the great answers I got on an earlier question: Can one extend the functionality of PDF, CDF, FindDistributionParameters etc in Mathematica? To start I have PDFs and CDFs for two custom distributions: nlDist and dplDist as you can see from the code dplDist builds upon nlDist. nlDist /: PDF[nlDis...
Although you have provided both PDF and CDF for your custom distribution to Mathematica, you have not given the domain, so it does not know boundaries of integration, and in fact whether to integrate or sum. Adding that makes things work: In[8]:= nlDist /: DistributionDomain[nlDist[alpha_, beta_, mu_, sigma_]]:= Interv...
Calculating expectation for a custom distribution in Mathematica This question builds on the great answers I got on an earlier question: Can one extend the functionality of PDF, CDF, FindDistributionParameters etc in Mathematica? To start I have PDFs and CDFs for two custom distributions: nlDist and dplDist as you can ...
TITLE: Calculating expectation for a custom distribution in Mathematica QUESTION: This question builds on the great answers I got on an earlier question: Can one extend the functionality of PDF, CDF, FindDistributionParameters etc in Mathematica? To start I have PDFs and CDFs for two custom distributions: nlDist and d...
[ "statistics", "wolfram-mathematica" ]
4
5
1,625
3
0
2011-06-09T16:53:25.647000
2011-06-09T19:58:28.627000
6,296,458
6,310,115
Question about Rendering a stream in DirectShowNet
currently I have a disfigured avi file that a program of mine creates. I found out that by going into graphedit, i can refigure it correctly. I found that if i do: SourceFile(test1.avi) -> AVI Splitter -> ffdshow video encoder -> AVI Mux -> File Writer i can get a video stream back that is correct. Now I am trying to c...
i put in a piece of code: DsRotEntry m_rot = new DsRotEntry(filter); this allowed me to view my filter i made, in graphedit. what happened was i add the filters but none of them got connected to each other. So then what i did was got each of the filters i added, found the input and output pins associated with them Filt...
Question about Rendering a stream in DirectShowNet currently I have a disfigured avi file that a program of mine creates. I found out that by going into graphedit, i can refigure it correctly. I found that if i do: SourceFile(test1.avi) -> AVI Splitter -> ffdshow video encoder -> AVI Mux -> File Writer i can get a vide...
TITLE: Question about Rendering a stream in DirectShowNet QUESTION: currently I have a disfigured avi file that a program of mine creates. I found out that by going into graphedit, i can refigure it correctly. I found that if i do: SourceFile(test1.avi) -> AVI Splitter -> ffdshow video encoder -> AVI Mux -> File Write...
[ "c#", "directshow", "directshow.net" ]
1
1
2,863
1
0
2011-06-09T16:53:37.997000
2011-06-10T17:41:29.340000
6,296,460
6,296,548
Is it worth additional overhead to add an extra checksum to UDP packets?
I'm working on an application which transfers encrypted files over UDP (yes; I know UDP isn't usually used for file transfer, but this is an edge case), and was wondering if its worth the additional overhead to add an extra checksum to the packet. I know it's not 'likely' that UDP packets will come in corrupted, but wo...
UDP already has a checksum 16 bits, very unlikely that there is a collision, possible in theory. You definitely want partial checksums. If you have a 1TB file that takes a day to transfer and then you get a hash fail, that would make you very sad. Lazy solution: Hash every megabyte or so? Maybe more or less, eyeball it...
Is it worth additional overhead to add an extra checksum to UDP packets? I'm working on an application which transfers encrypted files over UDP (yes; I know UDP isn't usually used for file transfer, but this is an edge case), and was wondering if its worth the additional overhead to add an extra checksum to the packet....
TITLE: Is it worth additional overhead to add an extra checksum to UDP packets? QUESTION: I'm working on an application which transfers encrypted files over UDP (yes; I know UDP isn't usually used for file transfer, but this is an edge case), and was wondering if its worth the additional overhead to add an extra check...
[ "c#", ".net", "networking", "udp" ]
2
1
1,127
7
0
2011-06-09T16:53:49.073000
2011-06-09T17:01:15.127000
6,296,464
6,296,498
Join two queries with COUNT from the same table in MySQL
I have two queries that I run in the same table: SELECT id, COUNT(up) FROM comentarios WHERE up = 1 GROUP BY id And SELECT id, COUNT(down) FROM comentarios WHERE down = 2 GROUP BY id I tried something like this but doesn't work SELECT t1.id, COUNT(t1.up), t2.id, COUNT(t2.down) FROM (SELECT id, up FROM comentarios WHERE...
SELECT id, SUM(CASE WHEN up = 1 THEN 1 ELSE 0 END) AS UpCount, SUM(CASE WHEN down = 2 THEN 1 ELSE 0 END) AS DownCount FROM comentarios GROUP BY id
Join two queries with COUNT from the same table in MySQL I have two queries that I run in the same table: SELECT id, COUNT(up) FROM comentarios WHERE up = 1 GROUP BY id And SELECT id, COUNT(down) FROM comentarios WHERE down = 2 GROUP BY id I tried something like this but doesn't work SELECT t1.id, COUNT(t1.up), t2.id, ...
TITLE: Join two queries with COUNT from the same table in MySQL QUESTION: I have two queries that I run in the same table: SELECT id, COUNT(up) FROM comentarios WHERE up = 1 GROUP BY id And SELECT id, COUNT(down) FROM comentarios WHERE down = 2 GROUP BY id I tried something like this but doesn't work SELECT t1.id, COU...
[ "mysql", "join", "count", "outer-join" ]
0
1
1,904
2
0
2011-06-09T16:54:12.473000
2011-06-09T16:56:54.470000
6,296,473
6,296,532
Regular expression for length only - any characters
I'm trying to regex the contents of a textarea to be between 4 and 138 characters. My regular expression is this: '/^.{4,138}$/' But - I want the user to be able to include return characters, which I believe the "." keeps them from doing. Thoughts on what I need to change? EDIT: Obviously there are other ways to get th...
I want the user to be able to include return characters, which I believe the "." keeps them from doing. Thoughts on what I need to change? Either: change the. to [\s\S] (whitespace/newlines are part of \s, all the rest is part of \S ) use the SINGLE_LINE (a.k.a DOTALL) regex flag /…/s
Regular expression for length only - any characters I'm trying to regex the contents of a textarea to be between 4 and 138 characters. My regular expression is this: '/^.{4,138}$/' But - I want the user to be able to include return characters, which I believe the "." keeps them from doing. Thoughts on what I need to ch...
TITLE: Regular expression for length only - any characters QUESTION: I'm trying to regex the contents of a textarea to be between 4 and 138 characters. My regular expression is this: '/^.{4,138}$/' But - I want the user to be able to include return characters, which I believe the "." keeps them from doing. Thoughts on...
[ "php", "regex" ]
7
7
10,918
4
0
2011-06-09T16:54:50.337000
2011-06-09T16:59:24.253000
6,296,505
6,296,545
Why is Linux msync is returning "Cannot Allocate memory"? Is it possible to fix this error code?
Good afternoon, We are building a prototype deduper for Centos Linux Release x86_32 and Microsoft Windows. One part of the prototype is a MemoryMappedFile program which uses a 1800 element cache. For Centos Linux 5.5 we call msync to synchronize the file with the memory map. For the last several weeks, msync has been f...
The msync man page states: ENOMEM The indicated memory (or part of it) was not mapped. That's the errno value perror() prints for you. So you're somehow trying to msync() memory that you've not mmap()'ed from a file.
Why is Linux msync is returning "Cannot Allocate memory"? Is it possible to fix this error code? Good afternoon, We are building a prototype deduper for Centos Linux Release x86_32 and Microsoft Windows. One part of the prototype is a MemoryMappedFile program which uses a 1800 element cache. For Centos Linux 5.5 we cal...
TITLE: Why is Linux msync is returning "Cannot Allocate memory"? Is it possible to fix this error code? QUESTION: Good afternoon, We are building a prototype deduper for Centos Linux Release x86_32 and Microsoft Windows. One part of the prototype is a MemoryMappedFile program which uses a 1800 element cache. For Cento...
[ "c++", "linux" ]
2
5
1,577
1
0
2011-06-09T16:57:38.553000
2011-06-09T17:01:08.340000
6,296,518
6,296,755
How can I make the ASP.NET MVC mini profiler work with Linq 2 SQL?
The ASP.NET MVC Mini Profiler looks awesome, but I don't get the Linq 2 SQL usage example. This is the Linq2SQL example from the profiler documentation: partial class DBContext { public static DBContext Get() { var conn = ProfiledDbConnection.Get(GetConnection()); return new DBContext(conn); // or: return DataContextUt...
Finally figured it out. In case someone else has the same question: private static DataClassesDataContext CreateNewContext() { var sqlConnection = new SqlConnection( ); var profiledConnection = ProfiledDbConnection.Get(sqlConnection); return DataContextUtils.CreateDataContext (profiledConnection); }
How can I make the ASP.NET MVC mini profiler work with Linq 2 SQL? The ASP.NET MVC Mini Profiler looks awesome, but I don't get the Linq 2 SQL usage example. This is the Linq2SQL example from the profiler documentation: partial class DBContext { public static DBContext Get() { var conn = ProfiledDbConnection.Get(GetCon...
TITLE: How can I make the ASP.NET MVC mini profiler work with Linq 2 SQL? QUESTION: The ASP.NET MVC Mini Profiler looks awesome, but I don't get the Linq 2 SQL usage example. This is the Linq2SQL example from the profiler documentation: partial class DBContext { public static DBContext Get() { var conn = ProfiledDbCon...
[ "asp.net-mvc", "linq-to-sql", "mvc-mini-profiler" ]
18
8
1,675
3
0
2011-06-09T16:58:24.620000
2011-06-09T17:19:36.127000
6,296,539
6,296,565
issue loading properties file
I am having issue with loading test.xml and test.properties inside the same folder conf. I have a myProject.jar inside dist folder and test.xml and test.properties inside conf folder. To load xml, I am using document = reader.read(new File("../conf/test.xml"));//its working But I am having issue when loading properties...
Why don't you take the file and load it using an FileInputStream Properties properties = new Properties(); properties.load(new FileInputStream(fileName)); The above code will take the properties file and load it into a properties object.
issue loading properties file I am having issue with loading test.xml and test.properties inside the same folder conf. I have a myProject.jar inside dist folder and test.xml and test.properties inside conf folder. To load xml, I am using document = reader.read(new File("../conf/test.xml"));//its working But I am having...
TITLE: issue loading properties file QUESTION: I am having issue with loading test.xml and test.properties inside the same folder conf. I have a myProject.jar inside dist folder and test.xml and test.properties inside conf folder. To load xml, I am using document = reader.read(new File("../conf/test.xml"));//its worki...
[ "java" ]
2
6
606
3
0
2011-06-09T17:00:31.843000
2011-06-09T17:02:39.643000
6,296,552
6,296,890
Cocoa: Auto close a status menu
I hava a status menu on the status bar, and I have some tasks running behind the scene. When one of task is done, assume at the time the menu is being showed (dropped down), I want to make the menu to be not in drop down mode (pretend doing a left click on the mouse on the menu icon) automatically. Is there a way to do...
It's there, but the name is a little bit counterintuitive: You want NSMenu's cancelTracking.
Cocoa: Auto close a status menu I hava a status menu on the status bar, and I have some tasks running behind the scene. When one of task is done, assume at the time the menu is being showed (dropped down), I want to make the menu to be not in drop down mode (pretend doing a left click on the mouse on the menu icon) aut...
TITLE: Cocoa: Auto close a status menu QUESTION: I hava a status menu on the status bar, and I have some tasks running behind the scene. When one of task is done, assume at the time the menu is being showed (dropped down), I want to make the menu to be not in drop down mode (pretend doing a left click on the mouse on ...
[ "cocoa", "nsmenu", "nsstatusitem" ]
0
7
989
1
0
2011-06-09T17:01:56.173000
2011-06-09T17:31:01.410000
6,296,555
6,296,894
n-tiers & ORM & how to implement ORM
Usually I'm developing application in tiers (DAL, BLL, UI) using VS.NET 2008 with.net framework 3.5. For data access, I'm using Enterprise Library 4.1 and logging using log4net. I've heard about ORM, and interesting to implement ORM in my programming, how to do that? Is that any impact to the performance? I know 2 ORM,...
It may be worth looking at some of the so called 'micro ORM' solutions such as Dapper, PetaPoco or Massive as alternatives to NHibernate, Subsonic, Linq2Sql, EF, etc. This answer holds some insightful info into the experience of using Subsonic vs PetaPoco.
n-tiers & ORM & how to implement ORM Usually I'm developing application in tiers (DAL, BLL, UI) using VS.NET 2008 with.net framework 3.5. For data access, I'm using Enterprise Library 4.1 and logging using log4net. I've heard about ORM, and interesting to implement ORM in my programming, how to do that? Is that any imp...
TITLE: n-tiers & ORM & how to implement ORM QUESTION: Usually I'm developing application in tiers (DAL, BLL, UI) using VS.NET 2008 with.net framework 3.5. For data access, I'm using Enterprise Library 4.1 and logging using log4net. I've heard about ORM, and interesting to implement ORM in my programming, how to do tha...
[ "c#", "orm", "n-tier-architecture" ]
1
2
924
3
0
2011-06-09T17:02:08.200000
2011-06-09T17:31:10.340000
6,296,557
6,296,591
Alternative to a Filtered Sub-query
I have this query that works as desired, but it seems like there should be a better way to accomplish what I want: SELECT `x`.* FROM ( SELECT `m`.`id`, `m`.`email`, MAX(`s`.`end`) AS `max_end` FROM `members` AS `m` INNER JOIN `memberships` AS `s` ON `m`.`id` = `s`.`member_id` GROUP BY `m`.`id`, `m`.`email` ) AS `x` WHE...
This could be rewritten using having: SELECT `m`.`id`, `m`.`email` FROM `members` AS `m` INNER JOIN `memberships` AS `s` ON `m`.`id` = `s`.`member_id` GROUP BY `m`.`id`, `m`.`email` HAVING MAX(`s`.`end`) = '2010-02-28 23:59:59'
Alternative to a Filtered Sub-query I have this query that works as desired, but it seems like there should be a better way to accomplish what I want: SELECT `x`.* FROM ( SELECT `m`.`id`, `m`.`email`, MAX(`s`.`end`) AS `max_end` FROM `members` AS `m` INNER JOIN `memberships` AS `s` ON `m`.`id` = `s`.`member_id` GROUP B...
TITLE: Alternative to a Filtered Sub-query QUESTION: I have this query that works as desired, but it seems like there should be a better way to accomplish what I want: SELECT `x`.* FROM ( SELECT `m`.`id`, `m`.`email`, MAX(`s`.`end`) AS `max_end` FROM `members` AS `m` INNER JOIN `memberships` AS `s` ON `m`.`id` = `s`.`...
[ "mysql", "subquery" ]
0
2
539
2
0
2011-06-09T17:02:12.853000
2011-06-09T17:04:14.633000
6,296,569
6,296,666
C# ASP.NET MVC Windows Service NULL out Static Instance Properties in Data Layer?
Here is my scenario. I have an ASP.NET MVC solution with 3 projects. Data, Web, and Windows Service. The Data layer has static (non thread safe) properties which goes and gets data once otherwise stores in static private field. See below: private static int? _userCount; public static int UserCount { get { if (!_userCou...
Let me see if I have this straight. You have a library that handles save user, which nulls out a count value. It works in MVC, but not in your windows service, because it is not being seen as null in your MVC application. If I have that correct, let me be more explicit. You have a library to handle users being used by ...
C# ASP.NET MVC Windows Service NULL out Static Instance Properties in Data Layer? Here is my scenario. I have an ASP.NET MVC solution with 3 projects. Data, Web, and Windows Service. The Data layer has static (non thread safe) properties which goes and gets data once otherwise stores in static private field. See below:...
TITLE: C# ASP.NET MVC Windows Service NULL out Static Instance Properties in Data Layer? QUESTION: Here is my scenario. I have an ASP.NET MVC solution with 3 projects. Data, Web, and Windows Service. The Data layer has static (non thread safe) properties which goes and gets data once otherwise stores in static private...
[ "c#", "asp.net", "windows-services", "static" ]
1
2
581
2
0
2011-06-09T17:02:57.263000
2011-06-09T17:11:16.567000
6,296,574
6,296,639
Dynamic favicon using image manipulation similar to Gmail adding a count
I tried to figure it out looking at the source code but I couldn't figure it out. I would like to know how to make a dynamic favicon with a count like Gmail does. Any idea on how to do this?
You can make an image with the canvas element, and then just replace the current favicon. Check out the following link for a good explanation on it. Reference Code is from the above reference. Markup JS (function () { var canvas = document.createElement('canvas'), ctx, img = document.createElement('img'), link = docume...
Dynamic favicon using image manipulation similar to Gmail adding a count I tried to figure it out looking at the source code but I couldn't figure it out. I would like to know how to make a dynamic favicon with a count like Gmail does. Any idea on how to do this?
TITLE: Dynamic favicon using image manipulation similar to Gmail adding a count QUESTION: I tried to figure it out looking at the source code but I couldn't figure it out. I would like to know how to make a dynamic favicon with a count like Gmail does. Any idea on how to do this? ANSWER: You can make an image with th...
[ "javascript", "canvas", "dynamic", "favicon" ]
38
61
12,615
1
0
2011-06-09T17:03:12.817000
2011-06-09T17:08:53.580000
6,296,579
6,296,612
Copy constructor called many times when data is inserted in vector
#include #include using namespace std; class base { int x; public: base(int k){x =k; } void display() { cout< v; base obase[5]={4,14,19,24,29}; for(int i=0; i<5; i++) { v.push_back(obase[i]); } } When data is inserted into vector, copy to that data goes to vector using the copy constructor. When i run this program, fo...
If v needs to resize its internal buffer, it will usually allocate a totally fresh memory area, so it needs to copy all the objects that were previously in the vector to the new location. This is done using regular copying, so the copy constructor is invoked. You should call reserve() on the vector to reserve storage u...
Copy constructor called many times when data is inserted in vector #include #include using namespace std; class base { int x; public: base(int k){x =k; } void display() { cout< v; base obase[5]={4,14,19,24,29}; for(int i=0; i<5; i++) { v.push_back(obase[i]); } } When data is inserted into vector, copy to that data goe...
TITLE: Copy constructor called many times when data is inserted in vector QUESTION: #include #include using namespace std; class base { int x; public: base(int k){x =k; } void display() { cout< v; base obase[5]={4,14,19,24,29}; for(int i=0; i<5; i++) { v.push_back(obase[i]); } } When data is inserted into vector, cop...
[ "c++" ]
0
2
556
3
0
2011-06-09T17:03:41.063000
2011-06-09T17:06:26.740000
6,296,584
6,296,730
django automated dateTime field
Hello i'm working on a blog app and I have a model: class Post(models.Model): title = models.CharField(max_length=255) <..> is_published = models.BooleanField(default=False) time_publish = models.DateTimeField() time_edit = models.DateTimeField(auto_now=True) time_create = models.DateTimeField(auto_now_add=True) And i ...
The simplest solution (and django compliant) is to override your model's save method. class Post(models.Model):... def save(self, *args, **kwargs): if self.is_published: self.time_publish = datetime.now() # don't forget import datetime super(Post, self).save(*args, **kwargs)... More informations here: Overriding prede...
django automated dateTime field Hello i'm working on a blog app and I have a model: class Post(models.Model): title = models.CharField(max_length=255) <..> is_published = models.BooleanField(default=False) time_publish = models.DateTimeField() time_edit = models.DateTimeField(auto_now=True) time_create = models.DateTim...
TITLE: django automated dateTime field QUESTION: Hello i'm working on a blog app and I have a model: class Post(models.Model): title = models.CharField(max_length=255) <..> is_published = models.BooleanField(default=False) time_publish = models.DateTimeField() time_edit = models.DateTimeField(auto_now=True) time_creat...
[ "python", "django", "datetime", "automation" ]
0
1
276
1
0
2011-06-09T17:04:02.387000
2011-06-09T17:16:53.863000
6,296,594
6,296,762
jQuery: Is it possible to test for both input type and and attribute in one selector?
I have a list of input elements and using one selector I want to find those that are checkboxes have the value attribute set Can I do that? I tried: $(items).find("input:checkbox[value]") $(items).find("input[value]:checkbox") But both ignore the [value] and only test for input:checkbox. Sure, I can use two selectors, ...
Firstly, if people take the time to provide you with answers, you could at least take the effort in accepting those answers. Secondly, regarding your question you can either use filter() or check whether value is empty: $('input[value!=""]:checkbox').addClass('selected'); http://jsfiddle.net/niklasvh/pEK3c/ or $('input...
jQuery: Is it possible to test for both input type and and attribute in one selector? I have a list of input elements and using one selector I want to find those that are checkboxes have the value attribute set Can I do that? I tried: $(items).find("input:checkbox[value]") $(items).find("input[value]:checkbox") But bot...
TITLE: jQuery: Is it possible to test for both input type and and attribute in one selector? QUESTION: I have a list of input elements and using one selector I want to find those that are checkboxes have the value attribute set Can I do that? I tried: $(items).find("input:checkbox[value]") $(items).find("input[value]:...
[ "javascript", "jquery", "jquery-selectors" ]
3
4
127
2
0
2011-06-09T17:04:56.083000
2011-06-09T17:20:01.563000
6,296,602
6,296,624
Unknown column 'a.Email Address' in 'field list' error MySQL
I have the error: Unknown column 'a.Email Address' in 'field list in PHP from a database query. Please can you tell me why it doesn't like the fact that I have a space between Email and Address, and how I can fix it. Here's my full query: SELECT f.*, a.*, a.Email Address, a.Avatar FROM Following as f JOIN Accounts as a...
Quote it: a.`Email Address` And avoid spaces (or dashes, or reserved words) in/as table/column names.
Unknown column 'a.Email Address' in 'field list' error MySQL I have the error: Unknown column 'a.Email Address' in 'field list in PHP from a database query. Please can you tell me why it doesn't like the fact that I have a space between Email and Address, and how I can fix it. Here's my full query: SELECT f.*, a.*, a.E...
TITLE: Unknown column 'a.Email Address' in 'field list' error MySQL QUESTION: I have the error: Unknown column 'a.Email Address' in 'field list in PHP from a database query. Please can you tell me why it doesn't like the fact that I have a space between Email and Address, and how I can fix it. Here's my full query: SE...
[ "php", "mysql" ]
0
5
1,080
1
0
2011-06-09T17:05:34.773000
2011-06-09T17:07:13.867000
6,296,604
6,296,664
Drawing dashed and continuous lines
I need to draw lines; some are dashed and others are continuous. I cannot know which are dashed and which are not. When I draw the dashed lines, I use this: CGContextSetLineDash(context, 5, linedashPattern, 2); // set dashed line It happens, however, that if I draw a dotted line the next ones are also all dashed. Is th...
CGContextSetLineDash(context, 0, NULL, 0); B.t.w. I can only recommend to check the documentation. Definitely faster than posting a question on SO;)
Drawing dashed and continuous lines I need to draw lines; some are dashed and others are continuous. I cannot know which are dashed and which are not. When I draw the dashed lines, I use this: CGContextSetLineDash(context, 5, linedashPattern, 2); // set dashed line It happens, however, that if I draw a dotted line the ...
TITLE: Drawing dashed and continuous lines QUESTION: I need to draw lines; some are dashed and others are continuous. I cannot know which are dashed and which are not. When I draw the dashed lines, I use this: CGContextSetLineDash(context, 5, linedashPattern, 2); // set dashed line It happens, however, that if I draw ...
[ "objective-c", "cocoa-touch", "ios", "line", "cgcontext" ]
10
22
8,989
1
0
2011-06-09T17:05:44.510000
2011-06-09T17:11:11.250000
6,296,611
6,296,651
List<MyClass> as datasource for DropDownList?
I have a simple Class with ID and Name on it which I would like to link to a DropDownList but it seems that myDropDownList.DataTextField = "Name"; and myDropDownList.DataValueField = "ID"; are not accessible or available. UPDATE: I am using winforms public class Test { public int ID { get; set; } public string Name { g...
For web based ASP.net You need to specify the drop down lists datatextfield and datavaluefield properties. MyDropDownList.DataSource = myList; MyDropDownList.DataTextField="Name"; MyDropDownList.DataValueField="ID"; MyDropDownList.DataBind(); For win form You need to specify the displaymember / valuemember properties. ...
List<MyClass> as datasource for DropDownList? I have a simple Class with ID and Name on it which I would like to link to a DropDownList but it seems that myDropDownList.DataTextField = "Name"; and myDropDownList.DataValueField = "ID"; are not accessible or available. UPDATE: I am using winforms public class Test { publ...
TITLE: List<MyClass> as datasource for DropDownList? QUESTION: I have a simple Class with ID and Name on it which I would like to link to a DropDownList but it seems that myDropDownList.DataTextField = "Name"; and myDropDownList.DataValueField = "ID"; are not accessible or available. UPDATE: I am using winforms public...
[ "c#", "list", ".net-3.5", "drop-down-menu", "datasource" ]
6
15
13,871
1
0
2011-06-09T17:06:20.540000
2011-06-09T17:09:56.560000
6,296,613
6,296,668
Preserving case / capitalization with JavaScript replace method
I'm continuing work on a search term suggestion tool using Jquery UI. I am now working on displaying the results with the search term pattern in bold. I have implemented this functionality through patching the Autocomplete's _renderItem method. The problem I have now is that the replaced characters have the same case a...
You can use: var rep = item.label.replace(exp, " $& "); When replacing a string, $& means "the whole match", so you don't have to repeat the search term (in some cases you don't know it). In other flavors, you may use $0 or \0. Also, remember to escape special characters in this.term.
Preserving case / capitalization with JavaScript replace method I'm continuing work on a search term suggestion tool using Jquery UI. I am now working on displaying the results with the search term pattern in bold. I have implemented this functionality through patching the Autocomplete's _renderItem method. The problem...
TITLE: Preserving case / capitalization with JavaScript replace method QUESTION: I'm continuing work on a search term suggestion tool using Jquery UI. I am now working on displaying the results with the search term pattern in bold. I have implemented this functionality through patching the Autocomplete's _renderItem m...
[ "javascript", "regex", "replace" ]
4
7
1,836
2
0
2011-06-09T17:06:31.483000
2011-06-09T17:11:32.957000
6,296,619
6,296,646
php preg_macthing for tumblr avatar grabbing
amm please kindly check this code? cos it won't work.. To Grab copy this tag view-source:http://natadec0c0.tumblr.com/ whew almost half of hour im stuck in this problem.. hope someone can help me...
You're searching for an, instead of a. Also, you'll likely want something like (http.+?) instead of (http+). A better better way for finding that link though would be something like: if (preg_match('/ /si', $page, $link_matches) && strpos($link_matches[0], 'shortcut icon')!== false && preg_match('/href\s*=\s*"(http:.+?...
php preg_macthing for tumblr avatar grabbing amm please kindly check this code? cos it won't work.. To Grab copy this tag view-source:http://natadec0c0.tumblr.com/ whew almost half of hour im stuck in this problem.. hope someone can help me...
TITLE: php preg_macthing for tumblr avatar grabbing QUESTION: amm please kindly check this code? cos it won't work.. To Grab copy this tag view-source:http://natadec0c0.tumblr.com/ whew almost half of hour im stuck in this problem.. hope someone can help me... ANSWER: You're searching for an, instead of a. Also, you'...
[ "php", "tumblr" ]
0
1
229
1
0
2011-06-09T17:07:02.573000
2011-06-09T17:09:24.220000
6,296,626
6,296,710
Getting total length of an index in each()
I want to get an unknown ( changing ) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: $("#parent table:first tr").each(function(i){ var goodlng = $(this).parent().children("tr").length -1; //this w...
Your question says "cells", but it seems like you're trying to get the number of rows. If you really want it inside the.each(), you could use the siblings() [docs] method and the andSelf() [docs] method. $(this).siblings().andSelf().length But if the rows aren't changing, why do it repetitively? Or if they are changing...
Getting total length of an index in each() I want to get an unknown ( changing ) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: $("#parent table:first tr").each(function(i){ var goodlng = $(this)....
TITLE: Getting total length of an index in each() QUESTION: I want to get an unknown ( changing ) # of rows from a table, between the 1st cell and the last 3. I'm using jQuery's each and don't know why $(this).length doesn't give the total length of the index. jQuery: $("#parent table:first tr").each(function(i){ var ...
[ "javascript", "jquery", "each" ]
1
1
2,083
4
0
2011-06-09T17:07:32.187000
2011-06-09T17:14:33.223000
6,296,632
6,296,682
Run NSOperation on Main Thread
I built a NSOperation to run on a background thread, but I have since optimized the operation such that I might be better suited running it in the main thread. Is there a way to direct my NSOperation to run on the main thread instead of a background thread so that I can test things out without significant refactoring?
You can do this in the NSOperationQueue by using mainQueue http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSOperationQueue_class/Reference/Reference.html
Run NSOperation on Main Thread I built a NSOperation to run on a background thread, but I have since optimized the operation such that I might be better suited running it in the main thread. Is there a way to direct my NSOperation to run on the main thread instead of a background thread so that I can test things out wi...
TITLE: Run NSOperation on Main Thread QUESTION: I built a NSOperation to run on a background thread, but I have since optimized the operation such that I might be better suited running it in the main thread. Is there a way to direct my NSOperation to run on the main thread instead of a background thread so that I can ...
[ "multithreading", "nsoperation" ]
1
4
5,229
1
0
2011-06-09T17:08:06.360000
2011-06-09T17:12:28.323000
6,296,633
6,296,703
How do you change the width of a UITableView?
I'm new to iPhone development, coming from a web application development background and I'm working on my first project. I chose to create a Navigation based project, since after reading it seemed to be the easiest way to get what I'm after. How do you change the width of the UITableView? Eventually, I'd like to have a...
If you want to change the width of the tableViewCell.. go to cellForRowAtIndexPath, and assign it there. You could also do - CGFloat tableBorderLeft = 1; CGFloat tableBorderRight = 1; CGRect tableRect = self.view.frame; tableRect.origin.x += tableBorderLeft; // make the table begin a few pixels right from its origin t...
How do you change the width of a UITableView? I'm new to iPhone development, coming from a web application development background and I'm working on my first project. I chose to create a Navigation based project, since after reading it seemed to be the easiest way to get what I'm after. How do you change the width of t...
TITLE: How do you change the width of a UITableView? QUESTION: I'm new to iPhone development, coming from a web application development background and I'm working on my first project. I chose to create a Navigation based project, since after reading it seemed to be the easiest way to get what I'm after. How do you cha...
[ "objective-c", "cocoa-touch" ]
1
4
7,209
1
0
2011-06-09T17:08:20.710000
2011-06-09T17:13:56.967000
6,296,634
6,296,803
WPF Multiple ItemSources?
Is it possible to have multiple ItemSources for a single control? Given the code below: The TextBlock within the ComboBox DataTemplate requires data from another property within the VM than that of the ComboBox. How can this be achieved? Thanks.
You can use RelativeSource -FindAncestor to reach up the visual tree and grab a different DataContext. For example (assuming the command is what you want): Command=”{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}, Path=CheckCommand}” This should also serve as a good resource. Edit:...
WPF Multiple ItemSources? Is it possible to have multiple ItemSources for a single control? Given the code below: The TextBlock within the ComboBox DataTemplate requires data from another property within the VM than that of the ComboBox. How can this be achieved? Thanks.
TITLE: WPF Multiple ItemSources? QUESTION: Is it possible to have multiple ItemSources for a single control? Given the code below: The TextBlock within the ComboBox DataTemplate requires data from another property within the VM than that of the ComboBox. How can this be achieved? Thanks. ANSWER: You can use RelativeS...
[ "c#", "wpf", "xaml", "itemssource" ]
2
3
239
2
0
2011-06-09T17:08:25.413000
2011-06-09T17:23:37.807000
6,296,647
6,296,681
Determining which config file a setting originated from?
I am trying to find a way to determine the location of the config file that holds a specific appsetting or connection string value. i.e. I have multiple web sites/apps on an IIS server and I would like to determine if a setting is coming from the app's config, the parent app's config or the machine.config. Any idea? TI...
There is no way to do that using System.Configuration because it was designed to be indiscriminate. If you must do what you are trying to do, you will want to manually parse the potential files, those being the app.config/web.config, application.exe.config, and machine.config. Note: I see you are using.NET 4.0. Note th...
Determining which config file a setting originated from? I am trying to find a way to determine the location of the config file that holds a specific appsetting or connection string value. i.e. I have multiple web sites/apps on an IIS server and I would like to determine if a setting is coming from the app's config, th...
TITLE: Determining which config file a setting originated from? QUESTION: I am trying to find a way to determine the location of the config file that holds a specific appsetting or connection string value. i.e. I have multiple web sites/apps on an IIS server and I would like to determine if a setting is coming from th...
[ "c#", "asp.net", "iis", ".net-4.0", "web-config" ]
2
2
85
1
0
2011-06-09T17:09:30.250000
2011-06-09T17:12:22.563000
6,296,662
6,296,716
The project type is not supported by this installation
I am trying to use VS2005 Profession Edition (with C# installed) to open a Solution file that includes a WebSite that I was told was created using VS2005, when I get this error: --------------------------- Microsoft Visual Studio --------------------------- The project file 'C:\path\SolutionFolder\tedWeb\tedWeb.csproj'...
I would look here first: http://forums.asp.net/t/987224.aspx/1?Missing+ASP+Net+Web+Application+Template+VS+2005 Before that I would look at latest service packs for VS 2005 and see if there is one that cures the issue. I have not been on VS2005 in a long time, so this is a good safety check before messing up your syste...
The project type is not supported by this installation I am trying to use VS2005 Profession Edition (with C# installed) to open a Solution file that includes a WebSite that I was told was created using VS2005, when I get this error: --------------------------- Microsoft Visual Studio --------------------------- The pro...
TITLE: The project type is not supported by this installation QUESTION: I am trying to use VS2005 Profession Edition (with C# installed) to open a Solution file that includes a WebSite that I was told was created using VS2005, when I get this error: --------------------------- Microsoft Visual Studio -----------------...
[ "visual-studio-2005" ]
1
3
14,907
4
0
2011-06-09T17:10:58.337000
2011-06-09T17:15:17.003000
6,296,663
6,296,744
Could someone recommend best settings and plugins to Enable in JetBrains IntelliJ Idea for beginner
I am a new to IntelliJ Idea from Jetbrains and the installer asks me various questions at first launch. Though i managed Subversion/Version control system settings in first window other seem alien to me. Can i have a experienced hand at completing other steps. I am used to visual studio and.net and C#. But Java for fir...
Given what you want to do with the IDE, I'd recommend getting at least the following: GWT, GAE, Hibernate, SQL, and whatever App servers you plan on using for deployment. Also, you can always add those plugins later if and when needed. I've noticed that overloading the IDE with lots of plugins slows IDEA down quite a b...
Could someone recommend best settings and plugins to Enable in JetBrains IntelliJ Idea for beginner I am a new to IntelliJ Idea from Jetbrains and the installer asks me various questions at first launch. Though i managed Subversion/Version control system settings in first window other seem alien to me. Can i have a exp...
TITLE: Could someone recommend best settings and plugins to Enable in JetBrains IntelliJ Idea for beginner QUESTION: I am a new to IntelliJ Idea from Jetbrains and the installer asks me various questions at first launch. Though i managed Subversion/Version control system settings in first window other seem alien to me...
[ "java", "ide", "installation", "intellij-idea" ]
0
0
1,065
2
0
2011-06-09T17:11:03.543000
2011-06-09T17:18:18.043000
6,296,667
6,296,784
AppStore approval and md5
I'm using md5 from. I don't use it for encryption purposes. I know that in submitting an app to AppStore, it's asked if the app uses encryption. Is this the case to answer yes?
MD5 is not an encryption algorithm, it's a hashing algorithm. Encryption has to be reversible.
AppStore approval and md5 I'm using md5 from. I don't use it for encryption purposes. I know that in submitting an app to AppStore, it's asked if the app uses encryption. Is this the case to answer yes?
TITLE: AppStore approval and md5 QUESTION: I'm using md5 from. I don't use it for encryption purposes. I know that in submitting an app to AppStore, it's asked if the app uses encryption. Is this the case to answer yes? ANSWER: MD5 is not an encryption algorithm, it's a hashing algorithm. Encryption has to be reversi...
[ "iphone", "objective-c", "md5", "appstore-approval" ]
7
9
835
2
0
2011-06-09T17:11:26.840000
2011-06-09T17:21:35.033000
6,296,669
6,308,081
MSDEPLOY: How can I access the command generated by Visual Studio
How can I access the MSDEPLOY command line generated by Visual Studio 2010. I am asking because when I manually run MSDEPLOY I can easly deploy on a remote server and when I run it throught Visual Studio, I get this error Web deployment task failed.(Remote Agent (url https://x.x.x.x:8172/msdeply.axd?site=Default Web Si...
If you follow this guys instructions you can see more verbose output: http://sedodream.com/2010/11/04/WebDeployHowToSeeTheCommandExecutedInVisualStudioDuringPublish.aspx FYI, I tested this myself because MSDeploy.exe from the command line was working but the Publish form Visual Studio 2010 wasn't working (using Web Dep...
MSDEPLOY: How can I access the command generated by Visual Studio How can I access the MSDEPLOY command line generated by Visual Studio 2010. I am asking because when I manually run MSDEPLOY I can easly deploy on a remote server and when I run it throught Visual Studio, I get this error Web deployment task failed.(Remo...
TITLE: MSDEPLOY: How can I access the command generated by Visual Studio QUESTION: How can I access the MSDEPLOY command line generated by Visual Studio 2010. I am asking because when I manually run MSDEPLOY I can easly deploy on a remote server and when I run it throught Visual Studio, I get this error Web deployment...
[ "msdeploy" ]
8
7
2,283
1
0
2011-06-09T17:11:46.770000
2011-06-10T14:52:56.270000
6,296,670
6,298,821
Core data storing link to parent record only on last child record stored
I've got a core data model created using XCode 4 that is doing something weird. I have an entity called ProbeObj that has a defined relationship with a second entity called SmokeObj. In the diagram, I've created the relationship on ProbObj as ProbeToSmoke and on SmokeObj, I have created the relationship as SmokeToProbe...
Your SmokeObj.SmokeToProbe relationship is set one-to-one. This means that any single instance of SmokeObj can have a relationship with only one other single instance of ProbeObj. So, as you go through the loop, you first assign the SmokeObj in self.SmokeForThisRun to the first created ProbObj referenced by newProb. Th...
Core data storing link to parent record only on last child record stored I've got a core data model created using XCode 4 that is doing something weird. I have an entity called ProbeObj that has a defined relationship with a second entity called SmokeObj. In the diagram, I've created the relationship on ProbObj as Prob...
TITLE: Core data storing link to parent record only on last child record stored QUESTION: I've got a core data model created using XCode 4 that is doing something weird. I have an entity called ProbeObj that has a defined relationship with a second entity called SmokeObj. In the diagram, I've created the relationship ...
[ "core-data", "xcode4", "relationships" ]
0
0
231
1
0
2011-06-09T17:11:47.947000
2011-06-09T20:26:13.937000
6,296,673
6,296,771
WPF image.source change during runtime, from byte[]. But image is blank(white)
I am trying to change an image for image1 during runtime. However the image turns blank(blank), what am I doing wrong? ImageAsBytes is a Byte[] containing an image. ScrollViewer1 is the where image1 is located. using (MemoryStream ms = new MemoryStream(ImagesAsBytes, 0, ImagesAsBytes.Length)) { BitmapImage image = new ...
I think your Image can't be displayed because the MemoryStream you are using is being disposed. Remove the surrounding using block and see if that helps. (you would need to dispose of the stream manually if you don't need it anymore then)
WPF image.source change during runtime, from byte[]. But image is blank(white) I am trying to change an image for image1 during runtime. However the image turns blank(blank), what am I doing wrong? ImageAsBytes is a Byte[] containing an image. ScrollViewer1 is the where image1 is located. using (MemoryStream ms = new M...
TITLE: WPF image.source change during runtime, from byte[]. But image is blank(white) QUESTION: I am trying to change an image for image1 during runtime. However the image turns blank(blank), what am I doing wrong? ImageAsBytes is a Byte[] containing an image. ScrollViewer1 is the where image1 is located. using (Memor...
[ "c#", ".net", "wpf", ".net-4.0" ]
1
0
1,178
1
0
2011-06-09T17:12:04.540000
2011-06-09T17:20:27.997000
6,296,675
6,298,706
Fastest/preferred method of loading data into Core Data (iOS)
I have a relatively small amount of data (stored in a static text file) that I'm loading into Core Data in my iOS app. What is the fastest or preferred method of storing static data on the device and loading data into Core Data? I've tried putting the data in XML format and using libxml to load it into Core Data. I've ...
The simplest solution is to load the data into a Core Data persistent SQL store during development. Then include that file in the app bundle itself. Upon first launch, copy the file from the readonly app bundle into the Documents or Library directory. Then open the store as normal. All the data will be in place and rea...
Fastest/preferred method of loading data into Core Data (iOS) I have a relatively small amount of data (stored in a static text file) that I'm loading into Core Data in my iOS app. What is the fastest or preferred method of storing static data on the device and loading data into Core Data? I've tried putting the data i...
TITLE: Fastest/preferred method of loading data into Core Data (iOS) QUESTION: I have a relatively small amount of data (stored in a static text file) that I'm loading into Core Data in my iOS app. What is the fastest or preferred method of storing static data on the device and loading data into Core Data? I've tried ...
[ "xml", "ios", "core-data", "csv", "load-time" ]
0
1
508
1
0
2011-06-09T17:12:07.020000
2011-06-09T20:14:21.113000
6,296,698
6,296,760
This Stream Does Not Support Seek Operations
This is a follow-up to: Getting Started With ASP.NET MVC3 & Google Checkout: Take 2 It seems that the problem why I'm getting a Bad Request (400 error) - refer to the topic above - is because of this error. Checkout the screen shot below: So as you can see, there's an exception being thrown and that's probably what's c...
That is a false lead. Ignore that. You are only seeing that because of the debugger / visualiser trying to show you all the properties (some of which don't make sense for a stream of unknown length). That said, I'm not sure how it makes sense to add that stream to view-data. Streams are pipes, not buckets. With a few e...
This Stream Does Not Support Seek Operations This is a follow-up to: Getting Started With ASP.NET MVC3 & Google Checkout: Take 2 It seems that the problem why I'm getting a Bad Request (400 error) - refer to the topic above - is because of this error. Checkout the screen shot below: So as you can see, there's an except...
TITLE: This Stream Does Not Support Seek Operations QUESTION: This is a follow-up to: Getting Started With ASP.NET MVC3 & Google Checkout: Take 2 It seems that the problem why I'm getting a Bad Request (400 error) - refer to the topic above - is because of this error. Checkout the screen shot below: So as you can see,...
[ "c#", "asp.net", "asp.net-mvc-3", "stream", "io" ]
1
2
4,521
1
0
2011-06-09T17:13:41.327000
2011-06-09T17:19:58.720000
6,296,712
6,296,960
Positioning a "reel" div properly in jQuery when total width is dynamic
I'm writing my own small pager control in Javascript and jQuery and having trouble positioning it properly. The pager is set to only be a specific width (340px in this case) which allows it to display roughly ten page buttons. If the user has selected a higher page, I'd like the reel to slide to the left and show the s...
You'll need to manually give #reel a width equivalent to the number of items * the width of each item. A dynamic way to do this is to load in all of the items, place them in a hidden, unbounded div, then set the width of #reel equal to the width of that div. Try this before your carousel code: var dummyDiv = $(' '); du...
Positioning a "reel" div properly in jQuery when total width is dynamic I'm writing my own small pager control in Javascript and jQuery and having trouble positioning it properly. The pager is set to only be a specific width (340px in this case) which allows it to display roughly ten page buttons. If the user has selec...
TITLE: Positioning a "reel" div properly in jQuery when total width is dynamic QUESTION: I'm writing my own small pager control in Javascript and jQuery and having trouble positioning it properly. The pager is set to only be a specific width (340px in this case) which allows it to display roughly ten page buttons. If ...
[ "javascript", "jquery", "css" ]
0
1
517
1
0
2011-06-09T17:14:56.420000
2011-06-09T17:36:54.833000
6,296,714
6,296,748
php calculation solution for pagination
I have a variable $total which is the total number of results and $page which is the page number. The result is limited to 12 per page. Suppose if $total is 24, the script may return 1 and 2 for $page =1 and $page =2 respectively. It should also return 1 if the input number is less than 1 (negative or zero) or if the n...
Here's one way to calculate it: // Assuming you have the $total variable which contains the total // number of records $recordsPerPage = 12; // Declare a variable which will hold the number of pages required to // display all the records, when displaying @recordsPerPage records on each page $maxPages = 1; if($total ...
php calculation solution for pagination I have a variable $total which is the total number of results and $page which is the page number. The result is limited to 12 per page. Suppose if $total is 24, the script may return 1 and 2 for $page =1 and $page =2 respectively. It should also return 1 if the input number is le...
TITLE: php calculation solution for pagination QUESTION: I have a variable $total which is the total number of results and $page which is the page number. The result is limited to 12 per page. Suppose if $total is 24, the script may return 1 and 2 for $page =1 and $page =2 respectively. It should also return 1 if the ...
[ "php" ]
0
2
3,525
1
0
2011-06-09T17:15:00.043000
2011-06-09T17:18:41.503000
6,296,715
6,296,731
How to select for td class in Jquery
I'm having trouble selecting for an element on my DOM. How do you select for all links of the td class trash can? The following code does nothing and is not working: $(function(){ $('.trash_can').live("click", function(event) { console.log('Clicked Delete'); event.preventDefault(); }); });
.trash_can selects your td, not its a. You want to apply the event handler to the a element. $(function(){ $('.trash_can a').live("click", function(event) { console.log('Clicked Delete'); event.preventDefault(); }); });
How to select for td class in Jquery I'm having trouble selecting for an element on my DOM. How do you select for all links of the td class trash can? The following code does nothing and is not working: $(function(){ $('.trash_can').live("click", function(event) { console.log('Clicked Delete'); event.preventDefault(); ...
TITLE: How to select for td class in Jquery QUESTION: I'm having trouble selecting for an element on my DOM. How do you select for all links of the td class trash can? The following code does nothing and is not working: $(function(){ $('.trash_can').live("click", function(event) { console.log('Clicked Delete'); event....
[ "jquery", "jquery-selectors", "preventdefault" ]
2
2
4,891
3
0
2011-06-09T17:15:02.130000
2011-06-09T17:16:58.483000
6,296,719
6,296,754
Problems with VisualTreeHelper Hit test in landscape
I'm using the FindElementsInHostCoordinates method to find elements as the user swipes his finger across the screen. I'm noticing that it is reacting to if the phone was in portrait. For example - As I move my finger up it moves down, and as I move my finger to the right it moves left. It also only does something if I'...
The host is always in portrait mode by design. However, you can read about a workaround in this blog post.
Problems with VisualTreeHelper Hit test in landscape I'm using the FindElementsInHostCoordinates method to find elements as the user swipes his finger across the screen. I'm noticing that it is reacting to if the phone was in portrait. For example - As I move my finger up it moves down, and as I move my finger to the r...
TITLE: Problems with VisualTreeHelper Hit test in landscape QUESTION: I'm using the FindElementsInHostCoordinates method to find elements as the user swipes his finger across the screen. I'm noticing that it is reacting to if the phone was in portrait. For example - As I move my finger up it moves down, and as I move ...
[ "silverlight", "windows-phone-7", "hittest", "visualtreehelper" ]
1
1
329
1
0
2011-06-09T17:15:53.080000
2011-06-09T17:19:29.593000
6,296,733
6,296,826
Is it possible to place URL Rewrite configuration in a separate config file?
We are using URL Rewrite in an ASP.NET website hosted on IIS7: http://www.iis.net/download/URLRewrite This is OK, but business users have to request IT to update the web.config file whenever a new redirect is required. Is it possible to put all URL rewrite configurations in a separate config file, which could be manage...
Yes. Any config section can be external to the web/app.config. You create an empty element and give it a configSource attribute whose value is the path to the external configfile, thus: The referenced file has as its root element the config section: That's about it. Changes made to the external config file for a ASP.Ne...
Is it possible to place URL Rewrite configuration in a separate config file? We are using URL Rewrite in an ASP.NET website hosted on IIS7: http://www.iis.net/download/URLRewrite This is OK, but business users have to request IT to update the web.config file whenever a new redirect is required. Is it possible to put al...
TITLE: Is it possible to place URL Rewrite configuration in a separate config file? QUESTION: We are using URL Rewrite in an ASP.NET website hosted on IIS7: http://www.iis.net/download/URLRewrite This is OK, but business users have to request IT to update the web.config file whenever a new redirect is required. Is it ...
[ "asp.net", "web-config", "url-rewriting" ]
2
1
723
1
0
2011-06-09T17:17:09.190000
2011-06-09T17:25:09.970000
6,296,734
6,296,997
Update fields from an array with CakePHP
I have an array that is sent to my controller, such as this: $array = array( [0]=>array( [id]=>5, [position]=>6 ), [1]=>array( [id]=>8, [position]=>2 ) ); And I need to save the position of each item using its id. What is the best way to do this in cakePHP? I can only imagine looping an update function or pulling the e...
Ha, Cake magic to the rescue again. You don't have to tell Cake to save it by id. There's a big long amazing way Cake does this, but the short and skinny is - if your array contains an 'id' key, Cake presumes it is the table primary key and generates an UPDATE statement instead of an INSERT. Looks like this: UPDATE tab...
Update fields from an array with CakePHP I have an array that is sent to my controller, such as this: $array = array( [0]=>array( [id]=>5, [position]=>6 ), [1]=>array( [id]=>8, [position]=>2 ) ); And I need to save the position of each item using its id. What is the best way to do this in cakePHP? I can only imagine lo...
TITLE: Update fields from an array with CakePHP QUESTION: I have an array that is sent to my controller, such as this: $array = array( [0]=>array( [id]=>5, [position]=>6 ), [1]=>array( [id]=>8, [position]=>2 ) ); And I need to save the position of each item using its id. What is the best way to do this in cakePHP? I c...
[ "php", "cakephp" ]
2
4
3,193
2
0
2011-06-09T17:17:19.530000
2011-06-09T17:40:18.507000
6,296,737
6,296,765
PHP - Variable Variables & array_merge() - not working
I have a bunch of arrays, which are stored in different variables like $required, $reserved, etc... I would like to allow (inside a function) an array of options to be passed (like $options = array('required', 'reserved') ), and that array would then be used to define which arrays to merge together and return at the en...
array_merge returns the merged array, you're not assigning that return value to anything and thus it is being lost. $array = array_merge($array, $array_to_merge); should fix your problem.
PHP - Variable Variables & array_merge() - not working I have a bunch of arrays, which are stored in different variables like $required, $reserved, etc... I would like to allow (inside a function) an array of options to be passed (like $options = array('required', 'reserved') ), and that array would then be used to def...
TITLE: PHP - Variable Variables & array_merge() - not working QUESTION: I have a bunch of arrays, which are stored in different variables like $required, $reserved, etc... I would like to allow (inside a function) an array of options to be passed (like $options = array('required', 'reserved') ), and that array would t...
[ "php", "arrays", "variables", "variable-variables", "array-merge" ]
1
4
1,929
2
0
2011-06-09T17:17:43.863000
2011-06-09T17:20:17.537000
6,296,741
6,296,772
Prevent user from installing my app if capability not met
I working on an app and its primary need is auto focus camera. How can I prevent users to install this app if they don't have an auto focus camera?
well if you really want to prevent users from installing your app if they don't have a autofocus camera then you can add "UIRequiredDeviceCapabilities" key in your info.plist file and can add "auto-focus-camera" value to it. for more info you can visit my blog entry - http://www.makebetterthings.com/blogs/iphone/how-to...
Prevent user from installing my app if capability not met I working on an app and its primary need is auto focus camera. How can I prevent users to install this app if they don't have an auto focus camera?
TITLE: Prevent user from installing my app if capability not met QUESTION: I working on an app and its primary need is auto focus camera. How can I prevent users to install this app if they don't have an auto focus camera? ANSWER: well if you really want to prevent users from installing your app if they don't have a ...
[ "iphone", "objective-c", "camera", "autofocus" ]
2
2
368
4
0
2011-06-09T17:18:01.413000
2011-06-09T17:20:30.073000
6,296,749
6,297,121
Hide Route values when using RedirectToAction
[HttpGet] public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(HomeOfficeViewModel viewModel) { return RedirectToAction("SearchResults", "HomeOffice", viewModel); } public ActionResult SearchResults(HomeOfficeViewModel viewModel) { if (viewModel.FirstName!= null && viewModel.LastName ==...
RedirectToAction will create a GET request to the named action ( SearchResults in your case) which is probably trying to serialize your view model fields. Instead, you could use TempData [HttpPost] public ActionResult Index(HomeOfficeViewModel viewModel) { TempData["Field1"] = "Value1"; TempData["HomeOfficeViewModel1"]...
Hide Route values when using RedirectToAction [HttpGet] public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(HomeOfficeViewModel viewModel) { return RedirectToAction("SearchResults", "HomeOffice", viewModel); } public ActionResult SearchResults(HomeOfficeViewModel viewModel) { if (viewM...
TITLE: Hide Route values when using RedirectToAction QUESTION: [HttpGet] public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(HomeOfficeViewModel viewModel) { return RedirectToAction("SearchResults", "HomeOffice", viewModel); } public ActionResult SearchResults(HomeOfficeViewModel view...
[ "asp.net-mvc-3", "hide", "redirecttoaction" ]
1
2
3,904
1
0
2011-06-09T17:18:45.127000
2011-06-09T17:53:31.960000
6,296,752
6,296,977
Use JS to replace text in Gmail message body
I want to write an GnuPG extension for Google Chrome. So far, everything works as expected: If I detect ASCII armored crypt-text, I parse it with my extension and then replace it. (after password has been entered) Gmail however litters the message body with an insane amount of tags, so my simple JS approach doesn't wor...
what do you need is something like this: /<[^>]+>/g this regexp will remove all tags, an leave plain text... just gotta replace for nothing... something like this: " text full of junk and unwanted tags ".replace(/<[^>]+>/g, "");...and about selecting an specific part you can use substring, I guess!
Use JS to replace text in Gmail message body I want to write an GnuPG extension for Google Chrome. So far, everything works as expected: If I detect ASCII armored crypt-text, I parse it with my extension and then replace it. (after password has been entered) Gmail however litters the message body with an insane amount ...
TITLE: Use JS to replace text in Gmail message body QUESTION: I want to write an GnuPG extension for Google Chrome. So far, everything works as expected: If I detect ASCII armored crypt-text, I parse it with my extension and then replace it. (after password has been entered) Gmail however litters the message body with...
[ "javascript", "regex", "gnupg" ]
1
1
368
2
0
2011-06-09T17:18:56.377000
2011-06-09T17:38:25.223000
6,296,757
6,297,196
Qdir's function exists() always returns true, even when the directory doesn't exist
I'm trying to error-proof the first part of a project, in which a folder is created in a specified base directory. The base directory is selected by the user either manually in QLineEdit, or by browsing through the computer's directories using QFileDialog. I'm trying to check if the base directory exists before I make ...
Your second if statement will not be executed if you type in anything in the text field. Your logic in the first if states that if the input is empty or a predefine string, then test for the existence of the dir. Which means you are always testing with an empty string or the canned message. The correct logic should be:...
Qdir's function exists() always returns true, even when the directory doesn't exist I'm trying to error-proof the first part of a project, in which a folder is created in a specified base directory. The base directory is selected by the user either manually in QLineEdit, or by browsing through the computer's directorie...
TITLE: Qdir's function exists() always returns true, even when the directory doesn't exist QUESTION: I'm trying to error-proof the first part of a project, in which a folder is created in a specified base directory. The base directory is selected by the user either manually in QLineEdit, or by browsing through the com...
[ "c++", "qt" ]
2
2
2,094
1
0
2011-06-09T17:19:42.510000
2011-06-09T18:00:52.157000
6,296,764
6,307,095
Detecting Cases using SQL statements
I'm trying to use a SQL command that will look through a block of text and determine if it has 3 consecutive uppercase letters in it. Is there a way of doing this? Or even simpler, is there a way that SQL can detect case?
A function you can use create function ThreeUpperInARow(@s varchar(max)) returns bit begin declare @Rows int;with cte as ( select left(@s, 3) as Part, stuff(@s, 1, 1, '') as Rest union all select left(Rest, 3) as Part, stuff(Rest, 1, 1, '') as Rest from cte where len(Rest) >= 3 ) select @Rows = count(*) from cte where ...
Detecting Cases using SQL statements I'm trying to use a SQL command that will look through a block of text and determine if it has 3 consecutive uppercase letters in it. Is there a way of doing this? Or even simpler, is there a way that SQL can detect case?
TITLE: Detecting Cases using SQL statements QUESTION: I'm trying to use a SQL command that will look through a block of text and determine if it has 3 consecutive uppercase letters in it. Is there a way of doing this? Or even simpler, is there a way that SQL can detect case? ANSWER: A function you can use create func...
[ "sql", "sql-server", "case-sensitive" ]
2
3
674
4
0
2011-06-09T17:20:16.747000
2011-06-10T13:34:57.990000
6,296,780
6,297,177
Installing PHPMyAdmin on IIS 7.5
I am trying to install PHPMyAdmin on IIS 7.5 / Windows Server 2008 R2. I created an application inside IIS, when I try to run the app I get an internal error,which is related to phpMyAdmin here is the log: [09-Jun-2011 21:17:03] PHP Warning: require_once(./libraries/common.inc.php) [ function.require-once ]: failed to ...
1) Have you verified that the files exist and the PHP has access to them? 2) Try changing the relative path to an absolute path This: require_once(./libraries/common.inc.php) To This: require_once(D:\Inetpub\wwwroot/libraries/common.inc.php) /* Of course using your own path. */
Installing PHPMyAdmin on IIS 7.5 I am trying to install PHPMyAdmin on IIS 7.5 / Windows Server 2008 R2. I created an application inside IIS, when I try to run the app I get an internal error,which is related to phpMyAdmin here is the log: [09-Jun-2011 21:17:03] PHP Warning: require_once(./libraries/common.inc.php) [ fu...
TITLE: Installing PHPMyAdmin on IIS 7.5 QUESTION: I am trying to install PHPMyAdmin on IIS 7.5 / Windows Server 2008 R2. I created an application inside IIS, when I try to run the app I get an internal error,which is related to phpMyAdmin here is the log: [09-Jun-2011 21:17:03] PHP Warning: require_once(./libraries/co...
[ "php", "iis-7.5" ]
2
1
4,780
3
0
2011-06-09T17:21:03.337000
2011-06-09T17:59:48.320000
6,296,788
6,296,854
Java : Multithreading -Wait/notifyAll Question
I have a class which spawns a bunch of threads and have to wait till all the spawned threads are completed. ( I need to calculate the time for all threads to complete). The MainClass spawns all the threads and then it checks whether all the threads are completed before it can call itself completed. Will this logic work...
notifyAll() is relatively slow. A better way is to use CountDownLatch: import java.util.concurrent.CountDownLatch; int n = 10; CountDownLatch doneSignal = new CountDownLatch(n); //... start threads... doneSignal.await(); // and within each thread: doWork(); doneSignal.countDown();
Java : Multithreading -Wait/notifyAll Question I have a class which spawns a bunch of threads and have to wait till all the spawned threads are completed. ( I need to calculate the time for all threads to complete). The MainClass spawns all the threads and then it checks whether all the threads are completed before it ...
TITLE: Java : Multithreading -Wait/notifyAll Question QUESTION: I have a class which spawns a bunch of threads and have to wait till all the spawned threads are completed. ( I need to calculate the time for all threads to complete). The MainClass spawns all the threads and then it checks whether all the threads are co...
[ "java", "multithreading", "thread-safety", "threadpool" ]
5
11
1,411
3
0
2011-06-09T17:21:43.463000
2011-06-09T17:28:13.960000
6,296,790
6,297,142
Check if String Variable is a certain string value
I have a psuedo contextual menu script on my webpage. The idea is that a script will check to see if the element you're hovering over has a certain class. If it does, it sets a string variable to a certain value. This way, when ctrl is pressed, i can check the string variable content to determine which contextual menu ...
You're resetting the value of cmEl in your function scope. You need to just rewrite it like this.... if (actEl.hasClass("B_Info")) { cmEl = "BiP"; } else if (actEl.hasClass("BiO")) { cmEl = "BiO"; } else if (actEl.hasClass("myOpt")) { cmEl = "myOpt"; } else { cmEl = "GEN"; } Now your global variable cmEl is being set, ...
Check if String Variable is a certain string value I have a psuedo contextual menu script on my webpage. The idea is that a script will check to see if the element you're hovering over has a certain class. If it does, it sets a string variable to a certain value. This way, when ctrl is pressed, i can check the string v...
TITLE: Check if String Variable is a certain string value QUESTION: I have a psuedo contextual menu script on my webpage. The idea is that a script will check to see if the element you're hovering over has a certain class. If it does, it sets a string variable to a certain value. This way, when ctrl is pressed, i can ...
[ "jquery", "contextmenu", "keydown" ]
0
1
223
2
0
2011-06-09T17:21:53.747000
2011-06-09T17:55:38.247000
6,296,792
6,296,993
Basic Java Sockets, Server can't send nor clients can recieve anything
I've written a basic client - server socket program in Java from a tutorial in the book 'java-all-in-one desk reference for Dummies',it contains 3 classes, BartServer,BartClient,BartQuote.. basically what the BartServer.class does is listens for the BartClient.class, the BartClient upon execution will send commands to ...
Change this line on the server: PrintWriter out = new PrintWriter(s.getOutputStream()); to: PrintWriter out = new PrintWriter(s.getOutputStream(), true); That will change so that the server always is flushing the stream after a write. Data can otherwise be lingering around in the servers buffer for the output stream. N...
Basic Java Sockets, Server can't send nor clients can recieve anything I've written a basic client - server socket program in Java from a tutorial in the book 'java-all-in-one desk reference for Dummies',it contains 3 classes, BartServer,BartClient,BartQuote.. basically what the BartServer.class does is listens for the...
TITLE: Basic Java Sockets, Server can't send nor clients can recieve anything QUESTION: I've written a basic client - server socket program in Java from a tutorial in the book 'java-all-in-one desk reference for Dummies',it contains 3 classes, BartServer,BartClient,BartQuote.. basically what the BartServer.class does ...
[ "java", "sockets" ]
1
4
2,702
1
0
2011-06-09T17:22:10.453000
2011-06-09T17:39:48.387000
6,296,793
6,296,827
Change a div's height to auto using jQuery once the div reaches a certain height
I have a div that lets the user add additional form inputs dynamically. I'd like to be able to change this div's height to auto once it reaches a certain height. Here is the jQuery code I have, though it doesn't seem to be working at the moment. $(document).ready(function(){ if($('#upload3').height() > 400){ $('#upload...
This will only run ONCE when the document is ready. You need to put it inside a resize() event handler: $('#upload3').resize(function() { if($(this).height() > 400){ $(this).css('height','auto'); } }); });
Change a div's height to auto using jQuery once the div reaches a certain height I have a div that lets the user add additional form inputs dynamically. I'd like to be able to change this div's height to auto once it reaches a certain height. Here is the jQuery code I have, though it doesn't seem to be working at the m...
TITLE: Change a div's height to auto using jQuery once the div reaches a certain height QUESTION: I have a div that lets the user add additional form inputs dynamically. I'd like to be able to change this div's height to auto once it reaches a certain height. Here is the jQuery code I have, though it doesn't seem to b...
[ "jquery", "css", "html", "height" ]
7
12
52,258
4
0
2011-06-09T17:22:29.557000
2011-06-09T17:25:13.953000
6,296,797
6,296,916
Rebinding page-up via global-set-key
I'm trying to rebind my page-up and page-down keys to some functions I've written using global-set-key (global-set-key [next] 'up-rate) (global-set-key [previous] 'down-rate) This seems to work fine for page-down, but not page-up ( previous ) - the key remains bound to "buffer page up". Am I missing something obvious h...
C-h c is your friend -- it will tell you that the name of the page up key is prior, not previous.
Rebinding page-up via global-set-key I'm trying to rebind my page-up and page-down keys to some functions I've written using global-set-key (global-set-key [next] 'up-rate) (global-set-key [previous] 'down-rate) This seems to work fine for page-down, but not page-up ( previous ) - the key remains bound to "buffer page ...
TITLE: Rebinding page-up via global-set-key QUESTION: I'm trying to rebind my page-up and page-down keys to some functions I've written using global-set-key (global-set-key [next] 'up-rate) (global-set-key [previous] 'down-rate) This seems to work fine for page-down, but not page-up ( previous ) - the key remains boun...
[ "emacs", "elisp" ]
1
5
928
1
0
2011-06-09T17:23:06.613000
2011-06-09T17:32:50.560000
6,296,799
6,296,856
basic python indentation/dedentation question
Why does the following code produce indentation error in the Python console (version 2.6.5 in my case)? I was convinced the following was a valid piece of code: if True: print '1' print 'indentation error on this line' If I insert a blank line between the if-block and the last print, the error goes away: if True: print...
The problem is due to the usage of the Python console, not the Python language. If you put everything in a method, it works. Example: >>> if True:... print '1'... print 'indentation error on this line' File " ", line 3 print 'indentation error on this line' ^ SyntaxError: invalid syntax >>> def test():... if True:... p...
basic python indentation/dedentation question Why does the following code produce indentation error in the Python console (version 2.6.5 in my case)? I was convinced the following was a valid piece of code: if True: print '1' print 'indentation error on this line' If I insert a blank line between the if-block and the l...
TITLE: basic python indentation/dedentation question QUESTION: Why does the following code produce indentation error in the Python console (version 2.6.5 in my case)? I was convinced the following was a valid piece of code: if True: print '1' print 'indentation error on this line' If I insert a blank line between the ...
[ "python", "syntax", "indentation" ]
4
5
1,071
2
0
2011-06-09T17:23:28.433000
2011-06-09T17:28:19.697000
6,296,820
6,297,067
Action upon leaving a web page with Django
This is a general question with no attempt so far since I don't know where to start. All I've seen are javascript alerts upon leaving a page. Scenario: When User1 visit a page I want to generate a random string and make an entry in the database for that string. This random number can be entered by one other user ( User...
Perhaps someone can prove me wrong, but as far as I know there isn't a reliable way of triggering a server-side event when users leave a page. Yes, there is the onunload event that you can use to trigger a quick ajax call, but HTTP is by definition a stateless protocol and attempting to create a solution which emulate ...
Action upon leaving a web page with Django This is a general question with no attempt so far since I don't know where to start. All I've seen are javascript alerts upon leaving a page. Scenario: When User1 visit a page I want to generate a random string and make an entry in the database for that string. This random num...
TITLE: Action upon leaving a web page with Django QUESTION: This is a general question with no attempt so far since I don't know where to start. All I've seen are javascript alerts upon leaving a page. Scenario: When User1 visit a page I want to generate a random string and make an entry in the database for that strin...
[ "django" ]
1
1
1,495
1
0
2011-06-09T17:24:45.110000
2011-06-09T17:47:27.047000
6,296,822
6,296,848
How to format numbers with 00 prefixes in php?
I'm trying to generate invoice numbers. They should always be 4 numbers long, with leading zeros, for example: 1 -> Invoice 0001 10 -> Invoice 0010 150 -> Invoice 0150 etc.
Use str_pad(). $invID = str_pad($invID, 4, '0', STR_PAD_LEFT);
How to format numbers with 00 prefixes in php? I'm trying to generate invoice numbers. They should always be 4 numbers long, with leading zeros, for example: 1 -> Invoice 0001 10 -> Invoice 0010 150 -> Invoice 0150 etc.
TITLE: How to format numbers with 00 prefixes in php? QUESTION: I'm trying to generate invoice numbers. They should always be 4 numbers long, with leading zeros, for example: 1 -> Invoice 0001 10 -> Invoice 0010 150 -> Invoice 0150 etc. ANSWER: Use str_pad(). $invID = str_pad($invID, 4, '0', STR_PAD_LEFT);
[ "php", "numbers", "format" ]
47
100
111,714
7
0
2011-06-09T17:25:05.077000
2011-06-09T17:27:32.940000
6,296,836
6,296,940
Why e.Handled = true not working?
I have following XAML In code behind I am doing this private void StackPanel_MouseEnter(object sender, MouseEventArgs e) { } private void Grid_MouseEnter(object sender, MouseEventArgs e) { e.Handled = true; } private void Button_MouseEnter(object sender, MouseEventArgs e) { e.Handled = true; } Now even if I move mou...
The MouseEnter event is not a bubbling event, it is a direct event (like classic CLR events). From the documentation: You can define multiple MouseEnter events for objects in XAML content. However, if a child object and its parent object both define a MouseEnter event, the parent object's MouseEnter event occurs before...
Why e.Handled = true not working? I have following XAML In code behind I am doing this private void StackPanel_MouseEnter(object sender, MouseEventArgs e) { } private void Grid_MouseEnter(object sender, MouseEventArgs e) { e.Handled = true; } private void Button_MouseEnter(object sender, MouseEventArgs e) { e.Handle...
TITLE: Why e.Handled = true not working? QUESTION: I have following XAML In code behind I am doing this private void StackPanel_MouseEnter(object sender, MouseEventArgs e) { } private void Grid_MouseEnter(object sender, MouseEventArgs e) { e.Handled = true; } private void Button_MouseEnter(object sender, MouseEvent...
[ "c#", "wpf", "routed-events" ]
10
11
9,973
1
0
2011-06-09T17:26:04.577000
2011-06-09T17:34:52.493000
6,296,842
6,296,956
Setup webpage using Windows DNS and Apache on VM
I have inherited a website to maintain that is hosted on a VM of Fedora/Apache. The DNS for the website is maintained on a Windows 2000 Server machine. The current setup has no test site to test changes before deployment. I have copied the contents of the website on Fedora (found at /pub/customercenter.perceptionistinc...
Yes, any changes in httpd.conf, will be applied only after an apache restart! If it is a production environment, I would suggest testing the config changes on another server, to resolve glitches before you go live with it. EDIT: There is an option, to reload without restart (no disruption of connections of current clie...
Setup webpage using Windows DNS and Apache on VM I have inherited a website to maintain that is hosted on a VM of Fedora/Apache. The DNS for the website is maintained on a Windows 2000 Server machine. The current setup has no test site to test changes before deployment. I have copied the contents of the website on Fedo...
TITLE: Setup webpage using Windows DNS and Apache on VM QUESTION: I have inherited a website to maintain that is hosted on a VM of Fedora/Apache. The DNS for the website is maintained on a Windows 2000 Server machine. The current setup has no test site to test changes before deployment. I have copied the contents of t...
[ "apache", "web", "httpd.conf" ]
1
1
449
1
0
2011-06-09T17:26:39.103000
2011-06-09T17:36:27.320000
6,296,850
6,297,185
Hebrew and numbers
I have a database and use it with phpMyAdmin, and values in one of the fields are mixed hebrew letters with numbers like: אב12 first character is א second character is ב third character is 1 fourth character is 2 The above is written in correctly, though this value: first character is 1 second character is 2 third char...
In fact changing the phpMyAdmin language to hebrew helped. Not very comfortable though(
Hebrew and numbers I have a database and use it with phpMyAdmin, and values in one of the fields are mixed hebrew letters with numbers like: אב12 first character is א second character is ב third character is 1 fourth character is 2 The above is written in correctly, though this value: first character is 1 second charac...
TITLE: Hebrew and numbers QUESTION: I have a database and use it with phpMyAdmin, and values in one of the fields are mixed hebrew letters with numbers like: אב12 first character is א second character is ב third character is 1 fourth character is 2 The above is written in correctly, though this value: first character ...
[ "mysql", "phpmyadmin" ]
7
1
264
2
0
2011-06-09T17:28:01.170000
2011-06-09T18:00:12.837000
6,296,859
6,296,954
installing a windows service
I have created a Windows Service in ASP.NET 4.0 and I am using the following command to install the service after starting a command prompt as administrator: C:\Windows\system32>sc create EnviroTracker1 binpath= "D:\Freelance Work\SuperExpert\git EnviroTrack\EnviroTrack\EnviroTrackerService\bin\Release\EnviroTrackServi...
You will need have a class that derives from ServiceBase and add code to the OnStart and OnStop methods. Once you get that working you can right click anywhere in designer view and choose "Add Installer" which will add the necessary code to the assembly that allows installutil to register the service. public class Your...
installing a windows service I have created a Windows Service in ASP.NET 4.0 and I am using the following command to install the service after starting a command prompt as administrator: C:\Windows\system32>sc create EnviroTracker1 binpath= "D:\Freelance Work\SuperExpert\git EnviroTrack\EnviroTrack\EnviroTrackerService...
TITLE: installing a windows service QUESTION: I have created a Windows Service in ASP.NET 4.0 and I am using the following command to install the service after starting a command prompt as administrator: C:\Windows\system32>sc create EnviroTracker1 binpath= "D:\Freelance Work\SuperExpert\git EnviroTrack\EnviroTrack\En...
[ "c#", "windows-services" ]
3
1
1,809
3
0
2011-06-09T17:28:33.540000
2011-06-09T17:36:16.337000
6,296,874
6,296,889
How can I disambiguate a label of a SELECT clause used in a GROUP BY?
I have a query: SELECT... (some expression) AS Country FROM Sometable... GROUP BY Country; Sometable has a column named Country (this can't be changed). One of the result columns is named Country (this can't be changed either). It works (I want the GROUP BY to apply on the result column, and this is the way MySQL under...
SELECT a,b,c,d, country2 AS country FROM ( SELECT a,b,c,d, (some expression) AS Country2 FROM Sometable... GROUP BY Country ) s;
How can I disambiguate a label of a SELECT clause used in a GROUP BY? I have a query: SELECT... (some expression) AS Country FROM Sometable... GROUP BY Country; Sometable has a column named Country (this can't be changed). One of the result columns is named Country (this can't be changed either). It works (I want the G...
TITLE: How can I disambiguate a label of a SELECT clause used in a GROUP BY? QUESTION: I have a query: SELECT... (some expression) AS Country FROM Sometable... GROUP BY Country; Sometable has a column named Country (this can't be changed). One of the result columns is named Country (this can't be changed either). It w...
[ "mysql" ]
3
1
1,012
2
0
2011-06-09T17:29:30.280000
2011-06-09T17:30:54.757000
6,296,896
6,296,974
run ffmpeg in background so page can be changed
I have a problem that is driving me crazy. I have a php script that uploads a file into a directory. I could then convert it with ffmpeg but I don't want the user to have to wait on that page, I want them to be able to change page while the ffmpeg is running on the file. How can I achieve this, do I use batch or cron o...
I would go for crons or just create an another php script which will do converting. After user will submit the form, process the form and send the data with $_POST to video converter script and execute it without waiting for response. Here is an example from my framework, you can modify to your needs. # Executing The S...
run ffmpeg in background so page can be changed I have a problem that is driving me crazy. I have a php script that uploads a file into a directory. I could then convert it with ffmpeg but I don't want the user to have to wait on that page, I want them to be able to change page while the ffmpeg is running on the file. ...
TITLE: run ffmpeg in background so page can be changed QUESTION: I have a problem that is driving me crazy. I have a php script that uploads a file into a directory. I could then convert it with ffmpeg but I don't want the user to have to wait on that page, I want them to be able to change page while the ffmpeg is run...
[ "php", "mysql", "linux", "ffmpeg" ]
0
2
1,184
2
0
2011-06-09T17:31:14.053000
2011-06-09T17:38:16.610000
6,296,910
6,296,935
jquery test a condition vs entire collection without a loop
Pretty simple to do with loop but I'm wondering if there's a way to see if every item in a collection matches a condition without a loop. For example: if( $('.many-items-of-this-class').hasClass('some-other-class') ) { } This returns true if any item in the collection returns true. Is there a way to do this sort of ope...
You could cache the set, then run a filter against the set that tests for the other class, and compare the.length properties of both. var many_items = $('.many-items-of-this-class'); if( many_items.length === many_items.filter('.some-other-class').length ) { } Or shorter, but arguably more confusing, you could use a.n...
jquery test a condition vs entire collection without a loop Pretty simple to do with loop but I'm wondering if there's a way to see if every item in a collection matches a condition without a loop. For example: if( $('.many-items-of-this-class').hasClass('some-other-class') ) { } This returns true if any item in the co...
TITLE: jquery test a condition vs entire collection without a loop QUESTION: Pretty simple to do with loop but I'm wondering if there's a way to see if every item in a collection matches a condition without a loop. For example: if( $('.many-items-of-this-class').hasClass('some-other-class') ) { } This returns true if ...
[ "jquery" ]
5
5
871
6
0
2011-06-09T17:32:09.303000
2011-06-09T17:34:35.200000
6,296,912
6,298,876
Board game grid with fixed background
I am trying to design a grid for a simple game and was looking up apps on the net, and came across one at http://itunes.apple.com/us/app/tic-tac-toe-free/id289278457?mt=8 which seems to be something like what I have in mind. A board with a custom background (the blackboard in this case) but which also has the cells sep...
How about keeping it simple and drawing cell separators right on background? If cells have uniform size, it shouldn't be too hard to align things so that GridView matches the board exactly, I think. If on bigger screen you'd want bigger cells but not thicker cell separators, 9-patch could help there: 9-patch images can...
Board game grid with fixed background I am trying to design a grid for a simple game and was looking up apps on the net, and came across one at http://itunes.apple.com/us/app/tic-tac-toe-free/id289278457?mt=8 which seems to be something like what I have in mind. A board with a custom background (the blackboard in this ...
TITLE: Board game grid with fixed background QUESTION: I am trying to design a grid for a simple game and was looking up apps on the net, and came across one at http://itunes.apple.com/us/app/tic-tac-toe-free/id289278457?mt=8 which seems to be something like what I have in mind. A board with a custom background (the b...
[ "android", "android-layout" ]
0
1
653
1
0
2011-06-09T17:32:15.097000
2011-06-09T20:32:05.637000
6,296,934
6,296,957
Should I use EBS or S3 to store my database on?
I want to host a website on an Amazon EC2 instance, but for reliability purposes, I want to have the underlying database on some more permanent storage medium. There won't be any file uploading or anything like that, but I want to make sure that the database queries and updates are going quickly. Should I use EBS or S3...
You can not store a database on S3. If you intend to store your database anywhere it will either be on EBS or on instance storage.
Should I use EBS or S3 to store my database on? I want to host a website on an Amazon EC2 instance, but for reliability purposes, I want to have the underlying database on some more permanent storage medium. There won't be any file uploading or anything like that, but I want to make sure that the database queries and u...
TITLE: Should I use EBS or S3 to store my database on? QUESTION: I want to host a website on an Amazon EC2 instance, but for reliability purposes, I want to have the underlying database on some more permanent storage medium. There won't be any file uploading or anything like that, but I want to make sure that the data...
[ "database", "amazon-s3", "amazon-web-services", "amazon-ebs" ]
6
7
3,613
3
0
2011-06-09T17:34:27.803000
2011-06-09T17:36:35.110000
6,296,938
6,297,017
jQuery not hitting MVC controller on second pass in IE
I'll start out saying that this works perfectly in Chrome and Firefox but not IE (IE9). Desired behavior: I have a Partial View on my page that contains a hyperlink. When you click on the hyperlink it uses a jQuery function to pop up a dialog to enter a new note. When you close the dialog, it should refresh the Partial...
I'm betting that IE is caching the result of the ModalNoteEdit action. I'd try doing something to prevent that caching. Maybe setting a response header, or adding a querystring to that request that changes every time. For instance: $('#noteDialog).load('<%= Url.Action("ModalNoteEdit","Notes")%>' + Date.now(), { id: id ...
jQuery not hitting MVC controller on second pass in IE I'll start out saying that this works perfectly in Chrome and Firefox but not IE (IE9). Desired behavior: I have a Partial View on my page that contains a hyperlink. When you click on the hyperlink it uses a jQuery function to pop up a dialog to enter a new note. W...
TITLE: jQuery not hitting MVC controller on second pass in IE QUESTION: I'll start out saying that this works perfectly in Chrome and Firefox but not IE (IE9). Desired behavior: I have a Partial View on my page that contains a hyperlink. When you click on the hyperlink it uses a jQuery function to pop up a dialog to e...
[ "jquery", "asp.net-mvc", "internet-explorer", "jquery-ui" ]
1
5
2,996
2
0
2011-06-09T17:34:41.977000
2011-06-09T17:42:12.110000
6,296,945
6,296,980
size vs capacity of a vector?
I am a bit confused about this both of these look same to me. Although it may happen that capacity and size may differ on different compilers. how it may differ. Its also said that if we are out of memory the capacity changes. All these things are bit unclear to me. Can somebody give an explanation.(if possible with an...
Size is not allowed to differ between multiple compilers. The size of a vector is the number of elements that it contains, which is directly controlled by how many elements you put into the vector. Capacity is the amount of total space that the vector has. Under the hood, a vector just uses an array. The capacity of th...
size vs capacity of a vector? I am a bit confused about this both of these look same to me. Although it may happen that capacity and size may differ on different compilers. how it may differ. Its also said that if we are out of memory the capacity changes. All these things are bit unclear to me. Can somebody give an ex...
TITLE: size vs capacity of a vector? QUESTION: I am a bit confused about this both of these look same to me. Although it may happen that capacity and size may differ on different compilers. how it may differ. Its also said that if we are out of memory the capacity changes. All these things are bit unclear to me. Can s...
[ "c++", "vector" ]
60
99
74,168
9
0
2011-06-09T17:35:40.757000
2011-06-09T17:38:52.970000
6,296,951
6,297,154
Is there a way to add a table to a Linq-to-SQL dbml in C#?
I am working on some scripts, and was wondering if anyone knew of a way to dynamically add a table from an MSSQL database into a dbml file, just as if one were to do it the normal "drag-n-drop" way. Is there anything in the framework that allows this? Update: I have the name of a table, that exists in my database. If i...
No, this is not possible; the point of LINQ-to-SQL (and similar ORM's, like the Entity Framework) is to give you a strongly-typed mechanism for querying and updating your database. If the schema is unknown to you at compile time, then it is impossible to query against it as you could not write code to do so (LINQ-to-SQ...
Is there a way to add a table to a Linq-to-SQL dbml in C#? I am working on some scripts, and was wondering if anyone knew of a way to dynamically add a table from an MSSQL database into a dbml file, just as if one were to do it the normal "drag-n-drop" way. Is there anything in the framework that allows this? Update: I...
TITLE: Is there a way to add a table to a Linq-to-SQL dbml in C#? QUESTION: I am working on some scripts, and was wondering if anyone knew of a way to dynamically add a table from an MSSQL database into a dbml file, just as if one were to do it the normal "drag-n-drop" way. Is there anything in the framework that allo...
[ "c#", ".net", "linq-to-sql", "scripting", "dynamic" ]
1
1
1,639
1
0
2011-06-09T17:36:06.133000
2011-06-09T17:57:01.967000
6,296,959
6,306,882
midi | How do I tell when the string sound is Pizzicato (A sort of finger-pinch noise)
first thing - Pizzicato means that you sort of pinch the violin/cello/bass with your fingers and you get more of a guitar-pinching noise instead of a regular violin. When I convert the midi to mp3 using a random program - the program makes this pizzicato just fine (since I hear it). but when I am trying to look for a h...
Firstly, you can playback any MIDI file through MIDI-OX and see exactly what messages are being sent. Second, there is no specific MIDI message for this. What you are hearing is the result of short notes with likely large velocity. The synth generating the sound for strings is programmed to respond in this way. You sho...
midi | How do I tell when the string sound is Pizzicato (A sort of finger-pinch noise) first thing - Pizzicato means that you sort of pinch the violin/cello/bass with your fingers and you get more of a guitar-pinching noise instead of a regular violin. When I convert the midi to mp3 using a random program - the program...
TITLE: midi | How do I tell when the string sound is Pizzicato (A sort of finger-pinch noise) QUESTION: first thing - Pizzicato means that you sort of pinch the violin/cello/bass with your fingers and you get more of a guitar-pinching noise instead of a regular violin. When I convert the midi to mp3 using a random pro...
[ "flash", "actionscript-3", "audio", "midi" ]
0
2
209
1
0
2011-06-09T17:36:49.417000
2011-06-10T13:17:24.333000
6,296,961
6,298,977
NHibernate and "anonymous" entities
I have these entities: public class Parent { public int Foo { get; set; } public Child C { get; set; } } public class Child { public string Name { get; set; } } I have query which fetches all Parent entities from the database. Then I keep them in memory, and filter them using LINQ queries. I have noticed that when I d...
You can eagerly load the children for this query like this (using QueryOver syntax) public IList FindAllParentsWithChildren() { ISession s = // Get session return s.QueryOver ().Fetch(p => p.C).Eager.List (); } An alternative is to change your HBM files to indicate that Child is eagerly loaded by default. Then you won'...
NHibernate and "anonymous" entities I have these entities: public class Parent { public int Foo { get; set; } public Child C { get; set; } } public class Child { public string Name { get; set; } } I have query which fetches all Parent entities from the database. Then I keep them in memory, and filter them using LINQ q...
TITLE: NHibernate and "anonymous" entities QUESTION: I have these entities: public class Parent { public int Foo { get; set; } public Child C { get; set; } } public class Child { public string Name { get; set; } } I have query which fetches all Parent entities from the database. Then I keep them in memory, and filter...
[ "nhibernate", "entity" ]
1
4
180
2
0
2011-06-09T17:37:00.940000
2011-06-09T20:41:55.040000
6,296,962
6,296,994
Request.IsAjaxRequest() == Request.IsMvcAjaxRequest()
Are these two the same essentially? I am just noticing that Request.IsMvcAjaxRequest() does not show up in my code hint as it does in the tutorial video here. I am using ASP.net MVC 3
The ASP.NET MVC RC Release Notes states that IsMvcAjaxRequest is renamed to IsAjaxRequest. This means that you should just use IsAjaxRequest. Quote from release notes: The IsMvcAjaxRequest method been renamed to IsAjaxRequest. As part of this change, the IsAjaxRequest method was updated to recognize the X-Requested-Wit...
Request.IsAjaxRequest() == Request.IsMvcAjaxRequest() Are these two the same essentially? I am just noticing that Request.IsMvcAjaxRequest() does not show up in my code hint as it does in the tutorial video here. I am using ASP.net MVC 3
TITLE: Request.IsAjaxRequest() == Request.IsMvcAjaxRequest() QUESTION: Are these two the same essentially? I am just noticing that Request.IsMvcAjaxRequest() does not show up in my code hint as it does in the tutorial video here. I am using ASP.net MVC 3 ANSWER: The ASP.NET MVC RC Release Notes states that IsMvcAjaxR...
[ "asp.net", "asp.net-mvc" ]
1
4
278
1
0
2011-06-09T17:37:01.670000
2011-06-09T17:39:51.377000
6,296,964
6,296,985
Why does form display incorrectly in IE7/8?
Why does this form display incorrectly in IE7/8? Firefox (correct): http://img812.imageshack.us/img812/9610/contactfirefox.png IE (incorrect): http://img840.imageshack.us/img840/2742/contactiexplorer.png Here is the code: /*-----Contact Form----------------*/.fb-container { width: 425px; font-family: "lucida grande",ta...
Can you be more specific? One thing that stands out is any floated element you have that has a horizontal margin, it's likely the double margin bug is occurring so put display:inline; on any element that is floated and has horizontal ( left, right ) margins.
Why does form display incorrectly in IE7/8? Why does this form display incorrectly in IE7/8? Firefox (correct): http://img812.imageshack.us/img812/9610/contactfirefox.png IE (incorrect): http://img840.imageshack.us/img840/2742/contactiexplorer.png Here is the code: /*-----Contact Form----------------*/.fb-container { w...
TITLE: Why does form display incorrectly in IE7/8? QUESTION: Why does this form display incorrectly in IE7/8? Firefox (correct): http://img812.imageshack.us/img812/9610/contactfirefox.png IE (incorrect): http://img840.imageshack.us/img840/2742/contactiexplorer.png Here is the code: /*-----Contact Form----------------*...
[ "html", "css" ]
2
0
213
1
0
2011-06-09T17:37:02.117000
2011-06-09T17:39:12.200000
6,296,967
6,297,026
making a custom image frame in css by overlapping divs, but not being able to access the image anymore
I'm trying to make a custom, irregular frame for a google maps iframe. You can see my results so far here: http://bufident.com/pruebas/site02/contacto/contacto.html (please forgive the sloppy markup) The only way I could think up of doing this was by having 1 div with the frame overlapping the div with the map like thi...
Use 4 images instead of one.. The div holding the images must be under the iframe, and the images above.. So you need absolute positioning for it.. That way the overlapping images are more border-like.. Also there is another solution that allows clicking through div's, found that in a jquery plugin. I'll check if I can...
making a custom image frame in css by overlapping divs, but not being able to access the image anymore I'm trying to make a custom, irregular frame for a google maps iframe. You can see my results so far here: http://bufident.com/pruebas/site02/contacto/contacto.html (please forgive the sloppy markup) The only way I co...
TITLE: making a custom image frame in css by overlapping divs, but not being able to access the image anymore QUESTION: I'm trying to make a custom, irregular frame for a google maps iframe. You can see my results so far here: http://bufident.com/pruebas/site02/contacto/contacto.html (please forgive the sloppy markup)...
[ "css", "html" ]
0
0
1,416
2
0
2011-06-09T17:37:31.367000
2011-06-09T17:43:16.380000
6,296,979
6,297,037
Problems killing a process with Python on Solaris
I have a C++ program, called C, that is designed to shut down when it receives a SIGINT signal. I've written a Python program P that runs C as a subprocess. I want P to stop C. I tried 3 things and I'd like to know why some of them didn't work. Attempt #1: import subprocess import signal import os p = subprocess.Popen...
The first fails because os.killpg kills a process group, identified by its leader; you have a simple process, not a process group. Try os.kill instead. The second fails because the shell builtin kill understands symbolic signals, but the external command on Solaris doesn't (whereas on *BSD and Linux it does); use a num...
Problems killing a process with Python on Solaris I have a C++ program, called C, that is designed to shut down when it receives a SIGINT signal. I've written a Python program P that runs C as a subprocess. I want P to stop C. I tried 3 things and I'd like to know why some of them didn't work. Attempt #1: import subpro...
TITLE: Problems killing a process with Python on Solaris QUESTION: I have a C++ program, called C, that is designed to shut down when it receives a SIGINT signal. I've written a Python program P that runs C as a subprocess. I want P to stop C. I tried 3 things and I'd like to know why some of them didn't work. Attempt...
[ "python", "solaris", "kill" ]
2
5
2,299
2
0
2011-06-09T17:38:41.087000
2011-06-09T17:44:22.517000
6,296,983
6,297,018
Multiple SQL Searches - OR Command
My users can search for an order by an address right now. What I would like to do is let them be able to search with multiple criteria. Let them search by address, city, state, etc etc. I have tried using the following code, but it doesn't seem to work. $sql = ("SELECT order_number, sitestreet FROM `PropertyInfo` WHERE...
Wrap your OR statements in parenthesis so it forms one top-level condition, the user is the other top-level condition: $sql = ' SELECT `order_number`, `sitestreet` FROM `PropertyInfo` WHERE ( `sitestreet` LIKE "%'.$street.'%" OR `sitecity` LIKE "%'.$city.'%" ) AND `user` = '.$user; Also note, you want a direct match to...
Multiple SQL Searches - OR Command My users can search for an order by an address right now. What I would like to do is let them be able to search with multiple criteria. Let them search by address, city, state, etc etc. I have tried using the following code, but it doesn't seem to work. $sql = ("SELECT order_number, s...
TITLE: Multiple SQL Searches - OR Command QUESTION: My users can search for an order by an address right now. What I would like to do is let them be able to search with multiple criteria. Let them search by address, city, state, etc etc. I have tried using the following code, but it doesn't seem to work. $sql = ("SELE...
[ "php", "sql" ]
0
3
69
4
0
2011-06-09T17:39:08.300000
2011-06-09T17:42:13.347000
6,297,006
6,297,076
c++ dynamic library segfault
I'm writing network application in c++ and I want to enable making plugins, but I don't know what to do, to protect my application from errors like segfault. For example: I have interface: class IPlugin{ public: IPlugin(); virtual ~IPlugin(); virtual void callPlugin() = 0; } And someone will write dynamic library: clas...
It's a losing battle trying to protect you from bad code loaded into your address space. Those plugins could do real damage that you can never recover from. Either accept the fact that a buggy plugin will bring your application down, or you have to isolate the plugin in a separate process as you suggest. But you only n...
c++ dynamic library segfault I'm writing network application in c++ and I want to enable making plugins, but I don't know what to do, to protect my application from errors like segfault. For example: I have interface: class IPlugin{ public: IPlugin(); virtual ~IPlugin(); virtual void callPlugin() = 0; } And someone wil...
TITLE: c++ dynamic library segfault QUESTION: I'm writing network application in c++ and I want to enable making plugins, but I don't know what to do, to protect my application from errors like segfault. For example: I have interface: class IPlugin{ public: IPlugin(); virtual ~IPlugin(); virtual void callPlugin() = 0;...
[ "c++", "dynamic" ]
3
5
245
1
0
2011-06-09T17:41:17.877000
2011-06-09T17:48:15.887000
6,297,009
6,297,057
query on array in android
hi friends i am a new developer to java and android, in my app i am using sax parser to getting the values of a particular tag. i have stored all those values in an Array. When i printed it in my log cat it appears to be as follows. [s,d,f,g,h,h,j,q,k,k...............] Now my problem is, in another activity i used to g...
You should learn how activities can share data through intents' extra. Read anddev book, page 58. Regards, Stéphane
query on array in android hi friends i am a new developer to java and android, in my app i am using sax parser to getting the values of a particular tag. i have stored all those values in an Array. When i printed it in my log cat it appears to be as follows. [s,d,f,g,h,h,j,q,k,k...............] Now my problem is, in an...
TITLE: query on array in android QUESTION: hi friends i am a new developer to java and android, in my app i am using sax parser to getting the values of a particular tag. i have stored all those values in an Array. When i printed it in my log cat it appears to be as follows. [s,d,f,g,h,h,j,q,k,k...............] Now my...
[ "java", "android", "arraylist" ]
0
0
282
2
0
2011-06-09T17:41:37.843000
2011-06-09T17:46:07.487000
6,297,012
6,298,560
urls being shown after links when printing web page
I have an issue with a site that I've created. When the page is printed (as in command+p) it prints out the urls of hyperlinks as part of the page content. I'm guessing this is using the:after pseudo class to add the href attribute after hyperlinks, but I can't find any instance in my stylesheets where it might be doin...
The Web-Developer plugin allow you to do that. http://chrispederick.com/work/web-developer/ Install it -> Look at toolbar -> CSS -> Display CSS by Media Type Also, similar question here: How do you debug printable CSS?
urls being shown after links when printing web page I have an issue with a site that I've created. When the page is printed (as in command+p) it prints out the urls of hyperlinks as part of the page content. I'm guessing this is using the:after pseudo class to add the href attribute after hyperlinks, but I can't find a...
TITLE: urls being shown after links when printing web page QUESTION: I have an issue with a site that I've created. When the page is printed (as in command+p) it prints out the urls of hyperlinks as part of the page content. I'm guessing this is using the:after pseudo class to add the href attribute after hyperlinks, ...
[ "html", "css" ]
2
0
567
1
0
2011-06-09T17:41:57.417000
2011-06-09T20:02:54.640000
6,297,036
6,297,140
Unexpected Results in Testing JavaScript Objects
I'm in the process of truly learning the nuances of working with JavaScript objects and ran into a snag. I have a set of "namespaced" objects to segment the DOM and Model to act on. Below is code: function Sandbox2(){ this.page = { FirstName: document.getElementById("FirstName"), LastName: document.getElementById("Last...
It seems like the issue is here: for(var property in this.page){ if (property){ property.value = this.model[property]; } } The property variable is actually the key value of the object (FirstName, LastName and Email). You're setting the value attributes on these string objects without any result. I think you meant to d...
Unexpected Results in Testing JavaScript Objects I'm in the process of truly learning the nuances of working with JavaScript objects and ran into a snag. I have a set of "namespaced" objects to segment the DOM and Model to act on. Below is code: function Sandbox2(){ this.page = { FirstName: document.getElementById("Fir...
TITLE: Unexpected Results in Testing JavaScript Objects QUESTION: I'm in the process of truly learning the nuances of working with JavaScript objects and ran into a snag. I have a set of "namespaced" objects to segment the DOM and Model to act on. Below is code: function Sandbox2(){ this.page = { FirstName: document.g...
[ "javascript", "js-test-driver" ]
0
2
127
1
0
2011-06-09T17:44:16.433000
2011-06-09T17:55:10.403000
6,297,038
6,297,114
Embedding fonts in mx and spark components
I'm trying to embed fonts in my app. All is mostly well but for the itemRenderers in my AdvancedDataGrid. Adobe's documentation claims that The MX DataGrid control has a special class, FTEDataGridItemRenderer, that you can use for custom item renderers. The MXFTEText.css theme file specifies it as follows: defaultDataG...
Just figured it out... mx|AdvancedDataGrid { defaultDataGridItemEditor: ClassReference("mx.controls.MXFTETextInput"); defaultDataGridItemRenderer: ClassReference("mx.controls.advancedDataGridClasses.FTEAdvancedDataGridItemRenderer"); } does the trick. Strangely if you only use the itemRenderer part the IRs actually don...
Embedding fonts in mx and spark components I'm trying to embed fonts in my app. All is mostly well but for the itemRenderers in my AdvancedDataGrid. Adobe's documentation claims that The MX DataGrid control has a special class, FTEDataGridItemRenderer, that you can use for custom item renderers. The MXFTEText.css theme...
TITLE: Embedding fonts in mx and spark components QUESTION: I'm trying to embed fonts in my app. All is mostly well but for the itemRenderers in my AdvancedDataGrid. Adobe's documentation claims that The MX DataGrid control has a special class, FTEDataGridItemRenderer, that you can use for custom item renderers. The M...
[ "apache-flex", "fonts" ]
1
2
283
1
0
2011-06-09T17:44:24.413000
2011-06-09T17:52:15.517000
6,297,041
6,297,088
JQuery add class functionality not working
I am trying to have an element rather like the Twitter tweets area. The DIV should be a different colour on mouseover with a new position for the background image. Then when the user clicks the background image position should move again and the background colour should change only when the user is not on hover. I trie...
$(id).addClass('ractive'); is not getting a proper selector. From your markup you should be doing. $('.review').click(function() { $(this).addClass('ractive'); }); You should then REMOVE onclick="reviews(this); from your markup. If you are using jquery to apply classes, stick with that approach overall. Don't mix obtru...
JQuery add class functionality not working I am trying to have an element rather like the Twitter tweets area. The DIV should be a different colour on mouseover with a new position for the background image. Then when the user clicks the background image position should move again and the background colour should change...
TITLE: JQuery add class functionality not working QUESTION: I am trying to have an element rather like the Twitter tweets area. The DIV should be a different colour on mouseover with a new position for the background image. Then when the user clicks the background image position should move again and the background co...
[ "jquery", "css", "addclass" ]
4
3
17,453
1
0
2011-06-09T17:44:28.873000
2011-06-09T17:49:10.810000
6,297,047
6,299,138
Python: exec statement and unexpected garbage collector behavior
I found a problem with exec (It happened in a system that has to be extensible with user written scripts). I could reduce the problem itself to this code: def fn(): context = {} exec ''' class test: def __init__(self): self.buf = '1'*1024*1024*200 x = test()''' in context fn() I expected that memory should be freed by...
The reason that you're seeing it take up 200Mb of memory for longer than you expect is because you have a reference cycle: context is a dict referencing both x and test. x references an instance of test, which references test. test has a dict of attributes, test.__dict__, which contains the __init__ function for the cl...
Python: exec statement and unexpected garbage collector behavior I found a problem with exec (It happened in a system that has to be extensible with user written scripts). I could reduce the problem itself to this code: def fn(): context = {} exec ''' class test: def __init__(self): self.buf = '1'*1024*1024*200 x = tes...
TITLE: Python: exec statement and unexpected garbage collector behavior QUESTION: I found a problem with exec (It happened in a system that has to be extensible with user written scripts). I could reduce the problem itself to this code: def fn(): context = {} exec ''' class test: def __init__(self): self.buf = '1'*102...
[ "python", "garbage-collection", "exec" ]
7
5
779
2
0
2011-06-09T17:44:50.637000
2011-06-09T20:53:52.313000
6,297,071
6,297,173
Stopping a windows service when the stop option is grayed out
I have created a windows service and in the service in control panel -> administrative tools -> services, its status is starting. I want to stop this service, but the stop option is grayed out. How can I start/stop the service? Every time I restart, then it becomes stopped and I can delete it.
If you run the command: sc queryex where is the the name of the service, not the display name (spooler, not Print Spooler), at the cmd prompt it will return the PID of the process the service is running as. Take that PID and run taskkill /F /PID to force the PID to stop. Sometimes if the process hangs while stopping th...
Stopping a windows service when the stop option is grayed out I have created a windows service and in the service in control panel -> administrative tools -> services, its status is starting. I want to stop this service, but the stop option is grayed out. How can I start/stop the service? Every time I restart, then it ...
TITLE: Stopping a windows service when the stop option is grayed out QUESTION: I have created a windows service and in the service in control panel -> administrative tools -> services, its status is starting. I want to stop this service, but the stop option is grayed out. How can I start/stop the service? Every time I...
[ "windows-services" ]
94
162
264,965
9
0
2011-06-09T17:47:41.597000
2011-06-09T17:59:38.650000
6,297,089
6,297,107
Quick and Easy way to Test if an ftp adress user/pass works?
Possible Duplicate: How to check FTP connection? Using VS.NET App What would be very simple way to test is a connection is made to a FTP address using provided username/password just to validate that a user inputted a good address. I just use Network.UploadFile to send a file but if the address is wrong just throws 500...
Well, the simple clever way would be to use some FTP class or Network.Upload file to test it, wouldn't it? How about implementing some error handling for the exceptions that are thrown and providing feedback to the user if the address is incorrect?
Quick and Easy way to Test if an ftp adress user/pass works? Possible Duplicate: How to check FTP connection? Using VS.NET App What would be very simple way to test is a connection is made to a FTP address using provided username/password just to validate that a user inputted a good address. I just use Network.UploadFi...
TITLE: Quick and Easy way to Test if an ftp adress user/pass works? QUESTION: Possible Duplicate: How to check FTP connection? Using VS.NET App What would be very simple way to test is a connection is made to a FTP address using provided username/password just to validate that a user inputted a good address. I just us...
[ ".net", "ftp" ]
0
1
155
1
0
2011-06-09T17:49:11.783000
2011-06-09T17:51:23.250000
6,297,109
6,297,128
C# Get Month INT from Month String
I found a lot of ways to get the name from a number but now I need it the other way around. If the string equals April, I want to convert it to int "4". Does anyone know the best way to accomplish this server side?
int month = DateTime.ParseExact(MonthNameStr, "MMMM", CultureInfo.CurrentCulture ).Month or you can do int month = DateTimeFormatInfo.CurrentInfo.MonthNames.ToList().IndexOf(MonthNameStr) + 1;
C# Get Month INT from Month String I found a lot of ways to get the name from a number but now I need it the other way around. If the string equals April, I want to convert it to int "4". Does anyone know the best way to accomplish this server side?
TITLE: C# Get Month INT from Month String QUESTION: I found a lot of ways to get the name from a number but now I need it the other way around. If the string equals April, I want to convert it to int "4". Does anyone know the best way to accomplish this server side? ANSWER: int month = DateTime.ParseExact(MonthNameSt...
[ "c#" ]
13
30
32,423
3
0
2011-06-09T17:51:33.757000
2011-06-09T17:54:06.277000
6,297,112
6,297,139
WPF close window when property in ViewModel changes
I was wondering if there was a way to close a window when a property in the view model changes. In my situation I have a login window with an Ok button bound to a LoginCommand so that the function Login executes when Ok is clicked. If the login is successful, I want the window to close. Now I know I could do this by ad...
Here's a similar question, which filled my need. Basically, you use an attached property for your window, which binds to a bool? property on your VM. When the VM property is set to something non-null, the attached property sets the Window's DialogResult, which will automatically close the window.
WPF close window when property in ViewModel changes I was wondering if there was a way to close a window when a property in the view model changes. In my situation I have a login window with an Ok button bound to a LoginCommand so that the function Login executes when Ok is clicked. If the login is successful, I want t...
TITLE: WPF close window when property in ViewModel changes QUESTION: I was wondering if there was a way to close a window when a property in the view model changes. In my situation I have a login window with an Ok button bound to a LoginCommand so that the function Login executes when Ok is clicked. If the login is su...
[ "wpf", "data-binding", "window" ]
0
2
3,482
3
0
2011-06-09T17:52:11.253000
2011-06-09T17:54:54.083000
6,297,113
6,297,168
Send UIImage to server
I want to send UIImage from my application to the server. I use ASIHTTPRequest. I'll send NSData but how to convert from UIImage to NSData?
If you need PNG data in your NSData you can use: NSData *data = UIImagePNGRepresentation(img); Where img is your UIImage. There is a similar function for JPG.
Send UIImage to server I want to send UIImage from my application to the server. I use ASIHTTPRequest. I'll send NSData but how to convert from UIImage to NSData?
TITLE: Send UIImage to server QUESTION: I want to send UIImage from my application to the server. I use ASIHTTPRequest. I'll send NSData but how to convert from UIImage to NSData? ANSWER: If you need PNG data in your NSData you can use: NSData *data = UIImagePNGRepresentation(img); Where img is your UIImage. There is...
[ "ios", "ios4", "uiimage" ]
1
3
719
2
0
2011-06-09T17:52:12.447000
2011-06-09T17:58:58.867000
6,297,149
6,297,206
HTML Table -- Putting a Link in the Header for Sorting? (No JavaScript)
I'm dynamically generating a table, as well as the column headers. How do I make the columns clickable ( NO JavaScript!), so that when they're clicked, they add a sort=columnNameHere entry to the query, and reload the current page with that query?
It would be helpful to know your server-side language, but since you didn't include that, you'll want the code to output html as follows... Name Location Bob Canada on the server you need to make sure you get the sort variable from the collection of get variables and apply it to the source query. In pseudocode, this wo...
HTML Table -- Putting a Link in the Header for Sorting? (No JavaScript) I'm dynamically generating a table, as well as the column headers. How do I make the columns clickable ( NO JavaScript!), so that when they're clicked, they add a sort=columnNameHere entry to the query, and reload the current page with that query?
TITLE: HTML Table -- Putting a Link in the Header for Sorting? (No JavaScript) QUESTION: I'm dynamically generating a table, as well as the column headers. How do I make the columns clickable ( NO JavaScript!), so that when they're clicked, they add a sort=columnNameHere entry to the query, and reload the current page...
[ "python", "html", "django", "hyperlink" ]
2
3
6,118
2
0
2011-06-09T17:56:38.320000
2011-06-09T18:02:27.360000
6,297,160
6,298,965
Condition in IEquatable<T>.Equals
I have implemented IEquatable to compare objects in two lists however i want to do it conditionally like this: public bool Equals(CustomerType other) { if (this.Zipcode == "11111" || this.Zipcode == "22222" || this.Zipcode== "33333") { return this.FirstName.Equals(other.FirstName) && this.LastName.Equals(other.LastNam...
Regarding the symmetry of your equals and hashcode functions and based on what you said in the comments on another answer, I believe this is the implementation you need: public bool Equals(CustomerType other) { if ((this.Zipcode == "11111" || this.Zipcode == "22222" || this.Zipcode== "33333") && (other.Zipcode == "111...
Condition in IEquatable<T>.Equals I have implemented IEquatable to compare objects in two lists however i want to do it conditionally like this: public bool Equals(CustomerType other) { if (this.Zipcode == "11111" || this.Zipcode == "22222" || this.Zipcode== "33333") { return this.FirstName.Equals(other.FirstName) && ...
TITLE: Condition in IEquatable<T>.Equals QUESTION: I have implemented IEquatable to compare objects in two lists however i want to do it conditionally like this: public bool Equals(CustomerType other) { if (this.Zipcode == "11111" || this.Zipcode == "22222" || this.Zipcode== "33333") { return this.FirstName.Equals(ot...
[ "c#", "linq", "comparison" ]
2
2
257
2
0
2011-06-09T17:57:55.343000
2011-06-09T20:40:52.547000
6,298,349
6,298,646
Why null and reference to null not the same thing
Why these two methods work differently: public List GetFoos() { int? parentId = null; var l = _dataContext.Foos.Where(x => x.ParentElementId == parentId).ToList(); return l; } public List GetFoos() { var l = _dataContext.Foos.Where(x => x.ParentElementId == null).ToList(); return l; } The first one returns nothing. Se...
That is because you can't compare to null in SQL, it has the special IS NULL operator to check for null values. The first query will be translated into a comparison, where the parameter is null: WHERE ParentElementId = @param This doesn't work, because comparing two null values doesn't yield true. The second query will...
Why null and reference to null not the same thing Why these two methods work differently: public List GetFoos() { int? parentId = null; var l = _dataContext.Foos.Where(x => x.ParentElementId == parentId).ToList(); return l; } public List GetFoos() { var l = _dataContext.Foos.Where(x => x.ParentElementId == null).ToLis...
TITLE: Why null and reference to null not the same thing QUESTION: Why these two methods work differently: public List GetFoos() { int? parentId = null; var l = _dataContext.Foos.Where(x => x.ParentElementId == parentId).ToList(); return l; } public List GetFoos() { var l = _dataContext.Foos.Where(x => x.ParentElemen...
[ "entity-framework", "c#-4.0", "null", "nullable" ]
2
4
595
3
0
2011-06-09T19:44:25.650000
2011-06-09T20:09:49.740000
6,298,352
6,298,516
When adding new jQuery functions into the DOM how do I get them to communicate with already loaded functions?
I have searched quite a bit on the web and on this site and can't seem to find an answer. If it's already been asked I apologize in advance. I have a page [ index.htm ] where I load an external javascript file that contains generic functions [ func.js ]. The function I am calling in func.js is show_message(). How I am ...
From your edit, you can see that show_message is defined within a function callback. This is a problem, because functions are defined in the current scope. They are not defined in the global scope. So when you define show_message, it is only available in the context of that particular anonymous function. You cannot acc...
When adding new jQuery functions into the DOM how do I get them to communicate with already loaded functions? I have searched quite a bit on the web and on this site and can't seem to find an answer. If it's already been asked I apologize in advance. I have a page [ index.htm ] where I load an external javascript file ...
TITLE: When adding new jQuery functions into the DOM how do I get them to communicate with already loaded functions? QUESTION: I have searched quite a bit on the web and on this site and can't seem to find an answer. If it's already been asked I apologize in advance. I have a page [ index.htm ] where I load an externa...
[ "jquery" ]
0
2
175
1
0
2011-06-09T19:44:33.403000
2011-06-09T19:59:21.953000
6,298,376
6,298,436
regex match all except two characters
I'm trying to write a regex to match the first attribute before both: and! so either PASS SKIP OR FAIL PASS: test::subtest() message SKIP: test::subtest2() message FAIL!: test::subtest3() message The following regex works ([^:]*) but it also matches the! with FAIL! So I tried ([^:!]*) but that doesn't work it doesn't m...
Can you provide more code? It works for me: ckruse@achilles ~ $ perl -e 'print "FAIL!: blabla" =~ /^([^:!]+)/? "yes: $1": "no","\n"' yes: FAIL
regex match all except two characters I'm trying to write a regex to match the first attribute before both: and! so either PASS SKIP OR FAIL PASS: test::subtest() message SKIP: test::subtest2() message FAIL!: test::subtest3() message The following regex works ([^:]*) but it also matches the! with FAIL! So I tried ([^:!...
TITLE: regex match all except two characters QUESTION: I'm trying to write a regex to match the first attribute before both: and! so either PASS SKIP OR FAIL PASS: test::subtest() message SKIP: test::subtest2() message FAIL!: test::subtest3() message The following regex works ([^:]*) but it also matches the! with FAIL...
[ "regex" ]
0
5
7,781
4
0
2011-06-09T19:47:17.473000
2011-06-09T19:52:34.923000
6,298,383
6,298,569
how to read XML using XLinq and bind it to Combo Box?
Hi I am trying to read XML File using XLinq and binding the values into Combo Box:- XDocument xmlDoc = XDocument.Load("abc.xml"); var res = from c in xmlDoc.Element("Clients").Descendants("Client") select c; cmb1.BindingContext = new BindingContext(); cmb1.DataSource = res; cmb1.DisplayMember = "Name"; cmb1.ValueMembe...
Your current query produces an IEnumerable, that doesn't give you the properties you want. // not tested var res = from c in xmlDoc.Element("Clients").Descendants("Client") select new { Name=c.Element("Name").Value, ID = c.Element("ID").Value };... cmb1.DataSource = res.ToList(); The ID will be a string.
how to read XML using XLinq and bind it to Combo Box? Hi I am trying to read XML File using XLinq and binding the values into Combo Box:- XDocument xmlDoc = XDocument.Load("abc.xml"); var res = from c in xmlDoc.Element("Clients").Descendants("Client") select c; cmb1.BindingContext = new BindingContext(); cmb1.DataSour...
TITLE: how to read XML using XLinq and bind it to Combo Box? QUESTION: Hi I am trying to read XML File using XLinq and binding the values into Combo Box:- XDocument xmlDoc = XDocument.Load("abc.xml"); var res = from c in xmlDoc.Element("Clients").Descendants("Client") select c; cmb1.BindingContext = new BindingContex...
[ "c#", "xml", "winforms", "linq-to-xml" ]
0
1
1,547
1
0
2011-06-09T19:47:54.610000
2011-06-09T20:03:14.797000
6,298,384
6,298,563
Any better approaches to doing this in C# 4.0?
foreach (DataRow row in dt.Rows ) avlCols.Add(row.ItemArray[0].ToString().Trim());
A couple of suggestions: use good variable names use the column name instead of the index use LINQ An example: var names = from personRow in personTable.AsEnumerable() select personRow["name"].ToString().Trim();
Any better approaches to doing this in C# 4.0? foreach (DataRow row in dt.Rows ) avlCols.Add(row.ItemArray[0].ToString().Trim());
TITLE: Any better approaches to doing this in C# 4.0? QUESTION: foreach (DataRow row in dt.Rows ) avlCols.Add(row.ItemArray[0].ToString().Trim()); ANSWER: A couple of suggestions: use good variable names use the column name instead of the index use LINQ An example: var names = from personRow in personTable.AsEnumerab...
[ "c#", "c#-4.0", "foreach" ]
0
1
138
3
0
2011-06-09T19:47:56.623000
2011-06-09T20:03:04.853000
6,298,390
6,298,415
Should ecapsulated objects be public or private?
I'm a little unclear as to how far to take the idea in making all members within a class private and make public methods to handle mutations. Primitive types are not the issue, it's encapsulated object that I am unclear about. The benefit of making object members private is the ability to hide methods that do not apply...
What are the dangers in having objects exposed this way? Changing the type of those objects would require changing the interface to the class. With private objects + public getters/setters, you'd only have to modify the code in the getters and setters, assuming you want to keep the things being returned the same. Note ...
Should ecapsulated objects be public or private? I'm a little unclear as to how far to take the idea in making all members within a class private and make public methods to handle mutations. Primitive types are not the issue, it's encapsulated object that I am unclear about. The benefit of making object members private...
TITLE: Should ecapsulated objects be public or private? QUESTION: I'm a little unclear as to how far to take the idea in making all members within a class private and make public methods to handle mutations. Primitive types are not the issue, it's encapsulated object that I am unclear about. The benefit of making obje...
[ "oop", "class-design", "encapsulation" ]
5
2
156
5
0
2011-06-09T19:48:22.350000
2011-06-09T19:51:08.170000
6,298,393
6,298,451
C# Serialization error
I'm trying to store object of Employee in Session (DB Based), When i do this I'm getting serialization error "Unable to serialize the session state. In 'StateServer'" [Serializable] public class Employee {... public List MyValidationResult { get; set; } } I figured out it is happening when it tries to serialize MyValid...
You could use the NonSerializedAttribute. Add a backing field and don't use an auto-implemented property and add the NonSerializedAttribute to the field and you should be good to go.
C# Serialization error I'm trying to store object of Employee in Session (DB Based), When i do this I'm getting serialization error "Unable to serialize the session state. In 'StateServer'" [Serializable] public class Employee {... public List MyValidationResult { get; set; } } I figured out it is happening when it tri...
TITLE: C# Serialization error QUESTION: I'm trying to store object of Employee in Session (DB Based), When i do this I'm getting serialization error "Unable to serialize the session state. In 'StateServer'" [Serializable] public class Employee {... public List MyValidationResult { get; set; } } I figured out it is hap...
[ "c#", "asp.net", "serialization" ]
0
2
1,246
2
0
2011-06-09T19:48:31.553000
2011-06-09T19:53:56.473000