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,214,868 | 6,215,108 | combobox binding | Please can you tell me how can I bind combobox. I had combobox which Itemsource is ObservableCollection. I wont to set Selected Combobox value to MainObject.SomeValue and vice versa. Which is the easiest way | here's a little example. I have two classes: public class Person { private string _name = "Test2"; public String Name { get { return _name; } set { _name = value; } } }
public class DataProvider { public ObservableCollection Data { get; set; }
public DataProvider() { Data = new ObservableCollection (); Data.Add("Test... | combobox binding Please can you tell me how can I bind combobox. I had combobox which Itemsource is ObservableCollection. I wont to set Selected Combobox value to MainObject.SomeValue and vice versa. Which is the easiest way | TITLE:
combobox binding
QUESTION:
Please can you tell me how can I bind combobox. I had combobox which Itemsource is ObservableCollection. I wont to set Selected Combobox value to MainObject.SomeValue and vice versa. Which is the easiest way
ANSWER:
here's a little example. I have two classes: public class Person { p... | [
"silverlight",
"combobox"
] | 0 | 1 | 814 | 1 | 0 | 2011-06-02T13:03:58.810000 | 2011-06-02T13:23:29.170000 |
6,214,870 | 6,215,066 | Rails simpleform pre data | How do I make a simple form association have pre data when editing? My form: Editing kategori <%= simple_form_for(@konkurrancer,:url => {:action => 'update',:id => @konkurrancer.id }) do |f| %> <%= f.association:kategoris %> <%= f.button:submit,:value => 'Edit konkurrence' %> <% end %> | Your best bet is to do something like this in your controller: def edit @konkurrancer = Konkurrancer.new(:title => "hello wurld",:description => "blah blah blah",:nuclear_level => 10) end Then your form should automatically populate these values as "pre data". | Rails simpleform pre data How do I make a simple form association have pre data when editing? My form: Editing kategori <%= simple_form_for(@konkurrancer,:url => {:action => 'update',:id => @konkurrancer.id }) do |f| %> <%= f.association:kategoris %> <%= f.button:submit,:value => 'Edit konkurrence' %> <% end %> | TITLE:
Rails simpleform pre data
QUESTION:
How do I make a simple form association have pre data when editing? My form: Editing kategori <%= simple_form_for(@konkurrancer,:url => {:action => 'update',:id => @konkurrancer.id }) do |f| %> <%= f.association:kategoris %> <%= f.button:submit,:value => 'Edit konkurrence' %>... | [
"ruby-on-rails",
"ruby-on-rails-3",
"simple-form"
] | 0 | 0 | 321 | 2 | 0 | 2011-06-02T13:04:00.263000 | 2011-06-02T13:20:13.040000 |
6,214,878 | 6,215,365 | python: Using the choice box to get data besides getString() | I have defined an object that has several attribute.. class thing(object): def __init__(self, type, name, attrA, attrB, attrC): self.type = type self.name = name self.attrA = attrA self.attrB = attrB self.attrC = attrC lets say then I have a list of things self.things=[thing('car','fred',1,2,3), thing('car','george',a,... | Associating data or objects with wx.Choice or wx.ComboBox is pretty easy. You can see an example using the latter here: http://www.blog.pythonlibrary.org/2010/12/16/wxpython-storing-object-in-combobox-or-listbox-widgets/ The basic idea is to pass an empty list to the control's constructor and then iterate over the obje... | python: Using the choice box to get data besides getString() I have defined an object that has several attribute.. class thing(object): def __init__(self, type, name, attrA, attrB, attrC): self.type = type self.name = name self.attrA = attrA self.attrB = attrB self.attrC = attrC lets say then I have a list of things se... | TITLE:
python: Using the choice box to get data besides getString()
QUESTION:
I have defined an object that has several attribute.. class thing(object): def __init__(self, type, name, attrA, attrB, attrC): self.type = type self.name = name self.attrA = attrA self.attrB = attrB self.attrC = attrC lets say then I have a... | [
"python",
"list",
"wxpython"
] | 0 | 2 | 961 | 1 | 0 | 2011-06-02T13:04:31.033000 | 2011-06-02T13:44:16.030000 |
6,214,886 | 6,215,107 | Two UpdatePanels working in parallel, one not updating | I have two update panels (lets call them A and B). In A, I have a simple checkbox. AutoPostback set to true. When you check it (or uncheck it), it will enable/disable a simple dropdown within the same UpdatePanel. UpdatePanel B has a long running process in it. It fires off a request for a dropdown to be created that t... | You ask too much from UpdatePanel:) UpdatePanel can not work with 2 parallel request that way. Consider to make some ajax call to get your results. Why you may ask, one basic reason is that every page have only one viewstate. When you ask from the A or the B, UpdatePanel to send/get data, then the viewstate must change... | Two UpdatePanels working in parallel, one not updating I have two update panels (lets call them A and B). In A, I have a simple checkbox. AutoPostback set to true. When you check it (or uncheck it), it will enable/disable a simple dropdown within the same UpdatePanel. UpdatePanel B has a long running process in it. It ... | TITLE:
Two UpdatePanels working in parallel, one not updating
QUESTION:
I have two update panels (lets call them A and B). In A, I have a simple checkbox. AutoPostback set to true. When you check it (or uncheck it), it will enable/disable a simple dropdown within the same UpdatePanel. UpdatePanel B has a long running ... | [
"asp.net",
"asp.net-ajax",
"updatepanel"
] | 5 | 3 | 2,587 | 1 | 0 | 2011-06-02T13:05:35.237000 | 2011-06-02T13:23:19.810000 |
6,214,887 | 6,214,987 | Simple databinding IN CODE to a DependencyProperty | My apologies as this is simplistic enough I know the question's been answered but in 30 or so pages, I've yet to find the boiled down problem I'm trying to solve. I'm not yet well practiced in SL and trying a simple version of attempting to write a TextBox that binds to a property within the screen and updates it when ... | The following should be enough to set the binding you want: textBox1.SetBinding(TextBox.TextProperty, new Binding() { Path = "TargetText", Source = this }); The problem with your code is that you set both Source and binding Path to the TargetText property and as a result you get the framework trying to bind to TargetTe... | Simple databinding IN CODE to a DependencyProperty My apologies as this is simplistic enough I know the question's been answered but in 30 or so pages, I've yet to find the boiled down problem I'm trying to solve. I'm not yet well practiced in SL and trying a simple version of attempting to write a TextBox that binds t... | TITLE:
Simple databinding IN CODE to a DependencyProperty
QUESTION:
My apologies as this is simplistic enough I know the question's been answered but in 30 or so pages, I've yet to find the boiled down problem I'm trying to solve. I'm not yet well practiced in SL and trying a simple version of attempting to write a Te... | [
"data-binding",
"silverlight-4.0",
"dependencyobject"
] | 2 | 5 | 2,889 | 1 | 0 | 2011-06-02T13:05:33.820000 | 2011-06-02T13:14:36.660000 |
6,214,896 | 6,214,996 | how to set the color of toggle button from style already defined in app xaml? | I had created a button and i want to change its color using style from app xaml. But,i don't get the exact code and i am new to xaml. Can any one help me with some example. I am also confused to use which property to change color means background or foreground? | Within a toolbar, the two statements: causes the toggle button to appear in the normal state when the toggle button is checked, however nothing changes when you hover over the checked toggle button. If I wrap the toggle button in another layout, say wrap layout: the two statements: You can find tutorial in the folowing... | how to set the color of toggle button from style already defined in app xaml? I had created a button and i want to change its color using style from app xaml. But,i don't get the exact code and i am new to xaml. Can any one help me with some example. I am also confused to use which property to change color means backgr... | TITLE:
how to set the color of toggle button from style already defined in app xaml?
QUESTION:
I had created a button and i want to change its color using style from app xaml. But,i don't get the exact code and i am new to xaml. Can any one help me with some example. I am also confused to use which property to change ... | [
"xaml",
"button",
"coding-style",
"properties"
] | 0 | 0 | 1,434 | 1 | 0 | 2011-06-02T13:06:13.427000 | 2011-06-02T13:15:18.437000 |
6,214,905 | 6,216,003 | In Habanero how would I restrict the number of objects returned from a database | I need to restrict the number of customer bo's returned from the database as I am searching for a partial customer name and at the moment I get over 600 bo's when searching for 'a'. I would like to restrict this to 20. My code at the moment is public IEnumerable FindCustomers(string partialCustomerName) { if (string.Is... | Till is on the right track there, but did not give the correct syntax. The broker is used to load collections from the current Data Accessor, not for creating new ones. So the code would then be: public IEnumerable FindCustomers(string partialCustomerName) { if (string.IsNullOrEmpty(partialCustomerName)) throw new Argu... | In Habanero how would I restrict the number of objects returned from a database I need to restrict the number of customer bo's returned from the database as I am searching for a partial customer name and at the moment I get over 600 bo's when searching for 'a'. I would like to restrict this to 20. My code at the moment... | TITLE:
In Habanero how would I restrict the number of objects returned from a database
QUESTION:
I need to restrict the number of customer bo's returned from the database as I am searching for a partial customer name and at the moment I get over 600 bo's when searching for 'a'. I would like to restrict this to 20. My ... | [
"c#",
"orm",
"habanero"
] | 1 | 1 | 74 | 3 | 0 | 2011-06-02T13:07:48.593000 | 2011-06-02T14:36:45.717000 |
6,214,914 | 6,215,602 | javascript array and jsf/richfaces | I have the following code in javascript: "samplePoints" is an array of coordinates which I can use to show markers on the map. Map is showing here: How can I provide this array from jsf/richfaces without using file (e.g. I want to fetch those data from db, create array and send to this script)? Thanks | Just let JSF print it as if it is JavaScript code. Replace var markers = []; for (var i = 0; i < samplePoints.length; i++) { markers.push(new CM.Marker(new CM.LatLng(samplePoints[i][0], samplePoints[i][1]))); } by (assuming Facelets) var markers = []; markers.push(new CM.Marker(new CM.LatLng(#{samplePoint[0]}, #{sample... | javascript array and jsf/richfaces I have the following code in javascript: "samplePoints" is an array of coordinates which I can use to show markers on the map. Map is showing here: How can I provide this array from jsf/richfaces without using file (e.g. I want to fetch those data from db, create array and send to thi... | TITLE:
javascript array and jsf/richfaces
QUESTION:
I have the following code in javascript: "samplePoints" is an array of coordinates which I can use to show markers on the map. Map is showing here: How can I provide this array from jsf/richfaces without using file (e.g. I want to fetch those data from db, create arr... | [
"java",
"javascript",
"jsf",
"richfaces"
] | 1 | 2 | 2,802 | 2 | 0 | 2011-06-02T13:08:17.560000 | 2011-06-02T14:02:26.273000 |
6,214,919 | 6,220,217 | VB6 -> VB.NET ... Cannot find the Canvas control in .NET | I am trying to convert some old VB6 code to VB.NET. The VB6 uses a Canvas control, simply Dim cv as Canvas I cannot for the life of me figure out how to use the Canvas control in VB.NET (using VS2005). MSDN says it is in the System.Windows.Controls namespace, which doesn't seem to exist? All I see is System.Windows.For... | You need to find out what the Canvas was in VB6, then you will be able to see what the nearest equivalent is in VB.Net. I think it must have been an obscure third-party control or possibly some custom code. I've not come across Canvas before in VB6 | VB6 -> VB.NET ... Cannot find the Canvas control in .NET I am trying to convert some old VB6 code to VB.NET. The VB6 uses a Canvas control, simply Dim cv as Canvas I cannot for the life of me figure out how to use the Canvas control in VB.NET (using VS2005). MSDN says it is in the System.Windows.Controls namespace, whi... | TITLE:
VB6 -> VB.NET ... Cannot find the Canvas control in .NET
QUESTION:
I am trying to convert some old VB6 code to VB.NET. The VB6 uses a Canvas control, simply Dim cv as Canvas I cannot for the life of me figure out how to use the Canvas control in VB.NET (using VS2005). MSDN says it is in the System.Windows.Contr... | [
"vb.net",
"vb6",
"wpf-controls"
] | 1 | 1 | 1,151 | 2 | 0 | 2011-06-02T13:09:02.387000 | 2011-06-02T20:49:04.697000 |
6,214,921 | 6,215,972 | opengl glDrawArray throws exception | I'm new to openGL and I need to directly use it for debuging perpose can anyone please tell me why in this code glDrawArray should throw exception (trying to access memory at 0x00000000) glEnableClientState(GL_VERTEX_ARRAY); float data[8]; data[0] = 10; data[1] = 10; data[2] = 10; data[3] = 20; data[4] = 20; data[5] = ... | Perhaps you have enabled another array with glEnableClientState at another point in your program and didn't disable it. So glDrawArrays tries to read from another array that causes the problem. EDIT:: It could also be, that the code you showed us is not the real code and you call glVertexPointer at a completely differe... | opengl glDrawArray throws exception I'm new to openGL and I need to directly use it for debuging perpose can anyone please tell me why in this code glDrawArray should throw exception (trying to access memory at 0x00000000) glEnableClientState(GL_VERTEX_ARRAY); float data[8]; data[0] = 10; data[1] = 10; data[2] = 10; da... | TITLE:
opengl glDrawArray throws exception
QUESTION:
I'm new to openGL and I need to directly use it for debuging perpose can anyone please tell me why in this code glDrawArray should throw exception (trying to access memory at 0x00000000) glEnableClientState(GL_VERTEX_ARRAY); float data[8]; data[0] = 10; data[1] = 10... | [
"c++",
"opengl-es"
] | 1 | 2 | 2,037 | 3 | 0 | 2011-06-02T13:09:08.020000 | 2011-06-02T14:34:11 |
6,214,922 | 6,215,798 | Verify method has been called with IEnumerable containing 'x' elements with Moq | I have a repository with an Add method that takes an IEnumerable as parameter: public void Add (T item) where T: class, new(){} In a unittest I want to verify that this method is called with an IEnumerable that contains exactly the same amount of elements as another IEnumerable [Test] public void InvoicesAreGeneratedFo... | From your code example you haven't set up the x => x.Add on the Moq session.Setup(x => x.Add(It.IsAny ()); Unless the Setup for x.All is meant to be x.Add? If so, you need to match the Verify and Setup exactly - a good way to do that is to extract it to a common method that returns an Expression. EDIT: Added a sample, ... | Verify method has been called with IEnumerable containing 'x' elements with Moq I have a repository with an Add method that takes an IEnumerable as parameter: public void Add (T item) where T: class, new(){} In a unittest I want to verify that this method is called with an IEnumerable that contains exactly the same amo... | TITLE:
Verify method has been called with IEnumerable containing 'x' elements with Moq
QUESTION:
I have a repository with an Add method that takes an IEnumerable as parameter: public void Add (T item) where T: class, new(){} In a unittest I want to verify that this method is called with an IEnumerable that contains ex... | [
"c#",
".net",
"unit-testing",
"moq",
"verify"
] | 7 | 4 | 3,618 | 1 | 0 | 2011-06-02T13:09:13.007000 | 2011-06-02T14:20:31.180000 |
6,214,924 | 6,251,209 | get flv video length | While i try to get length of a flv video file i get 0 second where as it only happens with some videos, else my function works fine. below is my code. 3){ if (substr($contents,0,3) == "FLV"){ $taglen = hexdec(bin2hex(substr($contents,strlen($contents)-3))); if (strlen($contents) > $taglen){ $duration = hexdec(bin2hex(s... | This type of problem occurs when the meta information of a video is partially or fully corrputed. In order to resolve this problem, use FFMPEG commnad line tool, to repair such corrupted file while uploading. below is a code snippet that extracts the video duration using FFMPEG. &1"); $duration = ob_get_contents(); $fu... | get flv video length While i try to get length of a flv video file i get 0 second where as it only happens with some videos, else my function works fine. below is my code. 3){ if (substr($contents,0,3) == "FLV"){ $taglen = hexdec(bin2hex(substr($contents,strlen($contents)-3))); if (strlen($contents) > $taglen){ $durati... | TITLE:
get flv video length
QUESTION:
While i try to get length of a flv video file i get 0 second where as it only happens with some videos, else my function works fine. below is my code. 3){ if (substr($contents,0,3) == "FLV"){ $taglen = hexdec(bin2hex(substr($contents,strlen($contents)-3))); if (strlen($contents) >... | [
"php",
"video",
"flv"
] | 5 | 7 | 6,103 | 3 | 0 | 2011-06-02T13:09:18.730000 | 2011-06-06T11:16:32.820000 |
6,214,929 | 6,215,177 | Cant explain why page wont work in IE | At the top of this page: http://andrew-muir.com/search/2/#1 - When you click on the slider it will load new results using AJAX into a div. When i chose certain prices on the slider the results look fine in IE and when i chose other prices the results come back all broken. Any ideas? Thanks! | There's a lot of invalid markup in the HTML fragment that comes back from the slider actions. You've got some unclosed tags, etc. Example: Blue Lucerne lotus jug £4250 Superb and very rare 30cm lotus jug in the bl… View details > That line with the "Superb and rare" text has an unclosed tag. When I try to look at the b... | Cant explain why page wont work in IE At the top of this page: http://andrew-muir.com/search/2/#1 - When you click on the slider it will load new results using AJAX into a div. When i chose certain prices on the slider the results look fine in IE and when i chose other prices the results come back all broken. Any ideas... | TITLE:
Cant explain why page wont work in IE
QUESTION:
At the top of this page: http://andrew-muir.com/search/2/#1 - When you click on the slider it will load new results using AJAX into a div. When i chose certain prices on the slider the results look fine in IE and when i chose other prices the results come back all... | [
"javascript",
"ajax",
"internet-explorer",
"jquery"
] | 1 | 2 | 101 | 1 | 0 | 2011-06-02T13:09:35.097000 | 2011-06-02T13:28:32.367000 |
6,214,930 | 6,214,995 | With what user should i do queries in postgres and php | Here is the current situation: I have a login page on which user enters his username and pass. Then I connect to the database using a "hardcoded" user (in the script), which opens connection to the server and executes the query to check if this data that user submitted is valid, and if so it "recognizes" him as logged ... | I don't think that's wise at all. Technically you would have your root or admin user which can DROP or ALTER tables right? You don't want it at all possible for a user to get access to your database internals. Why don't you have a separate table (at the moment that is)? If you require your users to have real database a... | With what user should i do queries in postgres and php Here is the current situation: I have a login page on which user enters his username and pass. Then I connect to the database using a "hardcoded" user (in the script), which opens connection to the server and executes the query to check if this data that user submi... | TITLE:
With what user should i do queries in postgres and php
QUESTION:
Here is the current situation: I have a login page on which user enters his username and pass. Then I connect to the database using a "hardcoded" user (in the script), which opens connection to the server and executes the query to check if this da... | [
"php",
"postgresql",
"authentication"
] | 0 | 2 | 119 | 1 | 0 | 2011-06-02T13:09:35.127000 | 2011-06-02T13:15:18.540000 |
6,214,933 | 6,214,960 | jQuery hover effect | I am new to jQuery and trying to figure out how to use the.hover(); effect in place of the.mouseover() and.mouseout() effects. Here is the scenerio: I am using a table and want to highlight the row with a CSS class that changes the background color to a light yellow. Here is the CSS:.bgHvr { background-color: #FFFACD; ... | Hover basically combines the 2 events into one..hover(mouseover,mouseout) or in your case: jQuery(document).ready(function($) { $('#table tbody tr').hover(function() { $(this).addClass('bgHvr'); },function() { $(this).removeClass('bgHvr'); }); }); | jQuery hover effect I am new to jQuery and trying to figure out how to use the.hover(); effect in place of the.mouseover() and.mouseout() effects. Here is the scenerio: I am using a table and want to highlight the row with a CSS class that changes the background color to a light yellow. Here is the CSS:.bgHvr { backgro... | TITLE:
jQuery hover effect
QUESTION:
I am new to jQuery and trying to figure out how to use the.hover(); effect in place of the.mouseover() and.mouseout() effects. Here is the scenerio: I am using a table and want to highlight the row with a CSS class that changes the background color to a light yellow. Here is the CS... | [
"jquery",
"jquery-hover"
] | 1 | 4 | 1,905 | 4 | 0 | 2011-06-02T13:10:07.390000 | 2011-06-02T13:12:37.513000 |
6,214,936 | 6,214,948 | how to read the response from a web site? | I have a website url which gives corresponding city names by taking zip code as input parameter. Now I want to know how to read the response from the site. This is the link I am using http://zipinfo.com/cgi-local/zipsrch.exe?zip=60680 | You'll have to Use the HTTPWebRequest object to connect to the site and scrape the information from the response. Look for html tags or class names that wrap the content you are trying to find, then use either regexes or string functions to get the required data. Good example here: | how to read the response from a web site? I have a website url which gives corresponding city names by taking zip code as input parameter. Now I want to know how to read the response from the site. This is the link I am using http://zipinfo.com/cgi-local/zipsrch.exe?zip=60680 | TITLE:
how to read the response from a web site?
QUESTION:
I have a website url which gives corresponding city names by taking zip code as input parameter. Now I want to know how to read the response from the site. This is the link I am using http://zipinfo.com/cgi-local/zipsrch.exe?zip=60680
ANSWER:
You'll have to U... | [
"c#",
"asp.net"
] | 1 | 2 | 7,347 | 7 | 0 | 2011-06-02T13:10:19.047000 | 2011-06-02T13:11:57.310000 |
6,214,940 | 6,215,053 | cakephp select list showing ids instead of text | i am using cakephp 1.3 to generate a form i am creating a select list using hasOne and belongsTo relation my models: image, category category hasMany image image belongsTo Category category table has two columns id and category_name i am doing $this->set('categories', $this->Image->Category->find( 'list', array( 'order... | You need to define the displayField property in your category model, so that CakePHP can properly determine which field to display as a label. This code in your category model will fix it for you: var $displayField = 'category_name'; Alternatively, rename the category_name field to 'name' or 'title' (I would do this, i... | cakephp select list showing ids instead of text i am using cakephp 1.3 to generate a form i am creating a select list using hasOne and belongsTo relation my models: image, category category hasMany image image belongsTo Category category table has two columns id and category_name i am doing $this->set('categories', $th... | TITLE:
cakephp select list showing ids instead of text
QUESTION:
i am using cakephp 1.3 to generate a form i am creating a select list using hasOne and belongsTo relation my models: image, category category hasMany image image belongsTo Category category table has two columns id and category_name i am doing $this->set... | [
"php",
"cakephp",
"cakephp-1.3"
] | 5 | 6 | 4,216 | 2 | 0 | 2011-06-02T13:10:58.027000 | 2011-06-02T13:19:26.620000 |
6,214,941 | 6,215,015 | problem with "title" in UINavigationController | I am having a problem with title and UINavigationController. I am using the following code at UIViewControllerCurrent and when I get back from NextViewController, the title of the NavBar is still "Previous"..Can anyone kindly help me out with this problem? Thanks. [self setTitle:@"Previous"]; NextViewController *contro... | I would try to exchange the two lines [self setTitle:@"Real Title"]; [super viewWillAppear:animated]; so that you get [super viewDidAppear:animated]; [self setTitle:@"Real Title"]; and I would put these into viewDidAppear. | problem with "title" in UINavigationController I am having a problem with title and UINavigationController. I am using the following code at UIViewControllerCurrent and when I get back from NextViewController, the title of the NavBar is still "Previous"..Can anyone kindly help me out with this problem? Thanks. [self se... | TITLE:
problem with "title" in UINavigationController
QUESTION:
I am having a problem with title and UINavigationController. I am using the following code at UIViewControllerCurrent and when I get back from NextViewController, the title of the NavBar is still "Previous"..Can anyone kindly help me out with this problem... | [
"iphone",
"ios",
"uinavigationcontroller",
"uinavigationbar",
"title"
] | 0 | 2 | 1,671 | 3 | 0 | 2011-06-02T13:11:09.417000 | 2011-06-02T13:16:47.823000 |
6,214,945 | 6,215,204 | Extract Email Address from Thunderbird Emails | I want to extract all the email addresses found in a Thunderbird email file. Sometimes the emails are incased in spaces, sometimes in <> and possibly other ways. I'm able to find where a @ occurs on each string, but how do I grab the characters before and after it that form the email? Thanks. | Regex was born for this kind of job. Here's a minimal console application that shows how you can use RegEx to extract all email addresses from one long block of text: program Project25;
{$APPTYPE CONSOLE}
uses SysUtils, PerlRegex;
var PR: TPerlRegEx; TestString: string;
begin
// Initialize a test string to include... | Extract Email Address from Thunderbird Emails I want to extract all the email addresses found in a Thunderbird email file. Sometimes the emails are incased in spaces, sometimes in <> and possibly other ways. I'm able to find where a @ occurs on each string, but how do I grab the characters before and after it that form... | TITLE:
Extract Email Address from Thunderbird Emails
QUESTION:
I want to extract all the email addresses found in a Thunderbird email file. Sometimes the emails are incased in spaces, sometimes in <> and possibly other ways. I'm able to find where a @ occurs on each string, but how do I grab the characters before and ... | [
"delphi"
] | 3 | 5 | 1,708 | 2 | 0 | 2011-06-02T13:11:30.117000 | 2011-06-02T13:31:05.830000 |
6,214,946 | 6,215,394 | How to dynamically generate mathematica code? | I want to make a mini programming language in mma. From a textfile to Module(s) in a Package. Ideally I should be able to generate the package and modules from within Mathematica by functions in another package. Question: Is this possible? I am looking for a reference or an example to get this started. EDIT: For exampl... | Your question has several parts. First, if you want to use some non-mma syntax for your language, you need to make a parser from your language to mma expression (AST of your code). I will leave this one out (since this is a separate topic) and assume that you are willing to use mma syntax or have means to transfer your... | How to dynamically generate mathematica code? I want to make a mini programming language in mma. From a textfile to Module(s) in a Package. Ideally I should be able to generate the package and modules from within Mathematica by functions in another package. Question: Is this possible? I am looking for a reference or an... | TITLE:
How to dynamically generate mathematica code?
QUESTION:
I want to make a mini programming language in mma. From a textfile to Module(s) in a Package. Ideally I should be able to generate the package and modules from within Mathematica by functions in another package. Question: Is this possible? I am looking for... | [
"wolfram-mathematica"
] | 10 | 13 | 1,727 | 2 | 0 | 2011-06-02T13:11:37.123000 | 2011-06-02T13:46:57.333000 |
6,214,953 | 6,215,085 | Any visual studio 2010 extension for auto concatenation on new line? | i have this question about visual studio 2010... in mono develop, when i have a string like this: string s = "hello, how are you"; and if i press enter key on the beginning of the "how...", the code changes automatically to this: string s = "hello, " + "how are you?"; Is some extension in visual studio 2010 for this au... | Are you expecting any escape sequences in your string? If not, you can just use a Verbatim String Literal: string s = @"Hello, how are you?"; Then you have no need for a VS extension. Obviously, this will only work if you are not concerned with the additional whitespace which will get added. If you need to just split t... | Any visual studio 2010 extension for auto concatenation on new line? i have this question about visual studio 2010... in mono develop, when i have a string like this: string s = "hello, how are you"; and if i press enter key on the beginning of the "how...", the code changes automatically to this: string s = "hello, " ... | TITLE:
Any visual studio 2010 extension for auto concatenation on new line?
QUESTION:
i have this question about visual studio 2010... in mono develop, when i have a string like this: string s = "hello, how are you"; and if i press enter key on the beginning of the "how...", the code changes automatically to this: str... | [
"c#",
"visual-studio-2010",
"string-concatenation"
] | 5 | 2 | 1,196 | 1 | 0 | 2011-06-02T13:12:18.687000 | 2011-06-02T13:21:45.647000 |
6,214,975 | 6,215,429 | Which mechanism is a better way to extend Dictionary to deal with missing keys and why? | There is a minor annoyance I find myself with a lot - I have a Dictionary that contains values that may or may not be there. So normal behaviour would be to use the indexer, like this: object result = myDictionary["key"]; However, if "key" is not in the dictionary this throws a KeyNotFoundException, so you do this inst... | When naming an extension method intended to replace an existing method, I tend to add to the method name for specificity rather than shortening it: GetValueOrDefault(...) As for the ForgivingDictionary, you can constrain TKey so that it can't be a value type. However, if you must deal with value types in it, you're goi... | Which mechanism is a better way to extend Dictionary to deal with missing keys and why? There is a minor annoyance I find myself with a lot - I have a Dictionary that contains values that may or may not be there. So normal behaviour would be to use the indexer, like this: object result = myDictionary["key"]; However, i... | TITLE:
Which mechanism is a better way to extend Dictionary to deal with missing keys and why?
QUESTION:
There is a minor annoyance I find myself with a lot - I have a Dictionary that contains values that may or may not be there. So normal behaviour would be to use the indexer, like this: object result = myDictionary[... | [
"c#",
"dictionary",
"extension-methods",
"keynotfoundexception"
] | 17 | 9 | 7,335 | 3 | 0 | 2011-06-02T13:13:58.390000 | 2011-06-02T13:49:33.863000 |
6,214,981 | 6,215,158 | Is it possible to run a PHP function after each line of a PHP script is executed? | My question is similar to this: Is it possible to run code after each line in Ruby? However I want to do it in PHP. Is it possible and if so, how? | You can register a tick handler: Ticks A tick is an event that occurs for every N low-level tickable statements executed by the parser within the declare block. The value for N is specified using ticks=N within the declare blocks's directive section. Not all statements are tickable. Typically, condition expressions and... | Is it possible to run a PHP function after each line of a PHP script is executed? My question is similar to this: Is it possible to run code after each line in Ruby? However I want to do it in PHP. Is it possible and if so, how? | TITLE:
Is it possible to run a PHP function after each line of a PHP script is executed?
QUESTION:
My question is similar to this: Is it possible to run code after each line in Ruby? However I want to do it in PHP. Is it possible and if so, how?
ANSWER:
You can register a tick handler: Ticks A tick is an event that o... | [
"php",
"apache"
] | 7 | 11 | 1,193 | 3 | 0 | 2011-06-02T13:14:24.563000 | 2011-06-02T13:26:53.137000 |
6,214,982 | 6,215,024 | illegal 0000-00-00 00:00:00 timestamp being sent by php to mysql using codeigniter | here is a Database_update_entry function in my CodeIgniter model which gets executed upon successful form submission. $this->input->post('item_sl'), 'item_name' => $this->input->post('item_name'), 'img_url' => $this->input->post('img_url'), 'sound_url' => $this->input->post('sound_url'), 'price' => $this->input->post('... | mysql timestamp field accept yyyy-mm-dd H:i:s format of date so you have to pass date into this format not the UNIX timestamp instead of this 'timestamp' => time() Use 'timestamp' => date('Y-m-d H:i:s') If you really want to store UNIX time stamp change the field type to CHAR | illegal 0000-00-00 00:00:00 timestamp being sent by php to mysql using codeigniter here is a Database_update_entry function in my CodeIgniter model which gets executed upon successful form submission. $this->input->post('item_sl'), 'item_name' => $this->input->post('item_name'), 'img_url' => $this->input->post('img_url... | TITLE:
illegal 0000-00-00 00:00:00 timestamp being sent by php to mysql using codeigniter
QUESTION:
here is a Database_update_entry function in my CodeIgniter model which gets executed upon successful form submission. $this->input->post('item_sl'), 'item_name' => $this->input->post('item_name'), 'img_url' => $this->in... | [
"php",
"mysql",
"codeigniter",
"timestamp"
] | 6 | 5 | 2,506 | 4 | 0 | 2011-06-02T13:14:26.810000 | 2011-06-02T13:17:24.960000 |
6,214,990 | 6,215,027 | rewrite the url in .htaccess | i have a link like http://for.example.com/?type=foo-bar and i want it to be displayed in the address bar like this http://for.example.com/foo-bar so when the user types http://for.example.com/foo-bar it should re-direct to http://for.example.com/?type=foo-bar without the user knowing about the backend query string proc... | RewriteEngine On RewriteBase /
RewriteRule ^foo-bar?$ index.php?type=foo-bar [QSA,L] Or if you want to use different variables (values) instead of "bar" RewriteRule ^foo-([A-Za-z0-9_]+)?$ index.php?type=foo&someVar=$1 [QSA,L] But you couldn't use dash (-) after "foo-", only alphanumeric and underscore. | rewrite the url in .htaccess i have a link like http://for.example.com/?type=foo-bar and i want it to be displayed in the address bar like this http://for.example.com/foo-bar so when the user types http://for.example.com/foo-bar it should re-direct to http://for.example.com/?type=foo-bar without the user knowing about ... | TITLE:
rewrite the url in .htaccess
QUESTION:
i have a link like http://for.example.com/?type=foo-bar and i want it to be displayed in the address bar like this http://for.example.com/foo-bar so when the user types http://for.example.com/foo-bar it should re-direct to http://for.example.com/?type=foo-bar without the u... | [
"php",
".htaccess"
] | 0 | 0 | 62 | 1 | 0 | 2011-06-02T13:14:58.183000 | 2011-06-02T13:17:54.757000 |
6,215,000 | 6,215,119 | How to save files locally using html5 | how can i download mp3 files locally and then play them using a html5 player, the files should be there even user quit the browser or even come back after couple of days. | HTML5 introduced the manifest attribute to the HTML element, which lets you specify a manifest of files to cache locally. All of the examples I saw cache only HTML, CSS, and JS pages, but you could experiment with caching other types of data. For more information, see: http://www.webreference.com/authoring/languages/ht... | How to save files locally using html5 how can i download mp3 files locally and then play them using a html5 player, the files should be there even user quit the browser or even come back after couple of days. | TITLE:
How to save files locally using html5
QUESTION:
how can i download mp3 files locally and then play them using a html5 player, the files should be there even user quit the browser or even come back after couple of days.
ANSWER:
HTML5 introduced the manifest attribute to the HTML element, which lets you specify ... | [
"html5-audio",
"html"
] | 0 | 0 | 3,605 | 2 | 0 | 2011-06-02T13:15:27.970000 | 2011-06-02T13:24:09.287000 |
6,215,001 | 6,215,559 | Convert XML file using XSLT in Android | I am new to Android. I want to convert a XML file to HTML format using XSLT to display it in android. Can you please tell me some tutorials or examples to follow? I also tried the codes in the Android: Convert xml using xslt But it didn't work. I am not sure what is "StringOutputStream" there. Thanks in advance. | Put both your xml and xslt file in raw folder. The generated html file will be stored in sdcard. Use the following code. import java.io.File;
import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerEx... | Convert XML file using XSLT in Android I am new to Android. I want to convert a XML file to HTML format using XSLT to display it in android. Can you please tell me some tutorials or examples to follow? I also tried the codes in the Android: Convert xml using xslt But it didn't work. I am not sure what is "StringOutputS... | TITLE:
Convert XML file using XSLT in Android
QUESTION:
I am new to Android. I want to convert a XML file to HTML format using XSLT to display it in android. Can you please tell me some tutorials or examples to follow? I also tried the codes in the Android: Convert xml using xslt But it didn't work. I am not sure what... | [
"android",
"xml",
"xslt"
] | 1 | 4 | 6,005 | 2 | 0 | 2011-06-02T13:15:30.717000 | 2011-06-02T13:58:04.517000 |
6,215,008 | 6,215,045 | Will the thread exit automatically when `func` finishes? | Is calling pthread_exit explicitly from the thread routine required? Example code: pthread_create(&pth, NULL, (void *)func, parg);... func() {... //do I have to call pthread_exit() here? return 0; } | The pthread_create documentation says: If the start_routine returns, the effect is as if there was an implicit call to pthread_exit() using the return value of start_routine as the exit status. So no, no need to call it explicitly. | Will the thread exit automatically when `func` finishes? Is calling pthread_exit explicitly from the thread routine required? Example code: pthread_create(&pth, NULL, (void *)func, parg);... func() {... //do I have to call pthread_exit() here? return 0; } | TITLE:
Will the thread exit automatically when `func` finishes?
QUESTION:
Is calling pthread_exit explicitly from the thread routine required? Example code: pthread_create(&pth, NULL, (void *)func, parg);... func() {... //do I have to call pthread_exit() here? return 0; }
ANSWER:
The pthread_create documentation says... | [
"c",
"multithreading"
] | 2 | 4 | 81 | 1 | 0 | 2011-06-02T13:16:19.687000 | 2011-06-02T13:19:12.550000 |
6,215,013 | 6,226,221 | How do I get CruiseControl.NET to show failure when aborting a build? | Currently if I abort a CC.NET build the project last build status is shown as Success, I would prefer it to say Failure. How can I make that happen? | I don't think you can - its has been added in version 1.6 by design. | How do I get CruiseControl.NET to show failure when aborting a build? Currently if I abort a CC.NET build the project last build status is shown as Success, I would prefer it to say Failure. How can I make that happen? | TITLE:
How do I get CruiseControl.NET to show failure when aborting a build?
QUESTION:
Currently if I abort a CC.NET build the project last build status is shown as Success, I would prefer it to say Failure. How can I make that happen?
ANSWER:
I don't think you can - its has been added in version 1.6 by design. | [
"cruisecontrol.net"
] | 2 | 3 | 177 | 1 | 0 | 2011-06-02T13:16:33.267000 | 2011-06-03T11:00:21.860000 |
6,215,016 | 6,215,215 | Getting "undefined method `model_name' for NilClass:Class" in Rails 3, jQuery, Ajax | When a radio button is checked, the whole form is submitted. The answers_controller (below) does update the result, so everything works, but i get the aforementioned error in the console. I realize that in my update_result.js.erb (below) nothing is assigned to the @answers variable but i have been unable to make adjust... | Change the action like this: def update_result @answers = []
params[:answer].each_pair do |key,value| ans = Answer.find(key.to_i) ans.update_attributes(:score => value) @answers << ans end end Change the update_result.js.erb like this: $("#answers").html("#{escape_javascript(render(@answers))}"); | Getting "undefined method `model_name' for NilClass:Class" in Rails 3, jQuery, Ajax When a radio button is checked, the whole form is submitted. The answers_controller (below) does update the result, so everything works, but i get the aforementioned error in the console. I realize that in my update_result.js.erb (below... | TITLE:
Getting "undefined method `model_name' for NilClass:Class" in Rails 3, jQuery, Ajax
QUESTION:
When a radio button is checked, the whole form is submitted. The answers_controller (below) does update the result, so everything works, but i get the aforementioned error in the console. I realize that in my update_re... | [
"jquery",
"ajax",
"ruby-on-rails-3"
] | 0 | 1 | 1,361 | 1 | 0 | 2011-06-02T13:16:50.127000 | 2011-06-02T13:32:12.620000 |
6,215,021 | 6,215,080 | Switch Views Within UITabBar Tab Using Segmented Control | I am working on an app that allows two media galleries to be loaded into the same tab. They have separate XIB files and are loaded as such. However, once I switch views using the segmented control the UITabBar disappears. This is how I am switching the views: //Switch Views - (IBAction)segmentSwitch:(id)sender { if([se... | The reason why your view disappear is that you are showing a modal view controller on top of it: [self presentModalViewController: v2 animated: YES]; As you know a modal view controller takes the whole display space for it. What are you trying to accomplish with your segmented control? EDIT: in order to change the curr... | Switch Views Within UITabBar Tab Using Segmented Control I am working on an app that allows two media galleries to be loaded into the same tab. They have separate XIB files and are loaded as such. However, once I switch views using the segmented control the UITabBar disappears. This is how I am switching the views: //S... | TITLE:
Switch Views Within UITabBar Tab Using Segmented Control
QUESTION:
I am working on an app that allows two media galleries to be loaded into the same tab. They have separate XIB files and are loaded as such. However, once I switch views using the segmented control the UITabBar disappears. This is how I am switch... | [
"iphone",
"uitabbarcontroller",
"uitabbar",
"uisegmentedcontrol"
] | 0 | 2 | 1,432 | 2 | 0 | 2011-06-02T13:17:15.753000 | 2011-06-02T13:21:22.843000 |
6,215,030 | 6,215,195 | QR Code generation in shell / mac terminal | I want to create QR codes for a project I'm working on in applescript the resulting qr will be placed in the indesign document. I have found that there is a plugin for indesign but I suspect that requires user interaction. So I've been search for how to generate the qr using a shell command. I've found things related t... | For doing something similar, we use libqrencode. It's a c library for generating QR codes, but it comes with a command line utility (called qrencode) which lets you generate QR codes from a string, e.g.:./qrencode -o /tmp/foo.png "This is the input string" It supports most options you'd probably want (e.g. error correc... | QR Code generation in shell / mac terminal I want to create QR codes for a project I'm working on in applescript the resulting qr will be placed in the indesign document. I have found that there is a plugin for indesign but I suspect that requires user interaction. So I've been search for how to generate the qr using a... | TITLE:
QR Code generation in shell / mac terminal
QUESTION:
I want to create QR codes for a project I'm working on in applescript the resulting qr will be placed in the indesign document. I have found that there is a plugin for indesign but I suspect that requires user interaction. So I've been search for how to gener... | [
"perl",
"shell",
"terminal",
"applescript",
"image-events"
] | 29 | 25 | 16,594 | 2 | 0 | 2011-06-02T13:18:05.740000 | 2011-06-02T13:30:17.160000 |
6,215,037 | 6,215,214 | Play mp3 on iPad Safari | Is it possible to play embedded MP3 on iPad Safari (the way you do on normal desktop browsers)? If yes, do we need to code separately for iPad Safari? The reason I am asking is bcoz in my app, the desktop code for mp3 is not working on iPad.. The code for desktop is | To add to the excellent answers of Blindy and John, the IPad should be HTML5 compliant which means that you can use the HTML5 audio and vido tags. You can read more about this at The Safari Developer Library. | Play mp3 on iPad Safari Is it possible to play embedded MP3 on iPad Safari (the way you do on normal desktop browsers)? If yes, do we need to code separately for iPad Safari? The reason I am asking is bcoz in my app, the desktop code for mp3 is not working on iPad.. The code for desktop is | TITLE:
Play mp3 on iPad Safari
QUESTION:
Is it possible to play embedded MP3 on iPad Safari (the way you do on normal desktop browsers)? If yes, do we need to code separately for iPad Safari? The reason I am asking is bcoz in my app, the desktop code for mp3 is not working on iPad.. The code for desktop is
ANSWER:
To... | [
"javascript",
"html",
"ipad",
"safari",
"webkit"
] | 0 | 1 | 4,946 | 3 | 0 | 2011-06-02T13:18:47.813000 | 2011-06-02T13:32:10.453000 |
6,215,042 | 6,215,935 | How to deploy pinax with virtualenv? | I developed one application with Pinax http://pinaxproject.com/. I created project by pinax-admin setup_project mysite -b social in my local virtualenv, i want to deploy my project to my Centos server, so how to setup the libraries? you know i setup many libraries by pinax-admin setup_project mysite -b social and all l... | Generally you create a new virtualenv on your server and install your dependencies into it. The documentation recommends zc.buildout: http://pinaxproject.com/docs/dev/buildout/. | How to deploy pinax with virtualenv? I developed one application with Pinax http://pinaxproject.com/. I created project by pinax-admin setup_project mysite -b social in my local virtualenv, i want to deploy my project to my Centos server, so how to setup the libraries? you know i setup many libraries by pinax-admin set... | TITLE:
How to deploy pinax with virtualenv?
QUESTION:
I developed one application with Pinax http://pinaxproject.com/. I created project by pinax-admin setup_project mysite -b social in my local virtualenv, i want to deploy my project to my Centos server, so how to setup the libraries? you know i setup many libraries ... | [
"python",
"django",
"pinax"
] | 1 | 0 | 425 | 1 | 0 | 2011-06-02T13:19:04.823000 | 2011-06-02T14:31:35.967000 |
6,215,046 | 6,215,255 | textbox textchanged event always firing | I have a form with a few text-boxes and a Grid-view. There is this one text-box called "Inward Number", whose text-changed event fires all the time. When i want to fire another control's event, it simply fires the text-changed event of the Inward Number text-box. This happens with all of the other controls. Can someone... | http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.ontextchanged.aspx A TextBox control must persist some values between posts to the server for this event to work correctly. Be sure that view state is enabled for this control. Try enabling ViewState for TextBox. | textbox textchanged event always firing I have a form with a few text-boxes and a Grid-view. There is this one text-box called "Inward Number", whose text-changed event fires all the time. When i want to fire another control's event, it simply fires the text-changed event of the Inward Number text-box. This happens wit... | TITLE:
textbox textchanged event always firing
QUESTION:
I have a form with a few text-boxes and a Grid-view. There is this one text-box called "Inward Number", whose text-changed event fires all the time. When i want to fire another control's event, it simply fires the text-changed event of the Inward Number text-box... | [
"asp.net",
"visual-studio-2008"
] | 2 | 3 | 7,639 | 2 | 0 | 2011-06-02T13:19:12.617000 | 2011-06-02T13:34:27.593000 |
6,215,049 | 6,215,098 | escaping string - php in html element | i know this is really obvious but i just don't know what I'm missing. $option[] = " user ";` thanks | Try this: $option[] = ' user ';` Three differences from your code: I reversed your use of quotes...easier to wrap a PHP string that contains HTML in single quotes (since HTML uses double quotes). I modified the parenthesis around your ternary operator...it was only wrapped around the condition, and not the true/false r... | escaping string - php in html element i know this is really obvious but i just don't know what I'm missing. $option[] = " user ";` thanks | TITLE:
escaping string - php in html element
QUESTION:
i know this is really obvious but i just don't know what I'm missing. $option[] = " user ";` thanks
ANSWER:
Try this: $option[] = ' user ';` Three differences from your code: I reversed your use of quotes...easier to wrap a PHP string that contains HTML in single... | [
"php",
"html"
] | 0 | 2 | 65 | 3 | 0 | 2011-06-02T13:19:17.533000 | 2011-06-02T13:22:25.583000 |
6,215,052 | 6,215,079 | How to insert a string to a text field programatically in JavaScript | I would like to add a string of text to a text field using JavaScript but I don't want to use the onClick or onLoad events to do so. I simply want the JavaScript to be executed as soon as the browser reads it and the JavaScript will be within the body of the html. The text field is something like: I have tried somethin... | did you try getting this by document.getElementById() assuming edit-mail is your textbox id | How to insert a string to a text field programatically in JavaScript I would like to add a string of text to a text field using JavaScript but I don't want to use the onClick or onLoad events to do so. I simply want the JavaScript to be executed as soon as the browser reads it and the JavaScript will be within the body... | TITLE:
How to insert a string to a text field programatically in JavaScript
QUESTION:
I would like to add a string of text to a text field using JavaScript but I don't want to use the onClick or onLoad events to do so. I simply want the JavaScript to be executed as soon as the browser reads it and the JavaScript will ... | [
"javascript",
"dom-events"
] | 1 | 8 | 4,993 | 5 | 0 | 2011-06-02T13:19:24.770000 | 2011-06-02T13:21:21.993000 |
6,215,059 | 6,216,779 | How do I use class variables from class and instance methods which are mixed in via a Module | I want to be able to make an option passed to my class method (auditable) available to instance methods. I'm mixing in both the class and instance methods using a Module. The obvious choice is to use a class variable, but I get an error when trying access it: uninitialized class variable @@auditable_only_once in Audita... | Using @@ class instance variables is irregular and the number of of occasions when they're strictly required is exceedingly rare. Most of the time they just seem to cause trouble or confusion. Generally you can use regular instance variables in the class context without issue. What you might want to do is use a differe... | How do I use class variables from class and instance methods which are mixed in via a Module I want to be able to make an option passed to my class method (auditable) available to instance methods. I'm mixing in both the class and instance methods using a Module. The obvious choice is to use a class variable, but I get... | TITLE:
How do I use class variables from class and instance methods which are mixed in via a Module
QUESTION:
I want to be able to make an option passed to my class method (auditable) available to instance methods. I'm mixing in both the class and instance methods using a Module. The obvious choice is to use a class v... | [
"ruby",
"class-variables"
] | 1 | 0 | 218 | 1 | 0 | 2011-06-02T13:19:46.213000 | 2011-06-02T15:37:45.883000 |
6,215,065 | 6,234,223 | Why do I get CancelledKeyException when going through the keys? | Why do I get the CancelledKeyException few times a day? Should I do something about it? Is my code wrong? Iterator keys = selector.selectedKeys().iterator(); while (keys.hasNext()) {
SelectionKey key = (SelectionKey) keys.next(); keys.remove();
try { if (key.isValid()) { if (key.isReadable()) { readHandler.handle((Co... | One of the handlers may close the channel. For example, the read handler should close the channel if it reads a -1. So the write handler will then fail. Indeed isWritable() will fail, as I can now see from your stack trace. So you must test isValid() with every other condition, e.g. isValid() && isReadable(), isValid()... | Why do I get CancelledKeyException when going through the keys? Why do I get the CancelledKeyException few times a day? Should I do something about it? Is my code wrong? Iterator keys = selector.selectedKeys().iterator(); while (keys.hasNext()) {
SelectionKey key = (SelectionKey) keys.next(); keys.remove();
try { if ... | TITLE:
Why do I get CancelledKeyException when going through the keys?
QUESTION:
Why do I get the CancelledKeyException few times a day? Should I do something about it? Is my code wrong? Iterator keys = selector.selectedKeys().iterator(); while (keys.hasNext()) {
SelectionKey key = (SelectionKey) keys.next(); keys.re... | [
"java",
"exception",
"networking",
"nio"
] | 12 | 8 | 11,860 | 3 | 0 | 2011-06-02T13:20:07.830000 | 2011-06-04T02:03:04.777000 |
6,215,067 | 6,215,401 | Binding to nested properties where observables in the chain can be null | I just read about KnockoutJS and when I try to bind to sub-properties on objects that can be null I get binding errors, e.g.: So once you call ko.applyBindings it tries to evaluate the above expression and if selectedAccount is null (which it is by default) it throws an error. I know that I can create a dependentObserv... | A couple thoughts: If you don't want to bother with the dependentObservable, then you can place your statement directly in the text binding like: or even shorter: Depending on your scenario, you can also use the template binding to your advantage when dealing with potentially null values. It would be like this: Additio... | Binding to nested properties where observables in the chain can be null I just read about KnockoutJS and when I try to bind to sub-properties on objects that can be null I get binding errors, e.g.: So once you call ko.applyBindings it tries to evaluate the above expression and if selectedAccount is null (which it is by... | TITLE:
Binding to nested properties where observables in the chain can be null
QUESTION:
I just read about KnockoutJS and when I try to bind to sub-properties on objects that can be null I get binding errors, e.g.: So once you call ko.applyBindings it tries to evaluate the above expression and if selectedAccount is nu... | [
"data-binding",
"knockout.js"
] | 7 | 14 | 7,461 | 1 | 0 | 2011-06-02T13:20:15.707000 | 2011-06-02T13:47:22.747000 |
6,215,068 | 6,215,115 | Why does the sun jdk source code not contain the javax.servlet package? | I tried to find the source code of the javax.servlet package in the jdk source code, but it seems the jdk doesn't contains the package. Where can I download the package? | Why the sun jdk source code dose not contains the javax.servlet package? Because it is part of Java EE, not Java SE. where can I download the package? The JARs are part of your Java EE platform; e.g. Tomcat, JBoss, Glassfish, etc. | Why does the sun jdk source code not contain the javax.servlet package? I tried to find the source code of the javax.servlet package in the jdk source code, but it seems the jdk doesn't contains the package. Where can I download the package? | TITLE:
Why does the sun jdk source code not contain the javax.servlet package?
QUESTION:
I tried to find the source code of the javax.servlet package in the jdk source code, but it seems the jdk doesn't contains the package. Where can I download the package?
ANSWER:
Why the sun jdk source code dose not contains the j... | [
"java"
] | 9 | 12 | 3,212 | 2 | 0 | 2011-06-02T13:20:22.860000 | 2011-06-02T13:23:58.223000 |
6,215,074 | 6,215,159 | RotateAnimation without duration | guys. i have this code (asyncTask) my animation() function: public void animation() { int currentRotation = 0; anim = new RotateAnimation(currentRotation, (360*4), Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f); currentRotation = (currentRotation + 45) % 360; anim.setInterpolator(new LinearInterpola... | I think you should look at repeat mode. The duration is the time for one loop through the animation, if you set it up to repeat after that, then it can go on forever. See this and that. For instance, you could use: anim.setRepeatCount(Animation.INFINITE); anim.setRepeatMode(Animation.RESTART); | RotateAnimation without duration guys. i have this code (asyncTask) my animation() function: public void animation() { int currentRotation = 0; anim = new RotateAnimation(currentRotation, (360*4), Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f); currentRotation = (currentRotation + 45) % 360; anim.se... | TITLE:
RotateAnimation without duration
QUESTION:
guys. i have this code (asyncTask) my animation() function: public void animation() { int currentRotation = 0; anim = new RotateAnimation(currentRotation, (360*4), Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f); currentRotation = (currentRotation + ... | [
"android",
"animation",
"rotation"
] | 6 | 12 | 9,498 | 2 | 0 | 2011-06-02T13:21:01.953000 | 2011-06-02T13:26:57.157000 |
6,215,076 | 6,215,210 | jQuery code - IE8 problem | I have this code that changes input fields name attribute value, works great in all major browsers except IE8, IE7 and IE6. For IE the name just stay name="participant_name[{i}]", should be name="participant_name[1]". var i = 1; var input_name = null; $('.dubl input').each(function () { var new_input_name = $(this).att... | It is in fact changing the attribute name correctly in IE as well. However, I think the problem you may be experiencing is that when you submit the form, it isn't the updated field name. IE doesn't take into account that name change and as such, when the form is sent, it is still using the same name as it was when it w... | jQuery code - IE8 problem I have this code that changes input fields name attribute value, works great in all major browsers except IE8, IE7 and IE6. For IE the name just stay name="participant_name[{i}]", should be name="participant_name[1]". var i = 1; var input_name = null; $('.dubl input').each(function () { var ne... | TITLE:
jQuery code - IE8 problem
QUESTION:
I have this code that changes input fields name attribute value, works great in all major browsers except IE8, IE7 and IE6. For IE the name just stay name="participant_name[{i}]", should be name="participant_name[1]". var i = 1; var input_name = null; $('.dubl input').each(fu... | [
"jquery"
] | 0 | 1 | 195 | 3 | 0 | 2011-06-02T13:21:03.717000 | 2011-06-02T13:31:44.570000 |
6,215,078 | 6,215,212 | How-to parse XML key:value pair | I have a clients server returning the following (strange) XML response; how do I access each key:value pair? $xml = ' success 1000 9999 '; I was hoping that the following would work, but it appears not. $test = new SimpleXMLElement($xml); echo "Mask: ". $xml->response->mask; // Mask: 9999 | If you want a specific element, you can use XPath: $matches = $test->xpath('//string[@key="mask"]'); (this requires PHP 5.2) This would give you: Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [key] => mask )
[0] => 9999 ) ) If you want all elements, you have to iterate over all string elements and ... | How-to parse XML key:value pair I have a clients server returning the following (strange) XML response; how do I access each key:value pair? $xml = ' success 1000 9999 '; I was hoping that the following would work, but it appears not. $test = new SimpleXMLElement($xml); echo "Mask: ". $xml->response->mask; // Mask: 999... | TITLE:
How-to parse XML key:value pair
QUESTION:
I have a clients server returning the following (strange) XML response; how do I access each key:value pair? $xml = ' success 1000 9999 '; I was hoping that the following would work, but it appears not. $test = new SimpleXMLElement($xml); echo "Mask: ". $xml->response->... | [
"php",
"xml"
] | 1 | 3 | 3,794 | 3 | 0 | 2011-06-02T13:21:19.920000 | 2011-06-02T13:31:53.490000 |
6,215,081 | 6,215,176 | Securely serving up data via API to app and the residing site | I'm not quite sure if an API is the way to go with this, so a little background. I have been building up a back end which has a very useful set of data and tools for someone to run a site. The front end also uses the same data to show to customers, as one would expect. A mobile app could probably be added in the near f... | You should use a public/private key. Your front/back end's, mobile versions, or even 3rd party developers will then use the their keys to authenticate each other. | Securely serving up data via API to app and the residing site I'm not quite sure if an API is the way to go with this, so a little background. I have been building up a back end which has a very useful set of data and tools for someone to run a site. The front end also uses the same data to show to customers, as one wo... | TITLE:
Securely serving up data via API to app and the residing site
QUESTION:
I'm not quite sure if an API is the way to go with this, so a little background. I have been building up a back end which has a very useful set of data and tools for someone to run a site. The front end also uses the same data to show to cu... | [
"php",
"api"
] | 0 | 0 | 69 | 1 | 0 | 2011-06-02T13:21:35.440000 | 2011-06-02T13:28:27.380000 |
6,215,092 | 6,215,360 | Why basic_ifstream show me wrong results? | I have a binary file. There are 2288*2288 longitude float values stored in top half section, and the same number of latitude float values occupied the bottom half. I used the following code to load them into a float vector. It can run like a charm, but gave me incorrect results. With regard to my binary file, the float... | To make std::basic_ifstream works, you have to define your trait_type so that it provides everything expected by input stream, and I'm not sure that it will be possible. That will be far more than just a codecvt (which you seem to think is already present while the standard demand only the wchar_t, char and char, char ... | Why basic_ifstream show me wrong results? I have a binary file. There are 2288*2288 longitude float values stored in top half section, and the same number of latitude float values occupied the bottom half. I used the following code to load them into a float vector. It can run like a charm, but gave me incorrect results... | TITLE:
Why basic_ifstream show me wrong results?
QUESTION:
I have a binary file. There are 2288*2288 longitude float values stored in top half section, and the same number of latitude float values occupied the bottom half. I used the following code to load them into a float vector. It can run like a charm, but gave me... | [
"c++",
"file",
"binary",
"ifstream"
] | 2 | 0 | 535 | 2 | 0 | 2011-06-02T13:22:13.337000 | 2011-06-02T13:43:55.110000 |
6,215,094 | 6,216,097 | How to delete an ManyToMany related object when one part is empty? | Here is the BlogPost model: @Entity @Table(name = "blog_posts") public class BlogPost extends Model { @Required @MaxSize(50) @MinSize(3) @Column(length=50) public String title;
@Lob @Required @MaxSize(10000) public String description;
@Temporal(TemporalType.TIMESTAMP) public Date created;
@ManyToMany(targetEntity=Po... | Ok I've found where the problem was, so I'll explain it here in case someone have the same issue. The exception was because I was trying to delete a Tag that still had relationship (it was not left alone). Here is a working solution on how to delete Tags when there is no Posts using it anymore: public boolean removeTag... | How to delete an ManyToMany related object when one part is empty? Here is the BlogPost model: @Entity @Table(name = "blog_posts") public class BlogPost extends Model { @Required @MaxSize(50) @MinSize(3) @Column(length=50) public String title;
@Lob @Required @MaxSize(10000) public String description;
@Temporal(Tempor... | TITLE:
How to delete an ManyToMany related object when one part is empty?
QUESTION:
Here is the BlogPost model: @Entity @Table(name = "blog_posts") public class BlogPost extends Model { @Required @MaxSize(50) @MinSize(3) @Column(length=50) public String title;
@Lob @Required @MaxSize(10000) public String description;... | [
"hibernate",
"jpa",
"playframework"
] | 2 | 2 | 1,897 | 2 | 0 | 2011-06-02T13:22:13.760000 | 2011-06-02T14:44:21.850000 |
6,215,103 | 6,215,713 | osx - How to get a process id (PID) programmatically? | How can I get a process' ID? I require the ID in order to kill that process. I know the name of the process. Thanks! | The best approach is to use -[NSWorkspace launchedApplications] for 10.5- and -[NSWorkspace runningApplicattions] for 10.6+ apps. One returns a dictionary with specified keys, including process ID and bundle name and location info (when available), the other an NSRunningApplication object. | osx - How to get a process id (PID) programmatically? How can I get a process' ID? I require the ID in order to kill that process. I know the name of the process. Thanks! | TITLE:
osx - How to get a process id (PID) programmatically?
QUESTION:
How can I get a process' ID? I require the ID in order to kill that process. I know the name of the process. Thanks!
ANSWER:
The best approach is to use -[NSWorkspace launchedApplications] for 10.5- and -[NSWorkspace runningApplicattions] for 10.6... | [
"macos",
"process",
"kill",
"pid"
] | 6 | 5 | 7,417 | 5 | 0 | 2011-06-02T13:23:01.433000 | 2011-06-02T14:13:24.157000 |
6,215,110 | 6,215,150 | PHP: Extract string from another | i have some strings (address), all like this: 2 rue lambda, 75018, PARIS I want to get the postal code, in this exemple "75018". I've been trying different solution, but i'm not familiar with escaped characters, and don't know how to detect coma in the string. Which function should i use to extract the postal code? | you can try this: preg_match('/([0-9]{5})/',$string,$match); echo $match[1]; This will work whenever there is an address comma separated or simply space separated | PHP: Extract string from another i have some strings (address), all like this: 2 rue lambda, 75018, PARIS I want to get the postal code, in this exemple "75018". I've been trying different solution, but i'm not familiar with escaped characters, and don't know how to detect coma in the string. Which function should i us... | TITLE:
PHP: Extract string from another
QUESTION:
i have some strings (address), all like this: 2 rue lambda, 75018, PARIS I want to get the postal code, in this exemple "75018". I've been trying different solution, but i'm not familiar with escaped characters, and don't know how to detect coma in the string. Which fu... | [
"php",
"string"
] | 1 | 3 | 828 | 4 | 0 | 2011-06-02T13:23:38.313000 | 2011-06-02T13:26:27.377000 |
6,215,126 | 6,215,802 | Problem with Git Repository in Xcode 4 | In my iPhone app, I am using the in-built Git repository of Xcode 4 so that all the team members can work on the same project. Now the problem is that even after I commit my changes to the repository, It still shows modified (M) symbol in front of the committed file. What could be wrong? I want to ensure that once I co... | The built-in Git repository is a local repository only. How do you share that with your team? If you hooked that repository to GitHub, for example, you will experience problems as the implementation is not 100% reliable. I would use the command line in this case and git add/commit/push the changes. There are discussion... | Problem with Git Repository in Xcode 4 In my iPhone app, I am using the in-built Git repository of Xcode 4 so that all the team members can work on the same project. Now the problem is that even after I commit my changes to the repository, It still shows modified (M) symbol in front of the committed file. What could be... | TITLE:
Problem with Git Repository in Xcode 4
QUESTION:
In my iPhone app, I am using the in-built Git repository of Xcode 4 so that all the team members can work on the same project. Now the problem is that even after I commit my changes to the repository, It still shows modified (M) symbol in front of the committed f... | [
"iphone",
"objective-c",
"xcode",
"git",
"xcode4"
] | 0 | 1 | 1,862 | 4 | 0 | 2011-06-02T13:24:48.943000 | 2011-06-02T14:20:59.013000 |
6,215,129 | 6,216,994 | regexp, help with assertions | I have the following string: ` And I want to replace every with if it follows immediately I use this regex %(.* and replace with $1$2qn$3. But it also replaces second case too | I'm assuming you only want to match name after the first subhd row above, but not the second, since the first one is an "st_" and the second one is a "qn_". Try: ( \s*<\/a>\s* ) where you would replace as $1qn$2 Note that here I have assumed that you were quite literal when you said "it follows immediately. I don't rea... | regexp, help with assertions I have the following string: ` And I want to replace every with if it follows immediately I use this regex %(.* and replace with $1$2qn$3. But it also replaces second case too | TITLE:
regexp, help with assertions
QUESTION:
I have the following string: ` And I want to replace every with if it follows immediately I use this regex %(.* and replace with $1$2qn$3. But it also replaces second case too
ANSWER:
I'm assuming you only want to match name after the first subhd row above, but not the se... | [
"regex"
] | 1 | 2 | 76 | 2 | 0 | 2011-06-02T13:25:03.053000 | 2011-06-02T15:57:53.410000 |
6,215,138 | 6,215,174 | Will the JVM ever inline an object's instance variables and methods? | Suppose I have a very tight inner loop, each iteration of which accesses and mutates a single bookkeeping object that stores some simple data about the algorithm and has simple logic for manipulating it The bookkeeping object is private and final and all of its methods are private, final and @inline. Here's an example ... | In Java it can inline fields and methods in a situation as you have. It does not eliminate the Object completely, but gets close. I assume Scala would work similarly. | Will the JVM ever inline an object's instance variables and methods? Suppose I have a very tight inner loop, each iteration of which accesses and mutates a single bookkeeping object that stores some simple data about the algorithm and has simple logic for manipulating it The bookkeeping object is private and final and ... | TITLE:
Will the JVM ever inline an object's instance variables and methods?
QUESTION:
Suppose I have a very tight inner loop, each iteration of which accesses and mutates a single bookkeeping object that stores some simple data about the algorithm and has simple logic for manipulating it The bookkeeping object is priv... | [
"java",
"scala",
"jvm",
"jit",
"jvm-hotspot"
] | 3 | 3 | 740 | 1 | 0 | 2011-06-02T13:25:42.310000 | 2011-06-02T13:28:26.040000 |
6,215,143 | 6,215,589 | How to cancel BackgroundWorker in WPF without DoEvents | I have a search box that works great in WinForms, but is giving me trouble in WPF. It works by starting a search each time a letter is pushed, similar to Google. If (txtQuickSearch.Text.Length >= 3) Or (e.Key = Key.Enter) Then If SearchWorker.IsBusy Then SearchWorker.CancelAsync() Do While SearchWorker.IsBusy 'Applicat... | I don't know enough VB to give you any well written sample code, but if you're on.Net 4.0 I suggest switching to the System.Threading.Tasks namespace, which has cancellation abilities. If (txtQuickSearch.Text.Length >= 3) Or (e.Key = Key.Enter) Then If TokenSource Is Not Nothing Then TokenSource.Cancel() TokenSource = ... | How to cancel BackgroundWorker in WPF without DoEvents I have a search box that works great in WinForms, but is giving me trouble in WPF. It works by starting a search each time a letter is pushed, similar to Google. If (txtQuickSearch.Text.Length >= 3) Or (e.Key = Key.Enter) Then If SearchWorker.IsBusy Then SearchWork... | TITLE:
How to cancel BackgroundWorker in WPF without DoEvents
QUESTION:
I have a search box that works great in WinForms, but is giving me trouble in WPF. It works by starting a search each time a letter is pushed, similar to Google. If (txtQuickSearch.Text.Length >= 3) Or (e.Key = Key.Enter) Then If SearchWorker.IsBu... | [
"wpf",
"vb.net",
"multithreading",
"backgroundworker"
] | 3 | 2 | 943 | 3 | 0 | 2011-06-02T13:26:05.940000 | 2011-06-02T14:00:42.200000 |
6,215,166 | 6,225,489 | Continuous integration server for Erlang code | What kind of agile tools are you using for Erlang development? What continuous integration (CI) server are you using to build Erlang code? The only reference I got was from Quora question How do I integrate Erlang unit tests in Jenkins (Hudson)?. I am also interested in the nifty details of setting them up and making t... | If you want to do it using Jenkins, I have written a common test hook which generates JUnit XML output for your tests which Jenkins can use to produce test statistics. https://github.com/garazdawi/cth_tools/blob/master/src/cth_junit.erl | Continuous integration server for Erlang code What kind of agile tools are you using for Erlang development? What continuous integration (CI) server are you using to build Erlang code? The only reference I got was from Quora question How do I integrate Erlang unit tests in Jenkins (Hudson)?. I am also interested in the... | TITLE:
Continuous integration server for Erlang code
QUESTION:
What kind of agile tools are you using for Erlang development? What continuous integration (CI) server are you using to build Erlang code? The only reference I got was from Quora question How do I integrate Erlang unit tests in Jenkins (Hudson)?. I am also... | [
"erlang",
"continuous-integration"
] | 7 | 5 | 3,816 | 4 | 0 | 2011-06-02T13:27:35.960000 | 2011-06-03T09:48:31.707000 |
6,215,170 | 6,215,325 | Delphi Embarcadero XE: tons of warnings with String and PAnsiChar | I'm trying to migrate from Delphi 2007 to Embarcadero RAD Studio XE. I'm getting tons of warnings. They all look like this: I have a procedure where I declare a "String": procedure SendMail( ADestinataire,ASubject: String); And I'm trying to call Windows API like: Res:= MAPIResolveName(Session, Application.Handle, PAns... | MAPIResolveName uses LPSTR parameter, which is PAnsiChar in Delphi. Simple MAPI does not support UTF16 strings (though it can be used with UTF8 strings), so if you adhere to simple MAPI you should use AnsiStrings, for example procedure SendMail( ADestinataire,ASubject: AnsiString); or better you can use procedure SendM... | Delphi Embarcadero XE: tons of warnings with String and PAnsiChar I'm trying to migrate from Delphi 2007 to Embarcadero RAD Studio XE. I'm getting tons of warnings. They all look like this: I have a procedure where I declare a "String": procedure SendMail( ADestinataire,ASubject: String); And I'm trying to call Windows... | TITLE:
Delphi Embarcadero XE: tons of warnings with String and PAnsiChar
QUESTION:
I'm trying to migrate from Delphi 2007 to Embarcadero RAD Studio XE. I'm getting tons of warnings. They all look like this: I have a procedure where I declare a "String": procedure SendMail( ADestinataire,ASubject: String); And I'm tryi... | [
"string",
"delphi",
"compiler-warnings",
"delphi-xe"
] | 1 | 8 | 2,593 | 4 | 0 | 2011-06-02T13:27:50.683000 | 2011-06-02T13:41:38.410000 |
6,215,171 | 6,215,431 | Javascript Object to Array | I'm having some problems with converting some JSON and I'm after some help. This is my problem, I have JSON returned the following: Example of the JSON recieved (from a CSV file): [ { "rating": "0", "title": "The Killing Kind", "author": "John Connolly", "type": "Book", "asin": "0340771224", "tags": "", "review": "i st... | There is a nice JavaScript library called Undersore.js which does all kind of object/array manipulations. Using it you could do the conversion as easy as this _(json).each(function(elem, key){ json[key] = _(elem).values(); }); | Javascript Object to Array I'm having some problems with converting some JSON and I'm after some help. This is my problem, I have JSON returned the following: Example of the JSON recieved (from a CSV file): [ { "rating": "0", "title": "The Killing Kind", "author": "John Connolly", "type": "Book", "asin": "0340771224", ... | TITLE:
Javascript Object to Array
QUESTION:
I'm having some problems with converting some JSON and I'm after some help. This is my problem, I have JSON returned the following: Example of the JSON recieved (from a CSV file): [ { "rating": "0", "title": "The Killing Kind", "author": "John Connolly", "type": "Book", "asi... | [
"javascript",
"json"
] | 3 | 4 | 15,539 | 4 | 0 | 2011-06-02T13:28:03.553000 | 2011-06-02T13:49:39.053000 |
6,215,172 | 6,215,205 | Calayer subclass problem | I am creating calayer subclass for carousel view. My subclass is @interface Carousellayer: CALayer { } I get an error message in Cannot find interface declaration for 'CALayer', superclass of 'Carousellayer' in Carousellayer.h | CALayer header files are not included by default, you need to import QuartzCore: #import And also link your application with the corresponding framework. | Calayer subclass problem I am creating calayer subclass for carousel view. My subclass is @interface Carousellayer: CALayer { } I get an error message in Cannot find interface declaration for 'CALayer', superclass of 'Carousellayer' in Carousellayer.h | TITLE:
Calayer subclass problem
QUESTION:
I am creating calayer subclass for carousel view. My subclass is @interface Carousellayer: CALayer { } I get an error message in Cannot find interface declaration for 'CALayer', superclass of 'Carousellayer' in Carousellayer.h
ANSWER:
CALayer header files are not included by ... | [
"iphone",
"objective-c",
"calayer"
] | 2 | 5 | 535 | 1 | 0 | 2011-06-02T13:28:16.190000 | 2011-06-02T13:31:15.987000 |
6,215,175 | 6,215,272 | How to Desrialize JSON using C# | I am currently using Json.Net to deserialize my JSON. I now have the following situation: I am getting the following JSON response: {"Success":false,"Errors":{"UserName":"User Name already registered","EmailAddress":"Email Address already registered"}} I want to parse it into this type: public class CustomJsonResult { ... | The problem is you're trying to convert a dictionary into an array. Try replacing your string[] with Dictionary. | How to Desrialize JSON using C# I am currently using Json.Net to deserialize my JSON. I now have the following situation: I am getting the following JSON response: {"Success":false,"Errors":{"UserName":"User Name already registered","EmailAddress":"Email Address already registered"}} I want to parse it into this type: ... | TITLE:
How to Desrialize JSON using C#
QUESTION:
I am currently using Json.Net to deserialize my JSON. I now have the following situation: I am getting the following JSON response: {"Success":false,"Errors":{"UserName":"User Name already registered","EmailAddress":"Email Address already registered"}} I want to parse i... | [
"c#",
"asp.net",
"json",
"serialization"
] | 2 | 3 | 421 | 4 | 0 | 2011-06-02T13:28:27.300000 | 2011-06-02T13:35:28.390000 |
6,215,185 | 6,215,423 | Getting length of video | I am having trouble finding a simple example of how to get the video length of a file programmatically. Many people say, oh use this library/wrapper or whatever, but do not say how. I have downloaded ffmpeg, but have no clue how to actually use it and there does not seem to be any example of how to use it to get the vi... | Here is an example: using DirectShowLib; using DirectShowLib.DES; using System.Runtime.InteropServices;...
var mediaDet = (IMediaDet)new MediaDet(); DsError.ThrowExceptionForHR(mediaDet.put_Filename(FileName));
// find the video stream in the file int index; var type = Guid.Empty; for (index = 0; index < 1000 && type... | Getting length of video I am having trouble finding a simple example of how to get the video length of a file programmatically. Many people say, oh use this library/wrapper or whatever, but do not say how. I have downloaded ffmpeg, but have no clue how to actually use it and there does not seem to be any example of how... | TITLE:
Getting length of video
QUESTION:
I am having trouble finding a simple example of how to get the video length of a file programmatically. Many people say, oh use this library/wrapper or whatever, but do not say how. I have downloaded ffmpeg, but have no clue how to actually use it and there does not seem to be ... | [
"c#",
"video",
"ffmpeg",
"duration"
] | 16 | 15 | 29,933 | 9 | 0 | 2011-06-02T13:29:10.233000 | 2011-06-02T13:49:12.960000 |
6,215,186 | 6,216,307 | Full range of options for respond_to format.* | I'm looking into rendering more complex responses. Specifically, I am searching for options for formatting yaml and json responses with multiple levels, but right now I cannot locate any api information on options. I've seen something about:include and:only in other sample controllers. I'm wondering what the full range... | After reading through the rails code, I can safely say that there isn't anything else that you don't know about. (Although the documentation for respond_to in block form seems to be missing from the API docs) Basically there are two ways to use respond_to Declarative class WidgetsController respond_to:html,:xml,:json, ... | Full range of options for respond_to format.* I'm looking into rendering more complex responses. Specifically, I am searching for options for formatting yaml and json responses with multiple levels, but right now I cannot locate any api information on options. I've seen something about:include and:only in other sample ... | TITLE:
Full range of options for respond_to format.*
QUESTION:
I'm looking into rendering more complex responses. Specifically, I am searching for options for formatting yaml and json responses with multiple levels, but right now I cannot locate any api information on options. I've seen something about:include and:onl... | [
"ruby-on-rails",
"ruby-on-rails-3",
"ruby-on-rails-3.1"
] | 0 | 3 | 1,089 | 2 | 0 | 2011-06-02T13:29:25.083000 | 2011-06-02T15:01:09.493000 |
6,215,187 | 6,215,258 | How can I use IF ELSE in WHERE clause on the basis of a string variable? | I have an SP. It returns some number of rows. Here is the SP: ALTER PROCEDURE [dbo].[spGetClients] ( @orderBy varchar(50), @startAge int, @endAge int, @sex char, @staffId nvarchar(1024), @statusId nvarchar(1024), @ethnicityId nvarchar(1024), @treatmentProviderId nvarchar(1024) ) AS BEGIN SET NOCOUNT ON; IF(@orderBy = '... | AND ((@staffId = "") OR (dbo.GetClientStaffContacts(c.Id, @staffId) is not null)) | How can I use IF ELSE in WHERE clause on the basis of a string variable? I have an SP. It returns some number of rows. Here is the SP: ALTER PROCEDURE [dbo].[spGetClients] ( @orderBy varchar(50), @startAge int, @endAge int, @sex char, @staffId nvarchar(1024), @statusId nvarchar(1024), @ethnicityId nvarchar(1024), @trea... | TITLE:
How can I use IF ELSE in WHERE clause on the basis of a string variable?
QUESTION:
I have an SP. It returns some number of rows. Here is the SP: ALTER PROCEDURE [dbo].[spGetClients] ( @orderBy varchar(50), @startAge int, @endAge int, @sex char, @staffId nvarchar(1024), @statusId nvarchar(1024), @ethnicityId nva... | [
"sql-server-2008",
"stored-procedures"
] | 0 | 0 | 3,636 | 2 | 0 | 2011-06-02T13:29:27.517000 | 2011-06-02T13:34:35.347000 |
6,215,188 | 6,215,275 | Download an image with AsyncTask, I need help if there's no network connection | I'm new to programming so bear with me, this is a big learning experience for me, and it's been a lot of fun so far. What I'm trying to do is to load an image into my app that I change and upload to my server on a regular basis. Right now, it loads a placement image until the proper image is finished downloading in the... | If you get null as a return value from you doInBackground function can you not just display another image? Also you could always check if there is a network connection available before trying to do any of it and do something at that point? You can check if a network connection is available by doing something similar to... | Download an image with AsyncTask, I need help if there's no network connection I'm new to programming so bear with me, this is a big learning experience for me, and it's been a lot of fun so far. What I'm trying to do is to load an image into my app that I change and upload to my server on a regular basis. Right now, i... | TITLE:
Download an image with AsyncTask, I need help if there's no network connection
QUESTION:
I'm new to programming so bear with me, this is a big learning experience for me, and it's been a lot of fun so far. What I'm trying to do is to load an image into my app that I change and upload to my server on a regular b... | [
"android",
"imageview",
"android-asynctask"
] | 0 | 0 | 2,035 | 2 | 0 | 2011-06-02T13:29:28.893000 | 2011-06-02T13:36:13.713000 |
6,215,193 | 6,215,243 | Is there a grid for storing data? | I need to store data in a grid like this: {0,1,2,3} {4,5,6,7} {8,9,10,11} {12,13,14,15} I know I can use multi dimensional arrays, but Is there any easier way to do it? Also I need to get values from it like myData.Item(0,1) would return 1. | You can have a list of tuples if you are using.NET 4.0. In this case, Tuple(Of T1, T2, T3, T4): Dim matrix() = { Tuple.Create(0,1,2,3), Tuple.Create(4,5,6,7), Tuple.Create(8,9,10,11), Tuple.Create(12,13,14,15)} | Is there a grid for storing data? I need to store data in a grid like this: {0,1,2,3} {4,5,6,7} {8,9,10,11} {12,13,14,15} I know I can use multi dimensional arrays, but Is there any easier way to do it? Also I need to get values from it like myData.Item(0,1) would return 1. | TITLE:
Is there a grid for storing data?
QUESTION:
I need to store data in a grid like this: {0,1,2,3} {4,5,6,7} {8,9,10,11} {12,13,14,15} I know I can use multi dimensional arrays, but Is there any easier way to do it? Also I need to get values from it like myData.Item(0,1) would return 1.
ANSWER:
You can have a lis... | [
".net",
"vb.net"
] | 0 | 1 | 50 | 1 | 0 | 2011-06-02T13:29:56.257000 | 2011-06-02T13:33:51.323000 |
6,215,194 | 6,215,220 | php.ini wont work outside public_html directory | Just very quick question about php.ini file. I created my own on my php.ini file and it works fine if I put it inside my 'public_html' directory. However the problem is it can obviously be viewed in browser through HTTP requests. So, I am trying to move it outside my 'public_html' directory however it does not seem to ... | It can't get cached by google if you block like that in.htaccess | php.ini wont work outside public_html directory Just very quick question about php.ini file. I created my own on my php.ini file and it works fine if I put it inside my 'public_html' directory. However the problem is it can obviously be viewed in browser through HTTP requests. So, I am trying to move it outside my 'pub... | TITLE:
php.ini wont work outside public_html directory
QUESTION:
Just very quick question about php.ini file. I created my own on my php.ini file and it works fine if I put it inside my 'public_html' directory. However the problem is it can obviously be viewed in browser through HTTP requests. So, I am trying to move ... | [
"php"
] | 3 | 2 | 979 | 4 | 0 | 2011-06-02T13:30:10.033000 | 2011-06-02T13:32:40.357000 |
6,215,199 | 6,215,223 | Assigning null/Nullable to DateTime in Ternary Operation | I have a statement like DateTime? dt = (string1 == string2)? null; (DateTime)(txtbox.Text); which I cannot compile. Reason is: null cannot be assigned to DateTime. So, I have to declare a Nullable nullable variable and replace null with nullable. I do not want to use if -statement and I want to do this in one line. Als... | DateTime? dt = (string1 == string2)? (DateTime?)null: DateTime.Parse(txtbox.Text); | Assigning null/Nullable to DateTime in Ternary Operation I have a statement like DateTime? dt = (string1 == string2)? null; (DateTime)(txtbox.Text); which I cannot compile. Reason is: null cannot be assigned to DateTime. So, I have to declare a Nullable nullable variable and replace null with nullable. I do not want to... | TITLE:
Assigning null/Nullable to DateTime in Ternary Operation
QUESTION:
I have a statement like DateTime? dt = (string1 == string2)? null; (DateTime)(txtbox.Text); which I cannot compile. Reason is: null cannot be assigned to DateTime. So, I have to declare a Nullable nullable variable and replace null with nullable... | [
"c#",
".net",
"sql",
"datetime",
"nullable"
] | 22 | 63 | 16,702 | 2 | 0 | 2011-06-02T13:30:38.343000 | 2011-06-02T13:32:48.690000 |
6,215,200 | 6,215,323 | python sqlite3 not working | try: c = db.cursor() c.execute("insert or replace into registrations values " + "(?,?, datetime('now'))", (user, identity)) print '\t true ' except Exception,inst: print inst.args insert create table not working. How do I fetch the exception details? | If you read this Python PEP, it should describe the exception classes for the Sqlite Python module. Have you tried something like this: try: db_cursor.execute('some hopefully valid SQL;') except sqlite3.Error, msg: print msg | python sqlite3 not working try: c = db.cursor() c.execute("insert or replace into registrations values " + "(?,?, datetime('now'))", (user, identity)) print '\t true ' except Exception,inst: print inst.args insert create table not working. How do I fetch the exception details? | TITLE:
python sqlite3 not working
QUESTION:
try: c = db.cursor() c.execute("insert or replace into registrations values " + "(?,?, datetime('now'))", (user, identity)) print '\t true ' except Exception,inst: print inst.args insert create table not working. How do I fetch the exception details?
ANSWER:
If you read thi... | [
"python",
"sqlite"
] | 2 | 1 | 613 | 1 | 0 | 2011-06-02T13:30:44.243000 | 2011-06-02T13:41:29.607000 |
6,215,202 | 6,218,636 | Sharepoint event handler not firing | I have created an event handler for ItemAdded so that when an item is added on the site, my code checks to see if it's a folder. If it is, it should change the content type of that folder to a custom content type. The event isn't firing, so I was wondering if I'm doing it the right way and/or in the right place. Here i... | I figured it out. My custom content type needed to be enabled for the document library before an item could be given that content type. Thanks everyone for your responses. | Sharepoint event handler not firing I have created an event handler for ItemAdded so that when an item is added on the site, my code checks to see if it's a folder. If it is, it should change the content type of that folder to a custom content type. The event isn't firing, so I was wondering if I'm doing it the right w... | TITLE:
Sharepoint event handler not firing
QUESTION:
I have created an event handler for ItemAdded so that when an item is added on the site, my code checks to see if it's a folder. If it is, it should change the content type of that folder to a custom content type. The event isn't firing, so I was wondering if I'm do... | [
"sharepoint",
"content-type",
"event-handling"
] | 2 | 2 | 2,909 | 1 | 0 | 2011-06-02T13:30:57.503000 | 2011-06-02T18:23:13.060000 |
6,215,206 | 6,215,254 | .innerHTML not working or am I using it wrong? | If I understand right,.innerHTML should overwrite whatever was in a certain div or span. For example: Via Email: 123obama@whitehouse.com remove Add Email Therefor upon click of #addEmail button, everything inside would be removed and replaced by "12345". Yet in reality it doesn't do anything to that span, but just prin... | It's actually your span that's wrong. A span can't... span (I know, I know) over table rows, so it gets opened and closed somewhere between the rows (or outside the table on some browsers), so when you're overwriting it's html, it ends up somewhere else. You should name the tr instead and overwrite its html, that shoul... | .innerHTML not working or am I using it wrong? If I understand right,.innerHTML should overwrite whatever was in a certain div or span. For example: Via Email: 123obama@whitehouse.com remove Add Email Therefor upon click of #addEmail button, everything inside would be removed and replaced by "12345". Yet in reality it ... | TITLE:
.innerHTML not working or am I using it wrong?
QUESTION:
If I understand right,.innerHTML should overwrite whatever was in a certain div or span. For example: Via Email: 123obama@whitehouse.com remove Add Email Therefor upon click of #addEmail button, everything inside would be removed and replaced by "12345". ... | [
"javascript"
] | 1 | 1 | 1,594 | 4 | 0 | 2011-06-02T13:31:19.107000 | 2011-06-02T13:34:26.300000 |
6,215,213 | 6,215,335 | save hidden values in header after redirect | I have a form with 2 pages that retrieve information, that information is stored in my header file as hidden values. After the second page the user is directed to a third party payment system. Then they are redirected back to the third page of the form. However, my header does not have the hidden values anymore. how do... | If the third party payment system you speak of is PayPal, there's a way to set values that they'll send back to you. However, if the payment system does not have such an API, then I think you're out of luck. It would be their system that generates the headers that would come back to you. It's highly unlikely that their... | save hidden values in header after redirect I have a form with 2 pages that retrieve information, that information is stored in my header file as hidden values. After the second page the user is directed to a third party payment system. Then they are redirected back to the third page of the form. However, my header doe... | TITLE:
save hidden values in header after redirect
QUESTION:
I have a form with 2 pages that retrieve information, that information is stored in my header file as hidden values. After the second page the user is directed to a third party payment system. Then they are redirected back to the third page of the form. Howe... | [
"hidden",
"postdata"
] | 0 | 0 | 132 | 1 | 0 | 2011-06-02T13:32:07.003000 | 2011-06-02T13:42:07.873000 |
6,215,216 | 6,215,336 | Making jQuery slideUp when clicking off | I am using jQuery to make a nav slideDown. I want when people click anywhere outside of the nav it slideUp. The problem is that with my code it slideUp even if I click on the element. I basically want it to slideUp if the user clicks anywhere other than the element which slideDown //News Drop Down $(document).ready(fun... | This it wath I would do: $('*').not("li.newsDrop").click(function() { $('div.newsadviceDrop').slideUp('slow', function() { // Animation complete. }); | Making jQuery slideUp when clicking off I am using jQuery to make a nav slideDown. I want when people click anywhere outside of the nav it slideUp. The problem is that with my code it slideUp even if I click on the element. I basically want it to slideUp if the user clicks anywhere other than the element which slideDow... | TITLE:
Making jQuery slideUp when clicking off
QUESTION:
I am using jQuery to make a nav slideDown. I want when people click anywhere outside of the nav it slideUp. The problem is that with my code it slideUp even if I click on the element. I basically want it to slideUp if the user clicks anywhere other than the elem... | [
"jquery"
] | 2 | 2 | 1,193 | 2 | 0 | 2011-06-02T13:32:15.087000 | 2011-06-02T13:42:08.140000 |
6,215,225 | 6,226,012 | Adobe Air Javascript on *.php files | I'm trying to build an Adobe Air app which runs from a PHP file. Currently I have an index.html file which then performs a location.href to move to realfile.php - this gets round the limitation that a root file has to be HTML. My problem is that the *.php files contain JavaScript which in turn make use of Adobe Air cod... | I read around a bit more and now know that Air will only run in a HTML page. Although there is no explanation that I could find that explains why this is... How I think I can fix this: My current idea is to add a RewriteRule in my htaccess to make PHP files accessible via a.html file extension. This should trick Air in... | Adobe Air Javascript on *.php files I'm trying to build an Adobe Air app which runs from a PHP file. Currently I have an index.html file which then performs a location.href to move to realfile.php - this gets round the limitation that a root file has to be HTML. My problem is that the *.php files contain JavaScript whi... | TITLE:
Adobe Air Javascript on *.php files
QUESTION:
I'm trying to build an Adobe Air app which runs from a PHP file. Currently I have an index.html file which then performs a location.href to move to realfile.php - this gets round the limitation that a root file has to be HTML. My problem is that the *.php files cont... | [
"php",
"javascript",
"air"
] | 2 | 0 | 280 | 1 | 0 | 2011-06-02T13:32:57.583000 | 2011-06-03T10:39:25.963000 |
6,215,227 | 6,215,320 | problem with adding UIActivityIndicator to the view ! | I am trying to add a UIActivityIndicator to my custom view (programmatically). I am using the following code. But I dont see anything on the screen. Any idea why? Thanks. UIActivityIndicatorView *activityIndicator=[[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(75, 395, 200, 200)] autorelease]; [activityIndi... | UIActivityIndicator has its hidesWhenStopped property equal to YES by default - that is it is hidden if you do not start animating it. So to make it appear on the screen try one of the following (whichever is more suitable for you): set hidesWhenStopped property to NO start animating it (using -startAnimating method) c... | problem with adding UIActivityIndicator to the view ! I am trying to add a UIActivityIndicator to my custom view (programmatically). I am using the following code. But I dont see anything on the screen. Any idea why? Thanks. UIActivityIndicatorView *activityIndicator=[[[UIActivityIndicatorView alloc] initWithFrame:CGRe... | TITLE:
problem with adding UIActivityIndicator to the view !
QUESTION:
I am trying to add a UIActivityIndicator to my custom view (programmatically). I am using the following code. But I dont see anything on the screen. Any idea why? Thanks. UIActivityIndicatorView *activityIndicator=[[[UIActivityIndicatorView alloc] ... | [
"iphone",
"ios",
"view",
"uiactivityindicatorview"
] | 0 | 11 | 1,127 | 2 | 0 | 2011-06-02T13:33:04.383000 | 2011-06-02T13:41:27.750000 |
6,215,235 | 6,215,296 | jsonpCallback function not working | UPDATE 1: I've just upgraded from jquery 1.4.4 to 1.6.1. How does that effect the script in the original question? ORIGINAL QUESTION: Just as I test, I did: $(document).ready(function() { get_jsonp_feed();
function get_jsonp_feed() { $.ajax({ url: 'http://www.remote_host.co.uk/feed.php', type: 'GET', dataType: 'jsonp'... | George is correct, set the jsonp param to false -- as of jQuery 1.5 (so, how you set this up is jQuery version dependent). I don't believe that your supplied callback name is invoked as a function (rather, it is the name provided in the URL presented to the server). If you are getting success, then you have received th... | jsonpCallback function not working UPDATE 1: I've just upgraded from jquery 1.4.4 to 1.6.1. How does that effect the script in the original question? ORIGINAL QUESTION: Just as I test, I did: $(document).ready(function() { get_jsonp_feed();
function get_jsonp_feed() { $.ajax({ url: 'http://www.remote_host.co.uk/feed.p... | TITLE:
jsonpCallback function not working
QUESTION:
UPDATE 1: I've just upgraded from jquery 1.4.4 to 1.6.1. How does that effect the script in the original question? ORIGINAL QUESTION: Just as I test, I did: $(document).ready(function() { get_jsonp_feed();
function get_jsonp_feed() { $.ajax({ url: 'http://www.remote... | [
"jquery",
"jsonp"
] | 3 | 3 | 28,172 | 4 | 0 | 2011-06-02T13:33:41.713000 | 2011-06-02T13:38:12.247000 |
6,215,239 | 6,225,044 | getActivity() returns null in Fragment function | I have a fragment (F1) with a public method like this public void asd() { if (getActivity() == null) { Log.d("yes","it is null"); } } and yes when I call it (from the Activity), it is null... FragmentTransaction transaction1 = getSupportFragmentManager().beginTransaction(); F1 f1 = new F1(); transaction1.replace(R.id.u... | commit schedules the transaction, i.e. it doesn't happen straightaway but is scheduled as work on the main thread the next time the main thread is ready. I'd suggest adding an onAttach(Activity activity) method to your Fragment and putting a break point on it and seeing when it is called relative to your call to asd().... | getActivity() returns null in Fragment function I have a fragment (F1) with a public method like this public void asd() { if (getActivity() == null) { Log.d("yes","it is null"); } } and yes when I call it (from the Activity), it is null... FragmentTransaction transaction1 = getSupportFragmentManager().beginTransaction(... | TITLE:
getActivity() returns null in Fragment function
QUESTION:
I have a fragment (F1) with a public method like this public void asd() { if (getActivity() == null) { Log.d("yes","it is null"); } } and yes when I call it (from the Activity), it is null... FragmentTransaction transaction1 = getSupportFragmentManager()... | [
"android",
"android-fragments",
"android-activity",
"null",
"android-context"
] | 209 | 172 | 180,852 | 15 | 0 | 2011-06-02T13:33:46.503000 | 2011-06-03T09:03:51.180000 |
6,215,251 | 6,215,528 | How to peek at STDIN with Delphi 7? | In a Delphi 7 console application, how can I check whether stdin holds a character, without blocking until one is entered? My plan is that this console program will be executed by a GUI program, and its stdin will be written to by the GUI program. So I want my console app to periodically check stdin, but I can't find a... | I think you have already found the right way to read stdin. It is meant to block when there's nothing more to be read. The standard way to handle this is to use a separate thread to handle the pipe. When it receives new data from stdin it signals this to the processing thread, for example with a message passing mechani... | How to peek at STDIN with Delphi 7? In a Delphi 7 console application, how can I check whether stdin holds a character, without blocking until one is entered? My plan is that this console program will be executed by a GUI program, and its stdin will be written to by the GUI program. So I want my console app to periodic... | TITLE:
How to peek at STDIN with Delphi 7?
QUESTION:
In a Delphi 7 console application, how can I check whether stdin holds a character, without blocking until one is entered? My plan is that this console program will be executed by a GUI program, and its stdin will be written to by the GUI program. So I want my conso... | [
"delphi",
"ipc",
"delphi-7",
"stdin"
] | 1 | 4 | 1,309 | 4 | 0 | 2011-06-02T13:34:13.603000 | 2011-06-02T13:56:32.657000 |
6,215,253 | 6,215,447 | Get html from <td class"title"> and attach it to img | I have HTML: Afbeelding Locatie Groep Soort Bijzonderheden Tuin Appels Dubbele Bellefleur Zoete stevige appel Tuin Appels Dubbele Zoete Aagt Zoete stevige appel Tuin Appels Ellisons Orange Zoete stevige appel What I am trying to create is that jQuery gets the title from the: td class="titel" and create at the a href=".... | See it on jsfiddle. This will put the text from each td with class titel on the title attribute of the a on the same row. $('td.titel').each(function() { $(this).parent().find('a').attr('title', $(this).text()); }); Explanation of what this does: For each of the selected td.titel elements Walk up the tree to the parent... | Get html from <td class"title"> and attach it to img I have HTML: Afbeelding Locatie Groep Soort Bijzonderheden Tuin Appels Dubbele Bellefleur Zoete stevige appel Tuin Appels Dubbele Zoete Aagt Zoete stevige appel Tuin Appels Ellisons Orange Zoete stevige appel What I am trying to create is that jQuery gets the title f... | TITLE:
Get html from <td class"title"> and attach it to img
QUESTION:
I have HTML: Afbeelding Locatie Groep Soort Bijzonderheden Tuin Appels Dubbele Bellefleur Zoete stevige appel Tuin Appels Dubbele Zoete Aagt Zoete stevige appel Tuin Appels Ellisons Orange Zoete stevige appel What I am trying to create is that jQuer... | [
"jquery",
"image",
"html-table"
] | 2 | 1 | 2,783 | 4 | 0 | 2011-06-02T13:34:20.730000 | 2011-06-02T13:51:16.610000 |
6,215,256 | 6,215,333 | Sign extension from 16 to 32 bits in C | I have to do a sign extension for a 16-bit integer and for some reason, it seems not to be working properly. Could anyone please tell me where the bug is in the code? I've been working on it for hours. int signExtension(int instr) { int value = (0x0000FFFF & instr); int mask = 0x00008000; int sign = (mask & instr) >> 1... | Try: int signExtension(int instr) { int value = (0x0000FFFF & instr); int mask = 0x00008000; if (mask & instr) { value += 0xFFFF0000; } return value; } | Sign extension from 16 to 32 bits in C I have to do a sign extension for a 16-bit integer and for some reason, it seems not to be working properly. Could anyone please tell me where the bug is in the code? I've been working on it for hours. int signExtension(int instr) { int value = (0x0000FFFF & instr); int mask = 0x0... | TITLE:
Sign extension from 16 to 32 bits in C
QUESTION:
I have to do a sign extension for a 16-bit integer and for some reason, it seems not to be working properly. Could anyone please tell me where the bug is in the code? I've been working on it for hours. int signExtension(int instr) { int value = (0x0000FFFF & inst... | [
"c",
"binary",
"integer",
"sign"
] | 7 | 6 | 48,580 | 5 | 0 | 2011-06-02T13:34:29.293000 | 2011-06-02T13:42:00.730000 |
6,215,259 | 6,215,483 | Am i violating any NF RULE on my database design? | Good day! I am a newbie on creating database... I need to create a db for my recruitment web application. My database schema is as follows: NOTE: I included the applicant_id on other tables... e.g. exam, interview, exam type. Am i violating any normalization rule? If i do, what do you recommend to improve my design? Th... | Overall looks good. A few minor points to consider: Interviewer is also a person. You will need to use program logic to prevent different / misspellings. The longest real life email address I've seen was 62 characters. In exam you use the reserved word date for a column name (subjective) I would rename applicant_date t... | Am i violating any NF RULE on my database design? Good day! I am a newbie on creating database... I need to create a db for my recruitment web application. My database schema is as follows: NOTE: I included the applicant_id on other tables... e.g. exam, interview, exam type. Am i violating any normalization rule? If i ... | TITLE:
Am i violating any NF RULE on my database design?
QUESTION:
Good day! I am a newbie on creating database... I need to create a db for my recruitment web application. My database schema is as follows: NOTE: I included the applicant_id on other tables... e.g. exam, interview, exam type. Am i violating any normali... | [
"database-schema"
] | 3 | 4 | 874 | 5 | 0 | 2011-06-02T13:34:41.637000 | 2011-06-02T13:53:42.243000 |
6,215,264 | 6,216,608 | Problem with creating instances of type using reflection from strong-named assembly | I have an existing.NET 2.0 Win Forms solution that's deployed on the client. For the sake of this scenario, lets call it 'WinApp.exe'. WinApp.exe has a direct reference to a private assembly named 'Assembly.dll'. Assembly.dll has a direct reference to another assembly named 'Framework.dll'. Within Framework.dll is a ty... | The problem here is that both the strong named Framework as the old Framework assembly are loaded..NET does not really care that both definitions of IPlugin are the same. They are from a differend assembly so they are different (I am a little puzzled as why it will raise an InvalidCastException as a cast like that will... | Problem with creating instances of type using reflection from strong-named assembly I have an existing.NET 2.0 Win Forms solution that's deployed on the client. For the sake of this scenario, lets call it 'WinApp.exe'. WinApp.exe has a direct reference to a private assembly named 'Assembly.dll'. Assembly.dll has a dire... | TITLE:
Problem with creating instances of type using reflection from strong-named assembly
QUESTION:
I have an existing.NET 2.0 Win Forms solution that's deployed on the client. For the sake of this scenario, lets call it 'WinApp.exe'. WinApp.exe has a direct reference to a private assembly named 'Assembly.dll'. Assem... | [
".net",
"reflection"
] | 5 | 4 | 719 | 1 | 0 | 2011-06-02T13:35:04.477000 | 2011-06-02T15:22:49.237000 |
6,215,267 | 6,215,332 | Visual basic handle decimal comma | I'm trying to save variables into text files and the Czech typographic rules drives me crazy. The program I'm tuning is dedicated to work on Czech localized computers where decimal comma is used but the VB is working with normal, standard decimal dot. When loading files "US" decimals are loaded correctly and showed as ... | Your trouble might be due to use of the Val function; that isn't international. The help text recommends the use of CDbl when converting from strings to numbers. | Visual basic handle decimal comma I'm trying to save variables into text files and the Czech typographic rules drives me crazy. The program I'm tuning is dedicated to work on Czech localized computers where decimal comma is used but the VB is working with normal, standard decimal dot. When loading files "US" decimals a... | TITLE:
Visual basic handle decimal comma
QUESTION:
I'm trying to save variables into text files and the Czech typographic rules drives me crazy. The program I'm tuning is dedicated to work on Czech localized computers where decimal comma is used but the VB is working with normal, standard decimal dot. When loading fil... | [
"vb6",
"internationalization",
"decimal"
] | 15 | 7 | 35,015 | 4 | 0 | 2011-06-02T13:35:14.600000 | 2011-06-02T13:42:00.087000 |
6,215,276 | 6,217,301 | How to have Jenkins ignore certain files when checking for change? | In the "Excluded Regions" of the CVS configuration, I have added the following:.*/.*/.*\.d.*/.*/.*\.o.*/.*/.*\.so.*/.*/.*\.a.*/.*/.*\.exe.*/.*/.*\.obj.*/.*/.*\.dll.*/.*/.*\.lib.*/.*/.*\.txt.*/.*/.*\.tar.*/.*/.*\.tar\.gz All files with the above extensions should be ignored. However, Jenkins still runs builds based on t... | Glad that worked for you! Reposting as requested: My guess is it has to do with the.*/ parts. Have you tried it with just.*\.txt? Just as an experiment, you might also try /.*/.*/.*\.txt (note the extra / at the beginning). I have a feeling the problem was related to using relative vs. absolute file paths. | How to have Jenkins ignore certain files when checking for change? In the "Excluded Regions" of the CVS configuration, I have added the following:.*/.*/.*\.d.*/.*/.*\.o.*/.*/.*\.so.*/.*/.*\.a.*/.*/.*\.exe.*/.*/.*\.obj.*/.*/.*\.dll.*/.*/.*\.lib.*/.*/.*\.txt.*/.*/.*\.tar.*/.*/.*\.tar\.gz All files with the above extensio... | TITLE:
How to have Jenkins ignore certain files when checking for change?
QUESTION:
In the "Excluded Regions" of the CVS configuration, I have added the following:.*/.*/.*\.d.*/.*/.*\.o.*/.*/.*\.so.*/.*/.*\.a.*/.*/.*\.exe.*/.*/.*\.obj.*/.*/.*\.dll.*/.*/.*\.lib.*/.*/.*\.txt.*/.*/.*\.tar.*/.*/.*\.tar\.gz All files with ... | [
"regex",
"jenkins",
"hudson",
"cvs"
] | 3 | 2 | 6,381 | 1 | 0 | 2011-06-02T13:36:19.200000 | 2011-06-02T16:24:25.770000 |
6,215,285 | 6,219,761 | 3D Cad Viewer for Visual Studio | Does anyone know of a 3D Cad Viewer Component for Visual Studio Win App? Web App would be nice too. I am looking to open.dxfs or.dwgs in the viewer with the ability of turning on features for the user such as panning, rotation, perspective, etc... | CAD Import.NET http://www.cadsofttools.com/en/products/cad_import_.net.html | 3D Cad Viewer for Visual Studio Does anyone know of a 3D Cad Viewer Component for Visual Studio Win App? Web App would be nice too. I am looking to open.dxfs or.dwgs in the viewer with the ability of turning on features for the user such as panning, rotation, perspective, etc... | TITLE:
3D Cad Viewer for Visual Studio
QUESTION:
Does anyone know of a 3D Cad Viewer Component for Visual Studio Win App? Web App would be nice too. I am looking to open.dxfs or.dwgs in the viewer with the ability of turning on features for the user such as panning, rotation, perspective, etc...
ANSWER:
CAD Import.NE... | [
"c#",
"asp.net",
"vb.net",
"3d"
] | 0 | 1 | 3,428 | 1 | 0 | 2011-06-02T13:37:31.197000 | 2011-06-02T20:04:55.333000 |
6,215,287 | 6,215,505 | Makefile multiple dependency lines for a single target? | To generate dependency files I can use something like this to generate dependency files: -include $(patsubst %.cpp,build/%.d,$(SRC)) build/%.o: %.cpp $(CC) $(CXXFLAGS) -c -o $@ $< $(CC) $(CXXFLAGS) -MM -MT $@ -MF $(patsubst %.o,%.d,%@) $< This generates everything and puts both the object and dependency files into the ... | You should add one more pattern rule to express the dependency between the.cpp and.d files and use that rule to create the.d files (second line in the pattern rule of your question) instead of creating the.d files unconditionally. It might make sense to introduce another dependency between all.h and.cpp files and all.d... | Makefile multiple dependency lines for a single target? To generate dependency files I can use something like this to generate dependency files: -include $(patsubst %.cpp,build/%.d,$(SRC)) build/%.o: %.cpp $(CC) $(CXXFLAGS) -c -o $@ $< $(CC) $(CXXFLAGS) -MM -MT $@ -MF $(patsubst %.o,%.d,%@) $< This generates everything... | TITLE:
Makefile multiple dependency lines for a single target?
QUESTION:
To generate dependency files I can use something like this to generate dependency files: -include $(patsubst %.cpp,build/%.d,$(SRC)) build/%.o: %.cpp $(CC) $(CXXFLAGS) -c -o $@ $< $(CC) $(CXXFLAGS) -MM -MT $@ -MF $(patsubst %.o,%.d,%@) $< This ge... | [
"c++",
"makefile"
] | 6 | 5 | 7,828 | 3 | 0 | 2011-06-02T13:37:34.100000 | 2011-06-02T13:55:20.533000 |
6,215,293 | 6,215,341 | How to Verify using C# if a XML file is broken | Is there anything built in to determine if an XML file is valid. One way would be to read the entire content and verify if the string represents valid XML content. Even then, how to determine if string contains valid XML data. | You can try to load the XML into XML document and catch the exception. Here is the sample code: var doc = new XmlDocument(); try { doc.LoadXml(content); } catch (XmlException e) { // put code here that should be executed when the XML is not valid. } Hope it helps. | How to Verify using C# if a XML file is broken Is there anything built in to determine if an XML file is valid. One way would be to read the entire content and verify if the string represents valid XML content. Even then, how to determine if string contains valid XML data. | TITLE:
How to Verify using C# if a XML file is broken
QUESTION:
Is there anything built in to determine if an XML file is valid. One way would be to read the entire content and verify if the string represents valid XML content. Even then, how to determine if string contains valid XML data.
ANSWER:
You can try to load... | [
"c#",
"xml",
"string",
"validation",
"file"
] | 5 | 4 | 3,907 | 3 | 0 | 2011-06-02T13:38:01.180000 | 2011-06-02T13:42:37.063000 |
6,215,303 | 6,216,915 | Moving elements to end of previous line | I have a problem with moving a defined text block ("PT") to the end of its previous line.. for eg, consider the following:- 100001,-6.0704 PT 100061,19.1127 100122,8.1831 PT I need that to be:- 100001,-6.0704PT 100061,19.1127 100122,8.1831PT I have a large irregularly repeating data like this.. and need to achieve this... | try this as a first attempt @echo off setlocal enabledelayedexpansion set prevline= for /f "tokens=*" %%a in (a.txt) do ( if '%%a'=='PT' ( echo!prevline!PT set prevline= ) else ( if not '!prevline!'=='' echo!prevline! set prevline=%%a ) ) this batch file iterates over all the lines of the a.txt file, storing each line ... | Moving elements to end of previous line I have a problem with moving a defined text block ("PT") to the end of its previous line.. for eg, consider the following:- 100001,-6.0704 PT 100061,19.1127 100122,8.1831 PT I need that to be:- 100001,-6.0704PT 100061,19.1127 100122,8.1831PT I have a large irregularly repeating d... | TITLE:
Moving elements to end of previous line
QUESTION:
I have a problem with moving a defined text block ("PT") to the end of its previous line.. for eg, consider the following:- 100001,-6.0704 PT 100061,19.1127 100122,8.1831 PT I need that to be:- 100001,-6.0704PT 100061,19.1127 100122,8.1831PT I have a large irreg... | [
"excel",
"batch-file",
"notepad++"
] | 0 | 0 | 120 | 1 | 0 | 2011-06-02T13:39:00.980000 | 2011-06-02T15:50:20.807000 |
6,215,310 | 6,216,130 | Limiting PHP's file access according to logged-in user's access permissions | I have a PHP web application (running on Apache/Linux) that, among other things, allows some browsing of local files on the web server. Since Apache is running as a special "www" user, PHP has access to everything that "www" can access, whichever user is logged into the application. What is the best way to limit the ac... | You may take a look over http://httpd.apache.org/docs/2.0/suexec.html it should do what you need, without the need to keep a separate lsit of users and permissions in your aplications. As far as i know, this extension is implemented on some(if not all) shared hosting services to control how resources are divided betwee... | Limiting PHP's file access according to logged-in user's access permissions I have a PHP web application (running on Apache/Linux) that, among other things, allows some browsing of local files on the web server. Since Apache is running as a special "www" user, PHP has access to everything that "www" can access, whichev... | TITLE:
Limiting PHP's file access according to logged-in user's access permissions
QUESTION:
I have a PHP web application (running on Apache/Linux) that, among other things, allows some browsing of local files on the web server. Since Apache is running as a special "www" user, PHP has access to everything that "www" c... | [
"php",
"security",
"web-applications",
"filesystems"
] | 3 | 0 | 879 | 3 | 0 | 2011-06-02T13:39:53.397000 | 2011-06-02T14:47:05.407000 |
6,215,311 | 6,216,680 | Twitter streaming API with Python - controlling the process | I'm writing a script that uses Python to consume Twitter's streaming API. My issue is that I would like to collect tweets for only a specific time frame (i.e. 1 hr worth of tweets). I've used a Timer object to stop the process and attempt to close the connection but this works half the time. I also tried to catch Keybo... | urllib2 is a blocking API and includes buffering. There is little you can do to cleanly interrupt its read() at a given time. You'll need a more flexible HTTP library. Here's a tutorial for Twitter with PyCurl. | Twitter streaming API with Python - controlling the process I'm writing a script that uses Python to consume Twitter's streaming API. My issue is that I would like to collect tweets for only a specific time frame (i.e. 1 hr worth of tweets). I've used a Timer object to stop the process and attempt to close the connecti... | TITLE:
Twitter streaming API with Python - controlling the process
QUESTION:
I'm writing a script that uses Python to consume Twitter's streaming API. My issue is that I would like to collect tweets for only a specific time frame (i.e. 1 hr worth of tweets). I've used a Timer object to stop the process and attempt to ... | [
"python",
"twitter",
"process"
] | 0 | 2 | 586 | 1 | 0 | 2011-06-02T13:40:02.350000 | 2011-06-02T15:28:27.760000 |
6,215,312 | 6,215,570 | Does caching the return value of typeof(MyControl) provide any optimization? | I see code similar to the following sprinkled about some native WPF controls: static MyControl { Type typeFromHandle = typeof(MyControl);
// Which is used in various places SomeProperty.OverrideMetadata(typeFromHandle,...); CommandManager.RegisterClassInputBinding(typeFromHandle,...); EventManager.RegisterClassHandler... | Caching of typeof will give you a small performance boost. The following page gives the benchmarks: Typeof expression used: 2.55 ns Type object cached: 0.64 ns If you typeof a lot, or care about nanoseconds, then this might matter to you! | Does caching the return value of typeof(MyControl) provide any optimization? I see code similar to the following sprinkled about some native WPF controls: static MyControl { Type typeFromHandle = typeof(MyControl);
// Which is used in various places SomeProperty.OverrideMetadata(typeFromHandle,...); CommandManager.Reg... | TITLE:
Does caching the return value of typeof(MyControl) provide any optimization?
QUESTION:
I see code similar to the following sprinkled about some native WPF controls: static MyControl { Type typeFromHandle = typeof(MyControl);
// Which is used in various places SomeProperty.OverrideMetadata(typeFromHandle,...); ... | [
"c#",
".net",
"optimization"
] | 29 | 21 | 3,169 | 3 | 0 | 2011-06-02T13:40:18.893000 | 2011-06-02T13:58:55.583000 |
6,215,313 | 6,216,636 | Updating an Activity from an AsyncTask | So I'm an iOS developer learning android, and I'm having a difficult time understanding some things. Right now I have a datamanager class. In that class it has an AsyncTask to update the data. OnPreExecute I pop an activity to show it is updating. I understand I could use extras to pass initial information to the Updat... | AsyncTask is designed to work best when nested in an Activity class. What makes AsyncTask 'special' is that it isn't just a worker thread - instead it combines a worker thread which processes the code in doInBackground(...) with methods which run on the Activity's UI thread - onProgressUpdate(...) and onPostExecute(...... | Updating an Activity from an AsyncTask So I'm an iOS developer learning android, and I'm having a difficult time understanding some things. Right now I have a datamanager class. In that class it has an AsyncTask to update the data. OnPreExecute I pop an activity to show it is updating. I understand I could use extras t... | TITLE:
Updating an Activity from an AsyncTask
QUESTION:
So I'm an iOS developer learning android, and I'm having a difficult time understanding some things. Right now I have a datamanager class. In that class it has an AsyncTask to update the data. OnPreExecute I pop an activity to show it is updating. I understand I ... | [
"android",
"android-activity",
"android-asynctask"
] | 3 | 6 | 7,631 | 2 | 0 | 2011-06-02T13:40:23.177000 | 2011-06-02T15:25:16.103000 |
6,215,321 | 6,215,510 | PL/SQL DB triggers - Make insertion fail if a given condition is not met | I have a small test database I'm using for learning SQL. There's a Duel table, which contains two Pilot foreign keys (the duelists). I want to check if the duelists haven't already "met" before insertion. Pseudocode: before insertion on Duel for each row already in the table if ((new_row.numpilot1 = old_row.numpilot1 a... | Normally, you wouldn't use a trigger for this sort of requirement. Instead, you'd create a couple of constraints on the table. I would suggest a unique constraint on ( numpilot1, numpilot2 ) along with a check constraint that ensures that numpilot1 < numpilot2. ALTER TABLE duel ADD CONSTRAINT unique_pilot_combination U... | PL/SQL DB triggers - Make insertion fail if a given condition is not met I have a small test database I'm using for learning SQL. There's a Duel table, which contains two Pilot foreign keys (the duelists). I want to check if the duelists haven't already "met" before insertion. Pseudocode: before insertion on Duel for e... | TITLE:
PL/SQL DB triggers - Make insertion fail if a given condition is not met
QUESTION:
I have a small test database I'm using for learning SQL. There's a Duel table, which contains two Pilot foreign keys (the duelists). I want to check if the duelists haven't already "met" before insertion. Pseudocode: before inser... | [
"sql",
"oracle",
"plsql",
"triggers"
] | 3 | 5 | 2,079 | 2 | 0 | 2011-06-02T13:41:28.530000 | 2011-06-02T13:55:27.827000 |
6,215,324 | 6,215,361 | Will Python open a file before it's finished writing? | I am writing a script that will be polling a directory looking for new files. In this scenario, is it necessary to do some sort of error checking to make sure the files are completely written prior to accessing them? I don't want to work with a file before it has been written completely to disk, but because the info I ... | On Unix, unless the writing application goes out of its way, the file won't be locked and you'll be able to read from it. The reader will, of course, have to be prepared to deal with an incomplete file (bearing in mind that there may be I/O buffering happening on the writer's side). If that's a non-starter, you'll have... | Will Python open a file before it's finished writing? I am writing a script that will be polling a directory looking for new files. In this scenario, is it necessary to do some sort of error checking to make sure the files are completely written prior to accessing them? I don't want to work with a file before it has be... | TITLE:
Will Python open a file before it's finished writing?
QUESTION:
I am writing a script that will be polling a directory looking for new files. In this scenario, is it necessary to do some sort of error checking to make sure the files are completely written prior to accessing them? I don't want to work with a fil... | [
"python",
"linux",
"file"
] | 5 | 4 | 3,395 | 4 | 0 | 2011-06-02T13:41:31.213000 | 2011-06-02T13:43:57.280000 |
6,215,337 | 6,215,699 | Java Char on actionscript | I have java class which has a variable of type "char" now I have to conver that class on AS3 side. does any one know whats the java char equivalent on actionsctipt (keeping in mind char accepty only one character ) | This may not be what you want, but I would still use String. I have had this same situation in the past, and I found that using String still provided everything I needed. You could create your own special object with a member String and then control access through getters and setters to make sure that only a single cha... | Java Char on actionscript I have java class which has a variable of type "char" now I have to conver that class on AS3 side. does any one know whats the java char equivalent on actionsctipt (keeping in mind char accepty only one character ) | TITLE:
Java Char on actionscript
QUESTION:
I have java class which has a variable of type "char" now I have to conver that class on AS3 side. does any one know whats the java char equivalent on actionsctipt (keeping in mind char accepty only one character )
ANSWER:
This may not be what you want, but I would still use... | [
"java",
"actionscript",
"character"
] | 0 | 2 | 266 | 1 | 0 | 2011-06-02T13:42:20.353000 | 2011-06-02T14:11:50.243000 |
6,215,345 | 6,215,413 | checkboxes in php - problem with access | i need to reproduce with the code below something like: myformdata[languages1] myformdata[languages2] myformdata[languages3] But with this code only reproduce myformdata[languages $data \n"); }?> i already tried remove the increment and only access with $form_data_array["languages"][1] but in this case i get: Notice: U... | It looks like your output string may be incorrect. Try this one: echo nl2br (" $data \n"); I replaced the two instance of single quotes before and after the increment output with double quotes. Also note, there is no need to increment in PHP. All you need to add is two empty brackets [] and PHP will take care of the in... | checkboxes in php - problem with access i need to reproduce with the code below something like: myformdata[languages1] myformdata[languages2] myformdata[languages3] But with this code only reproduce myformdata[languages $data \n"); }?> i already tried remove the increment and only access with $form_data_array["language... | TITLE:
checkboxes in php - problem with access
QUESTION:
i need to reproduce with the code below something like: myformdata[languages1] myformdata[languages2] myformdata[languages3] But with this code only reproduce myformdata[languages $data \n"); }?> i already tried remove the increment and only access with $form_da... | [
"php",
"arrays"
] | 0 | 1 | 84 | 5 | 0 | 2011-06-02T13:42:57.343000 | 2011-06-02T13:48:13.770000 |
6,215,349 | 6,215,379 | Getting corresponding eNum key for the value passed | var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3, AR: 4, CA: 5, CO: 6, CT: 7, DE: 8, }, Now i need to get the enumValues. function getKeyValue(stateVal) { For example 'AK' I need to get the corresponding value... } | It is simply: var val = StateValue[stateVal]; You can access object properties with bracket notation. I suggest to read MDC - Working with Objects. | Getting corresponding eNum key for the value passed var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3, AR: 4, CA: 5, CO: 6, CT: 7, DE: 8, }, Now i need to get the enumValues. function getKeyValue(stateVal) { For example 'AK' I need to get the corresponding value... } | TITLE:
Getting corresponding eNum key for the value passed
QUESTION:
var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3, AR: 4, CA: 5, CO: 6, CT: 7, DE: 8, }, Now i need to get the enumValues. function getKeyValue(stateVal) { For example 'AK' I need to get the corresponding value... }
ANSWER:
It is simply: var val = ... | [
"javascript"
] | 10 | 21 | 35,382 | 3 | 0 | 2011-06-02T13:43:12.680000 | 2011-06-02T13:45:27.110000 |
6,215,366 | 6,219,671 | How to collect elements of a collection basing on a result of some method? | Suppose we have a list of values sorted according to some ordering. We also have a map of elements mapped to these values. We want to obtain a collection of elements from the map in the same order as their keys are in the list. A straightforward method to do this is: val order = Seq("a", "b", "c") val map = Map("a" -> ... | More generally you can use views; then the collection is only iterated once and all three operations are applied as you go: order.view.map(map.get).filter(_.isDefined).map(_.get).force | How to collect elements of a collection basing on a result of some method? Suppose we have a list of values sorted according to some ordering. We also have a map of elements mapped to these values. We want to obtain a collection of elements from the map in the same order as their keys are in the list. A straightforward... | TITLE:
How to collect elements of a collection basing on a result of some method?
QUESTION:
Suppose we have a list of values sorted according to some ordering. We also have a map of elements mapped to these values. We want to obtain a collection of elements from the map in the same order as their keys are in the list.... | [
"scala",
"scala-collections"
] | 2 | 1 | 202 | 4 | 0 | 2011-06-02T13:44:23.240000 | 2011-06-02T19:56:24.033000 |
6,215,370 | 6,215,464 | Cannot use Using Statement | I am using Visual Studio 2005 and am unable to use the "Using" statement. I have just moved some code over from a.net 4 application, but that does not seem to be the problem as it is still not usable in a new app. Using sw as StreamWriter = new StreamWriter(userFile2) For each blah as blahblah in blah() sw.WriteLine(bl... | Seems compile fine for me (VS 2005/.Net 2.0). You are missing Next for the For Each. Also you don't have to explicitly call Close() for sw, the Using block take care of it. Using sw as StreamWriter = new StreamWriter(userFile2) For each blah as blahblah in blah() sw.WriteLine(blah) Next End Using | Cannot use Using Statement I am using Visual Studio 2005 and am unable to use the "Using" statement. I have just moved some code over from a.net 4 application, but that does not seem to be the problem as it is still not usable in a new app. Using sw as StreamWriter = new StreamWriter(userFile2) For each blah as blahbla... | TITLE:
Cannot use Using Statement
QUESTION:
I am using Visual Studio 2005 and am unable to use the "Using" statement. I have just moved some code over from a.net 4 application, but that does not seem to be the problem as it is still not usable in a new app. Using sw as StreamWriter = new StreamWriter(userFile2) For ea... | [
"vb.net",
"visual-studio-2005"
] | 0 | 1 | 715 | 2 | 0 | 2011-06-02T13:44:36.843000 | 2011-06-02T13:52:15.440000 |
6,215,372 | 6,215,506 | What is causing the error in my CruiseControl.Net Project? | I'm a bit baffled by the results I'm seeing in my CruiseControl.Net build log. The build fails after a few minutes but I can't figure out what's causing it. Build (ForceBuild) triggered from ITUSER-PC C:\CCNet\Projects\Bromley Live\Artifacts ForceBuild 2011-06-02 14:34:38 Failure 1.0.0.0 Failure C:\CCNet\Projects\Broml... | Robocopy does not return proper exit status codes (that is, 0 on success). To work around this, you have to use the successExitCodes attibute on your executable task. Setting it to "0,1,2" should work (you want the task to fail on other results). ( Robocopy exit codes list as a reference.) | What is causing the error in my CruiseControl.Net Project? I'm a bit baffled by the results I'm seeing in my CruiseControl.Net build log. The build fails after a few minutes but I can't figure out what's causing it. Build (ForceBuild) triggered from ITUSER-PC C:\CCNet\Projects\Bromley Live\Artifacts ForceBuild 2011-06-... | TITLE:
What is causing the error in my CruiseControl.Net Project?
QUESTION:
I'm a bit baffled by the results I'm seeing in my CruiseControl.Net build log. The build fails after a few minutes but I can't figure out what's causing it. Build (ForceBuild) triggered from ITUSER-PC C:\CCNet\Projects\Bromley Live\Artifacts F... | [
"cruisecontrol.net"
] | 1 | 5 | 862 | 1 | 0 | 2011-06-02T13:44:59.587000 | 2011-06-02T13:55:20.687000 |
6,215,374 | 6,216,286 | JNI: From C code to Java and JNI | Background I am developing an application for android in eclipse and now I have a problem and I need your help. So I must Call function written in C from JAVA application. But on my way of writing code I have some Questions which you can see below. I am waiting for your answers and ideas... C Code: typdef struct blobDa... | For question #1: You can use a jchar. Primitive chars in java are not signed, it's about the only primitive that isn't. Note that jchar is a UTF-16 char, so you will have to "map" the jchar to a regular char, as you would have to with any character conversion issue. For simple conversions, this can typically be done by... | JNI: From C code to Java and JNI Background I am developing an application for android in eclipse and now I have a problem and I need your help. So I must Call function written in C from JAVA application. But on my way of writing code I have some Questions which you can see below. I am waiting for your answers and idea... | TITLE:
JNI: From C code to Java and JNI
QUESTION:
Background I am developing an application for android in eclipse and now I have a problem and I need your help. So I must Call function written in C from JAVA application. But on my way of writing code I have some Questions which you can see below. I am waiting for you... | [
"java",
"android",
"c",
"eclipse",
"java-native-interface"
] | 12 | 3 | 3,112 | 1 | 0 | 2011-06-02T13:45:11.280000 | 2011-06-02T14:59:31.843000 |
6,215,378 | 6,215,663 | Combine get-ChildItem with ACL powershell | Im looking for some help on information on files using Power shell, we have got most of when we need apart from the owner information. the code below returns a list of directories that are older then 1 year, but the problem is we cannot seem to get the Owner Information to show in there: gci -r "D:\Network Shares\ICT\I... | Something like this? gci -r "D:\Network Shares\ICT\ICT\Network Shares\ICT\Innovations\Robert Pitt" |? {$_.LastWriteTime -lt (Get-Date).AddYears(-1)} | % {$_ | add-member -name "Owner" -membertype noteproperty -value (get-acl $_.fullname).owner -passthru} | Select fullname,lastwritetime,owner | Combine get-ChildItem with ACL powershell Im looking for some help on information on files using Power shell, we have got most of when we need apart from the owner information. the code below returns a list of directories that are older then 1 year, but the problem is we cannot seem to get the Owner Information to show... | TITLE:
Combine get-ChildItem with ACL powershell
QUESTION:
Im looking for some help on information on files using Power shell, we have got most of when we need apart from the owner information. the code below returns a list of directories that are older then 1 year, but the problem is we cannot seem to get the Owner I... | [
"powershell",
"get-childitem"
] | 2 | 7 | 3,536 | 2 | 0 | 2011-06-02T13:45:26.390000 | 2011-06-02T14:08:20.263000 |
6,215,389 | 6,218,241 | One word phrase search to avoid stemming in Solr | I have stemming enabled in my Solr instance, I had assumed that in order to perform an exact word search without disabling stemming, it would be as simple as putting the word into quotes. This however does not appear to be the case? Is there a simple way to achieve this? | There is a simple way, if what you're referring to is the "slop" (required similarity) as part of a fuzzy search (see the Lucene Query Syntax here). For example, if I perform this search: q=field_name:determine I see results that contain "determine", "determining", "determined", etc.. If I then modify the query like so... | One word phrase search to avoid stemming in Solr I have stemming enabled in my Solr instance, I had assumed that in order to perform an exact word search without disabling stemming, it would be as simple as putting the word into quotes. This however does not appear to be the case? Is there a simple way to achieve this? | TITLE:
One word phrase search to avoid stemming in Solr
QUESTION:
I have stemming enabled in my Solr instance, I had assumed that in order to perform an exact word search without disabling stemming, it would be as simple as putting the word into quotes. This however does not appear to be the case? Is there a simple wa... | [
"search",
"lucene",
"solr",
"stemming"
] | 3 | 9 | 4,879 | 2 | 0 | 2011-06-02T13:46:37.203000 | 2011-06-02T17:51:08.897000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.