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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,365,018 | 07/06/2012 15:17:41 | 840,688 | 07/12/2011 12:27:57 | 130 | 0 | DevExpress component history or Delphi | I am using the Delphi 5.0 version. I have installed the DevExpress VCL for Delphi components. Build no is 27. After installation there is one older creted Developer Express.VCl. This folder contains 3 different folders 1. dx3 2. dx2005 and 3. dx2006. All these folders contains some pas,project files. I want to use ExpressBars component. But as dx3,dx2005 and dx2006 all contains ExpressBars files I am unable to decide which components should i use. What are these dx3,dx2005 and dx2006? It is the diff versions? And if my modules were build using dx3 and I use dx2006 for my current development then it will cause any error after building module? Thanks for help and please let me know i anyone used the DevExpress for VCL Delphi.
Regards-- Naren | delphi | devexpress | null | null | null | 07/27/2012 00:28:44 | not a real question | DevExpress component history or Delphi
===
I am using the Delphi 5.0 version. I have installed the DevExpress VCL for Delphi components. Build no is 27. After installation there is one older creted Developer Express.VCl. This folder contains 3 different folders 1. dx3 2. dx2005 and 3. dx2006. All these folders contains some pas,project files. I want to use ExpressBars component. But as dx3,dx2005 and dx2006 all contains ExpressBars files I am unable to decide which components should i use. What are these dx3,dx2005 and dx2006? It is the diff versions? And if my modules were build using dx3 and I use dx2006 for my current development then it will cause any error after building module? Thanks for help and please let me know i anyone used the DevExpress for VCL Delphi.
Regards-- Naren | 1 |
11,053,491 | 06/15/2012 15:14:56 | 1,230,505 | 02/24/2012 10:14:15 | 1 | 0 | TrippleDES encryption with two keys in Object C | i am new to Object C but need to encrypt a string using Tripple DES with two random keys. Can someone please share a sample code with me. Thanks guys | objective-c | encryption | primary-key | null | null | 06/16/2012 21:05:08 | not a real question | TrippleDES encryption with two keys in Object C
===
i am new to Object C but need to encrypt a string using Tripple DES with two random keys. Can someone please share a sample code with me. Thanks guys | 1 |
9,945,278 | 03/30/2012 14:49:02 | 1,299,145 | 03/28/2012 19:53:02 | 24 | 0 | shifting value in a matrix | i have a 8 * 4 matrix.
{
0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
}
if i input "10111101", then the process should be like:
{
1,0,0,0,0,0,0,0
1,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
1,0,0,0,0,0,0,0
}
then
{
1,1,0,0,0,0,0,0
0,1,0,0,0,0,0,0
1,0,0,0,0,0,0,0
1,1,0,0,0,0,0,0
}
then
{
0,1,1,0,0,0,0,0
0,0,1,0,0,0,0,0
0,1,0,0,0,0,0,0
0,1,1,0,0,0,0,0
}
then
{
0,0,1,1,0,0,0,0
0,0,0,1,0,0,0,0
0,0,1,0,0,0,0,0
0,0,1,1,0,0,0,0
}
{
0,0,0,1,1,0,0,0
0,0,0,0,1,0,0,0
0,0,0,1,0,0,0,0
0,0,0,1,1,0,0,0
}
and this will go to the last. after finishing all column it will start again.
i actually have a matrix(8*4) of ovalshape. i used list<> and all controls are in shapecontainer. i want to change the color when i find 1. this part i can do. but i cannot think how can i shift 1,0 in the matrix.
how could i do this? | c# | algorithm | matrix | null | null | null | open | shifting value in a matrix
===
i have a 8 * 4 matrix.
{
0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
}
if i input "10111101", then the process should be like:
{
1,0,0,0,0,0,0,0
1,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0
1,0,0,0,0,0,0,0
}
then
{
1,1,0,0,0,0,0,0
0,1,0,0,0,0,0,0
1,0,0,0,0,0,0,0
1,1,0,0,0,0,0,0
}
then
{
0,1,1,0,0,0,0,0
0,0,1,0,0,0,0,0
0,1,0,0,0,0,0,0
0,1,1,0,0,0,0,0
}
then
{
0,0,1,1,0,0,0,0
0,0,0,1,0,0,0,0
0,0,1,0,0,0,0,0
0,0,1,1,0,0,0,0
}
{
0,0,0,1,1,0,0,0
0,0,0,0,1,0,0,0
0,0,0,1,0,0,0,0
0,0,0,1,1,0,0,0
}
and this will go to the last. after finishing all column it will start again.
i actually have a matrix(8*4) of ovalshape. i used list<> and all controls are in shapecontainer. i want to change the color when i find 1. this part i can do. but i cannot think how can i shift 1,0 in the matrix.
how could i do this? | 0 |
11,289,333 | 07/02/2012 07:26:17 | 1,388,658 | 05/11/2012 05:32:57 | 1 | 0 | selenium grid2 generate log for script executed on a remote node | I have a selenium grid2 hub and then attached remote nodes to it.Now I want to run scripts on the node and get the logs of script that is executed on the node to know the test result.Suggest me the ways in which I can do this. | web-services | apache | tomcat | logging | selenium-rc | 07/03/2012 11:51:18 | not a real question | selenium grid2 generate log for script executed on a remote node
===
I have a selenium grid2 hub and then attached remote nodes to it.Now I want to run scripts on the node and get the logs of script that is executed on the node to know the test result.Suggest me the ways in which I can do this. | 1 |
9,972,221 | 04/02/2012 07:13:10 | 1,289,784 | 03/24/2012 10:02:53 | 14 | 0 | How to implement infinite scrolling in table data? | How to implement infinite scrolling in table data by using php and jquery? | jquery | null | null | null | null | 04/02/2012 12:12:20 | not a real question | How to implement infinite scrolling in table data?
===
How to implement infinite scrolling in table data by using php and jquery? | 1 |
2,383,321 | 03/04/2010 22:48:53 | 281,348 | 02/25/2010 15:42:38 | 18 | 5 | Saving User Config data to XML and Relative URI error | Good evening,
I am working on a program where some application config info is stored in a Userconfig.xml file. I am loading the file as an XMLDataProvider in the XAML via relative URI:
<XmlDataProvider x:Name="UserConfigDataSource" x:Key="UserConfigDataSource" Source="UserConfig.xml" d:IsDataSource="True"/>
I have a number of items throughout bound to elements in the document and an event handler that saves to the XMLDataProvider:
Private Sub SaveConfig(ByVal sender as Object, ByVal e as System.EventArgs)
'TODO: Add event handler implementation here
Dim SavePath As String = UserConfigDataSource.Source.LocalPath.ToString
Dim XMLDoc = UserConfigDataSource.Document
UserConfigDataSource.Document.Save(SavePath)
End Sub
When this executes I get the error "This operation is not supported for a relative URI". Is there a good way to produce an absolute URI (aside from getting the assembly executing location and trimming the executable filename from the end)? I expected this to be a somewhat simple procedure. Any help would be greatly appreciated.
Cory
| wpf | vb.net | uri | config | null | null | open | Saving User Config data to XML and Relative URI error
===
Good evening,
I am working on a program where some application config info is stored in a Userconfig.xml file. I am loading the file as an XMLDataProvider in the XAML via relative URI:
<XmlDataProvider x:Name="UserConfigDataSource" x:Key="UserConfigDataSource" Source="UserConfig.xml" d:IsDataSource="True"/>
I have a number of items throughout bound to elements in the document and an event handler that saves to the XMLDataProvider:
Private Sub SaveConfig(ByVal sender as Object, ByVal e as System.EventArgs)
'TODO: Add event handler implementation here
Dim SavePath As String = UserConfigDataSource.Source.LocalPath.ToString
Dim XMLDoc = UserConfigDataSource.Document
UserConfigDataSource.Document.Save(SavePath)
End Sub
When this executes I get the error "This operation is not supported for a relative URI". Is there a good way to produce an absolute URI (aside from getting the assembly executing location and trimming the executable filename from the end)? I expected this to be a somewhat simple procedure. Any help would be greatly appreciated.
Cory
| 0 |
9,503,402 | 02/29/2012 17:02:26 | 1,240,755 | 02/29/2012 16:44:45 | 1 | 0 | Parsing JSON data in RAILS 3.0.6 received from HTTP POST with content-type application/x-www-form-urlencoded | I am receiving an HTTP POST from a 3rd party with content-type as 'application/x-www-form-urlencoded' in my RAILS 3.0.6 controller
I tried parsing the request both as -
job_status = params['job']['status']
as well as
recd_json = JSON.parse(params)
job_status = recd_json['job']['status']
But in both cases the rails controller is throwing the error 'NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.'
I am not sure how else can JSON (encoded using this content type) can be parsed..Any help is appreciated :) | ruby-on-rails | json | http-headers | null | null | null | open | Parsing JSON data in RAILS 3.0.6 received from HTTP POST with content-type application/x-www-form-urlencoded
===
I am receiving an HTTP POST from a 3rd party with content-type as 'application/x-www-form-urlencoded' in my RAILS 3.0.6 controller
I tried parsing the request both as -
job_status = params['job']['status']
as well as
recd_json = JSON.parse(params)
job_status = recd_json['job']['status']
But in both cases the rails controller is throwing the error 'NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.'
I am not sure how else can JSON (encoded using this content type) can be parsed..Any help is appreciated :) | 0 |
6,282,124 | 06/08/2011 16:30:23 | 734,801 | 05/02/2011 17:00:18 | 48 | 2 | jqGrid: Reload Data | Here is my code:
$('#ShowName').autocomplete({
delay: 600,
minLength: 0,
source: function (request, response) {
$.ajax({
url: '<%: Url.Content("~/Case/FilterShowName") %>',
data: getData(),
success: function (data) { response(data); },
dataType: "json"
});
},
select: function (event, ui) {
var data = getData();
data.ShowName = ui.item.label;
$("#list").setGridParam('postData', data);
$("#list").trigger("reloadGrid");
}
});
As you can see, when an item is selected on **$('#ShowName')** I want to reload my **$("#list")**'s jqGrid. But when I do that, the new postData's values is never sended. Only the old values are sended to **~/Case/FilterShowName**
I see different solution on Stackoverflow by recreating the entire grid. This is realy necessary?
Thank you! | jquery | jquery-ui | jqgrid | jqgrid-asp.net | null | null | open | jqGrid: Reload Data
===
Here is my code:
$('#ShowName').autocomplete({
delay: 600,
minLength: 0,
source: function (request, response) {
$.ajax({
url: '<%: Url.Content("~/Case/FilterShowName") %>',
data: getData(),
success: function (data) { response(data); },
dataType: "json"
});
},
select: function (event, ui) {
var data = getData();
data.ShowName = ui.item.label;
$("#list").setGridParam('postData', data);
$("#list").trigger("reloadGrid");
}
});
As you can see, when an item is selected on **$('#ShowName')** I want to reload my **$("#list")**'s jqGrid. But when I do that, the new postData's values is never sended. Only the old values are sended to **~/Case/FilterShowName**
I see different solution on Stackoverflow by recreating the entire grid. This is realy necessary?
Thank you! | 0 |
7,957,746 | 10/31/2011 18:05:22 | 965,368 | 09/26/2011 15:48:07 | 1 | 0 | Zend Framework fails to upload a .mobileprovision, says it "has a false file extension" | So I'm trying to upload a .mobileprovison to my system. Every-time it uploads the error says, "has a false file extension"
Is it a .htaccess problem, can Zend handle MobileProvision file?
Thanks!
class Application_Form_MobileProvision extends Zend_Form
{
public function init()
{
$this->setName('mobileprovision');
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int');
$file = new Zend_Form_Element_File('file');
$file->addValidator('Extension', false,'mobileprovision');
$file->setLabel('File')
->setRequired(true);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$this->setAttrib('enctype', 'multipart/form-data');
$this->addElements(array($id, $file, $submit));
}
} | php | zend-framework | file-upload | false | null | 11/22/2011 16:45:17 | too localized | Zend Framework fails to upload a .mobileprovision, says it "has a false file extension"
===
So I'm trying to upload a .mobileprovison to my system. Every-time it uploads the error says, "has a false file extension"
Is it a .htaccess problem, can Zend handle MobileProvision file?
Thanks!
class Application_Form_MobileProvision extends Zend_Form
{
public function init()
{
$this->setName('mobileprovision');
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int');
$file = new Zend_Form_Element_File('file');
$file->addValidator('Extension', false,'mobileprovision');
$file->setLabel('File')
->setRequired(true);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$this->setAttrib('enctype', 'multipart/form-data');
$this->addElements(array($id, $file, $submit));
}
} | 3 |
7,041,460 | 08/12/2011 14:19:57 | 246,277 | 01/08/2010 09:51:48 | 542 | 29 | VS2010 - publish website, empty folders are ignored | In visual studio 2010, when publishing a website, it seems that empty folders are not being published.
I am quite sure that this behavior were introduced in vs2010. I cant find it documented anywhere, not sure if I should call it a feature or a bug... Anyway, is it possible to revert to the old behavior as I wish to keep my folder structure on the production server. | visual-studio-2010 | publishing-site | null | null | null | null | open | VS2010 - publish website, empty folders are ignored
===
In visual studio 2010, when publishing a website, it seems that empty folders are not being published.
I am quite sure that this behavior were introduced in vs2010. I cant find it documented anywhere, not sure if I should call it a feature or a bug... Anyway, is it possible to revert to the old behavior as I wish to keep my folder structure on the production server. | 0 |
8,383,284 | 12/05/2011 09:34:10 | 701,961 | 04/11/2011 10:20:08 | 147 | 12 | subdomain redirection in htaccess | I was wondering if the following scenario is possible using htaccess rules.
I want one subdomain to be redirected to another url.
I have contact the server admin to add the "test" subdomain to "example.com" domain.
The main domain has no other subdomains.
What rule must i put in htaccess to do achieve:
http://test.example.com to be redirected to http://www.something-else.com.
NOTE: www.something-else.com is a complicated url (200 chars length) | .htaccess | subdomain | redirect | null | null | 12/07/2011 13:40:16 | off topic | subdomain redirection in htaccess
===
I was wondering if the following scenario is possible using htaccess rules.
I want one subdomain to be redirected to another url.
I have contact the server admin to add the "test" subdomain to "example.com" domain.
The main domain has no other subdomains.
What rule must i put in htaccess to do achieve:
http://test.example.com to be redirected to http://www.something-else.com.
NOTE: www.something-else.com is a complicated url (200 chars length) | 2 |
6,288,931 | 06/09/2011 06:32:48 | 631,852 | 02/24/2011 07:15:56 | 11 | 2 | How to implement the vote up and down function like stackoverflow | If you have use stackoverflow for a while. You surely have use the function of vote up and down of the question and answer. I notice stackoverflow use <a> anchor. But I don't know how to post the data to server. I think it's javascript associate with this <a>. But I can't find it. Anybody know how to implement it? Thanks for your answer. | php | javascript | post | stackoverflow | null | 06/09/2011 17:10:08 | not a real question | How to implement the vote up and down function like stackoverflow
===
If you have use stackoverflow for a while. You surely have use the function of vote up and down of the question and answer. I notice stackoverflow use <a> anchor. But I don't know how to post the data to server. I think it's javascript associate with this <a>. But I can't find it. Anybody know how to implement it? Thanks for your answer. | 1 |
94,875 | 09/18/2008 17:47:04 | 145 | 08/02/2008 14:40:17 | 1,071 | 43 | Image Processing, In Python? | I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so, with what? | python | image | image-manipulation | image-processing | null | 07/24/2012 19:56:36 | not constructive | Image Processing, In Python?
===
I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so, with what? | 4 |
3,908,545 | 10/11/2010 17:29:35 | 472,531 | 10/11/2010 17:24:46 | 1 | 0 | Reading, Comparing and taking input non ASCII charachter(i.e Bangla and other indic script) array in C | Can I work with Begali charachters(non ASCII) in C? | c | non-ascii-chars | null | null | null | 05/22/2012 14:55:24 | not a real question | Reading, Comparing and taking input non ASCII charachter(i.e Bangla and other indic script) array in C
===
Can I work with Begali charachters(non ASCII) in C? | 1 |
8,527,606 | 12/15/2011 22:35:22 | 1,100,894 | 12/15/2011 22:31:47 | 1 | 0 | Batch file to edit a text file and replace text | I need to create a batch file that will open a text file look for a specific text and replace it with another word. Then save the file and rename it to .reg when its done. | batch | search-and-replace | null | null | null | 12/17/2011 00:49:15 | not a real question | Batch file to edit a text file and replace text
===
I need to create a batch file that will open a text file look for a specific text and replace it with another word. Then save the file and rename it to .reg when its done. | 1 |
6,526,071 | 06/29/2011 19:23:32 | 821,790 | 06/29/2011 19:23:32 | 1 | 0 | Cant add if statement php | Hi im posting a textarea value to a page and the value must equal "2011" if it doesnt I want to throw an error.
my input is
<fieldset>
<span class="subtitle">What year is it?</span>
<input type="text" name="aspam" id="aspam"/>
</fieldset>
and my php is
if(!isset($_POST['produgg_username']) or !isset($_POST['produgg_password']) or !isset($_POST['produgg_email']) or $_POST['aspam'] != '2011')
{
print "Please use all fields";
}elseif(empty($_POST['produgg_username'])){
print "Please choose a username";
}elseif($_POST['aspam'] != '2011'){
print "its not 2011!";
}elseif(empty($_POST['produgg_password'])){
print "Please choose a password";
}elseif(empty($_POST['produgg_email'])){
print "Please enter an email address";
}elseif(!filter_var($_POST['produgg_email'], FILTER_VALIDATE_EMAIL)) {
print "Please enter a valid email address";
}elseif(!preg_match("/^[a-z0-9]+$/i", $_POST['produgg_username'])) {
print "Please use only characters and numbers for username";
}elseif($usersClass->checkUserExists($_POST['produgg_username'])) {
print "Username Taken, please choose another"; | php | null | null | null | null | 06/29/2011 19:28:14 | not a real question | Cant add if statement php
===
Hi im posting a textarea value to a page and the value must equal "2011" if it doesnt I want to throw an error.
my input is
<fieldset>
<span class="subtitle">What year is it?</span>
<input type="text" name="aspam" id="aspam"/>
</fieldset>
and my php is
if(!isset($_POST['produgg_username']) or !isset($_POST['produgg_password']) or !isset($_POST['produgg_email']) or $_POST['aspam'] != '2011')
{
print "Please use all fields";
}elseif(empty($_POST['produgg_username'])){
print "Please choose a username";
}elseif($_POST['aspam'] != '2011'){
print "its not 2011!";
}elseif(empty($_POST['produgg_password'])){
print "Please choose a password";
}elseif(empty($_POST['produgg_email'])){
print "Please enter an email address";
}elseif(!filter_var($_POST['produgg_email'], FILTER_VALIDATE_EMAIL)) {
print "Please enter a valid email address";
}elseif(!preg_match("/^[a-z0-9]+$/i", $_POST['produgg_username'])) {
print "Please use only characters and numbers for username";
}elseif($usersClass->checkUserExists($_POST['produgg_username'])) {
print "Username Taken, please choose another"; | 1 |
6,025,963 | 05/17/2011 03:34:05 | 584,020 | 01/21/2011 05:52:28 | 11 | 0 | Can anyone please let me know how semaphores are implemented in operating systems | Can anyone please let me know how semaphores are implemented in operating systems.
I want to implement the same kind of calls.
Thanks in advance. | operating-system | null | null | null | null | 05/18/2011 12:15:54 | not a real question | Can anyone please let me know how semaphores are implemented in operating systems
===
Can anyone please let me know how semaphores are implemented in operating systems.
I want to implement the same kind of calls.
Thanks in advance. | 1 |
3,312,226 | 07/22/2010 18:42:19 | 163,728 | 08/26/2009 18:34:20 | 25 | 0 | C#, opening a single file (read only) with millions of other files in the same directory seems to consume way to much memory | I have a Windows service that is retrieving a few selected files from a directory that contains millions of other files. The service runs out of memory every hour or so. This never happened when there were a few thousand, so it feels like some resource is not being properly disposed of. But to my eyes the stream is being disposed of properly.
using (FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read))
{
//deserializes the file with a binary formatter
}
The directory itself is marked as compressed, so I also wonder whether this is contributing to the problem.
Can anyone explain the cause of this apparent memory leak? | c# | .net | c#3.0 | null | null | null | open | C#, opening a single file (read only) with millions of other files in the same directory seems to consume way to much memory
===
I have a Windows service that is retrieving a few selected files from a directory that contains millions of other files. The service runs out of memory every hour or so. This never happened when there were a few thousand, so it feels like some resource is not being properly disposed of. But to my eyes the stream is being disposed of properly.
using (FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read))
{
//deserializes the file with a binary formatter
}
The directory itself is marked as compressed, so I also wonder whether this is contributing to the problem.
Can anyone explain the cause of this apparent memory leak? | 0 |
5,788,541 | 04/26/2011 09:42:30 | 553,801 | 12/25/2010 11:45:09 | 54 | 8 | Does document reload every time DOM changes via Javascript? | I kind of have a newbie question. I've done some testing, but I didn't get anything solid, so does the whole document reload when DOM is updated?
Thanks! <3 | javascript | dom | null | null | null | null | open | Does document reload every time DOM changes via Javascript?
===
I kind of have a newbie question. I've done some testing, but I didn't get anything solid, so does the whole document reload when DOM is updated?
Thanks! <3 | 0 |
10,867,182 | 06/03/2012 01:13:38 | 1,433,048 | 06/03/2012 01:04:37 | 1 | 0 | How can I put a complicated php code inside of another php code? | I need to be able to put part of a site i had built previously into another site im making now. However, both are in php and there are issues with the syntax (ie too many subsets of " and '). How can I put this code:
if(mysql_num_rows($result) == 0)
{
echo 'No categories defined yet.';
}
else
{
//prepare the table
echo '<table border="1">
<tr>
<th>Category</th>
<th>Last topic</th>
</tr>';
while($row = mysql_fetch_assoc($result))
{
echo '<tr>';
echo '<td class="leftpart">';
echo '<h3><a href="category.php?id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a></h3>' . $row['cat_description'];
echo '</td>';
echo '<td class="rightpart">';
//fetch last topic for each cat
$topicsql = "SELECT
topic_id,
topic_subject,
topic_date,
topic_cat
FROM
topics
WHERE
topic_cat = " . $row['cat_id'] . "
ORDER BY
topic_date
DESC
LIMIT
1";
$topicsresult = mysql_query($topicsql);
if(!$topicsresult)
{
echo 'Last topic could not be displayed.';
}
else
{
if(mysql_num_rows($topicsresult) == 0)
{
echo 'no topics';
}
else
{
while($topicrow = mysql_fetch_assoc($topicsresult))
echo '<a href="topic.php?id=' . $topicrow['topic_id'] . '">' . $topicrow['topic_subject'] . '</a> at ' . date('d-m-Y', strtotime($topicrow['topic_date']));
}
}
echo '</td>';
echo '</tr>';
}
}
into this code (i want the table itself to be inside the div main and under the welcome)
echo
"<div id=holder>
<div id='nav'>
<a href='chat.php'>Chat with your friends!</a>
<br><br><a href='changepassword.php'>Change password</a><br><br>
<a href='logout.php'>Logout</a>
</div>
<div id='main'>
Welcome, ".$_SESSION['user_name']."!
</div>
</div>";
//fetch last topic for each cat
$topicsql = "SELECT
topic_id,
topic_subject,
topic_date,
topic_cat
FROM
topics
WHERE
topic_cat = " . $row['cat_id'] . "
ORDER BY
topic_date
DESC
LIMIT
1";
$topicsresult = mysql_query($topicsql);
if(!$topicsresult)
{
echo 'Last topic could not be displayed.';
}
else
{
if(mysql_num_rows($topicsresult) == 0)
{
echo 'no topics';
}
else
{
while($topicrow = mysql_fetch_assoc($topicsresult))
echo '<a href="topic.php?id=' . $topicrow['topic_id'] . '">' . $topicrow['topic_subject'] . '</a> at ' . date('d-m-Y', strtotime($topicrow['topic_date']));
}
}
echo '</td>';
echo '</tr>';
}
}
};
I recognize that this is pretty complicated, but I am so lost in the syntax at this point, so if someone could help me a little bit on this itd be very appreciated | php | mysql | syntax | null | null | 06/03/2012 10:44:48 | too localized | How can I put a complicated php code inside of another php code?
===
I need to be able to put part of a site i had built previously into another site im making now. However, both are in php and there are issues with the syntax (ie too many subsets of " and '). How can I put this code:
if(mysql_num_rows($result) == 0)
{
echo 'No categories defined yet.';
}
else
{
//prepare the table
echo '<table border="1">
<tr>
<th>Category</th>
<th>Last topic</th>
</tr>';
while($row = mysql_fetch_assoc($result))
{
echo '<tr>';
echo '<td class="leftpart">';
echo '<h3><a href="category.php?id=' . $row['cat_id'] . '">' . $row['cat_name'] . '</a></h3>' . $row['cat_description'];
echo '</td>';
echo '<td class="rightpart">';
//fetch last topic for each cat
$topicsql = "SELECT
topic_id,
topic_subject,
topic_date,
topic_cat
FROM
topics
WHERE
topic_cat = " . $row['cat_id'] . "
ORDER BY
topic_date
DESC
LIMIT
1";
$topicsresult = mysql_query($topicsql);
if(!$topicsresult)
{
echo 'Last topic could not be displayed.';
}
else
{
if(mysql_num_rows($topicsresult) == 0)
{
echo 'no topics';
}
else
{
while($topicrow = mysql_fetch_assoc($topicsresult))
echo '<a href="topic.php?id=' . $topicrow['topic_id'] . '">' . $topicrow['topic_subject'] . '</a> at ' . date('d-m-Y', strtotime($topicrow['topic_date']));
}
}
echo '</td>';
echo '</tr>';
}
}
into this code (i want the table itself to be inside the div main and under the welcome)
echo
"<div id=holder>
<div id='nav'>
<a href='chat.php'>Chat with your friends!</a>
<br><br><a href='changepassword.php'>Change password</a><br><br>
<a href='logout.php'>Logout</a>
</div>
<div id='main'>
Welcome, ".$_SESSION['user_name']."!
</div>
</div>";
//fetch last topic for each cat
$topicsql = "SELECT
topic_id,
topic_subject,
topic_date,
topic_cat
FROM
topics
WHERE
topic_cat = " . $row['cat_id'] . "
ORDER BY
topic_date
DESC
LIMIT
1";
$topicsresult = mysql_query($topicsql);
if(!$topicsresult)
{
echo 'Last topic could not be displayed.';
}
else
{
if(mysql_num_rows($topicsresult) == 0)
{
echo 'no topics';
}
else
{
while($topicrow = mysql_fetch_assoc($topicsresult))
echo '<a href="topic.php?id=' . $topicrow['topic_id'] . '">' . $topicrow['topic_subject'] . '</a> at ' . date('d-m-Y', strtotime($topicrow['topic_date']));
}
}
echo '</td>';
echo '</tr>';
}
}
};
I recognize that this is pretty complicated, but I am so lost in the syntax at this point, so if someone could help me a little bit on this itd be very appreciated | 3 |
8,998,545 | 01/25/2012 06:05:03 | 787,250 | 06/07/2011 10:13:57 | 124 | 15 | Notifications from SQLServer to Java | I want to implement notifications in java springs. How to get the notifications to java on change in database/table? Database is SQLServer 2008. | java | database | sql-server-2008 | spring | notifications | null | open | Notifications from SQLServer to Java
===
I want to implement notifications in java springs. How to get the notifications to java on change in database/table? Database is SQLServer 2008. | 0 |
3,221,605 | 07/11/2010 02:19:53 | 112,355 | 05/26/2009 03:58:14 | 2,577 | 32 | If I give full, 100% attribution to source code, is it still stealing? | For example, say that I want to make a program that solves linear equations.
Say I find an open source program that does this and I decide to read it, study it, and generally tweak it to my liking and keeping around 70% of the code.
If I give 100% undisputed attribution to the original author both in source code and my website (I'm not a thief and give credit where credit is due), would this be illegal and frowned upon by my fellow peers?
| open-source | legal | attribution | null | null | 07/11/2010 06:36:35 | off topic | If I give full, 100% attribution to source code, is it still stealing?
===
For example, say that I want to make a program that solves linear equations.
Say I find an open source program that does this and I decide to read it, study it, and generally tweak it to my liking and keeping around 70% of the code.
If I give 100% undisputed attribution to the original author both in source code and my website (I'm not a thief and give credit where credit is due), would this be illegal and frowned upon by my fellow peers?
| 2 |
6,420,051 | 06/21/2011 03:31:35 | 301,218 | 03/24/2010 21:14:20 | 99 | 1 | Why QueryperformanceCounter timed different from wall clock? | Hi I am using QueryperformanceCounter to time a block of code in Delphi. For some reason, the
Millisecond number I got by using QueryPerformanceCounter is quite different from my wall clock time by using a stopwatch. For example The stopwatch give me about 33 seconds, which seems right if not accuracy, but using QueryPerofomanceCounter will give me a number like 500 Million-seconds.
When step though my code, I can see that QueryPerformanceFrequencygives me correct CPU frequency for my CPU, 2.4G for Core2 E6600. So if the tick number is correct, `(tick number / Freq) * 1000` should give me correct execution time for the code I am timing, but why not?
I know that for the code I am trying to timing, QeuryPerformanceCounter is probably over-killing as it took seconds rather than MillionSeconds, but I am more interested in understanding the reason for the time difference between wall clock and QueryPerormanceCounter.
My Hardware is E6600 Core2 and OS is Windows 7 X64 if it is relevant. | delphi | queryperformancecounter | null | null | null | null | open | Why QueryperformanceCounter timed different from wall clock?
===
Hi I am using QueryperformanceCounter to time a block of code in Delphi. For some reason, the
Millisecond number I got by using QueryPerformanceCounter is quite different from my wall clock time by using a stopwatch. For example The stopwatch give me about 33 seconds, which seems right if not accuracy, but using QueryPerofomanceCounter will give me a number like 500 Million-seconds.
When step though my code, I can see that QueryPerformanceFrequencygives me correct CPU frequency for my CPU, 2.4G for Core2 E6600. So if the tick number is correct, `(tick number / Freq) * 1000` should give me correct execution time for the code I am timing, but why not?
I know that for the code I am trying to timing, QeuryPerformanceCounter is probably over-killing as it took seconds rather than MillionSeconds, but I am more interested in understanding the reason for the time difference between wall clock and QueryPerormanceCounter.
My Hardware is E6600 Core2 and OS is Windows 7 X64 if it is relevant. | 0 |
5,808,252 | 04/27/2011 17:42:26 | 450,741 | 09/17/2010 15:36:05 | 203 | 4 | decompilation resources and theory | There must be a million of books and papers on the theory and techniques of building compilers. Are there any resources on doing the reverse? Im not interested in any particular HW platform. Looking for good books/research papers that examine the subject and difficulties in depth. | decompiler | null | null | null | null | null | open | decompilation resources and theory
===
There must be a million of books and papers on the theory and techniques of building compilers. Are there any resources on doing the reverse? Im not interested in any particular HW platform. Looking for good books/research papers that examine the subject and difficulties in depth. | 0 |
5,776,618 | 04/25/2011 08:30:04 | 508,127 | 11/15/2010 10:28:18 | 901 | 3 | what is Dynamic Linq query | i never work with DLINQ so i dont know the use of DLINQ. so can anyone show the situation where DLINQ is required and also show me the various use of DLINQ. | linq | null | null | null | null | 04/25/2011 10:35:50 | not a real question | what is Dynamic Linq query
===
i never work with DLINQ so i dont know the use of DLINQ. so can anyone show the situation where DLINQ is required and also show me the various use of DLINQ. | 1 |
1,879,136 | 12/10/2009 06:58:53 | 56,621 | 01/19/2009 09:48:29 | 33 | 1 | Forms Authentication and POST request | We have an ASP.NET app protected by forms authentication. The app uses MS AJAX heavily to call its web-services.
When the forms authentication times out, and a **GET**-request happens - all is fine (the user is redirected to a login page).
**BUT** when the forms authentication times out and a **POST**-request happens (ajax) - no redirect happens, instead the app returns "401 unathorized" and the browser prompts for username and password (not a login form, but a browsers built-in dialog). Of course entering ANY username/password never helps.
How do I handle this? | asp.net | forms-authentication | null | null | null | null | open | Forms Authentication and POST request
===
We have an ASP.NET app protected by forms authentication. The app uses MS AJAX heavily to call its web-services.
When the forms authentication times out, and a **GET**-request happens - all is fine (the user is redirected to a login page).
**BUT** when the forms authentication times out and a **POST**-request happens (ajax) - no redirect happens, instead the app returns "401 unathorized" and the browser prompts for username and password (not a login form, but a browsers built-in dialog). Of course entering ANY username/password never helps.
How do I handle this? | 0 |
6,598,353 | 07/06/2011 14:47:49 | 756,871 | 05/17/2011 06:58:32 | 1 | 0 | How to get the position of character at onTouch in editext | i want to get the Position of the character at the time of touch on the editext box in my application with the help of the coordinates of Ontouch. How should this be possible .
Please help me
Thanks in advance | android | null | null | null | null | null | open | How to get the position of character at onTouch in editext
===
i want to get the Position of the character at the time of touch on the editext box in my application with the help of the coordinates of Ontouch. How should this be possible .
Please help me
Thanks in advance | 0 |
8,625,136 | 12/24/2011 14:37:37 | 1,114,646 | 12/24/2011 14:35:40 | 1 | 0 | vmware ESXi 5.0 snapshot backup failed “500 internal server error” | I'm trying to backup virtual machine on ESXi 5.0 using Trilead Vm Explorer 3.7 but I'm getting 500 internal server error:
1) Snapshot is created.
2) Files download started. Some files have been downloaded, but when -flat.vmdk file download starts, after 3-4 minutes download interrupted with "500 internal server error".
I tried to download manually using SSH(WinSCP) but same thing, -flat.vmdk file download starts and after 3-4 minutes download interrupted with SCP error.
I have three virtual machines on one datastore. lockdown mode is disabled.
Can anybody help? | backup | vmware | null | null | null | 12/24/2011 21:30:27 | off topic | vmware ESXi 5.0 snapshot backup failed “500 internal server error”
===
I'm trying to backup virtual machine on ESXi 5.0 using Trilead Vm Explorer 3.7 but I'm getting 500 internal server error:
1) Snapshot is created.
2) Files download started. Some files have been downloaded, but when -flat.vmdk file download starts, after 3-4 minutes download interrupted with "500 internal server error".
I tried to download manually using SSH(WinSCP) but same thing, -flat.vmdk file download starts and after 3-4 minutes download interrupted with SCP error.
I have three virtual machines on one datastore. lockdown mode is disabled.
Can anybody help? | 2 |
9,171,909 | 02/07/2012 06:26:21 | 581,477 | 01/19/2011 13:12:16 | 58 | 3 | Datepicker issue while adding textboxes dynamically | In my project, I have a textbox for meetingdate, i have given id = meetingdate1 to this textbox. if one want to add more meetings date then there is button for that. After clicking this button, new textbox added below to previous textbox, say meetingdate2, meetingdate3 and so on... Now I want to add datepicker textbox instead of textbox, so I have used jquery for this purpose. Its work for 1st textbox whose id = meetingdate1 but datepicker functionality not getting in other textboxes whose id = meetingdate2, id= meetingdate3 and so on...
the jquery code is:
$("#addButton").live("click", function () {
if(counter_ldates>10){
alert("Only 10 dates allowed");
return false;
}
var newTextBoxDiv = $(document.createElement('div')).attr("id", 'LdateDiv' + counter_ldates);
newTextBoxDiv.html('<label>Date #'+ counter_ldates + ' : </label>' +
'<input type="text" name="meetingdate' + counter_ldates +
'" id="meetingdate' + counter_ldates +
'" class="ldatestextbox" value="" style="width: 75px" >');
newTextBoxDiv.appendTo("#LdatesGroup");
counter_ldates++;
$('#ldates_cnt').attr('value', counter_ldates);
});
$( "#meetingdate1" ).datepicker();
$( "#meetingdate2" ).datepicker();
$( "#meetingdate3" ).datepicker();
$( "#meetingdate4" ).datepicker();
$( "#meetingdate5" ).datepicker();
how can i solve this issue of datepicker? | jquery | jquery-ui | datepicker | null | null | null | open | Datepicker issue while adding textboxes dynamically
===
In my project, I have a textbox for meetingdate, i have given id = meetingdate1 to this textbox. if one want to add more meetings date then there is button for that. After clicking this button, new textbox added below to previous textbox, say meetingdate2, meetingdate3 and so on... Now I want to add datepicker textbox instead of textbox, so I have used jquery for this purpose. Its work for 1st textbox whose id = meetingdate1 but datepicker functionality not getting in other textboxes whose id = meetingdate2, id= meetingdate3 and so on...
the jquery code is:
$("#addButton").live("click", function () {
if(counter_ldates>10){
alert("Only 10 dates allowed");
return false;
}
var newTextBoxDiv = $(document.createElement('div')).attr("id", 'LdateDiv' + counter_ldates);
newTextBoxDiv.html('<label>Date #'+ counter_ldates + ' : </label>' +
'<input type="text" name="meetingdate' + counter_ldates +
'" id="meetingdate' + counter_ldates +
'" class="ldatestextbox" value="" style="width: 75px" >');
newTextBoxDiv.appendTo("#LdatesGroup");
counter_ldates++;
$('#ldates_cnt').attr('value', counter_ldates);
});
$( "#meetingdate1" ).datepicker();
$( "#meetingdate2" ).datepicker();
$( "#meetingdate3" ).datepicker();
$( "#meetingdate4" ).datepicker();
$( "#meetingdate5" ).datepicker();
how can i solve this issue of datepicker? | 0 |
1,353,215 | 08/30/2009 06:16:34 | 162,393 | 08/25/2009 01:38:42 | 3 | 1 | javascript appendChild is causing document write? favelet | The following favelet in IE is causing something similar to a document.write which is displaying [object]?
I am attempting to dynamically add a frame to get javascript variables from another page to autopopulate a form. I cannot edit the source this must execute from a favorite or bookmark.
javascript:
var newFrame = document.createElement("frame");
newFrame.id = "externalFrame";
newFrame.name = "externalFrame";
newFrame.src = "listparent.jsp?listType=all";
var m = document.getElementById('mainframeset');
m.appendChild(newFrame);
The html page looks like this
<html>
<frameset id=mainframeset cols="*,0">
<frame src="issue.jsp" name="editor">
<frame src="adminPoller.jsp" name="poller" scrolling=no>
</frameset>
</html>
Thank you! | document.write | appendchild | bookmarklet | frameset | null | null | open | javascript appendChild is causing document write? favelet
===
The following favelet in IE is causing something similar to a document.write which is displaying [object]?
I am attempting to dynamically add a frame to get javascript variables from another page to autopopulate a form. I cannot edit the source this must execute from a favorite or bookmark.
javascript:
var newFrame = document.createElement("frame");
newFrame.id = "externalFrame";
newFrame.name = "externalFrame";
newFrame.src = "listparent.jsp?listType=all";
var m = document.getElementById('mainframeset');
m.appendChild(newFrame);
The html page looks like this
<html>
<frameset id=mainframeset cols="*,0">
<frame src="issue.jsp" name="editor">
<frame src="adminPoller.jsp" name="poller" scrolling=no>
</frameset>
</html>
Thank you! | 0 |
10,819,755 | 05/30/2012 15:48:14 | 1,396,465 | 05/15/2012 14:45:13 | 105 | 15 | Yum installation directory | So I want to install a package using yum. The repo is not a default, and so I'm going to use rpm to install this repo. Following that, I'd like to install this package in a specific folder. Very similar to the prefix option in configure. Is that possible?
Any help would be greatly appreciated. | linux | yum | null | null | null | 05/31/2012 13:52:26 | off topic | Yum installation directory
===
So I want to install a package using yum. The repo is not a default, and so I'm going to use rpm to install this repo. Following that, I'd like to install this package in a specific folder. Very similar to the prefix option in configure. Is that possible?
Any help would be greatly appreciated. | 2 |
4,989,101 | 02/14/2011 05:28:10 | 615,728 | 02/14/2011 05:00:46 | 1 | 0 | Hi, I could really use some help...on C++ factory pattern | //////////MY FIRST CLASS GUITAR///////////////
class Guitar {
private: std::string _name;
protected: mutable std::auto_ptr< HeadStock > _HeadStock;
protected: mutable std::auto_ptr< NeckStrap > _NeckStrap;
protected: mutable std::vector< Bridge* > _Bridge;
protected: mutable std::auto_ptr< Strings > _Strings;
protected: mutable std::auto_ptr< Switches > _Switches;
protected: mutable std::auto_ptr< GuitarBody > _GuitarBody;
public: virtual void prepare() const = 0;
private: Guitar( const Guitar& ); // Disable copy constructor
private: void operator=( const Guitar& ); // Disable assignment operator
protected: Guitar() {
}
public: virtual ~Guitar()
{
for( std::vector< Bridge* >::iterator iterator = _Bridge.begin();
_Bridge.end() != iterator; ++iterator ) {delete *iterator;
}
_Bridge.clear();
}
public: virtual void bake() const {
std::cout << "Bake for 25 minutes at 350" << std::endl;
}
public: virtual void cut() const {
std::cout << "Cutting the pizza into diagonal slices" << std::endl;
}
public: virtual void box() const {
std::cout << "Place pizza in official PizzaStore box" << std::endl;
}
public: void setName( std::string name) {
_name = name;
}
public: std::string getName() const {
return _name;
}
public: std::string toString() const {
std::stringstream value;
value << "---- " << _name.c_str() << " ----" << std::endl;
if( _HeadStock.get() != 0 ) {
value << _HeadStock->toString();
value << std::endl;
}
if( _NeckStrap.get() != 0 ) {
value << _NeckStrap->toString();
value << std::endl;
}
if( _Strings.get() != 0 ) {
value << _Strings->toString();
value << std::endl;
}
if( _GuitarBody.get() != 0 ) {
value << _GuitarBody->toString();
value << std::endl;
}
if( _Switches.get() != 0 ) {
value << _Switches->toString();
value << std::endl;
}
if( _Bridge.size() != 0 )
{
for( std::vector< Bridge* >::iterator iterator = _Bridge.begin
();_Bridge.end() != iterator; ++iterator )
{
value << ( *iterator )->toString() << ", ";
}
value << std::endl;
}
return value.str();
}
};
////////// CLASS GUITARSTORE ///////////////
class GuitarStore {
protected: GuitarStore() {
}
public: virtual ~GuitarStore() = 0 {
}
public: std::auto_ptr< Guitar > orderGuitar( std::string type ) const {
std::auto_ptr< Guitar > guitar( createGuitar( type ) );
std::cout << "--- Making a " << guitar->getName() << " ---" << std::endl;
guitar->prepare();
guitar->bake();
guitar->cut();
guitar->box();
return guitar;
}
public: virtual std::auto_ptr< Guitar > createGuitar( std::string type ) const = 0;
};
////////// CLASS GUITARCOMPONENT FACTORY ///////////////
class GuitarComponentFactory {
public: virtual HeadStock* createHeadStock() const = 0;
public: virtual NeckStrap* createNeckStrap() const = 0;
public: virtual Strings* createStrings() const = 0;
public: virtual std::vector< Bridge* > createBridge() const = 0;
public: virtual Switches* createSwitches() const = 0;
public: virtual GuitarBody* createGuitarBody() const = 0;
public: virtual ~GuitarComponentFactory() = 0 {
}};
////////// CLASS ELECTRIC GUITAR ///////////////
class ElectricGuitar : public Guitar {
private: mutable std::auto_ptr< GuitarComponentFactory > _ingredientFactory;
public: explicit ElectricGuitar( GuitarComponentFactory* ingredientFactory ) :
_ingredientFactory( ingredientFactory ) { assert( ingredientFactory );
}
public: void prepare() const {
std::cout << "Preparing " << getName().c_str() << std::endl;
_HeadStock = std::auto_ptr< HeadStock>( _ingredientFactory->createHeadStock() );
_NeckStrap = std::auto_ptr< NeckStrap>( _ingredientFactory->createNeckStrap() );
_Strings = std::auto_ptr< Strings>( _ingredientFactory->createStrings() );
_Switches= std::auto_ptr< Switches>( _ingredientFactory->createSwitches() );
if( _Bridge.empty() )
_Bridge = _ingredientFactory->createBridge();
}
};
////////// CLASS ELECTRIC GUITAR COMPONENT FACTORY ///////////////
class ElectricGuitarComponentFactory : public GuitarComponentFactory {
public: HeadStock* createHeadStock() const {
return new AngledHeadStock();
}
public: NeckStrap* createNeckStrap() const {
return new LeatherNeckStrap();
}
public: Strings* createStrings() const {
return new NylonStrings();
}
public: std::vector< Bridge* > createBridge() const {
std::vector< Bridge* > bridge;
bridge.push_back( new ChromeBridge() );
return bridge;
}
public: Switches* createSwithes() const {
return new SPDT_Switches();
}
public: GuitarBody* createGuitarBody() const {
return new HollowGuitarBody();
}
};
////////// CLASS ELECTRIC GUITAR STORE ///////////////
class ElectricGuitarStore : public GuitarStore
{
public: std::auto_ptr< Guitar > createGuitar( std::string item ) const{
std::auto_ptr< Guitar > guitar( 0 );
GuitarComponentFactory* ingredientFactory = new ElectricGuitarComponentFactory();
if( item.compare( "Electric" ) == 0 ) {
guitar = std::auto_ptr< Guitar >( new ElectricGuitar( ingredientFactory ) );
guitar->setName( "Electric GuitarBody" );
return guitar;
}
};
I GET THE FOLLOWING ERROR....
1>c:\users\brian\documents\visual studio 2010\projects\cst276lab_3\project3_main.cpp(37): fatal error C1075: end of file found before the left brace '{' at 'c:\users\brian\documents\visual studio 2010\projects\cst276lab_3\guitar.hpp(365)' was matched
ANYONES HELP WOULD BE GREATLY APPRECIATED
THX
| c++ | design-patterns | factory-pattern | null | null | 02/14/2011 07:00:17 | not a real question | Hi, I could really use some help...on C++ factory pattern
===
//////////MY FIRST CLASS GUITAR///////////////
class Guitar {
private: std::string _name;
protected: mutable std::auto_ptr< HeadStock > _HeadStock;
protected: mutable std::auto_ptr< NeckStrap > _NeckStrap;
protected: mutable std::vector< Bridge* > _Bridge;
protected: mutable std::auto_ptr< Strings > _Strings;
protected: mutable std::auto_ptr< Switches > _Switches;
protected: mutable std::auto_ptr< GuitarBody > _GuitarBody;
public: virtual void prepare() const = 0;
private: Guitar( const Guitar& ); // Disable copy constructor
private: void operator=( const Guitar& ); // Disable assignment operator
protected: Guitar() {
}
public: virtual ~Guitar()
{
for( std::vector< Bridge* >::iterator iterator = _Bridge.begin();
_Bridge.end() != iterator; ++iterator ) {delete *iterator;
}
_Bridge.clear();
}
public: virtual void bake() const {
std::cout << "Bake for 25 minutes at 350" << std::endl;
}
public: virtual void cut() const {
std::cout << "Cutting the pizza into diagonal slices" << std::endl;
}
public: virtual void box() const {
std::cout << "Place pizza in official PizzaStore box" << std::endl;
}
public: void setName( std::string name) {
_name = name;
}
public: std::string getName() const {
return _name;
}
public: std::string toString() const {
std::stringstream value;
value << "---- " << _name.c_str() << " ----" << std::endl;
if( _HeadStock.get() != 0 ) {
value << _HeadStock->toString();
value << std::endl;
}
if( _NeckStrap.get() != 0 ) {
value << _NeckStrap->toString();
value << std::endl;
}
if( _Strings.get() != 0 ) {
value << _Strings->toString();
value << std::endl;
}
if( _GuitarBody.get() != 0 ) {
value << _GuitarBody->toString();
value << std::endl;
}
if( _Switches.get() != 0 ) {
value << _Switches->toString();
value << std::endl;
}
if( _Bridge.size() != 0 )
{
for( std::vector< Bridge* >::iterator iterator = _Bridge.begin
();_Bridge.end() != iterator; ++iterator )
{
value << ( *iterator )->toString() << ", ";
}
value << std::endl;
}
return value.str();
}
};
////////// CLASS GUITARSTORE ///////////////
class GuitarStore {
protected: GuitarStore() {
}
public: virtual ~GuitarStore() = 0 {
}
public: std::auto_ptr< Guitar > orderGuitar( std::string type ) const {
std::auto_ptr< Guitar > guitar( createGuitar( type ) );
std::cout << "--- Making a " << guitar->getName() << " ---" << std::endl;
guitar->prepare();
guitar->bake();
guitar->cut();
guitar->box();
return guitar;
}
public: virtual std::auto_ptr< Guitar > createGuitar( std::string type ) const = 0;
};
////////// CLASS GUITARCOMPONENT FACTORY ///////////////
class GuitarComponentFactory {
public: virtual HeadStock* createHeadStock() const = 0;
public: virtual NeckStrap* createNeckStrap() const = 0;
public: virtual Strings* createStrings() const = 0;
public: virtual std::vector< Bridge* > createBridge() const = 0;
public: virtual Switches* createSwitches() const = 0;
public: virtual GuitarBody* createGuitarBody() const = 0;
public: virtual ~GuitarComponentFactory() = 0 {
}};
////////// CLASS ELECTRIC GUITAR ///////////////
class ElectricGuitar : public Guitar {
private: mutable std::auto_ptr< GuitarComponentFactory > _ingredientFactory;
public: explicit ElectricGuitar( GuitarComponentFactory* ingredientFactory ) :
_ingredientFactory( ingredientFactory ) { assert( ingredientFactory );
}
public: void prepare() const {
std::cout << "Preparing " << getName().c_str() << std::endl;
_HeadStock = std::auto_ptr< HeadStock>( _ingredientFactory->createHeadStock() );
_NeckStrap = std::auto_ptr< NeckStrap>( _ingredientFactory->createNeckStrap() );
_Strings = std::auto_ptr< Strings>( _ingredientFactory->createStrings() );
_Switches= std::auto_ptr< Switches>( _ingredientFactory->createSwitches() );
if( _Bridge.empty() )
_Bridge = _ingredientFactory->createBridge();
}
};
////////// CLASS ELECTRIC GUITAR COMPONENT FACTORY ///////////////
class ElectricGuitarComponentFactory : public GuitarComponentFactory {
public: HeadStock* createHeadStock() const {
return new AngledHeadStock();
}
public: NeckStrap* createNeckStrap() const {
return new LeatherNeckStrap();
}
public: Strings* createStrings() const {
return new NylonStrings();
}
public: std::vector< Bridge* > createBridge() const {
std::vector< Bridge* > bridge;
bridge.push_back( new ChromeBridge() );
return bridge;
}
public: Switches* createSwithes() const {
return new SPDT_Switches();
}
public: GuitarBody* createGuitarBody() const {
return new HollowGuitarBody();
}
};
////////// CLASS ELECTRIC GUITAR STORE ///////////////
class ElectricGuitarStore : public GuitarStore
{
public: std::auto_ptr< Guitar > createGuitar( std::string item ) const{
std::auto_ptr< Guitar > guitar( 0 );
GuitarComponentFactory* ingredientFactory = new ElectricGuitarComponentFactory();
if( item.compare( "Electric" ) == 0 ) {
guitar = std::auto_ptr< Guitar >( new ElectricGuitar( ingredientFactory ) );
guitar->setName( "Electric GuitarBody" );
return guitar;
}
};
I GET THE FOLLOWING ERROR....
1>c:\users\brian\documents\visual studio 2010\projects\cst276lab_3\project3_main.cpp(37): fatal error C1075: end of file found before the left brace '{' at 'c:\users\brian\documents\visual studio 2010\projects\cst276lab_3\guitar.hpp(365)' was matched
ANYONES HELP WOULD BE GREATLY APPRECIATED
THX
| 1 |
7,464,556 | 09/18/2011 21:20:43 | 11,470 | 09/16/2008 08:16:25 | 187 | 9 | Using Django Admin Tables in user views? | Is it possibe to use the sortable, searchable tables that admin users get from a non-admin/staff view?
I'd like to be able to make use of it to display data to users without having to install a 3rd party app like django_tables2, dont repeat yourself and all that ... | django | django-admin | null | null | null | null | open | Using Django Admin Tables in user views?
===
Is it possibe to use the sortable, searchable tables that admin users get from a non-admin/staff view?
I'd like to be able to make use of it to display data to users without having to install a 3rd party app like django_tables2, dont repeat yourself and all that ... | 0 |
9,756,392 | 03/18/2012 06:02:03 | 135,322 | 07/08/2009 23:25:58 | 74 | 1 | Python Regex to match YAML Front Matter | I'm having trouble crafting a regex to match YAML Front Matter
This is the front matter I was trying to match:
---
name: me
title: test
cpu: 1
---
This is what I thought would work:
re.search( r'^(---)(.*)(---)$', content, re.MULTILINE)
Any help would be greatly appreciated. | python | regex | null | null | null | null | open | Python Regex to match YAML Front Matter
===
I'm having trouble crafting a regex to match YAML Front Matter
This is the front matter I was trying to match:
---
name: me
title: test
cpu: 1
---
This is what I thought would work:
re.search( r'^(---)(.*)(---)$', content, re.MULTILINE)
Any help would be greatly appreciated. | 0 |
2,834,869 | 05/14/2010 14:25:35 | 197,241 | 10/27/2009 11:00:29 | 159 | 0 | help with this query.. | $test2=mysql_query("SELECT min(substr(status,1) FROM railways");
while($test_array1=mysql_fetch_array($test2)){
echo "<pre>";
print_r($test_array1);
echo "</pre>";
}
what is the correct form of this query...need to get the min value from the table itself.. | mysql | null | null | null | null | null | open | help with this query..
===
$test2=mysql_query("SELECT min(substr(status,1) FROM railways");
while($test_array1=mysql_fetch_array($test2)){
echo "<pre>";
print_r($test_array1);
echo "</pre>";
}
what is the correct form of this query...need to get the min value from the table itself.. | 0 |
11,180,923 | 06/24/2012 20:21:10 | 862,806 | 07/26/2011 05:33:20 | 25 | 0 | Looking for how to develop this idea | I'm going to be developing a game which will be simulating an environment of people interacting with each other and the goal of the game will be to become to rise to the top by doing activities, buying weapons, items, etc.. There will be a lot of names for the items and simulated people, and i was wondering how i could store and retrieve such information. Could i use something like XML or any other related language to do it? I will be developing this using java btw
Thanks. | java | null | null | null | null | 06/24/2012 20:32:15 | not a real question | Looking for how to develop this idea
===
I'm going to be developing a game which will be simulating an environment of people interacting with each other and the goal of the game will be to become to rise to the top by doing activities, buying weapons, items, etc.. There will be a lot of names for the items and simulated people, and i was wondering how i could store and retrieve such information. Could i use something like XML or any other related language to do it? I will be developing this using java btw
Thanks. | 1 |
6,710,044 | 07/15/2011 16:14:30 | 277,286 | 02/19/2010 20:18:10 | 8 | 0 | My wordpress site doesn't render correctly on larger monitors. | I've been working on [this site][1] for the last couple of days. Everything was going perfectly well on my 13" laptop - and even on the 17" PC laptop I checked it on. However, the magazine owners looked at it on a 21" screen earlier today and apparently it looks radically different. I just checked it on a monitor in an Internet cafe, and it appears they have a point. Can anyone help?
[1]: http://shawati.ae/ | wordpress | wordpress-theming | null | null | null | null | open | My wordpress site doesn't render correctly on larger monitors.
===
I've been working on [this site][1] for the last couple of days. Everything was going perfectly well on my 13" laptop - and even on the 17" PC laptop I checked it on. However, the magazine owners looked at it on a 21" screen earlier today and apparently it looks radically different. I just checked it on a monitor in an Internet cafe, and it appears they have a point. Can anyone help?
[1]: http://shawati.ae/ | 0 |
2,503,376 | 03/23/2010 20:31:53 | 108,007 | 05/15/2009 23:45:00 | 1,119 | 39 | Help with C puzzle | I found <a href="http://www.gowrikumar.com/c/index.html">a site</a> with some complicated C puzzles. Right now I'm dealing with this:
>The following is a piece of C code, whose intention was to print a minus sign 20 times. But you can notice that, it doesn't work.
#include <stdio.h>
int main()
{
int i;
int n = 20;
for( i = 0; i < n; i-- )
printf("-");
return 0;
}
>Well fixing the above code is straight-forward. To make the problem interesting, you have to fix the above code, by changing exactly one character. There are three known solutions. See if you can get all those three.
I cannot figure out how to solve. I know that it can be fixed by changing `--` to `++`, but I can't figure out what single character to change to make it work. | c | puzzle | null | null | null | 01/02/2012 03:37:11 | not constructive | Help with C puzzle
===
I found <a href="http://www.gowrikumar.com/c/index.html">a site</a> with some complicated C puzzles. Right now I'm dealing with this:
>The following is a piece of C code, whose intention was to print a minus sign 20 times. But you can notice that, it doesn't work.
#include <stdio.h>
int main()
{
int i;
int n = 20;
for( i = 0; i < n; i-- )
printf("-");
return 0;
}
>Well fixing the above code is straight-forward. To make the problem interesting, you have to fix the above code, by changing exactly one character. There are three known solutions. See if you can get all those three.
I cannot figure out how to solve. I know that it can be fixed by changing `--` to `++`, but I can't figure out what single character to change to make it work. | 4 |
7,355,828 | 09/08/2011 23:57:32 | 877,593 | 08/03/2011 23:14:28 | 21 | 0 | Codeigniter or Wordpress? | Yes, I am aware one is a framework and the other a CMS.
However, I am a one man team that develops projects/websites for myself and I have a limited amount of time to get these projects off the ground, so speed is crucial.
Basically I am looking for the easiest and fastest method for creating web apps without being limited on features.
Would it be best/fastest to learn Codeigniter or to build off of Wordpress and develop my own themes/plugins? Possibly another option that would be more viable?
I deal a lot with video/photo media and high traffic websites.
Thanks! | wordpress | codeigniter | null | null | null | 09/12/2011 03:54:08 | off topic | Codeigniter or Wordpress?
===
Yes, I am aware one is a framework and the other a CMS.
However, I am a one man team that develops projects/websites for myself and I have a limited amount of time to get these projects off the ground, so speed is crucial.
Basically I am looking for the easiest and fastest method for creating web apps without being limited on features.
Would it be best/fastest to learn Codeigniter or to build off of Wordpress and develop my own themes/plugins? Possibly another option that would be more viable?
I deal a lot with video/photo media and high traffic websites.
Thanks! | 2 |
7,861,271 | 10/22/2011 17:19:13 | 699,944 | 04/09/2011 12:38:57 | 39 | 2 | how to hide table header, and keep it hidden after insert/delete | I found out, that UITableView modify contentSize property and I can't set it by myself.
![Stack Trace][1]
[1]: http://i.stack.imgur.com/blOOU.png
This is my call stack. After this call contentSize is modified. I don't wan't it, because of that I want to hide header, so I need to scroll view a little bit down, and to make it I set contentSize little higher than visible to be able to scroll down a bit.
Any ideas how to hide table header, and keep it hidden after insertion/deletion ?
I'm using NSFetchedResultsController to fetch data with CoreData. | ios | uitableview | core-data | uiscrollview | null | null | open | how to hide table header, and keep it hidden after insert/delete
===
I found out, that UITableView modify contentSize property and I can't set it by myself.
![Stack Trace][1]
[1]: http://i.stack.imgur.com/blOOU.png
This is my call stack. After this call contentSize is modified. I don't wan't it, because of that I want to hide header, so I need to scroll view a little bit down, and to make it I set contentSize little higher than visible to be able to scroll down a bit.
Any ideas how to hide table header, and keep it hidden after insertion/deletion ?
I'm using NSFetchedResultsController to fetch data with CoreData. | 0 |
5,044,392 | 02/18/2011 17:17:50 | 623,431 | 02/18/2011 16:06:05 | 1 | 0 | shell programming | tell me the shell program to print home directory of each user .user details are stored in /etc/passwd | unix | null | null | null | null | 02/18/2011 17:21:34 | not a real question | shell programming
===
tell me the shell program to print home directory of each user .user details are stored in /etc/passwd | 1 |
2,470,739 | 03/18/2010 14:54:03 | 109,104 | 05/19/2009 01:18:13 | 98 | 0 | Easiest/Best Way to Learn the x86 Instruction Set? | I would like to learn the x86 Instruction Set Architecture. I don't meaning learning an assembly for x86. I want to understand the machine code baby.
The reason is that I would like to write an assembler for x86. Then I want to write a compiler that compiles to that assembly.
I know that there are the <a href="http://www.intel.com/products/processor/manuals/">Intel manuals</a> and AMD manuals that cover the x86 instruction set. But those are very large and dense.
I'm wondering if there is a more approachable (possibly tutorial) approach to learning the x86 instruction set architecture. | 80x86 | x86 | null | null | null | 04/20/2012 11:10:36 | not constructive | Easiest/Best Way to Learn the x86 Instruction Set?
===
I would like to learn the x86 Instruction Set Architecture. I don't meaning learning an assembly for x86. I want to understand the machine code baby.
The reason is that I would like to write an assembler for x86. Then I want to write a compiler that compiles to that assembly.
I know that there are the <a href="http://www.intel.com/products/processor/manuals/">Intel manuals</a> and AMD manuals that cover the x86 instruction set. But those are very large and dense.
I'm wondering if there is a more approachable (possibly tutorial) approach to learning the x86 instruction set architecture. | 4 |
5,881,028 | 05/04/2011 09:03:44 | 168,179 | 09/03/2009 21:38:06 | 631 | 32 | What is the default JsonConverter used in JSON.NET? | I'm trying to write a custom JsonConverter for cases where a person subclasses a list or collection, but then adds extra properties to the subclass (see <a href="http://stackoverflow.com/q/5863496/168179">**here**</a>). The current implementation of JSON.NET just changes the list into an array of child objects and ignores all of the added properties. So I want to write a new JsonConverter that treats the object as if it _wasn't_ a List and to just serialize everything else as normal, but then to add a new property in the serialization called '_Items' where the actual array of data is stored.
Now I've already written a class that does exactly this for our specific List subclass, but I had to manually specify all the properties one-by-one. But if I could write a converter that treats this just as a normal object, then manually handle the items, I'd be golden. I don't even care if I end up duplicating half of another class (or even more!) but I'd love to make a reusable converter for these cases. However, as I said, I can't find the default converter to start from.
So... anyone know where that is? | source-code | json.net | base-class | default-implementation | null | null | open | What is the default JsonConverter used in JSON.NET?
===
I'm trying to write a custom JsonConverter for cases where a person subclasses a list or collection, but then adds extra properties to the subclass (see <a href="http://stackoverflow.com/q/5863496/168179">**here**</a>). The current implementation of JSON.NET just changes the list into an array of child objects and ignores all of the added properties. So I want to write a new JsonConverter that treats the object as if it _wasn't_ a List and to just serialize everything else as normal, but then to add a new property in the serialization called '_Items' where the actual array of data is stored.
Now I've already written a class that does exactly this for our specific List subclass, but I had to manually specify all the properties one-by-one. But if I could write a converter that treats this just as a normal object, then manually handle the items, I'd be golden. I don't even care if I end up duplicating half of another class (or even more!) but I'd love to make a reusable converter for these cases. However, as I said, I can't find the default converter to start from.
So... anyone know where that is? | 0 |
10,368,937 | 04/29/2012 01:17:59 | 753,603 | 05/14/2011 12:33:29 | 2,871 | 100 | Open source code licensing guidance | What is the difference between,
- MIT licence
- GPLv2
- GNU licence
As I tried to read those licensing agreements but I could not understand those legal obligations. I wanted know wether I can use a plugin which licence their source code under GPLv2 licence. I am developing a website for a client and he might make this application commercial, However I have asked him for a permission to give full credit on their website for the source code I am using.
Is it okay to use GPLv2 licensed code on commercial website? we are okay to give full credit for that plugin. | jquery | plugins | open-source | licensing | gpl | 04/29/2012 08:41:27 | off topic | Open source code licensing guidance
===
What is the difference between,
- MIT licence
- GPLv2
- GNU licence
As I tried to read those licensing agreements but I could not understand those legal obligations. I wanted know wether I can use a plugin which licence their source code under GPLv2 licence. I am developing a website for a client and he might make this application commercial, However I have asked him for a permission to give full credit on their website for the source code I am using.
Is it okay to use GPLv2 licensed code on commercial website? we are okay to give full credit for that plugin. | 2 |
8,461,438 | 12/11/2011 02:08:50 | 755,548 | 05/16/2011 11:31:16 | 13 | 0 | Print list of binary permutations | What I am trying to do is print all the possibilities of a binary number. In other words:
0001
0010
0100
1000
..etc
To be honest, I have no idea of where to even start with this (other than I figure I'd need to use a loop, and probably an array) so any pointers in the right direction would be appreciated. | java | algorithm | null | null | null | null | open | Print list of binary permutations
===
What I am trying to do is print all the possibilities of a binary number. In other words:
0001
0010
0100
1000
..etc
To be honest, I have no idea of where to even start with this (other than I figure I'd need to use a loop, and probably an array) so any pointers in the right direction would be appreciated. | 0 |
2,243,674 | 02/11/2010 10:09:47 | 55,366 | 11/12/2008 20:15:20 | 101 | 6 | Simulate a device driver crash in linux. Have python reload it. | I have a web camera running in Linux using the uvcvideo module. And I'm using a python application to access the web camera and display the image.
I want the python program to handle it if the web camera for some reason don't work anymore. Have tested with just unloading the module. Works fine if i just unload the module before I run the python code, but if force it to unload in use, I get the following feedback.
VIDIOC_DQBUF: Inappropriate ioctl for device
And if I kill the python code, and restart it the whole machine freezes.
The code I'm trying to run is
import pygame
import Image
from pygame.locals import *
import sys
import time, os
import opencv
from opencv import highgui
camera = highgui.cvCreateCameraCapture(0)
fps = 10.0
pygame.init()
window = pygame.display.set_mode((640,480))
pygame.display.set_caption("WebCam Demo")
screen = pygame.display.get_surface()
while True:
events = pygame.event.get()
for event in events:
if event.type == QUIT or event.type == KEYDOWN:
sys.exit(0)
while True:
try:
ima = highgui.cvQueryFrame(camera)
im = opencv.adaptors.Ipl2PIL(ima)
break;
except TypeError:
print 'No camera'
os.system('sudo modprobe uvcvideo')
time.sleep(1)
camera = highgui.cvCreateCameraCapture(0)
pg_img = pygame.image.frombuffer(im.tostring(), im.size, im.mode)
screen.blit(pg_img, (0,0))
pygame.display.flip()
pygame.time.delay(int(1000 * 1.0/fps))
It's a modified version of http://www.jperla.com/blog/2007/09/26/capturing-frames-from-a-webcam-on-linux/ It's using openvc version 1.x and not 2.x.
Any idea on how to make this work? | python | linux | null | null | null | null | open | Simulate a device driver crash in linux. Have python reload it.
===
I have a web camera running in Linux using the uvcvideo module. And I'm using a python application to access the web camera and display the image.
I want the python program to handle it if the web camera for some reason don't work anymore. Have tested with just unloading the module. Works fine if i just unload the module before I run the python code, but if force it to unload in use, I get the following feedback.
VIDIOC_DQBUF: Inappropriate ioctl for device
And if I kill the python code, and restart it the whole machine freezes.
The code I'm trying to run is
import pygame
import Image
from pygame.locals import *
import sys
import time, os
import opencv
from opencv import highgui
camera = highgui.cvCreateCameraCapture(0)
fps = 10.0
pygame.init()
window = pygame.display.set_mode((640,480))
pygame.display.set_caption("WebCam Demo")
screen = pygame.display.get_surface()
while True:
events = pygame.event.get()
for event in events:
if event.type == QUIT or event.type == KEYDOWN:
sys.exit(0)
while True:
try:
ima = highgui.cvQueryFrame(camera)
im = opencv.adaptors.Ipl2PIL(ima)
break;
except TypeError:
print 'No camera'
os.system('sudo modprobe uvcvideo')
time.sleep(1)
camera = highgui.cvCreateCameraCapture(0)
pg_img = pygame.image.frombuffer(im.tostring(), im.size, im.mode)
screen.blit(pg_img, (0,0))
pygame.display.flip()
pygame.time.delay(int(1000 * 1.0/fps))
It's a modified version of http://www.jperla.com/blog/2007/09/26/capturing-frames-from-a-webcam-on-linux/ It's using openvc version 1.x and not 2.x.
Any idea on how to make this work? | 0 |
8,406,061 | 12/06/2011 20:03:20 | 252,000 | 01/16/2010 02:41:04 | 34,194 | 652 | looking for a tutorial on representation of numbers | I remember reading a tutorial a couple of years ago where concepts like twos complement and floating point numbers were explained with lots of drawings, involving cute animals. I think it was a diploma thesis or something at some University, but I simply cannot find it anymore. I'd be glad for a link. Thanks! | numbers | floating-point | university | representation | twos-complement | 12/10/2011 02:32:38 | not constructive | looking for a tutorial on representation of numbers
===
I remember reading a tutorial a couple of years ago where concepts like twos complement and floating point numbers were explained with lots of drawings, involving cute animals. I think it was a diploma thesis or something at some University, but I simply cannot find it anymore. I'd be glad for a link. Thanks! | 4 |
4,060,179 | 10/30/2010 18:55:54 | 492,334 | 10/30/2010 18:55:54 | 1 | 0 | some IE6 versions crashes WHEN people visit MY SITE | My website is html/css website. i did not use tables at all.
There is a version of IE6 that crashes when someone visit my site.,
could any one help me?
address:
http://www.alarab.net
Thanks | css | ie6-bug | null | null | null | 10/31/2010 18:42:22 | too localized | some IE6 versions crashes WHEN people visit MY SITE
===
My website is html/css website. i did not use tables at all.
There is a version of IE6 that crashes when someone visit my site.,
could any one help me?
address:
http://www.alarab.net
Thanks | 3 |
1,748,501 | 11/17/2009 12:21:43 | 168,047 | 09/03/2009 17:47:55 | 13 | 0 | a basic javascript class and instance using jquery "$(this)" for XML parser | I am (slowly) writing an XML parser for some "site definition" files that will drive a website. Many of the elements will be parsed in the same manner and I won't necessarily need to keep the values for each.
[The XML][1]
[The parser so far][2]
My question is actually pretty simple: How can I use jquery manipulators in an class function? How can I pass $(this)? I know that it sometimes refers to a DOM object and sometimes the jQuery object, but am a bit hazy.
For my function:
function parseXML(xml) {
$("book, site", xml).children().each(function() {
var label = $(this).get(0).tagName;
var text = $(this).text();
var key = toCamelCase(label);
if ((key in siteData) && (text != -1)){
if (isArray(siteData[key]))
{
$(this).children().each(function (){
var childLabel = $(this).get(0).tagName;
var childText = $(this).text();
var childKey = toCamelCase(childLabel);
if(isArray(siteData[key][childKey]))
{
siteData[key][childKey].push(childText);
}
else {
siteData[key].push(childText);
}
});
}
else
{
siteData[key] = text;
}
};
});
}
});
I want to place
var label = $(this).get(0).tagName; var text = $(this).text(); var key = toCamelCase(label);
in a class, so I can do something like
var child = new Element(); and var subchild = new Element();
and then use `child.label , child.text and child.key`...
But again, not sure how to use the jquery methods with these... I have more nodes to process and I don't want to keep doing stuff like `var label = $(this).get(0).tagName; and then var childLabel = $(this).get(0).tagName;`
Thanks.
[1]: http://f1shw1ck.com/jquery_sandbox/site_definition.xml
[2]: http://f1shw1ck.com/jquery_sandbox/test.html | jquery | javascript | this | xml-parsing | class | null | open | a basic javascript class and instance using jquery "$(this)" for XML parser
===
I am (slowly) writing an XML parser for some "site definition" files that will drive a website. Many of the elements will be parsed in the same manner and I won't necessarily need to keep the values for each.
[The XML][1]
[The parser so far][2]
My question is actually pretty simple: How can I use jquery manipulators in an class function? How can I pass $(this)? I know that it sometimes refers to a DOM object and sometimes the jQuery object, but am a bit hazy.
For my function:
function parseXML(xml) {
$("book, site", xml).children().each(function() {
var label = $(this).get(0).tagName;
var text = $(this).text();
var key = toCamelCase(label);
if ((key in siteData) && (text != -1)){
if (isArray(siteData[key]))
{
$(this).children().each(function (){
var childLabel = $(this).get(0).tagName;
var childText = $(this).text();
var childKey = toCamelCase(childLabel);
if(isArray(siteData[key][childKey]))
{
siteData[key][childKey].push(childText);
}
else {
siteData[key].push(childText);
}
});
}
else
{
siteData[key] = text;
}
};
});
}
});
I want to place
var label = $(this).get(0).tagName; var text = $(this).text(); var key = toCamelCase(label);
in a class, so I can do something like
var child = new Element(); and var subchild = new Element();
and then use `child.label , child.text and child.key`...
But again, not sure how to use the jquery methods with these... I have more nodes to process and I don't want to keep doing stuff like `var label = $(this).get(0).tagName; and then var childLabel = $(this).get(0).tagName;`
Thanks.
[1]: http://f1shw1ck.com/jquery_sandbox/site_definition.xml
[2]: http://f1shw1ck.com/jquery_sandbox/test.html | 0 |
917,140 | 05/27/2009 17:55:47 | 100,988 | 05/04/2009 16:32:39 | 199 | 21 | Log every time an exception is handled | I have noticed a discrepancy in views on logging and wanted to provide a poll on this issue to the SO community. C.f. a [similar question][1] but not as a poll.
Poll: Should exception handlers **ALWAYS** write to the log any time an exception is caught and handled?
Please provide your rationale as a comment under either answer.
Note: This is not a question about how to handle the exception, or on how to re-throw the exception.
[1]: http://stackoverflow.com/questions/95547/should-i-catch-exceptions-only-to-log-them | polls | exception | language-agnostic | null | null | 05/08/2012 12:53:42 | not constructive | Log every time an exception is handled
===
I have noticed a discrepancy in views on logging and wanted to provide a poll on this issue to the SO community. C.f. a [similar question][1] but not as a poll.
Poll: Should exception handlers **ALWAYS** write to the log any time an exception is caught and handled?
Please provide your rationale as a comment under either answer.
Note: This is not a question about how to handle the exception, or on how to re-throw the exception.
[1]: http://stackoverflow.com/questions/95547/should-i-catch-exceptions-only-to-log-them | 4 |
11,437,883 | 07/11/2012 17:13:16 | 1,336,218 | 04/16/2012 11:48:40 | 35 | 1 | Complete status Form C# | I made a form that looks like this:
![form][1]
i need to put a "complete status" in this form. So when the process is done and i get the result, it shows in this form the status "complete" so i know that it's done.
Can someone help me how to do that?
The code for my form is the following:
public partial class MDG_Form : Form
{
EA.Repository modelRepository;
private NeatDiagram.CoreDiagram.MDGBuilder diagramBuilder;
public MDG_Form(EA.Repository repository)
{
InitializeComponent();
this.modelRepository = repository;
}
private void button1_Click(object sender, EventArgs e)
{
String typeOfDiagram = "";
if (radioButton1.Checked)
typeOfDiagram = radioButton1.Text;
else if (radioButton2.Checked)
typeOfDiagram = radioButton2.Text;
else if (radioButton3.Checked)
typeOfDiagram = radioButton3.Text;
else if (radioButton4.Checked)
typeOfDiagram = radioButton4.Text;
//Creo un'istanza di MDGBuilder
diagramBuilder = new CoreDiagram.MDGBuilder();
diagramBuilder.createDiagram(typeOfDiagram, modelRepository);
//Close();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
[1]: http://i.stack.imgur.com/pzT8m.jpg | c# | forms | complete | null | null | 07/12/2012 17:21:11 | too localized | Complete status Form C#
===
I made a form that looks like this:
![form][1]
i need to put a "complete status" in this form. So when the process is done and i get the result, it shows in this form the status "complete" so i know that it's done.
Can someone help me how to do that?
The code for my form is the following:
public partial class MDG_Form : Form
{
EA.Repository modelRepository;
private NeatDiagram.CoreDiagram.MDGBuilder diagramBuilder;
public MDG_Form(EA.Repository repository)
{
InitializeComponent();
this.modelRepository = repository;
}
private void button1_Click(object sender, EventArgs e)
{
String typeOfDiagram = "";
if (radioButton1.Checked)
typeOfDiagram = radioButton1.Text;
else if (radioButton2.Checked)
typeOfDiagram = radioButton2.Text;
else if (radioButton3.Checked)
typeOfDiagram = radioButton3.Text;
else if (radioButton4.Checked)
typeOfDiagram = radioButton4.Text;
//Creo un'istanza di MDGBuilder
diagramBuilder = new CoreDiagram.MDGBuilder();
diagramBuilder.createDiagram(typeOfDiagram, modelRepository);
//Close();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
[1]: http://i.stack.imgur.com/pzT8m.jpg | 3 |
10,332,639 | 04/26/2012 11:39:13 | 363,789 | 06/10/2010 18:07:50 | 397 | 8 | iOS tests succeeding, but not running | I have a couple of SenTestCase subclasses in by test target, with STFail macros in the test methods.
When I run my tests, I get a spinner saying they are running, and that they succeeded, but they obviously have not run (or they would have failed).
My test scheme config LOOKS good, with each of my test showing up in there and being checked.
What could be wrong here? | ios | unit-testing | sentestingkit | null | null | null | open | iOS tests succeeding, but not running
===
I have a couple of SenTestCase subclasses in by test target, with STFail macros in the test methods.
When I run my tests, I get a spinner saying they are running, and that they succeeded, but they obviously have not run (or they would have failed).
My test scheme config LOOKS good, with each of my test showing up in there and being checked.
What could be wrong here? | 0 |
7,200,306 | 08/26/2011 05:21:44 | 913,395 | 08/26/2011 05:21:44 | 1 | 0 | need to remove javasript from menu bar of a jommla site | I am new to joomla,one of my client is asking to remove javascript from menu bar.The site is running in joomla.would you please guide me how to do this.many thanks in advance. | joomla | null | null | null | null | 08/26/2011 19:51:53 | not a real question | need to remove javasript from menu bar of a jommla site
===
I am new to joomla,one of my client is asking to remove javascript from menu bar.The site is running in joomla.would you please guide me how to do this.many thanks in advance. | 1 |
10,123,700 | 04/12/2012 12:35:35 | 1,329,023 | 04/12/2012 11:57:47 | 1 | 0 | How to Make a Picture rotate Continuously? | ) I have a star image in top-left of my screen want to rotate continuously. so can anyone tell me How can we make a Picture rotate Continuously for browsers Mozilla Firefox, Google chrome!?
[Css Position type is 'Absolutely' and image resolution:25*25 ] | javascript | jquery | html | css | null | 04/12/2012 18:55:43 | not a real question | How to Make a Picture rotate Continuously?
===
) I have a star image in top-left of my screen want to rotate continuously. so can anyone tell me How can we make a Picture rotate Continuously for browsers Mozilla Firefox, Google chrome!?
[Css Position type is 'Absolutely' and image resolution:25*25 ] | 1 |
400,802 | 12/30/2008 16:48:16 | 50,216 | 12/30/2008 16:01:25 | 4 | 0 | How to fetch HTML in C/C++ | How to fetch HTML in C or C++? with Sockets. Can you give me a Example code pls? | cc++ | null | null | null | null | 04/14/2012 02:46:24 | not a real question | How to fetch HTML in C/C++
===
How to fetch HTML in C or C++? with Sockets. Can you give me a Example code pls? | 1 |
5,835,898 | 04/29/2011 18:31:00 | 285,109 | 12/31/2009 19:13:01 | 188 | 0 | How to use Eclipse for capturing the structure of a java software. | I am trying to learn an open source software developed using Java. The software itself is complicated, consisting of multiple packages. I would like to know how to understand the inter-relationships or dependences of these packages under Eclipse developement environment. Thanks. | java | eclipse | null | null | null | null | open | How to use Eclipse for capturing the structure of a java software.
===
I am trying to learn an open source software developed using Java. The software itself is complicated, consisting of multiple packages. I would like to know how to understand the inter-relationships or dependences of these packages under Eclipse developement environment. Thanks. | 0 |
10,261,963 | 04/21/2012 18:54:38 | 1,204,317 | 02/11/2012 20:55:40 | 4 | 0 | multiple classes, same public interface | ok, after last night I've decided to rephrase my question for easier reading.
I have 2 classes, Army and Battle groups. heres the classes below, albeit with some parts missing:
class Battlegroups
{
private: battlegroup battlegroupobject[100];
public:
void AddBattleGroup(); //add a battlegroup object to the array
void removebattlegroup(); //remove a battle group objects from the array
};
class Army
{
private: battlegroups battlegroupsobject;
public:
void formbattlegroup()
{
battlegroupsobject.AddBattleGroup();
}
void disbandbattlegroup()
{
battlegroupsobject.removebattlegroup();
}
};
See, the problem is the formbattlegroup() and the disbandbattlegroup(), which seems like its adding a pointless interface.
if there is a way for me to access the Addbattlegroup and removebattlegroup() methods without doing the above, please tell me.
or, tell me if this is the way you do it, but to me, it seems like adding code, for the sake of code.
| c++ | oop | encapsulation | null | null | null | open | multiple classes, same public interface
===
ok, after last night I've decided to rephrase my question for easier reading.
I have 2 classes, Army and Battle groups. heres the classes below, albeit with some parts missing:
class Battlegroups
{
private: battlegroup battlegroupobject[100];
public:
void AddBattleGroup(); //add a battlegroup object to the array
void removebattlegroup(); //remove a battle group objects from the array
};
class Army
{
private: battlegroups battlegroupsobject;
public:
void formbattlegroup()
{
battlegroupsobject.AddBattleGroup();
}
void disbandbattlegroup()
{
battlegroupsobject.removebattlegroup();
}
};
See, the problem is the formbattlegroup() and the disbandbattlegroup(), which seems like its adding a pointless interface.
if there is a way for me to access the Addbattlegroup and removebattlegroup() methods without doing the above, please tell me.
or, tell me if this is the way you do it, but to me, it seems like adding code, for the sake of code.
| 0 |
5,725,829 | 04/20/2011 05:18:22 | 708,354 | 04/13/2011 23:32:59 | 1 | 0 | OOP in Python!! My First assignment in Python | I have no clue how OOP works in Python. I tried to get ideas from online tutorials but I couldn't understand clearly and my due for this assignment is tom morning :(
I would really appreciate if you guys could help me in solving this!!!
quest 1:
Write a class named Car that has the following data attributes:
• __year_model (for the car's year model)
• __make (for the make of the car)
• __speed (for the car's current speed)
The Car class should have an __init__ method that accept the car's year model and make as
arguments. These values should be assigned to the object's __year_model and _make data
attributes. It should also assign 0 to the __speed data attributes.
The class should also have the following methods:
• accelerate
The accelerate method should add 5 to the speed data attribute each time it is
called.
• Brake
The brake method should subtract 5 from the s;peed data attribute each time it is
called.
• get_speed
The get_speed method should return the current speed.
Next, design a program that creates a Car object and then calls the accelerate method five
times. After each call to the accelerate method, get the current speed of the car and display
it. Then call the brake method five times. After each call to the brake method, get the current
speed of the car and display it.
| python | null | null | null | null | 04/20/2011 05:48:56 | not a real question | OOP in Python!! My First assignment in Python
===
I have no clue how OOP works in Python. I tried to get ideas from online tutorials but I couldn't understand clearly and my due for this assignment is tom morning :(
I would really appreciate if you guys could help me in solving this!!!
quest 1:
Write a class named Car that has the following data attributes:
• __year_model (for the car's year model)
• __make (for the make of the car)
• __speed (for the car's current speed)
The Car class should have an __init__ method that accept the car's year model and make as
arguments. These values should be assigned to the object's __year_model and _make data
attributes. It should also assign 0 to the __speed data attributes.
The class should also have the following methods:
• accelerate
The accelerate method should add 5 to the speed data attribute each time it is
called.
• Brake
The brake method should subtract 5 from the s;peed data attribute each time it is
called.
• get_speed
The get_speed method should return the current speed.
Next, design a program that creates a Car object and then calls the accelerate method five
times. After each call to the accelerate method, get the current speed of the car and display
it. Then call the brake method five times. After each call to the brake method, get the current
speed of the car and display it.
| 1 |
7,400,416 | 09/13/2011 10:32:46 | 912,432 | 08/25/2011 15:18:39 | 21 | 0 | How to increase cassandra write performance using hadoop map reduce? | I am uploading data to Cassandra-0.7.8 using hadoop map/reduce program. To upload 9G of data to cluster of 3 nodes with RF=3 is taking 3.15 hrs.
Bleow are my mapper class code that uploads record. Kindly put across your suggestion to make it faster.( Also I am experimenting bulk uploader )
Is there any parameter can I turn on cassandra.yaml
public void map(Object key, Text value, Context context
) throws IOException, InterruptedException {
String[] columnDetail = value.toString().split("\\t");
if( columnDetail.length != 2 )
return;
// map size=21
HashMap<String, String> map = CommonUtil.parseRecord(columnDetail[1]);
List<Mutation> mutations = new ArrayList<Mutation>();
Iterator iter = map.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry pairs = (Map.Entry)iter.next();
Column col = new Column();
String cKey = pairs.getKey().toString().trim();
String cVal = pairs.getValue().toString().trim();
col.name = ByteBufferUtil.bytes( cKey );
col.timestamp = timeStamp;
if( cKey.compareTo("ip") == 0 ){
col.value = ByteBufferUtil.bytes( Long.valueOf( cVal) );
}else if( cKey.compareTo("domain") == 0 ){
col.value = ByteBufferUtil.bytes( Integer.valueOf(cVal) );
}else{
col.value = ByteBufferUtil.bytes( cVal );
}
Mutation m = new Mutation();
m.column_or_supercolumn = new ColumnOrSuperColumn ();
m.column_or_supercolumn.column = col;
mutations.add(m);
}
ByteBuffer rowKey = ByteBuffer.wrap( rKey.getBytes() );
context.write(rowKey ,mutations);
} | cassandra | null | null | null | null | null | open | How to increase cassandra write performance using hadoop map reduce?
===
I am uploading data to Cassandra-0.7.8 using hadoop map/reduce program. To upload 9G of data to cluster of 3 nodes with RF=3 is taking 3.15 hrs.
Bleow are my mapper class code that uploads record. Kindly put across your suggestion to make it faster.( Also I am experimenting bulk uploader )
Is there any parameter can I turn on cassandra.yaml
public void map(Object key, Text value, Context context
) throws IOException, InterruptedException {
String[] columnDetail = value.toString().split("\\t");
if( columnDetail.length != 2 )
return;
// map size=21
HashMap<String, String> map = CommonUtil.parseRecord(columnDetail[1]);
List<Mutation> mutations = new ArrayList<Mutation>();
Iterator iter = map.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry pairs = (Map.Entry)iter.next();
Column col = new Column();
String cKey = pairs.getKey().toString().trim();
String cVal = pairs.getValue().toString().trim();
col.name = ByteBufferUtil.bytes( cKey );
col.timestamp = timeStamp;
if( cKey.compareTo("ip") == 0 ){
col.value = ByteBufferUtil.bytes( Long.valueOf( cVal) );
}else if( cKey.compareTo("domain") == 0 ){
col.value = ByteBufferUtil.bytes( Integer.valueOf(cVal) );
}else{
col.value = ByteBufferUtil.bytes( cVal );
}
Mutation m = new Mutation();
m.column_or_supercolumn = new ColumnOrSuperColumn ();
m.column_or_supercolumn.column = col;
mutations.add(m);
}
ByteBuffer rowKey = ByteBuffer.wrap( rKey.getBytes() );
context.write(rowKey ,mutations);
} | 0 |
5,502,884 | 03/31/2011 16:08:52 | 686,104 | 03/31/2011 16:01:44 | 1 | 0 | Help Using UITableView for High Score Page | I am making a simple gaming app, implementing a tab bar controller. The second tab, or high score page is what I am having problems with. I am able to populate the UITableView with an initial array of objects, however I can't seem to add new cells. Now I read about User entered cells, but how exactly would I extract the winner from one tab to populate the UITableView in the high score tab? Thank you for your time! | iphone | uitableview | uitabbarcontroller | null | null | null | open | Help Using UITableView for High Score Page
===
I am making a simple gaming app, implementing a tab bar controller. The second tab, or high score page is what I am having problems with. I am able to populate the UITableView with an initial array of objects, however I can't seem to add new cells. Now I read about User entered cells, but how exactly would I extract the winner from one tab to populate the UITableView in the high score tab? Thank you for your time! | 0 |
6,558,555 | 07/02/2011 17:35:53 | 826,254 | 07/02/2011 17:21:52 | 1 | 0 | Asp.NET publishing problem - PLEASE HELP!!!!!!!!!!!! | My problems started after i finished my web application project,<br/>
I want to upload my website to sub folder (http://site.com/project/)<br/>
<br/>
asp.net page.resolveUrl("~") is converted to / not /project/<br/>
that i solved it with alternate function.<br/>
<br/>
Theme folder = /App_Themes/ instead of /project/App_Themes/<br/>
<br/>
after I solved that the new problem is <br/>
"Could not load type 'xxx.xxx'."<br/>
in all pages.<br/>
<br/>
I am using a free hosting(http://somee.com/)<br/>
Please HELP!!!!!!!!!!! | asp.net | iis7 | null | null | null | 07/02/2011 22:39:37 | not a real question | Asp.NET publishing problem - PLEASE HELP!!!!!!!!!!!!
===
My problems started after i finished my web application project,<br/>
I want to upload my website to sub folder (http://site.com/project/)<br/>
<br/>
asp.net page.resolveUrl("~") is converted to / not /project/<br/>
that i solved it with alternate function.<br/>
<br/>
Theme folder = /App_Themes/ instead of /project/App_Themes/<br/>
<br/>
after I solved that the new problem is <br/>
"Could not load type 'xxx.xxx'."<br/>
in all pages.<br/>
<br/>
I am using a free hosting(http://somee.com/)<br/>
Please HELP!!!!!!!!!!! | 1 |
3,936,554 | 10/14/2010 18:55:44 | 127,880 | 06/23/2009 22:01:04 | 1,277 | 36 | HTML - What is the correct way to do the following layout? | Diagram A can be accomplished by having a valign="top" and align="right" on the parent TD. The red rectangle is a div with style="float:right". This works on most browsers, but not IE. IE will put a linebreak before the div. The Text is not surrounded in any tag. It is the first thing in the TD.
The problem with the setup in Diagram A was solved by containing the text inside a Div with style="float:right" and placing that div AFTER the original red div, causing the layout in Diagram B. This appears to work in all browsers, but I have doubts that I'm accomplishing this layout requirement in the correct way.
![alt text][1]
[1]: http://i.stack.imgur.com/5xEmh.png
Is there a better way to accomplish this?
I can't use a table, because the div on the right side has a slightly variable width and the distance between the green text and the left side of the right-side Div is very important. Basically, the absolute position of the text on the left depends on what happens in the right side div. | html | null | null | null | null | null | open | HTML - What is the correct way to do the following layout?
===
Diagram A can be accomplished by having a valign="top" and align="right" on the parent TD. The red rectangle is a div with style="float:right". This works on most browsers, but not IE. IE will put a linebreak before the div. The Text is not surrounded in any tag. It is the first thing in the TD.
The problem with the setup in Diagram A was solved by containing the text inside a Div with style="float:right" and placing that div AFTER the original red div, causing the layout in Diagram B. This appears to work in all browsers, but I have doubts that I'm accomplishing this layout requirement in the correct way.
![alt text][1]
[1]: http://i.stack.imgur.com/5xEmh.png
Is there a better way to accomplish this?
I can't use a table, because the div on the right side has a slightly variable width and the distance between the green text and the left side of the right-side Div is very important. Basically, the absolute position of the text on the left depends on what happens in the right side div. | 0 |
10,740,279 | 05/24/2012 15:11:25 | 1,291,078 | 03/25/2012 09:34:54 | 22 | 0 | I can't see data from database (supplied argument is not a valid) | I can't understand why i get supplied argument is not a valid?
My codes belove
dbconnect.class.php http://ideone.com/AILC9
getdata.class.php http://ideone.com/wIbL3
header.class.php http://ideone.com/OQSg9
index.php
http://ideone.com/Zp6sF
When I run index.php I can get this codes:
<html>
<head>
<title> <br />
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>C:\AppServ\www\ilk\class\getdata.class.php</b> on line <b>21</b><br />
</title>
<meta name="description" content="<br />
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>C:\AppServ\www\ilk\class\getdata.class.php</b> on line <b>21</b><br />
" />
<meta name="keywords" content="<br />
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>C:\AppServ\www\ilk\class\getdata.class.php</b> on line <b>21</b><br />
" />
</head>
</html> | php | mysql | null | null | null | 05/24/2012 22:49:23 | not a real question | I can't see data from database (supplied argument is not a valid)
===
I can't understand why i get supplied argument is not a valid?
My codes belove
dbconnect.class.php http://ideone.com/AILC9
getdata.class.php http://ideone.com/wIbL3
header.class.php http://ideone.com/OQSg9
index.php
http://ideone.com/Zp6sF
When I run index.php I can get this codes:
<html>
<head>
<title> <br />
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>C:\AppServ\www\ilk\class\getdata.class.php</b> on line <b>21</b><br />
</title>
<meta name="description" content="<br />
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>C:\AppServ\www\ilk\class\getdata.class.php</b> on line <b>21</b><br />
" />
<meta name="keywords" content="<br />
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>C:\AppServ\www\ilk\class\getdata.class.php</b> on line <b>21</b><br />
" />
</head>
</html> | 1 |
5,625,739 | 04/11/2011 18:28:58 | 603,200 | 02/04/2011 13:19:17 | 81 | 8 | Java - Rich logging in web services | I have a simple web service like this:
@WebService
public class MyWebService
{
@WebMethod
public String ProcessQuery(@WebParam(name="query") String q)
{
// Logging here: User IP, etc.
}
public static void main(String[] args) throws Exception
{
String address = "http://127.0.0.1:8023/_WebServiceDemo";
Endpoint.publish(address, new MyWebService());
new DocumentServer();
System.out.println("Listening: " + address);
}
}
I want to add a logging method for my service to extract information. I've heard about NCSA format and Log4J but I don't know how to use them in the service. I want to log user's ip and other info. How can I do it?
Thanks.
| java | logging | log4j | null | null | null | open | Java - Rich logging in web services
===
I have a simple web service like this:
@WebService
public class MyWebService
{
@WebMethod
public String ProcessQuery(@WebParam(name="query") String q)
{
// Logging here: User IP, etc.
}
public static void main(String[] args) throws Exception
{
String address = "http://127.0.0.1:8023/_WebServiceDemo";
Endpoint.publish(address, new MyWebService());
new DocumentServer();
System.out.println("Listening: " + address);
}
}
I want to add a logging method for my service to extract information. I've heard about NCSA format and Log4J but I don't know how to use them in the service. I want to log user's ip and other info. How can I do it?
Thanks.
| 0 |
5,255,735 | 03/10/2011 05:11:56 | 462,951 | 06/02/2010 11:32:08 | 92 | 0 | how to install simpleSAMLphp in wamp | I have read installation documentation of simpleSAMLphp but still confused | php | wamp | wampserver | saml | null | 03/10/2011 14:50:42 | not a real question | how to install simpleSAMLphp in wamp
===
I have read installation documentation of simpleSAMLphp but still confused | 1 |
6,845,964 | 07/27/2011 14:18:48 | 823,313 | 06/30/2011 15:09:48 | 1 | 0 | what is htmlx and pdfx | I am trying to convert word document into html and pdf
Sometimes my code converts them into html and pdf but sometimes I get the htmlx and pdfx and I have NO idea whatsoever!
| html | pdf | microsoft | null | null | 07/27/2011 14:24:13 | not a real question | what is htmlx and pdfx
===
I am trying to convert word document into html and pdf
Sometimes my code converts them into html and pdf but sometimes I get the htmlx and pdfx and I have NO idea whatsoever!
| 1 |
7,412,419 | 09/14/2011 06:57:41 | 763,394 | 05/20/2011 20:46:32 | 1 | 1 | Amazon Ec2 Cluster Computing is too expensive? | Im working on a HPC program. and i decide to rent the Cluster Computing of EC2.
but the cost of reserved system is too much:
> 1 yr 3 yr Linux Usage
> Extra Large $5630 $8650 $0.74 per hour
how much the price of full HP server by this specification?
> 23 GB of memory
> 33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core “Nehalem”
> architecture) 1690 GB of instance storage 64-bit platform I/O
> Performance: Very High (10 Gigabit Ethernet) API name: cc1.4xlarge
dose it worth? | amazon-ec2 | cluster-computing | null | null | null | 09/14/2011 11:05:56 | off topic | Amazon Ec2 Cluster Computing is too expensive?
===
Im working on a HPC program. and i decide to rent the Cluster Computing of EC2.
but the cost of reserved system is too much:
> 1 yr 3 yr Linux Usage
> Extra Large $5630 $8650 $0.74 per hour
how much the price of full HP server by this specification?
> 23 GB of memory
> 33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core “Nehalem”
> architecture) 1690 GB of instance storage 64-bit platform I/O
> Performance: Very High (10 Gigabit Ethernet) API name: cc1.4xlarge
dose it worth? | 2 |
11,450,746 | 07/12/2012 11:21:46 | 1,478,133 | 06/24/2012 13:36:46 | 17 | 0 | download image from web service in blackberry | I am trying to download and show an image from my webservice but I get the error:
net.rim.device.cldc.io.ssl.TLSIOException(net.rim.device.cldc.io.ssl.TLSException(net.rim.device.api.io.ConnectionClosedException: Not connected))
This is my code to get the image:
public Bitmap getBitmapFromUrl(String url)
{
Bitmap bitmap=null;
try
{
HttpConnection connection=(HttpConnection)Connector.open(url+ ";deviceside=true;ConnectionUID=S TCP");
connection.setRequestMethod(HttpConnection.GET);
InputStream is=connection.openInputStream();
int length=is.available();
System.out.println("InputStream length "+length);
byte[] data=new byte[length];
System.out.println("byte data "+data);
data=IOUtilities.streamToBytes(is);
System.out.println("IOUtilities data "+data);
connection.close();
is.close();
bitmap=Bitmap.createBitmapFromBytes(data,0,data.length,1);
if(bitmap!=null)
return bitmap;
else
return bitmap=Bitmap.getBitmapResource("me1.jpg");
}
catch (Exception e)
{
System.out.println("The image has not been fetched");
return bitmap=Bitmap.getBitmapResource("me2.jpg");
}
}
I am calling it with Bitmap bitmap=null; bitmap = (getBitmapFromUrl(strsessionPictureUrl));
The error says connection closed. I wonder why is this happening. Is there some glitch in my code? | blackberry | imagedownload | null | null | null | null | open | download image from web service in blackberry
===
I am trying to download and show an image from my webservice but I get the error:
net.rim.device.cldc.io.ssl.TLSIOException(net.rim.device.cldc.io.ssl.TLSException(net.rim.device.api.io.ConnectionClosedException: Not connected))
This is my code to get the image:
public Bitmap getBitmapFromUrl(String url)
{
Bitmap bitmap=null;
try
{
HttpConnection connection=(HttpConnection)Connector.open(url+ ";deviceside=true;ConnectionUID=S TCP");
connection.setRequestMethod(HttpConnection.GET);
InputStream is=connection.openInputStream();
int length=is.available();
System.out.println("InputStream length "+length);
byte[] data=new byte[length];
System.out.println("byte data "+data);
data=IOUtilities.streamToBytes(is);
System.out.println("IOUtilities data "+data);
connection.close();
is.close();
bitmap=Bitmap.createBitmapFromBytes(data,0,data.length,1);
if(bitmap!=null)
return bitmap;
else
return bitmap=Bitmap.getBitmapResource("me1.jpg");
}
catch (Exception e)
{
System.out.println("The image has not been fetched");
return bitmap=Bitmap.getBitmapResource("me2.jpg");
}
}
I am calling it with Bitmap bitmap=null; bitmap = (getBitmapFromUrl(strsessionPictureUrl));
The error says connection closed. I wonder why is this happening. Is there some glitch in my code? | 0 |
10,828,848 | 05/31/2012 07:01:28 | 358,037 | 06/04/2010 01:07:22 | 684 | 24 | jsonp failing in chrome | I'm using Chrome 19.0.1084.52 and I'm finding chrome is just silently failing jsonp related code.
As a real world case (as my code is on a private server atm), Hitting http://tweet.seaofclouds.com/ with firefox seems to work fine but chrome just silently fails.
The script is not showing up in any of the tabs.
I've tried manually writing a <script> tag. I've tried jQuery.getJSON and jQuery.ajax
Nothing I've tried seems to get around it, except for the non practical method of running the code locally (file://)
Other than running chrome in disable-web-security mode (which I have not yet tried) is there any way to get chrome to work? | javascript | google-chrome | jsonp | null | null | null | open | jsonp failing in chrome
===
I'm using Chrome 19.0.1084.52 and I'm finding chrome is just silently failing jsonp related code.
As a real world case (as my code is on a private server atm), Hitting http://tweet.seaofclouds.com/ with firefox seems to work fine but chrome just silently fails.
The script is not showing up in any of the tabs.
I've tried manually writing a <script> tag. I've tried jQuery.getJSON and jQuery.ajax
Nothing I've tried seems to get around it, except for the non practical method of running the code locally (file://)
Other than running chrome in disable-web-security mode (which I have not yet tried) is there any way to get chrome to work? | 0 |
11,720,285 | 07/30/2012 11:10:32 | 784,101 | 06/04/2011 16:39:52 | 28 | 0 | Lookahead, lookbehind condition in regular expression | The following example is about using lookahead assertion as a condition. i found it in php manual at: http://www.php.net/manual/en/regexp.reference.conditional.php
(?(?=[^a-z]*[a-z])
\d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} )
Here's the description about this regex:
The condition is a positive lookahead assertion that matches an optional sequence of non-letters followed by a letter. In other words, it tests for the presence of at least one letter in the subject. If a letter is found, the subject is matched against the first alternative; otherwise it is matched against the second. This pattern matches strings in one of the two forms dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits.
Could anyone tell me why we use lookahead assertion as the condition in this example? Why don't we use lookbehind assertion? I get confused when they're used as conditions like this because I don't know how do they match the subject string. Thanks in advance! | php | pcre | null | null | null | null | open | Lookahead, lookbehind condition in regular expression
===
The following example is about using lookahead assertion as a condition. i found it in php manual at: http://www.php.net/manual/en/regexp.reference.conditional.php
(?(?=[^a-z]*[a-z])
\d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} )
Here's the description about this regex:
The condition is a positive lookahead assertion that matches an optional sequence of non-letters followed by a letter. In other words, it tests for the presence of at least one letter in the subject. If a letter is found, the subject is matched against the first alternative; otherwise it is matched against the second. This pattern matches strings in one of the two forms dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits.
Could anyone tell me why we use lookahead assertion as the condition in this example? Why don't we use lookbehind assertion? I get confused when they're used as conditions like this because I don't know how do they match the subject string. Thanks in advance! | 0 |
10,963,138 | 06/09/2012 17:38:13 | 546,427 | 06/10/2010 18:25:18 | 821 | 18 | creating a global urls object in javascript, for easy reverse routing in templates | I am working on a web project that uses lots of ajax. I am using playframework, and in my html templates, I have access to the playframework reverse router, so I can get urls from the router and not have to worry about what happens if I later decide to change the url structure of the site. However I don't have access tho the reverse router in the external js files, but would often like to leverage the indirection of the reverse router for requests in these files.
I came up with a solution that doesn't force every external ajax function to accept a url parameter, and that was to create a global url object like this:
var globalUrls = {
confirmImageUpload : "@routes.UploadController.confirmResourceUpload()",
anotherUrl : "@routes.AnotherController.anotherControllerMethod()"
}
I then use this object in the external js files to know where to send ajax requests.
Is this ok to do? I don't know if this is bad practice, or if exposing all the urls like that is wise...
I am hoping some experienced individual will interject if this is for some reason dumb... | ajax | templates | playframework | global-variables | null | null | open | creating a global urls object in javascript, for easy reverse routing in templates
===
I am working on a web project that uses lots of ajax. I am using playframework, and in my html templates, I have access to the playframework reverse router, so I can get urls from the router and not have to worry about what happens if I later decide to change the url structure of the site. However I don't have access tho the reverse router in the external js files, but would often like to leverage the indirection of the reverse router for requests in these files.
I came up with a solution that doesn't force every external ajax function to accept a url parameter, and that was to create a global url object like this:
var globalUrls = {
confirmImageUpload : "@routes.UploadController.confirmResourceUpload()",
anotherUrl : "@routes.AnotherController.anotherControllerMethod()"
}
I then use this object in the external js files to know where to send ajax requests.
Is this ok to do? I don't know if this is bad practice, or if exposing all the urls like that is wise...
I am hoping some experienced individual will interject if this is for some reason dumb... | 0 |
2,624,313 | 04/12/2010 18:17:13 | 314,802 | 04/12/2010 18:17:13 | 1 | 0 | Sorting a text file by date - Date looks like DD/MM/YYYY | I am trying to sort the dates from the earliest to the latest.
I was thinking about using the bufferedreader and do a try searching the first 2 characters of the string and then the 4th and 5th characters and finally the 7th and 8th characters, ignoring the slashes.
The following is an example of the text file I have:
04/24/2010 - 2000.0 (Deposit)
09/05/2010 - 20.0 (Fees)
02/30/2007 - 600.0 (Deposit)
06/15/2009 - 200.0 (Fees)
08/23/2010 - 300.0 (Deposit)
06/05/2006 - 500.0 (Fees)
| java | sorting | bufferedreader | null | null | null | open | Sorting a text file by date - Date looks like DD/MM/YYYY
===
I am trying to sort the dates from the earliest to the latest.
I was thinking about using the bufferedreader and do a try searching the first 2 characters of the string and then the 4th and 5th characters and finally the 7th and 8th characters, ignoring the slashes.
The following is an example of the text file I have:
04/24/2010 - 2000.0 (Deposit)
09/05/2010 - 20.0 (Fees)
02/30/2007 - 600.0 (Deposit)
06/15/2009 - 200.0 (Fees)
08/23/2010 - 300.0 (Deposit)
06/05/2006 - 500.0 (Fees)
| 0 |
7,294,403 | 09/03/2011 16:38:17 | 926,789 | 09/03/2011 16:16:38 | 1 | 0 | Programming Novice-Slickdeals.net, level of programming knowledge | I am interested in creating a website for gardeners but in similar format to slickdeals.net, in terms of having a login page, front page, and up/down votes for comments in forum.
If I plan on using python, what how long and how difficult will it take me to build something like this? I have never programmed before, except for a little HTML, C++.
| python | null | null | null | null | 09/03/2011 18:27:31 | off topic | Programming Novice-Slickdeals.net, level of programming knowledge
===
I am interested in creating a website for gardeners but in similar format to slickdeals.net, in terms of having a login page, front page, and up/down votes for comments in forum.
If I plan on using python, what how long and how difficult will it take me to build something like this? I have never programmed before, except for a little HTML, C++.
| 2 |
8,319,829 | 11/30/2011 00:53:03 | 1,072,441 | 11/30/2011 00:39:26 | 1 | 0 | SSH access to a ubuntu box with no terminal | Trying to figure out a way so that when i have somebody PUTTY into my linux ubuntu box, they will have no terminal access. Basically i just want them to have access to some repos for SVN but when they ssh, they should have no options for command lines. | linux | svn | ubuntu | terminal | putty | 11/30/2011 01:58:46 | off topic | SSH access to a ubuntu box with no terminal
===
Trying to figure out a way so that when i have somebody PUTTY into my linux ubuntu box, they will have no terminal access. Basically i just want them to have access to some repos for SVN but when they ssh, they should have no options for command lines. | 2 |
5,636,569 | 04/12/2011 14:09:08 | 186,942 | 10/09/2009 06:01:36 | 75 | 0 | Front controller object in zend framewok. | What is diff. between below objects of front controller and how to use it?
$this->bootstrap('frontController');
$frontController = $this->getResource('frontController');
$front = Zend_Controller_Front::getInstance();
What is diff. between these two objects of front controller? | zend-framework | null | null | null | null | null | open | Front controller object in zend framewok.
===
What is diff. between below objects of front controller and how to use it?
$this->bootstrap('frontController');
$frontController = $this->getResource('frontController');
$front = Zend_Controller_Front::getInstance();
What is diff. between these two objects of front controller? | 0 |
10,432,308 | 05/03/2012 13:21:59 | 1,372,482 | 05/03/2012 12:41:29 | 1 | 0 | declaring a class inside of itself | I'm not sure what the practice of what I'm trying to do is called so finding any kind of help has been difficult. The code speaks for itself I think. Guess what I'm looking for is what this is called and the proper way to code it.
Class Point {
int x,y;
Point Spawn[];
Point() {
x=100;
y=100;
}
void Make() {
Spawn = new Point[2];
Spawn[0] = new Point();
Spawn[1] = new Point();
}
//main code
Point my_point;
my_point.Make();
for (Point set1:my_point.Spawn)
{
set1.Make();
for (Point set2:set1.Spawn) {
// repeat x 10
}
}
| java | class | declaration | null | null | 05/03/2012 13:33:11 | not a real question | declaring a class inside of itself
===
I'm not sure what the practice of what I'm trying to do is called so finding any kind of help has been difficult. The code speaks for itself I think. Guess what I'm looking for is what this is called and the proper way to code it.
Class Point {
int x,y;
Point Spawn[];
Point() {
x=100;
y=100;
}
void Make() {
Spawn = new Point[2];
Spawn[0] = new Point();
Spawn[1] = new Point();
}
//main code
Point my_point;
my_point.Make();
for (Point set1:my_point.Spawn)
{
set1.Make();
for (Point set2:set1.Spawn) {
// repeat x 10
}
}
| 1 |
4,780,211 | 01/24/2011 09:04:15 | 583,003 | 01/12/2011 12:25:50 | 1 | 0 | [subview setWantsLayer:YES] will bring the subview to the front? | i have this little cocoa snippet
[subView setWantsLayer:YES];
thus,the subView covers all the other subview suppose to be on top of it.How to put it to the back as it should be? | cocoa | calayer | null | null | null | null | open | [subview setWantsLayer:YES] will bring the subview to the front?
===
i have this little cocoa snippet
[subView setWantsLayer:YES];
thus,the subView covers all the other subview suppose to be on top of it.How to put it to the back as it should be? | 0 |
1,230,822 | 08/05/2009 02:01:58 | 54,064 | 01/12/2009 06:25:34 | 86 | 3 | Need html text shown as a link to work with an iframe | I have a page that contains an iframe element. I want to have some text on the main page when clicked to change the iframe source. I can do that with an "a href" tag but the main page resets to the top instead of where the user was last on the page vertically. If I use an input type=button element, then it works just fine without resetting to the top of the main page. However, I want the look of just text on the page (with an underline) instead of a button look. How can I do this? | html | null | null | null | null | null | open | Need html text shown as a link to work with an iframe
===
I have a page that contains an iframe element. I want to have some text on the main page when clicked to change the iframe source. I can do that with an "a href" tag but the main page resets to the top instead of where the user was last on the page vertically. If I use an input type=button element, then it works just fine without resetting to the top of the main page. However, I want the look of just text on the page (with an underline) instead of a button look. How can I do this? | 0 |
8,795,847 | 01/09/2012 22:09:20 | 1,132,256 | 01/05/2012 13:31:52 | 8 | 0 | Python/PHP, cakePHP and wordpress | Could someone explain differences and relations between Python/PHP, cakePHP and wordpress? Maybe draw some connections to Ruby or Java? Could you compare wordpress to Google Web Toolkit?
| php | python | cakephp | null | null | 01/09/2012 22:21:27 | not a real question | Python/PHP, cakePHP and wordpress
===
Could someone explain differences and relations between Python/PHP, cakePHP and wordpress? Maybe draw some connections to Ruby or Java? Could you compare wordpress to Google Web Toolkit?
| 1 |
11,501,096 | 07/16/2012 09:04:17 | 1,300,497 | 03/29/2012 10:20:52 | 1 | 0 | Coding Algorithm in Poll-Listen and Listen-Poll of NFC A | I'm doing a research in NFC (Near Field Communication). I have a question related to the coding algorithm in two connections Poll - Listen and Listen - Poll. Why do they use 2 different algorithms (Manchester and modified Miller) in these two phases?
Thanks, | nfc | null | null | null | null | 07/17/2012 14:03:32 | off topic | Coding Algorithm in Poll-Listen and Listen-Poll of NFC A
===
I'm doing a research in NFC (Near Field Communication). I have a question related to the coding algorithm in two connections Poll - Listen and Listen - Poll. Why do they use 2 different algorithms (Manchester and modified Miller) in these two phases?
Thanks, | 2 |
9,936,108 | 03/30/2012 02:14:21 | 1,083,268 | 12/06/2011 10:13:00 | 1 | 1 | Can not register Microsoft Azure | I get the following error when trying to sign up for the Microsoft Azure 90-day free trial:
We can't authorize the payment method. Please make sure the information is correct, or use another payment method. If you continue to get this message, please contact your financial institution.
I've tried three different cards, two credit and one debit. Those cards are issued from two different banks. I've also tried the cards on two separate accounts. Someone from my work also confirmed that he could not sign up for the free trial either.
Has anyone else had this problem? I haven't really seen much help searching Google and the support staff doesn't seem interested in helping people sign up for free accounts.
| sql-azure | null | null | null | null | 07/03/2012 20:36:13 | off topic | Can not register Microsoft Azure
===
I get the following error when trying to sign up for the Microsoft Azure 90-day free trial:
We can't authorize the payment method. Please make sure the information is correct, or use another payment method. If you continue to get this message, please contact your financial institution.
I've tried three different cards, two credit and one debit. Those cards are issued from two different banks. I've also tried the cards on two separate accounts. Someone from my work also confirmed that he could not sign up for the free trial either.
Has anyone else had this problem? I haven't really seen much help searching Google and the support staff doesn't seem interested in helping people sign up for free accounts.
| 2 |
8,059,902 | 11/09/2011 03:11:34 | 957,314 | 09/21/2011 15:36:09 | 1 | 0 | 300 mb text file using java | I am a newbie in Java, I want to open a 300 mb text file and read and parse line by line, after doing some research I think nio package is the best way to go. I was wondering if there is anything that I should consider while doing this or any hint from people who have already done this is highly appreciated. | java | nio | text-files | null | null | 11/09/2011 04:44:32 | not constructive | 300 mb text file using java
===
I am a newbie in Java, I want to open a 300 mb text file and read and parse line by line, after doing some research I think nio package is the best way to go. I was wondering if there is anything that I should consider while doing this or any hint from people who have already done this is highly appreciated. | 4 |
7,241,973 | 08/30/2011 10:43:10 | 737,065 | 05/03/2011 23:15:37 | 25 | 0 | Video On Demand and IPTV -- How start? | Can someone point the way
focused on the coding of Video On Demand and IPTV?
I want to start from the beginning of this topic, what literature, what tools and
Test platform. Just... how start?
TIA | c++ | video | iptv | null | null | 08/30/2011 11:22:57 | not a real question | Video On Demand and IPTV -- How start?
===
Can someone point the way
focused on the coding of Video On Demand and IPTV?
I want to start from the beginning of this topic, what literature, what tools and
Test platform. Just... how start?
TIA | 1 |
7,947,875 | 10/30/2011 21:16:34 | 149,080 | 08/01/2009 21:00:20 | 4,489 | 34 | Possible to use jQuery Auto Suggest for a Twitter Mention like suggestions? | With Twitter, when you type a tweet, anytime you type @ it triggers an autosuggest to quickly enter a twitter handle. You can do @ at the beginning of a tweet in the middle and multiple times.
Can jQuery AutoSuggest handle this? After looking it over it seems like it is good for input fields that just contain the autosuggest value. Not multiple times or in various locations.
Thoughts? Examples? Thanks | jquery | jquery-ui | autosuggest | null | null | null | open | Possible to use jQuery Auto Suggest for a Twitter Mention like suggestions?
===
With Twitter, when you type a tweet, anytime you type @ it triggers an autosuggest to quickly enter a twitter handle. You can do @ at the beginning of a tweet in the middle and multiple times.
Can jQuery AutoSuggest handle this? After looking it over it seems like it is good for input fields that just contain the autosuggest value. Not multiple times or in various locations.
Thoughts? Examples? Thanks | 0 |
11,301,093 | 07/02/2012 20:59:27 | 220,935 | 11/29/2009 18:18:37 | 1,158 | 102 | Connect computer running lion to panther | I'm trying to figure out how to connect a computer running lion to another computer running panther via FireWire. So far, I have tried the following things:
-Both computers have file sharing on, as well as remote login and personal web sharing
-The computer running panther does not have Bluetooth or wifi
-The computer that is running lion does not have an available Ethernet port
-On either computer, there is no indication that they are connected
One thing that I might consider trying is running a virtual machine on the computer running lion (say, Linux) and the virtual environment will be able to see the computer.
I don't want to upgrade the panther computer because it's just a computers lying around, and I'd like to put it to good use. | osx | null | null | null | null | 07/02/2012 21:01:10 | off topic | Connect computer running lion to panther
===
I'm trying to figure out how to connect a computer running lion to another computer running panther via FireWire. So far, I have tried the following things:
-Both computers have file sharing on, as well as remote login and personal web sharing
-The computer running panther does not have Bluetooth or wifi
-The computer that is running lion does not have an available Ethernet port
-On either computer, there is no indication that they are connected
One thing that I might consider trying is running a virtual machine on the computer running lion (say, Linux) and the virtual environment will be able to see the computer.
I don't want to upgrade the panther computer because it's just a computers lying around, and I'd like to put it to good use. | 2 |
10,927,343 | 06/07/2012 07:19:51 | 1,410,110 | 05/22/2012 11:41:24 | 8 | 0 | One Class - Multiple ViewControllers (Obj. C) | I've created one C class for my app. But I want to use it on like 6 view Controllers. But then I get an error at XCODE when Compiling. Is there an option to use that class on multiple view controllers without errors?
Thanks | xcode | class | null | null | null | 06/08/2012 01:09:52 | not a real question | One Class - Multiple ViewControllers (Obj. C)
===
I've created one C class for my app. But I want to use it on like 6 view Controllers. But then I get an error at XCODE when Compiling. Is there an option to use that class on multiple view controllers without errors?
Thanks | 1 |
6,720,348 | 07/16/2011 21:27:24 | 728,819 | 04/28/2011 07:55:02 | 140 | 0 | Difference between OOP and Functional Programming (scheme) | I'm watching a video course/lectures from Stanford. The course is "The Structure and Interpretation of Computer Programs"
In the first OOP lecture, the instructor (Brian Harvey) describes an OOP method as one that gives different answers for the same question, while a function in functional programming gives a certain output for a certain input.
The following code is an example of a method in OOP that gives a different answer each time it's called:-
(define-class (counter)
instance-vars (count 0))
(method (next)
(set! count (+ count 1))
count) )
Now although the course is illustrated by scheme, I didn't pay much attention to the language itself, and so I can't explain the code; but can't a similar function "next" do the same thing as this "next" function?
In C, I would declare a global variable, and each time increase it by one when calling next. I know C is procedural, but I'm guessing a similar thing can be done in Scheme. | oop | functional-programming | scheme | null | null | 07/17/2011 11:33:15 | not a real question | Difference between OOP and Functional Programming (scheme)
===
I'm watching a video course/lectures from Stanford. The course is "The Structure and Interpretation of Computer Programs"
In the first OOP lecture, the instructor (Brian Harvey) describes an OOP method as one that gives different answers for the same question, while a function in functional programming gives a certain output for a certain input.
The following code is an example of a method in OOP that gives a different answer each time it's called:-
(define-class (counter)
instance-vars (count 0))
(method (next)
(set! count (+ count 1))
count) )
Now although the course is illustrated by scheme, I didn't pay much attention to the language itself, and so I can't explain the code; but can't a similar function "next" do the same thing as this "next" function?
In C, I would declare a global variable, and each time increase it by one when calling next. I know C is procedural, but I'm guessing a similar thing can be done in Scheme. | 1 |
4,061,053 | 10/30/2010 23:00:24 | 62,122 | 02/03/2009 20:47:20 | 975 | 15 | Whats better in the job market, and what has a better future: Java or C#? | I've learned a lot of programming language, and I think that Java or C# are most likely the best for getting a job, but I was wondering if I am correct in thinking this, or are there other popular languages I should know about? | c# | java | jobs | null | null | 10/30/2010 23:08:24 | not constructive | Whats better in the job market, and what has a better future: Java or C#?
===
I've learned a lot of programming language, and I think that Java or C# are most likely the best for getting a job, but I was wondering if I am correct in thinking this, or are there other popular languages I should know about? | 4 |
254,093 | 10/31/2008 16:24:02 | 3,892 | 08/31/2008 17:59:08 | 353 | 33 | Best practices on answering dogfood excuses | Dogfooding is using your own software. Sometimes that is impossible (software for fighter pilots.) More often it is possible, but doesn't happen anyway.
A couple of "Our users won't experience that problem so it can't be a dogfooding bug," and quickly the practicalities of dogfooding go down so far no one does it.
What are the best practices about getting dogfooding to actually happen? | polls | team | null | null | null | 07/04/2012 15:48:26 | not constructive | Best practices on answering dogfood excuses
===
Dogfooding is using your own software. Sometimes that is impossible (software for fighter pilots.) More often it is possible, but doesn't happen anyway.
A couple of "Our users won't experience that problem so it can't be a dogfooding bug," and quickly the practicalities of dogfooding go down so far no one does it.
What are the best practices about getting dogfooding to actually happen? | 4 |
8,325,087 | 11/30/2011 11:20:23 | 1,073,199 | 11/30/2011 11:11:45 | 1 | 0 | Blocked list has disappeared, tried everything :( | i have literally tried everything from deactivating my account, using different computers, different phones. and facebook is still saying i havent blocked anyone when i have. i blocked my boyfriend as a joke and now when i go on my blocked list to unblock him it says i haven't blocked anyone. its really quite annoying and the fact i've tried to contact numerous times about it and they've done absolutely nothing really angers me. does anyone have any idea on what it could be/ what i can do.
thanks. | facebook-connect | privacy | null | null | null | 11/30/2011 13:11:36 | off topic | Blocked list has disappeared, tried everything :(
===
i have literally tried everything from deactivating my account, using different computers, different phones. and facebook is still saying i havent blocked anyone when i have. i blocked my boyfriend as a joke and now when i go on my blocked list to unblock him it says i haven't blocked anyone. its really quite annoying and the fact i've tried to contact numerous times about it and they've done absolutely nothing really angers me. does anyone have any idea on what it could be/ what i can do.
thanks. | 2 |
4,930,901 | 02/08/2011 08:20:38 | 607,783 | 02/08/2011 08:20:38 | 1 | 0 | CSV file export | I have some data with in different datatables.
Each datatable is not assured of having the same no of records.
Using all these datatables i need to put those data into a comma delimeted CSV file.
But I found examples only for exporting using a single dataset.
Can any one suggest a way to do this?
And if I insert recod into the CSV file from one dataset how will I insert data from the others at specific headers in the CSV file? | c# | asp.net | null | null | null | 06/13/2012 12:22:14 | not a real question | CSV file export
===
I have some data with in different datatables.
Each datatable is not assured of having the same no of records.
Using all these datatables i need to put those data into a comma delimeted CSV file.
But I found examples only for exporting using a single dataset.
Can any one suggest a way to do this?
And if I insert recod into the CSV file from one dataset how will I insert data from the others at specific headers in the CSV file? | 1 |
7,461,808 | 09/18/2011 13:36:15 | 357,618 | 06/03/2010 15:10:21 | 195 | 4 | How to Console.WriteLine from [TestMethod]? | I am trying to show some information from a [TestMethod] method.
Usually we use NUnit and a line with `Console.WriteLine` runs fine and we can see it in 'output' window, but on this project we must to use Testing tools embebed with VS2010 and `Console.WriteLine` doesn't run because we cannot see anything.
What I want is show trace messages on the 'Output' Window in this way more or less:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Test1
{
[TestClass]
public class TestNum1
{
[TestMethod]
public void Constructors()
{
for (int b = 1; b < 99; b++) {
Console.WriteLine(b.ToString()); // <<<<<<< This don't show on Output.
Assert.AreEqual(b, b); // This is only a silly sample.
}
}
}
}
| c# | visual-studio-2010 | testing | null | null | null | open | How to Console.WriteLine from [TestMethod]?
===
I am trying to show some information from a [TestMethod] method.
Usually we use NUnit and a line with `Console.WriteLine` runs fine and we can see it in 'output' window, but on this project we must to use Testing tools embebed with VS2010 and `Console.WriteLine` doesn't run because we cannot see anything.
What I want is show trace messages on the 'Output' Window in this way more or less:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Test1
{
[TestClass]
public class TestNum1
{
[TestMethod]
public void Constructors()
{
for (int b = 1; b < 99; b++) {
Console.WriteLine(b.ToString()); // <<<<<<< This don't show on Output.
Assert.AreEqual(b, b); // This is only a silly sample.
}
}
}
}
| 0 |
1,000,162 | 06/16/2009 08:23:47 | 111,919 | 05/25/2009 03:20:52 | 58 | 9 | Have abyone used Graph based Databases : http://neo4j.org/ | I have used Relational Db's a lot and decided to venture out on other types available.<br>
This particular product looks good and promising http://neo4j.org/<br>
Have anyone used Graph based databases and can highlisght pro's and con's from usability prespective .<br>Also have you used these in production enviornment and what was you requirement that prompted you to use these ?<br><br>
| database | null | null | null | null | 05/11/2012 15:57:37 | not constructive | Have abyone used Graph based Databases : http://neo4j.org/
===
I have used Relational Db's a lot and decided to venture out on other types available.<br>
This particular product looks good and promising http://neo4j.org/<br>
Have anyone used Graph based databases and can highlisght pro's and con's from usability prespective .<br>Also have you used these in production enviornment and what was you requirement that prompted you to use these ?<br><br>
| 4 |
3,604,894 | 08/30/2010 23:10:47 | 237,507 | 12/23/2009 10:29:48 | 3 | 0 | ASP MVC, Django or Rails? | I've to start my master thesis project and I've to choose a technology to work with. I've used Rails and ASP MVC, in two projects, but never used Django, only some play with it. But I've some experience with python and really like the admin interface.
The objective of my master thesis is a creation of portal to a public hospital.
I have several years of experience with .NET and C#, but the other alternatives are appealing too.
In terms of philosophy, all three are open-source, and ASP MVC works in Mono.
What are your opinion?
| ruby-on-rails | asp.net-mvc | django | asp.net-mvc-2 | healthcare | 08/30/2010 23:44:36 | not constructive | ASP MVC, Django or Rails?
===
I've to start my master thesis project and I've to choose a technology to work with. I've used Rails and ASP MVC, in two projects, but never used Django, only some play with it. But I've some experience with python and really like the admin interface.
The objective of my master thesis is a creation of portal to a public hospital.
I have several years of experience with .NET and C#, but the other alternatives are appealing too.
In terms of philosophy, all three are open-source, and ASP MVC works in Mono.
What are your opinion?
| 4 |
18,126 | 08/20/2008 14:45:27 | 1,409 | 08/15/2008 13:18:51 | 129 | 10 | What tools (other than IDE) to you find useful? | I'm always on the lookout for tools to help make me more efficient, so I was wondering what kinds of tools, other than IDEs/text editors (these have been covered in a few questions), that people use to make themselves more productive.
Here's a list of the tools I currently find useful:
- [Launchy][1] - application launcher, to make launching apps much faster
- [VirtuaWin][2] - Lightweight virtual desktop manager, to make it easier to manage the many windows/apps I have to use.
- [Process Explorer][3] - Task manager replacement, which besides regular Task Manager tasks I use as a simple resource usage measurement tool (can see the CPU, memory, and other stats for the apps I'm working on).
- [TCPView][4] - GUI for netstat, for debugging simple network issues. Also lets you close net connections, which can be helpful for testing network error handling in my apps.
- [Wireshark][5] - packet tracer, for debugging network issues
- [cygwin][6] - For a good commandline experience in windows. I find I can be a lot more efficient at some things by using the command line, and I find zsh *much* easier and more powerful to use than cmd. Also, using xTerms in rootless mode gives me command line windows that are easier to handle (resize just like any other window, unlike cmd windows).
- [Synergy][7] - software-based KVM. Lets me use a single keyboard and mouse for multiple devel boxes.
[1]: http://www.launchy.net/
[2]: http://virtuawin.sourceforge.net/
[3]: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
[4]: http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx
[5]: http://www.wireshark.org/
[6]: http://cygwin.org/
[7]: http://synergy2.sourceforge.net/ | productivity | null | null | null | null | 08/19/2011 16:13:42 | not constructive | What tools (other than IDE) to you find useful?
===
I'm always on the lookout for tools to help make me more efficient, so I was wondering what kinds of tools, other than IDEs/text editors (these have been covered in a few questions), that people use to make themselves more productive.
Here's a list of the tools I currently find useful:
- [Launchy][1] - application launcher, to make launching apps much faster
- [VirtuaWin][2] - Lightweight virtual desktop manager, to make it easier to manage the many windows/apps I have to use.
- [Process Explorer][3] - Task manager replacement, which besides regular Task Manager tasks I use as a simple resource usage measurement tool (can see the CPU, memory, and other stats for the apps I'm working on).
- [TCPView][4] - GUI for netstat, for debugging simple network issues. Also lets you close net connections, which can be helpful for testing network error handling in my apps.
- [Wireshark][5] - packet tracer, for debugging network issues
- [cygwin][6] - For a good commandline experience in windows. I find I can be a lot more efficient at some things by using the command line, and I find zsh *much* easier and more powerful to use than cmd. Also, using xTerms in rootless mode gives me command line windows that are easier to handle (resize just like any other window, unlike cmd windows).
- [Synergy][7] - software-based KVM. Lets me use a single keyboard and mouse for multiple devel boxes.
[1]: http://www.launchy.net/
[2]: http://virtuawin.sourceforge.net/
[3]: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
[4]: http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx
[5]: http://www.wireshark.org/
[6]: http://cygwin.org/
[7]: http://synergy2.sourceforge.net/ | 4 |
3,079,123 | 06/20/2010 11:54:46 | 371,475 | 06/20/2010 10:16:11 | 16 | 2 | Repost: Learning programming in general - virtual mentoring | > **Everyone**: I am reposting this question, because I
> posted this question as an
> unregistered user and I no longer have
> access to that session. The original question was posted here:
> http://stackoverflow.com/questions/3078868?tab=newest#tab-top
> Thanks and sorry for the inconvenience.
> --AspiringGuru
I know some programming. I know little bit of Java, I know some C#, I know some GW Basic. I've followed those 30 minute Ruby, Python tutorials and so on. I took some computer courses in college but didn't take them very seriously at that time. After I finished school, I got an IT job but my luck (or bad luck) I ended up doing non-coding work (requirements analysis, business analysis, project management etc.). I changed jobs and I now work in a "software configuration management" so although the job is technical, I don't really have to code. I just debug people's build files (ant, maven), help people with check-in/check-outs and make sure their project builds on our build-box. I've been doing this for 4 years now and my official title has been "Senior Developer" all this while. So, I kind of feel like an imbecile because I am not really a developer. I haven't yet learned the art of programming.
So, I'd like to get started and teach myself some real world programming. Right now, I can read and understand overall code and make small hacks. But I start sweating when I click "new" in text editor and it opens an empty file. I don't know how to begin programming, how to approach problems? I don't even know syntax of the top of my head. When I am hacking someone else's code, it's easy to change values, modify loops, throw some if/else statements and make whatever changes are required. But writing a complete program from scratch makes me sweat.
So, how do I learn programming? Ideally, it'd be nice to just start working as a junior programmer under a senior programmer but that's not the choice I've right now. Is there a site or some place where I can volunteer and do small work for a proficient/expert programmer for free? Somewhere I can get myself paired as a virtual apprentice (sort of) to a virtual coding-mentor? The mentor can throw some work at me every day and I'd complete it during the day and email the results in the evening. First few weeks, I would not be very productive. I would probably email my coding-mentor a lot of times throughout the day to ask questions/clarifications. But as I learn and absorb more knowledge from my coding-mentor, I'd get more productive and my work would be more and more valuable to my mentor.
This way, I would learn good coding habits/style, some good pointers on how to approach a problem, and I would be helping me mentor in real-world problems so I'd get real-world exposure. Eventually, I'd develop my own style.
I'd prefer to start in Ruby or Python and I'd prefer web-development track. But I will take whatever I can get. The idea is to become better at programming in general. Preference is web development though. I am not really a novice in the world of programming. I am , well, I don't know the word for my skill level.
EDIT: I've followed some beginner books. I've written basic Fibonacci series programs, small games, created to do lists etc. That's what I meant when I said I know some programming. But I can't seem to be able to go further than this. I've done beginner tutorials for several languages But these books/tutorials get boring after a while. Probably because a) it seems pointless to do problems in the book because it's not real-world code, and b) I don't get to pick brains of an expert in real-time -- I mean, the book is not interactive. The questions/doubts that popup in my head at the time of reading the book are usually not answered by the author as such.
I guess I learn better when I am shadowing an expert. Asking questions in real time. I like it when someone catches a rookie mistake in my code and then tells me why it is rookie and how I should/could have thought about the problem.
As for language: I don't mind any language. Ruby is fine, Python is fine, C# is fine, Java is fine. But I'd prefer to learn web-development track. So, Ruby/Python both are preferred. Java/C# not so much. I don't mind doing C++ either but I'd prefer to stay in garbage-collected OO world. Whatever my virtual-mentor (if I find one) decides to use is good for me. The idea is to get better at programming and to develop a programming mindset.
| c++ | python | ruby | algorithm | mentoring | 03/23/2012 13:49:09 | not constructive | Repost: Learning programming in general - virtual mentoring
===
> **Everyone**: I am reposting this question, because I
> posted this question as an
> unregistered user and I no longer have
> access to that session. The original question was posted here:
> http://stackoverflow.com/questions/3078868?tab=newest#tab-top
> Thanks and sorry for the inconvenience.
> --AspiringGuru
I know some programming. I know little bit of Java, I know some C#, I know some GW Basic. I've followed those 30 minute Ruby, Python tutorials and so on. I took some computer courses in college but didn't take them very seriously at that time. After I finished school, I got an IT job but my luck (or bad luck) I ended up doing non-coding work (requirements analysis, business analysis, project management etc.). I changed jobs and I now work in a "software configuration management" so although the job is technical, I don't really have to code. I just debug people's build files (ant, maven), help people with check-in/check-outs and make sure their project builds on our build-box. I've been doing this for 4 years now and my official title has been "Senior Developer" all this while. So, I kind of feel like an imbecile because I am not really a developer. I haven't yet learned the art of programming.
So, I'd like to get started and teach myself some real world programming. Right now, I can read and understand overall code and make small hacks. But I start sweating when I click "new" in text editor and it opens an empty file. I don't know how to begin programming, how to approach problems? I don't even know syntax of the top of my head. When I am hacking someone else's code, it's easy to change values, modify loops, throw some if/else statements and make whatever changes are required. But writing a complete program from scratch makes me sweat.
So, how do I learn programming? Ideally, it'd be nice to just start working as a junior programmer under a senior programmer but that's not the choice I've right now. Is there a site or some place where I can volunteer and do small work for a proficient/expert programmer for free? Somewhere I can get myself paired as a virtual apprentice (sort of) to a virtual coding-mentor? The mentor can throw some work at me every day and I'd complete it during the day and email the results in the evening. First few weeks, I would not be very productive. I would probably email my coding-mentor a lot of times throughout the day to ask questions/clarifications. But as I learn and absorb more knowledge from my coding-mentor, I'd get more productive and my work would be more and more valuable to my mentor.
This way, I would learn good coding habits/style, some good pointers on how to approach a problem, and I would be helping me mentor in real-world problems so I'd get real-world exposure. Eventually, I'd develop my own style.
I'd prefer to start in Ruby or Python and I'd prefer web-development track. But I will take whatever I can get. The idea is to become better at programming in general. Preference is web development though. I am not really a novice in the world of programming. I am , well, I don't know the word for my skill level.
EDIT: I've followed some beginner books. I've written basic Fibonacci series programs, small games, created to do lists etc. That's what I meant when I said I know some programming. But I can't seem to be able to go further than this. I've done beginner tutorials for several languages But these books/tutorials get boring after a while. Probably because a) it seems pointless to do problems in the book because it's not real-world code, and b) I don't get to pick brains of an expert in real-time -- I mean, the book is not interactive. The questions/doubts that popup in my head at the time of reading the book are usually not answered by the author as such.
I guess I learn better when I am shadowing an expert. Asking questions in real time. I like it when someone catches a rookie mistake in my code and then tells me why it is rookie and how I should/could have thought about the problem.
As for language: I don't mind any language. Ruby is fine, Python is fine, C# is fine, Java is fine. But I'd prefer to learn web-development track. So, Ruby/Python both are preferred. Java/C# not so much. I don't mind doing C++ either but I'd prefer to stay in garbage-collected OO world. Whatever my virtual-mentor (if I find one) decides to use is good for me. The idea is to get better at programming and to develop a programming mindset.
| 4 |
4,495,261 | 12/21/2010 00:23:41 | 549,345 | 12/21/2010 00:23:41 | 1 | 0 | Different Instance of Applicationcontext in Broadcastreceiver | I want to access a "global" variable in my MyApp(extends Application) from a broadcastreceiver (registered in the manifest) and e.g. multiple activities. Now I seem to have different instances of my MyApp: one for the BCR and one for the activities. Could sb help me with my problem?
thanks alot
Joerg | android | application | global-variables | broadcastreceiver | null | null | open | Different Instance of Applicationcontext in Broadcastreceiver
===
I want to access a "global" variable in my MyApp(extends Application) from a broadcastreceiver (registered in the manifest) and e.g. multiple activities. Now I seem to have different instances of my MyApp: one for the BCR and one for the activities. Could sb help me with my problem?
thanks alot
Joerg | 0 |
3,355,107 | 07/28/2010 16:29:05 | 404,650 | 07/28/2010 14:45:34 | 1 | 0 | Possibly inconsistent behavior in qplot() ?? | I'm trying to use qplot() to plot a simple time series as one might do using plot(). The x variable is as.POSIXlt and the y is just some continuous measurement. Here is the code with some brief comments. Any help on why these data.frames behave differently would be very much appreciated. As you can see below, I can work around the problem, but I'm curious as to why is doesn't work as I would expect.
A few details:
platform: OS X 10.6.4
R version: R 2.11.0
Disclaimer: I realize that I could dig into the source code and figure this out myself. I've never used SO and thought that it might be a nice topic for this forum.
Disclaimer (2): I'm new to ggplot2
library(ggplot2)
ws.dat <- read.csv("~/path/to/filename.csv",header=F)
names(ws.dat) <- c("s","t","w")
ws.dat$new.t <- as.POSIXlt(ws.dat$t)
ws.dat[1:5,]
## s t w new.t
## 1 29522 2005-07-02 00:00:00 5.00 2005-07-02 00:00:00
## 2 29522 2005-07-02 00:10:00 5.29 2005-07-02 00:10:00
## 3 29522 2005-07-02 00:20:00 5.48 2005-07-02 00:20:00
## 4 29522 2005-07-02 00:30:00 5.54 2005-07-02 00:30:00
## 5 29522 2005-07-02 00:40:00 5.49 2005-07-02 00:40:00
## the following works
plot(as.POSIXlt(ws.dat$t), ws.dat$w)
## doesn't work
qplot(as.POSIXlt(t), w, data = ws.dat)
## Error in if (length(range) == 1 || diff(range) == 0) { :
## missing value where TRUE/FALSE needed
## doesn't work
ws.dat$new.t <- as.POSIXlt(ws.dat$t)
qplot(new.t, w, data = ws.dat)
## Same error as above
## Note - I could find a more elegant way of doing this; I'm just trying
## to reproduce as fast as possible.
new.df <- data.frame(ws.dat$new.t, ws.dat$w)
new.df[1:5,]
## ws.dat.new.t ws.dat.w
## 1 2005-07-02 00:00:00 5.00
## 2 2005-07-02 00:10:00 5.29
## 3 2005-07-02 00:20:00 5.48
## 4 2005-07-02 00:30:00 5.54
## 5 2005-07-02 00:40:00 5.49
## 'works as *I* would expect'; this is != 'works *as* expected'
qplot(ws.dat.new.t, ws.dat.w, data = new.df)
| r | statistics | null | null | null | null | open | Possibly inconsistent behavior in qplot() ??
===
I'm trying to use qplot() to plot a simple time series as one might do using plot(). The x variable is as.POSIXlt and the y is just some continuous measurement. Here is the code with some brief comments. Any help on why these data.frames behave differently would be very much appreciated. As you can see below, I can work around the problem, but I'm curious as to why is doesn't work as I would expect.
A few details:
platform: OS X 10.6.4
R version: R 2.11.0
Disclaimer: I realize that I could dig into the source code and figure this out myself. I've never used SO and thought that it might be a nice topic for this forum.
Disclaimer (2): I'm new to ggplot2
library(ggplot2)
ws.dat <- read.csv("~/path/to/filename.csv",header=F)
names(ws.dat) <- c("s","t","w")
ws.dat$new.t <- as.POSIXlt(ws.dat$t)
ws.dat[1:5,]
## s t w new.t
## 1 29522 2005-07-02 00:00:00 5.00 2005-07-02 00:00:00
## 2 29522 2005-07-02 00:10:00 5.29 2005-07-02 00:10:00
## 3 29522 2005-07-02 00:20:00 5.48 2005-07-02 00:20:00
## 4 29522 2005-07-02 00:30:00 5.54 2005-07-02 00:30:00
## 5 29522 2005-07-02 00:40:00 5.49 2005-07-02 00:40:00
## the following works
plot(as.POSIXlt(ws.dat$t), ws.dat$w)
## doesn't work
qplot(as.POSIXlt(t), w, data = ws.dat)
## Error in if (length(range) == 1 || diff(range) == 0) { :
## missing value where TRUE/FALSE needed
## doesn't work
ws.dat$new.t <- as.POSIXlt(ws.dat$t)
qplot(new.t, w, data = ws.dat)
## Same error as above
## Note - I could find a more elegant way of doing this; I'm just trying
## to reproduce as fast as possible.
new.df <- data.frame(ws.dat$new.t, ws.dat$w)
new.df[1:5,]
## ws.dat.new.t ws.dat.w
## 1 2005-07-02 00:00:00 5.00
## 2 2005-07-02 00:10:00 5.29
## 3 2005-07-02 00:20:00 5.48
## 4 2005-07-02 00:30:00 5.54
## 5 2005-07-02 00:40:00 5.49
## 'works as *I* would expect'; this is != 'works *as* expected'
qplot(ws.dat.new.t, ws.dat.w, data = new.df)
| 0 |
5,440,238 | 03/26/2011 03:43:05 | 323,720 | 04/22/2010 21:30:00 | 109 | 1 | How do I load instances of a certain class from a java directory? | Here's my method:
Feature[] getFeatures(File dir)
I'm trying to go through the directory, check each class file. Any class that is of type 'Feature', I want to load an instance of it. Then I want to return an array of these instances.
How is this done?
Thank you. | java | null | null | null | null | null | open | How do I load instances of a certain class from a java directory?
===
Here's my method:
Feature[] getFeatures(File dir)
I'm trying to go through the directory, check each class file. Any class that is of type 'Feature', I want to load an instance of it. Then I want to return an array of these instances.
How is this done?
Thank you. | 0 |
2,919,946 | 05/27/2010 09:33:27 | 381,293 | 05/26/2010 15:33:41 | 1 | 3 | perl and sed how to combine if and unless in perl | I have the two perl command
perl -pe "s/\b$a\b/$b/g if m/param1 /" test
and
perl -pe "s/\b$a\b/$b/g unless /^#/" test
how to use combine the if m/somthing/ and the unless /something/
for example
[root@localhost tmp]# perl -pe "s/\b$a\b/$b/g if m/param1/ unless /^#/" test
syntax error at -e line 1, near "m/param1/ unless"
but its now work
THX | perl | null | null | null | null | null | open | perl and sed how to combine if and unless in perl
===
I have the two perl command
perl -pe "s/\b$a\b/$b/g if m/param1 /" test
and
perl -pe "s/\b$a\b/$b/g unless /^#/" test
how to use combine the if m/somthing/ and the unless /something/
for example
[root@localhost tmp]# perl -pe "s/\b$a\b/$b/g if m/param1/ unless /^#/" test
syntax error at -e line 1, near "m/param1/ unless"
but its now work
THX | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.