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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,664,295 | 12/29/2011 05:24:01 | 1,120,405 | 12/29/2011 03:44:01 | 1 | 0 | Does unordered_map copy/release contained objects if there is insert/remove/rehash operation? | I wanna store small objects in unordered_map, just wondering if it may copy/release contained objects if there is any insert/remove/rehash operation? I think unordered_map uses link list to store key/value pair, it should not need to copy/release objects like vector for memory reallocation. | c++ | boost | stl | null | null | null | open | Does unordered_map copy/release contained objects if there is insert/remove/rehash operation?
===
I wanna store small objects in unordered_map, just wondering if it may copy/release contained objects if there is any insert/remove/rehash operation? I think unordered_map uses link list to store key/value pair, it should not need to copy/release objects like vector for memory reallocation. | 0 |
9,293,777 | 02/15/2012 12:53:26 | 502,044 | 11/09/2010 15:04:12 | 403 | 4 | cannot run a .svb file | I am using Windows 7 and have associated .svb files with C:\Windows\System32\wscript.exe which is the Windows Script Host program
But when I click the file I get the popup "There is no script engine for file extension .svb"
I have googled it but cold find a solution
Any ideas? | windows | windows-7 | script | null | null | null | open | cannot run a .svb file
===
I am using Windows 7 and have associated .svb files with C:\Windows\System32\wscript.exe which is the Windows Script Host program
But when I click the file I get the popup "There is no script engine for file extension .svb"
I have googled it but cold find a solution
Any ideas? | 0 |
9,082,510 | 01/31/2012 15:50:57 | 350,305 | 05/25/2010 20:26:31 | 1 | 0 | Pull street names from mysql to dropdown with php and display results on next page | I have searched all around stackoverflow, and only come across vague code on how to proceed. The closest was how to do multiple drop-downs based on one selection.
The overall concept is to pull street names from MySQL table with PHP into dropdown. On selection, display list of all people with that street name.
| php | mysql | null | null | null | 02/01/2012 02:06:33 | not a real question | Pull street names from mysql to dropdown with php and display results on next page
===
I have searched all around stackoverflow, and only come across vague code on how to proceed. The closest was how to do multiple drop-downs based on one selection.
The overall concept is to pull street names from MySQL table with PHP into dropdown. On selection, display list of all people with that street name.
| 1 |
4,527,552 | 12/24/2010 17:30:12 | 264,052 | 02/02/2010 04:03:26 | 1,395 | 7 | How does IE downloading is achieved? | I often click on a file link in the IE and a download box just pops out. But what happens behind this scene? I know that IE always talks to web server with HTTP protocol, and HTTP is **text based**.
So is IE download achieved with HTTP protocol? If so, how could arbitrary file format be downloaded over a text based protocol?
And I am currently trying to make a web app which will direct my customer to download some file. My current design is to implement a web service. Customer will call this web service and the web service will return the file download URL. But then I don't know what to do with the URL. Could I just use something like File.Copy to copy the file from the URL to local disk? Or how should I treat the URL? If there's a better design, please teach me.
Many thanks... | web-services | internet-explorer | download | null | null | null | open | How does IE downloading is achieved?
===
I often click on a file link in the IE and a download box just pops out. But what happens behind this scene? I know that IE always talks to web server with HTTP protocol, and HTTP is **text based**.
So is IE download achieved with HTTP protocol? If so, how could arbitrary file format be downloaded over a text based protocol?
And I am currently trying to make a web app which will direct my customer to download some file. My current design is to implement a web service. Customer will call this web service and the web service will return the file download URL. But then I don't know what to do with the URL. Could I just use something like File.Copy to copy the file from the URL to local disk? Or how should I treat the URL? If there's a better design, please teach me.
Many thanks... | 0 |
137,657 | 09/26/2008 03:47:07 | 115 | 08/02/2008 05:44:40 | 2,474 | 218 | Free insaller | Is there something like install shield that I can use for free? | installer | null | null | null | null | 06/14/2012 16:48:46 | not constructive | Free insaller
===
Is there something like install shield that I can use for free? | 4 |
4,238,698 | 11/21/2010 15:44:00 | 514,103 | 11/16/2010 19:20:39 | 56 | 0 | Do the simplicity of PHP is in the languge itself or is there anonter thing that make it simple? | Everyone says that PHP is simpler than ASP.NET and C#, why it is easier ans simpler?
Considering C# and PHP for web development, what is the thing that make PHP easier exactly? I want to understand this point please. | c# | php | null | null | null | 11/22/2010 02:15:40 | not constructive | Do the simplicity of PHP is in the languge itself or is there anonter thing that make it simple?
===
Everyone says that PHP is simpler than ASP.NET and C#, why it is easier ans simpler?
Considering C# and PHP for web development, what is the thing that make PHP easier exactly? I want to understand this point please. | 4 |
9,571,014 | 03/05/2012 17:20:58 | 401,643 | 07/25/2010 16:56:58 | 338 | 3 | design workflow in an asp.net mvc application | I have an application that could be divided into 2 modes. Template mode and detail plan mode. Please do not take the modes literally its just a sample to show you the workflow. In both modes there is a tree control on the left and a datagrid onn the right. In each mode the datagrid has some more or less columns and depending on the mode I am i have a save button called save_template or save_detailplan with the appropriate functionality. How can I design the 'mode' stuff ? | asp.net-mvc | design | application | workflow | null | 03/05/2012 20:01:59 | not a real question | design workflow in an asp.net mvc application
===
I have an application that could be divided into 2 modes. Template mode and detail plan mode. Please do not take the modes literally its just a sample to show you the workflow. In both modes there is a tree control on the left and a datagrid onn the right. In each mode the datagrid has some more or less columns and depending on the mode I am i have a save button called save_template or save_detailplan with the appropriate functionality. How can I design the 'mode' stuff ? | 1 |
5,325,326 | 03/16/2011 12:33:17 | 662,483 | 03/16/2011 12:33:17 | 1 | 0 | Assembly output of Hello world written in C | I ran gcc -S over this:
int main()
{
printf ("Hello world!");
}
and I got this assembly code:
.file "test.c"
.section .rodata
.LC0:
.string "Hello world!"
.text
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
subl $20, %esp
movl $.LC0, (%esp)
call printf
addl $20, %esp
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size main, .-main
.ident "GCC: (GNU) 4.3.0 20080428 (Red Hat 4.3.0-8)"
.section .note.GNU-stack,"",@progbits
I am not great at assembly and I am curious to understand this output. Can someone share some pointers in understanding this output, or if someone could mark comments against each of these lines/group of lines explaining what it does it would be great.
Thanks.
| assembly | null | null | null | null | null | open | Assembly output of Hello world written in C
===
I ran gcc -S over this:
int main()
{
printf ("Hello world!");
}
and I got this assembly code:
.file "test.c"
.section .rodata
.LC0:
.string "Hello world!"
.text
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
subl $20, %esp
movl $.LC0, (%esp)
call printf
addl $20, %esp
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size main, .-main
.ident "GCC: (GNU) 4.3.0 20080428 (Red Hat 4.3.0-8)"
.section .note.GNU-stack,"",@progbits
I am not great at assembly and I am curious to understand this output. Can someone share some pointers in understanding this output, or if someone could mark comments against each of these lines/group of lines explaining what it does it would be great.
Thanks.
| 0 |
7,068,771 | 08/15/2011 18:10:23 | 886,454 | 08/09/2011 17:29:18 | 1 | 0 | Using uTorrent Web API via .NET | I'm trying to get list of torrents from uTorrent using [Web API](http://www.utorrent.com/community/developers/webapi). Getting required token goes O.K.:
WebClient client = new WebClient() { Credentials = new NetworkCredential(UserName, pass) };
StreamReader Reader = new StreamReader(client.OpenRead("http://localhost:" + port + "/gui/token.html"));
string token = Reader.ReadToEnd();
token = token.Split('>')[2].Split('<')[0];
// token is now something like 3LemfrO_-A-SNBXlnQ2QcQWTYydx7qOqKb1W1S54JJW74Ly3EYGgu0xQSU4AAAAA
But when I try to use it to get list of torrents:
Reader = new StreamReader(client.OpenRead("http://localhost:" + port + "/gui/?list=1&token=" + token));
all I get is "Error 400 Bad request".
I've tried to get token manually. In browser page "http://localhost:30303/gui/?list=1&token=3LemfrO_-A-SNBXlnQ2QcQWTYydx7qOqKb1W1S54JJW74Ly3EYGgu0xQSU4AAAAA" opens as it should, but in C# with the same link without any variables I still get error 400.
The interesting part is that if switch off token authentication WebClient load page perfectly with and without
"&token=3LemfrO_-A-SNBXlnQ2QcQWTYydx7qOqKb1W1S54JJW74Ly3EYGgu0xQSU4AAAAA"
but token auth enabled by default, so my and any app should use it.
P.S. sorry for my English, I was never able to make it work right | c# | .net | token | web-api | utorrent | null | open | Using uTorrent Web API via .NET
===
I'm trying to get list of torrents from uTorrent using [Web API](http://www.utorrent.com/community/developers/webapi). Getting required token goes O.K.:
WebClient client = new WebClient() { Credentials = new NetworkCredential(UserName, pass) };
StreamReader Reader = new StreamReader(client.OpenRead("http://localhost:" + port + "/gui/token.html"));
string token = Reader.ReadToEnd();
token = token.Split('>')[2].Split('<')[0];
// token is now something like 3LemfrO_-A-SNBXlnQ2QcQWTYydx7qOqKb1W1S54JJW74Ly3EYGgu0xQSU4AAAAA
But when I try to use it to get list of torrents:
Reader = new StreamReader(client.OpenRead("http://localhost:" + port + "/gui/?list=1&token=" + token));
all I get is "Error 400 Bad request".
I've tried to get token manually. In browser page "http://localhost:30303/gui/?list=1&token=3LemfrO_-A-SNBXlnQ2QcQWTYydx7qOqKb1W1S54JJW74Ly3EYGgu0xQSU4AAAAA" opens as it should, but in C# with the same link without any variables I still get error 400.
The interesting part is that if switch off token authentication WebClient load page perfectly with and without
"&token=3LemfrO_-A-SNBXlnQ2QcQWTYydx7qOqKb1W1S54JJW74Ly3EYGgu0xQSU4AAAAA"
but token auth enabled by default, so my and any app should use it.
P.S. sorry for my English, I was never able to make it work right | 0 |
9,672,093 | 03/12/2012 17:45:06 | 1,150,718 | 01/15/2012 18:32:28 | 20 | 0 | Best resources to learn C/C++ | I am mostly a javascript/jquery developer programming UI/UX experiences but I want to learn more about other languages such as C/C++ and I am not really sure where to start...
Do I learn Java first? I don't know! I was wondering what the best way to go about this was? | java | c++ | c | null | null | 03/12/2012 17:50:24 | not a real question | Best resources to learn C/C++
===
I am mostly a javascript/jquery developer programming UI/UX experiences but I want to learn more about other languages such as C/C++ and I am not really sure where to start...
Do I learn Java first? I don't know! I was wondering what the best way to go about this was? | 1 |
6,070,092 | 05/20/2011 09:42:47 | 719,115 | 04/21/2011 14:28:51 | 11 | 0 | Comparing Times 24 Hour Intervals | I have 2 timestamps in JavaScript. One timestamp comes from an Ajax call to my database and the other is generated when the script it loaded.
What I want to do is check to see if the timestamp from the database is older than 24 hours compared the timestamp that was just generated.
In my case the database timestamp is always going to be lesser than the current timestamp.
Would this work?
var currentTimestamp = Math.round(new Date().getTime() / 1000);
if((currentTimestamp - databaseTimestamp) >= 86400) {
// Older than 24 hours
} else {
// Less than 24 hours
}
... or is there a better way? | javascript | null | null | null | null | null | open | Comparing Times 24 Hour Intervals
===
I have 2 timestamps in JavaScript. One timestamp comes from an Ajax call to my database and the other is generated when the script it loaded.
What I want to do is check to see if the timestamp from the database is older than 24 hours compared the timestamp that was just generated.
In my case the database timestamp is always going to be lesser than the current timestamp.
Would this work?
var currentTimestamp = Math.round(new Date().getTime() / 1000);
if((currentTimestamp - databaseTimestamp) >= 86400) {
// Older than 24 hours
} else {
// Less than 24 hours
}
... or is there a better way? | 0 |
7,808,494 | 10/18/2011 14:03:28 | 523,960 | 11/29/2010 13:37:15 | 113 | 0 | Which Python GUI IDE is the most widely used? | I am still kind of new to programming and after playing around with a lot of languages trying to find which one worked best for me I stumbled across python and have been doing really well with it.
The only problem/concern I have is that I do not mainly want to do web development. I want to create desktop apps with nice GUis as well. Unlike most other programming languages that I have dabbled in python doesn't seem to have one definitive ide for this sort of thing which kind of sucks imo, especially since it's such a cool language.
I've searched and found quite a few IDEs that include GUI designers with code editing as well but I can't decide which one to use. Of those I am interested in the following
BlackAdder - http://www.thekompany.com/products/blackadder/<br>
Pythoncard - http://pythoncard.sourceforge.net/<br>
Boa Constructor - http://boa-constructor.sourceforge.net/<br>
SPE - http://pythonide.blogspot.com/<BR>
Dabo (is it even an ide?) - http://dabodev.com/<BR>
Eric IDE - http://eric-ide.python-projects.org/index.html<BR>
Xrope - http://xrope.sourceforge.net/<br>
I am not looking for opinions on which one is the "best" or anyone's favorite. I want to know which one is the most widely used and which one I would be able to find the most documentation on and get the most user support from whether it be via forums, here, community, etc..
P.S. If anyone cares to post any links to some documentation/tutorials with their answer it would be greatly appreciated.
P.P.S. Does anyone know if there are any plans for a larger company maybe thinking of creating a full fledged ide comparable to Delphi, Visual Studio for python in the foreseeable future? Would make things a lot easier IMO.
Thanks..
| python | wxpython | null | null | null | 10/18/2011 15:44:02 | not constructive | Which Python GUI IDE is the most widely used?
===
I am still kind of new to programming and after playing around with a lot of languages trying to find which one worked best for me I stumbled across python and have been doing really well with it.
The only problem/concern I have is that I do not mainly want to do web development. I want to create desktop apps with nice GUis as well. Unlike most other programming languages that I have dabbled in python doesn't seem to have one definitive ide for this sort of thing which kind of sucks imo, especially since it's such a cool language.
I've searched and found quite a few IDEs that include GUI designers with code editing as well but I can't decide which one to use. Of those I am interested in the following
BlackAdder - http://www.thekompany.com/products/blackadder/<br>
Pythoncard - http://pythoncard.sourceforge.net/<br>
Boa Constructor - http://boa-constructor.sourceforge.net/<br>
SPE - http://pythonide.blogspot.com/<BR>
Dabo (is it even an ide?) - http://dabodev.com/<BR>
Eric IDE - http://eric-ide.python-projects.org/index.html<BR>
Xrope - http://xrope.sourceforge.net/<br>
I am not looking for opinions on which one is the "best" or anyone's favorite. I want to know which one is the most widely used and which one I would be able to find the most documentation on and get the most user support from whether it be via forums, here, community, etc..
P.S. If anyone cares to post any links to some documentation/tutorials with their answer it would be greatly appreciated.
P.P.S. Does anyone know if there are any plans for a larger company maybe thinking of creating a full fledged ide comparable to Delphi, Visual Studio for python in the foreseeable future? Would make things a lot easier IMO.
Thanks..
| 4 |
8,365,203 | 12/03/2011 03:15:00 | 719,998 | 04/22/2011 03:29:42 | 1 | 0 | How to write a PHP to capture daily currency rates and store in mySQL? | I am new to PHP & mySQL.
I would like to know how to write a PHP to get/parse the daily currency rate (say USD and EUR) and store them in mysql database?
Any tutorial would be very helpful | php | mysql | currency | null | null | 12/03/2011 07:58:42 | not a real question | How to write a PHP to capture daily currency rates and store in mySQL?
===
I am new to PHP & mySQL.
I would like to know how to write a PHP to get/parse the daily currency rate (say USD and EUR) and store them in mysql database?
Any tutorial would be very helpful | 1 |
11,254,568 | 06/29/2012 00:07:29 | 1,367,853 | 05/01/2012 13:49:01 | 21 | 1 | Array return is not working | use Text::Diff;
my $count;
our $stats2 = 0;
for($count = 0; $count <= 1000; $count++){
my $data_dir="archive/oswiostat/oracleapps.*dat";
my $data_file= `ls -t $data_dir | head -1`;
chomp($data_file);
while(defined($data_file)){
print $data_file;
open (DAT,$data_file) || die("Could not open file! $!");
my @stats1 = stat $data_file;
@raw_data=<DAT>;
close(DAT);
print "Stats1 is :$stats1[9]\n";
sleep(5);
print "Checking $stats1[9] equals $stats2\n";
chomp $stats[9];
chomp $stats2;
if($stats1[9] != $stats2){
print "I am here";
my @diff = diff \@raw_data, \@raw_data2, { STYLE => "Context" };
@trim_diff = removedash(@diff);
print "@trim_diff";
}
@raw_data2=@raw_data;
$stats2 = $stats1[9];
print "Stat2: $stats2\n";
}
}
sub removedash {
print "Its in sub";
my $cnt=0;
foreach (@_) {
chomp;
if (/^- /){
s#^- ##g;
$ar[$cnt] = "$_\n";
$cnt++;
}
}
return (@ar);
}
I am using a sub to remove dashes from array and send it back. The @trim_diff should have the return @ar, but it is showing nothing. I am not sure where i have done wrong. Can you guys help me with it? | perl | null | null | null | null | 07/02/2012 03:04:10 | too localized | Array return is not working
===
use Text::Diff;
my $count;
our $stats2 = 0;
for($count = 0; $count <= 1000; $count++){
my $data_dir="archive/oswiostat/oracleapps.*dat";
my $data_file= `ls -t $data_dir | head -1`;
chomp($data_file);
while(defined($data_file)){
print $data_file;
open (DAT,$data_file) || die("Could not open file! $!");
my @stats1 = stat $data_file;
@raw_data=<DAT>;
close(DAT);
print "Stats1 is :$stats1[9]\n";
sleep(5);
print "Checking $stats1[9] equals $stats2\n";
chomp $stats[9];
chomp $stats2;
if($stats1[9] != $stats2){
print "I am here";
my @diff = diff \@raw_data, \@raw_data2, { STYLE => "Context" };
@trim_diff = removedash(@diff);
print "@trim_diff";
}
@raw_data2=@raw_data;
$stats2 = $stats1[9];
print "Stat2: $stats2\n";
}
}
sub removedash {
print "Its in sub";
my $cnt=0;
foreach (@_) {
chomp;
if (/^- /){
s#^- ##g;
$ar[$cnt] = "$_\n";
$cnt++;
}
}
return (@ar);
}
I am using a sub to remove dashes from array and send it back. The @trim_diff should have the return @ar, but it is showing nothing. I am not sure where i have done wrong. Can you guys help me with it? | 3 |
4,970,534 | 02/11/2011 15:04:36 | 217,187 | 11/23/2009 17:25:04 | 92 | 12 | iPhone Objective C oauth 2.0 Login - unsupported_grant_type | I am brand new to salesforce development and am trying to connect to Sales force to get the token.
I guess my question is 2 fold:
1) Do I have to use a webpage to authenticate with SF?
2) If not, why is this not working? When I try to use the username and password method of authenticating, I get:
{"error":"unsupported_grant_type","error_description":"grant type not supported"}
Here is my code:
NSString *post = [NSString stringWithFormat:@"grant_type=basic-credentials&client_id=%@&client_secret=%@&redirect_uri=%@",
kOAuthClientID,
kOAuthClientSecret,
kOAuthClientAuthURL
];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:kOAuthClientTokenUrl]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSError *error;
NSURLResponse *response;
NSLog(@"%@", request);
NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
NSLog(@"%@", data);
Any thoughts would be welcome.
(I did try using grant_type = authorization_code but got another error: {"error":"invalid_grant","error_description":"invalid authorization code"}) | iphone | oauth | salesforce | nsurlrequest | oauth-2.0 | null | open | iPhone Objective C oauth 2.0 Login - unsupported_grant_type
===
I am brand new to salesforce development and am trying to connect to Sales force to get the token.
I guess my question is 2 fold:
1) Do I have to use a webpage to authenticate with SF?
2) If not, why is this not working? When I try to use the username and password method of authenticating, I get:
{"error":"unsupported_grant_type","error_description":"grant type not supported"}
Here is my code:
NSString *post = [NSString stringWithFormat:@"grant_type=basic-credentials&client_id=%@&client_secret=%@&redirect_uri=%@",
kOAuthClientID,
kOAuthClientSecret,
kOAuthClientAuthURL
];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:kOAuthClientTokenUrl]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSError *error;
NSURLResponse *response;
NSLog(@"%@", request);
NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
NSLog(@"%@", data);
Any thoughts would be welcome.
(I did try using grant_type = authorization_code but got another error: {"error":"invalid_grant","error_description":"invalid authorization code"}) | 0 |
6,225,617 | 06/03/2011 10:02:51 | 342,279 | 05/16/2010 08:28:06 | 270 | 6 | PHP keep form info after submit form failed | I am building a form in a mvc system view, and i want that all the inserted values will be kept,in case of form submit failure.
How can this be done: i tried like (example for a field):
<label for="user_firstname">Nume</label>
<input id="user_firstname" type="text" name="user_firstname" value=<?= $_POST['user_firstmane'] ?> >
<? if (isset($errors['user_firstname'])): ?>
<span class="error"><?= $errors['user_firstname']; ?></span>
<? endif; ?>
but of course, it doesn't work the first time (when no post action is done).
what is the simplest way to do this? any ideas?
thank you | php | forms | value | submit | null | null | open | PHP keep form info after submit form failed
===
I am building a form in a mvc system view, and i want that all the inserted values will be kept,in case of form submit failure.
How can this be done: i tried like (example for a field):
<label for="user_firstname">Nume</label>
<input id="user_firstname" type="text" name="user_firstname" value=<?= $_POST['user_firstmane'] ?> >
<? if (isset($errors['user_firstname'])): ?>
<span class="error"><?= $errors['user_firstname']; ?></span>
<? endif; ?>
but of course, it doesn't work the first time (when no post action is done).
what is the simplest way to do this? any ideas?
thank you | 0 |
9,086,238 | 01/31/2012 20:12:33 | 993,963 | 10/13/2011 16:57:58 | 3 | 0 | SQL2008R2 - AdventureWorksR2 - Fatal Error | I get an error whilst installing Adventureworks.
Got SQL Server 2008 R2 and same AdventureWorks version.
I start the installation, it starts extract all scripts and so on. When I accept the License Terms and press next, I get an error.
Fatal error: Details
ISupportInitialize.EndInit. An exception occured in SMO while trying to manage a service. Row 78, position 3.
Have read about this problem quite a while, seem to be to retarded to understand...
Sorry to dirty the forum down with such a question. But I really need help :P | sql | fatal-error | adventureworks | null | null | 01/31/2012 21:21:55 | off topic | SQL2008R2 - AdventureWorksR2 - Fatal Error
===
I get an error whilst installing Adventureworks.
Got SQL Server 2008 R2 and same AdventureWorks version.
I start the installation, it starts extract all scripts and so on. When I accept the License Terms and press next, I get an error.
Fatal error: Details
ISupportInitialize.EndInit. An exception occured in SMO while trying to manage a service. Row 78, position 3.
Have read about this problem quite a while, seem to be to retarded to understand...
Sorry to dirty the forum down with such a question. But I really need help :P | 2 |
8,061,984 | 11/09/2011 08:11:39 | 763,794 | 05/21/2011 08:19:47 | 1 | 1 | Recommendation on response handling for the ajax-upload script | I have used the multiple-file upload script from valums.com/ajax-upload/
How I can handle the JSON-response?
The actually input parameter 'responseJSON' of the 'onComplete' function is some '__proto__: Object' object. It hasn't the valid JSON format.
However, the server response has the valid JSON format content. Below you may see 'onComplete' function and debugger screenshot link.
Debugger screenshot - http://bit.ly/sB5mK0
Uncaught ТуреЕrrоr: Cannot read property 'src' of null
onComplete : function(id, filename, responseJSON) {
console.log('File upload for file %s, id %s done with status %s', filename, id, responseJSON);
var json = $.parseJSON(responseJSON);
avatarPreview.attr('src', json.src);
}
You may see the request and response content on the next link:
http://pastebin.com/aWcTaUAJ
Thank you very much for your time! | javascript | jquery | json | ajax-upload | ajaxuploader | null | open | Recommendation on response handling for the ajax-upload script
===
I have used the multiple-file upload script from valums.com/ajax-upload/
How I can handle the JSON-response?
The actually input parameter 'responseJSON' of the 'onComplete' function is some '__proto__: Object' object. It hasn't the valid JSON format.
However, the server response has the valid JSON format content. Below you may see 'onComplete' function and debugger screenshot link.
Debugger screenshot - http://bit.ly/sB5mK0
Uncaught ТуреЕrrоr: Cannot read property 'src' of null
onComplete : function(id, filename, responseJSON) {
console.log('File upload for file %s, id %s done with status %s', filename, id, responseJSON);
var json = $.parseJSON(responseJSON);
avatarPreview.attr('src', json.src);
}
You may see the request and response content on the next link:
http://pastebin.com/aWcTaUAJ
Thank you very much for your time! | 0 |
3,852,349 | 10/04/2010 01:43:44 | 465,471 | 10/04/2010 01:43:44 | 1 | 0 | How do I show another window in an IPhone window application | First of all, I'm new to Objective-C and IPhone programming. There is somehing I can not get to work. I have a IPhone window application and in the MainWindow I have a button. I want to show another window when I click the button. I've bind the event with my controller. I just don't know how to show my other window (otherWindow) in the event.
Anyone can guide to do this ? Thank you | iphone | objective-c | cocoa-touch | xcode | null | null | open | How do I show another window in an IPhone window application
===
First of all, I'm new to Objective-C and IPhone programming. There is somehing I can not get to work. I have a IPhone window application and in the MainWindow I have a button. I want to show another window when I click the button. I've bind the event with my controller. I just don't know how to show my other window (otherWindow) in the event.
Anyone can guide to do this ? Thank you | 0 |
8,401,345 | 12/06/2011 14:18:44 | 809,356 | 06/21/2011 22:23:52 | 71 | 1 | How to imitate a web host failure to check if the backup works | Because my main web host has failed me before, and because I have accounts in two different web hosts, I am thinking on using them both to make sure my websites are always up. The idea is to set one host as the primary DNS, and the other as the secondary DNS, so that if the first one fails, the traffic gets automatically redirected to the second one. But I am not sure if it will work, so I want to test it. And in order to do so, I think I need to somehow fake or imitate a failure in the first host, to see if the traffic goes to the second. Is there any way to do so? Or maybe my quest is misguided? Any help is appreciated, thanks! | hosting | dns | null | null | null | 12/06/2011 16:24:12 | off topic | How to imitate a web host failure to check if the backup works
===
Because my main web host has failed me before, and because I have accounts in two different web hosts, I am thinking on using them both to make sure my websites are always up. The idea is to set one host as the primary DNS, and the other as the secondary DNS, so that if the first one fails, the traffic gets automatically redirected to the second one. But I am not sure if it will work, so I want to test it. And in order to do so, I think I need to somehow fake or imitate a failure in the first host, to see if the traffic goes to the second. Is there any way to do so? Or maybe my quest is misguided? Any help is appreciated, thanks! | 2 |
7,910,415 | 10/27/2011 00:14:38 | 915,109 | 08/27/2011 03:56:10 | 1 | 0 | Where the a class instance will be located on memory if it is declared as A a ? | If declare an instance of class A :
"A a;"
which kind of memory type will it be created on?
any other type of memory type?
My solution:
It depends on where it is declared.
If it is a global variable, and outside any class and functions, it is on heap.
If it in a class or function, it is on stack.
If is in a namespace, it is on heap .
right?
thanks
| java | c++ | c | class | object | 10/27/2011 00:46:39 | not a real question | Where the a class instance will be located on memory if it is declared as A a ?
===
If declare an instance of class A :
"A a;"
which kind of memory type will it be created on?
any other type of memory type?
My solution:
It depends on where it is declared.
If it is a global variable, and outside any class and functions, it is on heap.
If it in a class or function, it is on stack.
If is in a namespace, it is on heap .
right?
thanks
| 1 |
7,373,767 | 09/10/2011 18:34:16 | 938,478 | 09/10/2011 18:34:16 | 1 | 0 | Why My C# program runs on my Pc but not in other computers? | I used C# language in visual studio 2008 and some SQL server management databases in my program
but here in my computer the program runs well but in other Pcs it just can't be run :(
My databases use windows authentication ( not sql server authentication )and I just added them in my project
I guess the problem is my databases but what should I do?
| sql-server-2008 | c#-4.0 | null | null | null | 09/10/2011 19:49:54 | not a real question | Why My C# program runs on my Pc but not in other computers?
===
I used C# language in visual studio 2008 and some SQL server management databases in my program
but here in my computer the program runs well but in other Pcs it just can't be run :(
My databases use windows authentication ( not sql server authentication )and I just added them in my project
I guess the problem is my databases but what should I do?
| 1 |
4,648,728 | 01/10/2011 16:02:45 | 570,063 | 01/10/2011 16:02:46 | 1 | 0 | BST red black - :(( | i need to insert, delete a node and rotate a Red-Black tree but nothing i do works!
can somebody help me?
i use c++(Microsoft Visual Studio 2008) | binary-tree | null | null | null | null | 01/10/2011 16:10:04 | not a real question | BST red black - :((
===
i need to insert, delete a node and rotate a Red-Black tree but nothing i do works!
can somebody help me?
i use c++(Microsoft Visual Studio 2008) | 1 |
7,953,916 | 10/31/2011 12:48:17 | 754,352 | 05/15/2011 09:41:28 | 82 | 0 | auto scroller horizontal images from database | i have following code that generate some images with urls associated from database
<html>
<head>
<title></title>
</head>
<body>
<div id="datacontainer">
<?php
ini_set('display_errors', 0);
header('Content-type: text/html; charset=UTF-8') ;
//Retriving informations from database
mysql_connect("****", "****", "*****");
mysql_select_db("*****);
$result = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 52");
print "<table width='200' border='0' ><style>
td {overflow:hidden;}
</style> ";
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$link=$row['url'];
$title=$row['siteTitle'];
$thumb= $row['url'];
print " <tr>
<td><div style= 'text-align:center;height:90px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link' target='_blank'><img src='http://open.thumbshots.org/image.pxf?url=$thumb'/></a></div></td>
</tr>
<tr>
<td><div style= 'text-align:center;height:20px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link'target='_blank'><font color='0000ff'>$title </font></a></div></td>
</tr>";
}
print"</table>";
?>
</div>
</body>
</html>
i need of implement a auto horizontal scroller of this images from left to right possibly with a width of container of max 4 images exist some function in javascript or similar
can you help me?
thanks | database | image | horizontal | scroller | null | 11/02/2011 05:55:35 | not a real question | auto scroller horizontal images from database
===
i have following code that generate some images with urls associated from database
<html>
<head>
<title></title>
</head>
<body>
<div id="datacontainer">
<?php
ini_set('display_errors', 0);
header('Content-type: text/html; charset=UTF-8') ;
//Retriving informations from database
mysql_connect("****", "****", "*****");
mysql_select_db("*****);
$result = mysql_query("SELECT * FROM table ORDER BY RAND() LIMIT 52");
print "<table width='200' border='0' ><style>
td {overflow:hidden;}
</style> ";
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$link=$row['url'];
$title=$row['siteTitle'];
$thumb= $row['url'];
print " <tr>
<td><div style= 'text-align:center;height:90px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link' target='_blank'><img src='http://open.thumbshots.org/image.pxf?url=$thumb'/></a></div></td>
</tr>
<tr>
<td><div style= 'text-align:center;height:20px;padding: 5px 5px 5px 5px;overflow:hidden;'><a href='$link'target='_blank'><font color='0000ff'>$title </font></a></div></td>
</tr>";
}
print"</table>";
?>
</div>
</body>
</html>
i need of implement a auto horizontal scroller of this images from left to right possibly with a width of container of max 4 images exist some function in javascript or similar
can you help me?
thanks | 1 |
11,072,996 | 06/17/2012 16:36:30 | 1,282,022 | 03/20/2012 21:38:23 | 5 | 0 | simple wordpress cart plugin | I know there are plenty checkout plugins out there but to be honest - they are so extended and huge.. I am looking for something really simple:
+ I have category like COOKIES and subpages there which are my products
+ on product page after description should be only button add to cart (plus No of ordered items -> if plugin do not have it, no problem )
+ after clicking on checkout button you can only give the simple data like email, address, name.
No payments, no taxes.. only sending such ordering on my email. do you know anything like that? | wordpress | shopping-cart | cart | null | null | 06/18/2012 18:30:25 | off topic | simple wordpress cart plugin
===
I know there are plenty checkout plugins out there but to be honest - they are so extended and huge.. I am looking for something really simple:
+ I have category like COOKIES and subpages there which are my products
+ on product page after description should be only button add to cart (plus No of ordered items -> if plugin do not have it, no problem )
+ after clicking on checkout button you can only give the simple data like email, address, name.
No payments, no taxes.. only sending such ordering on my email. do you know anything like that? | 2 |
8,634,163 | 12/26/2011 08:41:33 | 1,096,315 | 12/13/2011 17:36:26 | 1 | 1 | ANTLR : A lexer or a parser error? | I wrote a simple lexer in ANTLR and the grammer for ID is something like this :
ID : (('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*|'_'('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*);
(No digits are allowed at the beginning)
when I generated the code (in java) and tested the input :
3a
I expected an error but the input was recognized as "INT ID" , how can i fix the grammer to make it report an error ?(with only lexer rules)
Thanks for your attention | antlr | lexer | null | null | null | null | open | ANTLR : A lexer or a parser error?
===
I wrote a simple lexer in ANTLR and the grammer for ID is something like this :
ID : (('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*|'_'('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*);
(No digits are allowed at the beginning)
when I generated the code (in java) and tested the input :
3a
I expected an error but the input was recognized as "INT ID" , how can i fix the grammer to make it report an error ?(with only lexer rules)
Thanks for your attention | 0 |
6,451,816 | 06/23/2011 09:17:14 | 811,913 | 06/23/2011 09:17:14 | 1 | 0 | PHP Division by Zero Problem | I have the following PHP code to display my tag cloud. It seems if I don't have at least two tags that are the same, I get a warning message saying Warnng: Division by zero (shown below).
Could some one please help me fix this code? Thank you!
<?php
// define variables
$fontSizeUnit = "px";
$maxFontSize = 40;
$minFontSize = 10;
$tagsToDisplay = 100;
$tagDivider = " ";
// font size range
$fontSizeSpread = $maxFontSize - $minFontSize;
// create blank arrays
$tagArray = array();
$tempTagArray = array();
// DB: get all public tags
$result = mysqli_query($conn, "SELECT Tags FROM blog WHERE Tags != '' AND IsPublic = 1 ORDER BY RAND()")
or die($dataaccess_error);
if(mysqli_num_rows($result) > 0 )
{
// loop through results
while($row = mysqli_fetch_array($result))
{
// split the results
$tempStringArray = preg_split("/,/", $row['Tags']);
// loop through all items of this string array
for ($a = 0; $a < count($tempStringArray); $a++)
{
// convert to lowercase
$tempStringArray[$a] = strtolower($tempStringArray[$a]);
// check if it exists in tag array
if (empty($tagArray[$tempStringArray[$a]]))
{
// if it doesn't exist, create it with value 1
$tagArray[$tempStringArray[$a]] = 1;
}
else
{
// if it does exist, increase the value by 1
$tagArray[$tempStringArray[$a]] += 1;
}
}
}
// store to temporary array and sort descending
arsort($tagArray);
$numberOfTags = 0;
foreach ($tagArray as $key => $val)
{
$numberOfTags++;
if ($numberOfTags > $tagsToDisplay)
{
break;
}
$finalTagArray[$key] = $val;
}
ksort($finalTagArray);
$maxTagCount = max($finalTagArray);
$minTagCount = min($finalTagArray);
$tagCountSpread = $maxTagCount - $minTagCount; // <<== Problem here...
$unitsPerCount = $fontSizeSpread/$tagCountSpread;
// function to calculate the font size
function calcSize($thisTagCount) {
// import necessary global variables
global $minTagCount, $minFontSize, $fontSizeUnit, $unitsPerCount;
// calculate font size
$thisFontSize = $minFontSize+($unitsPerCount*($thisTagCount-$minTagCount));
// round font size and add units
$thisFontSize = round($thisFontSize) . $fontSizeUnit;
// return font size
return $thisFontSize;
}
// echo out the resulting tags
$b = 1;
foreach ($finalTagArray as $key => $val)
{
echo "<a href='snippets-by-tags.php?tag=".urlencode($key)."' style='font-size: ";
echo calcSize($val);
echo "'>" . htmlentities($key) . "</a>";
if($b != count($finalTagArray))
{
echo " " . $tagDivider . " ";
}
$b++;
}
}
else
{
echo '<a href="#">none found ...</a>';
}
?> | php | dividebyzero | null | null | null | 06/23/2011 10:26:27 | not a real question | PHP Division by Zero Problem
===
I have the following PHP code to display my tag cloud. It seems if I don't have at least two tags that are the same, I get a warning message saying Warnng: Division by zero (shown below).
Could some one please help me fix this code? Thank you!
<?php
// define variables
$fontSizeUnit = "px";
$maxFontSize = 40;
$minFontSize = 10;
$tagsToDisplay = 100;
$tagDivider = " ";
// font size range
$fontSizeSpread = $maxFontSize - $minFontSize;
// create blank arrays
$tagArray = array();
$tempTagArray = array();
// DB: get all public tags
$result = mysqli_query($conn, "SELECT Tags FROM blog WHERE Tags != '' AND IsPublic = 1 ORDER BY RAND()")
or die($dataaccess_error);
if(mysqli_num_rows($result) > 0 )
{
// loop through results
while($row = mysqli_fetch_array($result))
{
// split the results
$tempStringArray = preg_split("/,/", $row['Tags']);
// loop through all items of this string array
for ($a = 0; $a < count($tempStringArray); $a++)
{
// convert to lowercase
$tempStringArray[$a] = strtolower($tempStringArray[$a]);
// check if it exists in tag array
if (empty($tagArray[$tempStringArray[$a]]))
{
// if it doesn't exist, create it with value 1
$tagArray[$tempStringArray[$a]] = 1;
}
else
{
// if it does exist, increase the value by 1
$tagArray[$tempStringArray[$a]] += 1;
}
}
}
// store to temporary array and sort descending
arsort($tagArray);
$numberOfTags = 0;
foreach ($tagArray as $key => $val)
{
$numberOfTags++;
if ($numberOfTags > $tagsToDisplay)
{
break;
}
$finalTagArray[$key] = $val;
}
ksort($finalTagArray);
$maxTagCount = max($finalTagArray);
$minTagCount = min($finalTagArray);
$tagCountSpread = $maxTagCount - $minTagCount; // <<== Problem here...
$unitsPerCount = $fontSizeSpread/$tagCountSpread;
// function to calculate the font size
function calcSize($thisTagCount) {
// import necessary global variables
global $minTagCount, $minFontSize, $fontSizeUnit, $unitsPerCount;
// calculate font size
$thisFontSize = $minFontSize+($unitsPerCount*($thisTagCount-$minTagCount));
// round font size and add units
$thisFontSize = round($thisFontSize) . $fontSizeUnit;
// return font size
return $thisFontSize;
}
// echo out the resulting tags
$b = 1;
foreach ($finalTagArray as $key => $val)
{
echo "<a href='snippets-by-tags.php?tag=".urlencode($key)."' style='font-size: ";
echo calcSize($val);
echo "'>" . htmlentities($key) . "</a>";
if($b != count($finalTagArray))
{
echo " " . $tagDivider . " ";
}
$b++;
}
}
else
{
echo '<a href="#">none found ...</a>';
}
?> | 1 |
6,738,063 | 07/18/2011 19:12:51 | 780,182 | 06/01/2011 20:50:21 | 6 | 0 | Post Array from JavaScript to PHP Post | I have a php file that normally takes input array from an html multiple select box, and I need a way to post that data from JScript code in another file.
As I understand it, JQuery post would work nicely for this, however that will not work in IE. Is there any easy way to pass an array of values through JavaScript so that its contents can be accessed through the $_POST array, just as if they were from an HTML multiple select box AND works in IE? | php | javascript | arrays | http-post | null | null | open | Post Array from JavaScript to PHP Post
===
I have a php file that normally takes input array from an html multiple select box, and I need a way to post that data from JScript code in another file.
As I understand it, JQuery post would work nicely for this, however that will not work in IE. Is there any easy way to pass an array of values through JavaScript so that its contents can be accessed through the $_POST array, just as if they were from an HTML multiple select box AND works in IE? | 0 |
8,305,476 | 11/29/2011 03:29:04 | 146,610 | 07/28/2009 18:46:18 | 61 | 3 | Ninject Binding Attribute to Filter with Constructor Arguments | I read as many answers as I could for this, but they seem to fall short of one detail.
The trouble is when binding an action filter (with a service injected by controller) to a corresponding attribute, I've been unable to figure out how to pass parameter/property values from the attribute to its bound filter. Below is the code, and below that my intended fake-code:
**Filter & Attribute**
public class AuthorizationFilter : IAuthorizationFilter
{
private readonly IAuthorizationService _authorizationService;
private readonly UserRoles _requiredRoles; // Enum
public AuthorizationFilter(IAuthorizationService authorizationService, UserRoles requiredRoles)
{
_authorizationService = authorizationService;
_requiredRoles = requiredRoles;
}
public void OnAuthorization(AuthorizationContext filterContext)
{
if (filterContext.HttpContext.Session == null)
HandleUnauthorizedRequest(filterContext);
else {
var authorized = _authorizationService.IsUserInRole((UserSessionInfoViewModel) filterContext.HttpContext.Session["user"], _requiredRoles);
if (!authorized)
HandleUnauthorizedRequest(filterContext);
// else TODO: deal with cache...
}
}
}
public class RequireRolesAttribute : FilterAttribute
{
public readonly UserRoles RequiredRoles;
public RequireRolesAttribute(UserRoles requiredRoles)
{
RequiredRoles = requiredRoles;
}
}
**Filter/Attribute Bindings**
kernel.BindFilter<AuthorizationFilter>(FilterScope.Controller, 0)
.WhenControllerHas<RequireRolesAttribute>();
kernel.BindFilter<AuthorizationFilter>(FilterScope.Action, 0)
.WhenActionMethodHas<RequireRolesAttribute>();
This should make sure any controller/action decorated with [RolesRequired] is bound to the filter. So far so good. Now I want to declare via the attribute the roles (much like the stock AuthorizeAttribute) and pass those values onto the filter that actually does the authorization.
**Intended/Fake Code:**
[RequireRoles(UserRoles.Author)]
public ActionResult Index()
{
// blah
}
**Specifically,**
What does it take to inform the AuthorizationFilter of the roles? Can the filter/ninject access the arguments passed to the attribute's constructor? Can the filter/ninject pull them from the attributes public property?
For reference, these articles were a huge help, but don't answer this one thing:
http://stackoverflow.com/questions/6193414/dependency-injection-with-ninject-and-filter-attribute-for-asp-net-mvc
http://stackoverflow.com/questions/5572257/custom-authorization-mvc-3-and-ninject-ioc/5572752#5572752
B Z, Remo Gloor, others... how can I accomplish this?
| asp.net-mvc-3 | dependency-injection | attributes | filter | ninject | null | open | Ninject Binding Attribute to Filter with Constructor Arguments
===
I read as many answers as I could for this, but they seem to fall short of one detail.
The trouble is when binding an action filter (with a service injected by controller) to a corresponding attribute, I've been unable to figure out how to pass parameter/property values from the attribute to its bound filter. Below is the code, and below that my intended fake-code:
**Filter & Attribute**
public class AuthorizationFilter : IAuthorizationFilter
{
private readonly IAuthorizationService _authorizationService;
private readonly UserRoles _requiredRoles; // Enum
public AuthorizationFilter(IAuthorizationService authorizationService, UserRoles requiredRoles)
{
_authorizationService = authorizationService;
_requiredRoles = requiredRoles;
}
public void OnAuthorization(AuthorizationContext filterContext)
{
if (filterContext.HttpContext.Session == null)
HandleUnauthorizedRequest(filterContext);
else {
var authorized = _authorizationService.IsUserInRole((UserSessionInfoViewModel) filterContext.HttpContext.Session["user"], _requiredRoles);
if (!authorized)
HandleUnauthorizedRequest(filterContext);
// else TODO: deal with cache...
}
}
}
public class RequireRolesAttribute : FilterAttribute
{
public readonly UserRoles RequiredRoles;
public RequireRolesAttribute(UserRoles requiredRoles)
{
RequiredRoles = requiredRoles;
}
}
**Filter/Attribute Bindings**
kernel.BindFilter<AuthorizationFilter>(FilterScope.Controller, 0)
.WhenControllerHas<RequireRolesAttribute>();
kernel.BindFilter<AuthorizationFilter>(FilterScope.Action, 0)
.WhenActionMethodHas<RequireRolesAttribute>();
This should make sure any controller/action decorated with [RolesRequired] is bound to the filter. So far so good. Now I want to declare via the attribute the roles (much like the stock AuthorizeAttribute) and pass those values onto the filter that actually does the authorization.
**Intended/Fake Code:**
[RequireRoles(UserRoles.Author)]
public ActionResult Index()
{
// blah
}
**Specifically,**
What does it take to inform the AuthorizationFilter of the roles? Can the filter/ninject access the arguments passed to the attribute's constructor? Can the filter/ninject pull them from the attributes public property?
For reference, these articles were a huge help, but don't answer this one thing:
http://stackoverflow.com/questions/6193414/dependency-injection-with-ninject-and-filter-attribute-for-asp-net-mvc
http://stackoverflow.com/questions/5572257/custom-authorization-mvc-3-and-ninject-ioc/5572752#5572752
B Z, Remo Gloor, others... how can I accomplish this?
| 0 |
5,578,389 | 04/07/2011 08:50:08 | 696,432 | 04/07/2011 08:50:08 | 1 | 0 | Send and Retrive data from XML | I am making an application. i want to send the data to XML as well as i want retrive data from XML. I am using HTML. plz help me | html | xml | html5 | null | null | 04/07/2011 18:06:39 | not a real question | Send and Retrive data from XML
===
I am making an application. i want to send the data to XML as well as i want retrive data from XML. I am using HTML. plz help me | 1 |
4,170,021 | 11/12/2010 23:48:01 | 329,205 | 04/29/2010 18:45:45 | 123 | 3 | Why doesn't this simple jQuery ajax work? | Why doesn't this simply jQuery ajax code not load `pull.php` into the `div` with `id` of `#alert`?
...
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$(".pull_button").click(function() {
$("#alert").load("pull.php");
});
});
</script>
</head>
<body>
<div id="#alert"></div>
<nav>
<a class="pull_button">Pull Data</a>
</nav>
...
| jquery | ajax | debugging | jquery-ajax | javascript-library | null | open | Why doesn't this simple jQuery ajax work?
===
Why doesn't this simply jQuery ajax code not load `pull.php` into the `div` with `id` of `#alert`?
...
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$(".pull_button").click(function() {
$("#alert").load("pull.php");
});
});
</script>
</head>
<body>
<div id="#alert"></div>
<nav>
<a class="pull_button">Pull Data</a>
</nav>
...
| 0 |
8,713,613 | 01/03/2012 14:18:09 | 740,700 | 05/05/2011 20:44:49 | 122 | 5 | Semantic analysis into compilers | How it's done the semantic analysis in a compiler? (a generic/abstract compiler)<br />
I had to answer to this question during my last exam, but my answer was not enough for the professor. I talked about BNF (with an example), syntactic cards, but it wasn't enough, and he asked to me: "What happen when the compiler found a statement like `int i;`?"
| compiler | semantic | compiler-theory | semantic-analysis | null | 01/03/2012 20:35:25 | not a real question | Semantic analysis into compilers
===
How it's done the semantic analysis in a compiler? (a generic/abstract compiler)<br />
I had to answer to this question during my last exam, but my answer was not enough for the professor. I talked about BNF (with an example), syntactic cards, but it wasn't enough, and he asked to me: "What happen when the compiler found a statement like `int i;`?"
| 1 |
7,968,370 | 11/01/2011 14:58:00 | 607,846 | 02/08/2011 09:16:51 | 383 | 5 | Getting started with ASP .NET | I use the following listener to listen to a particular pattern. The process method is called many times each second. Is there a nicer way to do this :)
Thanks,
Barry
class Listener:
def __init__(self, data_to_catch):
self.data_to_catch = data_to_catch
self.length_of_data_to_catch = len(data_to_catch)
self.previous_data = ""
self.found = False
def process(self, data):
if self.found:
return
self.previous_data = self.previous_data + data
if not self.data_to_catch in self.previous_data:
# see if some of the data to catch has arrived, if so keep it
for i in reversed(range(min(self.length_of_data_to_catch,len(self.previous_data)))):
if self.data_to_catch[:i+1] == self.previous_data[-i-1:]:
return
else:
self.previous_data = ""
return
self.found = True
print("found!")
l = Listener("hello")
l.process("he")
l.process("llh")
l.process("e")
l.process("ll")
l.process("he")
l.process("llohe") | python | null | null | null | null | 11/01/2011 15:51:42 | not a real question | Getting started with ASP .NET
===
I use the following listener to listen to a particular pattern. The process method is called many times each second. Is there a nicer way to do this :)
Thanks,
Barry
class Listener:
def __init__(self, data_to_catch):
self.data_to_catch = data_to_catch
self.length_of_data_to_catch = len(data_to_catch)
self.previous_data = ""
self.found = False
def process(self, data):
if self.found:
return
self.previous_data = self.previous_data + data
if not self.data_to_catch in self.previous_data:
# see if some of the data to catch has arrived, if so keep it
for i in reversed(range(min(self.length_of_data_to_catch,len(self.previous_data)))):
if self.data_to_catch[:i+1] == self.previous_data[-i-1:]:
return
else:
self.previous_data = ""
return
self.found = True
print("found!")
l = Listener("hello")
l.process("he")
l.process("llh")
l.process("e")
l.process("ll")
l.process("he")
l.process("llohe") | 1 |
10,612,011 | 05/16/2012 04:30:05 | 1,194,039 | 02/07/2012 07:14:57 | 37 | 2 | CSS IE8 Photos are hidden | In my gallery I have thumbnail images that sit in an unordered list. For some reason they do not display in IE8. Could anyone explain why?
[www.melbournedodgeball.com.au/dodgeball2012/photos][1]
[1]: http://www.melbournedodgeball.com.au/dodgeball2012/photos
Thanks! | css | internet-explorer-8 | null | null | null | null | open | CSS IE8 Photos are hidden
===
In my gallery I have thumbnail images that sit in an unordered list. For some reason they do not display in IE8. Could anyone explain why?
[www.melbournedodgeball.com.au/dodgeball2012/photos][1]
[1]: http://www.melbournedodgeball.com.au/dodgeball2012/photos
Thanks! | 0 |
7,295,089 | 09/03/2011 18:41:07 | 926,891 | 09/03/2011 18:28:01 | 1 | 0 | Give pseudocode to create a number generation program? | Give pseudocode to create a number generation program?
Where the number runs from
0,1,2,3,.....,9,A,B,...,Z,10,11,...1A,1B,...,1Z,20,...
- if the input given is RAM,the program should generate the next number as RAN.
/*----------------------------------------------------*/
please give me the answers as soon as possible.
| pseudocode | null | null | null | null | 09/05/2011 00:04:02 | not a real question | Give pseudocode to create a number generation program?
===
Give pseudocode to create a number generation program?
Where the number runs from
0,1,2,3,.....,9,A,B,...,Z,10,11,...1A,1B,...,1Z,20,...
- if the input given is RAM,the program should generate the next number as RAN.
/*----------------------------------------------------*/
please give me the answers as soon as possible.
| 1 |
8,359,126 | 12/02/2011 16:06:42 | 580,981 | 01/19/2011 05:52:11 | 93 | 0 | Something cannot be resolved to be a type | My code is a simple vending machine. I used centralised parttern to coding. But I found some errors such as in class veding_machine,
Ls[3]=new nosmall_cups();
Ls[4]=new nolarge_cups();
Ls[5]=new exit();
Ls[6]=new start();
these errors are the same:" Multiple markers at this line
- nosmall_cups cannot be resolved to a type"
And also each time when I using Ls[] in class veding_machine, there is always exits an error "Ls cannot be resolved to a variable" such as in below code:
public void small_cup(){
st.small_cup();
if(st.getId()==1){
//s=2;
st=Ls[1];
}
if(st.getId()==2){
//s=2;
st=Ls[2];
}
}
The whole code of this vending machine are listed below:
import java.util.*;
class veding_machine{
State st;
private int price;
private int k;
private int k1;
private int t;
private int s;
public veding_machine(){
State[] Ls=new State[7];
Ls[0]=new idle();
Ls[1]=new coins_inserted();
Ls[2]=new sugar();
Ls[3]=new nosmall_cups();
Ls[4]=new nolarge_cups();
Ls[5]=new exit();
Ls[6]=new start();
k=0;
k1=0;
t=0;
price=0;
}
public void setK(int k){
this.k=k;
}
public int getK(){
return k;
}
public void setT(int t){
this.t=t;
}
public int getT(){
return t;
}
public void setK1(int k1){
this.k1=k1;
}
public int getK1(){
return k1;
}
public void setPrice(int price){
this.price=price;
}
public int getPrice(){
return price;
}
public void setS(int s){
this.s=s;
}
public int getS(){
return s;
}
public void coin(){
st.coin();
if(st.getId()==0){
if(t+25<price){
// t=t+25;
st=Ls[0];
}
if(t+25>=price && price>0){
//s=0;
//t=0;
st=Ls[1];
}
}
else if(st.getId()==1){
if(k1>1 && s==2){
//k1=k1-1;
st=Ls[0];
}else{
st=Ls[1];
}
}
else if(st.getId()==2){
st=Ls[2];
}
else if(st.getId()==3){
st=Ls[3];
}
else if(st.getId()==4){
st=Ls[4];
}
}
public void small_cup(){
st.small_cup();
if(st.getId()==1){
//s=2;
st=Ls[1];
}
if(st.getId()==2){
//s=2;
st=Ls[2];
}
}
public void large_cup(){
st.large_cup();
if(st.getId()==1){
//s=1;
st=Ls[1];
}
if(st.getId()==2){
//s=2;
st=Ls[2];
}
}
public void sugar(){
st.sugar();
if(st.getId()==1){
st=Ls[2];
}
if(st.getId()==2){
st=Ls[1];
}
}
public void tea(){
st.tea();
if(st.getId()==1){
if(k>1&&s==1){
//k=k-1;
st=Ls[0];
}
if(k1>1&&s==2){
//k1=k1-1;
st=Ls[0];
}
if(k==1&&s==1){
//k=k-1;
st=Ls[3];
}
if(k1==1&&s==2){
//k1=k1-1;
st=Ls[4];
}
}
if(st.getId()==2){
if(k==1&&s==1){
//k=k-1;
st=Ls[3];
}
if(k1==1&&s==2){
//k1=k1-1;
st=Ls[4];
}
if(k1>1&&s==2){
//k1=k1-1;
st=Ls[0];
}
if(k>1&&s==1){
//k=k-1;
st=Ls[0];
}
}
}
public void insert_large_cups(int n){
st.insert_large_cups(n);
if(st.getId()==0){
if(n>0){
//k=k+n;
st=Ls[0];
}
}
if(st.getId()==3){
if(n>0){
//k=n;
st=Ls[0];
}
}
}
public void insert_small_cups(int n){
st.insert_small_cups(n);
if(st.getId()==0){
if(n>0){
//k1=k1+n;
st=Ls[0];
}
}
if(st.getId()==4){
if(n>0){
//k1=n;
st=Ls[0];
}
}
}
public void set_price(int p){
st.set_price(p);
if(st.getId()==0){
if(p>0){
//price=p;
st=Ls[0];
}
}
}
public void cancle(){
st.cancle();
if(st.getId()==1){
st=Ls[0];
}
if(st.getId()==2){
st=Ls[0];
}
}
public void dispose(){
st.dispose();
if(st.getId()==0){
st=Ls[5];
}
}
}
class State{
veding_machine vm;
int id;
public void coin(){}
public void small_cup(){}
public void large_cup(){}
public void sugar(){}
public void tea(){}
public void insert_large_cups(int n){}
public void insert_small_cups(int n){}
public void set_price(int p){}
public void cancle(){}
public void dispose(){}
public int getId(){
return id;
}
}
// operation of idle class
class idle extends State{
// idle i;
veding_machine vm;
public void coin(){
if(vm.getT()+25<vm.getPrice()){
vm.setT(vm.getT()+25);
}
if((vm.getT()+25>=vm.getPrice())&&(vm.getPrice()>0)){
vm.setS(0);
vm.setT(0);
}
}
public void insert_small_cups(int n){
if(n>0){
vm.setK1(vm.getK1()+n);
}
}
public void insert_large_cups(int n){
if(n>0){
vm.setK(vm.getK()+n);
}
}
public void set_price(int p){
if(p>0){
vm.setPrice(p);
}
}
public void dispose(){
System.exit(0);
}
}
//operation of coins_inserted class
class coins_inserted extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void cancel(){
vm.setT(0);
System.out.println("return coins");
}
public void sugar(){
}
public void small_cup(){
vm.setS(2);
}
public void large_cup(){
vm.setS(1);
}
public void tea(){
if(vm.getK()==1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea;");
}
if(vm.getK1()==1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea;");
}
if(vm.getK()>1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea;");
}
if(vm.getK1()>1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea;");
}
}
public void cancle(){
vm.setT(0);
System.out.println("return coins");
}
}
//operation of sugar class
class sugar extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void small_cup(){
vm.setS(2);
}
public void large_cup(){
vm.setS(1);
}
public void sugar(){
}
public void tea(){
if(vm.getK()==1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea;");
}
if(vm.getK1()==1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea;");
}
if(vm.getK()>1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea with sugar;");
}
if(vm.getK1()>1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea with sugar;");
}
}
//operation of nolarge_cups class
class nolarge_cups extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void insert_large_cups(int n){
if(n>0){
vm.setK(n);
}
}
}
//operation of nosmall_cups class
class nosmall_cups extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void insert_small_cups(int n){
if(n>0){
vm.setK1(n);
}
}
}
//operation of start class
class start extends State{
public void veding_machine(){
int k=0;
int t=0;
int price=0;
int k1=0;
}
}
//operation of exit class
class exit extends State{}
public static void main(String[] args) {
//idle i;
//coins_inserted ci;
//sugar sg;
//nosmall_cups nsc;
//nolarge_cups nlc;
//exit et;
//start st;
int b;
char ch1;
System.out.println("*****CS589 Fall 2010***** \n"+
"******PROJECT********\n"+
"******DEMO******\n");
// PutLines(3);
veding_machine vm;
ch1='1';
while(ch1!='q'){
System.out.println("DRIVE for the vending machine\n");
System.out.println(" 0. coin() \n");
System.out.println(" 1. small_cup() \n");
System.out.println(" 2. large_cup() \n");
System.out.println(" 3. sugar() \n");
System.out.println(" 4. tea() \n");
System.out.println(" 5. insert_large_cups(int n) \n");
System.out.println(" 6. insert_small_cups(int n) \n");
System.out.println(" 7. set_Price(int p) \n");
System.out.println(" 8. cancle() \n");
System.out.println(" 9. dispose() j\n");
System.out.println(" Testing-related methods\n");
System.out.println(" a. show_variables() \n");
System.out.println(" q. Quit Vending Machine class driver \n");
Scanner scan=new Scanner(System.in);
ch1=(char)scan.nextInt();
switch(ch1){
case 'a':
System.out.println(" show_variables() testing-related method ");
}
}
}
}
| java | null | null | null | null | 12/02/2011 17:15:30 | not a real question | Something cannot be resolved to be a type
===
My code is a simple vending machine. I used centralised parttern to coding. But I found some errors such as in class veding_machine,
Ls[3]=new nosmall_cups();
Ls[4]=new nolarge_cups();
Ls[5]=new exit();
Ls[6]=new start();
these errors are the same:" Multiple markers at this line
- nosmall_cups cannot be resolved to a type"
And also each time when I using Ls[] in class veding_machine, there is always exits an error "Ls cannot be resolved to a variable" such as in below code:
public void small_cup(){
st.small_cup();
if(st.getId()==1){
//s=2;
st=Ls[1];
}
if(st.getId()==2){
//s=2;
st=Ls[2];
}
}
The whole code of this vending machine are listed below:
import java.util.*;
class veding_machine{
State st;
private int price;
private int k;
private int k1;
private int t;
private int s;
public veding_machine(){
State[] Ls=new State[7];
Ls[0]=new idle();
Ls[1]=new coins_inserted();
Ls[2]=new sugar();
Ls[3]=new nosmall_cups();
Ls[4]=new nolarge_cups();
Ls[5]=new exit();
Ls[6]=new start();
k=0;
k1=0;
t=0;
price=0;
}
public void setK(int k){
this.k=k;
}
public int getK(){
return k;
}
public void setT(int t){
this.t=t;
}
public int getT(){
return t;
}
public void setK1(int k1){
this.k1=k1;
}
public int getK1(){
return k1;
}
public void setPrice(int price){
this.price=price;
}
public int getPrice(){
return price;
}
public void setS(int s){
this.s=s;
}
public int getS(){
return s;
}
public void coin(){
st.coin();
if(st.getId()==0){
if(t+25<price){
// t=t+25;
st=Ls[0];
}
if(t+25>=price && price>0){
//s=0;
//t=0;
st=Ls[1];
}
}
else if(st.getId()==1){
if(k1>1 && s==2){
//k1=k1-1;
st=Ls[0];
}else{
st=Ls[1];
}
}
else if(st.getId()==2){
st=Ls[2];
}
else if(st.getId()==3){
st=Ls[3];
}
else if(st.getId()==4){
st=Ls[4];
}
}
public void small_cup(){
st.small_cup();
if(st.getId()==1){
//s=2;
st=Ls[1];
}
if(st.getId()==2){
//s=2;
st=Ls[2];
}
}
public void large_cup(){
st.large_cup();
if(st.getId()==1){
//s=1;
st=Ls[1];
}
if(st.getId()==2){
//s=2;
st=Ls[2];
}
}
public void sugar(){
st.sugar();
if(st.getId()==1){
st=Ls[2];
}
if(st.getId()==2){
st=Ls[1];
}
}
public void tea(){
st.tea();
if(st.getId()==1){
if(k>1&&s==1){
//k=k-1;
st=Ls[0];
}
if(k1>1&&s==2){
//k1=k1-1;
st=Ls[0];
}
if(k==1&&s==1){
//k=k-1;
st=Ls[3];
}
if(k1==1&&s==2){
//k1=k1-1;
st=Ls[4];
}
}
if(st.getId()==2){
if(k==1&&s==1){
//k=k-1;
st=Ls[3];
}
if(k1==1&&s==2){
//k1=k1-1;
st=Ls[4];
}
if(k1>1&&s==2){
//k1=k1-1;
st=Ls[0];
}
if(k>1&&s==1){
//k=k-1;
st=Ls[0];
}
}
}
public void insert_large_cups(int n){
st.insert_large_cups(n);
if(st.getId()==0){
if(n>0){
//k=k+n;
st=Ls[0];
}
}
if(st.getId()==3){
if(n>0){
//k=n;
st=Ls[0];
}
}
}
public void insert_small_cups(int n){
st.insert_small_cups(n);
if(st.getId()==0){
if(n>0){
//k1=k1+n;
st=Ls[0];
}
}
if(st.getId()==4){
if(n>0){
//k1=n;
st=Ls[0];
}
}
}
public void set_price(int p){
st.set_price(p);
if(st.getId()==0){
if(p>0){
//price=p;
st=Ls[0];
}
}
}
public void cancle(){
st.cancle();
if(st.getId()==1){
st=Ls[0];
}
if(st.getId()==2){
st=Ls[0];
}
}
public void dispose(){
st.dispose();
if(st.getId()==0){
st=Ls[5];
}
}
}
class State{
veding_machine vm;
int id;
public void coin(){}
public void small_cup(){}
public void large_cup(){}
public void sugar(){}
public void tea(){}
public void insert_large_cups(int n){}
public void insert_small_cups(int n){}
public void set_price(int p){}
public void cancle(){}
public void dispose(){}
public int getId(){
return id;
}
}
// operation of idle class
class idle extends State{
// idle i;
veding_machine vm;
public void coin(){
if(vm.getT()+25<vm.getPrice()){
vm.setT(vm.getT()+25);
}
if((vm.getT()+25>=vm.getPrice())&&(vm.getPrice()>0)){
vm.setS(0);
vm.setT(0);
}
}
public void insert_small_cups(int n){
if(n>0){
vm.setK1(vm.getK1()+n);
}
}
public void insert_large_cups(int n){
if(n>0){
vm.setK(vm.getK()+n);
}
}
public void set_price(int p){
if(p>0){
vm.setPrice(p);
}
}
public void dispose(){
System.exit(0);
}
}
//operation of coins_inserted class
class coins_inserted extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void cancel(){
vm.setT(0);
System.out.println("return coins");
}
public void sugar(){
}
public void small_cup(){
vm.setS(2);
}
public void large_cup(){
vm.setS(1);
}
public void tea(){
if(vm.getK()==1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea;");
}
if(vm.getK1()==1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea;");
}
if(vm.getK()>1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea;");
}
if(vm.getK1()>1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea;");
}
}
public void cancle(){
vm.setT(0);
System.out.println("return coins");
}
}
//operation of sugar class
class sugar extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void small_cup(){
vm.setS(2);
}
public void large_cup(){
vm.setS(1);
}
public void sugar(){
}
public void tea(){
if(vm.getK()==1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea;");
}
if(vm.getK1()==1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea;");
}
if(vm.getK()>1&&vm.getS()==1){
vm.setK(vm.getK()-1);
System.out.println("dispose large cup of tea with sugar;");
}
if(vm.getK1()>1&&vm.getS()==2){
vm.setK1(vm.getK1()-1);
System.out.println("dispose small cup of tea with sugar;");
}
}
//operation of nolarge_cups class
class nolarge_cups extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void insert_large_cups(int n){
if(n>0){
vm.setK(n);
}
}
}
//operation of nosmall_cups class
class nosmall_cups extends State{
veding_machine vm;
public void coin(){
vm.setT(0);
System.out.println("return coins");
}
public void insert_small_cups(int n){
if(n>0){
vm.setK1(n);
}
}
}
//operation of start class
class start extends State{
public void veding_machine(){
int k=0;
int t=0;
int price=0;
int k1=0;
}
}
//operation of exit class
class exit extends State{}
public static void main(String[] args) {
//idle i;
//coins_inserted ci;
//sugar sg;
//nosmall_cups nsc;
//nolarge_cups nlc;
//exit et;
//start st;
int b;
char ch1;
System.out.println("*****CS589 Fall 2010***** \n"+
"******PROJECT********\n"+
"******DEMO******\n");
// PutLines(3);
veding_machine vm;
ch1='1';
while(ch1!='q'){
System.out.println("DRIVE for the vending machine\n");
System.out.println(" 0. coin() \n");
System.out.println(" 1. small_cup() \n");
System.out.println(" 2. large_cup() \n");
System.out.println(" 3. sugar() \n");
System.out.println(" 4. tea() \n");
System.out.println(" 5. insert_large_cups(int n) \n");
System.out.println(" 6. insert_small_cups(int n) \n");
System.out.println(" 7. set_Price(int p) \n");
System.out.println(" 8. cancle() \n");
System.out.println(" 9. dispose() j\n");
System.out.println(" Testing-related methods\n");
System.out.println(" a. show_variables() \n");
System.out.println(" q. Quit Vending Machine class driver \n");
Scanner scan=new Scanner(System.in);
ch1=(char)scan.nextInt();
switch(ch1){
case 'a':
System.out.println(" show_variables() testing-related method ");
}
}
}
}
| 1 |
23,640 | 08/22/2008 22:13:06 | 324 | 08/04/2008 16:46:29 | 60 | 2 | Free or Open Source Collaboration/eLearning Software | I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up to 10 students in the class at a time. The instructor would be able to post slides or other teaching material and the students would be able to see it on their computers remotely. Video is not required but audio is a must. Any recommendations? | elearning | collaboration | null | null | null | 12/10/2011 16:40:17 | not constructive | Free or Open Source Collaboration/eLearning Software
===
I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language. The idea is that an instructor would teach a class and there would be up to 10 students in the class at a time. The instructor would be able to post slides or other teaching material and the students would be able to see it on their computers remotely. Video is not required but audio is a must. Any recommendations? | 4 |
3,756,596 | 09/21/2010 00:58:25 | 343,540 | 05/17/2010 23:31:39 | 67 | 2 | Join SQL Query Problem? | First Select Statement:
SELECT
dbo.FG_FILLIN.PartNumber,
dbo.DropshipPackinglist.Shiplist_Qty,
dbo.DropshipPackinglist.Quantity
FROM dbo.FG_FILLIN INNER JOIN
dbo.DropshipPackinglist ON
dbo.FG_FILLIN.PartNumber = dbo.DropshipPackinglist.PartNumber
WHERE (dbo.FG_FILLIN.Batch = 'CIP_HK_6')
GROUP BY
dbo.FG_FILLIN.Batch,
dbo.FG_FILLIN.PartNumber,
dbo.FG_FILLIN.ItemNumber,
dbo.DropshipPackinglist.Shiplist_Qty,
dbo.DropshipPackinglist.Quantity
Result :
PartNumber Shiplist_Qty Quantity
P02-070161-00111-C100 6 3
P02-070161-10111-C100 6 3
--------------------------------------------------------------------------
2nd :
SELECT PartNumber,COUNT(Batch) AS Created
FROM dbo.FG_FILLIN
WHERE Batch='CIP_HK_6'
GROUP BY Batch,PartNumber
Result :
PartNumber Created
P02-070161-00111-C100 3
P02-070161-10111-C100 1
Joining this two Query I cant show this one:
PartNumber Shiplist_Qty Quantity Created
P02-070161-00111-C100 6 3 3
P02-070161-10111-C100 6 3 1
It always show : when i Add Count(dbo.FG_FILLIN.Batch) as Created
PartNumber Shiplist_Qty Quantity Created
P02-070161-00111-C100 6 3 6
P02-070161-10111-C100 6 3 2
Any Advice.? Thanks In Regards! | c# | sql | mysql | sql-server | null | null | open | Join SQL Query Problem?
===
First Select Statement:
SELECT
dbo.FG_FILLIN.PartNumber,
dbo.DropshipPackinglist.Shiplist_Qty,
dbo.DropshipPackinglist.Quantity
FROM dbo.FG_FILLIN INNER JOIN
dbo.DropshipPackinglist ON
dbo.FG_FILLIN.PartNumber = dbo.DropshipPackinglist.PartNumber
WHERE (dbo.FG_FILLIN.Batch = 'CIP_HK_6')
GROUP BY
dbo.FG_FILLIN.Batch,
dbo.FG_FILLIN.PartNumber,
dbo.FG_FILLIN.ItemNumber,
dbo.DropshipPackinglist.Shiplist_Qty,
dbo.DropshipPackinglist.Quantity
Result :
PartNumber Shiplist_Qty Quantity
P02-070161-00111-C100 6 3
P02-070161-10111-C100 6 3
--------------------------------------------------------------------------
2nd :
SELECT PartNumber,COUNT(Batch) AS Created
FROM dbo.FG_FILLIN
WHERE Batch='CIP_HK_6'
GROUP BY Batch,PartNumber
Result :
PartNumber Created
P02-070161-00111-C100 3
P02-070161-10111-C100 1
Joining this two Query I cant show this one:
PartNumber Shiplist_Qty Quantity Created
P02-070161-00111-C100 6 3 3
P02-070161-10111-C100 6 3 1
It always show : when i Add Count(dbo.FG_FILLIN.Batch) as Created
PartNumber Shiplist_Qty Quantity Created
P02-070161-00111-C100 6 3 6
P02-070161-10111-C100 6 3 2
Any Advice.? Thanks In Regards! | 0 |
4,216,505 | 11/18/2010 15:33:08 | 507,401 | 11/14/2010 14:30:23 | 38 | 0 | about environment variables in unix | i want to know about the environment variables and want to know how are they used and where are they used? | unix | null | null | null | null | 11/18/2010 15:39:25 | not a real question | about environment variables in unix
===
i want to know about the environment variables and want to know how are they used and where are they used? | 1 |
4,295,555 | 11/28/2010 05:35:20 | 268,687 | 02/08/2010 13:55:17 | 573 | 24 | Dynamic image rendering on iOS | I have a programming task for an application I am writing for the iPad and the documentation is not clear about how to go about doing this. I am hoping for some good advice on approaching this problem.
Basically, I have a memory buffer that stores raw RGB for a 256x192 pixel image. This image will be written to regularly and I wish to display this to a 768x576 pixel area on the screen on an update call. I would like this to be relatively quick and maybe optimise it by only processing the areas of the image that actually change.
How would I go about doing this? My initial thought is to create a CGBitmapContext to manage the 256x192 image, then create a CGImage from this, then create a UIImage from this and change the image property of a UIImageView instance. This sounds like a rather slow process.
Am I on the right lines or should I be looking at something different. Another note is that this image must co-exists with other UIKit views on the screen.
Thanks for any help you can provide.
| ipad | graphics | ios4 | null | null | null | open | Dynamic image rendering on iOS
===
I have a programming task for an application I am writing for the iPad and the documentation is not clear about how to go about doing this. I am hoping for some good advice on approaching this problem.
Basically, I have a memory buffer that stores raw RGB for a 256x192 pixel image. This image will be written to regularly and I wish to display this to a 768x576 pixel area on the screen on an update call. I would like this to be relatively quick and maybe optimise it by only processing the areas of the image that actually change.
How would I go about doing this? My initial thought is to create a CGBitmapContext to manage the 256x192 image, then create a CGImage from this, then create a UIImage from this and change the image property of a UIImageView instance. This sounds like a rather slow process.
Am I on the right lines or should I be looking at something different. Another note is that this image must co-exists with other UIKit views on the screen.
Thanks for any help you can provide.
| 0 |
10,408,974 | 05/02/2012 06:48:23 | 1,353,660 | 04/24/2012 12:24:45 | 1 | 0 | Finding Available network Access points in Qt | I need to find available network connections like eth,wlan,bluetooth. Does Qt emit any signals on detection of these access-points automatically? And also if more than 1 connection is available how would I know that which access point is used by system? And also if only 1 connection[apart form eth0] is present, for ex:WLAN Do we need to apply any additional settings for using ftp/htttp protocols?
Thanx | linux | qt | network-programming | wlan | qtnetwork | null | open | Finding Available network Access points in Qt
===
I need to find available network connections like eth,wlan,bluetooth. Does Qt emit any signals on detection of these access-points automatically? And also if more than 1 connection is available how would I know that which access point is used by system? And also if only 1 connection[apart form eth0] is present, for ex:WLAN Do we need to apply any additional settings for using ftp/htttp protocols?
Thanx | 0 |
9,086,672 | 01/31/2012 20:46:45 | 256,048 | 01/21/2010 17:57:03 | 103 | 0 | How is ReuseCabinetCache used in a WIX install | Similiar question: http://stackoverflow.com/questions/1207020/reusing-wix-components-to-speed-up-candle-light
My project has the very same problem as the one referenced; a very large static database that never changes is compressed into the msi every time a build is required. I would like to do as the question asks: reuse a pre-compressed cab file to speed up the build time.
I started doing as the answer suggests, using the cabCache property. I added the following to the .wixproj:
<CabinetCachePath>cabs</CabinetCachePath>
<ReuseCabinetCache>True</ReuseCabinetCache>
I then seperated the static data into a fragment:
<Fragmet>
<Media Id="2" Cabinet="static.cab" EmbedCab="no" />
<Component Id="staticCab" Guid="..." >
Files ...
</Component>
And the fragment was referenced in the feature:
<ComponentRef Id="staticCab" />
This created the cab file, but left it empty. My next thought was the use a Merge Module. I created the module:
<Module Id="StaticModule" Language="1033" Version="1.0.0.0" >
<Package ...>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="MergeRedirectFolder" Name=".">
<Component Id="StaticFiles" Guid="...">
Files...
</ -- End all XML Tags
And then merged it:
<Directory Id="StaticDir" Name="static">
<Merge Id="StaticModule" Language="1033" src="..\Static\bin\Release\static.msm" />
</Directory>
<Feature ...>
<MergeRef Id="StaticModule"/>
</Feature>
I guess my question would be what is the correct way to use ReuseCabinetCache. I'm still learning WIX, so I apologize if the answer is evident. I just am not sure how to use it.
| wix | wix3.5 | null | null | null | null | open | How is ReuseCabinetCache used in a WIX install
===
Similiar question: http://stackoverflow.com/questions/1207020/reusing-wix-components-to-speed-up-candle-light
My project has the very same problem as the one referenced; a very large static database that never changes is compressed into the msi every time a build is required. I would like to do as the question asks: reuse a pre-compressed cab file to speed up the build time.
I started doing as the answer suggests, using the cabCache property. I added the following to the .wixproj:
<CabinetCachePath>cabs</CabinetCachePath>
<ReuseCabinetCache>True</ReuseCabinetCache>
I then seperated the static data into a fragment:
<Fragmet>
<Media Id="2" Cabinet="static.cab" EmbedCab="no" />
<Component Id="staticCab" Guid="..." >
Files ...
</Component>
And the fragment was referenced in the feature:
<ComponentRef Id="staticCab" />
This created the cab file, but left it empty. My next thought was the use a Merge Module. I created the module:
<Module Id="StaticModule" Language="1033" Version="1.0.0.0" >
<Package ...>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="MergeRedirectFolder" Name=".">
<Component Id="StaticFiles" Guid="...">
Files...
</ -- End all XML Tags
And then merged it:
<Directory Id="StaticDir" Name="static">
<Merge Id="StaticModule" Language="1033" src="..\Static\bin\Release\static.msm" />
</Directory>
<Feature ...>
<MergeRef Id="StaticModule"/>
</Feature>
I guess my question would be what is the correct way to use ReuseCabinetCache. I'm still learning WIX, so I apologize if the answer is evident. I just am not sure how to use it.
| 0 |
10,486,158 | 05/07/2012 17:11:22 | 1,243,296 | 03/01/2012 17:19:36 | 1 | 0 | Jquery dialog with Iframe not working in IE9 | Jquery dialog with Iframe not wroking in IE9.
I have an HTML Button on my parent.aspx
<input type="button" id="btnMessageFilter" class="mainFont" value="Message Filter" />
On "btnMessageFilter" click, I want to open another aspx page (child.aspx) in Jquery dialog; I was doing this like this:
$(document).ready(function () {
$("#btnMessageFilter").live('click', function () {
var iframe = $("<iframe>").attr({ "src": "MessageFilter.aspx?btn=btnRefresh",
"height": "100%",
"marginwidth": "0",
"marginheight": "0",
"scrolling": "auto",
"frameborder": "0"
});
$("#dialog2").empty().append(iframe);
$("#dialog2").dialog({ modal: true, title: 'Message Filter', width: 400, height: 450 });
$("#dialog2").parent().appendTo('form');
return false;
});
});
The code was works fine except for IE9. Any suggestions to fix the above cod or an alternate way to open another aspx in Jquery Dialog? | iframe | dialog | internet-explorer-9 | null | null | null | open | Jquery dialog with Iframe not working in IE9
===
Jquery dialog with Iframe not wroking in IE9.
I have an HTML Button on my parent.aspx
<input type="button" id="btnMessageFilter" class="mainFont" value="Message Filter" />
On "btnMessageFilter" click, I want to open another aspx page (child.aspx) in Jquery dialog; I was doing this like this:
$(document).ready(function () {
$("#btnMessageFilter").live('click', function () {
var iframe = $("<iframe>").attr({ "src": "MessageFilter.aspx?btn=btnRefresh",
"height": "100%",
"marginwidth": "0",
"marginheight": "0",
"scrolling": "auto",
"frameborder": "0"
});
$("#dialog2").empty().append(iframe);
$("#dialog2").dialog({ modal: true, title: 'Message Filter', width: 400, height: 450 });
$("#dialog2").parent().appendTo('form');
return false;
});
});
The code was works fine except for IE9. Any suggestions to fix the above cod or an alternate way to open another aspx in Jquery Dialog? | 0 |
11,704,831 | 07/28/2012 21:35:37 | 1,560,183 | 07/28/2012 21:32:25 | 1 | 0 | What's a good backup software that will scan for particular files and only back those up? | I don't want all 500GB backed up, I just want all my office documents backed up (they are spread out through dozens of folders). I don't want to use iCloud, but I want to be able to FTP the backup to my web server. | ftp | backup | office | documents | null | 07/29/2012 18:27:21 | off topic | What's a good backup software that will scan for particular files and only back those up?
===
I don't want all 500GB backed up, I just want all my office documents backed up (they are spread out through dozens of folders). I don't want to use iCloud, but I want to be able to FTP the backup to my web server. | 2 |
11,481,397 | 07/14/2012 05:45:56 | 1,357,346 | 04/25/2012 22:16:11 | 18 | 0 | Why can't I import (via require) the LuaFileSystem dll (lfs.dll) into a Lua script being run by a C# program through LuaInterface? | When using LuaInterface to run a Lua script which imports the LuaFileSystem, I get an obscure error.
Here's my stack trace:
QTools: ERROR: LuaInterface.LuaException: error loading module 'lfs' from file '.\lfs.dll':
T
at LuaInterface.Lua.ThrowExceptionFromError(Int32 oldTop)
at LuaInterface.Lua.DoFile(String fileName)
at QuestSystemLUA.QTools.RunQuest(Object RunQuestOb)
It's located the DLL, which is in the directory that the script runs in. It just gives me the oddest error, literally "T". | lua | luainterface | null | null | null | null | open | Why can't I import (via require) the LuaFileSystem dll (lfs.dll) into a Lua script being run by a C# program through LuaInterface?
===
When using LuaInterface to run a Lua script which imports the LuaFileSystem, I get an obscure error.
Here's my stack trace:
QTools: ERROR: LuaInterface.LuaException: error loading module 'lfs' from file '.\lfs.dll':
T
at LuaInterface.Lua.ThrowExceptionFromError(Int32 oldTop)
at LuaInterface.Lua.DoFile(String fileName)
at QuestSystemLUA.QTools.RunQuest(Object RunQuestOb)
It's located the DLL, which is in the directory that the script runs in. It just gives me the oddest error, literally "T". | 0 |
6,887,773 | 07/31/2011 05:43:36 | 871,301 | 07/31/2011 05:43:36 | 1 | 0 | Apache 2.2.19 release compatible with tomcat 6? | We have apache 2.2.14 but need to upgrade to a higher version due to security vulnerabilities. Apache 2.2.19 is the highest and available now, but we are not sure if it will be compatible with Tomcat 6 we are having. How can I find out about the compatibilities & possible risks? and will it be compatible with tomcat 7?
| apache | null | null | null | null | null | open | Apache 2.2.19 release compatible with tomcat 6?
===
We have apache 2.2.14 but need to upgrade to a higher version due to security vulnerabilities. Apache 2.2.19 is the highest and available now, but we are not sure if it will be compatible with Tomcat 6 we are having. How can I find out about the compatibilities & possible risks? and will it be compatible with tomcat 7?
| 0 |
9,038,022 | 01/27/2012 18:12:27 | 1,124,199 | 12/31/2011 10:03:45 | 15 | 0 | Search submits on localsever but does nothing on remote | I have a search bar on my website that submits to the next page perfectly fine on my localhost with wamp but when I put it on my hosts server it doesn't submit, it does nothing. If you type in a search term it doesn't even move to the next page it just has the spinny icon in the tab and does nothing and the address bar doesn't change either. It seems to crash but i could be wrong.
function OnSubmitForm()
{
if (document.getElementById('Search').value =='')
{alert('No search term was entered!')
return false;
}
else {
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==0)
{
document.getElementById('Searchbar').action ="searchdefault.php";
}
else
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==1)
{
document.getElementById('Searchbar').action ="MusicSearch.php";
}
else
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==2)
{
document.getElementById('Searchbar').action ="DVDSearch.php";
}
else
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==3)
{
document.getElementById('Searchbar').action ="BluraySearch.php";
}
}
}
<div id="form">
<center>
<form name="Searchbar" onsubmit="return OnSubmitForm()" id="Searchbar" method="get">
Search
<input name="Search" type="text" dir="ltr" lang="en" size="50" id="Search" value="" />
In
<select name="Searchby" size="1" id="Searchby">
<option value="0" selected="selected">All Departments</option>
<option value="1">Music</option>
<option value="2">DVD</option>
<option value="3">Bluray</option>
</select>
<input type="submit" name="submit" value="Search" />
</form>
</center>
</div>
Top code is javasrcript directing the browser from what was selected in the drop down menu and text box is where you type the search term. It goes to the search page specified and runs through php and then to a sql statement to display the results on the searchpage.
Heres a link to see the site(NB only use the searchbar.)some of the links are not finished
www.echosrecordbar.co.za
Just a side note, will unsetting the varbles fix the problems?
Please help as I can't find the problem. | php | javascript | html | sql | null | null | open | Search submits on localsever but does nothing on remote
===
I have a search bar on my website that submits to the next page perfectly fine on my localhost with wamp but when I put it on my hosts server it doesn't submit, it does nothing. If you type in a search term it doesn't even move to the next page it just has the spinny icon in the tab and does nothing and the address bar doesn't change either. It seems to crash but i could be wrong.
function OnSubmitForm()
{
if (document.getElementById('Search').value =='')
{alert('No search term was entered!')
return false;
}
else {
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==0)
{
document.getElementById('Searchbar').action ="searchdefault.php";
}
else
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==1)
{
document.getElementById('Searchbar').action ="MusicSearch.php";
}
else
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==2)
{
document.getElementById('Searchbar').action ="DVDSearch.php";
}
else
if(document.getElementById('Searchby').
options[document.getElementById('Searchby').selectedIndex].value==3)
{
document.getElementById('Searchbar').action ="BluraySearch.php";
}
}
}
<div id="form">
<center>
<form name="Searchbar" onsubmit="return OnSubmitForm()" id="Searchbar" method="get">
Search
<input name="Search" type="text" dir="ltr" lang="en" size="50" id="Search" value="" />
In
<select name="Searchby" size="1" id="Searchby">
<option value="0" selected="selected">All Departments</option>
<option value="1">Music</option>
<option value="2">DVD</option>
<option value="3">Bluray</option>
</select>
<input type="submit" name="submit" value="Search" />
</form>
</center>
</div>
Top code is javasrcript directing the browser from what was selected in the drop down menu and text box is where you type the search term. It goes to the search page specified and runs through php and then to a sql statement to display the results on the searchpage.
Heres a link to see the site(NB only use the searchbar.)some of the links are not finished
www.echosrecordbar.co.za
Just a side note, will unsetting the varbles fix the problems?
Please help as I can't find the problem. | 0 |
7,639,010 | 10/03/2011 18:20:09 | 478,573 | 10/17/2010 14:54:01 | 1,601 | 30 | How to resize and float right a background image using css? | I am working on this site: http://www.problemio.com and I have a requirement to add the background image to the top banner which I did.
What I can't figure out how to do is how to shift it all the way to the right and make it smaller in length so that it only takes up half of the screen width.
Any idea how to do that? So far I have this css for the overall banner div:
.banner
{
width:60em;
margin: 0 auto;
position: relative;
padding: 0.3em 0;
z-index: 1;
background-image: url('http://www.problemio.com/img/ui/problemiotoprightimage.png');
background-repeat: no-repeat;
background-image: right-align
}
but I don't know how to make the background image align right and rescale to be 50% of the entire width of the div. Any ideas?
Thanks!
| html | css | null | null | null | null | open | How to resize and float right a background image using css?
===
I am working on this site: http://www.problemio.com and I have a requirement to add the background image to the top banner which I did.
What I can't figure out how to do is how to shift it all the way to the right and make it smaller in length so that it only takes up half of the screen width.
Any idea how to do that? So far I have this css for the overall banner div:
.banner
{
width:60em;
margin: 0 auto;
position: relative;
padding: 0.3em 0;
z-index: 1;
background-image: url('http://www.problemio.com/img/ui/problemiotoprightimage.png');
background-repeat: no-repeat;
background-image: right-align
}
but I don't know how to make the background image align right and rescale to be 50% of the entire width of the div. Any ideas?
Thanks!
| 0 |
3,524,850 | 08/19/2010 18:10:58 | 425,571 | 08/19/2010 17:50:24 | 1 | 0 | How do you create an indexed table view based on last name. | If you could find a tutorial for an indexed table view based on last name like the "Contacts" app, that would be great. I've search all around but can't find one on last names. | iphone | uitableview | indexed | null | null | null | open | How do you create an indexed table view based on last name.
===
If you could find a tutorial for an indexed table view based on last name like the "Contacts" app, that would be great. I've search all around but can't find one on last names. | 0 |
9,570,480 | 03/05/2012 16:47:17 | 1,242,503 | 03/01/2012 11:17:51 | 4 | 0 | Howdo display random number generated on te scree in textView | i m trying to show the random number generated on the screen but for some reason its not coming up the screen luk like
_______
1 2 3
4 5 6
7 8 9
del 0 # -
random number are to be shown where"___" is
main.xml
<TextView
android:id="@+id/Title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=" "
android:textSize="45dp" />
question.Java
package org.example.question;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class QuestionActivity extends Activity implements View.OnClickListener {
/** Called when the activity is first created. */
int fnum, snum;
Button one,two,three,four,five,six,seven,eight,nine,zero,minus,hash;
TextView display;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
display = (TextView)findViewById(R.id.Title);
//Buttons
one= (Button) findViewById(R.id.keypad_1);
two= (Button) findViewById(R.id.keypad_2);
three= (Button) findViewById(R.id.keypad_3);
four= (Button) findViewById(R.id.keypad_4);
five = (Button) findViewById(R.id.keypad_5);
six= (Button) findViewById(R.id.keypad_6);
seven = (Button) findViewById(R.id.keypad_7);
eight = (Button) findViewById(R.id.keypad_8);
nine = (Button) findViewById(R.id.keypad_9);
minus = (Button) findViewById(R.id.keypad_subtract);
hash = (Button) findViewById(R.id.keypad_hash);
one.setOnClickListener(this); two.setOnClickListener(this); three.setOnClickListener(this);
three.setOnClickListener(this); four.setOnClickListener(this); five.setOnClickListener(this);
six.setOnClickListener(this); seven.setOnClickListener(this); eight.setOnClickListener(this);
nine.setOnClickListener(this); minus.setOnClickListener(this); hash.setOnClickListener(this);
}
public void onClick(View arg0) {
// TODO Auto-generated method stub
display.setText("2+2");
}
public void requestFocus() {
// TODO Auto-generated method stub
}
}
help would be greatly apprecited
| android | null | null | null | null | null | open | Howdo display random number generated on te scree in textView
===
i m trying to show the random number generated on the screen but for some reason its not coming up the screen luk like
_______
1 2 3
4 5 6
7 8 9
del 0 # -
random number are to be shown where"___" is
main.xml
<TextView
android:id="@+id/Title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=" "
android:textSize="45dp" />
question.Java
package org.example.question;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class QuestionActivity extends Activity implements View.OnClickListener {
/** Called when the activity is first created. */
int fnum, snum;
Button one,two,three,four,five,six,seven,eight,nine,zero,minus,hash;
TextView display;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
display = (TextView)findViewById(R.id.Title);
//Buttons
one= (Button) findViewById(R.id.keypad_1);
two= (Button) findViewById(R.id.keypad_2);
three= (Button) findViewById(R.id.keypad_3);
four= (Button) findViewById(R.id.keypad_4);
five = (Button) findViewById(R.id.keypad_5);
six= (Button) findViewById(R.id.keypad_6);
seven = (Button) findViewById(R.id.keypad_7);
eight = (Button) findViewById(R.id.keypad_8);
nine = (Button) findViewById(R.id.keypad_9);
minus = (Button) findViewById(R.id.keypad_subtract);
hash = (Button) findViewById(R.id.keypad_hash);
one.setOnClickListener(this); two.setOnClickListener(this); three.setOnClickListener(this);
three.setOnClickListener(this); four.setOnClickListener(this); five.setOnClickListener(this);
six.setOnClickListener(this); seven.setOnClickListener(this); eight.setOnClickListener(this);
nine.setOnClickListener(this); minus.setOnClickListener(this); hash.setOnClickListener(this);
}
public void onClick(View arg0) {
// TODO Auto-generated method stub
display.setText("2+2");
}
public void requestFocus() {
// TODO Auto-generated method stub
}
}
help would be greatly apprecited
| 0 |
1,447,962 | 09/19/2009 06:35:33 | 4,227 | 09/02/2008 13:08:22 | 86 | 24 | DesignTime data not showing in Blend when bound against CollectionViewSource | I have datatemplate for a viewmodel where an itemscontrol is bound again a CollectionViewSource (to enable sorting in xaml).
<DataTemplate x:Key="equipmentDataTemplate">
<Viewbox>
<Viewbox.Resources>
<CollectionViewSource x:Key="viewSource" Source="{Binding Modules}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="ID" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</Viewbox.Resources>
<ItemsControl ItemsSource="{Binding Source={StaticResource viewSource}}"
Height="{DynamicResource equipmentHeight}"
ItemTemplate="{StaticResource moduleDataTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Viewbox>
</DataTemplate>
I have also setup the UserControl where all of this is defined to provide designtime data
d:DataContext="{x:Static vm:DesignTimeHelper.Equipment}">
This is basically a static property that gives me an EquipmentViewModel that has a list of ModuleViewModels (Equipment.Modules). Now as long as I bind to the CollectionViewSource the designtime data does not show up in blend 3. When I bind to the ViewModel collection directly
<ItemsControl ItemsSource="{Binding Modules}"
I can see the designtime data. Any idea what I could do? | wpf | blend | collectionviewsource | null | null | null | open | DesignTime data not showing in Blend when bound against CollectionViewSource
===
I have datatemplate for a viewmodel where an itemscontrol is bound again a CollectionViewSource (to enable sorting in xaml).
<DataTemplate x:Key="equipmentDataTemplate">
<Viewbox>
<Viewbox.Resources>
<CollectionViewSource x:Key="viewSource" Source="{Binding Modules}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="ID" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</Viewbox.Resources>
<ItemsControl ItemsSource="{Binding Source={StaticResource viewSource}}"
Height="{DynamicResource equipmentHeight}"
ItemTemplate="{StaticResource moduleDataTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Viewbox>
</DataTemplate>
I have also setup the UserControl where all of this is defined to provide designtime data
d:DataContext="{x:Static vm:DesignTimeHelper.Equipment}">
This is basically a static property that gives me an EquipmentViewModel that has a list of ModuleViewModels (Equipment.Modules). Now as long as I bind to the CollectionViewSource the designtime data does not show up in blend 3. When I bind to the ViewModel collection directly
<ItemsControl ItemsSource="{Binding Modules}"
I can see the designtime data. Any idea what I could do? | 0 |
6,308,574 | 06/10/2011 15:29:23 | 792,230 | 06/10/2011 06:25:09 | 1 | 0 | C# interview question | In one of the interview, i got asked the following question but i am not sure what is that, Please help me to understand about the question
Use C# to turn an 4th and 7th bits of a said byte myFlag in which write most bit is first bit. | c# | null | null | null | null | 06/11/2011 10:03:49 | not a real question | C# interview question
===
In one of the interview, i got asked the following question but i am not sure what is that, Please help me to understand about the question
Use C# to turn an 4th and 7th bits of a said byte myFlag in which write most bit is first bit. | 1 |
3,107,946 | 06/24/2010 07:28:07 | 374,989 | 06/24/2010 07:28:07 | 1 | 0 | Modify HTML Object tag attributes with mootools in IE | I got an object tag (generated by SWFObject) which I'ld like to modify width and height properties on window resize with mootools library.
With a :
$('my_object').set({ 'width': new_width, 'height': new_height });
everything working fine in a firefox, chrome and others.
Unfortunately, Internet explorer (7 & 8) don't see it the same. It gives me an error saying "Object does not support this property or method".
Does anyone know why this problem or how to avoid it ?
Thanks to all. | html | mootools | javascript | null | null | null | open | Modify HTML Object tag attributes with mootools in IE
===
I got an object tag (generated by SWFObject) which I'ld like to modify width and height properties on window resize with mootools library.
With a :
$('my_object').set({ 'width': new_width, 'height': new_height });
everything working fine in a firefox, chrome and others.
Unfortunately, Internet explorer (7 & 8) don't see it the same. It gives me an error saying "Object does not support this property or method".
Does anyone know why this problem or how to avoid it ?
Thanks to all. | 0 |
10,611,218 | 05/16/2012 02:23:05 | 1,369,607 | 05/02/2012 09:16:11 | 8 | 0 | Chicking FACEBOOK user login status | I have a web site. i do it using PHP. In home page i want to check if a user is still logged / or not into facebook.
if facebook session is available alert("OK") otherwise alert("No")
I have tried this code but it not working for me
<html>
<head>
</head>
<body>
<script>
function logged() {
alert('logged');
}
function notlogged() {
alert('not logged');
}
</script>
<script src="http://www.facebook.com/ajax/composer/attachment/question/question.php" onload="logged()" onerror="notlogged()">
</body>
</html>
when after i logged out from facebook this code alert as logged.
what is wrong with this code?
thanks
best regards;
thari | php | facebook | null | null | null | 05/17/2012 20:09:57 | not a real question | Chicking FACEBOOK user login status
===
I have a web site. i do it using PHP. In home page i want to check if a user is still logged / or not into facebook.
if facebook session is available alert("OK") otherwise alert("No")
I have tried this code but it not working for me
<html>
<head>
</head>
<body>
<script>
function logged() {
alert('logged');
}
function notlogged() {
alert('not logged');
}
</script>
<script src="http://www.facebook.com/ajax/composer/attachment/question/question.php" onload="logged()" onerror="notlogged()">
</body>
</html>
when after i logged out from facebook this code alert as logged.
what is wrong with this code?
thanks
best regards;
thari | 1 |
9,084,478 | 01/31/2012 17:54:51 | 310,291 | 03/02/2010 15:22:39 | 3,508 | 21 | Why my javascript alert doesn't show up | I tested the code below in google chrome but alert shows up why ? (I took it from http://msdn.microsoft.com/en-us/magazine/cc163419.aspx)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
</head>
<body>
<script type="text/javascript">
function filter(pred, arr) {
var len = arr.length;
var filtered = []; // shorter version of new Array();
// iterate through every element in the array...
for(var i = 0; i < len; i++) {
var val = arr[i];
// if the element satisfies the predicate let it through
if(pred(val)) {
filtered.push(val);
}
}
return filtered;
}
var someRandomNumbers = [12, 32, 1, 3, 2, 2, 234, 236, 632,7, 8];
var numbersGreaterThan100 = filter(
function(x) { return (x > 100) ? true : false; },
someRandomNumbers);
// displays 234, 236, 632
alert(numbersGreaterThan100);
</script>
</body>
</html>
| javascript | html | null | null | null | 01/31/2012 18:11:39 | too localized | Why my javascript alert doesn't show up
===
I tested the code below in google chrome but alert shows up why ? (I took it from http://msdn.microsoft.com/en-us/magazine/cc163419.aspx)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
</head>
<body>
<script type="text/javascript">
function filter(pred, arr) {
var len = arr.length;
var filtered = []; // shorter version of new Array();
// iterate through every element in the array...
for(var i = 0; i < len; i++) {
var val = arr[i];
// if the element satisfies the predicate let it through
if(pred(val)) {
filtered.push(val);
}
}
return filtered;
}
var someRandomNumbers = [12, 32, 1, 3, 2, 2, 234, 236, 632,7, 8];
var numbersGreaterThan100 = filter(
function(x) { return (x > 100) ? true : false; },
someRandomNumbers);
// displays 234, 236, 632
alert(numbersGreaterThan100);
</script>
</body>
</html>
| 3 |
10,995,252 | 06/12/2012 10:55:26 | 916,439 | 08/28/2011 13:12:42 | 488 | 10 | resolution of iPad simulator | I am new to iOS, how to find what is the resolution of iPad.
Googling resulted me to choose 748*1024, is this value represents in pixels? Or
do we have any alternate measurement unit?
| ios5 | iphone-sdk-4.0 | xcode4.2 | null | null | null | open | resolution of iPad simulator
===
I am new to iOS, how to find what is the resolution of iPad.
Googling resulted me to choose 748*1024, is this value represents in pixels? Or
do we have any alternate measurement unit?
| 0 |
6,162,401 | 05/28/2011 14:59:58 | 663,724 | 03/17/2011 05:17:05 | 117 | 3 | Conversion of Date to different Format | From my JSP Page , i amgetting date in this format
Fri May 13 2011 19:59:09 GMT 0530 (India Standard Time)
Please tell me how can i convert this data to yyyy-mm-dd HH24:Mi:ss this format .
Please advice . Thank you . | java | null | null | null | null | null | open | Conversion of Date to different Format
===
From my JSP Page , i amgetting date in this format
Fri May 13 2011 19:59:09 GMT 0530 (India Standard Time)
Please tell me how can i convert this data to yyyy-mm-dd HH24:Mi:ss this format .
Please advice . Thank you . | 0 |
7,393,920 | 09/12/2011 20:54:11 | 640,261 | 03/01/2011 22:47:04 | 195 | 31 | C DataStructures in C++ Code | I am performing performance comparison tests against several algorithms. One of them is in C, the rest are C++. I don't want to change any of the code in the algorithms.
The C code will not compile with the C++ command
g++ -std=c++0x -O3 -msse2 -m32 -DNDEBUG -DINTEL -D_REENTRANT -lrt -pthread -fno-strict-aliasing -l cds -l tbb -lllalloc -c ../test/main.cpp
The command works for the other algorithms though.
What do you recommend? THe test file can't be converted to C, due to testing criteria.
| c++ | c | data-structures | compilation | null | 09/12/2011 22:00:06 | not a real question | C DataStructures in C++ Code
===
I am performing performance comparison tests against several algorithms. One of them is in C, the rest are C++. I don't want to change any of the code in the algorithms.
The C code will not compile with the C++ command
g++ -std=c++0x -O3 -msse2 -m32 -DNDEBUG -DINTEL -D_REENTRANT -lrt -pthread -fno-strict-aliasing -l cds -l tbb -lllalloc -c ../test/main.cpp
The command works for the other algorithms though.
What do you recommend? THe test file can't be converted to C, due to testing criteria.
| 1 |
99,807 | 09/19/2008 05:10:00 | 1,167,846 | 09/15/2008 11:12:33 | 173 | 19 | Useful Textmate Shortcuts | Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in Textmate and its bundles.
What are some useful keyboard shortcuts you use? | mac | keyboard-shortcuts | textmate | bundle | null | 06/20/2012 12:08:54 | not constructive | Useful Textmate Shortcuts
===
Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in Textmate and its bundles.
What are some useful keyboard shortcuts you use? | 4 |
10,241,777 | 04/20/2012 07:11:06 | 65,120 | 02/11/2009 15:02:52 | 2,000 | 28 | CSS3 visual formatting model | I'm confused by what is written in the specification on the box model in that
**it generates for each element 0 or more boxes** but I do not understand when an element may generate 0 box.
In fact in the specification is also said that **each element generates a box**.
Thanks. | css3 | null | null | null | null | null | open | CSS3 visual formatting model
===
I'm confused by what is written in the specification on the box model in that
**it generates for each element 0 or more boxes** but I do not understand when an element may generate 0 box.
In fact in the specification is also said that **each element generates a box**.
Thanks. | 0 |
7,205,494 | 08/26/2011 13:38:04 | 851,798 | 07/19/2011 10:58:00 | 84 | 9 | Short Link SDK iOs | I'm looking for an sdk/easy way to create a short link programmatically, preferably via a known service such as bitly.com / tinurl.com<br /><br />
The only way I've found doing this is with McAfee's beta short-link service, but it is unknown, and I want the link to be from a known service.
Does anybody know such way?
Tnx in advance! | ios | short-url | null | null | null | null | open | Short Link SDK iOs
===
I'm looking for an sdk/easy way to create a short link programmatically, preferably via a known service such as bitly.com / tinurl.com<br /><br />
The only way I've found doing this is with McAfee's beta short-link service, but it is unknown, and I want the link to be from a known service.
Does anybody know such way?
Tnx in advance! | 0 |
8,088,800 | 11/11/2011 01:54:49 | 1,040,876 | 11/11/2011 01:12:13 | 1 | 0 | Java - cannot read back int from data file after writing | I am trying to write a char[] and then an int, but it caused IOException when I try to read back the int. What I am really trying to do is to write a fixed byte array for a String, that's why I used the Writer class because I can't find write(char[]) in DataOutputStream. What did I do wrong?
import java.io.*;
class Test {
public static void main(String[] args) {
System.out.printf("start of main\n");
char[] cc = new char[300]; // fixed # of chars do block size can be pre-determ
ined
try {
String s = "this is a test.";
System.arraycopy(s.toCharArray(), 0, cc, 0, s.length());
System.out.printf("cc = %s\n", new String(cc));
String filename = "tst.data"; DataOutputStream ostream = new DataOutputStream(new FileOutputStream(filename
));
OutputStreamWriter writer = new OutputStreamWriter(ostream);
writer.write(cc, 0, 300);
writer.flush();
int i = 10;
ostream.writeInt(i);
writer.close();
DataInputStream istream = new DataInputStream(new FileInputStream(filename));
InputStreamReader reader = new InputStreamReader(istream);
char[] newcc = new char[300];
reader.read(newcc, 0, 300);
int j = istream.readInt();
reader.close();
System.out.printf("newcc = %s\n", new String(newcc));
System.out.printf("j = %d\n", j);
} catch (Exception e) {
e.printStackTrace();
}
}
}
| java | input | stream | reader | null | 11/11/2011 05:07:11 | too localized | Java - cannot read back int from data file after writing
===
I am trying to write a char[] and then an int, but it caused IOException when I try to read back the int. What I am really trying to do is to write a fixed byte array for a String, that's why I used the Writer class because I can't find write(char[]) in DataOutputStream. What did I do wrong?
import java.io.*;
class Test {
public static void main(String[] args) {
System.out.printf("start of main\n");
char[] cc = new char[300]; // fixed # of chars do block size can be pre-determ
ined
try {
String s = "this is a test.";
System.arraycopy(s.toCharArray(), 0, cc, 0, s.length());
System.out.printf("cc = %s\n", new String(cc));
String filename = "tst.data"; DataOutputStream ostream = new DataOutputStream(new FileOutputStream(filename
));
OutputStreamWriter writer = new OutputStreamWriter(ostream);
writer.write(cc, 0, 300);
writer.flush();
int i = 10;
ostream.writeInt(i);
writer.close();
DataInputStream istream = new DataInputStream(new FileInputStream(filename));
InputStreamReader reader = new InputStreamReader(istream);
char[] newcc = new char[300];
reader.read(newcc, 0, 300);
int j = istream.readInt();
reader.close();
System.out.printf("newcc = %s\n", new String(newcc));
System.out.printf("j = %d\n", j);
} catch (Exception e) {
e.printStackTrace();
}
}
}
| 3 |
2,322,603 | 02/23/2010 23:32:38 | 232,495 | 12/15/2009 22:23:18 | 602 | 4 | Move cursor in JavaScript | Is it possible to move the mouse so that it is positioned inside a text input using JavaScript? | javascript | null | null | null | null | null | open | Move cursor in JavaScript
===
Is it possible to move the mouse so that it is positioned inside a text input using JavaScript? | 0 |
4,771,050 | 01/22/2011 22:29:32 | 310,648 | 04/07/2010 05:26:33 | 527 | 2 | Triggering a jquery action when the users mark a Checkbox | im very new in javascript and jquery. I have this checkbox:
<label for="editable">Editable </label><input name="editable" type="checkbox" id="edita"/>
And this jquery action:
$('#slickbox1').toggle(400);
return false;
I want to execute that action when the checkbox is checked. Thanks! | javascript | jquery | null | null | null | null | open | Triggering a jquery action when the users mark a Checkbox
===
im very new in javascript and jquery. I have this checkbox:
<label for="editable">Editable </label><input name="editable" type="checkbox" id="edita"/>
And this jquery action:
$('#slickbox1').toggle(400);
return false;
I want to execute that action when the checkbox is checked. Thanks! | 0 |
10,081,262 | 04/09/2012 23:42:11 | 1,313,998 | 04/04/2012 22:41:49 | 6 | 0 | SQL missing data | Hello I wondering if there are any SQL people out there who might know the answer to a brief question:
I am attempting to search for missing data points within a table. The data points are not suppose to be on weekends as well as various other
holidays. I have it working by building a temporary table that holds all data points that should exist(less weekends and holidays) and then deleting
all of the valid data points that exist in the main table, leaving a remainder of data points that should be in existence however are not.
ie:
Main Table
point 1
point 2
point 4
point 5
Temp Table
point 1
point 2
point 3
point 4
point 5
(delete main from temp)
Remaining Temp
point 3
This is operational by passing in a start time and an end time and how many minutes per interval between data points. I am looking to optimize so that
I don't build the temp table by looping from start time to end time in time intervals until complete, then deleting in accordance with the main table.
I am not super strong with SQL statements so I was wondering if there is a way to do dateADD within a select statement like a loop where it increases
based on how many total intervals it has completed without slowing down the server in a loop? Honestly if anyone has any ideas as to make this go faster
it will be greatly appreciated. I can always calculate the next expected value from the value currently being read, but again not sure how to do this outside
of a loop. Thanks in advance, any help will be appreciated. | sql | null | null | null | null | 04/09/2012 23:55:55 | not a real question | SQL missing data
===
Hello I wondering if there are any SQL people out there who might know the answer to a brief question:
I am attempting to search for missing data points within a table. The data points are not suppose to be on weekends as well as various other
holidays. I have it working by building a temporary table that holds all data points that should exist(less weekends and holidays) and then deleting
all of the valid data points that exist in the main table, leaving a remainder of data points that should be in existence however are not.
ie:
Main Table
point 1
point 2
point 4
point 5
Temp Table
point 1
point 2
point 3
point 4
point 5
(delete main from temp)
Remaining Temp
point 3
This is operational by passing in a start time and an end time and how many minutes per interval between data points. I am looking to optimize so that
I don't build the temp table by looping from start time to end time in time intervals until complete, then deleting in accordance with the main table.
I am not super strong with SQL statements so I was wondering if there is a way to do dateADD within a select statement like a loop where it increases
based on how many total intervals it has completed without slowing down the server in a loop? Honestly if anyone has any ideas as to make this go faster
it will be greatly appreciated. I can always calculate the next expected value from the value currently being read, but again not sure how to do this outside
of a loop. Thanks in advance, any help will be appreciated. | 1 |
2,240,738 | 02/10/2010 22:12:29 | 230,518 | 12/13/2009 02:18:03 | 226 | 0 | Theory: Sampling Theorem & Nyquist Frequency | i've got a problem with the sampling theorem
Sampling theorem states that a signal can be reconstructed exactly from it's samples if the original signal has no frequencies aboth half the sampling frequency.
But what about frequencies exactly half the sampling frequency?? let's say i sample a sine (with an arbitrary phase and amplitude) with a frequency exactly double the sine frequency. I will be unable to reconstruct the phase and the amplitude of the sine because i don't know how the phase shifted the sine in relation to my samples (for example, if i happen to sample exactly on the zero-crossings of the sine, my samples will all be zero).
what's the solution to that problem?
thanks! | theory | math | null | null | null | 02/11/2010 04:25:27 | off topic | Theory: Sampling Theorem & Nyquist Frequency
===
i've got a problem with the sampling theorem
Sampling theorem states that a signal can be reconstructed exactly from it's samples if the original signal has no frequencies aboth half the sampling frequency.
But what about frequencies exactly half the sampling frequency?? let's say i sample a sine (with an arbitrary phase and amplitude) with a frequency exactly double the sine frequency. I will be unable to reconstruct the phase and the amplitude of the sine because i don't know how the phase shifted the sine in relation to my samples (for example, if i happen to sample exactly on the zero-crossings of the sine, my samples will all be zero).
what's the solution to that problem?
thanks! | 2 |
5,877,341 | 05/04/2011 00:51:28 | 609,767 | 02/09/2011 13:07:31 | 116 | 12 | Doubts about subdomains in rails app | I have an application that will be marketed as a service. In this application I have an area where the User signs up, another area which is like if it were the User Site and another area that eh administration of User Site. To this end, I'm using wildcards to have subdomains with login User, my problem is to define when viewing the site of application available in the case when the User enters the www and when viewing the home site of User, in the case when he login.app.com enter.
Please excuse my English. | ruby-on-rails | wildcard | saas | subdomains | null | 05/07/2011 11:07:10 | not a real question | Doubts about subdomains in rails app
===
I have an application that will be marketed as a service. In this application I have an area where the User signs up, another area which is like if it were the User Site and another area that eh administration of User Site. To this end, I'm using wildcards to have subdomains with login User, my problem is to define when viewing the site of application available in the case when the User enters the www and when viewing the home site of User, in the case when he login.app.com enter.
Please excuse my English. | 1 |
5,948,489 | 05/10/2011 10:11:13 | 746,616 | 05/10/2011 10:11:13 | 1 | 0 | what is the mean of blackberry widgets applications ? | i am new to blackberry development , i want to know what is the mean of blackberry widgets applications and differrence between it and blackberry java based developmedt | java | null | null | null | null | 05/10/2011 11:15:47 | not a real question | what is the mean of blackberry widgets applications ?
===
i am new to blackberry development , i want to know what is the mean of blackberry widgets applications and differrence between it and blackberry java based developmedt | 1 |
5,196,497 | 03/04/2011 16:25:58 | 638,237 | 02/28/2011 19:13:20 | 6 | 0 | Xcode : how to make the user divide answer ... | Xcode : I have a tip calc that gives you the tip in USD in a label. This works fine.
**I want to make that the user can divide the tip amout(on label) to how much persons they are.**
So for example if the tip is 5 USD , and the user is with five people , then he is able to divide the tip amount to 5 , wich gives a tip of 1 USD per person.
Could someone help me please ?
| cocoa | xcode | sdk | iphone-simulator | calc | 03/06/2011 09:53:20 | not a real question | Xcode : how to make the user divide answer ...
===
Xcode : I have a tip calc that gives you the tip in USD in a label. This works fine.
**I want to make that the user can divide the tip amout(on label) to how much persons they are.**
So for example if the tip is 5 USD , and the user is with five people , then he is able to divide the tip amount to 5 , wich gives a tip of 1 USD per person.
Could someone help me please ?
| 1 |
11,399,219 | 07/09/2012 16:26:02 | 1,491,069 | 06/29/2012 11:39:36 | 1 | 0 | Is the set of codes of Deterministic Finite-State Automata a regular language? | Let $\Sigma$ be a given alphabet. Is there a way to code up Deterministic Finite state Automata (DFA) over $\Sigma$ as strings of $\Sigma$ in such a way that the corresponding subset of $\Sigma^*$ is a regular language?
For example for Turing machines, the set of codes of Turing machines over a fixed alphabet is decidable, and we can speak of decidable sets of Turing machines (through their codes).
Of course we can also speak of regular sets of DFA's (through their codes). Is the set of all DFA's regular in this sense? | logic | finite-automata | automata | formal-languages | computability | 07/10/2012 21:57:50 | off topic | Is the set of codes of Deterministic Finite-State Automata a regular language?
===
Let $\Sigma$ be a given alphabet. Is there a way to code up Deterministic Finite state Automata (DFA) over $\Sigma$ as strings of $\Sigma$ in such a way that the corresponding subset of $\Sigma^*$ is a regular language?
For example for Turing machines, the set of codes of Turing machines over a fixed alphabet is decidable, and we can speak of decidable sets of Turing machines (through their codes).
Of course we can also speak of regular sets of DFA's (through their codes). Is the set of all DFA's regular in this sense? | 2 |
3,115,937 | 06/25/2010 06:11:52 | 150,046 | 08/03/2009 23:31:41 | 905 | 23 | Passing a reference to a TObjectDictionary<TKey, TValue>.TValueEnumerator | I am trying to use Delphi 2010's TObjectDictionary<TKey, TValue> generic.
I would like to pass an enumerator of the `Values` property of that generic class, and the compiler doesn't seem to want to let me... Example:
TAttributeStates = class(TInterfacedObject, IAttributeStates)
private
FStates: TObjectDictionary<TPatchAttribute, TAttributeState>;
public
constructor Create;
destructor Destroy; override;
function GetEnumerator: TObjectDictionary<TPatchAttribute, TAttributeState>.TValueEnumerator;
end;
implementation
function TAttributeStates.GetEnumerator: TObjectDictionary<TPatchAttribute, TAttributeState>.TValueEnumerator;
begin
result := FStates.Values.GetEnumerator;
end;
This fails to compile with the error:
[DCC Error] ChannelStates.pas(249): E2010 Incompatible types: 'TDictionary<Generics.Collections.TObjectDictionary<TKey,TValue>.TKey,Generics.Collections.TObjectDictionary<TKey,TValue>.TValue>.TValueEnumerator' and 'TDictionary<ChannelPatch.TPatchAttribute,ChannelStates.TAttributeState>.TValueEnumerator'
It seems that the compiler isn't resolving the sub-type properly...
Anyone have any ideas?
N@ | delphi | generics | delphi-2010 | nested-generics | null | null | open | Passing a reference to a TObjectDictionary<TKey, TValue>.TValueEnumerator
===
I am trying to use Delphi 2010's TObjectDictionary<TKey, TValue> generic.
I would like to pass an enumerator of the `Values` property of that generic class, and the compiler doesn't seem to want to let me... Example:
TAttributeStates = class(TInterfacedObject, IAttributeStates)
private
FStates: TObjectDictionary<TPatchAttribute, TAttributeState>;
public
constructor Create;
destructor Destroy; override;
function GetEnumerator: TObjectDictionary<TPatchAttribute, TAttributeState>.TValueEnumerator;
end;
implementation
function TAttributeStates.GetEnumerator: TObjectDictionary<TPatchAttribute, TAttributeState>.TValueEnumerator;
begin
result := FStates.Values.GetEnumerator;
end;
This fails to compile with the error:
[DCC Error] ChannelStates.pas(249): E2010 Incompatible types: 'TDictionary<Generics.Collections.TObjectDictionary<TKey,TValue>.TKey,Generics.Collections.TObjectDictionary<TKey,TValue>.TValue>.TValueEnumerator' and 'TDictionary<ChannelPatch.TPatchAttribute,ChannelStates.TAttributeState>.TValueEnumerator'
It seems that the compiler isn't resolving the sub-type properly...
Anyone have any ideas?
N@ | 0 |
868,297 | 05/15/2009 12:07:37 | 91,607 | 04/16/2009 12:44:26 | 29 | 1 | Good books/resources for User Interface design ? |
I suck at User Interface design. I've always concentrated on the design/coding/programming part
and I want to know what books I can use to be better at designing User Interfaces in general and Web Interfaces in particular.
Thanks. | user-interface | null | null | null | null | 09/28/2011 11:32:15 | not constructive | Good books/resources for User Interface design ?
===
I suck at User Interface design. I've always concentrated on the design/coding/programming part
and I want to know what books I can use to be better at designing User Interfaces in general and Web Interfaces in particular.
Thanks. | 4 |
8,198,234 | 11/19/2011 23:41:07 | 1,055,847 | 11/19/2011 23:34:53 | 1 | 0 | Where should an absolute beginning programmer start? | Yea, I own a couple of Python, C++ and Java books. I'm 16 and pretty interested in programming, but I am kind of lost on where to start to get an idea of the basics. I want to know the in's and out's of programming. Any book and programming language recommendations? My only current experience is HTML (but that isn't really relevant) I've just recently started reading this Python book (as I've heard Python is a great beginning langauge) but I am having a hard time understanding some of the concepts. I think I need to take a step back.
I have my sights open for security type programming. Any tips and recommendations will be appreciated. | python | null | null | null | null | 11/20/2011 16:08:21 | not constructive | Where should an absolute beginning programmer start?
===
Yea, I own a couple of Python, C++ and Java books. I'm 16 and pretty interested in programming, but I am kind of lost on where to start to get an idea of the basics. I want to know the in's and out's of programming. Any book and programming language recommendations? My only current experience is HTML (but that isn't really relevant) I've just recently started reading this Python book (as I've heard Python is a great beginning langauge) but I am having a hard time understanding some of the concepts. I think I need to take a step back.
I have my sights open for security type programming. Any tips and recommendations will be appreciated. | 4 |
11,487,597 | 07/14/2012 21:43:12 | 1,510,578 | 07/08/2012 21:12:00 | 51 | 1 | cron: Unix versus Windows (and also magento) | I notice my magento-1.7.0.2.zip file installs
cron.php and cron.sh files in the base directory
of the Magento installation. So, I was wondering
(after recalling that on Unix cron works by
manipulating /etc/crontab)...
How does cron on windows differ from cron on Unix/Linux?
How does magento implement cron?
Thanks,
John Goche | linux | magento | windows-7 | cron | null | 07/15/2012 01:12:02 | not a real question | cron: Unix versus Windows (and also magento)
===
I notice my magento-1.7.0.2.zip file installs
cron.php and cron.sh files in the base directory
of the Magento installation. So, I was wondering
(after recalling that on Unix cron works by
manipulating /etc/crontab)...
How does cron on windows differ from cron on Unix/Linux?
How does magento implement cron?
Thanks,
John Goche | 1 |
8,212,665 | 11/21/2011 13:36:11 | 689,901 | 04/03/2011 14:49:18 | 25 | 0 | Cannot Comprehend Requirement | I'm trying to brush up my algorithmic skills and came across this problem. Here goes: http://opc.iarcs.org.in/index.php/problems/LEADGAME
My code is:
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char* argv[])
{
int count;
cin >> count;
int winningP = 1; // winning player
int lead = 0; // lead
for (int i=0; i < count; i++)
{
int scoreA, scoreB = 0;
cin >> scoreA >> scoreB;
int l;
if (scoreA > scoreB)
l = scoreA - scoreB;
else
l = scoreB - scoreA;
if (l > lead) // greater lead than what's been processed
{
lead = l;
winningP = scoreA > scoreB ? 1 : 2;
}
}
cout << winningP << " " << lead;
return 0;
}
However, on the website, when I submit my code for evaluation, it prints out that my program is giving wrong answers. What am I doing wrong here? The sample input and outputs have been verified. | c++ | algorithm | null | null | null | 11/21/2011 17:36:19 | too localized | Cannot Comprehend Requirement
===
I'm trying to brush up my algorithmic skills and came across this problem. Here goes: http://opc.iarcs.org.in/index.php/problems/LEADGAME
My code is:
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char* argv[])
{
int count;
cin >> count;
int winningP = 1; // winning player
int lead = 0; // lead
for (int i=0; i < count; i++)
{
int scoreA, scoreB = 0;
cin >> scoreA >> scoreB;
int l;
if (scoreA > scoreB)
l = scoreA - scoreB;
else
l = scoreB - scoreA;
if (l > lead) // greater lead than what's been processed
{
lead = l;
winningP = scoreA > scoreB ? 1 : 2;
}
}
cout << winningP << " " << lead;
return 0;
}
However, on the website, when I submit my code for evaluation, it prints out that my program is giving wrong answers. What am I doing wrong here? The sample input and outputs have been verified. | 3 |
1,716,363 | 11/11/2009 16:30:38 | 104,060 | 05/09/2009 13:16:27 | 904 | 10 | First chance exception - long at memory location? | What is this and how can I handle/fix it?
> First-chance exception at 0x756fb727 in Program.exe: Microsoft
> C++ exception: long at memory location
> 0x0018f7a4.
I am getting about a thousand of these each time I run my application. How can I track this down and fix it/ | c++ | exception | compiler | null | null | null | open | First chance exception - long at memory location?
===
What is this and how can I handle/fix it?
> First-chance exception at 0x756fb727 in Program.exe: Microsoft
> C++ exception: long at memory location
> 0x0018f7a4.
I am getting about a thousand of these each time I run my application. How can I track this down and fix it/ | 0 |
5,044,502 | 02/18/2011 17:27:55 | 182,786 | 10/01/2009 21:59:41 | 1,023 | 44 | NHibernate "Could not determine type for X" error | After upgrading the NHibernate and FluentNHibernate DLLs in a project, I'm now getting a "Could not determine type for: MyApp.Domain.Entities.AppCategory" exception thrown when initializing the SessionFactory. The only change in my code was tweaking the implementation of ForeignKeyConvention to override the `GetKeyName ( Member member, Type type )` abstract method, instead of `GetKeyName ( PropertyInfo property, Type type )`.
The upgraded DLLs were from 1.0.0.593 to 1.1.0.685 for FluentNHibernate, and from 2.1.0.4000 to 2.1.2.4000 for NHibernate. Part of the difficulty in finding a solution is the old age of the NHibernate version we're using, but that can't be changed, at least for now.
I posted the full exception and all relevant code and configuration below. I apologize for the length, but I have no idea where the problem might be.
**Full Exception**
FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
----> FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
----> NHibernate.MappingException : Could not compile the mapping document: (XmlDocument)
----> NHibernate.MappingException : Could not determine type for: MyApp.Domain.Entities.AppCategory, MyApp.Domain, Version=1.0.0.76, Culture=neutral, PublicKeyToken=null, for columns: NHibernate.Mapping.Column(AppCategory)
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 98
at MyFramework.App.DataAccess.NHibernate.Databases.BaseDatabase.CreateSessionFactory() in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\Databases\BaseDatabase.cs: line 115
at MyFramework.App.DataAccess.NHibernate.Databases.BaseDatabase.Init() in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\Databases\BaseDatabase.cs: line 100
at MyApp.DataAccess.SmartStudioUserUnitOfWork.<.ctor>b__0() in SmartStudioUserUnitOfWork.cs: line 28
at MyFramework.App.DataAccess.NHibernate.UnitOfWork`1.Create(FlushMode flushMode) in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\UnitOfWork.cs: line 72
at MyFramework.App.DataAccess.NHibernate.UnitOfWork`1..ctor(Func`1 getBaseDatabase) in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\UnitOfWork.cs: line 37
at MyApp.DataAccess.SmartStudioUserUnitOfWork..ctor() in SmartStudioUserUnitOfWork.cs: line 17
at MyApp.DataAccess.Test.SmartStudioUserDaoTest.create_dao() in SmartStudioUserDaoTest.cs: line 20
--FluentConfigurationException
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 119
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 93
--MappingException
at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
at NHibernate.Cfg.Configuration.ProcessMappingsQueue()
at NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document)
at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name)
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)
at NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc, String name)
at NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc)
at FluentNHibernate.PersistenceModel.Configure(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs: line 262
at FluentNHibernate.Automapping.AutoPersistenceModel.Configure(Configuration configuration) in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoPersistenceModel.cs: line 170
at FluentNHibernate.Cfg.AutoMappingsContainer.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\AutoMappingsContainer.cs: line 84
at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\MappingConfiguration.cs: line 56
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 110
--MappingException
at NHibernate.Mapping.SimpleValue.get_Type()
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindProperty(XmlNode node, Property property, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.CreateProperty(IValue value, String propertyName, String className, XmlNode subnode, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindJoin(XmlNode node, Join join, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.PropertiesFromXML(XmlNode node, PersistentClass model, IDictionary`2 inheritedMetas, UniqueKey uniqueKey, Boolean mutable, Boolean nullable, Boolean naturalId)
at NHibernate.Cfg.XmlHbmBinding.RootClassBinder.Bind(XmlNode node, HbmClass classSchema, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddRootClasses(XmlNode parentNode, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(XmlNode node)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
**Fluent Configuration**
sessionFactory = fluentConfiguration
.Mappings(m => m.AutoMappings.Add(
AutoMap.AssemblyOf<Application>().Conventions
.Add<CustomForeignKeyConvention>()))
.ExposeConfiguration(new SchemaExport(config).Create(true, false))
.BuildSessionFactory();
public class CustomForeignKeyConvention : ForeignKeyConvention
{
protected override string GetKeyName ( Member member, Type type )
{
if (member == null)
{
return type.Name + "Id";
}
return member.Name + "Id";
}
}
**Domain classes**
public class Application
{
public virtual int Id { get; set; }
public virtual string FriendlyName { get; set; }
public virtual AppCategory AppCategory { get; set; }
}
public class AppCategory
{
public virtual int Id { get; private set; }
public virtual string CategoryName { get; set; }
}
**Database Table Definitions**
CREATE TABLE [dbo].[Application](
[Id] [int] IDENTITY(1,1) NOT NULL,
[FriendlyName] [varchar](255) NOT NULL,
[AppCategoryId] [int] NOT NULL,
CONSTRAINT [PK_Application] PRIMARY KEY CLUSTERED ([Id] ASC)
)
GO
ALTER TABLE [dbo].[Application] WITH CHECK
ADD CONSTRAINT [FK_Application_AppCategory] FOREIGN KEY([AppCategoryId])
REFERENCES [dbo].[AppCategory] ([Id])
GO
ALTER TABLE [dbo].[Application] CHECK CONSTRAINT [FK_Application_AppCategory]
GO
CREATE TABLE [dbo].[AppCategory](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CategoryName] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_AppCategory] PRIMARY KEY CLUSTERED ([Id] ASC)
)
**Fluent NHibernate Mapping**
public class ApplicationMappingOverride : IAutoMappingOverride<Application>
{
public void Override(AutoMapping<Application> mapping)
{
mapping.Table("Application");
mapping.Id(x => x.Id);
mapping.Map(x => x.FriendlyName);
mapping.Join("AppCategory", x => x.Map(y => y.AppCategory));
}
}
**Mapping XML (pulled from Fluent NHibernate log message):**
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true">
<class xmlns="urn:nhibernate-mapping-2.2" mutable="true"
name="MyApp.Domain.Entities.Application, MyApp.Domain, Version=1.0.0.76, Culture=neutral, PublicKeyToken=null" table="Application">
<id name="Id" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Id" />
<generator class="identity" />
</id>
<property name="FriendlyName" type="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="FriendlyName" />
</property>
<join table="AppCategory">
<key>
<column name="ApplicationId" />
</key>
<property name="AppCategory" type="MyApp.Domain.Entities.AppCategory, MyApp.Domain, Version=1.0.0.76, Culture=neutral, PublicKeyToken=null">
<column name="AppCategory" />
</property>
</join>
</class>
</hibernate-mapping>
| c# | nhibernate | fluent-nhibernate | null | null | 01/22/2012 15:40:19 | too localized | NHibernate "Could not determine type for X" error
===
After upgrading the NHibernate and FluentNHibernate DLLs in a project, I'm now getting a "Could not determine type for: MyApp.Domain.Entities.AppCategory" exception thrown when initializing the SessionFactory. The only change in my code was tweaking the implementation of ForeignKeyConvention to override the `GetKeyName ( Member member, Type type )` abstract method, instead of `GetKeyName ( PropertyInfo property, Type type )`.
The upgraded DLLs were from 1.0.0.593 to 1.1.0.685 for FluentNHibernate, and from 2.1.0.4000 to 2.1.2.4000 for NHibernate. Part of the difficulty in finding a solution is the old age of the NHibernate version we're using, but that can't be changed, at least for now.
I posted the full exception and all relevant code and configuration below. I apologize for the length, but I have no idea where the problem might be.
**Full Exception**
FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
----> FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
----> NHibernate.MappingException : Could not compile the mapping document: (XmlDocument)
----> NHibernate.MappingException : Could not determine type for: MyApp.Domain.Entities.AppCategory, MyApp.Domain, Version=1.0.0.76, Culture=neutral, PublicKeyToken=null, for columns: NHibernate.Mapping.Column(AppCategory)
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 98
at MyFramework.App.DataAccess.NHibernate.Databases.BaseDatabase.CreateSessionFactory() in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\Databases\BaseDatabase.cs: line 115
at MyFramework.App.DataAccess.NHibernate.Databases.BaseDatabase.Init() in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\Databases\BaseDatabase.cs: line 100
at MyApp.DataAccess.SmartStudioUserUnitOfWork.<.ctor>b__0() in SmartStudioUserUnitOfWork.cs: line 28
at MyFramework.App.DataAccess.NHibernate.UnitOfWork`1.Create(FlushMode flushMode) in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\UnitOfWork.cs: line 72
at MyFramework.App.DataAccess.NHibernate.UnitOfWork`1..ctor(Func`1 getBaseDatabase) in C:\WIP\VSProjects\MyFramework\src\App\DataAccess\NHibernate\UnitOfWork.cs: line 37
at MyApp.DataAccess.SmartStudioUserUnitOfWork..ctor() in SmartStudioUserUnitOfWork.cs: line 17
at MyApp.DataAccess.Test.SmartStudioUserDaoTest.create_dao() in SmartStudioUserDaoTest.cs: line 20
--FluentConfigurationException
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 119
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 93
--MappingException
at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
at NHibernate.Cfg.Configuration.ProcessMappingsQueue()
at NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document)
at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name)
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)
at NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc, String name)
at NHibernate.Cfg.Configuration.AddDocument(XmlDocument doc)
at FluentNHibernate.PersistenceModel.Configure(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs: line 262
at FluentNHibernate.Automapping.AutoPersistenceModel.Configure(Configuration configuration) in d:\Builds\FluentNH\src\FluentNHibernate\Automapping\AutoPersistenceModel.cs: line 170
at FluentNHibernate.Cfg.AutoMappingsContainer.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\AutoMappingsContainer.cs: line 84
at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg) in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\MappingConfiguration.cs: line 56
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration() in d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs: line 110
--MappingException
at NHibernate.Mapping.SimpleValue.get_Type()
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindProperty(XmlNode node, Property property, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.CreateProperty(IValue value, String propertyName, String className, XmlNode subnode, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindJoin(XmlNode node, Join join, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.PropertiesFromXML(XmlNode node, PersistentClass model, IDictionary`2 inheritedMetas, UniqueKey uniqueKey, Boolean mutable, Boolean nullable, Boolean naturalId)
at NHibernate.Cfg.XmlHbmBinding.RootClassBinder.Bind(XmlNode node, HbmClass classSchema, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddRootClasses(XmlNode parentNode, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(XmlNode node)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
**Fluent Configuration**
sessionFactory = fluentConfiguration
.Mappings(m => m.AutoMappings.Add(
AutoMap.AssemblyOf<Application>().Conventions
.Add<CustomForeignKeyConvention>()))
.ExposeConfiguration(new SchemaExport(config).Create(true, false))
.BuildSessionFactory();
public class CustomForeignKeyConvention : ForeignKeyConvention
{
protected override string GetKeyName ( Member member, Type type )
{
if (member == null)
{
return type.Name + "Id";
}
return member.Name + "Id";
}
}
**Domain classes**
public class Application
{
public virtual int Id { get; set; }
public virtual string FriendlyName { get; set; }
public virtual AppCategory AppCategory { get; set; }
}
public class AppCategory
{
public virtual int Id { get; private set; }
public virtual string CategoryName { get; set; }
}
**Database Table Definitions**
CREATE TABLE [dbo].[Application](
[Id] [int] IDENTITY(1,1) NOT NULL,
[FriendlyName] [varchar](255) NOT NULL,
[AppCategoryId] [int] NOT NULL,
CONSTRAINT [PK_Application] PRIMARY KEY CLUSTERED ([Id] ASC)
)
GO
ALTER TABLE [dbo].[Application] WITH CHECK
ADD CONSTRAINT [FK_Application_AppCategory] FOREIGN KEY([AppCategoryId])
REFERENCES [dbo].[AppCategory] ([Id])
GO
ALTER TABLE [dbo].[Application] CHECK CONSTRAINT [FK_Application_AppCategory]
GO
CREATE TABLE [dbo].[AppCategory](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CategoryName] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_AppCategory] PRIMARY KEY CLUSTERED ([Id] ASC)
)
**Fluent NHibernate Mapping**
public class ApplicationMappingOverride : IAutoMappingOverride<Application>
{
public void Override(AutoMapping<Application> mapping)
{
mapping.Table("Application");
mapping.Id(x => x.Id);
mapping.Map(x => x.FriendlyName);
mapping.Join("AppCategory", x => x.Map(y => y.AppCategory));
}
}
**Mapping XML (pulled from Fluent NHibernate log message):**
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true">
<class xmlns="urn:nhibernate-mapping-2.2" mutable="true"
name="MyApp.Domain.Entities.Application, MyApp.Domain, Version=1.0.0.76, Culture=neutral, PublicKeyToken=null" table="Application">
<id name="Id" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Id" />
<generator class="identity" />
</id>
<property name="FriendlyName" type="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="FriendlyName" />
</property>
<join table="AppCategory">
<key>
<column name="ApplicationId" />
</key>
<property name="AppCategory" type="MyApp.Domain.Entities.AppCategory, MyApp.Domain, Version=1.0.0.76, Culture=neutral, PublicKeyToken=null">
<column name="AppCategory" />
</property>
</join>
</class>
</hibernate-mapping>
| 3 |
6,925,631 | 08/03/2011 11:18:51 | 876,471 | 08/03/2011 11:18:51 | 1 | 0 | silverstripe function to return menu level | I'm trying to write a function that returns what menu levels are visible on the page...at the moment I'm using <% if %> statements in the template, ie:
<div class="<% if Menu(1) %>navA<% end_if %> <% if Menu(2) %>navB<% end_if %> <% if Menu(3) %>navC<% end_if %>">...</div>
Which, if there are 3 menu levels on a page, returns `<div class="navA navB navC">`
What I want is a function that returns just the lowest level menu on the current page, ie `<div class="navC">`
Thanks | silverstripe | null | null | null | null | null | open | silverstripe function to return menu level
===
I'm trying to write a function that returns what menu levels are visible on the page...at the moment I'm using <% if %> statements in the template, ie:
<div class="<% if Menu(1) %>navA<% end_if %> <% if Menu(2) %>navB<% end_if %> <% if Menu(3) %>navC<% end_if %>">...</div>
Which, if there are 3 menu levels on a page, returns `<div class="navA navB navC">`
What I want is a function that returns just the lowest level menu on the current page, ie `<div class="navC">`
Thanks | 0 |
9,499,056 | 02/29/2012 12:18:28 | 462,496 | 09/30/2010 05:41:19 | 53 | 1 | How to limit rows in SELECT with TRANSBASE | I'm working with huge records amount in one table and i need to SELECT them in 50000 pages. Is it possible somehow to limit these pages so the query would be faster and row count will be limited and offsetted?
I'm using ODBC with php like this:
$odbc_query = "SELECT * FROM " . $table_name;
$data = odbc_exec($this->odbc_id, $odbc_query);
while($row = odbc_fetch_array($data))
{ | database | transbase | null | null | null | null | open | How to limit rows in SELECT with TRANSBASE
===
I'm working with huge records amount in one table and i need to SELECT them in 50000 pages. Is it possible somehow to limit these pages so the query would be faster and row count will be limited and offsetted?
I'm using ODBC with php like this:
$odbc_query = "SELECT * FROM " . $table_name;
$data = odbc_exec($this->odbc_id, $odbc_query);
while($row = odbc_fetch_array($data))
{ | 0 |
11,683,571 | 07/27/2012 07:47:06 | 1,512,179 | 07/09/2012 14:05:29 | 5 | 0 | Need some good sources to learn java | I am a beginner at java and i am learning java by thenewboston's java for beginners series.
http://www.youtube.com/playlist?list=PLFE2CE09D83EE3E28&feature=plcp
it is very interesting and easy to understand but as i can see that he only explains the main part and doesn't share a lot of information due to the simple fact that java is such a wide language.
but, i need some sources to learn java in a little more depth. I have listened a lot about head first java but is it good enough? is it worth buying? will it be too difficult for me to understand?(i have already learnt the basics of python so i have a grasp on programming language and i am not facing difficulties to understand those videos either.)
what i want to do is that, first understand the basics by thenewboston's videos on youtube and then study it in detail.
also, what is the difference between head first java and headfirst java 2nd edition?
http://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208/ref=sr_1_1?s=books&ie=UTF8&qid=1343374211&sr=1-1&keywords=head+first+java
(http://)shop.oreilly.com/product/9780596009205.do
also, it would be great help if you tell me what sources you used to study java(though i want some book sources.)
also, how much time on an average, if i spend 1-2 hours daily will it take me to learn java at such an extent that i can make gui and some basic games?
i know this isn't a very tech - type question but it will help me a lot.
Thanks a ton! | java | null | null | null | null | 07/27/2012 09:20:04 | not constructive | Need some good sources to learn java
===
I am a beginner at java and i am learning java by thenewboston's java for beginners series.
http://www.youtube.com/playlist?list=PLFE2CE09D83EE3E28&feature=plcp
it is very interesting and easy to understand but as i can see that he only explains the main part and doesn't share a lot of information due to the simple fact that java is such a wide language.
but, i need some sources to learn java in a little more depth. I have listened a lot about head first java but is it good enough? is it worth buying? will it be too difficult for me to understand?(i have already learnt the basics of python so i have a grasp on programming language and i am not facing difficulties to understand those videos either.)
what i want to do is that, first understand the basics by thenewboston's videos on youtube and then study it in detail.
also, what is the difference between head first java and headfirst java 2nd edition?
http://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208/ref=sr_1_1?s=books&ie=UTF8&qid=1343374211&sr=1-1&keywords=head+first+java
(http://)shop.oreilly.com/product/9780596009205.do
also, it would be great help if you tell me what sources you used to study java(though i want some book sources.)
also, how much time on an average, if i spend 1-2 hours daily will it take me to learn java at such an extent that i can make gui and some basic games?
i know this isn't a very tech - type question but it will help me a lot.
Thanks a ton! | 4 |
8,608,779 | 12/22/2011 19:25:43 | 1,047,895 | 11/15/2011 15:28:04 | 1 | 0 | Advanced Map Android | I'm starting to work with google maps in android and don't know where to start to do something cool.
anybody have a good website where teachs about using maps in android?
here is something i want to do...
image: http://imageshack.us/photo/my-images/215/printgooglemaps.jpg/
in this case, using maps app from Android 3.1, when you click in the dialog, that box in the left opens. What is this box? a dialog? activity? How do I do that?
Tks a lot and sorry for my english.
| android | maps | null | null | null | 12/22/2011 20:31:52 | not a real question | Advanced Map Android
===
I'm starting to work with google maps in android and don't know where to start to do something cool.
anybody have a good website where teachs about using maps in android?
here is something i want to do...
image: http://imageshack.us/photo/my-images/215/printgooglemaps.jpg/
in this case, using maps app from Android 3.1, when you click in the dialog, that box in the left opens. What is this box? a dialog? activity? How do I do that?
Tks a lot and sorry for my english.
| 1 |
7,242,057 | 08/30/2011 10:52:06 | 919,384 | 08/30/2011 09:26:13 | -1 | 0 | how to create TAGS | How can I create tags, like the one in Stack Over Flow ,, when you post a question and you add the tags !! how can i create something like that
example but not exactly like this:
<style type="text/css">
.tagcloud {
font-weight: bolder;
line-height: 1.4em;
}
.tagcloud li {
display: inline;
white-space: nowrap;
padding: 0;
margin: 0;
}
.tagcloud li a {
padding: 0 0.2em 0 0.2em;
text-decoration: none;
}
</style>
<div style="width: 300px; text-align: justify">
<ul class="tagcloud" style="background-color: #FFFFFF; padding: 20px;">
<li><a href="#"
style="font-family: Verdana; font-size: 16px; color: #0000cc;"
title="php, html, ajax, css">php, html, ajax, css</a></li>
</ul>
</div>
| php | ajax | tags | null | null | 08/30/2011 11:01:49 | not a real question | how to create TAGS
===
How can I create tags, like the one in Stack Over Flow ,, when you post a question and you add the tags !! how can i create something like that
example but not exactly like this:
<style type="text/css">
.tagcloud {
font-weight: bolder;
line-height: 1.4em;
}
.tagcloud li {
display: inline;
white-space: nowrap;
padding: 0;
margin: 0;
}
.tagcloud li a {
padding: 0 0.2em 0 0.2em;
text-decoration: none;
}
</style>
<div style="width: 300px; text-align: justify">
<ul class="tagcloud" style="background-color: #FFFFFF; padding: 20px;">
<li><a href="#"
style="font-family: Verdana; font-size: 16px; color: #0000cc;"
title="php, html, ajax, css">php, html, ajax, css</a></li>
</ul>
</div>
| 1 |
5,244,735 | 03/09/2011 10:55:28 | 445,826 | 09/12/2010 22:33:56 | 418 | 25 | Urls not working while integrating custom application with django-cms | I'm trying to integrate an django application with django-cms. I'm using the basic "Poll" application as mentioned in basic Django tutorial and following guidelines over <a href="http://readthedocs.org/docs/django-cms/en/2.1.3/extending_cms/extending_examples.html#my-first-app-apphook">here</a>.
Now I can integrate the application and can view the "poll" page. But when I press 'submit', the django-cms gives me error
**"CMS: Page not found for "polls/1/vote"**
Update: If I add following line to main urls.py, everything works fine.
(r'^polls/', include('polls.urls')),
But this is usually discouraged in django and django-cms. Is there a way out?
| django | django-models | django-cms | null | null | null | open | Urls not working while integrating custom application with django-cms
===
I'm trying to integrate an django application with django-cms. I'm using the basic "Poll" application as mentioned in basic Django tutorial and following guidelines over <a href="http://readthedocs.org/docs/django-cms/en/2.1.3/extending_cms/extending_examples.html#my-first-app-apphook">here</a>.
Now I can integrate the application and can view the "poll" page. But when I press 'submit', the django-cms gives me error
**"CMS: Page not found for "polls/1/vote"**
Update: If I add following line to main urls.py, everything works fine.
(r'^polls/', include('polls.urls')),
But this is usually discouraged in django and django-cms. Is there a way out?
| 0 |
1,505,621 | 10/01/2009 18:24:25 | 85,971 | 04/02/2009 02:29:20 | 96 | 2 | PHP Import Foreign Class' Method into MyClass | Wondering if this is possible in PHP Land:
Let's say I have a class as follows:
class myClass{
var $myVar;
...
myMethod(){
$this->myVar = 10;
}
}
and another class:
class anotherClass {
...
addFive(){
$this->myVar += 5;
}
}
The 'anotherClass' is 3500 lines long and I just want the single 'addFive' method to use in myClass.
- Is there a way I can import the function and be able to call it in my class and the $this would reference the myClass object?
- Is this good/bad practice?
- (optional) How does this work in Python? (Just curious as I'm starting to learn Python) | php | oop | python | closures | anonymous-methods | null | open | PHP Import Foreign Class' Method into MyClass
===
Wondering if this is possible in PHP Land:
Let's say I have a class as follows:
class myClass{
var $myVar;
...
myMethod(){
$this->myVar = 10;
}
}
and another class:
class anotherClass {
...
addFive(){
$this->myVar += 5;
}
}
The 'anotherClass' is 3500 lines long and I just want the single 'addFive' method to use in myClass.
- Is there a way I can import the function and be able to call it in my class and the $this would reference the myClass object?
- Is this good/bad practice?
- (optional) How does this work in Python? (Just curious as I'm starting to learn Python) | 0 |
7,516,202 | 09/22/2011 14:14:00 | 329,755 | 04/30/2010 12:46:03 | 235 | 25 | MSI , MSP pros and cons | What are the pros and cons of using MSI and MSP in using them for deployment. I was thinking of automating the deployment of my software using MSI and MSP.
I wanted to understand if there is any concerns. And also how feasible is it to use MSP for patch deployment | asp.net | msi | windows-installer | msp | null | 10/12/2011 14:32:33 | not constructive | MSI , MSP pros and cons
===
What are the pros and cons of using MSI and MSP in using them for deployment. I was thinking of automating the deployment of my software using MSI and MSP.
I wanted to understand if there is any concerns. And also how feasible is it to use MSP for patch deployment | 4 |
1,266,194 | 08/12/2009 13:31:35 | 144,755 | 07/24/2009 21:15:16 | 25 | 2 | Silverlight controls not loading | I'm working on a Silverlight 3.0 app, and about 1 out of every 10 or 20 times, a UserControl I've created won't load with the rest of the application. The rest of the application loads and functions correctly. So far, I've been exclusively launching this from visual studio, but I'd like to be sure that this isn't something that will happen when it's actually deployed.
Does anyone know what might be causing this? Has anyone else experienced this? | silverlight | silverlight-3.0 | null | null | null | null | open | Silverlight controls not loading
===
I'm working on a Silverlight 3.0 app, and about 1 out of every 10 or 20 times, a UserControl I've created won't load with the rest of the application. The rest of the application loads and functions correctly. So far, I've been exclusively launching this from visual studio, but I'd like to be sure that this isn't something that will happen when it's actually deployed.
Does anyone know what might be causing this? Has anyone else experienced this? | 0 |
10,196,191 | 04/17/2012 17:38:55 | 805,065 | 06/19/2011 04:40:45 | 347 | 16 | Multiple iOS Developer Accounts | If I and another individual want to publish an application, we would have to somehow create a joint account, and I understand this. However, in the future, if we were to independently publish applications, that would require us to create another developer account each and thus spend another $99 yearly. So my question is: Is there any way where we can both have individual accounts and somehow jointly publish the joint application onto the market?
So essentially, is there any way to avoid having to create seperate accounts for our individual publishing ventures and a joint account simply for publishing **one** application?
Sorry, I am new to iPhone Development so I may have missed something. | iphone | app-store | null | null | null | 04/19/2012 02:41:16 | off topic | Multiple iOS Developer Accounts
===
If I and another individual want to publish an application, we would have to somehow create a joint account, and I understand this. However, in the future, if we were to independently publish applications, that would require us to create another developer account each and thus spend another $99 yearly. So my question is: Is there any way where we can both have individual accounts and somehow jointly publish the joint application onto the market?
So essentially, is there any way to avoid having to create seperate accounts for our individual publishing ventures and a joint account simply for publishing **one** application?
Sorry, I am new to iPhone Development so I may have missed something. | 2 |
10,272,545 | 04/22/2012 22:08:22 | 766,650 | 05/23/2011 20:15:56 | 340 | 19 | Android Cloud Storage | I understand that this is an <b>insanely</b> broad topic, but can anyone give me any starting links/documentation on how to integrate cloud storage into my app? As an example (this isn't the actual app, since there's dozens of apps like this), I want the user to write a note and have it automatically saved to some cloud linked to their specific account. Now, I'm aware that I could work with DropBox to achieve this, but that requires the user to have a DropBox account and I would like this to work independently of any third-party services. <p> I know this is a lot to ask, but are there any beginner resources out there that anyone can think of to get me started thinking about this?
Thanks! | android | backup | cloud | null | null | 04/25/2012 11:40:58 | not a real question | Android Cloud Storage
===
I understand that this is an <b>insanely</b> broad topic, but can anyone give me any starting links/documentation on how to integrate cloud storage into my app? As an example (this isn't the actual app, since there's dozens of apps like this), I want the user to write a note and have it automatically saved to some cloud linked to their specific account. Now, I'm aware that I could work with DropBox to achieve this, but that requires the user to have a DropBox account and I would like this to work independently of any third-party services. <p> I know this is a lot to ask, but are there any beginner resources out there that anyone can think of to get me started thinking about this?
Thanks! | 1 |
1,554,429 | 10/12/2009 12:57:34 | 171,336 | 09/10/2009 09:35:05 | 1 | 0 | how to manipulate child control in flex | I am trying to manipulate (move up and down, enable/disable and launch a form) child controls inside a panel control. However I am unable to get the id of the child control on which the click event occurs.
To illustrate, I am trying to create similar functionality as is available. I am trying to create the up-down buttons that you see in the image at [http://i34.tinypic.com/2gugio6.jpg][2]
Any help/pointers are appreciated.
Thanks
[2]: http://i34.tinypic.com/2gugio6.jpg | flex | flex3 | air | null | null | null | open | how to manipulate child control in flex
===
I am trying to manipulate (move up and down, enable/disable and launch a form) child controls inside a panel control. However I am unable to get the id of the child control on which the click event occurs.
To illustrate, I am trying to create similar functionality as is available. I am trying to create the up-down buttons that you see in the image at [http://i34.tinypic.com/2gugio6.jpg][2]
Any help/pointers are appreciated.
Thanks
[2]: http://i34.tinypic.com/2gugio6.jpg | 0 |
6,943,277 | 08/04/2011 14:31:30 | 147,306 | 07/29/2009 18:15:40 | 187 | 13 | activitygroup inside tabhost | I have three tabs and one of which contains an activitygroup. The activitygroup calls a camera which takes a picture and returns a preview image to be displayed on the tab window. When i startactivity from cameraActivity it goes back to the activity that called the tabbed screen(Activity A).
> Activity A --StartactivityOnResult-->TabScreen -> Tab1
>
> ->Tab 2(Camera-ActivityGroup.class)->TabCamera.class-->Camera
>
> ->Tab3
**//calling camera**
Intent i = null;
i = new Intent(this, CameraActivity.class);
startActivity(i);
CameraActivity calling Tab2
Intent i = new Intent(this, cameraActivityGroup.class);
StartActivity(i);
finish();
| android | android-tabhost | activitygroup | null | null | 08/07/2011 09:51:53 | not a real question | activitygroup inside tabhost
===
I have three tabs and one of which contains an activitygroup. The activitygroup calls a camera which takes a picture and returns a preview image to be displayed on the tab window. When i startactivity from cameraActivity it goes back to the activity that called the tabbed screen(Activity A).
> Activity A --StartactivityOnResult-->TabScreen -> Tab1
>
> ->Tab 2(Camera-ActivityGroup.class)->TabCamera.class-->Camera
>
> ->Tab3
**//calling camera**
Intent i = null;
i = new Intent(this, CameraActivity.class);
startActivity(i);
CameraActivity calling Tab2
Intent i = new Intent(this, cameraActivityGroup.class);
StartActivity(i);
finish();
| 1 |
9,324,992 | 02/17/2012 08:23:08 | 1,071,545 | 11/29/2011 14:59:49 | 8 | 0 | How to use multiple layouts in a single activity on android? | I have a problem, i wanna save all my data in one class using multiple layouts. please tell me how do i use multiple layouts in one class ?? | android | android-layout | null | null | null | 02/17/2012 14:51:37 | not a real question | How to use multiple layouts in a single activity on android?
===
I have a problem, i wanna save all my data in one class using multiple layouts. please tell me how do i use multiple layouts in one class ?? | 1 |
10,906,448 | 06/05/2012 23:39:25 | 240,363 | 12/29/2009 18:18:53 | 300 | 26 | MySQL grouping by day then display the date from the grouped results | So i have a whole load of votes going into a voting system. I want to display how many votes i have in any one day. But i also want to then, display the amount of votes per day and spit out which day they were voted on, i.e 24k votes on 05/06/12, 27k votes on 06/06/12
SELECT count(*) AS count
FROM results
GROUP BY DAY(datesubmitted), YEAR(datesubmitted), MONTH(datesubmitted)
ORDER BY DAY(datesubmitted) DESC, YEAR(datesubmitted) DESC, MONTH(datesubmitted) DESC
Is my query, i tried to add something like
> DAY(FROM_UNIXTIME(datesubmitted)) as order_day
but this just throws a null which i found interesting as i'd expect the query to fail as there aren't any outers.
| php | mysql | null | null | null | null | open | MySQL grouping by day then display the date from the grouped results
===
So i have a whole load of votes going into a voting system. I want to display how many votes i have in any one day. But i also want to then, display the amount of votes per day and spit out which day they were voted on, i.e 24k votes on 05/06/12, 27k votes on 06/06/12
SELECT count(*) AS count
FROM results
GROUP BY DAY(datesubmitted), YEAR(datesubmitted), MONTH(datesubmitted)
ORDER BY DAY(datesubmitted) DESC, YEAR(datesubmitted) DESC, MONTH(datesubmitted) DESC
Is my query, i tried to add something like
> DAY(FROM_UNIXTIME(datesubmitted)) as order_day
but this just throws a null which i found interesting as i'd expect the query to fail as there aren't any outers.
| 0 |
8,184,547 | 11/18/2011 15:08:42 | 1,054,049 | 11/18/2011 15:01:38 | 1 | 0 | Need demo code or Articles on Silverlight 4.0, MVVM, RIA, MEF, Caliburn.Micro and NHibernate | I am new to Silverlight and MVVM and need very good articles OR DEMO on Silverlight 4.0 application on MVVM, Caliburn.Micro, MEF, WCF RIA service with NHibernate for LOB application. Please share your valuable thoughts or link on the same.
Your help we be highly appreciated. Thanks
| nhibernate | silverlight-4.0 | mvvm | wcf-ria-services | caliburn.micro | 11/19/2011 05:19:33 | not a real question | Need demo code or Articles on Silverlight 4.0, MVVM, RIA, MEF, Caliburn.Micro and NHibernate
===
I am new to Silverlight and MVVM and need very good articles OR DEMO on Silverlight 4.0 application on MVVM, Caliburn.Micro, MEF, WCF RIA service with NHibernate for LOB application. Please share your valuable thoughts or link on the same.
Your help we be highly appreciated. Thanks
| 1 |
11,513,953 | 07/16/2012 23:15:20 | 1,515,626 | 07/10/2012 17:46:23 | 28 | 2 | Creating contingency tables from recoded variables (atomic vectors) | Another boneheaded request. I am trying to create contingency tables using recoded variables where any answer is coded as "1" and non-answers are coded as "0."
My original data might have looked like this: some variables are recoded from character strings, whereas others are recoded from numbers.
id var1 recode var2 recode2
1 "hello" 1 1 1
2 "hi" 1 <NA> 0
3 0 <NA> 0
4 "hola" 1 1 1
I have written a bit of code to do this recoding of strings, which I check using a contingency table.
data$recode <- ifelse((as.numeric(data$var1)!=1), 1, 0) #RECODES STRINGS
table(data$recode)
0 1
1 3
But then, I also need to recode the NA's in all of my other variables to be 0. I tried to do this with another ifelse statement:
data <- ifelse(is.na(data), 0, 1)
The values seem to change, but now when I try to run the same contingency table, I get the following error message:
Error in data$recode : $ operator is invalid for atomic vectors
I actually need to be able to produce contingency tables for all of my variables (i.e. report percentages and frequencies), so help on how to correctly recode all of my NA's (within a range of columns) into 0 so would be very helpful. Thanks! | r | null | null | null | null | null | open | Creating contingency tables from recoded variables (atomic vectors)
===
Another boneheaded request. I am trying to create contingency tables using recoded variables where any answer is coded as "1" and non-answers are coded as "0."
My original data might have looked like this: some variables are recoded from character strings, whereas others are recoded from numbers.
id var1 recode var2 recode2
1 "hello" 1 1 1
2 "hi" 1 <NA> 0
3 0 <NA> 0
4 "hola" 1 1 1
I have written a bit of code to do this recoding of strings, which I check using a contingency table.
data$recode <- ifelse((as.numeric(data$var1)!=1), 1, 0) #RECODES STRINGS
table(data$recode)
0 1
1 3
But then, I also need to recode the NA's in all of my other variables to be 0. I tried to do this with another ifelse statement:
data <- ifelse(is.na(data), 0, 1)
The values seem to change, but now when I try to run the same contingency table, I get the following error message:
Error in data$recode : $ operator is invalid for atomic vectors
I actually need to be able to produce contingency tables for all of my variables (i.e. report percentages and frequencies), so help on how to correctly recode all of my NA's (within a range of columns) into 0 so would be very helpful. Thanks! | 0 |
7,800,574 | 10/17/2011 22:56:37 | 742,082 | 05/06/2011 15:47:33 | 172 | 20 | gcc error from easy_install of setproctitle | I'm trying to install setproctitle. I've tried just downloading the package and using setup.py to install and I've tried easy_install. Neither method works, both come up with something that looks like:
:~$ sudo easy_install setproctitle
Searching for setproctitle
Reading http://pypi.python.org/simple/setproctitle/
Reading http://code.google.com/p/py-setproctitle/
Best match: setproctitle 1.1.2
Downloading http://pypi.python.org/packages/source/s/setproctitle/setproctitle-1.1.2.zip#md5=52f99a78cbdd1b0036bf41b4512442e7
Processing setproctitle-1.1.2.zip
Running setproctitle-1.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-P9lA8V/setproctitle-1.1.2/egg-dist-tmp-T0jtZK
In file included from src/spt.h:15,
from src/setproctitle.c:14:
src/spt_python.h:14:20: error: Python.h: No such file or directory
src/setproctitle.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/setproctitle.c:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/setproctitle.c:52: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/setproctitle.c:68: error: array type has incomplete element type
src/setproctitle.c:69: error: ‘PyCFunction’ undeclared here (not in a function)
src/setproctitle.c:69: error: expected ‘}’ before ‘spt_setproctitle’
src/setproctitle.c:70: error: expected ‘}’ before ‘spt_getproctitle’
src/setproctitle.c:99: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initsetproctitle’
error: Setup script exited with error: command 'gcc' failed with exit status 1
I'm not really sure what's going on. I've installed it easily before. I'm running a fresh installation of Ubuntu 10.04. Any help would be appreciated. | python | easy-install | setup.py | null | null | null | open | gcc error from easy_install of setproctitle
===
I'm trying to install setproctitle. I've tried just downloading the package and using setup.py to install and I've tried easy_install. Neither method works, both come up with something that looks like:
:~$ sudo easy_install setproctitle
Searching for setproctitle
Reading http://pypi.python.org/simple/setproctitle/
Reading http://code.google.com/p/py-setproctitle/
Best match: setproctitle 1.1.2
Downloading http://pypi.python.org/packages/source/s/setproctitle/setproctitle-1.1.2.zip#md5=52f99a78cbdd1b0036bf41b4512442e7
Processing setproctitle-1.1.2.zip
Running setproctitle-1.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-P9lA8V/setproctitle-1.1.2/egg-dist-tmp-T0jtZK
In file included from src/spt.h:15,
from src/setproctitle.c:14:
src/spt_python.h:14:20: error: Python.h: No such file or directory
src/setproctitle.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/setproctitle.c:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/setproctitle.c:52: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
src/setproctitle.c:68: error: array type has incomplete element type
src/setproctitle.c:69: error: ‘PyCFunction’ undeclared here (not in a function)
src/setproctitle.c:69: error: expected ‘}’ before ‘spt_setproctitle’
src/setproctitle.c:70: error: expected ‘}’ before ‘spt_getproctitle’
src/setproctitle.c:99: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initsetproctitle’
error: Setup script exited with error: command 'gcc' failed with exit status 1
I'm not really sure what's going on. I've installed it easily before. I'm running a fresh installation of Ubuntu 10.04. Any help would be appreciated. | 0 |
3,553,462 | 08/24/2010 03:53:37 | 429,088 | 08/24/2010 03:50:46 | 1 | 0 | How do I match a range of range combining diacritical marks in Vim? | I have a file, and some lines contain unicode characters with diacritical marks in them.
I would like to delete all lines in the file that contain any unicode diacritical accent character (unicode 0x0300 - unicode 0x0362).
I can blow away pretty much any other unicode in the file as range matches like the following function fine:
:g/[{ctrl-v}u0129-{ctrl-v}u0229]/d
But for some reason when the range is in the diacritical range, the diacriticals apply to the range brackets, so I end up with square brackets with accents that dont match anything.
I *can* however match them one at a time like :g/{ctrl-v}u0301/d, but I'd rather not go through 100 or so iterations to make sure I get them all.
Additionally inverse searches are failing me too. :g/[^ -~]/d will delete every line that contains a character other than those in the range of {space} to tilde, *except lines with diacriticals*.
Thanks | vim | unicode | null | null | null | null | open | How do I match a range of range combining diacritical marks in Vim?
===
I have a file, and some lines contain unicode characters with diacritical marks in them.
I would like to delete all lines in the file that contain any unicode diacritical accent character (unicode 0x0300 - unicode 0x0362).
I can blow away pretty much any other unicode in the file as range matches like the following function fine:
:g/[{ctrl-v}u0129-{ctrl-v}u0229]/d
But for some reason when the range is in the diacritical range, the diacriticals apply to the range brackets, so I end up with square brackets with accents that dont match anything.
I *can* however match them one at a time like :g/{ctrl-v}u0301/d, but I'd rather not go through 100 or so iterations to make sure I get them all.
Additionally inverse searches are failing me too. :g/[^ -~]/d will delete every line that contains a character other than those in the range of {space} to tilde, *except lines with diacriticals*.
Thanks | 0 |
9,003,571 | 01/25/2012 13:34:09 | 891,772 | 08/12/2011 12:32:14 | 172 | 11 | Complex tabbed form with panels in .NET MVC 3 | I'm trying to create some complex form scheme in a .NET MVC 3 project (or so I think). I'll show a wireframe so that you can understand better.
![Wireframe for my form][1]
As you can see from the pic above, it's a form to create a new Car Dealership. I can choose from many available car's manufacturers (in the `Add a tab`), and each selection creates a new tab in the panel underneath it. In each panel there's a html fieldset, and I can add some new cars on it.
In the end, I want to submit all the form, which comprehends the data from the dealership (e.g. name), the car's brands that it has and the cars available for each brand. My real-world scenario is a little bit more complicated, but I'll start by this so that I can try to solve the rest by myself. I'm using jQuery/jQuery UI, but I'm opened to other javascript alternatives (like Backbone, etc - I just don't know them yet).
Thanks in advance!
[1]: http://i.stack.imgur.com/xZyYx.png | asp.net-mvc-3 | tabs | panel | null | null | null | open | Complex tabbed form with panels in .NET MVC 3
===
I'm trying to create some complex form scheme in a .NET MVC 3 project (or so I think). I'll show a wireframe so that you can understand better.
![Wireframe for my form][1]
As you can see from the pic above, it's a form to create a new Car Dealership. I can choose from many available car's manufacturers (in the `Add a tab`), and each selection creates a new tab in the panel underneath it. In each panel there's a html fieldset, and I can add some new cars on it.
In the end, I want to submit all the form, which comprehends the data from the dealership (e.g. name), the car's brands that it has and the cars available for each brand. My real-world scenario is a little bit more complicated, but I'll start by this so that I can try to solve the rest by myself. I'm using jQuery/jQuery UI, but I'm opened to other javascript alternatives (like Backbone, etc - I just don't know them yet).
Thanks in advance!
[1]: http://i.stack.imgur.com/xZyYx.png | 0 |
1,145,121 | 07/17/2009 19:05:39 | 1,432 | 08/15/2008 15:33:54 | 3,486 | 169 | Why does this code with generics compile? | This seems like a stupid question, but I'm tripping over it at the moment. Why does this compile?
import java.util.*;
public class Test {
public static void main (String[] argv) throws Exception {
Map<String,String> map = new HashMap<String,String>();
map.get(new ArrayList<String>());
}
}
Shouldn't it be illegal to call get with something that's not compatible with "String"? | java | generics | null | null | null | null | open | Why does this code with generics compile?
===
This seems like a stupid question, but I'm tripping over it at the moment. Why does this compile?
import java.util.*;
public class Test {
public static void main (String[] argv) throws Exception {
Map<String,String> map = new HashMap<String,String>();
map.get(new ArrayList<String>());
}
}
Shouldn't it be illegal to call get with something that's not compatible with "String"? | 0 |
2,127,093 | 01/24/2010 12:55:24 | 257,807 | 01/24/2010 12:55:24 | 1 | 0 | self timer properties | Is is it possible to tell if a picture from a digital camera was taken with the self timer by looking at the picture properties? | self | timer | null | null | null | 01/24/2010 13:06:29 | off topic | self timer properties
===
Is is it possible to tell if a picture from a digital camera was taken with the self timer by looking at the picture properties? | 2 |
891,934 | 05/21/2009 08:46:17 | 82,488 | 03/25/2009 10:04:26 | 6 | 0 | Satchmo donations | Can anyone share some pointers on building a Donations module for Satchmo? I'm comfortable customizing Satchmo's product models etc but unable to find anything related to Donations
I realize it's possible to create a Donations virtual product but as far as I can tell this still requires setting the amount beforehand ($5, $10 etc). I want users to be able to donate arbitrary amounts | django | satchmo | python | e-commerce | null | null | open | Satchmo donations
===
Can anyone share some pointers on building a Donations module for Satchmo? I'm comfortable customizing Satchmo's product models etc but unable to find anything related to Donations
I realize it's possible to create a Donations virtual product but as far as I can tell this still requires setting the amount beforehand ($5, $10 etc). I want users to be able to donate arbitrary amounts | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.