PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,985,028 | 11/02/2011 17:54:49 | 1,026,162 | 11/02/2011 17:20:15 | 1 | 0 | what are my options for a data entry application | Ok, so I'm finally rewriting an old .Net 1.1 system to bring it into the new decade, and I'd really appreciate some fellow programmer advice.
Let me give a quick description of the application:
* A user is presented a piece of media, could be a video, an image, or a swf.
* That user must fill out information about the media upon viewing it
* The data they must supply is dynamic so the forms can't be hardcoded (currently doing this with reflection, fun!)
* After entering data for one piece of media, they are presented with another, and so on.
So, here are my knowns:
* I want to use NHibernate for my data access (I'm familiar with it, and I love it)
* I will be using SQL server 2008 for my data store
* Needs to either be a thin or web client to allow for remote access
And here are my thoughts about the UI
* HTML5 would allow remote access and media playback, but multi-monitor support would be tricky. Does seem to be where the industry is going, but data entry can be iffy on the web.
* WPF would be the desktop choice, although I'm not quite sure on how to make it a thin client. Is WCF RIA Services available for WPF?
* Should I be considering Silverlight?
So, if you have any opinions, or suggestions, please have at it.
| c# | wpf | html5 | design | wcf-ria-services | null | open | what are my options for a data entry application
===
Ok, so I'm finally rewriting an old .Net 1.1 system to bring it into the new decade, and I'd really appreciate some fellow programmer advice.
Let me give a quick description of the application:
* A user is presented a piece of media, could be a video, an image, or a swf.
* That user must fill out information about the media upon viewing it
* The data they must supply is dynamic so the forms can't be hardcoded (currently doing this with reflection, fun!)
* After entering data for one piece of media, they are presented with another, and so on.
So, here are my knowns:
* I want to use NHibernate for my data access (I'm familiar with it, and I love it)
* I will be using SQL server 2008 for my data store
* Needs to either be a thin or web client to allow for remote access
And here are my thoughts about the UI
* HTML5 would allow remote access and media playback, but multi-monitor support would be tricky. Does seem to be where the industry is going, but data entry can be iffy on the web.
* WPF would be the desktop choice, although I'm not quite sure on how to make it a thin client. Is WCF RIA Services available for WPF?
* Should I be considering Silverlight?
So, if you have any opinions, or suggestions, please have at it.
| 0 |
11,310,841 | 07/03/2012 12:23:17 | 774,386 | 05/28/2011 14:12:14 | 19 | 1 | what is my error here as i cannot solve it | just a bit of code i think i may be being a bit dumb on this one
basically i want it to look at all of the records where the uniqreference is the same. get the matter for each one and run foreach statement replacing the matterID each time
$compliance = mysql_query("SELECT matterid from Links where portalreference='" . $uniqreference ."'");
while ($row = mysql_fetch_assoc($compliance))
{
$matterID = $row['matterid'];
foreach($row as $matterID2)
{
matterfield = $matterID;
(mysql query here)
}
where have i gone wrong? | php | mysql | foreach | while-loops | null | 07/03/2012 18:00:39 | not a real question | what is my error here as i cannot solve it
===
just a bit of code i think i may be being a bit dumb on this one
basically i want it to look at all of the records where the uniqreference is the same. get the matter for each one and run foreach statement replacing the matterID each time
$compliance = mysql_query("SELECT matterid from Links where portalreference='" . $uniqreference ."'");
while ($row = mysql_fetch_assoc($compliance))
{
$matterID = $row['matterid'];
foreach($row as $matterID2)
{
matterfield = $matterID;
(mysql query here)
}
where have i gone wrong? | 1 |
9,063,225 | 01/30/2012 11:35:45 | 1,177,915 | 01/30/2012 11:16:41 | 1 | 0 | Need Suggestions, Website should come from footer not from header | Need Suggestions,
Is there any script for loading website from footer not from header... | javascript | website | header | onload | footer | 01/30/2012 17:01:04 | not a real question | Need Suggestions, Website should come from footer not from header
===
Need Suggestions,
Is there any script for loading website from footer not from header... | 1 |
10,592,410 | 05/14/2012 23:39:00 | 1,394,884 | 05/14/2012 23:34:23 | 1 | 0 | Linux Default Editor with Options | I would like to change my default editor in Linux, my current configuration in ~/.bash_profile has the line:
export EDITOR=emacs
How would I load this with options, ie: emacs -nw ?
Thanks!
| linux | emacs | editor | null | null | 05/15/2012 04:03:44 | off topic | Linux Default Editor with Options
===
I would like to change my default editor in Linux, my current configuration in ~/.bash_profile has the line:
export EDITOR=emacs
How would I load this with options, ie: emacs -nw ?
Thanks!
| 2 |
6,222,524 | 06/03/2011 02:56:00 | 782,115 | 06/03/2011 02:56:00 | 1 | 0 | unable to use the toChecklist Plugin..... | has anybody used the toChecklist jquery plugin, i am trying to use it and followed the instructions, but nothing happen at all, here is my code:
-------------------------------------------------------------
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns="http://www.w3.org/1999/xhtml" >
< html>
< head>
< script type="text/javascript" src="jquery-1.6.1.min.js"></script>
< script type="text/javascript" src="jquery.toChecklist.min.js"></script>
< !-- Stylesheet -->
< link type="text/css" rel="stylesheet" media="screen" href="jquery.toChecklist.min.css" />
< !-- Code to run toChecklist -->
< script type="text/javascript">
$(function() {
$('mySelectBox').toChecklist();
});
< /script>
< /head>
< body>
< select id="mySelectBox" multiple="multiple">
< option>Value 1</option>
< option>Value 2</option>
< option>Value 3</option>
< /select>
< /body>
< /html>
| jquery | xhtml | null | null | null | null | open | unable to use the toChecklist Plugin.....
===
has anybody used the toChecklist jquery plugin, i am trying to use it and followed the instructions, but nothing happen at all, here is my code:
-------------------------------------------------------------
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns="http://www.w3.org/1999/xhtml" >
< html>
< head>
< script type="text/javascript" src="jquery-1.6.1.min.js"></script>
< script type="text/javascript" src="jquery.toChecklist.min.js"></script>
< !-- Stylesheet -->
< link type="text/css" rel="stylesheet" media="screen" href="jquery.toChecklist.min.css" />
< !-- Code to run toChecklist -->
< script type="text/javascript">
$(function() {
$('mySelectBox').toChecklist();
});
< /script>
< /head>
< body>
< select id="mySelectBox" multiple="multiple">
< option>Value 1</option>
< option>Value 2</option>
< option>Value 3</option>
< /select>
< /body>
< /html>
| 0 |
6,862,062 | 07/28/2011 16:05:03 | 866,137 | 07/27/2011 19:05:08 | 3 | 0 | JSONP array undefined outside of function | I found a lot of questions similar to mine; but none of the answers I saw seemed to work for me. So here is my issue. I am using jQuery JSONP to obtain quite a bit of information on some books (the JSON is static so it has a hardcoded function wrapped around it). I have this working great. My problem is that I need to reference the JSON several more times and with it being static I figured I needed to set a local array with the values. So here is my code below:
function changeList(cat) {
getList(cat);
}
var bookArray = new Array();
function parseResponse(jsonData) {
$('#bookList').empty();
var items = [];
var p = '0';
$.each(jsonData, function(item, i) {
bookArray[p] = { 'bookId':i.bookId, 'category':i.category, 'publishedDate':i.publishedDate, 'title':i.title, 'description':i.description, 'images':i.images };
var allImages = i.images;
if(allImages.length > 1) {
var imageLoc = allImages.toString().split(",");
} else {
var imageLoc = new Array(allImages);
}
var theDate = new Date();
theDate.setTime(i.publishedDate * 1000);
var year = theDate.getUTCFullYear();
var month = theDate.getUTCMonth();
var day = theDate.getUTCDate();
var d = months[month] + " " + day + ", " + year;
items.push('<li><a href="/' + i.category + '/' + i.bookId + '/index.html"><img border="0" height="70" width="124" src="' + imageLoc[0] + '"><p>Published: <strong>' + d + '</strong><br /><span class="bookTitle">' + i.title + '</span> ' + i.description + '</p></a></li>');
p++;
});
$('<ul/>', {
html: items.join('')
}).appendTo('#bookList');
}
function getList(section) {
$.getJSON('http://www.otherdomain.com/book_'+ section +'.json?format=jsonp&callback=?', function(data) { });
}
What the snippet of code above does is spits out a list of books from a certain cateogry on the page. There is a menu on the left that has the categories and fires the changeList() function (which in turn triggers the other functions to draw the correct json and spit them out on the page). This part works flawlessly!
Which brings me to my issue, as you can see in the parseResponse() function I am populating the 'bookArray' array that I created. If I reference that array inside the function I have no issues. However, if I try to reference it outside (for example alert(bookArray[0]['title']) I get that it is undefined. What am I doing wrong? I'm not the most tech savy person, so you have to use small words on me. Thanks for any help! | javascript | jquery | arrays | function | jsonp | null | open | JSONP array undefined outside of function
===
I found a lot of questions similar to mine; but none of the answers I saw seemed to work for me. So here is my issue. I am using jQuery JSONP to obtain quite a bit of information on some books (the JSON is static so it has a hardcoded function wrapped around it). I have this working great. My problem is that I need to reference the JSON several more times and with it being static I figured I needed to set a local array with the values. So here is my code below:
function changeList(cat) {
getList(cat);
}
var bookArray = new Array();
function parseResponse(jsonData) {
$('#bookList').empty();
var items = [];
var p = '0';
$.each(jsonData, function(item, i) {
bookArray[p] = { 'bookId':i.bookId, 'category':i.category, 'publishedDate':i.publishedDate, 'title':i.title, 'description':i.description, 'images':i.images };
var allImages = i.images;
if(allImages.length > 1) {
var imageLoc = allImages.toString().split(",");
} else {
var imageLoc = new Array(allImages);
}
var theDate = new Date();
theDate.setTime(i.publishedDate * 1000);
var year = theDate.getUTCFullYear();
var month = theDate.getUTCMonth();
var day = theDate.getUTCDate();
var d = months[month] + " " + day + ", " + year;
items.push('<li><a href="/' + i.category + '/' + i.bookId + '/index.html"><img border="0" height="70" width="124" src="' + imageLoc[0] + '"><p>Published: <strong>' + d + '</strong><br /><span class="bookTitle">' + i.title + '</span> ' + i.description + '</p></a></li>');
p++;
});
$('<ul/>', {
html: items.join('')
}).appendTo('#bookList');
}
function getList(section) {
$.getJSON('http://www.otherdomain.com/book_'+ section +'.json?format=jsonp&callback=?', function(data) { });
}
What the snippet of code above does is spits out a list of books from a certain cateogry on the page. There is a menu on the left that has the categories and fires the changeList() function (which in turn triggers the other functions to draw the correct json and spit them out on the page). This part works flawlessly!
Which brings me to my issue, as you can see in the parseResponse() function I am populating the 'bookArray' array that I created. If I reference that array inside the function I have no issues. However, if I try to reference it outside (for example alert(bookArray[0]['title']) I get that it is undefined. What am I doing wrong? I'm not the most tech savy person, so you have to use small words on me. Thanks for any help! | 0 |
6,101,196 | 05/23/2011 18:18:06 | 757,761 | 05/17/2011 16:23:57 | 11 | 0 | How CSS,PHP and HTML files connects each other ? | when you have CSS,PHP and HTML files in remote folder, when client enter the URL in browser, index.html or index.php runs first? And then how CSS files reads? | php | html | css | null | null | 05/23/2011 18:21:22 | not a real question | How CSS,PHP and HTML files connects each other ?
===
when you have CSS,PHP and HTML files in remote folder, when client enter the URL in browser, index.html or index.php runs first? And then how CSS files reads? | 1 |
11,454,795 | 07/12/2012 15:04:27 | 1,310,887 | 04/03/2012 16:05:11 | 1 | 1 | Operand type clash: Table | I am trying to pass a table as a parameter to the stored procedure.
As part of this , I have desinged a TYPE
CREATE TYPE tblms AS TABLE(clmo int NOT NULL)
go
Table popluated from another proc and tried to pass it to the new proc which I created.
dbo].[gsp_test] (
@tID as tblms READONLY,
@source varchar(100) ='')
But when I tried to execute the procedure I am getting the following error
Operand type clash: table is incompatible with tblms
Please help me if you are clear with the question. | types | operand | clash | null | null | null | open | Operand type clash: Table
===
I am trying to pass a table as a parameter to the stored procedure.
As part of this , I have desinged a TYPE
CREATE TYPE tblms AS TABLE(clmo int NOT NULL)
go
Table popluated from another proc and tried to pass it to the new proc which I created.
dbo].[gsp_test] (
@tID as tblms READONLY,
@source varchar(100) ='')
But when I tried to execute the procedure I am getting the following error
Operand type clash: table is incompatible with tblms
Please help me if you are clear with the question. | 0 |
1,501,608 | 10/01/2009 02:28:08 | 88,427 | 04/08/2009 05:04:54 | 527 | 4 | How do you create an application shortcut (.lnk file) in C# with command line arguments | I've written a simple FTP based file synchronization program. The settings of which can be stored in an XML file. I want users to be able to quickly open the program using various configurations. So I set up the program to be able to read the path to a config file through command line argument. This way shortcuts can be created on the desktop based on different config files. Now I'm trying to add a feature that will automatically create the shortcut for a specific config file.
I've tried using the example from [this post][1] using ShellLink.cs. And I've also tried using IWshRuntimeLibrary as described [here][2]. I'm able to create the shortcut, but the "Target Type" of the shortcut in the properties window ends up being blank in the new shortcut. If I double click the shortcut I get an error window from windows about it having problems finding FooBar.xml at the path provided.
Now, if I open the properties of the new shortcut and change something in the target field, and then change it back. For example delete the x from xml and then just add it back. After click OK the icon of the shortcut immediately switches to the icon of my app, and works correctly when double clicked.
So it appears that when I edit the shortcut manually it forces windows to check if the shortcut target type should be Application and switches it.
So how can I, through C#, create a new shortcut with a target type of Application when the target path does not end with .exe?
[1]: http://stackoverflow.com/questions/234231/how-do-you-create-an-application-shortcut-lnk-file-in-c-or-net
[2]: http://www.geekpedia.com/tutorial125_Create-shortcuts-with-a-.NET-application.html | c# | shortcuts | winforms | null | null | null | open | How do you create an application shortcut (.lnk file) in C# with command line arguments
===
I've written a simple FTP based file synchronization program. The settings of which can be stored in an XML file. I want users to be able to quickly open the program using various configurations. So I set up the program to be able to read the path to a config file through command line argument. This way shortcuts can be created on the desktop based on different config files. Now I'm trying to add a feature that will automatically create the shortcut for a specific config file.
I've tried using the example from [this post][1] using ShellLink.cs. And I've also tried using IWshRuntimeLibrary as described [here][2]. I'm able to create the shortcut, but the "Target Type" of the shortcut in the properties window ends up being blank in the new shortcut. If I double click the shortcut I get an error window from windows about it having problems finding FooBar.xml at the path provided.
Now, if I open the properties of the new shortcut and change something in the target field, and then change it back. For example delete the x from xml and then just add it back. After click OK the icon of the shortcut immediately switches to the icon of my app, and works correctly when double clicked.
So it appears that when I edit the shortcut manually it forces windows to check if the shortcut target type should be Application and switches it.
So how can I, through C#, create a new shortcut with a target type of Application when the target path does not end with .exe?
[1]: http://stackoverflow.com/questions/234231/how-do-you-create-an-application-shortcut-lnk-file-in-c-or-net
[2]: http://www.geekpedia.com/tutorial125_Create-shortcuts-with-a-.NET-application.html | 0 |
7,872,650 | 10/24/2011 07:53:45 | 992,846 | 10/13/2011 06:48:00 | 1 | 0 | how to Send email using GMail SMTP server from jsp page? |
I am trying to send an email via GMail's SMTP server from a jsp page but I didn't get the correct result | java | email | jsp | smtp | gmail | 10/24/2011 22:19:34 | not a real question | how to Send email using GMail SMTP server from jsp page?
===
I am trying to send an email via GMail's SMTP server from a jsp page but I didn't get the correct result | 1 |
9,575,717 | 03/05/2012 23:30:35 | 1,251,026 | 03/05/2012 23:29:07 | 1 | 0 | Magento Custom options in order email | Im having a little problem that i hope you can help me to solve.
Im using Magento 1.6.1.
So i create a new product, and in the last tab, Personalized options i add a new option that must be selected by user, like size or color. As my store has many types of products i used this option so the user can select size, color or other option.
The problem is that when i send the confirmation order email the option doesnt appear.
Can anyone tell me how can i make it appear in order email?
Also, does anyone know how to add product url to the order email?
Hope you people can help me.
Thanks in advance. | magento | null | null | null | null | null | open | Magento Custom options in order email
===
Im having a little problem that i hope you can help me to solve.
Im using Magento 1.6.1.
So i create a new product, and in the last tab, Personalized options i add a new option that must be selected by user, like size or color. As my store has many types of products i used this option so the user can select size, color or other option.
The problem is that when i send the confirmation order email the option doesnt appear.
Can anyone tell me how can i make it appear in order email?
Also, does anyone know how to add product url to the order email?
Hope you people can help me.
Thanks in advance. | 0 |
11,733,889 | 07/31/2012 05:46:54 | 237,383 | 12/23/2009 05:52:33 | 405 | 0 | andengine vs unity3d | I am developing a j2me game and android game using andengine . I used same code using in j2me(java games) for android also. I saw Unity 3d is good tool for developing a game in (web,android and iphone) using c#. Using andengine not need to work out porting.. one build run in all device.
Whether unity 3d its look like flash file.. If i used Unity 3d for android game.. Its possible to handle events(External/internal).
whether unity 3d is good for developing android games ? compare to andengine . Which one will be good for future game development ?
| unity3d | andengine | game-engine | null | null | 07/31/2012 13:01:33 | not constructive | andengine vs unity3d
===
I am developing a j2me game and android game using andengine . I used same code using in j2me(java games) for android also. I saw Unity 3d is good tool for developing a game in (web,android and iphone) using c#. Using andengine not need to work out porting.. one build run in all device.
Whether unity 3d its look like flash file.. If i used Unity 3d for android game.. Its possible to handle events(External/internal).
whether unity 3d is good for developing android games ? compare to andengine . Which one will be good for future game development ?
| 4 |
11,310,573 | 07/03/2012 12:07:55 | 978,756 | 10/04/2011 15:19:12 | 8,236 | 380 | Interrupt handling for page faults to service device memory copies in x86 | I'm trying to work out the control flow of an interrupt, specifically a page fault, on an x86 CPU. Here's what I can figure out so far:
1. IDT is populated with service routine addresses.
2. Interrupt occurs.
3. CPU saves EFLAGS, CS and EIP to stack.
4. EIP is set to ISR address fetched from IDT, i.e. `mov eip, [idtr+interruptNum*4]`
5. Interrupt routine executes.
6. Interrupt routine completes with an `iret` instruction.
Now, let's say the interrupt is actually a page fault relating to a NIC buffer. Would the ISR use `out` to tell the DMA controller to issue a copy from the system memory to the device (or vice versa), or am I way off base here? | x86 | cpu | interrupt | interrupt-handling | dma | null | open | Interrupt handling for page faults to service device memory copies in x86
===
I'm trying to work out the control flow of an interrupt, specifically a page fault, on an x86 CPU. Here's what I can figure out so far:
1. IDT is populated with service routine addresses.
2. Interrupt occurs.
3. CPU saves EFLAGS, CS and EIP to stack.
4. EIP is set to ISR address fetched from IDT, i.e. `mov eip, [idtr+interruptNum*4]`
5. Interrupt routine executes.
6. Interrupt routine completes with an `iret` instruction.
Now, let's say the interrupt is actually a page fault relating to a NIC buffer. Would the ISR use `out` to tell the DMA controller to issue a copy from the system memory to the device (or vice versa), or am I way off base here? | 0 |
11,622,914 | 07/24/2012 01:33:57 | 1,424,329 | 05/29/2012 17:33:55 | 329 | 22 | Process ram usage in /usr/bin/php Linux server | my boss server have a process that is taking the 68% memory usage in centos box:
user1 68.5 /usr/bin/php
But, I don't know what it means? The only idea that I have is that there is a web page that is taken huge resources when it try to load.
| linux | memory | process | centos5 | null | 07/25/2012 02:55:04 | off topic | Process ram usage in /usr/bin/php Linux server
===
my boss server have a process that is taking the 68% memory usage in centos box:
user1 68.5 /usr/bin/php
But, I don't know what it means? The only idea that I have is that there is a web page that is taken huge resources when it try to load.
| 2 |
10,875,527 | 06/04/2012 01:55:14 | 1,433,762 | 06/03/2012 16:31:01 | 1 | 0 | actionscript 3.0 error 1069 "this" cannot find declared variable inside class | "This" is incapable of finding the appropriate variable "array1" despite it clearly being declared within the class. But if I declare the variables outside of the class it works. How can I have the variables inside the class but keep it working?
package
{
//If I declared the variables here it would work.
public class main extends MovieClip
{
public function main():void
{
var array1:Array = [1,2];
var array2:Array = [3,4];
trace(this["array"+1][1]); //returns reference error 1069
}
}
}
Am I stuck with declaring the variables outside of the class?
And no, multidimensional arrays won't work for what I need it for. Though it looks like it would solve everything within the code snippet provided huh?
My intentions is to pass arrays through a class to be used and change which array bunch I use. If I used multidimensional arrays, it would be inefficient due to the amount of copying that would occur. | actionscript-3 | null | null | null | null | null | open | actionscript 3.0 error 1069 "this" cannot find declared variable inside class
===
"This" is incapable of finding the appropriate variable "array1" despite it clearly being declared within the class. But if I declare the variables outside of the class it works. How can I have the variables inside the class but keep it working?
package
{
//If I declared the variables here it would work.
public class main extends MovieClip
{
public function main():void
{
var array1:Array = [1,2];
var array2:Array = [3,4];
trace(this["array"+1][1]); //returns reference error 1069
}
}
}
Am I stuck with declaring the variables outside of the class?
And no, multidimensional arrays won't work for what I need it for. Though it looks like it would solve everything within the code snippet provided huh?
My intentions is to pass arrays through a class to be used and change which array bunch I use. If I used multidimensional arrays, it would be inefficient due to the amount of copying that would occur. | 0 |
10,349,362 | 04/27/2012 10:56:36 | 286,149 | 03/04/2010 10:10:28 | 355 | 20 | Is there an "onClose" event for the fullscreen video player on iPhone? | I am using an html5 video player on a website.
When the user starts playing it, the player goes into fullscreen mode and plays the video.
When the video has ended, I catch the `ended` event and close the video player via `myvideo.webkitExitFullScreen();`.
Now, I need another event when the player actually gets **closed** either if the user taps the "done" button in top bar or if the player gets closed via `video.webkitExitFullScreen();`.
Is there a way to do this? | html5 | events | video | null | null | null | open | Is there an "onClose" event for the fullscreen video player on iPhone?
===
I am using an html5 video player on a website.
When the user starts playing it, the player goes into fullscreen mode and plays the video.
When the video has ended, I catch the `ended` event and close the video player via `myvideo.webkitExitFullScreen();`.
Now, I need another event when the player actually gets **closed** either if the user taps the "done" button in top bar or if the player gets closed via `video.webkitExitFullScreen();`.
Is there a way to do this? | 0 |
4,543,930 | 12/28/2010 05:42:16 | 201,387 | 11/03/2009 03:56:34 | 1,605 | 72 | Which one is better apporach comet or ajax? | i need to update client on any changes occurred on server.
for that i found 2 approach.
1. using ajax which is also known as reverse ajax for this purpose.
2. using COMET.
but i don't know exact difference in both.
my site contains news content and i want that news to be automatically updates when new news is entered by my CMS application.
i have got hundreds of concurrent users on my web application.
please suggest me which approach should i use to get best solution.
also please provide me good example's like for that so that i can implement it.
NOTE: i am using .net framework 2.0 but if its not possible in 2.0 then can also move to 3.5
Thanks.
| c# | asp.net | ajax | comet | null | null | open | Which one is better apporach comet or ajax?
===
i need to update client on any changes occurred on server.
for that i found 2 approach.
1. using ajax which is also known as reverse ajax for this purpose.
2. using COMET.
but i don't know exact difference in both.
my site contains news content and i want that news to be automatically updates when new news is entered by my CMS application.
i have got hundreds of concurrent users on my web application.
please suggest me which approach should i use to get best solution.
also please provide me good example's like for that so that i can implement it.
NOTE: i am using .net framework 2.0 but if its not possible in 2.0 then can also move to 3.5
Thanks.
| 0 |
11,238,838 | 06/28/2012 05:59:58 | 1,487,340 | 06/28/2012 02:39:04 | 1 | 0 | Script can not use and alert message "We're sorry, a server error occurred. Please wait a bit and try again" | my script can used until 28/06/12
project key : M3lNjCXkf28gSsG__pX-a2qKsRpcr8Sdm
SDC key : 497dba0bd1b73fc9
the user used this script by click the url in sites
(a href="/macros/sites?action=run&lib=497dba0bd1b73fc9&funcName=newQuotation")
When user clicked The Link in sites,It's return message "We're sorry, a server error occurred. Please wait a bit and try again".
But,When I run Script in script editer,It,s can use completely.
How can i do? | google-apps-script | null | null | null | null | null | open | Script can not use and alert message "We're sorry, a server error occurred. Please wait a bit and try again"
===
my script can used until 28/06/12
project key : M3lNjCXkf28gSsG__pX-a2qKsRpcr8Sdm
SDC key : 497dba0bd1b73fc9
the user used this script by click the url in sites
(a href="/macros/sites?action=run&lib=497dba0bd1b73fc9&funcName=newQuotation")
When user clicked The Link in sites,It's return message "We're sorry, a server error occurred. Please wait a bit and try again".
But,When I run Script in script editer,It,s can use completely.
How can i do? | 0 |
6,969,477 | 08/06/2011 22:46:19 | 875,601 | 08/02/2011 22:56:27 | 1 | 0 | Joomla Add and Show fields on view/edit User admin page | I was able to insert extra information on a second table called employeeinfo in the joomla database, now I would like to be able to retrieve that extra information and show in the page :
http://localhost:8080/mysite/administra ... k=edit&cid[]=83
What would I need to do so besides the regular information name, username, email , I can read from my other table.......
this is the code I have modified so far in form.php
THANKS IN ADVANCE
enter code hereCode:
<tr>
<td class="key">
<label for="department">
<?php echo JText::_( 'Department' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" name="email" id="email" size="40" value="<?php echo $this->user->get('department'); ?>" />
</td>
</tr> | php | joomla | joomla1.5 | joomla-extensions | null | 08/07/2011 15:24:18 | not a real question | Joomla Add and Show fields on view/edit User admin page
===
I was able to insert extra information on a second table called employeeinfo in the joomla database, now I would like to be able to retrieve that extra information and show in the page :
http://localhost:8080/mysite/administra ... k=edit&cid[]=83
What would I need to do so besides the regular information name, username, email , I can read from my other table.......
this is the code I have modified so far in form.php
THANKS IN ADVANCE
enter code hereCode:
<tr>
<td class="key">
<label for="department">
<?php echo JText::_( 'Department' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" name="email" id="email" size="40" value="<?php echo $this->user->get('department'); ?>" />
</td>
</tr> | 1 |
9,551,464 | 03/04/2012 01:16:20 | 779,444 | 06/01/2011 13:12:37 | 184 | 2 | C# Smoothly Moving Controls | I am trying to slide a label upwards.
When I try to move it with a background color, it kinda works, little flickery.
When I try to move it with transparent background (which is what I need) the control simply disappears from bottom to top. Since before it gets the chance to render the control at position (X, Y-1) it has to render another one (X, Y-2)
for (int i = 0; i < 20; i++)
{
lbl.set_Location(new Point(lbl.get_Location().get_X(), lbl.get_Location().get_Y() - 1));
System.Threading.Thread.Sleep(20);
}
this.get_Controls().Remove(lbl);
I tried using AnimateWindow but it doesn't work.
Util.Animate(lbl, Util.Effect.Slide, 2000, 90);
It's like its just moving the text of the label which eventually makes the text disappear because texts goes out of the bounds of the label.
Any other suggestions?
| c# | animation | render | j# | null | null | open | C# Smoothly Moving Controls
===
I am trying to slide a label upwards.
When I try to move it with a background color, it kinda works, little flickery.
When I try to move it with transparent background (which is what I need) the control simply disappears from bottom to top. Since before it gets the chance to render the control at position (X, Y-1) it has to render another one (X, Y-2)
for (int i = 0; i < 20; i++)
{
lbl.set_Location(new Point(lbl.get_Location().get_X(), lbl.get_Location().get_Y() - 1));
System.Threading.Thread.Sleep(20);
}
this.get_Controls().Remove(lbl);
I tried using AnimateWindow but it doesn't work.
Util.Animate(lbl, Util.Effect.Slide, 2000, 90);
It's like its just moving the text of the label which eventually makes the text disappear because texts goes out of the bounds of the label.
Any other suggestions?
| 0 |
9,355,954 | 02/20/2012 03:49:16 | 1,215,306 | 02/17/2012 03:06:18 | 22 | 0 | How to print how many prime numbers were found | I got this Sieve of Eratosthenes code and I realized that I also have to print out the number of prime numbers found after I print the prime numbers themselves. I've tried a couple of different ways to no avail, could somebody nudge me along the right path or am I just on a wild goose chase?
public class Sieve {
// Initializing the upper limit of the array to not exceed
private static int upperLimit = 1000;
// Initializing boolean to mark true and false
private static boolean[] flags;
public Sieve() {
}
// Main method calling for the lower methods
public static void main(String[] args) {
initialize(args);
findPrimes();
displayPrimes();
}
// This method grabs the integer from the command line argument
// and sets it as the array length
private static void initialize(String[] args) {
try {
if (args.length > 0) {
upperLimit = Integer.parseInt(args[0]);
}
flags = new boolean[upperLimit + 1];
for (int position = 0; position <= upperLimit; position++) {
flags[position] = false;
}
}
catch(Exception e) {
System.out.printf(e.getMessage());
System.out.printf("Argument out of range");
}
}
private static void findPrimes() {
try {
for (int position = 2; position <= Math.sqrt(upperLimit); position++) {
if (!flags[position]) {
int multiple = position * 2;
while (multiple <= upperLimit) {
flags[multiple] = true;
multiple += position;
}
}
}
}
catch(Exception e) {
System.out.printf(e.getMessage());
System.out.printf("Array is out of bounds");
}
}
private static void displayPrimes() {
for (int position = 2; position <= upperLimit; position++) {
if (!flags[position]) {
System.out.printf(position + ", ");
}
}
System.out.printf("\n");
}
}
| java | homework | sieve-of-eratosthenes | null | null | 02/20/2012 04:45:27 | not constructive | How to print how many prime numbers were found
===
I got this Sieve of Eratosthenes code and I realized that I also have to print out the number of prime numbers found after I print the prime numbers themselves. I've tried a couple of different ways to no avail, could somebody nudge me along the right path or am I just on a wild goose chase?
public class Sieve {
// Initializing the upper limit of the array to not exceed
private static int upperLimit = 1000;
// Initializing boolean to mark true and false
private static boolean[] flags;
public Sieve() {
}
// Main method calling for the lower methods
public static void main(String[] args) {
initialize(args);
findPrimes();
displayPrimes();
}
// This method grabs the integer from the command line argument
// and sets it as the array length
private static void initialize(String[] args) {
try {
if (args.length > 0) {
upperLimit = Integer.parseInt(args[0]);
}
flags = new boolean[upperLimit + 1];
for (int position = 0; position <= upperLimit; position++) {
flags[position] = false;
}
}
catch(Exception e) {
System.out.printf(e.getMessage());
System.out.printf("Argument out of range");
}
}
private static void findPrimes() {
try {
for (int position = 2; position <= Math.sqrt(upperLimit); position++) {
if (!flags[position]) {
int multiple = position * 2;
while (multiple <= upperLimit) {
flags[multiple] = true;
multiple += position;
}
}
}
}
catch(Exception e) {
System.out.printf(e.getMessage());
System.out.printf("Array is out of bounds");
}
}
private static void displayPrimes() {
for (int position = 2; position <= upperLimit; position++) {
if (!flags[position]) {
System.out.printf(position + ", ");
}
}
System.out.printf("\n");
}
}
| 4 |
4,224,864 | 11/19/2010 12:16:52 | 221,706 | 11/30/2009 23:05:05 | 11 | 1 | Are there any Objective-C frameworks like Cocoa which provide Arrays, Dictionaries, Strings, etc | Before I start to write my own, are there any Objective-C frameworks or libraries that provide Arrays, Dictionaies and Strings? I am writing for windows so there is no Cocoa, there are ports. But I am only writing a small command line application so I don't really want to use Cocoa because it is quite large. I have looked around and all I can find is Cocoa. | objective-c | arrays | string | dictionary | null | null | open | Are there any Objective-C frameworks like Cocoa which provide Arrays, Dictionaries, Strings, etc
===
Before I start to write my own, are there any Objective-C frameworks or libraries that provide Arrays, Dictionaies and Strings? I am writing for windows so there is no Cocoa, there are ports. But I am only writing a small command line application so I don't really want to use Cocoa because it is quite large. I have looked around and all I can find is Cocoa. | 0 |
11,320,038 | 07/03/2012 22:23:43 | 685,084 | 03/31/2011 04:15:46 | 249 | 20 | Ruby on Rails "target of repeat operator is not specified" | An app I manage suddenly (after a reboot) shows the following error;
target of repeat operator is not specified: /\A\/(*hn)(?:\.([^\/.?]+))?\Z/
The code runs fine on my Macbook (development and production environments), yet on my server I'm seeing the above 500 message.
Here's the stack trace;
journey (1.0.3) lib/journey/path/pattern.rb:94:in `accept'
journey (1.0.3) lib/journey/path/pattern.rb:177:in `to_regexp'
journey (1.0.3) lib/journey/path/pattern.rb:167:in `match'
journey (1.0.3) lib/journey/router.rb:129:in `block in find_routes'
journey (1.0.3) lib/journey/router.rb:128:in `each'
journey (1.0.3) lib/journey/router.rb:128:in `find_all'
journey (1.0.3) lib/journey/router.rb:128:in `find_routes'
journey (1.0.3) lib/journey/router.rb:56:in `call'
actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:570:in `call'
sass (3.1.15) lib/sass/plugin/rack.rb:54:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.0) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in `_run__567979529779051348__call__4075940477208431972__callbacks'
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.0) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.0) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.0) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.0) lib/rails/engine.rb:479:in `call'
railties (3.2.0) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.0) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/home/deploy/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/deploy/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/deploy/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Any ideas?
| ruby-on-rails | linux | ruby-on-rails-3 | null | null | 07/09/2012 19:02:17 | too localized | Ruby on Rails "target of repeat operator is not specified"
===
An app I manage suddenly (after a reboot) shows the following error;
target of repeat operator is not specified: /\A\/(*hn)(?:\.([^\/.?]+))?\Z/
The code runs fine on my Macbook (development and production environments), yet on my server I'm seeing the above 500 message.
Here's the stack trace;
journey (1.0.3) lib/journey/path/pattern.rb:94:in `accept'
journey (1.0.3) lib/journey/path/pattern.rb:177:in `to_regexp'
journey (1.0.3) lib/journey/path/pattern.rb:167:in `match'
journey (1.0.3) lib/journey/router.rb:129:in `block in find_routes'
journey (1.0.3) lib/journey/router.rb:128:in `each'
journey (1.0.3) lib/journey/router.rb:128:in `find_all'
journey (1.0.3) lib/journey/router.rb:128:in `find_routes'
journey (1.0.3) lib/journey/router.rb:56:in `call'
actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:570:in `call'
sass (3.1.15) lib/sass/plugin/rack.rb:54:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.0) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in `_run__567979529779051348__call__4075940477208431972__callbacks'
activesupport (3.2.0) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.0) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.0) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.0) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.0) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.2.0) lib/rails/engine.rb:479:in `call'
railties (3.2.0) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.0) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/home/deploy/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/deploy/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/deploy/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
Any ideas?
| 3 |
4,616,159 | 01/06/2011 14:49:57 | 292,291 | 03/12/2010 10:53:07 | 2,757 | 36 | Is there a PHP Sandbox, something like JSFiddle is to JS? | Is there a PHP Sandbox, something like JSFiddle is to JS? | php | sandbox | null | null | null | 07/06/2012 11:42:01 | not constructive | Is there a PHP Sandbox, something like JSFiddle is to JS?
===
Is there a PHP Sandbox, something like JSFiddle is to JS? | 4 |
9,663,212 | 03/12/2012 07:32:15 | 1,263,468 | 03/12/2012 06:55:22 | 1 | 0 | the projected average profile?--some sentences in a paper could not be understood exactly | everyone I am a non-English student, and now I am read a paper, the name is:
*A Hierarchical Algorithm for Vehicle Model Type Recognition on Time-sequence Road Images*
The site of this paper is:
http://www.google.com.hk/url?sa=t&rct=j&q=A%20Hierarchical%20Algorithm%20for%20Vehicle%20Model%20Type%20Recognition%20on%20Time-sequence%20Road%20Images&source=web&cd=1&ved=0CDcQFjAA&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D1706797&ei=-55dT9-KL8-jiAfmnOCVDQ&usg=AFQjCNGdKxsBFFQQuVEQe8EsR7SV2yEd4A
I have some sentences in this paper which can hardly be understood exactly in my own language.
So I hope someone can help me.
**1.**-------In this method, **the projected average profile** of the Rx(i,j) through the horizontal scanning line is calculated to detect the vehicle front.-------
Here, the mean of the projected average profile is?
**2.**-------Scanning the front area of the vehicle, the sum of edge
intensities of pixels in rectangle areas, which are held on the
same distance from the symmetry axis, is calculated.--------
Here, what is the mean of this sentence ? (need to read the paper )
Thank you very much!!! | image | model | recognition | null | null | 03/13/2012 12:51:16 | not a real question | the projected average profile?--some sentences in a paper could not be understood exactly
===
everyone I am a non-English student, and now I am read a paper, the name is:
*A Hierarchical Algorithm for Vehicle Model Type Recognition on Time-sequence Road Images*
The site of this paper is:
http://www.google.com.hk/url?sa=t&rct=j&q=A%20Hierarchical%20Algorithm%20for%20Vehicle%20Model%20Type%20Recognition%20on%20Time-sequence%20Road%20Images&source=web&cd=1&ved=0CDcQFjAA&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D1706797&ei=-55dT9-KL8-jiAfmnOCVDQ&usg=AFQjCNGdKxsBFFQQuVEQe8EsR7SV2yEd4A
I have some sentences in this paper which can hardly be understood exactly in my own language.
So I hope someone can help me.
**1.**-------In this method, **the projected average profile** of the Rx(i,j) through the horizontal scanning line is calculated to detect the vehicle front.-------
Here, the mean of the projected average profile is?
**2.**-------Scanning the front area of the vehicle, the sum of edge
intensities of pixels in rectangle areas, which are held on the
same distance from the symmetry axis, is calculated.--------
Here, what is the mean of this sentence ? (need to read the paper )
Thank you very much!!! | 1 |
3,304,803 | 07/21/2010 23:57:29 | 2,543 | 08/22/2008 18:27:05 | 2,493 | 140 | Catching an Exception across treeview.Nodes.Add / treeview_AfterSelect event boundary | There is a place in my WinForms program that throws a MyOwnException.
void CodeThatThrowsMyOwnException()
{
...
throw new MyOwnException("Deep Inside");
...
}
Further up the stack, there is a simple try/catch block
try
{
CodeThatThrowsMyOwnException();
}
catch (MyOwnException moe)
{
MessageBox.Show("Hit this point in the code! Hurray!");
}
MessageBox.Show("Later, alligator.");
On a colleague's computer (running VS 2008 SP1 like me) the dialog box shows up. On my computer, it never catches the exception nor shows the dialog box. When I place a breakpoint deep inside the code (CodeThatThrowsMyOwnException) on the line that throws the Exception, it hits the breakpoint on the line. If I press F5 (Debug > Run) it skips passed my catch block and displays the "Later, alligator" message.
Actually pasting the "void CodeThatThrowsMyOwnException() { throw new MyOwnException("Shallow"); }" code into my code (instead of calling my real code) and literally calling "CodeThatThrowsMyOwnException();" in the try block does however get show the message in the catch block.
As far as I can tell, I am not creating any threads and I have looked for try {} catch {} blocks that catch all exceptions but cannot find any in the involved projects (and if they were in there, why would this catch block still work on my colleague's machine?)
Strangely enough running my code by double clicking the executable gives me an unhandled exception on my machine and the same on my colleague's machine. This is a clue that led me to try the following:
When I place a breakpoint at the throw MyOwnException("Deep Inside") line deep inside my code, the call stack contains a line "[External Code]" between my exception handler and the place where I call 'throw MyOwnException("Deep Inside")'. If I put a try/catch MyOwnException block further away from the throw (but on this side of the [External Code] I can still catch the exception, anywhere I place the try catch block (around relevant parts of the function chain):
try
{
CodeChain(...);
}
catch (DrawException de)
{
MessageBox.Show("Hurray!"); // being executed, but only on the 'throw' side of the [External Code] part of the call stack
}
However, when I step outside (below on the stack) the [External Code], the exception does not fire. This is unexpected:
try
{
treeview.Nodes.Add(treeNode); // triggers the aforementioned chain of code with MyOwnException thrown
}
catch (DrawException de) // no matter what I do, this will not handle my cursed MyOwnException
{
MessageBox.Show("Hurray!"); // not being executed
}
This is the heart of my problem: I can't move my catch up the call stack because I need to run lots of tests (see below).
I have a sort of hypothesis, which is that his debugger is magically lifting the exception across thread boundaries (or across external code, i.e. Windows GUI events) in his debugger, whereas in the other three situations (my debugger (without the 64 bit extensions) and also when either machine runs the EXE from windows explorer the exception) the exception is truly unhandled on that thread.
So how do I catch this exception? Re-engineer my whole system to avoid using treeview.AfterSelect? Clearly I don't understand the limitations of exceptions.
<h2>Potential problem?</h2>
- I have a delegate in there to keep my system modular and reusable. Can exceptions be thrown "through" a delegate, across module boundaries?
<h2>What I'm trying to accomplish (Testing Harness) and why I need Exceptions</h2>
I'm using this in an automated test harness. I need to fix some really tough logical/algorithmic bugs in a complicated GUI system by replaying action scripts (text files) that find these exceptional circumstances and narrow the problem down. (There is probably no good workaround to this in my program, in terms of rewriting or refactoring the design: I need to catch these Exceptions in this QA phase, fix the bugs (tough algorithmic special cases) before I ship so I don't subject my users to such buggy software. It's not like I'm using exceptions for exotic control flow for for fun (cf. Int32.Parse).)
| c# | winforms | exception-handling | treeview | null | null | open | Catching an Exception across treeview.Nodes.Add / treeview_AfterSelect event boundary
===
There is a place in my WinForms program that throws a MyOwnException.
void CodeThatThrowsMyOwnException()
{
...
throw new MyOwnException("Deep Inside");
...
}
Further up the stack, there is a simple try/catch block
try
{
CodeThatThrowsMyOwnException();
}
catch (MyOwnException moe)
{
MessageBox.Show("Hit this point in the code! Hurray!");
}
MessageBox.Show("Later, alligator.");
On a colleague's computer (running VS 2008 SP1 like me) the dialog box shows up. On my computer, it never catches the exception nor shows the dialog box. When I place a breakpoint deep inside the code (CodeThatThrowsMyOwnException) on the line that throws the Exception, it hits the breakpoint on the line. If I press F5 (Debug > Run) it skips passed my catch block and displays the "Later, alligator" message.
Actually pasting the "void CodeThatThrowsMyOwnException() { throw new MyOwnException("Shallow"); }" code into my code (instead of calling my real code) and literally calling "CodeThatThrowsMyOwnException();" in the try block does however get show the message in the catch block.
As far as I can tell, I am not creating any threads and I have looked for try {} catch {} blocks that catch all exceptions but cannot find any in the involved projects (and if they were in there, why would this catch block still work on my colleague's machine?)
Strangely enough running my code by double clicking the executable gives me an unhandled exception on my machine and the same on my colleague's machine. This is a clue that led me to try the following:
When I place a breakpoint at the throw MyOwnException("Deep Inside") line deep inside my code, the call stack contains a line "[External Code]" between my exception handler and the place where I call 'throw MyOwnException("Deep Inside")'. If I put a try/catch MyOwnException block further away from the throw (but on this side of the [External Code] I can still catch the exception, anywhere I place the try catch block (around relevant parts of the function chain):
try
{
CodeChain(...);
}
catch (DrawException de)
{
MessageBox.Show("Hurray!"); // being executed, but only on the 'throw' side of the [External Code] part of the call stack
}
However, when I step outside (below on the stack) the [External Code], the exception does not fire. This is unexpected:
try
{
treeview.Nodes.Add(treeNode); // triggers the aforementioned chain of code with MyOwnException thrown
}
catch (DrawException de) // no matter what I do, this will not handle my cursed MyOwnException
{
MessageBox.Show("Hurray!"); // not being executed
}
This is the heart of my problem: I can't move my catch up the call stack because I need to run lots of tests (see below).
I have a sort of hypothesis, which is that his debugger is magically lifting the exception across thread boundaries (or across external code, i.e. Windows GUI events) in his debugger, whereas in the other three situations (my debugger (without the 64 bit extensions) and also when either machine runs the EXE from windows explorer the exception) the exception is truly unhandled on that thread.
So how do I catch this exception? Re-engineer my whole system to avoid using treeview.AfterSelect? Clearly I don't understand the limitations of exceptions.
<h2>Potential problem?</h2>
- I have a delegate in there to keep my system modular and reusable. Can exceptions be thrown "through" a delegate, across module boundaries?
<h2>What I'm trying to accomplish (Testing Harness) and why I need Exceptions</h2>
I'm using this in an automated test harness. I need to fix some really tough logical/algorithmic bugs in a complicated GUI system by replaying action scripts (text files) that find these exceptional circumstances and narrow the problem down. (There is probably no good workaround to this in my program, in terms of rewriting or refactoring the design: I need to catch these Exceptions in this QA phase, fix the bugs (tough algorithmic special cases) before I ship so I don't subject my users to such buggy software. It's not like I'm using exceptions for exotic control flow for for fun (cf. Int32.Parse).)
| 0 |
7,116,489 | 08/19/2011 02:58:15 | 744,845 | 05/09/2011 09:14:09 | 1 | 0 | FluentNHibernate or NHibernate Mapping by Code | I have tested with FNH and NH mapping by code, it works fine too. Just with simple test, I still not identify pros & cons for each one. Any master there, could you show me some information? | nhibernate | mapping-by-code | null | null | null | 08/20/2011 01:37:34 | not a real question | FluentNHibernate or NHibernate Mapping by Code
===
I have tested with FNH and NH mapping by code, it works fine too. Just with simple test, I still not identify pros & cons for each one. Any master there, could you show me some information? | 1 |
2,649,059 | 04/15/2010 21:19:59 | 64,290 | 02/09/2009 19:31:48 | 3,308 | 102 | Detecting/Repairing NSConnection failure | I would like to use NSConnection/NSDistributedObject for interprocess communication. I would like the client to be able to handle the case where the server is only occasionally reachable.
How can I determine if sending a message to the NSConnection will fail or has failed? Currently if my server (the process that has vended the remote object) dies, the client will **crash** if it sends a selector to the remote object.
Ideally I'd like to have a wrapper for the remote object that can lazily instantiate (or reinstantiate) the connection, and return a default value in the case where the connection could not be instantiated, or the connection has failed. I don't really know the correct way to do this using objective c.
Here's some pseudocode representing this logic:
if myConnection is null:
instantiate myConnection
if MyConnection is null:
return defaultValue
try
return [myConnection someMethod]
catch
myConnection = null
return defaultValue | nsconnection | objective-c | cocoa | null | null | null | open | Detecting/Repairing NSConnection failure
===
I would like to use NSConnection/NSDistributedObject for interprocess communication. I would like the client to be able to handle the case where the server is only occasionally reachable.
How can I determine if sending a message to the NSConnection will fail or has failed? Currently if my server (the process that has vended the remote object) dies, the client will **crash** if it sends a selector to the remote object.
Ideally I'd like to have a wrapper for the remote object that can lazily instantiate (or reinstantiate) the connection, and return a default value in the case where the connection could not be instantiated, or the connection has failed. I don't really know the correct way to do this using objective c.
Here's some pseudocode representing this logic:
if myConnection is null:
instantiate myConnection
if MyConnection is null:
return defaultValue
try
return [myConnection someMethod]
catch
myConnection = null
return defaultValue | 0 |
7,226,518 | 08/29/2011 05:44:11 | 489,559 | 10/28/2010 01:28:22 | 13 | 0 | Problem about connecting wireless network in rhel6 | I've just installed rhel6 but I cannot connect to the wireless network.
There is no wireless interface when i use ifconfig.
![enter image description here][1]
My wireless card is: Intel Centrino Wireless-N1030
Here is the output of lspci:
![enter image description here][2]
And I then consult [http://intellinuxwireless.org/][3], find the firmware file
and put it in /lib/firmware. But it does not work.
Any ideas? Thanks.
[1]: http://i.stack.imgur.com/ZeqCW.png
[2]: http://i.stack.imgur.com/N0VyA.png
[3]: http://intellinuxwireless.org/ | wireless | rhel | null | null | null | 08/29/2011 06:42:00 | off topic | Problem about connecting wireless network in rhel6
===
I've just installed rhel6 but I cannot connect to the wireless network.
There is no wireless interface when i use ifconfig.
![enter image description here][1]
My wireless card is: Intel Centrino Wireless-N1030
Here is the output of lspci:
![enter image description here][2]
And I then consult [http://intellinuxwireless.org/][3], find the firmware file
and put it in /lib/firmware. But it does not work.
Any ideas? Thanks.
[1]: http://i.stack.imgur.com/ZeqCW.png
[2]: http://i.stack.imgur.com/N0VyA.png
[3]: http://intellinuxwireless.org/ | 2 |
10,768,038 | 05/26/2012 16:37:19 | 1,419,243 | 05/26/2012 16:29:21 | 1 | 0 | Is there any Phrase head finder? | I have some sentences that I want to parse. Here is what I have and what I need: I have sentences like these:
I was in the hospital.
I was going from home to Canada.
What I want is to know the head of "in the hospital", "from home", and "to Canada" phrases.
I am using Berkley parser, but what it gives me is the parsing result of all the sentence, and if I want to extract the head of phrases manually, I should develop another parser! The file that I want to parse is a very big file, so if I develop a parser myself, it may have many errors. Is there any parser that can give me the result I am looking for?
By the way, as parsing the phrases separately, may result in a different parsing compared with sentence parsing, I insist on parsing the sentences and then extract the phrase heads.
Thank you, | java | parsing | null | null | null | null | open | Is there any Phrase head finder?
===
I have some sentences that I want to parse. Here is what I have and what I need: I have sentences like these:
I was in the hospital.
I was going from home to Canada.
What I want is to know the head of "in the hospital", "from home", and "to Canada" phrases.
I am using Berkley parser, but what it gives me is the parsing result of all the sentence, and if I want to extract the head of phrases manually, I should develop another parser! The file that I want to parse is a very big file, so if I develop a parser myself, it may have many errors. Is there any parser that can give me the result I am looking for?
By the way, as parsing the phrases separately, may result in a different parsing compared with sentence parsing, I insist on parsing the sentences and then extract the phrase heads.
Thank you, | 0 |
10,298,837 | 04/24/2012 13:27:13 | 784,193 | 06/04/2011 19:05:00 | 1 | 0 | Redirect user to previous page in Joomla | I have integrated Joomla with a vBulletin and a CPG using jFusion .
I have set the login link of vB and CPG as http://fakesite.com/site/index.php?option=com_user&view=login&return=Zm9ydW0ucGhw , so that when a user logs into Joomla from that link , he will get redirected back to vB or CPG after a successful login .
This is happening correctly , but when I login with a wrong username and password , it just redirects back to vB or CPG without any warning, or prompting to try again .
I am using latest Joomla 1.5.x version .
How can I fix this ? | php | joomla | joomla1.5 | joomla1.7 | joomla1.6 | null | open | Redirect user to previous page in Joomla
===
I have integrated Joomla with a vBulletin and a CPG using jFusion .
I have set the login link of vB and CPG as http://fakesite.com/site/index.php?option=com_user&view=login&return=Zm9ydW0ucGhw , so that when a user logs into Joomla from that link , he will get redirected back to vB or CPG after a successful login .
This is happening correctly , but when I login with a wrong username and password , it just redirects back to vB or CPG without any warning, or prompting to try again .
I am using latest Joomla 1.5.x version .
How can I fix this ? | 0 |
3,799,782 | 09/26/2010 20:54:01 | 150,319 | 08/04/2009 12:31:03 | 15 | 3 | How to constrain loaded swf? | I load swf files continuosly, but if one of the swfs has some defective code such as Mouse.hide() the mouse disappears when the swf is loaded. I want to constrain such malicious code in loaded swfs.
There is also another problem related to contraining loaded or loading swfs. When I load a swf which loads another swf to operate, It does never completes loading (Event.Complete of contentLoaderInfo) because it needs another swf to load. However, swf should be loaded before it runs. Since loaded swf is as-2, loader does not give any error. I am also suspicious whether or not it will give error if it is as-3. | actionscript-3 | security | swf | loader | null | null | open | How to constrain loaded swf?
===
I load swf files continuosly, but if one of the swfs has some defective code such as Mouse.hide() the mouse disappears when the swf is loaded. I want to constrain such malicious code in loaded swfs.
There is also another problem related to contraining loaded or loading swfs. When I load a swf which loads another swf to operate, It does never completes loading (Event.Complete of contentLoaderInfo) because it needs another swf to load. However, swf should be loaded before it runs. Since loaded swf is as-2, loader does not give any error. I am also suspicious whether or not it will give error if it is as-3. | 0 |
6,921,750 | 08/03/2011 04:47:41 | 875,879 | 08/03/2011 04:47:41 | 1 | 0 | installing a new module in apache(wamp) on windows 7 | I have been trying to install a new module(specifically wsgi) in apache(wamp) on windows 7. I have referred it on the web. I got a solution too that said to make changes to the httpd.conf file, but my apache didn't start after that. Please give me a solution on how to install it. I am using wamp version 2.0 with apache 2.2.8. | apache | windows-7 | mod-wsgi | null | null | 08/09/2011 08:44:22 | off topic | installing a new module in apache(wamp) on windows 7
===
I have been trying to install a new module(specifically wsgi) in apache(wamp) on windows 7. I have referred it on the web. I got a solution too that said to make changes to the httpd.conf file, but my apache didn't start after that. Please give me a solution on how to install it. I am using wamp version 2.0 with apache 2.2.8. | 2 |
9,298,037 | 02/15/2012 17:18:37 | 1,211,947 | 02/15/2012 17:04:51 | 1 | 0 | how we can know there is abalancing of pranthess in c++ | I have Question in C++ but i didn't know how I can solve problem . The Qustion said :
write a programm in c++ to tset the balancing of paranthess in the given expression using stack .
Example of experssion :
((())) ()) | c++ | null | null | null | null | 02/15/2012 17:28:08 | not a real question | how we can know there is abalancing of pranthess in c++
===
I have Question in C++ but i didn't know how I can solve problem . The Qustion said :
write a programm in c++ to tset the balancing of paranthess in the given expression using stack .
Example of experssion :
((())) ()) | 1 |
1,518,134 | 10/05/2009 03:15:59 | 400,861 | 08/05/2009 20:06:53 | 17 | 5 | Free Lexical Analyzer / Scanner Source | I'm looking for a hand-written free lexer/scanner for any language, even a toy language written in a language similiar to C/C++. I am a beginner in creating languages and compiler design, I'd like to play around with the source.
Thanks.
| lexical-analysis | compiler-theory | null | null | null | null | open | Free Lexical Analyzer / Scanner Source
===
I'm looking for a hand-written free lexer/scanner for any language, even a toy language written in a language similiar to C/C++. I am a beginner in creating languages and compiler design, I'd like to play around with the source.
Thanks.
| 0 |
9,008,292 | 01/25/2012 18:39:21 | 1,169,846 | 01/25/2012 18:31:36 | 1 | 0 | How to retrieve all indexes in a database along with their data types in SQL Server 2005? | I have a maintenance task that's failing because there are a few indexes on the database that have a type which does not allow online rebuilding of the index. Offline is not an option in my industry, so I have to create my own T-SQL task that does the index rebuilding on specific indexes. The database is large with many tables and indexes, so is there a way to query the system for all indexes and their data types? | sql | indexing | maintenance-plan | null | null | null | open | How to retrieve all indexes in a database along with their data types in SQL Server 2005?
===
I have a maintenance task that's failing because there are a few indexes on the database that have a type which does not allow online rebuilding of the index. Offline is not an option in my industry, so I have to create my own T-SQL task that does the index rebuilding on specific indexes. The database is large with many tables and indexes, so is there a way to query the system for all indexes and their data types? | 0 |
1,769,649 | 11/20/2009 10:39:31 | 197,302 | 10/27/2009 12:29:07 | 7 | 2 | Parsing every element of an array as an integer | I have a string which I need to split into an array and then perform mathematical functions on each element of the array.
Currently I am doing something like this. (Actually, I am doing nothing like this, but this is a very simple example to explain my question!
var stringBits = theString.split('/');
var result = parseInt(stringBits[0]) + parseInt(stringBits[3]) / parseInt(stringBits[1]);
What I would like to know is if there is a way I can convert every element of an array into a certain type that would stop me from having to explicitly parse it each time.
| javascript | arrays | parsing | null | null | null | open | Parsing every element of an array as an integer
===
I have a string which I need to split into an array and then perform mathematical functions on each element of the array.
Currently I am doing something like this. (Actually, I am doing nothing like this, but this is a very simple example to explain my question!
var stringBits = theString.split('/');
var result = parseInt(stringBits[0]) + parseInt(stringBits[3]) / parseInt(stringBits[1]);
What I would like to know is if there is a way I can convert every element of an array into a certain type that would stop me from having to explicitly parse it each time.
| 0 |
1,309,251 | 08/20/2009 22:47:53 | 133,998 | 07/07/2009 01:55:00 | 18 | 1 | Rspec: "undefined local variable or method `controller_class_path' for #<RspecControllerGenerator" | I keep getting this error when I try to run
<pre>
./script/generate rspec_controller foo
undefined local variable or method `controller_class_path' for <RspecControllerGenerator:0x25b046c>
</pre>
I am using Rails 2.3.3, rspec 1.2.8, rspec-rails 1.2.7.1
The offending line is line 15 in rspec-rails/generators/rspec_controller/rspec_controller_generator.rb
<code:ruby>
m.directory File.join('spec/routing', controller_class_path)
</code>
The controller generator fails to run. Any ideas? | rspec | null | null | null | null | null | open | Rspec: "undefined local variable or method `controller_class_path' for #<RspecControllerGenerator"
===
I keep getting this error when I try to run
<pre>
./script/generate rspec_controller foo
undefined local variable or method `controller_class_path' for <RspecControllerGenerator:0x25b046c>
</pre>
I am using Rails 2.3.3, rspec 1.2.8, rspec-rails 1.2.7.1
The offending line is line 15 in rspec-rails/generators/rspec_controller/rspec_controller_generator.rb
<code:ruby>
m.directory File.join('spec/routing', controller_class_path)
</code>
The controller generator fails to run. Any ideas? | 0 |
3,976,367 | 10/20/2010 09:23:48 | 193,655 | 10/21/2009 08:29:52 | 730 | 9 | How to choose developer tools (Delphi)? | As stated in many places in SO "hardware/software is cheap, people is expensive".
Tools, like the ones listed [here][1] can really make a difference. Now I am stepping out of the cave and I am realizing that i must update myself.
I started studying "theory", I have a busy schedule for reading books on Refactoring, UnitTest, OOP Patterns. But all this is a lot of theory.
It is very good to do refactorings, write tests and apply patterns. But doing this simply in Delphi IDE (copying and pasting code/using the buggy built in refactorings) it is good for understanding the concepts, but for being proficient I feel tools are a must. Without a UML tool, I think it is impossible to refactor complex classes (or, even worse, legacy software where classes are just containers for procedural code). I am not experienced yet in OOP, but I translated in Delphi and followed step by step chapter one of [Fowler's Refactorign][2]. Yes, I see the great benefits, but I also realized how easy it is to get lost as many methods start to be added to classes (for good OO design). In those theoretical books there is almost never a reference the a CASE tool, or they say (I read this on [Ambler's Object Primer][3]) that CASE tools won't change your lifes. I agree that a CASE tool is not the starting point, first one must master the idea, and then use a tool (somehow we learng writing a language on paper and the we move to word processors).
Sticking on that first chapter example. I never used a CASE tool with advanced refactoring optinos, but I am sure it would have taken 1/3 of the time to do those refactorings with a tool.
And the same applies for all other cases: UI testing for example. One test I need to do in one application is to push all the buttons to see if errors occurs. If a tool allows me to do this, even if it costs 500$ it is worth.
Another example DUnit. Yes it is free but many things are left to the develoeper. If a tool like [TestComplete][4] makes me save time and money and headache, why shuoldn't I go for it?
Then a problem comes from choosing the tools. I see these problems:
1) etherogeneous tools that has great features can be comlpex to learn and master, while a suite of tools with may be some less feature can speed your way up. (for example buying 3 tools from same vendor, or a tool that does 3 things is maybe better than buying the 3 best tools from 3 different vendors)
2) Make a priority list: which tool do I need first? Buy only that one, master it then go to the next? The only tool I am using now is proDelphi profiler, may be it is not the best profiler on the world (now AQ is even built in in Delphi XE) but anyway being able to use it it helped me in finding bottlenecks I couldn't guess.
3) buy it or code it? I often read on forums about "buying dataabstract vs write your own libraries for 3-tier developement". Coding everything can be ok for a huge organization but for a small one as mine I think the solution is investing in 3rd party libraries (picking of course the ones from companies that seems not near to bankrupt). Let's make the dataabstract example. It costs around 1000$. Let's say the cost of a developer is 2000$ per month (just to have an idea). Anyway you get the library at less then 1 developer month work. Buying upgrades is like maintaining the libraries. The cost is much less and the features and performance are better.
4) I don't see a point of dimishing returns with tools/libraries, but may be I am wrong.
Somehow to step out of the cave of procedural programming and enter in the world of effficient programming there is monster jump to do. Doing OOP on simple "book examples" projects is nice. But putting it into practice in wide systems is scaring, expecially because I don't have an expert with me, I have to do it on myself.
Final thought: using tools, buying libraries... I think this is necessary to delegate to tools/libraries some tasks and focus only on what I really need to do. Anyway I am confused a little, scared too. May you please comment on what I wrote and give suggestions **that can help me**?
[1]: http://stackoverflow.com/questions/63957/what-is-the-best-set-of-tools-to-develop-win32-delphi-applications
[2]: http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672/ref=sr_1_1?ie=UTF8&qid=1287565494&sr=8-1
[3]: http://www.amazon.com/Object-Primer-Agile-Model-Driven-Development/dp/0521540186/ref=sr_1_1?ie=UTF8&qid=1287565662&sr=8-1
[4]: http://www.automatedqa.com/products/testcomplete/ | delphi | oop | 3rd-party-library | null | null | null | open | How to choose developer tools (Delphi)?
===
As stated in many places in SO "hardware/software is cheap, people is expensive".
Tools, like the ones listed [here][1] can really make a difference. Now I am stepping out of the cave and I am realizing that i must update myself.
I started studying "theory", I have a busy schedule for reading books on Refactoring, UnitTest, OOP Patterns. But all this is a lot of theory.
It is very good to do refactorings, write tests and apply patterns. But doing this simply in Delphi IDE (copying and pasting code/using the buggy built in refactorings) it is good for understanding the concepts, but for being proficient I feel tools are a must. Without a UML tool, I think it is impossible to refactor complex classes (or, even worse, legacy software where classes are just containers for procedural code). I am not experienced yet in OOP, but I translated in Delphi and followed step by step chapter one of [Fowler's Refactorign][2]. Yes, I see the great benefits, but I also realized how easy it is to get lost as many methods start to be added to classes (for good OO design). In those theoretical books there is almost never a reference the a CASE tool, or they say (I read this on [Ambler's Object Primer][3]) that CASE tools won't change your lifes. I agree that a CASE tool is not the starting point, first one must master the idea, and then use a tool (somehow we learng writing a language on paper and the we move to word processors).
Sticking on that first chapter example. I never used a CASE tool with advanced refactoring optinos, but I am sure it would have taken 1/3 of the time to do those refactorings with a tool.
And the same applies for all other cases: UI testing for example. One test I need to do in one application is to push all the buttons to see if errors occurs. If a tool allows me to do this, even if it costs 500$ it is worth.
Another example DUnit. Yes it is free but many things are left to the develoeper. If a tool like [TestComplete][4] makes me save time and money and headache, why shuoldn't I go for it?
Then a problem comes from choosing the tools. I see these problems:
1) etherogeneous tools that has great features can be comlpex to learn and master, while a suite of tools with may be some less feature can speed your way up. (for example buying 3 tools from same vendor, or a tool that does 3 things is maybe better than buying the 3 best tools from 3 different vendors)
2) Make a priority list: which tool do I need first? Buy only that one, master it then go to the next? The only tool I am using now is proDelphi profiler, may be it is not the best profiler on the world (now AQ is even built in in Delphi XE) but anyway being able to use it it helped me in finding bottlenecks I couldn't guess.
3) buy it or code it? I often read on forums about "buying dataabstract vs write your own libraries for 3-tier developement". Coding everything can be ok for a huge organization but for a small one as mine I think the solution is investing in 3rd party libraries (picking of course the ones from companies that seems not near to bankrupt). Let's make the dataabstract example. It costs around 1000$. Let's say the cost of a developer is 2000$ per month (just to have an idea). Anyway you get the library at less then 1 developer month work. Buying upgrades is like maintaining the libraries. The cost is much less and the features and performance are better.
4) I don't see a point of dimishing returns with tools/libraries, but may be I am wrong.
Somehow to step out of the cave of procedural programming and enter in the world of effficient programming there is monster jump to do. Doing OOP on simple "book examples" projects is nice. But putting it into practice in wide systems is scaring, expecially because I don't have an expert with me, I have to do it on myself.
Final thought: using tools, buying libraries... I think this is necessary to delegate to tools/libraries some tasks and focus only on what I really need to do. Anyway I am confused a little, scared too. May you please comment on what I wrote and give suggestions **that can help me**?
[1]: http://stackoverflow.com/questions/63957/what-is-the-best-set-of-tools-to-develop-win32-delphi-applications
[2]: http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672/ref=sr_1_1?ie=UTF8&qid=1287565494&sr=8-1
[3]: http://www.amazon.com/Object-Primer-Agile-Model-Driven-Development/dp/0521540186/ref=sr_1_1?ie=UTF8&qid=1287565662&sr=8-1
[4]: http://www.automatedqa.com/products/testcomplete/ | 0 |
1,961,162 | 12/25/2009 13:22:31 | 100,516 | 05/03/2009 22:15:07 | 782 | 72 | Spring Security basics | How to make a link visible only if an authenticated user has correspondent permissions?
I'm using JSF, and as I understand, I should use `rendered` attribute of a component which should call backing bean's boolean method.
I've even found correspondent code some time ago but now I can't find it again. So, can anyone give me an example of such boolean method? (or, even better, link to some article which describes this issue). | spring | spring-security | jsf | java | null | null | open | Spring Security basics
===
How to make a link visible only if an authenticated user has correspondent permissions?
I'm using JSF, and as I understand, I should use `rendered` attribute of a component which should call backing bean's boolean method.
I've even found correspondent code some time ago but now I can't find it again. So, can anyone give me an example of such boolean method? (or, even better, link to some article which describes this issue). | 0 |
9,870,661 | 03/26/2012 10:41:40 | 533,941 | 12/07/2010 16:30:07 | 1,385 | 52 | .replace(' ', '-') will only replace first whitespace | i am trying
To convert: `'any string separated with blankspaces'` into
'any-string-separated-with-blankspaces'
i am tying with `.replace(' ','-')` but it would only replace first... why? how can i replace all?
http://jsfiddle.net/7ycg3/
| javascript | replace | null | null | null | null | open | .replace(' ', '-') will only replace first whitespace
===
i am trying
To convert: `'any string separated with blankspaces'` into
'any-string-separated-with-blankspaces'
i am tying with `.replace(' ','-')` but it would only replace first... why? how can i replace all?
http://jsfiddle.net/7ycg3/
| 0 |
9,774,839 | 03/19/2012 17:24:13 | 1,278,129 | 03/19/2012 08:23:11 | 21 | 1 | sybase errorlog WARNING: memory usage in procedure headers does not match memory usage | I'm getting "WARNING: memory usage in procedure headers (1) does not match memory usage count in Pss (20) for server process id 1." in sybase log. I just rebuilt 11.0.3.3 on CentOS 5.8 I searched on internet found few posts of being harmless, just wanted to ask is it? Or maybe there is smth i can do to avoid it?
| sybase-ase | null | null | null | null | null | open | sybase errorlog WARNING: memory usage in procedure headers does not match memory usage
===
I'm getting "WARNING: memory usage in procedure headers (1) does not match memory usage count in Pss (20) for server process id 1." in sybase log. I just rebuilt 11.0.3.3 on CentOS 5.8 I searched on internet found few posts of being harmless, just wanted to ask is it? Or maybe there is smth i can do to avoid it?
| 0 |
5,166,485 | 03/02/2011 10:57:45 | 583,367 | 01/20/2011 17:40:43 | 1 | 1 | jquery: how to find the 2nd closest anscestor? | My DOM looks something like this:
<li>
<li><a class="editEntity>Edit</a></li>
<li><a class="deleteEntity>Delete</a></li>
</li>
When the used clicks on 'Edit', I want to change the outer `<li> to <li class="selected>.`
I tried something like this, but this is not working:
$('li a.editEntity').live('click', function() {
$(this).closest('li').closest('li').addClass('selected');
});
Any help is appreciated.
| jquery | null | null | null | null | null | open | jquery: how to find the 2nd closest anscestor?
===
My DOM looks something like this:
<li>
<li><a class="editEntity>Edit</a></li>
<li><a class="deleteEntity>Delete</a></li>
</li>
When the used clicks on 'Edit', I want to change the outer `<li> to <li class="selected>.`
I tried something like this, but this is not working:
$('li a.editEntity').live('click', function() {
$(this).closest('li').closest('li').addClass('selected');
});
Any help is appreciated.
| 0 |
7,231,464 | 08/29/2011 14:26:18 | 917,976 | 08/29/2011 14:14:03 | 1 | 0 | ASP.NET: Scroll bar dependent on full grid size | I'm trying to implement grid virtual scroll similar to [Telerik solution]. While I managed to handle server side, I still have no clue, how to create such scrollbar, dependent not on actual page size, but on whole page size. Do you know any JQuery plugin, JavaScript tutorial, that might be helpful?
Regards,
Adam
[Telerik solution]: http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpaging/defaultcs.aspx | javascript | jquery | asp.net | scrolling | scrollbar | 08/30/2011 07:51:07 | not constructive | ASP.NET: Scroll bar dependent on full grid size
===
I'm trying to implement grid virtual scroll similar to [Telerik solution]. While I managed to handle server side, I still have no clue, how to create such scrollbar, dependent not on actual page size, but on whole page size. Do you know any JQuery plugin, JavaScript tutorial, that might be helpful?
Regards,
Adam
[Telerik solution]: http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpaging/defaultcs.aspx | 4 |
7,540,981 | 09/24/2011 18:21:05 | 373,151 | 06/22/2010 12:24:31 | 1,579 | 64 | Cloudera's Flume vs Facebook's Scribe | Is there anyone who got a chance to work on both? I need to set up a framework to move data around. Basically, we have clickstream data coming in as text files. This data needs to be moved around form the app-servers to HDFS, and then to S3 after archival.
I need help in choosing between Flume and Scribe. Which one is better in terms of manageability, setting up and which is easier to customize? | flume | scribe-server | null | null | null | 09/25/2011 05:21:29 | not constructive | Cloudera's Flume vs Facebook's Scribe
===
Is there anyone who got a chance to work on both? I need to set up a framework to move data around. Basically, we have clickstream data coming in as text files. This data needs to be moved around form the app-servers to HDFS, and then to S3 after archival.
I need help in choosing between Flume and Scribe. Which one is better in terms of manageability, setting up and which is easier to customize? | 4 |
11,465,297 | 07/13/2012 06:33:13 | 1,312,489 | 04/04/2012 09:48:42 | 139 | 29 | Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: NSArrayM objectForKey | ![enter image description here][1]
[1]: http://i.stack.imgur.com/bHbvf.png
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0x12e654c0.
I am loading data on tableview from Array that has two dictionary objects. Dictionary object contains 2 nsstring object when ViewDidLoad called the code is below
while (sqlite3_step(statement) == SQLITE_ROW) {
NSString* delID = [NSString stringWithUTF8String:(const char *) sqlite3_column_text(statement, 0)];
NSString* name =[NSString stringWithUTF8String:(const char *) sqlite3_column_text(statement, 1)];
NSMutableDictionary *dict=[NSMutableDictionary dictionary];
[dict setObject:delID forKey:@"delID"];
[dict setObject:name forKey:@"name"];
if (i==0)
{
[self.arr addObject:dict];
}
It never crash for first row but on second row indexPath.row==1 it always crash please see the screen shot below. Thanks for help | objective-c | ios | null | null | null | null | open | Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: NSArrayM objectForKey
===
![enter image description here][1]
[1]: http://i.stack.imgur.com/bHbvf.png
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0x12e654c0.
I am loading data on tableview from Array that has two dictionary objects. Dictionary object contains 2 nsstring object when ViewDidLoad called the code is below
while (sqlite3_step(statement) == SQLITE_ROW) {
NSString* delID = [NSString stringWithUTF8String:(const char *) sqlite3_column_text(statement, 0)];
NSString* name =[NSString stringWithUTF8String:(const char *) sqlite3_column_text(statement, 1)];
NSMutableDictionary *dict=[NSMutableDictionary dictionary];
[dict setObject:delID forKey:@"delID"];
[dict setObject:name forKey:@"name"];
if (i==0)
{
[self.arr addObject:dict];
}
It never crash for first row but on second row indexPath.row==1 it always crash please see the screen shot below. Thanks for help | 0 |
11,202,081 | 06/26/2012 06:51:30 | 1,481,872 | 06/26/2012 06:44:43 | 1 | 0 | How do I use sprites on my computer to make a playable character in Java? | I am trying to make a game (I am a newbie at coding), and I have looked on goggle and on this website, but i can't really seem to find a proper answer. And any of the code i try and implement doesn't work.
I seem to be having trouble with importing javax.swing.JFrame and other such libraries on my mac where i do my coding.
I am using eclipse | java | sprites | null | null | null | 06/26/2012 12:28:42 | not a real question | How do I use sprites on my computer to make a playable character in Java?
===
I am trying to make a game (I am a newbie at coding), and I have looked on goggle and on this website, but i can't really seem to find a proper answer. And any of the code i try and implement doesn't work.
I seem to be having trouble with importing javax.swing.JFrame and other such libraries on my mac where i do my coding.
I am using eclipse | 1 |
8,922,619 | 01/19/2012 07:46:21 | 625,993 | 02/21/2011 04:33:57 | 3 | 0 | Well Apple Reject My Application Because of this code? | well apple reject my application if it is using this code ?
- (BOOL)isJailbroken {
BOOL jailbroken = NO;
NSString *cydiaPath = @"/Applications/Cydia.app";
NSString *aptPath = @"/private/var/lib/apt/";
if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) {
jailbroken = YES;
}
if ([[NSFileManager defaultManager] fileExistsAtPath:aptPath]) {
jailbroken = YES;
}
return jailbroken;
} | detection | jailbreak | null | null | null | 01/19/2012 23:00:09 | too localized | Well Apple Reject My Application Because of this code?
===
well apple reject my application if it is using this code ?
- (BOOL)isJailbroken {
BOOL jailbroken = NO;
NSString *cydiaPath = @"/Applications/Cydia.app";
NSString *aptPath = @"/private/var/lib/apt/";
if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) {
jailbroken = YES;
}
if ([[NSFileManager defaultManager] fileExistsAtPath:aptPath]) {
jailbroken = YES;
}
return jailbroken;
} | 3 |
9,137,039 | 02/03/2012 23:52:49 | 1,068,595 | 11/28/2011 02:35:06 | 57 | 1 | How can i use OAuth2 in my project? | I'm developing an app that use a WebServer and for accessing to this WebServer i must authenticate to it by using OAuth 2.0. the problem is i have never used OAuth 2.0 before so my my question is how can i use it? is there a nice tutorial that explain to me all the process? | iphone | cocoa-touch | ipad | oauth-2.0 | objective-c-2.0 | 02/05/2012 16:24:40 | not a real question | How can i use OAuth2 in my project?
===
I'm developing an app that use a WebServer and for accessing to this WebServer i must authenticate to it by using OAuth 2.0. the problem is i have never used OAuth 2.0 before so my my question is how can i use it? is there a nice tutorial that explain to me all the process? | 1 |
7,905,331 | 10/26/2011 15:53:27 | 629,407 | 02/23/2011 02:00:21 | 41 | 1 | NSMutableDictionary. Using an object to store an integer value | How would I go about adding instances of my custom class to a NSMutableDictionary with each instance added with a corresponding integer value? I later want to be able to retrieve the integer value using the class instance as the key. | objective-c | null | null | null | null | null | open | NSMutableDictionary. Using an object to store an integer value
===
How would I go about adding instances of my custom class to a NSMutableDictionary with each instance added with a corresponding integer value? I later want to be able to retrieve the integer value using the class instance as the key. | 0 |
3,052,891 | 06/16/2010 11:41:52 | 338,516 | 05/11/2010 16:46:25 | 10 | 0 | PERL XML::LibXML Parser Error | If I am using the XML::LibXML parser to repeatedly call a line like the following...
$tree = $parser->parse_file($WBCall);
...where $WBCall represents a HTTP string to a service that returns data in XML format, then occasionally I receive an error like the following: ":1: parser error : Start tag expected, '<' not found"
This occurs rarely when the code is pulling in hundreds of XML data files. Does this mean that I need to add in some XML validation? If so, what's the best PERL module for that? | xml | perl | null | null | null | null | open | PERL XML::LibXML Parser Error
===
If I am using the XML::LibXML parser to repeatedly call a line like the following...
$tree = $parser->parse_file($WBCall);
...where $WBCall represents a HTTP string to a service that returns data in XML format, then occasionally I receive an error like the following: ":1: parser error : Start tag expected, '<' not found"
This occurs rarely when the code is pulling in hundreds of XML data files. Does this mean that I need to add in some XML validation? If so, what's the best PERL module for that? | 0 |
5,102,238 | 02/24/2011 08:41:21 | 288,219 | 03/07/2010 13:44:18 | 114 | 7 | Any one knows about an issue with facebook live stream social plugin, and how to fix it? | I'm haveing a weird problem with facebook live stream plugin, I'm working with a XML file and it no matter what i do, when i try to add the plugin from the facebook developer site it doesn't work.
I found on the internet an Iframe version of the plugin and it is working but the code that facebook produce doesn't work.
THe problem with the Iframe version is that, In my system, every customer creates his own site and i need a unique chat for each site, The Iframe don't has XID attribute that let you and a unique one, but the Iframe doesn't support it.
The one that doesn't work:
<div id="fb-root"><xsl:comment/></div><script src="http://static.ak.connect.facebook.com/en_US/all.js#appId={AppID}&xfbml=1"></script><fb:live-stream width="200" height="300" always_post_to_friends="false"><xsl:comment/></fb:live-stream>
Code that Does work, but is not good for me:
<iframe src="http://www.facebook.com/plugins/live_stream_box.php?app_id={AppID}&width=315&height=388&via_url&always_post_to_friends=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:315px; height:388px;" allowTransparency="true"><xsl:comment/></iframe>
Both are rapped in a div(each one in it's turn, not together ofcourse):
<div id="facebook_plug" class="facebook_plug"><xsl:comment/>
...
</div>
If any one has an idea it will help me very much,
Tnx,
Erez
| xml | facebook | null | null | null | null | open | Any one knows about an issue with facebook live stream social plugin, and how to fix it?
===
I'm haveing a weird problem with facebook live stream plugin, I'm working with a XML file and it no matter what i do, when i try to add the plugin from the facebook developer site it doesn't work.
I found on the internet an Iframe version of the plugin and it is working but the code that facebook produce doesn't work.
THe problem with the Iframe version is that, In my system, every customer creates his own site and i need a unique chat for each site, The Iframe don't has XID attribute that let you and a unique one, but the Iframe doesn't support it.
The one that doesn't work:
<div id="fb-root"><xsl:comment/></div><script src="http://static.ak.connect.facebook.com/en_US/all.js#appId={AppID}&xfbml=1"></script><fb:live-stream width="200" height="300" always_post_to_friends="false"><xsl:comment/></fb:live-stream>
Code that Does work, but is not good for me:
<iframe src="http://www.facebook.com/plugins/live_stream_box.php?app_id={AppID}&width=315&height=388&via_url&always_post_to_friends=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:315px; height:388px;" allowTransparency="true"><xsl:comment/></iframe>
Both are rapped in a div(each one in it's turn, not together ofcourse):
<div id="facebook_plug" class="facebook_plug"><xsl:comment/>
...
</div>
If any one has an idea it will help me very much,
Tnx,
Erez
| 0 |
3,924,558 | 10/13/2010 14:07:16 | 432,599 | 08/27/2010 05:55:21 | 3 | 0 | oracle error, colum not allowed here | I haven't used Oracle for a while so I'm a bit rusty.
This is my table:
create table calendar(
username VARCHAR2(12),
content VARCHAR2(100),
dateContent DATE,
type CHAR(3) CHECK (type IN ('PUB', 'PRV')));
But when I try to insert a value like this:
insert into calendar(username, content, dateContent, type) values(chris, assignment due, to_date('01-OCT-2010 13:00','DD-MON-YYYY HH24:MI'), PUB);
I am getting: ORA-000984: column not allowed here, pointing to the type column at the end. I have a feeling I'm not getting something right with the DATE field as I've never really used it.
What have I done wrong? | oracle | null | null | null | null | null | open | oracle error, colum not allowed here
===
I haven't used Oracle for a while so I'm a bit rusty.
This is my table:
create table calendar(
username VARCHAR2(12),
content VARCHAR2(100),
dateContent DATE,
type CHAR(3) CHECK (type IN ('PUB', 'PRV')));
But when I try to insert a value like this:
insert into calendar(username, content, dateContent, type) values(chris, assignment due, to_date('01-OCT-2010 13:00','DD-MON-YYYY HH24:MI'), PUB);
I am getting: ORA-000984: column not allowed here, pointing to the type column at the end. I have a feeling I'm not getting something right with the DATE field as I've never really used it.
What have I done wrong? | 0 |
10,220,805 | 04/19/2012 02:21:31 | 1,342,839 | 04/19/2012 02:12:27 | 1 | 0 | Internship Project Details | A local portal solution (INTRANET) was developed using MS Sharepoint technology. OMT is a project assigned to the ICT task team in order to develop an OMT website that will contain data and information that can be uploaded by task team focal persons.
Tasks for the OMT website:
- Design and develop the website of the Operations Management Team(OMT)
- OMT website will be the repository of information from the different task teams of the OMT.
- Uploading of information will be done by focal person with access rights to the system.
Guys, how do I go about doing this? I have experience developping a system integrated with MySQL using XAMPP localhost. However that will not solve this purpose.
Ideas/Help will be much appreciate.. | php | website | xampp | localhost | intranet | 04/19/2012 11:13:47 | not a real question | Internship Project Details
===
A local portal solution (INTRANET) was developed using MS Sharepoint technology. OMT is a project assigned to the ICT task team in order to develop an OMT website that will contain data and information that can be uploaded by task team focal persons.
Tasks for the OMT website:
- Design and develop the website of the Operations Management Team(OMT)
- OMT website will be the repository of information from the different task teams of the OMT.
- Uploading of information will be done by focal person with access rights to the system.
Guys, how do I go about doing this? I have experience developping a system integrated with MySQL using XAMPP localhost. However that will not solve this purpose.
Ideas/Help will be much appreciate.. | 1 |
1,256,617 | 08/10/2009 19:02:04 | 116,838 | 06/03/2009 19:36:29 | 1,013 | 25 | Is there a good (free) benchmarking tool for Windows platform? | Is there a good performance tool for benchmarking like [Siege][1] for Windows?
[1]: http://www.joedog.org/index/siege-home | benchmarking | null | null | null | null | 05/15/2012 15:32:58 | not constructive | Is there a good (free) benchmarking tool for Windows platform?
===
Is there a good performance tool for benchmarking like [Siege][1] for Windows?
[1]: http://www.joedog.org/index/siege-home | 4 |
4,717,632 | 01/17/2011 20:36:38 | 87,968 | 04/07/2009 07:18:35 | 503 | 10 | Code compare tool for Linux | What is the best code compare tool available for Linux. I have been using Beyond Compare in Windows and am looking for something similar for Ubuntu with nautilus integration. | linux | ubuntu | software-tools | utilities | beyondcompare | 06/04/2012 02:00:32 | not constructive | Code compare tool for Linux
===
What is the best code compare tool available for Linux. I have been using Beyond Compare in Windows and am looking for something similar for Ubuntu with nautilus integration. | 4 |
3,769,931 | 09/22/2010 13:54:13 | 39,677 | 11/03/2008 21:48:03 | 6,424 | 4 | How to swap prototype for jquery in rails 3.0? | How to swap prototype for jquery in rails 3.0? | ruby-on-rails | null | null | null | null | null | open | How to swap prototype for jquery in rails 3.0?
===
How to swap prototype for jquery in rails 3.0? | 0 |
7,023,670 | 08/11/2011 09:32:39 | 885,775 | 08/09/2011 10:48:11 | 3 | 0 | how to add colours to my scripts text | I've connected to our apple mac server remotely. However, when I open my scripts the text is not unix coloured. Anyone has any idea how I can add the colour feature. I already have this in my .profile but this only colours the folder names, not the text in the scripts.
Mark | osx | unix | colors | null | null | 07/08/2012 01:31:06 | off topic | how to add colours to my scripts text
===
I've connected to our apple mac server remotely. However, when I open my scripts the text is not unix coloured. Anyone has any idea how I can add the colour feature. I already have this in my .profile but this only colours the folder names, not the text in the scripts.
Mark | 2 |
2,078,855 | 01/16/2010 20:45:15 | 122,536 | 06/13/2009 18:36:27 | 200 | 2 | About the forward and backward a word behaviour in Emacs | I don't know if there's something wrong with my settings but when I press M-f (forward a word)
it doesn't matter where I am, it never place the cursor in the next word (just between words). This doesn't happen with M-b which place my cursor in the beginning of the previous word.
Is this a normal behavior? How do I place my cursor at the beginning of the following word? | emacs | command | null | null | null | null | open | About the forward and backward a word behaviour in Emacs
===
I don't know if there's something wrong with my settings but when I press M-f (forward a word)
it doesn't matter where I am, it never place the cursor in the next word (just between words). This doesn't happen with M-b which place my cursor in the beginning of the previous word.
Is this a normal behavior? How do I place my cursor at the beginning of the following word? | 0 |
1,290,057 | 08/17/2009 19:54:10 | 120,727 | 06/10/2009 17:57:23 | 35 | 2 | GUI development with c# | I have a GUI that has a treeview on left side and a panel on the right side. The panel contains components like dropdown, radio buttons, textboxes,etc and I need to populate those according to the node selected on the tree.
Works fine till here. Howeer when I click on a button or any component on the panel, the node that was previously highlighted in the tree loses its focus. I mean that node does not remain highlighted any more. I want to keep that node highlighted when editing the components related to that node in the tree. How do I do that? Any help please?
Thanks. | gui | null | null | null | null | null | open | GUI development with c#
===
I have a GUI that has a treeview on left side and a panel on the right side. The panel contains components like dropdown, radio buttons, textboxes,etc and I need to populate those according to the node selected on the tree.
Works fine till here. Howeer when I click on a button or any component on the panel, the node that was previously highlighted in the tree loses its focus. I mean that node does not remain highlighted any more. I want to keep that node highlighted when editing the components related to that node in the tree. How do I do that? Any help please?
Thanks. | 0 |
10,536,397 | 05/10/2012 14:39:51 | 515,028 | 11/21/2010 10:52:18 | 81 | 3 | OpenCV: Writing a video from a cam, strange results (Python and Mac) | I am trying to grab frames from a webcam and then writing them in a video. It works and the video shows something but it is useless.
Here you can see an example of the videos I get:
![The kind of video I get] (http://i.imgur.com/mlG7m.png)
THe script is quite big so I will try to pick the relevant pieces for this problem:
import cv
capture = cv.CaptureFromCAM(1) # from webcam
frame = cv.QueryFrame(capture)
newvideo = 'Videos/%d_%d_%d_%d_%d_%d.avi' % (localtime()[0],localtime()[1],localtime()[2],localtime()[3],localtime()[4],localtime()[5])
video = cv.CreateVideoWriter(newvideo, cv.CV_FOURCC('D','I','V','X'), 30, cv.GetSize(frame), 1)
while(1):
frame = cv.QueryFrame(capture)
cv.WriteFrame(video, frame)
key = cv.WaitKey( int((1/30.)*1000)+1 )
| python | osx | opencv | null | null | null | open | OpenCV: Writing a video from a cam, strange results (Python and Mac)
===
I am trying to grab frames from a webcam and then writing them in a video. It works and the video shows something but it is useless.
Here you can see an example of the videos I get:
![The kind of video I get] (http://i.imgur.com/mlG7m.png)
THe script is quite big so I will try to pick the relevant pieces for this problem:
import cv
capture = cv.CaptureFromCAM(1) # from webcam
frame = cv.QueryFrame(capture)
newvideo = 'Videos/%d_%d_%d_%d_%d_%d.avi' % (localtime()[0],localtime()[1],localtime()[2],localtime()[3],localtime()[4],localtime()[5])
video = cv.CreateVideoWriter(newvideo, cv.CV_FOURCC('D','I','V','X'), 30, cv.GetSize(frame), 1)
while(1):
frame = cv.QueryFrame(capture)
cv.WriteFrame(video, frame)
key = cv.WaitKey( int((1/30.)*1000)+1 )
| 0 |
2,110,745 | 01/21/2010 16:11:37 | 196,082 | 10/25/2009 04:45:32 | 19 | 1 | Easy Flash question - use ems for width? | Can I use ems for the width tag when embedding a flash object?
I've done some googling and it looks like it's just pixels and percentages but I want to double check with the stack overflow community. | flash | null | null | null | null | null | open | Easy Flash question - use ems for width?
===
Can I use ems for the width tag when embedding a flash object?
I've done some googling and it looks like it's just pixels and percentages but I want to double check with the stack overflow community. | 0 |
7,569,156 | 09/27/2011 12:32:24 | 948,644 | 09/16/2011 10:49:20 | 31 | 0 | Microsoft Enterprises Library | I want to use Enterprises library in my new project. Is it better than Microsoft application blocks and from where i can learn more about this library.
Thanks in advance. | asp.net | null | null | null | null | 09/27/2011 13:17:29 | not a real question | Microsoft Enterprises Library
===
I want to use Enterprises library in my new project. Is it better than Microsoft application blocks and from where i can learn more about this library.
Thanks in advance. | 1 |
11,196,462 | 06/25/2012 20:00:12 | 1,461,166 | 06/16/2012 22:07:32 | 4 | 0 | How can I replace 40% characters from file ? C# | Today is a new day, today is a new project.
I have a text file with characters like this(eg.):
**Hi man. how is going. cool. lool. love this thing.
fo real. yep.no way.it's real.haha.**
Here are 10 characters of "." I just want to replace 40% of them (randomly) with " " (space).
I haven't tried any things out yet.
I was thinking like this. Find number of "." from entire text, get the 40% out of it. If it's float, make it int, doesn't matter, the file has like 50 lines, with like 300 characters on each line.
After I count that, how can I make it randomly to replace 4 characters of "." (in this case) with space ?
| c# | .net | null | null | null | 06/25/2012 20:15:43 | not constructive | How can I replace 40% characters from file ? C#
===
Today is a new day, today is a new project.
I have a text file with characters like this(eg.):
**Hi man. how is going. cool. lool. love this thing.
fo real. yep.no way.it's real.haha.**
Here are 10 characters of "." I just want to replace 40% of them (randomly) with " " (space).
I haven't tried any things out yet.
I was thinking like this. Find number of "." from entire text, get the 40% out of it. If it's float, make it int, doesn't matter, the file has like 50 lines, with like 300 characters on each line.
After I count that, how can I make it randomly to replace 4 characters of "." (in this case) with space ?
| 4 |
11,191,452 | 06/25/2012 14:39:34 | 8,047 | 09/15/2008 15:01:43 | 15,117 | 299 | Why is ARC using autorelease at all? | I am running this code with **no** autorelease pool in place under ARC:
- (NSString*) outName {
if (!outName) {
outName = [[NSString alloc] initWithFormat:@"whatever"]; // or stringWithFormat
}
return outName;
}
The debugger says that it's leaking the **single** `outName` instance each time with no pool in place.
This does not happen if I change the code to
- (NSString*) outName {
if (!outName) {
outName = @"whatever";
}
return outName;
}
Which I cannot do (this example is obviously simplified). Also, the leak message disappears if I create an autorelease pool in the calling code (which I would like to avoid).
Why is ARC insisting on autoreleasing this object, which is help in a `strong` property? And more importantly, how can I avoid this warning? | ios | arc | null | null | null | null | open | Why is ARC using autorelease at all?
===
I am running this code with **no** autorelease pool in place under ARC:
- (NSString*) outName {
if (!outName) {
outName = [[NSString alloc] initWithFormat:@"whatever"]; // or stringWithFormat
}
return outName;
}
The debugger says that it's leaking the **single** `outName` instance each time with no pool in place.
This does not happen if I change the code to
- (NSString*) outName {
if (!outName) {
outName = @"whatever";
}
return outName;
}
Which I cannot do (this example is obviously simplified). Also, the leak message disappears if I create an autorelease pool in the calling code (which I would like to avoid).
Why is ARC insisting on autoreleasing this object, which is help in a `strong` property? And more importantly, how can I avoid this warning? | 0 |
7,188,454 | 08/25/2011 10:00:55 | 238,517 | 12/25/2009 08:00:14 | 399 | 3 | Which branch of computer science focus on object oriented concepts in software? | Is there a branch of computer science that focuses on concepts of OO? There are many books about Object Oriented software development, but they are mostly adopting an engineering perspective.
In the context of a research paper, I'd like to be able to adopt the computer science point of view. In other words, most resources out there seem to be about the craft, not the science behind the craft.
Important books, papers which study OO at a more abstract level would be really useful. | oop | computer-science | academia | null | null | 11/10/2011 23:15:48 | not constructive | Which branch of computer science focus on object oriented concepts in software?
===
Is there a branch of computer science that focuses on concepts of OO? There are many books about Object Oriented software development, but they are mostly adopting an engineering perspective.
In the context of a research paper, I'd like to be able to adopt the computer science point of view. In other words, most resources out there seem to be about the craft, not the science behind the craft.
Important books, papers which study OO at a more abstract level would be really useful. | 4 |
8,393,491 | 12/05/2011 23:39:40 | 707,381 | 04/14/2011 06:23:33 | 1,542 | 11 | Why does the Buffer object have a capital B? | The only global object in Node that has a capitalised first letter is `Buffer`. It does not seem to be a constructor. Why the capital `B`? | node.js | null | null | null | null | null | open | Why does the Buffer object have a capital B?
===
The only global object in Node that has a capitalised first letter is `Buffer`. It does not seem to be a constructor. Why the capital `B`? | 0 |
11,387,151 | 07/08/2012 22:12:29 | 1,489,938 | 06/28/2012 23:05:52 | 21 | 0 | Number of elements less than a particular number in a sorted list? | Given a number x and a sorted list
I need to find the number of elements less than or equal x in O(logn)
where n is the size of array
I am implementing binary search to return the index but it returns wrong index for some cases
| c | null | null | null | null | 07/09/2012 00:34:58 | not a real question | Number of elements less than a particular number in a sorted list?
===
Given a number x and a sorted list
I need to find the number of elements less than or equal x in O(logn)
where n is the size of array
I am implementing binary search to return the index but it returns wrong index for some cases
| 1 |
10,187,070 | 04/17/2012 07:35:38 | 820,942 | 06/29/2011 11:15:03 | 58 | 2 | Iframe and absolute positioned elements | I have a small issue with absolute positioned elements inside of iframe.
So I have a page, on the page I have a iframe with small game. In the game is a guy and the guy has absolute positioned pupils. The pupils are moving by javascript.
Everything works just fine, but if I open that page, and go ahead and browse other pages in different tabs, After I come back the pupils are on other place than before (completely ut form eyes.)
There are more elements positioned absolutely in that iframe and none have the same problem I guess it is because of the Javascript animation. Did someone encouter similar problem? Im sorry but for many reasons I cannot post the page here.
I can post script for pupils animation:
function eyes_sides(){
$('.eyes').animate({
left:parseInt($('.eyes').css('left'))-9
},{duration:1500});
$('.eyes').animate({
left:parseInt($('.eyes').css('left'))
},{duration:1000});
}
function eyes_roll(){
$('.eyes').animate({
left:parseInt($('.eyes').css('left'))-7,
top:parseInt($('.eyes').css('top'))-18
},{duration:1800});
$('.eyes').animate({
left:parseInt($('.eyes').css('left')),
top:parseInt($('.eyes').css('top'))
},{duration:1300});
}
function animate_eyes(){
var animation = random_number(1,2);
//alert(animation);
switch(animation){
case 1:
eyes_roll();
break;
case 2:
eyes_sides();
break;
}
var delay = random_number(4000,12000);
window.animateEyes = setTimeout(function(){animate_eyes()},delay);
}
The script is not perfect, but does what requires.
I was thinking what could cause the problem, and maybe it is somehow connected to that animation runs when the tab is not active? Maybe adding "onBlur" and "onFocus" to stop / start animation would help?
Thanks for advice! | javascript | iframe | position | absolute | null | null | open | Iframe and absolute positioned elements
===
I have a small issue with absolute positioned elements inside of iframe.
So I have a page, on the page I have a iframe with small game. In the game is a guy and the guy has absolute positioned pupils. The pupils are moving by javascript.
Everything works just fine, but if I open that page, and go ahead and browse other pages in different tabs, After I come back the pupils are on other place than before (completely ut form eyes.)
There are more elements positioned absolutely in that iframe and none have the same problem I guess it is because of the Javascript animation. Did someone encouter similar problem? Im sorry but for many reasons I cannot post the page here.
I can post script for pupils animation:
function eyes_sides(){
$('.eyes').animate({
left:parseInt($('.eyes').css('left'))-9
},{duration:1500});
$('.eyes').animate({
left:parseInt($('.eyes').css('left'))
},{duration:1000});
}
function eyes_roll(){
$('.eyes').animate({
left:parseInt($('.eyes').css('left'))-7,
top:parseInt($('.eyes').css('top'))-18
},{duration:1800});
$('.eyes').animate({
left:parseInt($('.eyes').css('left')),
top:parseInt($('.eyes').css('top'))
},{duration:1300});
}
function animate_eyes(){
var animation = random_number(1,2);
//alert(animation);
switch(animation){
case 1:
eyes_roll();
break;
case 2:
eyes_sides();
break;
}
var delay = random_number(4000,12000);
window.animateEyes = setTimeout(function(){animate_eyes()},delay);
}
The script is not perfect, but does what requires.
I was thinking what could cause the problem, and maybe it is somehow connected to that animation runs when the tab is not active? Maybe adding "onBlur" and "onFocus" to stop / start animation would help?
Thanks for advice! | 0 |
6,782,721 | 07/21/2011 20:59:41 | 48,540 | 12/23/2008 02:15:08 | 74 | 8 | is it possible to create bi-directional link between two files in excel? | Is there a way to establish a bi-directional link between 2 files in excel?
i.e. File A has a sheet that pulls info from File B. If file B is updated, changes show in File A; but if File A updates the info it is pulling from file B, file B gets updated too.
Extra information:
A weekly report (let's pretend its a list of invoices to be paid) is run, John Doe analyzes it, adds comment to every line.
Document B contains the comments for all invoices we've done.
Upon running next week's report, it would be nice to pull the comments from document B, but if there is any change (e.g. an invoice has been paid and the comment needs to be changed) you can change the report and it will update document B.
I know this is not the most efficient way of accomplishing what I describe, and other tools would be better. Think of this as an exercise in excel mastery, and it's solution that has been bothering me for a while...
| excel | null | null | null | null | 07/18/2012 02:27:43 | off topic | is it possible to create bi-directional link between two files in excel?
===
Is there a way to establish a bi-directional link between 2 files in excel?
i.e. File A has a sheet that pulls info from File B. If file B is updated, changes show in File A; but if File A updates the info it is pulling from file B, file B gets updated too.
Extra information:
A weekly report (let's pretend its a list of invoices to be paid) is run, John Doe analyzes it, adds comment to every line.
Document B contains the comments for all invoices we've done.
Upon running next week's report, it would be nice to pull the comments from document B, but if there is any change (e.g. an invoice has been paid and the comment needs to be changed) you can change the report and it will update document B.
I know this is not the most efficient way of accomplishing what I describe, and other tools would be better. Think of this as an exercise in excel mastery, and it's solution that has been bothering me for a while...
| 2 |
8,492,968 | 12/13/2011 16:52:53 | 1,096,233 | 12/13/2011 16:49:33 | 1 | 0 | Data warehousing career | My wife currently works as an operations analyst, she has a masters in economics, but wants to get into BI/data warehousing. I'm looking for some advise to give her on how to start, what classes to take, and whether it is worth going back to school.
She knows SQL basics, but that's about it? Any advise on where to start or what classes or books to look at? | data-warehouse | null | null | null | null | 12/14/2011 05:11:04 | off topic | Data warehousing career
===
My wife currently works as an operations analyst, she has a masters in economics, but wants to get into BI/data warehousing. I'm looking for some advise to give her on how to start, what classes to take, and whether it is worth going back to school.
She knows SQL basics, but that's about it? Any advise on where to start or what classes or books to look at? | 2 |
7,060,348 | 08/14/2011 23:07:06 | 894,304 | 08/14/2011 23:07:06 | 1 | 0 | Pausing a download thread | I'm writing a very simple bulk download program in c# that reads a .txt file of URLs to download. I've set it up with a global Thread and delegate for updating the GUI, and the pressing of the "Begin" button creates and starts that thread. What I want to do is have a "Pause" button that enables me to pause the download until I hit the "Resume" button. How do I do this?
The relevant code:
private Thread thr;
private delegate void UpdateProgressCallback(int curFile);
private void Begin_btn_Click(object sender, EventArgs e)
{
thr = new Thread(Download);
thr.Start();
}
private void Pause_btn_Click(object sender, EventArgs e)
{
Pause_btn.Visible = false;
Resume_btn.Visible = true;
//{PAUSE THREAD thr}
}
private void Resume_btn_Click(object sender, Eventargs e)
{
Pause_btn.Visible = true;
Resume_btn.Visible = false;
//{RESUME THREAD thr}
}
public void Download()
{
//Download code goes here
}
Obviously, I am NOT using a Worker, and I really don't wish to unless you can show me how to get it to work (I don't really understand workers). Any help would be appreciated. | c# | multithreading | pause | null | null | null | open | Pausing a download thread
===
I'm writing a very simple bulk download program in c# that reads a .txt file of URLs to download. I've set it up with a global Thread and delegate for updating the GUI, and the pressing of the "Begin" button creates and starts that thread. What I want to do is have a "Pause" button that enables me to pause the download until I hit the "Resume" button. How do I do this?
The relevant code:
private Thread thr;
private delegate void UpdateProgressCallback(int curFile);
private void Begin_btn_Click(object sender, EventArgs e)
{
thr = new Thread(Download);
thr.Start();
}
private void Pause_btn_Click(object sender, EventArgs e)
{
Pause_btn.Visible = false;
Resume_btn.Visible = true;
//{PAUSE THREAD thr}
}
private void Resume_btn_Click(object sender, Eventargs e)
{
Pause_btn.Visible = true;
Resume_btn.Visible = false;
//{RESUME THREAD thr}
}
public void Download()
{
//Download code goes here
}
Obviously, I am NOT using a Worker, and I really don't wish to unless you can show me how to get it to work (I don't really understand workers). Any help would be appreciated. | 0 |
4,012,919 | 10/25/2010 08:30:06 | 414,771 | 08/09/2010 06:37:50 | 11 | 0 | How to avoid saying "gstring"? | I am picking up Groovy. The language is fine. But I have a non-technical problem. One of the classes is called GString. In some context, it can be misleading. And mentioning it is not very appropriate in the office, especially when some non-technical female colleagues are around.
I guess this is not enough to justify renaming the class in the language. So how should I avoid saying "GString" when I want to say GString? | groovy | gstring | null | null | null | 10/25/2010 09:07:53 | not a real question | How to avoid saying "gstring"?
===
I am picking up Groovy. The language is fine. But I have a non-technical problem. One of the classes is called GString. In some context, it can be misleading. And mentioning it is not very appropriate in the office, especially when some non-technical female colleagues are around.
I guess this is not enough to justify renaming the class in the language. So how should I avoid saying "GString" when I want to say GString? | 1 |
9,478,900 | 02/28/2012 08:52:56 | 1,053,150 | 11/18/2011 05:03:02 | 8 | 1 | cannot define a scope in a driver program from another class | I have this code and I cannot create a type of opcodetab class in the driver program.....
The file main driver is driver.cpp as follows...(and then follows the rest for reference).
int main() {
string filename;
cout << "Please enter filename:" << endl;
cin>>filename;
try {
file_parser parser(filename);
parser.read_file();
opcodetab theopcode;
string tmp = parser.get_token(3,1);
int q = theopcode->get_instruction_size("ADD");
cout<<q<<endl;
cout << "Token at 3,1 is: " << parser.get_token(3,1) << endl;
}
catch(opcode_error_exception excpt) {
cout << "**Sorry, error " << excpt.getMessage() << endl;
}
}
The file opcodetab.h
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <istream>
#include <iterator>
#include <cstring>
#include <sstream>
#include <fstream>
#include <map>
#include <utility>
#ifndef OPCODETAB_H
#define OPCODETAB_H
using namespace std;
class opcodetab {
public:
opcodetab();
string get_machine_code(string);
int get_instruction_size(string);
private:
struct vals{
string codes;
int bytes;
};
static map <string, vals> opc_vals;
map <string, string>::iterator it;
string toUpper(string);
string err (int s, string x, int y);
};
#endif
The file opcode.cc
#include "opcodetab.h"
#include "opcode_error_exception.h"
opcodetab::opcodetab(){
vals v;
v.codes="20"; v.bytes=4; opc_vals.insert(pair<string,vals>("+MUL",v));
....
}
string opcodetab::toUpper(string opc){
char a[opc.size()-1]=opc;
for (int i=0; i<opc.size(); i++){
char(toupper(a[i]));
}
string strop = a;
return strop;
}
string opcodetab::get_machine_code(string op){
string strop = toUpper(op);
it=opc_vals.find(strop);
if (it!=opc_vals.end()){
vals tmp = it->second;
return tmp.codes;
}
else{
string error=err(0," opcode not found : line ",0);
throw opcode_error_exception(error);
}
}
string opcodetab::err (int s, string x, int y){
stringstream excpt;
string out;
if (s==0) excpt<<": opcode error :"<<x<<y;
else if (s==1) excpt<<": opcode format error :"<<x<<y;
out=excpt.str();
return out;
}
int opcodetab::get_instruction_size(string op){
string strop = toUpper(op);
it=opc_vals.find(strop);
if (it!=opc_vals.end()){
vals tmp = it->second;
return tmp.bytes;
}
else{
string error=err(0," opcode not found : line ",0);
throw opcode_error_exception(error);
}
}
The Makefile
TORM = file_parser.o driver.o opcodetab.o driver
CC = g++
CCFLAGS = -g -O3 -Wall
driver: driver.o file_parser.o
${CC} ${CCFLAGS} -o driver driver.o file_parser.o
driver.o: driver.cpp
${CC} ${CCFLAGS} -c driver.cpp
opcodetab.o: opcodetab.cc opcodetab.h opcode_error_exception.h
${CC} ${CCFLAGS} -c opcodetab.cc
file_parser.o: file_parser.cc file_parser.h file_parse_exception.h
${CC} ${CCFLAGS} -c file_parser.cc
clean:
rm -f ${TORM}
anyway beyond that, I have been unable to create and execute without compile errors. Mainly (from what I can gather) the errors are in the driver. It seems that I cannot create an object of type opcodetab and reference the the internal methods correctly. I keep getting
> driver.cpp:18: undefined reference to `opcodetab::opcodetab()'
or
>driver.cpp:22: undefined reference to 'opcodetab::get_instruction_size(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
no matter what I do. I have used
opcodetab theopcode;
....
int q = theopcode.get_instruction_size("ADD");
&
int q = theopcode->get_instruction_size("ADD");
and also
opcodetab();
int q = opcodetab::get_instruction_size("ADD");
&
int q = opcodetab::get_instruction_size("ADD");
//(without the declaration of opcodetab();)
and....
opcodetab theopcode();
int q = opcodetab::get_instruction_size("ADD");
&
int q = opcodetab->get_instruction_size("ADD");
basically all the permutations of creating an object of a class in c++ that I can think of. If anyone has any idea at all how to create an object of opcodetab class so I can use the class methods inside it I would really appreciate it.
| c++ | class | scope | null | null | 02/28/2012 16:38:03 | too localized | cannot define a scope in a driver program from another class
===
I have this code and I cannot create a type of opcodetab class in the driver program.....
The file main driver is driver.cpp as follows...(and then follows the rest for reference).
int main() {
string filename;
cout << "Please enter filename:" << endl;
cin>>filename;
try {
file_parser parser(filename);
parser.read_file();
opcodetab theopcode;
string tmp = parser.get_token(3,1);
int q = theopcode->get_instruction_size("ADD");
cout<<q<<endl;
cout << "Token at 3,1 is: " << parser.get_token(3,1) << endl;
}
catch(opcode_error_exception excpt) {
cout << "**Sorry, error " << excpt.getMessage() << endl;
}
}
The file opcodetab.h
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <istream>
#include <iterator>
#include <cstring>
#include <sstream>
#include <fstream>
#include <map>
#include <utility>
#ifndef OPCODETAB_H
#define OPCODETAB_H
using namespace std;
class opcodetab {
public:
opcodetab();
string get_machine_code(string);
int get_instruction_size(string);
private:
struct vals{
string codes;
int bytes;
};
static map <string, vals> opc_vals;
map <string, string>::iterator it;
string toUpper(string);
string err (int s, string x, int y);
};
#endif
The file opcode.cc
#include "opcodetab.h"
#include "opcode_error_exception.h"
opcodetab::opcodetab(){
vals v;
v.codes="20"; v.bytes=4; opc_vals.insert(pair<string,vals>("+MUL",v));
....
}
string opcodetab::toUpper(string opc){
char a[opc.size()-1]=opc;
for (int i=0; i<opc.size(); i++){
char(toupper(a[i]));
}
string strop = a;
return strop;
}
string opcodetab::get_machine_code(string op){
string strop = toUpper(op);
it=opc_vals.find(strop);
if (it!=opc_vals.end()){
vals tmp = it->second;
return tmp.codes;
}
else{
string error=err(0," opcode not found : line ",0);
throw opcode_error_exception(error);
}
}
string opcodetab::err (int s, string x, int y){
stringstream excpt;
string out;
if (s==0) excpt<<": opcode error :"<<x<<y;
else if (s==1) excpt<<": opcode format error :"<<x<<y;
out=excpt.str();
return out;
}
int opcodetab::get_instruction_size(string op){
string strop = toUpper(op);
it=opc_vals.find(strop);
if (it!=opc_vals.end()){
vals tmp = it->second;
return tmp.bytes;
}
else{
string error=err(0," opcode not found : line ",0);
throw opcode_error_exception(error);
}
}
The Makefile
TORM = file_parser.o driver.o opcodetab.o driver
CC = g++
CCFLAGS = -g -O3 -Wall
driver: driver.o file_parser.o
${CC} ${CCFLAGS} -o driver driver.o file_parser.o
driver.o: driver.cpp
${CC} ${CCFLAGS} -c driver.cpp
opcodetab.o: opcodetab.cc opcodetab.h opcode_error_exception.h
${CC} ${CCFLAGS} -c opcodetab.cc
file_parser.o: file_parser.cc file_parser.h file_parse_exception.h
${CC} ${CCFLAGS} -c file_parser.cc
clean:
rm -f ${TORM}
anyway beyond that, I have been unable to create and execute without compile errors. Mainly (from what I can gather) the errors are in the driver. It seems that I cannot create an object of type opcodetab and reference the the internal methods correctly. I keep getting
> driver.cpp:18: undefined reference to `opcodetab::opcodetab()'
or
>driver.cpp:22: undefined reference to 'opcodetab::get_instruction_size(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
no matter what I do. I have used
opcodetab theopcode;
....
int q = theopcode.get_instruction_size("ADD");
&
int q = theopcode->get_instruction_size("ADD");
and also
opcodetab();
int q = opcodetab::get_instruction_size("ADD");
&
int q = opcodetab::get_instruction_size("ADD");
//(without the declaration of opcodetab();)
and....
opcodetab theopcode();
int q = opcodetab::get_instruction_size("ADD");
&
int q = opcodetab->get_instruction_size("ADD");
basically all the permutations of creating an object of a class in c++ that I can think of. If anyone has any idea at all how to create an object of opcodetab class so I can use the class methods inside it I would really appreciate it.
| 3 |
10,332,845 | 04/26/2012 11:53:18 | 1,090,620 | 12/09/2011 23:02:19 | 1 | 0 | CRUD Write specific application needs more than 7600 req/min for FREE Account | I have an application which does CRUD ( write specific ) operation very frequently on the app engine and at times it might exceed the Free limit of 7600 req/min. Is there any way to increase this limit?
P.S. I understand that paid account will boost it to 30000 req/min but it don't want to use that.
Is there anyway to use the concept of sparse files and send files instead of using 4KB pages. Because the response to the CRUD operation only takes certain bytes and all the other bytes are wasted.
Regards | google-app-engine | null | null | null | null | 04/29/2012 09:25:52 | off topic | CRUD Write specific application needs more than 7600 req/min for FREE Account
===
I have an application which does CRUD ( write specific ) operation very frequently on the app engine and at times it might exceed the Free limit of 7600 req/min. Is there any way to increase this limit?
P.S. I understand that paid account will boost it to 30000 req/min but it don't want to use that.
Is there anyway to use the concept of sparse files and send files instead of using 4KB pages. Because the response to the CRUD operation only takes certain bytes and all the other bytes are wasted.
Regards | 2 |
11,398,688 | 07/09/2012 15:51:48 | 1,510,463 | 07/08/2012 19:16:01 | 1 | 0 | merging DataFrames with pandas | I have multiple files containing dates and measured values. Their setup is identical:
YYYY MM DD val1
YYYY MM DD val2
YYYY MM DD val3
I use the following to read each of these files into a DataFrame
for cur_file in file_list:
cur_df = pa.io.parsers.read_table(os.path.join(data_path, result)
, header=None
, sep='\s*'
, parse_dates=[[0,1, 2]]
, names=['day','month', 'hour', cur_file[:-4]]
, index_col=[0]
)
The dates are not identical in all files. There is sometimes some overlap, but not always.
I could plot each of the cur_df individually via
cur_df.plot()
in the loop.
It seems like it would be a good idea to have all the cur_df in one "big" DataFrame. Both for plotting and also for statistics later on. How would this be done ideally, considering they have not the same dates? Is there a way to "merge" multiple DataFrames, but what is done at dates that occur only in one of the underlying DataFrames?
I guess I am looking for a data frame that looks like this:
YYYY MM DD val1(from1) NaN
YYYY MM DD val2(from1) val2(from2)
YYYY MM DD NaN val3(from2)
It would take the date stamp in the first line from the date of val1, in line two the dates of val1 and val2 are identical, and it would take the date in line 3 based on val2
I looked into
cur_df.add(cur_df2)
appends the two DataFrames. I am not sure what
cur_df.combine(cur_df2, ...)
would do, especially since I am not sure what function should be used as second argument.
Thanks for your help,
Cheers,
Claus
| io | pandas | null | null | null | null | open | merging DataFrames with pandas
===
I have multiple files containing dates and measured values. Their setup is identical:
YYYY MM DD val1
YYYY MM DD val2
YYYY MM DD val3
I use the following to read each of these files into a DataFrame
for cur_file in file_list:
cur_df = pa.io.parsers.read_table(os.path.join(data_path, result)
, header=None
, sep='\s*'
, parse_dates=[[0,1, 2]]
, names=['day','month', 'hour', cur_file[:-4]]
, index_col=[0]
)
The dates are not identical in all files. There is sometimes some overlap, but not always.
I could plot each of the cur_df individually via
cur_df.plot()
in the loop.
It seems like it would be a good idea to have all the cur_df in one "big" DataFrame. Both for plotting and also for statistics later on. How would this be done ideally, considering they have not the same dates? Is there a way to "merge" multiple DataFrames, but what is done at dates that occur only in one of the underlying DataFrames?
I guess I am looking for a data frame that looks like this:
YYYY MM DD val1(from1) NaN
YYYY MM DD val2(from1) val2(from2)
YYYY MM DD NaN val3(from2)
It would take the date stamp in the first line from the date of val1, in line two the dates of val1 and val2 are identical, and it would take the date in line 3 based on val2
I looked into
cur_df.add(cur_df2)
appends the two DataFrames. I am not sure what
cur_df.combine(cur_df2, ...)
would do, especially since I am not sure what function should be used as second argument.
Thanks for your help,
Cheers,
Claus
| 0 |
6,517,716 | 06/29/2011 08:28:30 | 187,570 | 10/10/2009 06:34:52 | 798 | 43 | How to do Image over like effect if google image search using jquery. | How to do Image over like effect if google image search using jquery.
In google image search result when user mouse over it display the image information div
how to achieve using jquery | jquery | null | null | null | null | 06/29/2011 16:37:34 | not a real question | How to do Image over like effect if google image search using jquery.
===
How to do Image over like effect if google image search using jquery.
In google image search result when user mouse over it display the image information div
how to achieve using jquery | 1 |
7,828,431 | 10/19/2011 21:31:37 | 892,076 | 08/12/2011 15:39:55 | 22 | 0 | Create a scalable table with a cell with overflow:auto | I have a table displaying tabular data in a scalable layout. The table itself has a width:100%.
In one of the columns, user data on rare occasion will include long strings that stretch the table outside of its container.
My solution was to put the contents of that cell inside a div, and give the div a max-width:320px and an overflow:auto. This work in IE9 and FF7, the two browsers I'm concerned about.
<table style="width:100%;">
<tr>
<td>
<div style="max-width:320px; overflow:auto;">
ReallyLongUnbrokenStringOfCharactersThatStretchesTheTableBeyondItsContainerReallyLongUnbrokenStringOfCharactersThatStretchesTheTableBeyondItsContainerReallyLongUnbrokenStringOfCharactersThatStretchesTheTableBeyondItsContainer
</div>
</td>
</tr>
</table>
However, my preference is not to limit the column's contents to a max-width of 320px. I'd rather that the div stretches as needed with the table, and only overflows when the table no longer fits the screen. Is this possible? | html | css | table | div | overflow | null | open | Create a scalable table with a cell with overflow:auto
===
I have a table displaying tabular data in a scalable layout. The table itself has a width:100%.
In one of the columns, user data on rare occasion will include long strings that stretch the table outside of its container.
My solution was to put the contents of that cell inside a div, and give the div a max-width:320px and an overflow:auto. This work in IE9 and FF7, the two browsers I'm concerned about.
<table style="width:100%;">
<tr>
<td>
<div style="max-width:320px; overflow:auto;">
ReallyLongUnbrokenStringOfCharactersThatStretchesTheTableBeyondItsContainerReallyLongUnbrokenStringOfCharactersThatStretchesTheTableBeyondItsContainerReallyLongUnbrokenStringOfCharactersThatStretchesTheTableBeyondItsContainer
</div>
</td>
</tr>
</table>
However, my preference is not to limit the column's contents to a max-width of 320px. I'd rather that the div stretches as needed with the table, and only overflows when the table no longer fits the screen. Is this possible? | 0 |
5,382,400 | 03/21/2011 19:08:23 | 481,635 | 10/20/2010 11:49:11 | 66 | 2 | Outsourcing CSS design: Things to keep in mind while writing HTML | I like building stuff, and currently I'm getting into building websites using ASP.NET. I (think I) know how to code, and how to make that code look elegant. What I (know I) don't know is how to make things look pretty... for the users.
I was just introduced to <a href="http://www.csszengarden.com/">css Zen garden</a>, and _oh my gawd_ does that look pretty. It looks pretty in (at time of writing) 210 ways, and all thanks to a clean separation of content and layout/graphical-design (Content being the HTML, and layout/graphical-design being the CSS of course). Go ahead, take a look :-)
I'm planning to ask a CSS guru to create a stylesheet for my website, but I want to make things as easy as possible for him. (And any future CSS guru's I might approach in the future). I don't know any CSS experts, that's why I'm asking here ;-)
For example I've noticed in HTML of the css Zen garden that most <div> and <p> tags have an "id" or "class" attribute to help the CSS creators.
So what I'd like to have is some kind of list with best practises for writing HTML, so that it is made very easy to (let someone) create a stylesheet for that HTML. Examples are always welcome! | html | css | website | null | null | 03/24/2011 02:23:43 | off topic | Outsourcing CSS design: Things to keep in mind while writing HTML
===
I like building stuff, and currently I'm getting into building websites using ASP.NET. I (think I) know how to code, and how to make that code look elegant. What I (know I) don't know is how to make things look pretty... for the users.
I was just introduced to <a href="http://www.csszengarden.com/">css Zen garden</a>, and _oh my gawd_ does that look pretty. It looks pretty in (at time of writing) 210 ways, and all thanks to a clean separation of content and layout/graphical-design (Content being the HTML, and layout/graphical-design being the CSS of course). Go ahead, take a look :-)
I'm planning to ask a CSS guru to create a stylesheet for my website, but I want to make things as easy as possible for him. (And any future CSS guru's I might approach in the future). I don't know any CSS experts, that's why I'm asking here ;-)
For example I've noticed in HTML of the css Zen garden that most <div> and <p> tags have an "id" or "class" attribute to help the CSS creators.
So what I'd like to have is some kind of list with best practises for writing HTML, so that it is made very easy to (let someone) create a stylesheet for that HTML. Examples are always welcome! | 2 |
7,094,485 | 08/17/2011 14:26:03 | 876,047 | 08/03/2011 07:06:25 | 19 | 2 | Nested listviews | How can i nest listviews?
Code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView
android:id="@+id/places_listView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText android:id="@+id/places_search_box"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:imeOptions="actionSearch"
android:singleLine="true"
android:hint="Search"/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ListView
android:id="@+id/places_listViewPlaces"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ListView>
</LinearLayout>
</ListView>
</LinearLayout>
Where is here the error?
Thanks for help | android | listview | nested | null | null | null | open | Nested listviews
===
How can i nest listviews?
Code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView
android:id="@+id/places_listView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText android:id="@+id/places_search_box"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:imeOptions="actionSearch"
android:singleLine="true"
android:hint="Search"/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ListView
android:id="@+id/places_listViewPlaces"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ListView>
</LinearLayout>
</ListView>
</LinearLayout>
Where is here the error?
Thanks for help | 0 |
10,997,599 | 06/12/2012 13:21:52 | 487,291 | 10/26/2010 07:16:51 | 175 | 9 | Filter, page and sort data with client script or webservice | I would like to build a custom solution that would filter, page and sort small amount of data aprox 10,000 rows. I would also like to consider different client side techniques in order to achieve this. Right now I am using the following solution:
1) Minimum number of columns are retreived from SQL, only key columns and columns needed for sorting data
2) Data is stored in javascript array
3) Paging is performed by passing listo of ID's into querystring of an iframe src so only specified items are displayed and bounded with all the additional information inside iframe
I am not looking for a solution, but I would like to discuss possible alternatives using jquery, webservices in order to achieve quick and clean filtering, paging and sorting.
All ideas are welcomed! | jquery | web-services | sorting | filtering | paging | 06/12/2012 13:59:31 | not constructive | Filter, page and sort data with client script or webservice
===
I would like to build a custom solution that would filter, page and sort small amount of data aprox 10,000 rows. I would also like to consider different client side techniques in order to achieve this. Right now I am using the following solution:
1) Minimum number of columns are retreived from SQL, only key columns and columns needed for sorting data
2) Data is stored in javascript array
3) Paging is performed by passing listo of ID's into querystring of an iframe src so only specified items are displayed and bounded with all the additional information inside iframe
I am not looking for a solution, but I would like to discuss possible alternatives using jquery, webservices in order to achieve quick and clean filtering, paging and sorting.
All ideas are welcomed! | 4 |
567,469 | 02/19/2009 22:13:27 | 91,385 | 11/21/2008 18:56:57 | 315 | 2 | Why can't my onclick handler find its parent node? | Why does the onclick handler below trigger an "elem.parentNode is not a function" error?
<html>
<head>
<script type="text/javascript">
function getParent(elem) {
var parent = elem.parentNode();
}
</script>
</head>
<body>
<div style="border: solid black 2px">
<span onclick="getParent(this)">hello</span>
</div>
</body>
</html> | html | javascript | null | null | null | null | open | Why can't my onclick handler find its parent node?
===
Why does the onclick handler below trigger an "elem.parentNode is not a function" error?
<html>
<head>
<script type="text/javascript">
function getParent(elem) {
var parent = elem.parentNode();
}
</script>
</head>
<body>
<div style="border: solid black 2px">
<span onclick="getParent(this)">hello</span>
</div>
</body>
</html> | 0 |
7,594,881 | 09/29/2011 09:01:21 | 324,041 | 04/23/2010 09:43:29 | 58 | 2 | InstallShield 2011 error 7185 importing Japanese strings in the string table o fbasic MSI project | I am trying to import Japanese strings inside my "Basic MSI" project, it use to work before without any issues but now when I try to import some Japanese strings from a text file then it throws following error (I have changed some of the personal data from the error message.)
ISDEV : error -7185: The Japanese: 日本語 translation for string identifier IDS_XXXX_1111 includes characters that are not available on code page 932.
I think there are some of the characters inside the IDS_XXXX_1111 are not part of code page 932. How to detect those characters using some tool?
Also documentation mentions about changing some encoding settings to UTF-8 in InstallShield 2011, if you are aware then please guide me.
Thanks in advance
Rahul
| utf-8 | localization | msi | installshield | japanese | null | open | InstallShield 2011 error 7185 importing Japanese strings in the string table o fbasic MSI project
===
I am trying to import Japanese strings inside my "Basic MSI" project, it use to work before without any issues but now when I try to import some Japanese strings from a text file then it throws following error (I have changed some of the personal data from the error message.)
ISDEV : error -7185: The Japanese: 日本語 translation for string identifier IDS_XXXX_1111 includes characters that are not available on code page 932.
I think there are some of the characters inside the IDS_XXXX_1111 are not part of code page 932. How to detect those characters using some tool?
Also documentation mentions about changing some encoding settings to UTF-8 in InstallShield 2011, if you are aware then please guide me.
Thanks in advance
Rahul
| 0 |
5,972,686 | 05/12/2011 02:24:11 | 583,712 | 01/20/2011 22:43:21 | 11 | 2 | Help me remove mysql_insert_id | Got three tables (blogs, tags, and blogtags) all AI and ID set to primary key. I'm making a tagging system to keep track of my sites (localhost). The code below is sort of working, but mysql_insert_id just doesn't seem reliable enough since I get some duplicate rows and the occasional 0 value in it.
/// inserts the blog into blog table.
$insert = mysql_query("INSERT INTO blogs (id, url, user, pass, dname, islocal, cat2post) VALUES ('', '$blog', '$bloguser', '$blogpassword', '','NO','$_POST[cat2blog]')")or die( 'Error: ' . mysql_error());
$taggit1 = mysql_insert_id();
$page->content .= "<p class=\"alert\">Success - External blog Added!</p>";
/// let's see what tags we have and explode them.
//$tags = $_POST['tags'] which is an array of words seperated by comma
$tags = 'fishing';
$pieces = explode(",", $tags);
/// go through the tags and add to tags table if needed.
foreach ($pieces as $l){
$l = trim($l);
$query = "SELECT id FROM tags WHERE tag = '$l'";
$result = mysql_query($query) or die( "Error: " . mysql_error() . " in query $query");
$row = mysql_fetch_array($result);
$taggit2 = $row[0];
if ($taggit2 == '') {
$insert2 = mysql_query("INSERT INTO tags (id, tag) VALUES ('','$l')")or die( 'Error: ' . mysql_error());
$taggit2 = mysql_insert_id();
$page->content .= "<p class=\"alert\">This tag didn't exist - so I inserted a new tag</p>";
}
/// for each tag we have, let's insert the blogstags table so we can reference which blog goes to which tag. Blogstags_id should map to the id of the blog.
$insert3 = mysql_query("INSERT INTO blogstags (id, tag_id, blogstags_id) VALUES ('','$taggit2','$taggit1')")or die( 'Error: ' . mysql_error());
}
Guess I need a different solution than mysql_insert_id - ideas? Suggestions? | php | null | null | null | null | null | open | Help me remove mysql_insert_id
===
Got three tables (blogs, tags, and blogtags) all AI and ID set to primary key. I'm making a tagging system to keep track of my sites (localhost). The code below is sort of working, but mysql_insert_id just doesn't seem reliable enough since I get some duplicate rows and the occasional 0 value in it.
/// inserts the blog into blog table.
$insert = mysql_query("INSERT INTO blogs (id, url, user, pass, dname, islocal, cat2post) VALUES ('', '$blog', '$bloguser', '$blogpassword', '','NO','$_POST[cat2blog]')")or die( 'Error: ' . mysql_error());
$taggit1 = mysql_insert_id();
$page->content .= "<p class=\"alert\">Success - External blog Added!</p>";
/// let's see what tags we have and explode them.
//$tags = $_POST['tags'] which is an array of words seperated by comma
$tags = 'fishing';
$pieces = explode(",", $tags);
/// go through the tags and add to tags table if needed.
foreach ($pieces as $l){
$l = trim($l);
$query = "SELECT id FROM tags WHERE tag = '$l'";
$result = mysql_query($query) or die( "Error: " . mysql_error() . " in query $query");
$row = mysql_fetch_array($result);
$taggit2 = $row[0];
if ($taggit2 == '') {
$insert2 = mysql_query("INSERT INTO tags (id, tag) VALUES ('','$l')")or die( 'Error: ' . mysql_error());
$taggit2 = mysql_insert_id();
$page->content .= "<p class=\"alert\">This tag didn't exist - so I inserted a new tag</p>";
}
/// for each tag we have, let's insert the blogstags table so we can reference which blog goes to which tag. Blogstags_id should map to the id of the blog.
$insert3 = mysql_query("INSERT INTO blogstags (id, tag_id, blogstags_id) VALUES ('','$taggit2','$taggit1')")or die( 'Error: ' . mysql_error());
}
Guess I need a different solution than mysql_insert_id - ideas? Suggestions? | 0 |
9,652,598 | 03/11/2012 04:59:08 | 1,028,892 | 11/04/2011 01:28:41 | 34 | 0 | Which Python reference book do you recommend? | I am trying to buy a Python reference book and I have found two that many people have recommended online:
Python in a Nutshell
http://www.amazon.com/Python-Nutshell-Second-Alex-Martelli/dp/0596100469/ref=pd_sim_b_3
Python Essential Reference
http://www.amazon.com/Python-Essential-Reference-4th-Edition/dp/0672329786/ref=sr_1_1?s=books&ie=UTF8&qid=1331441898&sr=1-1
| python | null | null | null | null | 03/11/2012 13:46:05 | not constructive | Which Python reference book do you recommend?
===
I am trying to buy a Python reference book and I have found two that many people have recommended online:
Python in a Nutshell
http://www.amazon.com/Python-Nutshell-Second-Alex-Martelli/dp/0596100469/ref=pd_sim_b_3
Python Essential Reference
http://www.amazon.com/Python-Essential-Reference-4th-Edition/dp/0672329786/ref=sr_1_1?s=books&ie=UTF8&qid=1331441898&sr=1-1
| 4 |
4,013,348 | 10/25/2010 09:38:35 | 125,571 | 06/19/2009 06:30:56 | 56 | 2 | Creating a custom capture window in Cocoa | I am trying to make a custom transparent bordered window(without tittle bar) to capture a part of the screen.This window should be resizeable from the bottom right corner area,and could be moved by dragging any of the border lines.This window should be such that, it could also be moved over the apple menu.
I am very new to Cocoa, Can you please suggest me some guide or tutorial to understand creating custom windows and the event handling in custom window.
I have seen the example given in the link below and it was pretty helpful,but I am not able to understand the whole code.
http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html
Please give me pointers to how to make such a window or what all to refer to have sufficient knowledge to be able to do it.
Thanks :) | objective-c | cocoa | gui | null | null | null | open | Creating a custom capture window in Cocoa
===
I am trying to make a custom transparent bordered window(without tittle bar) to capture a part of the screen.This window should be resizeable from the bottom right corner area,and could be moved by dragging any of the border lines.This window should be such that, it could also be moved over the apple menu.
I am very new to Cocoa, Can you please suggest me some guide or tutorial to understand creating custom windows and the event handling in custom window.
I have seen the example given in the link below and it was pretty helpful,but I am not able to understand the whole code.
http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html
Please give me pointers to how to make such a window or what all to refer to have sufficient knowledge to be able to do it.
Thanks :) | 0 |
582,803 | 02/24/2009 17:55:35 | 142 | 08/02/2008 12:41:43 | 689 | 30 | Sending RTP using Java | What would be the best way to send/receive audio data over RTP using Java? I have read a little about [JMF][1], but it seems to be out of date. Are there are other viable alternatives.
[1]: http://en.wikipedia.org/wiki/Java_Media_Framework | java | rtp | null | null | null | null | open | Sending RTP using Java
===
What would be the best way to send/receive audio data over RTP using Java? I have read a little about [JMF][1], but it seems to be out of date. Are there are other viable alternatives.
[1]: http://en.wikipedia.org/wiki/Java_Media_Framework | 0 |
6,955,886 | 08/05/2011 11:59:06 | 880,513 | 08/05/2011 11:59:06 | 1 | 0 | Cut a picture with Javascript or CSS? | I have pictures of constant width (i.e. `100px`) but with variable height (could be `200px`, `130px`, ... but height is always `>= 100px`).
I'm looking for CSS or Javacript code, that can cut the bottom of the picture so that all
my pictures will be of size 100x100.
Can this be done, or should I go using some PHP (or other server side language) library?
Thanks in advance! | php | javascript | css | image | cut | null | open | Cut a picture with Javascript or CSS?
===
I have pictures of constant width (i.e. `100px`) but with variable height (could be `200px`, `130px`, ... but height is always `>= 100px`).
I'm looking for CSS or Javacript code, that can cut the bottom of the picture so that all
my pictures will be of size 100x100.
Can this be done, or should I go using some PHP (or other server side language) library?
Thanks in advance! | 0 |
6,956,246 | 08/05/2011 12:27:26 | 278,669 | 02/22/2010 12:34:03 | 64 | 7 | strange behaviour of mysql | i have partitioned table by field daynumber. during the day i write into table logs, and then calculate some stat. table is big, each day i have ~ 3M new rows. field myField is indexed;
query:
SELECT COUNT(DISTINCT myField) FROM mytable WHERE daynumber=somevalue;
returns 0, which is mistake
and query:
SELECT COUNT(*) FROM (SELECT DISTINCT(myField) FROM mytable WHERE daynumber=somevalue) t;
returns true value;
for some daynumber values, first query works fine.
i tried to repeir that partition, but had no effect
any suggestions? | mysql | null | null | null | null | null | open | strange behaviour of mysql
===
i have partitioned table by field daynumber. during the day i write into table logs, and then calculate some stat. table is big, each day i have ~ 3M new rows. field myField is indexed;
query:
SELECT COUNT(DISTINCT myField) FROM mytable WHERE daynumber=somevalue;
returns 0, which is mistake
and query:
SELECT COUNT(*) FROM (SELECT DISTINCT(myField) FROM mytable WHERE daynumber=somevalue) t;
returns true value;
for some daynumber values, first query works fine.
i tried to repeir that partition, but had no effect
any suggestions? | 0 |
1,935,246 | 12/20/2009 08:29:07 | 221,153 | 11/30/2009 06:54:21 | 76 | 7 | Image editing using iphone. | I'm creating an image editing application for iphone. i would like to enable the user to pick an image from the photolibrary, edit it (grayscale, sepia,etc) and if possible, save back to the filesystem. I've done it for picking image (the simplest thing, as you know using imagepicker) and also for creating the grayscale image. But, i got stuck with sepia. I don't know how to implement that. Is it possible to get the values of each pixel of the image so that we can vary it to get the desired effects. Or any other possible methods are there??? pls help... | iphone | image-processing | null | null | null | null | open | Image editing using iphone.
===
I'm creating an image editing application for iphone. i would like to enable the user to pick an image from the photolibrary, edit it (grayscale, sepia,etc) and if possible, save back to the filesystem. I've done it for picking image (the simplest thing, as you know using imagepicker) and also for creating the grayscale image. But, i got stuck with sepia. I don't know how to implement that. Is it possible to get the values of each pixel of the image so that we can vary it to get the desired effects. Or any other possible methods are there??? pls help... | 0 |
11,385,696 | 07/08/2012 18:46:02 | 1,510,419 | 07/08/2012 18:38:17 | 1 | 0 | CMD.EXE on windows 7 Ultimate | How Can I Make My Command Prompts Background
Transparent i Have used Econsole B4 But i Didnt Like it
cause it Messes up the Background A lot
Any Ideas?
| windows-7 | cmd | transparent | null | null | 07/09/2012 10:46:45 | off topic | CMD.EXE on windows 7 Ultimate
===
How Can I Make My Command Prompts Background
Transparent i Have used Econsole B4 But i Didnt Like it
cause it Messes up the Background A lot
Any Ideas?
| 2 |
3,473,533 | 08/13/2010 02:47:49 | 419,117 | 08/13/2010 02:33:12 | 1 | 0 | What is the best open source for .NET controls? | Do anyone know the best opensource for .NET controls?
With Dev Express, Telerik, they so cool, but they are commercial version.
Thanks,
Tien | c# | .net | asp.net | null | null | 09/16/2011 20:46:25 | not constructive | What is the best open source for .NET controls?
===
Do anyone know the best opensource for .NET controls?
With Dev Express, Telerik, they so cool, but they are commercial version.
Thanks,
Tien | 4 |
3,008,270 | 06/09/2010 17:30:42 | 346,963 | 05/01/2009 10:09:02 | 120 | 16 | Deceleration for object for which creation is wrapped in Macro | The following macro is defined in ourcode:
#define MSGMacro(obj, arg) MyPaymentClass obj(arg)
Where MSGMacro is used to creates the object of type MyPaymentClass using code like
MSGMacro(Card, 1);
MSGMacro(Cash, 2);
----
---- //removed unwanted things to keep question cleaner.
All the above code is in one cpp file, Now the problem is how we can expose these two objects of MyPaymentClass to other units in my project?
i.e. i want to use Card and Cash in other CPP files. Please suggest how i can give the decleration for the same in some header file? | c++ | macros | header | declaration | null | null | open | Deceleration for object for which creation is wrapped in Macro
===
The following macro is defined in ourcode:
#define MSGMacro(obj, arg) MyPaymentClass obj(arg)
Where MSGMacro is used to creates the object of type MyPaymentClass using code like
MSGMacro(Card, 1);
MSGMacro(Cash, 2);
----
---- //removed unwanted things to keep question cleaner.
All the above code is in one cpp file, Now the problem is how we can expose these two objects of MyPaymentClass to other units in my project?
i.e. i want to use Card and Cash in other CPP files. Please suggest how i can give the decleration for the same in some header file? | 0 |
10,489,223 | 05/07/2012 21:13:34 | 1,359,914 | 04/26/2012 23:17:32 | 10 | 0 | "header" function can not work | My php runs correctly through localhost but when i post it into my domain it dose not work!
It have two component and that contain tow "controller" file. and i use the "controller" file using variables.
like:
include "components/{$com}/controller.php";
but when it works through real domain project can not find individual "controller" file.
I also use "header" function in many user defined function.
like:
header ('location: ' . baseurl . '?com=user&task=wall');
I can not understand what is the wrong and what can I do for it. | php | mysql | html | mvc | null | 05/07/2012 21:18:54 | not a real question | "header" function can not work
===
My php runs correctly through localhost but when i post it into my domain it dose not work!
It have two component and that contain tow "controller" file. and i use the "controller" file using variables.
like:
include "components/{$com}/controller.php";
but when it works through real domain project can not find individual "controller" file.
I also use "header" function in many user defined function.
like:
header ('location: ' . baseurl . '?com=user&task=wall');
I can not understand what is the wrong and what can I do for it. | 1 |
9,734,051 | 03/16/2012 08:31:44 | 1,273,541 | 03/16/2012 08:26:19 | 1 | 0 | Why do I keep getting the "must be caught or declared to be thrown" error? | Here is my code
import java.io.*;
import java.util.*;
import java.util.Scanner;
import java.io.PrintWriter;
public class EncryptionDecryption {
public static void main(String[] args) throws java.io.IOException{
int z = getRandom();
boolean luck = true;
while(luck == true){
String codeString = getString();
System.out.println(codeString);
char[] enCharArray = encrypt(codeString, z);
String encryptedString = new String(enCharArray);
System.out.println(encryptedString);
char[] deCharArray = decrypt(encryptedString, z);
String decryptedString = new String(deCharArray);
System.out.println(decryptedString);
putString(encryptedString);
if(codeString.length() == 0)
luck = false;
}
}
static String getString(){
Scanner input = new Scanner(new File(" "));
String codeString = input.next();
return codeString;
}
static void putString (String finalString){
PrintWriter work = new PrintWriter("EncryptedDocument.txt");
work.print(finalString + " ");
work.close();
}
static char[] encrypt(String encryptString, int z){
char[] codeChar = encryptString.toCharArray();
char[] enCharArray;
enCharArray = new char[codeChar.length];
for(int i = 0; i < codeChar.length; i++){
int x = codeChar[i];
int enInt = encryptChar(x, z);
char enChar = (char)enInt;
enCharArray[i] = enChar;
if(x == 32){
enInt = 32;
enChar = (char)enInt;
enCharArray[i] = enChar;
}
}
return enCharArray;
}
static char[] decrypt(String decryptString, int z){
char[] deCodeChar = decryptString.toCharArray();
char[] deCharArray;
deCharArray = new char[deCodeChar.length];
for(int i = 0; i < deCodeChar.length; i++){
int x = deCodeChar[i];
int deInt = decryptChar(x, z);
char deChar = (char)deInt;
deCharArray[i] = deChar;
if(x == 32){
deInt = 32;
deChar = (char)deInt;
deCharArray[i] = deChar;
}
}
return deCharArray;
}
static int encryptChar(int x, int z){
int y = 'A';
int enInt = (x - y + z) % 26 + y;
return enInt;
}
static int decryptChar(int x, int z){
int y = 'A';
int deInt = (x - y + 104 - z) % 26 + y;
return deInt;
}
static int getRandom(){
int encryptMethod = 0;
while(encryptMethod == 0){
Random encrypt = new Random();
encryptMethod = encrypt.nextInt(96);
}
return encryptMethod;
}
}
I keep getting these errors when i try to compile:
EncryptionDecryption.java:32: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
Scanner input = new Scanner(new File(" "));
^
EncryptionDecryption.java:38: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
PrintWriter work = new PrintWriter("EncryptedDocument.txt");
^
2 errors
| java | script | error-message | null | null | 03/17/2012 19:38:25 | too localized | Why do I keep getting the "must be caught or declared to be thrown" error?
===
Here is my code
import java.io.*;
import java.util.*;
import java.util.Scanner;
import java.io.PrintWriter;
public class EncryptionDecryption {
public static void main(String[] args) throws java.io.IOException{
int z = getRandom();
boolean luck = true;
while(luck == true){
String codeString = getString();
System.out.println(codeString);
char[] enCharArray = encrypt(codeString, z);
String encryptedString = new String(enCharArray);
System.out.println(encryptedString);
char[] deCharArray = decrypt(encryptedString, z);
String decryptedString = new String(deCharArray);
System.out.println(decryptedString);
putString(encryptedString);
if(codeString.length() == 0)
luck = false;
}
}
static String getString(){
Scanner input = new Scanner(new File(" "));
String codeString = input.next();
return codeString;
}
static void putString (String finalString){
PrintWriter work = new PrintWriter("EncryptedDocument.txt");
work.print(finalString + " ");
work.close();
}
static char[] encrypt(String encryptString, int z){
char[] codeChar = encryptString.toCharArray();
char[] enCharArray;
enCharArray = new char[codeChar.length];
for(int i = 0; i < codeChar.length; i++){
int x = codeChar[i];
int enInt = encryptChar(x, z);
char enChar = (char)enInt;
enCharArray[i] = enChar;
if(x == 32){
enInt = 32;
enChar = (char)enInt;
enCharArray[i] = enChar;
}
}
return enCharArray;
}
static char[] decrypt(String decryptString, int z){
char[] deCodeChar = decryptString.toCharArray();
char[] deCharArray;
deCharArray = new char[deCodeChar.length];
for(int i = 0; i < deCodeChar.length; i++){
int x = deCodeChar[i];
int deInt = decryptChar(x, z);
char deChar = (char)deInt;
deCharArray[i] = deChar;
if(x == 32){
deInt = 32;
deChar = (char)deInt;
deCharArray[i] = deChar;
}
}
return deCharArray;
}
static int encryptChar(int x, int z){
int y = 'A';
int enInt = (x - y + z) % 26 + y;
return enInt;
}
static int decryptChar(int x, int z){
int y = 'A';
int deInt = (x - y + 104 - z) % 26 + y;
return deInt;
}
static int getRandom(){
int encryptMethod = 0;
while(encryptMethod == 0){
Random encrypt = new Random();
encryptMethod = encrypt.nextInt(96);
}
return encryptMethod;
}
}
I keep getting these errors when i try to compile:
EncryptionDecryption.java:32: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
Scanner input = new Scanner(new File(" "));
^
EncryptionDecryption.java:38: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
PrintWriter work = new PrintWriter("EncryptedDocument.txt");
^
2 errors
| 3 |
10,929,263 | 06/07/2012 09:37:43 | 535,203 | 12/08/2010 15:39:13 | 188 | 33 | Get all the Class dependencies of a class (including generics)? | I want to extract all `Class` dependencies from a given `Class` (in order to create an [Arquillian][1] test with my Class and all its dependencies).
I'm neerly managing to do so (using [`CtClass.getRefClasses()`][2] from [Javassist][3]), but I'm stuck with generics (it seems that Javassist correctly parses Generics, [but doesn't have any API to get them][4]).
Here is the core of my recursive `inspect` method at the moment :
<!-- language: lang-java -->
for (String className : (Iterable<String>)ClassPool.getDefault().get(klass.getName()).getRefClasses()) {
try {
inspect(Class.forName(className), classSet); // recursion
} catch ( // ClassNotFoundException and NoClassDefFoundError handling
}
}
That iteration seems to work correctly for getting all `Class`es dependencies, but if the `Class` I want to inspect is manipulating for example a `List<MyClass>`, I'll not have `MyClass` from the `Collection` returned by `getRefClasses()`.
I've checked the `.class` file, and the bytecode has that information (`Ljava/util/List<Lmy/company/MyClass;>;`).
Do you know another API which I could use to extract **all** used `Class`es from a given `Class` ?
[1]: http://www.jboss.org/arquillian.html
[2]: http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/html/javassist/CtClass.html#getRefClasses%28%29
[3]: http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/
[4]: http://www.csg.is.titech.ac.jp/~chiba/javassist/tutorial/tutorial3.html#generics | java | generics | bytecode | introspection | null | null | open | Get all the Class dependencies of a class (including generics)?
===
I want to extract all `Class` dependencies from a given `Class` (in order to create an [Arquillian][1] test with my Class and all its dependencies).
I'm neerly managing to do so (using [`CtClass.getRefClasses()`][2] from [Javassist][3]), but I'm stuck with generics (it seems that Javassist correctly parses Generics, [but doesn't have any API to get them][4]).
Here is the core of my recursive `inspect` method at the moment :
<!-- language: lang-java -->
for (String className : (Iterable<String>)ClassPool.getDefault().get(klass.getName()).getRefClasses()) {
try {
inspect(Class.forName(className), classSet); // recursion
} catch ( // ClassNotFoundException and NoClassDefFoundError handling
}
}
That iteration seems to work correctly for getting all `Class`es dependencies, but if the `Class` I want to inspect is manipulating for example a `List<MyClass>`, I'll not have `MyClass` from the `Collection` returned by `getRefClasses()`.
I've checked the `.class` file, and the bytecode has that information (`Ljava/util/List<Lmy/company/MyClass;>;`).
Do you know another API which I could use to extract **all** used `Class`es from a given `Class` ?
[1]: http://www.jboss.org/arquillian.html
[2]: http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/html/javassist/CtClass.html#getRefClasses%28%29
[3]: http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/
[4]: http://www.csg.is.titech.ac.jp/~chiba/javassist/tutorial/tutorial3.html#generics | 0 |
1,501,690 | 10/01/2009 02:59:32 | 155,726 | 08/13/2009 11:06:10 | 46 | 0 | Parsing out data using BeautifulSoup in Python | I am attempting to use BeautifulSoup to parse through a DOM tree and extract the names of authors. Below is a snippet of HTML to show the structure of the code I'm going to scrape.
<html>
<body>
<div class="list-authors">
<span class="descriptor">Authors:</span>
<a href="/find/astro-ph/1/au:+Lin_D/0/1/0/all/0/1">Dacheng Lin</a>,
<a href="/find/astro-ph/1/au:+Remillard_R/0/1/0/all/0/1">Ronald A. Remillard</a>,
<a href="/find/astro-ph/1/au:+Homan_J/0/1/0/all/0/1">Jeroen Homan</a>
</div>
<!--There are many other div tags with this structure-->
</body>
</html>
My point of confusion is that when I do soup.find, it finds the first occurrence of the div tag that I'm searching for. After that, I search for all 'a' link tags. At this stage, how do I extract the authors names from each of the link tags and print them out? Is there a way to do it using BeautifulSoup or do I need to use Regex? How do I continue iterating over every other other div tag and extract the authors names?
import re
import urllib2,sys
from BeautifulSoup import BeautifulSoup, NavigableString
html = urllib2.urlopen(address).read()
soup = BeautifulSoup(html)
try:
authordiv = soup.find('div', attrs={'class': 'list-authors'})
links=tds.findAll('a')
#Iterate through entire page and print authors
except IOError:
print 'IO error'
| python | beautifulsoup | parsing | html | null | null | open | Parsing out data using BeautifulSoup in Python
===
I am attempting to use BeautifulSoup to parse through a DOM tree and extract the names of authors. Below is a snippet of HTML to show the structure of the code I'm going to scrape.
<html>
<body>
<div class="list-authors">
<span class="descriptor">Authors:</span>
<a href="/find/astro-ph/1/au:+Lin_D/0/1/0/all/0/1">Dacheng Lin</a>,
<a href="/find/astro-ph/1/au:+Remillard_R/0/1/0/all/0/1">Ronald A. Remillard</a>,
<a href="/find/astro-ph/1/au:+Homan_J/0/1/0/all/0/1">Jeroen Homan</a>
</div>
<!--There are many other div tags with this structure-->
</body>
</html>
My point of confusion is that when I do soup.find, it finds the first occurrence of the div tag that I'm searching for. After that, I search for all 'a' link tags. At this stage, how do I extract the authors names from each of the link tags and print them out? Is there a way to do it using BeautifulSoup or do I need to use Regex? How do I continue iterating over every other other div tag and extract the authors names?
import re
import urllib2,sys
from BeautifulSoup import BeautifulSoup, NavigableString
html = urllib2.urlopen(address).read()
soup = BeautifulSoup(html)
try:
authordiv = soup.find('div', attrs={'class': 'list-authors'})
links=tds.findAll('a')
#Iterate through entire page and print authors
except IOError:
print 'IO error'
| 0 |
11,103,371 | 06/19/2012 14:40:21 | 1,466,702 | 06/19/2012 14:25:01 | 1 | 0 | Microsoft Translator API - iOS | I took up obj-c development recently and I'm trying to use the Microsoft Translator APIs.
So far, it's working if I use an appId but this way is now depricated.
I've been trying to use the "good" way to do it, using OAuth and so on but so far, all my attempts have not been working.
So, here is my question :
Could anyone give me a sample (obviously without the clientID and the client_secretcode which I have) to get the access_token ?
I've been looking all over the internet with no luck at all...
Thank you,
Kadelka | ios | oauth-2.0 | microsoft-translator | null | null | 06/25/2012 13:49:28 | not a real question | Microsoft Translator API - iOS
===
I took up obj-c development recently and I'm trying to use the Microsoft Translator APIs.
So far, it's working if I use an appId but this way is now depricated.
I've been trying to use the "good" way to do it, using OAuth and so on but so far, all my attempts have not been working.
So, here is my question :
Could anyone give me a sample (obviously without the clientID and the client_secretcode which I have) to get the access_token ?
I've been looking all over the internet with no luck at all...
Thank you,
Kadelka | 1 |
8,428,773 | 12/08/2011 09:28:28 | 1,087,406 | 12/08/2011 09:25:48 | 1 | 0 | How to create a JSON restful webservice in ASP.NET C# that connect to MS SQL Database and retrieve stored procedures values from the database? | How to create a JSON restful webservice in ASP.NET C# that connect to MS SQL Database and retrieve stored procedures values from the database?. I have all stored procedures, data access layers and business layer available in my project. But I do not know how to create restful web service and how to call stored procedures values.
This webservice will eventually be used to communicate with iPhone SDK. And results of this web service will be shown in iPhone application. This iPhone application will be installed on iphone , and it will interact web service to get database values.
Any help would be appreciated.
Thanks! | c# | iphone | sql | null | null | 12/08/2011 15:42:20 | not a real question | How to create a JSON restful webservice in ASP.NET C# that connect to MS SQL Database and retrieve stored procedures values from the database?
===
How to create a JSON restful webservice in ASP.NET C# that connect to MS SQL Database and retrieve stored procedures values from the database?. I have all stored procedures, data access layers and business layer available in my project. But I do not know how to create restful web service and how to call stored procedures values.
This webservice will eventually be used to communicate with iPhone SDK. And results of this web service will be shown in iPhone application. This iPhone application will be installed on iphone , and it will interact web service to get database values.
Any help would be appreciated.
Thanks! | 1 |
5,172,231 | 03/02/2011 19:16:29 | 552,853 | 12/23/2010 22:34:38 | 100 | 1 | Default template arguments | I am testing out a property system and I want to make sure that the root class can hold function pointers to the most derived class that there is. As a result I have something that is sort of working. The most derived class is currently working (RC2), but the current middle class (RC1) will have a compiler error. I want to be able to instantiate RC1 and RC2. The compiler error I will get with RC when creating it is (for the line of "RC1<RC1> rc1test;")
error C2955: 'RC1' : use of class template requires template argument list
error C3203: 'RC1' : unspecialized class template can't be used as a template argument for template parameter 'PropertyOwner', expected a real type
I tried to do "RC1<> rc1test;" but that did not help either. Here is the source, does anyone have any suggestions?
Due to poor formatting on stackoverflow I have put the code here http://codepad.org/ZHBn82g7 (if anyone knows the proper tags that will not ruin the format then please post them below and I will fix this post). | c++ | templates | reflection | properties | metaprogramming | null | open | Default template arguments
===
I am testing out a property system and I want to make sure that the root class can hold function pointers to the most derived class that there is. As a result I have something that is sort of working. The most derived class is currently working (RC2), but the current middle class (RC1) will have a compiler error. I want to be able to instantiate RC1 and RC2. The compiler error I will get with RC when creating it is (for the line of "RC1<RC1> rc1test;")
error C2955: 'RC1' : use of class template requires template argument list
error C3203: 'RC1' : unspecialized class template can't be used as a template argument for template parameter 'PropertyOwner', expected a real type
I tried to do "RC1<> rc1test;" but that did not help either. Here is the source, does anyone have any suggestions?
Due to poor formatting on stackoverflow I have put the code here http://codepad.org/ZHBn82g7 (if anyone knows the proper tags that will not ruin the format then please post them below and I will fix this post). | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.