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,626,805 | 12/24/2011 20:48:09 | 274,472 | 02/16/2010 15:23:11 | 48 | 6 | Integrate Chrome with command-line tools | I'm trying to set up some integration between Chrome, and various command-line tools and build systems that I have. Almost everything that I want to do within Chrome is supported by the extensions API, so I figured I'd make an extension, set up communication between it and my external tools, and go from there.
Unfortunately, I can't find any sane way to get messages in and out of Chrome. The only thing I could find that would plausibly work at all, would be introduce a local web server as a message broker, having the extension connect to it with WebSockets, and then having the command-line utilities do the same. But that's *way* too much complexity - it'd basically mean writing a whole IPC framework.
Is there any reasonable way to do this? | command-line | google-chrome-extension | null | null | null | null | open | Integrate Chrome with command-line tools
===
I'm trying to set up some integration between Chrome, and various command-line tools and build systems that I have. Almost everything that I want to do within Chrome is supported by the extensions API, so I figured I'd make an extension, set up communication between it and my external tools, and go from there.
Unfortunately, I can't find any sane way to get messages in and out of Chrome. The only thing I could find that would plausibly work at all, would be introduce a local web server as a message broker, having the extension connect to it with WebSockets, and then having the command-line utilities do the same. But that's *way* too much complexity - it'd basically mean writing a whole IPC framework.
Is there any reasonable way to do this? | 0 |
11,148,661 | 06/22/2012 00:18:01 | 1,450,111 | 06/12/2012 00:28:13 | 3 | 0 | Socket programming PrintWriter does not produce output | My server code is as follow:
writer = new PrintWriter(s.getOutputStream());
writer.flush();
writer.print("HTTP/1.1 200 OK\r\n");
writer.print("Content-Length: " + len + "\r\n");
writer.print("Content-Type: "+"application/soap+xml;charset=utf-8"+"\r\n\r\n");
writer.print(response);
writer.close();
The variable response is SOAP+XML. I am adding the HTTP headers needed to send it over and it works in some cases but in most cases my client(SOAPUI) just waits for the response which doesn't get produced. When I close the client I don't see any error on the server side.
Any help is appreciated. Thanks.
| java | sockets | null | null | null | null | open | Socket programming PrintWriter does not produce output
===
My server code is as follow:
writer = new PrintWriter(s.getOutputStream());
writer.flush();
writer.print("HTTP/1.1 200 OK\r\n");
writer.print("Content-Length: " + len + "\r\n");
writer.print("Content-Type: "+"application/soap+xml;charset=utf-8"+"\r\n\r\n");
writer.print(response);
writer.close();
The variable response is SOAP+XML. I am adding the HTTP headers needed to send it over and it works in some cases but in most cases my client(SOAPUI) just waits for the response which doesn't get produced. When I close the client I don't see any error on the server side.
Any help is appreciated. Thanks.
| 0 |
10,268,762 | 04/22/2012 14:24:44 | 114,989 | 05/31/2009 03:06:30 | 219 | 0 | Using R to plot messages per user given data frame listing all messages | Given a data frame representing messages like this:
df <- structure(list(message.id = c(123L, 456L), user.id = c(999L, 888L),
message.date = structure(c(1310950467, 1311119810), class = c("POSIXct",
"POSIXt"), tzone = "")), .Names = c("messageid", "user.id",
"message.date"), row.names = c(NA, -2L), class = "data.frame")
head(df)
message.id user.id message.date
123 999 2011-07-17 17:54:27
456 888 2011-07-19 16:56:50
How would you plot the total number of messages per user assuming that some users would have a lot of messages and others very few (e.g. pareto distribution).
Thanks. | r | null | null | null | null | null | open | Using R to plot messages per user given data frame listing all messages
===
Given a data frame representing messages like this:
df <- structure(list(message.id = c(123L, 456L), user.id = c(999L, 888L),
message.date = structure(c(1310950467, 1311119810), class = c("POSIXct",
"POSIXt"), tzone = "")), .Names = c("messageid", "user.id",
"message.date"), row.names = c(NA, -2L), class = "data.frame")
head(df)
message.id user.id message.date
123 999 2011-07-17 17:54:27
456 888 2011-07-19 16:56:50
How would you plot the total number of messages per user assuming that some users would have a lot of messages and others very few (e.g. pareto distribution).
Thanks. | 0 |
1,341,905 | 08/27/2009 15:40:07 | 134,852 | 07/08/2009 11:01:21 | 87 | 9 | What is an excellent software architecture? | I know my question is too inaccurate to answer but let me give you some background information.
Last year I got a new job as a software manager which I thought could do well. I am experienced in many different programming domain, like GUI, web, RIA, network application. I am a good problem solver. GenerallyI know how to organize code in a clean way. And I am always hard working.
But after almost a year, I have to admit that my boss is really upset about my job. The most important reason is that he feels that my software solution of our product is not advanced enough.
I think I have elaborately broken down the system, and I've chosen most popular platform for each component, and most of the code is robust and clean.
BUT my boss doesn't think so. He really feels that we could do better. He want something not only good, but excellent. something with almost ultimate scalability, something looks very very easy to extend, something have some awesome concept and ideas.
This is a challenge I've never met. I don't know how to show my boss the current system is good enough. I told him that "we have use xxx, yyy", but he has no idea what they are. I showed him the UML to explain what we have done, but he is super fun of C and is sceptic to OO and UML.
So have you ever seen some software architect that you feel awesome, excellent and very easy to extend? I think I really need to see some exemple of what an excellent software architecture means.
To be honest, I really doubt if it worth try to build an architecture to prepare for some requirements that do not exist yet, but I have to make my boss hapyy to keep my job. | architecture | null | null | null | null | 02/21/2012 13:01:59 | not constructive | What is an excellent software architecture?
===
I know my question is too inaccurate to answer but let me give you some background information.
Last year I got a new job as a software manager which I thought could do well. I am experienced in many different programming domain, like GUI, web, RIA, network application. I am a good problem solver. GenerallyI know how to organize code in a clean way. And I am always hard working.
But after almost a year, I have to admit that my boss is really upset about my job. The most important reason is that he feels that my software solution of our product is not advanced enough.
I think I have elaborately broken down the system, and I've chosen most popular platform for each component, and most of the code is robust and clean.
BUT my boss doesn't think so. He really feels that we could do better. He want something not only good, but excellent. something with almost ultimate scalability, something looks very very easy to extend, something have some awesome concept and ideas.
This is a challenge I've never met. I don't know how to show my boss the current system is good enough. I told him that "we have use xxx, yyy", but he has no idea what they are. I showed him the UML to explain what we have done, but he is super fun of C and is sceptic to OO and UML.
So have you ever seen some software architect that you feel awesome, excellent and very easy to extend? I think I really need to see some exemple of what an excellent software architecture means.
To be honest, I really doubt if it worth try to build an architecture to prepare for some requirements that do not exist yet, but I have to make my boss hapyy to keep my job. | 4 |
10,135,291 | 04/13/2012 04:38:46 | 1,310,065 | 04/03/2012 09:40:28 | 1 | 0 | update query not working in array | here my code:
// select query to get the value
for($j=0;$j<count($capacity);$j++)
{
$capaci=$capacity[$j];
// select query to get the value
$sql2=mysql_query("SELECT recieved-allocate*plate_quantity as ans from total_values where capacity='$capaci'");
while($fetch=mysql_fetch_array($sql2))
{
$data1[]=$fetch['ans'];
}
}
for($k=0;$k<count($capacity);$k++)
{
$capac=$capacity[$k];
$recieves=$data1[$k];
// print_r($data1); exit;
// update query for update the value
echo $sql3="update total_values set recieved='$recieves' where capacity='$capac' and month='$mon'"; exit;
} | php | null | null | null | null | 04/14/2012 12:43:43 | not a real question | update query not working in array
===
here my code:
// select query to get the value
for($j=0;$j<count($capacity);$j++)
{
$capaci=$capacity[$j];
// select query to get the value
$sql2=mysql_query("SELECT recieved-allocate*plate_quantity as ans from total_values where capacity='$capaci'");
while($fetch=mysql_fetch_array($sql2))
{
$data1[]=$fetch['ans'];
}
}
for($k=0;$k<count($capacity);$k++)
{
$capac=$capacity[$k];
$recieves=$data1[$k];
// print_r($data1); exit;
// update query for update the value
echo $sql3="update total_values set recieved='$recieves' where capacity='$capac' and month='$mon'"; exit;
} | 1 |
8,890,711 | 01/17/2012 06:51:53 | 1,152,334 | 01/16/2012 17:10:23 | 1 | 0 | refer to section 10.4.4.1 "coping object "of TC++PL | `void h() {table t1;
table t2=t1; table t3; t3=t2;
}`
BJRANE wrote "array created for t1 will be deleted 3 times as array created for t1 apears in t1,t2,t3
COULD YOU PLEASE EXPLAIN WHAT DOES IT MEANS WITH SOME OTHER EXAMPLES ?
| c++ | null | null | null | null | 01/19/2012 03:56:17 | not a real question | refer to section 10.4.4.1 "coping object "of TC++PL
===
`void h() {table t1;
table t2=t1; table t3; t3=t2;
}`
BJRANE wrote "array created for t1 will be deleted 3 times as array created for t1 apears in t1,t2,t3
COULD YOU PLEASE EXPLAIN WHAT DOES IT MEANS WITH SOME OTHER EXAMPLES ?
| 1 |
10,646,583 | 05/18/2012 04:09:38 | 1,315,279 | 04/05/2012 12:32:23 | 13 | 0 | how to install pfa fonts in windows | I have extracted fonts from pdf but they have extension like
> font.pfa
how can i install those fonts | windows | windows-7 | fonts | null | null | null | open | how to install pfa fonts in windows
===
I have extracted fonts from pdf but they have extension like
> font.pfa
how can i install those fonts | 0 |
7,355,160 | 09/08/2011 22:13:36 | 935,434 | 09/08/2011 17:48:06 | 8 | 0 | vmware tools is not working properly, I cannot share folder in my virtual machine ubuntu | I am using windows XP, I created a virtual machine using VMware player and installed Ubuntu in it.
I want to have a shared folder between windows and my virtual machine, so I installed VMware tools, enabled the shared folders and named them. However, when I am on ubuntu, I don't see the link... I tried several time, re-install VMware tools and updated my VMware player but it's still not working...
Does anybody already had this problem?
Versions I am using: VMware player 3.1.2, Ubuntu 11.04, VMware tools 8.4.4 | windows-xp | ubuntu-11.04 | vmware-player | vmware-tools | null | 09/12/2011 03:44:17 | off topic | vmware tools is not working properly, I cannot share folder in my virtual machine ubuntu
===
I am using windows XP, I created a virtual machine using VMware player and installed Ubuntu in it.
I want to have a shared folder between windows and my virtual machine, so I installed VMware tools, enabled the shared folders and named them. However, when I am on ubuntu, I don't see the link... I tried several time, re-install VMware tools and updated my VMware player but it's still not working...
Does anybody already had this problem?
Versions I am using: VMware player 3.1.2, Ubuntu 11.04, VMware tools 8.4.4 | 2 |
9,098,592 | 02/01/2012 15:35:18 | 1,183,021 | 02/01/2012 15:22:41 | 1 | 0 | which IDE for Opa, how host opa code | I am Dot Net developer and would like to try with Opa, my question is:
1. is there any good tips for IED?
2. How can you Host Opa Code | ide | hosting | null | null | null | null | open | which IDE for Opa, how host opa code
===
I am Dot Net developer and would like to try with Opa, my question is:
1. is there any good tips for IED?
2. How can you Host Opa Code | 0 |
3,742,730 | 09/18/2010 17:35:54 | 387,852 | 07/09/2010 15:03:07 | 1 | 0 | Poor MySQL Join Performance | I've been trying to perform a join on two tables in MySQL, and the query will run for a minute or two before I run out of memory without getting results. I'm far from a database expert, so I'm not sure if I'm writing my queries poorly, if I have some MySQL settings poorly configured, or if I really should be doing something else entirely with my query. FYI the database is located locally on my machine.
I have a large table (~2 million records) where one of the columns is an ID into a small table (~3000 records). In case this matters, the ID is not unique in the large table but is unique in the small table. I've tried various flavors of the following query, but nothing seems to be working:
SELECT big_table.*, small_table.id FROM big_table left outer join small_table on (big_table.small_id = small_table.id) | mysql | database | performance | join | query-optimization | null | open | Poor MySQL Join Performance
===
I've been trying to perform a join on two tables in MySQL, and the query will run for a minute or two before I run out of memory without getting results. I'm far from a database expert, so I'm not sure if I'm writing my queries poorly, if I have some MySQL settings poorly configured, or if I really should be doing something else entirely with my query. FYI the database is located locally on my machine.
I have a large table (~2 million records) where one of the columns is an ID into a small table (~3000 records). In case this matters, the ID is not unique in the large table but is unique in the small table. I've tried various flavors of the following query, but nothing seems to be working:
SELECT big_table.*, small_table.id FROM big_table left outer join small_table on (big_table.small_id = small_table.id) | 0 |
7,115,616 | 08/19/2011 00:08:07 | 486,805 | 10/25/2010 19:01:21 | 118 | 2 | MYSQL DB Design Question - Move inactive rows to another table? | I have a table where when a row is created, it will be active for 24 hours with some writes and lots of reads. Then it becomes inactive after 24 hours and will have no more writes and only some reads, if any. Is it better to keep these rows in the table or move them when they become inactive (or via batch jobs) to a separate table? Thinking in terms of performance. | mysql | database | design | table | null | null | open | MYSQL DB Design Question - Move inactive rows to another table?
===
I have a table where when a row is created, it will be active for 24 hours with some writes and lots of reads. Then it becomes inactive after 24 hours and will have no more writes and only some reads, if any. Is it better to keep these rows in the table or move them when they become inactive (or via batch jobs) to a separate table? Thinking in terms of performance. | 0 |
6,275,934 | 06/08/2011 08:12:11 | 887,872 | 04/20/2011 06:05:51 | 37 | 1 | i should use aspx pages in mvc asp .net inplace of view or not ? | I am designing a project in **mvc3 asp.net** , this project is a website. should i use aspx pages in place of view(cshtml) ?
which one is more efficient way to do view (cshtml or aspx) ?
i am very fresher in asp mvc3 in asp .net .please suggest me. | asp.net-mvc | null | null | null | null | 06/08/2011 14:40:15 | not constructive | i should use aspx pages in mvc asp .net inplace of view or not ?
===
I am designing a project in **mvc3 asp.net** , this project is a website. should i use aspx pages in place of view(cshtml) ?
which one is more efficient way to do view (cshtml or aspx) ?
i am very fresher in asp mvc3 in asp .net .please suggest me. | 4 |
9,923,885 | 03/29/2012 10:49:10 | 1,293,094 | 03/26/2012 13:13:55 | 1 | 0 | How to upload video file to server in iphone application? | All
UIImagePickerController * picker1 = [[UIImagePickerController alloc] init];
picker1.delegate = self;
NSArray *mediaTypesAllowed=[[NSArray alloc]init];
mediaTypesAllowed = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[picker1 setMediaTypes:mediaTypesAllowed];
[self presentModalViewController:picker1 animated:YES];
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
mediaType=[[NSString alloc]init];
mediaType = [info valueForKey:UIImagePickerControllerMediaType];
if([mediaType isEqualToString:@"public.movie"])
{
}
[self dismissModalViewControllerAnimated:YES];
}
//UPLoading video to server
NSString *urlString = @"http://www.123singles.eminosoft.com/upload.php";
// setting up the request object now
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
// add some header info now
// we always need a boundary when we post a file
// also we need to set the content type
//
// You might want to generate a random boundary.. this is just the same
// as my output from wireshark on a valid html post
NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
// now lets create the body of the post
NSMutableData *body = [NSMutableData data];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"uploadedfile\"; filename=\"videoFile.mov\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"%@",mediaType]dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"username\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"%@",sharedDelegate.userNameStrObj] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"type\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"2"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:body];
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
//Here i am getting response as successfully uploaded , but the uploaded video did not play at server side
Please help me
Thank you | iphone-sdk-4.0 | null | null | null | null | 07/31/2012 22:08:57 | not a real question | How to upload video file to server in iphone application?
===
All
UIImagePickerController * picker1 = [[UIImagePickerController alloc] init];
picker1.delegate = self;
NSArray *mediaTypesAllowed=[[NSArray alloc]init];
mediaTypesAllowed = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[picker1 setMediaTypes:mediaTypesAllowed];
[self presentModalViewController:picker1 animated:YES];
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
mediaType=[[NSString alloc]init];
mediaType = [info valueForKey:UIImagePickerControllerMediaType];
if([mediaType isEqualToString:@"public.movie"])
{
}
[self dismissModalViewControllerAnimated:YES];
}
//UPLoading video to server
NSString *urlString = @"http://www.123singles.eminosoft.com/upload.php";
// setting up the request object now
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
// add some header info now
// we always need a boundary when we post a file
// also we need to set the content type
//
// You might want to generate a random boundary.. this is just the same
// as my output from wireshark on a valid html post
NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
// now lets create the body of the post
NSMutableData *body = [NSMutableData data];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"uploadedfile\"; filename=\"videoFile.mov\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"%@",mediaType]dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"username\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"%@",sharedDelegate.userNameStrObj] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"type\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"2"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:body];
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
//Here i am getting response as successfully uploaded , but the uploaded video did not play at server side
Please help me
Thank you | 1 |
9,705,773 | 03/14/2012 16:17:16 | 333,911 | 05/05/2010 22:03:18 | 13 | 0 | Non CRUD actions with ember-data | Say I have the following ember-data model:
App.Person = DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
starred: DS.attr('boolean')
});
This communicates with a Rails app with the following pretty standard CRUD API:
GET /people - get a list of people
POST /people - create a new person
GET /people/id - get a specific person
PUT /people/id - update a specific person
DELETE /people/id - delete a specific person
This all maps to Ember-Data with the standard Store/Adapter.
However, lets say that in order to "star" or "unstar" a person, the API doesn't let us do this by the standard update action. There's a specific API endpoint for this action:
POST /people/id/star - mark a person as "starred"
POST /people/id/unstar - mark a person as "unstarred"
How do I fit this API in with Ember Data?
It looks like I'd need to extend DS.Store and DS.RESTAdapter somehow, but I'm not sure of the best approach to make them aware of these different actions. It also feels a bit wrong that a generic Adapter for the app has to be aware of starring people.
Note that I have no control over the API, so I can't make `POST /people/id` aware of "starring" so that it would fit in with a standard update. | javascript | emberjs | null | null | null | null | open | Non CRUD actions with ember-data
===
Say I have the following ember-data model:
App.Person = DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
starred: DS.attr('boolean')
});
This communicates with a Rails app with the following pretty standard CRUD API:
GET /people - get a list of people
POST /people - create a new person
GET /people/id - get a specific person
PUT /people/id - update a specific person
DELETE /people/id - delete a specific person
This all maps to Ember-Data with the standard Store/Adapter.
However, lets say that in order to "star" or "unstar" a person, the API doesn't let us do this by the standard update action. There's a specific API endpoint for this action:
POST /people/id/star - mark a person as "starred"
POST /people/id/unstar - mark a person as "unstarred"
How do I fit this API in with Ember Data?
It looks like I'd need to extend DS.Store and DS.RESTAdapter somehow, but I'm not sure of the best approach to make them aware of these different actions. It also feels a bit wrong that a generic Adapter for the app has to be aware of starring people.
Note that I have no control over the API, so I can't make `POST /people/id` aware of "starring" so that it would fit in with a standard update. | 0 |
8,324,716 | 11/30/2011 10:51:55 | 1,012,211 | 10/25/2011 06:42:08 | 1 | 0 | Playing Video of format m3u8 | I am trying to play video of format m3u8.I have done with my code.But on running the application only a black screen is shown as output.I am imported vitamio p[layer along with that.please provide me a code to solve this. | android-video-player | null | null | null | null | 12/06/2011 02:48:22 | not a real question | Playing Video of format m3u8
===
I am trying to play video of format m3u8.I have done with my code.But on running the application only a black screen is shown as output.I am imported vitamio p[layer along with that.please provide me a code to solve this. | 1 |
5,516,471 | 04/01/2011 16:57:57 | 659,028 | 03/14/2011 15:12:17 | 1 | 0 | Minecraft Web SkinEdit Previewer? | Does anyone know how this thing works?
http://www.planetminecraft.com/skin/minecrafts-zombie/
i really want it for my site and i have been trying to get this thing active on my site with no luck at all... Anyone know how this thing works? or how i could implement it for my own skins?
If this is unexplainable, could i pay someone to implement it for me? =) | javascript | jsp | null | null | null | 07/03/2011 07:02:42 | not a real question | Minecraft Web SkinEdit Previewer?
===
Does anyone know how this thing works?
http://www.planetminecraft.com/skin/minecrafts-zombie/
i really want it for my site and i have been trying to get this thing active on my site with no luck at all... Anyone know how this thing works? or how i could implement it for my own skins?
If this is unexplainable, could i pay someone to implement it for me? =) | 1 |
1,645,238 | 10/29/2009 17:13:03 | 127,896 | 06/23/2009 22:33:32 | 49 | 3 | OpenCV Multi-Threaded Thread Message | I am writing a program using .Net 3.5 and OpenCV 1.1. I have multiple threads that need to get an image variables from the web camera on my computer, the problem being I get memory violation errors when multiple threads try to access the camera at the same time. I know I can use PostThreadMessage and GetMessage to send a variable to the threads. Can anyone give me a tutorial or example of how to pass a variable to a thread while it is running using PostThreadMessage and GetMessage? | c++ | multithreading | opencv | .net | message-passing | null | open | OpenCV Multi-Threaded Thread Message
===
I am writing a program using .Net 3.5 and OpenCV 1.1. I have multiple threads that need to get an image variables from the web camera on my computer, the problem being I get memory violation errors when multiple threads try to access the camera at the same time. I know I can use PostThreadMessage and GetMessage to send a variable to the threads. Can anyone give me a tutorial or example of how to pass a variable to a thread while it is running using PostThreadMessage and GetMessage? | 0 |
6,891,906 | 07/31/2011 19:53:02 | 594,845 | 01/29/2011 09:54:36 | 42 | 1 | Add spinner with radio button Swing | I want to create a radio button with a spinner attached to it. How do i go about it?
I searched on the net but no avail | java | swing | null | null | null | 08/31/2011 00:30:53 | not a real question | Add spinner with radio button Swing
===
I want to create a radio button with a spinner attached to it. How do i go about it?
I searched on the net but no avail | 1 |
2,373,724 | 03/03/2010 18:02:40 | 263,006 | 01/31/2010 17:50:30 | 47 | 2 | ASP.net auction expiration mechanism | How to realise auction expiration? Make it inactive after 1-3-5 days??? something like ebay? thank you! i am using asp.net c sharp
any links for information would be appreciated | asp.net | auction | c# | expiration | null | 03/03/2010 20:45:06 | not a real question | ASP.net auction expiration mechanism
===
How to realise auction expiration? Make it inactive after 1-3-5 days??? something like ebay? thank you! i am using asp.net c sharp
any links for information would be appreciated | 1 |
7,501,084 | 09/21/2011 14:00:14 | 212,977 | 11/17/2009 15:31:50 | 23 | 0 | How to handle server side errors in MVC3 with ajax.beginform | I am using Ajax.BeginForm for my page. The client side validation does its work and displays any errors in the validation summary area. Now I want same behaivor when a server side error occurs in the controller.
In a standard form you would AddModelError to the ModelState and return to the form and the fields and validation summary are updated. But with Ajax I can't get this to work.
My controller returns a JsonResult (this may not be the correct way, but I can get my update information back to the form easily) and the first thing I do is check for the ModelState.IsValid. If this is false, how do you get those errors to display on the page in the validation summary?
One would think this is really simple, but ..... | asp.net-mvc-3 | validation | razor | null | null | null | open | How to handle server side errors in MVC3 with ajax.beginform
===
I am using Ajax.BeginForm for my page. The client side validation does its work and displays any errors in the validation summary area. Now I want same behaivor when a server side error occurs in the controller.
In a standard form you would AddModelError to the ModelState and return to the form and the fields and validation summary are updated. But with Ajax I can't get this to work.
My controller returns a JsonResult (this may not be the correct way, but I can get my update information back to the form easily) and the first thing I do is check for the ModelState.IsValid. If this is false, how do you get those errors to display on the page in the validation summary?
One would think this is really simple, but ..... | 0 |
3,589,906 | 08/28/2010 07:41:42 | 433,585 | 08/28/2010 07:41:42 | 1 | 0 | Find a root of a polynomial modulo 2^r | I have a polynomial P and I would like to find y such that P(y) = 0 modulo 2^r.
I have tried something along the lines of Hensel lifting, but I don't know if this could even work, because of the usual condition f'(y mod 2) != 0 mod 2 which is not usually true.
Is there a different algorithm available ? Or could a variation of Hensel lifting work ?
Thanks in advance | algorithm | math | algebra | polynomial-math | null | 08/28/2010 21:29:43 | off topic | Find a root of a polynomial modulo 2^r
===
I have a polynomial P and I would like to find y such that P(y) = 0 modulo 2^r.
I have tried something along the lines of Hensel lifting, but I don't know if this could even work, because of the usual condition f'(y mod 2) != 0 mod 2 which is not usually true.
Is there a different algorithm available ? Or could a variation of Hensel lifting work ?
Thanks in advance | 2 |
9,332,925 | 02/17/2012 17:42:50 | 728,244 | 04/27/2011 22:51:48 | 594 | 35 | Symfony 2: How to inject the @request into a service? | When I try to inject the @request into any of my services, I get this exception:
> ScopeWideningInjectionException: Scope Widening Injection detected:
> The definition "service.navigation" references the service "request"
> which belongs to a narrower scope. Generally, it is safer to either
> move "service.navigation" to scope "request" or alternatively rely on
> the provider pattern by injecting the container itself, and requesting
> the service "request" each time it is needed. In rare, special cases
> however that might not be necessary, then you can set the reference to
> strict=false to get rid of this error.
What is the best way to proceed? Should I try to set this `strict=false` and how, or should I NOT inject the request service, but rather pass it to the service through my controller each time I call functions I need?
Other possibility would be to inject the kernel and take it from there, but in my service I am using only @router and @request, so injecting the whole kernel would be irrational.
Thanks! | php | service | dependency-injection | symfony-2.0 | request | null | open | Symfony 2: How to inject the @request into a service?
===
When I try to inject the @request into any of my services, I get this exception:
> ScopeWideningInjectionException: Scope Widening Injection detected:
> The definition "service.navigation" references the service "request"
> which belongs to a narrower scope. Generally, it is safer to either
> move "service.navigation" to scope "request" or alternatively rely on
> the provider pattern by injecting the container itself, and requesting
> the service "request" each time it is needed. In rare, special cases
> however that might not be necessary, then you can set the reference to
> strict=false to get rid of this error.
What is the best way to proceed? Should I try to set this `strict=false` and how, or should I NOT inject the request service, but rather pass it to the service through my controller each time I call functions I need?
Other possibility would be to inject the kernel and take it from there, but in my service I am using only @router and @request, so injecting the whole kernel would be irrational.
Thanks! | 0 |
6,110,585 | 05/24/2011 12:42:46 | 767,688 | 05/24/2011 12:16:39 | 1 | 0 | trying to implement sudoku solver brute foce algorithim | Hey guys, I've been trying to implement the brute force part of this http://www.garshol.priv.no/blog/178.html in my program here: paste.pound-python.org/show/7107/, but I'm relatively inexperience and I've hit a wall. I understand _generally_ whats going on in the algorithim but I can't figure out where I'm going wrong. | python | null | null | null | null | 06/23/2011 18:13:34 | not a real question | trying to implement sudoku solver brute foce algorithim
===
Hey guys, I've been trying to implement the brute force part of this http://www.garshol.priv.no/blog/178.html in my program here: paste.pound-python.org/show/7107/, but I'm relatively inexperience and I've hit a wall. I understand _generally_ whats going on in the algorithim but I can't figure out where I'm going wrong. | 1 |
807,639 | 04/30/2009 15:54:17 | 93,802 | 04/21/2009 13:43:27 | 60 | 1 | Override visual syntax highlighting through a plug-in? | This is related to [this question I asked earlier][1] about syntax highlighting user-defined blocks of code.
[1]: http://stackoverflow.com/questions/807404/displaying-code-sections-with-a-different-background-color
Is it possible to write some kind of plug-in for visual studio where it would override how it does syntax highlighting? Where would I start looking for that?
Thanks! | visual-studio | visual-studio-2008 | visual-studio-2005 | null | null | null | open | Override visual syntax highlighting through a plug-in?
===
This is related to [this question I asked earlier][1] about syntax highlighting user-defined blocks of code.
[1]: http://stackoverflow.com/questions/807404/displaying-code-sections-with-a-different-background-color
Is it possible to write some kind of plug-in for visual studio where it would override how it does syntax highlighting? Where would I start looking for that?
Thanks! | 0 |
238,579 | 10/26/2008 20:41:02 | 7,883 | 09/15/2008 14:37:57 | 846 | 62 | free sms api | Anyone know of a free sms api I can integrate in my web application that will enable my users to send a limited amount of free sms messages? | sms | null | null | null | null | 02/06/2012 16:16:18 | not constructive | free sms api
===
Anyone know of a free sms api I can integrate in my web application that will enable my users to send a limited amount of free sms messages? | 4 |
1,491,450 | 09/29/2009 09:15:46 | 19,803 | 09/20/2008 23:45:11 | 1,244 | 130 | Who are the relational database gurus ? | In general software development we have Martin Fowler and Steve McConnell. In relational database who are the gurus ? | relational-database | null | null | null | null | 06/04/2011 11:18:03 | off topic | Who are the relational database gurus ?
===
In general software development we have Martin Fowler and Steve McConnell. In relational database who are the gurus ? | 2 |
1,374,695 | 09/03/2009 17:01:42 | 134,397 | 07/07/2009 17:05:25 | 34 | 1 | simple C++ hash_set example | I am new to C++ and STL. I am stuck with the following simple example of a hash set storing custom data structures:
#include <iostream>
#include <ext/hash_set>
using namespace std;
using namespace __gnu_cxx;
struct trip {
int trip_id;
int delta_n;
int delta_secs;
trip(int trip_id, int delta_n, int delta_secs){
this->trip_id = trip_id;
this->delta_n = delta_n;
this->delta_secs = delta_secs;
}
};
struct hash_trip
{
size_t operator()(const trip t)
{
hash<int> H;
return H(t.trip_id);
}
};
struct eq_trip
{
bool operator()(const trip t1, const trip t2) {
return (t1.trip_id==t2.trip_id) &&
(t1.delta_n==t2.delta_n) &&
(t1.delta_secs==t2.delta_secs);
}
};
int main()
{
hash_set<trip, hash_trip, eq_trip> trips;
trip t = trip(3,2,-1);
trip t1 = trip(3,2,0);
trips.insert(t);
}
when I try to compile it, I get the following error message:
/usr/include/c++/4.2.1/ext/hashtable.h: In member function ‘size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num_key(const _Key&, size_t) const [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’:
/usr/include/c++/4.2.1/ext/hashtable.h:599: instantiated from ‘size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num(const _Val&, size_t) const [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
/usr/include/c++/4.2.1/ext/hashtable.h:1006: instantiated from ‘void __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::resize(size_t) [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
/usr/include/c++/4.2.1/ext/hashtable.h:437: instantiated from ‘std::pair<__gnu_cxx::_Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>, bool> __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::insert_unique(const _Val&) [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
/usr/include/c++/4.2.1/ext/hash_set:197: instantiated from ‘std::pair<typename __gnu_cxx::hashtable<_Value, _Value, _HashFcn, std::_Identity<_Value>, _EqualKey, _Alloc>::const_iterator, bool> __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>::insert(const typename __gnu_cxx::hashtable<_Value, _Value, _HashFcn, std::_Identity<_Value>, _EqualKey, _Alloc>::value_type&) [with _Value = trip, _HashFcn = hash_trip, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
try.cpp:45: instantiated from here
/usr/include/c++/4.2.1/ext/hashtable.h:595: error: passing ‘const hash_trip’ as ‘this’ argument of ‘size_t hash_trip::operator()(trip)’ discards qualifiers
What am I doing wrong? | c++ | hashset | stl | example | null | null | open | simple C++ hash_set example
===
I am new to C++ and STL. I am stuck with the following simple example of a hash set storing custom data structures:
#include <iostream>
#include <ext/hash_set>
using namespace std;
using namespace __gnu_cxx;
struct trip {
int trip_id;
int delta_n;
int delta_secs;
trip(int trip_id, int delta_n, int delta_secs){
this->trip_id = trip_id;
this->delta_n = delta_n;
this->delta_secs = delta_secs;
}
};
struct hash_trip
{
size_t operator()(const trip t)
{
hash<int> H;
return H(t.trip_id);
}
};
struct eq_trip
{
bool operator()(const trip t1, const trip t2) {
return (t1.trip_id==t2.trip_id) &&
(t1.delta_n==t2.delta_n) &&
(t1.delta_secs==t2.delta_secs);
}
};
int main()
{
hash_set<trip, hash_trip, eq_trip> trips;
trip t = trip(3,2,-1);
trip t1 = trip(3,2,0);
trips.insert(t);
}
when I try to compile it, I get the following error message:
/usr/include/c++/4.2.1/ext/hashtable.h: In member function ‘size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num_key(const _Key&, size_t) const [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’:
/usr/include/c++/4.2.1/ext/hashtable.h:599: instantiated from ‘size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num(const _Val&, size_t) const [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
/usr/include/c++/4.2.1/ext/hashtable.h:1006: instantiated from ‘void __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::resize(size_t) [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
/usr/include/c++/4.2.1/ext/hashtable.h:437: instantiated from ‘std::pair<__gnu_cxx::_Hashtable_iterator<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>, bool> __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::insert_unique(const _Val&) [with _Val = trip, _Key = trip, _HashFcn = hash_trip, _ExtractKey = std::_Identity<trip>, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
/usr/include/c++/4.2.1/ext/hash_set:197: instantiated from ‘std::pair<typename __gnu_cxx::hashtable<_Value, _Value, _HashFcn, std::_Identity<_Value>, _EqualKey, _Alloc>::const_iterator, bool> __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>::insert(const typename __gnu_cxx::hashtable<_Value, _Value, _HashFcn, std::_Identity<_Value>, _EqualKey, _Alloc>::value_type&) [with _Value = trip, _HashFcn = hash_trip, _EqualKey = eq_trip, _Alloc = std::allocator<trip>]’
try.cpp:45: instantiated from here
/usr/include/c++/4.2.1/ext/hashtable.h:595: error: passing ‘const hash_trip’ as ‘this’ argument of ‘size_t hash_trip::operator()(trip)’ discards qualifiers
What am I doing wrong? | 0 |
9,474,177 | 02/27/2012 23:41:39 | 845,021 | 07/14/2011 16:42:21 | 3 | 0 | How to extend a view from an external app? | I have a django project that uses views from an external app. The view displays a form but does not save the user. I want to be able to remember this user in order to grant him permission for another view. How do I extend the external app's view so it saves the user who's filling out this form?
For example:
User A fills out a form to post a job. Users B and C apply to this job. I want to show user A the people who have applied to the job-post (users B and C) but only if user A is indeed the creator of the job post.
I hope I make sense. | django | django-views | django-users | null | null | null | open | How to extend a view from an external app?
===
I have a django project that uses views from an external app. The view displays a form but does not save the user. I want to be able to remember this user in order to grant him permission for another view. How do I extend the external app's view so it saves the user who's filling out this form?
For example:
User A fills out a form to post a job. Users B and C apply to this job. I want to show user A the people who have applied to the job-post (users B and C) but only if user A is indeed the creator of the job post.
I hope I make sense. | 0 |
8,566,992 | 12/19/2011 20:17:08 | 569,183 | 01/09/2011 22:33:46 | 1,586 | 74 | free hotel wifi pushing an iframe at the top of each page | First, how is the stream edited on the fly? For every website I visit, there is a black bar telling me how much WiFi time I have left.
Second, how do I get rid of it?
Rather confused... | javascript | http | iframe | tcp | null | 12/19/2011 20:30:26 | off topic | free hotel wifi pushing an iframe at the top of each page
===
First, how is the stream edited on the fly? For every website I visit, there is a black bar telling me how much WiFi time I have left.
Second, how do I get rid of it?
Rather confused... | 2 |
8,373,983 | 12/04/2011 07:42:21 | 14,971 | 09/17/2008 04:32:26 | 13,558 | 471 | What is the current state of the art in Haskell web frameworks | I am looking for insight into the the current state of the art in Haskell web frameworks.
What I would consider to be necessary for a good framework:
- web application interface for connecting to http servers (like Rack)
- chainable middleware (again, like Rack or node.js Connect)
- idiomatic Haskell
- solid performance
- reasonable docs or at least readable open-source code
The framework does not necessarily need to be a full MVC stack, an elegant DSL for routing and handling requests (think Sinatra) would be more than sufficient.
Some of the options I have found:
- [Snap][1]
- [Yesod][2]
- [Miku][3]
- [Bird][4]
- [Happstack][5]
I like the depth of experience in the Haskell world to really make an informed decision, so any help would be appreciated.
[1]: http://snapframework.com/
[2]: http://yesodweb.com
[3]: https://github.com/nfjinjing/miku
[4]: https://github.com/moonmaster9000/bird
[5]: http://happstack.com | mvc | haskell | frameworks | null | null | 12/04/2011 16:39:21 | not constructive | What is the current state of the art in Haskell web frameworks
===
I am looking for insight into the the current state of the art in Haskell web frameworks.
What I would consider to be necessary for a good framework:
- web application interface for connecting to http servers (like Rack)
- chainable middleware (again, like Rack or node.js Connect)
- idiomatic Haskell
- solid performance
- reasonable docs or at least readable open-source code
The framework does not necessarily need to be a full MVC stack, an elegant DSL for routing and handling requests (think Sinatra) would be more than sufficient.
Some of the options I have found:
- [Snap][1]
- [Yesod][2]
- [Miku][3]
- [Bird][4]
- [Happstack][5]
I like the depth of experience in the Haskell world to really make an informed decision, so any help would be appreciated.
[1]: http://snapframework.com/
[2]: http://yesodweb.com
[3]: https://github.com/nfjinjing/miku
[4]: https://github.com/moonmaster9000/bird
[5]: http://happstack.com | 4 |
10,117,407 | 04/12/2012 04:32:07 | 1,328,128 | 04/12/2012 04:26:26 | 1 | 0 | Getting rid of the third margin on li items when displaying in columns of 3 so it aligns with edge of page? | I've looked everywhere it seems like there would be a simple answer that isn't using nth child which isn't supported in IE.. what's the best way to solve this? | css | wordpress | templates | null | null | 05/06/2012 21:02:09 | not a real question | Getting rid of the third margin on li items when displaying in columns of 3 so it aligns with edge of page?
===
I've looked everywhere it seems like there would be a simple answer that isn't using nth child which isn't supported in IE.. what's the best way to solve this? | 1 |
11,159,483 | 06/22/2012 15:38:13 | 394,430 | 07/17/2010 02:22:21 | 61 | 4 | Python interprocess communication with idle processes | I have an idle background process to process data in a queue, which I've implemented in the following way. The data passed in this example is just an integer, but I will be passing lists with up to 1000 integers and putting up to 100 lists on the queue per sec. Is this the correct approach, or should I be looking at more elaborate RPC and server methods?
import multiprocessing
import Queue
import time
class MyProcess(multiprocessing.Process):
def __init__(self, queue, cmds):
multiprocessing.Process.__init__(self)
self.q = queue
self.cmds = cmds
def run(self):
exit_flag = False
while True:
try:
obj = self.q.get(False)
print obj
except Queue.Empty:
if exit_flag:
break
else:
pass
if not exit_flag and self.cmds.poll():
cmd = self.cmds.recv()
if cmd == -1:
exit_flag = True
time.sleep(.01)
if __name__ == '__main__':
queue = multiprocessing.Queue()
proc2main, main2proc = multiprocessing.Pipe(duplex=False)
p = MyProcess(queue, proc2main)
p.start()
for i in range(5):
queue.put(i)
main2proc.send(-1)
proc2main.close()
main2proc.close()
# Wait for the worker to finish
queue.close()
queue.join_thread()
p.join()
| python | queue | multiprocessing | pipe | interprocess | null | open | Python interprocess communication with idle processes
===
I have an idle background process to process data in a queue, which I've implemented in the following way. The data passed in this example is just an integer, but I will be passing lists with up to 1000 integers and putting up to 100 lists on the queue per sec. Is this the correct approach, or should I be looking at more elaborate RPC and server methods?
import multiprocessing
import Queue
import time
class MyProcess(multiprocessing.Process):
def __init__(self, queue, cmds):
multiprocessing.Process.__init__(self)
self.q = queue
self.cmds = cmds
def run(self):
exit_flag = False
while True:
try:
obj = self.q.get(False)
print obj
except Queue.Empty:
if exit_flag:
break
else:
pass
if not exit_flag and self.cmds.poll():
cmd = self.cmds.recv()
if cmd == -1:
exit_flag = True
time.sleep(.01)
if __name__ == '__main__':
queue = multiprocessing.Queue()
proc2main, main2proc = multiprocessing.Pipe(duplex=False)
p = MyProcess(queue, proc2main)
p.start()
for i in range(5):
queue.put(i)
main2proc.send(-1)
proc2main.close()
main2proc.close()
# Wait for the worker to finish
queue.close()
queue.join_thread()
p.join()
| 0 |
2,539,965 | 03/29/2010 17:35:14 | 264,990 | 02/03/2010 05:36:15 | 90 | 2 | zend framework project shows blank page with out any errors!! | i created a simple project with zf and it works fine, but when i copy it to other pc
it just show a blank page without any page or errors ?
my zf version is 1.9 and in other pc zf version 1.9 too
what do you do about this problem?
| zend-framework | apache | null | null | null | null | open | zend framework project shows blank page with out any errors!!
===
i created a simple project with zf and it works fine, but when i copy it to other pc
it just show a blank page without any page or errors ?
my zf version is 1.9 and in other pc zf version 1.9 too
what do you do about this problem?
| 0 |
3,561,618 | 08/24/2010 22:48:43 | 134,569 | 07/07/2009 22:03:49 | 59 | 1 | How to set accessible name of QActions contained in a QMenu | I'm trying to set the accessible properties of a QMenu's sub items. I can set the accessible property of the parent menu using setAccessibleName() since it inherits QWidget. Unfortunately, the QActions that you add to the menu aren't widgets child classes, they inherit QObject directly.
Is there a way to set the menu items accessible name?
Thanks | qt | qt4 | null | null | null | null | open | How to set accessible name of QActions contained in a QMenu
===
I'm trying to set the accessible properties of a QMenu's sub items. I can set the accessible property of the parent menu using setAccessibleName() since it inherits QWidget. Unfortunately, the QActions that you add to the menu aren't widgets child classes, they inherit QObject directly.
Is there a way to set the menu items accessible name?
Thanks | 0 |
11,385,917 | 07/08/2012 19:15:03 | 93,647 | 04/21/2009 08:11:02 | 1,222 | 15 | is it possible to use VS Profilier (Perfomance Wizard) on machine without VS installed? | I have perfomance issue that can not be reproduced on my development machine.
Issue only reproduce on "deployement" machine so I have to run profilier right there (normally I use development machine for such type of work).
Can I do that remotely? For example can I use Visual Studio UI from my development machine to run profilier via network on deployment machine?
Probably I can install only "profilier" part (without VS) to deployment machine and run it from command-line via RDP?
What options do I have? Of course I can just install VS on deployment machine but I want to install as less things as possible as this machine is used for business and VS is not requried there.
**upd** just googled Standalone Profilier http://www.microsoft.com/en-us/download/details.aspx?id=23205 Probably this is what I need... | visual-studio-2010 | null | null | null | null | null | open | is it possible to use VS Profilier (Perfomance Wizard) on machine without VS installed?
===
I have perfomance issue that can not be reproduced on my development machine.
Issue only reproduce on "deployement" machine so I have to run profilier right there (normally I use development machine for such type of work).
Can I do that remotely? For example can I use Visual Studio UI from my development machine to run profilier via network on deployment machine?
Probably I can install only "profilier" part (without VS) to deployment machine and run it from command-line via RDP?
What options do I have? Of course I can just install VS on deployment machine but I want to install as less things as possible as this machine is used for business and VS is not requried there.
**upd** just googled Standalone Profilier http://www.microsoft.com/en-us/download/details.aspx?id=23205 Probably this is what I need... | 0 |
9,968,112 | 04/01/2012 20:38:01 | 963,974 | 09/25/2011 19:22:30 | 55 | 0 | Is there a way to write html file using beautiful soup? I tries an xml file and that works perfectly fine. | Input:
I have basic knowledge of beautifulSoup and I deployed the code and created a .xml file but now I wanted a html file using beautiful soup. Is there a way to deploy the code using beautifulsoup and python to generate following output.
Output.html:
<title>Network</title>
</head>
<table>
<tr>
<th>Type</th>
<th>Product</th>
<th>Vendor</th>
<th>Logical Name</th>
</tr>
<tr>
<td class='alt'>Wireless interface</td>
<td class='alt'>RT2760 Wireless 802.11n 1T/2R Cardbus</td>
<td class='alt'>Ralink corp.</td>
<td class='alt'>wlan0</td>
<tr>
</table>
</html> | python | html | beautifulsoup | null | null | 04/02/2012 22:47:48 | not a real question | Is there a way to write html file using beautiful soup? I tries an xml file and that works perfectly fine.
===
Input:
I have basic knowledge of beautifulSoup and I deployed the code and created a .xml file but now I wanted a html file using beautiful soup. Is there a way to deploy the code using beautifulsoup and python to generate following output.
Output.html:
<title>Network</title>
</head>
<table>
<tr>
<th>Type</th>
<th>Product</th>
<th>Vendor</th>
<th>Logical Name</th>
</tr>
<tr>
<td class='alt'>Wireless interface</td>
<td class='alt'>RT2760 Wireless 802.11n 1T/2R Cardbus</td>
<td class='alt'>Ralink corp.</td>
<td class='alt'>wlan0</td>
<tr>
</table>
</html> | 1 |
11,649,804 | 07/25/2012 12:33:27 | 1,356,166 | 04/25/2012 12:23:34 | 1 | 1 | Learning path from Java Client apps to Windows 8 Metro and Desktop apps | I was developing desktop and rich-client Java Swing apps for last 6 years. After watching Windows 8 presentations from BUILD I started to learn Metro style apps development using C# and XAML. I see that without knowing .NET, XAML and WPF I don't understand Metro code samples.
In many places I saw that if a developer has prior knowledge in .NET technologies they are mostly transferable to WinRT style apps. But I don't know them, so probably I should first read some books to learn .NET, C#, WPF, XAML and then I can read a book about developing Metro WinRT apps? Or there is a good book that explains all the technologies all together? For example:
1. .NET, C#
2. WPF, XAML
3. WinRT and Metro
So please advise the learning path and concrete books/guides?
P.S. I think desktop apps on Windows 8 is also interesting theme.
Thanks. | c# | .net | wpf | xaml | microsoft-metro | 07/25/2012 18:14:14 | not constructive | Learning path from Java Client apps to Windows 8 Metro and Desktop apps
===
I was developing desktop and rich-client Java Swing apps for last 6 years. After watching Windows 8 presentations from BUILD I started to learn Metro style apps development using C# and XAML. I see that without knowing .NET, XAML and WPF I don't understand Metro code samples.
In many places I saw that if a developer has prior knowledge in .NET technologies they are mostly transferable to WinRT style apps. But I don't know them, so probably I should first read some books to learn .NET, C#, WPF, XAML and then I can read a book about developing Metro WinRT apps? Or there is a good book that explains all the technologies all together? For example:
1. .NET, C#
2. WPF, XAML
3. WinRT and Metro
So please advise the learning path and concrete books/guides?
P.S. I think desktop apps on Windows 8 is also interesting theme.
Thanks. | 4 |
4,308,338 | 11/29/2010 21:35:33 | 384,275 | 07/06/2010 07:34:37 | 1 | 1 | how to fill an int array from textbox in c# | I asked this question a few minutes ago!
but Before any reactionو My question is closed.
This textBox contain number only.
i want to Separating textBox value figure figure and fill one array cell with one figure.
my english is very bad
i am sory | c# | null | null | null | null | 11/29/2010 21:55:17 | not a real question | how to fill an int array from textbox in c#
===
I asked this question a few minutes ago!
but Before any reactionو My question is closed.
This textBox contain number only.
i want to Separating textBox value figure figure and fill one array cell with one figure.
my english is very bad
i am sory | 1 |
11,525,997 | 07/17/2012 15:38:33 | 1,020,554 | 10/30/2011 10:11:40 | 6 | 0 | Chrome CSS Hack and Media Queries | i wanna make a responsive site which have some problems in chrome. The problem now - insert media queries into the chrome css hack?
<pre>@media screen and (-webkit-min-device-pixel-ratio:0) {
#myid {position: absolute; top: 10px;}
@media only screen and (max-width: 1024px) {
#myid {position: absolute; top: 8px;}
}
}</pre>
Need it only in css, so no javascript or php. Anyone an idea how to solve that problem? | css | null | null | null | null | 07/24/2012 02:43:22 | not a real question | Chrome CSS Hack and Media Queries
===
i wanna make a responsive site which have some problems in chrome. The problem now - insert media queries into the chrome css hack?
<pre>@media screen and (-webkit-min-device-pixel-ratio:0) {
#myid {position: absolute; top: 10px;}
@media only screen and (max-width: 1024px) {
#myid {position: absolute; top: 8px;}
}
}</pre>
Need it only in css, so no javascript or php. Anyone an idea how to solve that problem? | 1 |
5,438,434 | 03/25/2011 21:43:17 | 614,266 | 02/12/2011 14:41:48 | 1 | 0 | What does & means befor = operator in C#? | Hi i don't remember the meaning from class of "&"...
I'm sure you can help me here guys.
*For example:*
bool approved;
// Approved is a property of cra, also bool
approved &= cra.Approved;
Thanks a lot! | c# | operators | boolean | null | null | 03/25/2011 23:07:17 | too localized | What does & means befor = operator in C#?
===
Hi i don't remember the meaning from class of "&"...
I'm sure you can help me here guys.
*For example:*
bool approved;
// Approved is a property of cra, also bool
approved &= cra.Approved;
Thanks a lot! | 3 |
10,559,307 | 05/11/2012 22:16:56 | 1,320,017 | 04/08/2012 07:43:09 | 1 | 0 | SVG animations in HTML | I've spent the day messign about with SVG graphics and wanted to run some feedback through here for possible pointers and to share my results.
My ultimate intention is to use SVG graphics inside a iPhone/iPad web app, so have rigged my testing to be geared towards those platfroms. My experimentation was two fold, firstly I wanted to check how to animate the SVG files, and then how best to place inside HTML
I found the best way to animate SVG's was to use the SVG animation properties directly inside the SVG code, here's an example:
<animate attributeName="fill" values="green; #fff; green" dur="4s" repeatCount="indefinite" />
With regards to getting the SVG's into the HTML and keeping the animations intact, I found tha using this worked best:
< embed src="svgfile.svg" type="image/svg+xml" />
** Note that extra styling was required to remove box cropping and border.
Another alternative was to bring in a the SVG via CSS:
background-image: url(svg_file.svg);
-webkit-background-size: 100% 100%;
height: 296px;
width: 316px;
One thing that does seem a little flakey in Safari is styling SVG elements with CSS -Webkit-animation properties. doesn't seem to work great, but fine in Chrome.
Check out the link for the working files:
[http://bit.ly/KOtRqq][1]
[1]: http://bit.ly/KOtRqq
Cheers
K
| html | css | animation | webkit | svg | 05/12/2012 15:33:42 | off topic | SVG animations in HTML
===
I've spent the day messign about with SVG graphics and wanted to run some feedback through here for possible pointers and to share my results.
My ultimate intention is to use SVG graphics inside a iPhone/iPad web app, so have rigged my testing to be geared towards those platfroms. My experimentation was two fold, firstly I wanted to check how to animate the SVG files, and then how best to place inside HTML
I found the best way to animate SVG's was to use the SVG animation properties directly inside the SVG code, here's an example:
<animate attributeName="fill" values="green; #fff; green" dur="4s" repeatCount="indefinite" />
With regards to getting the SVG's into the HTML and keeping the animations intact, I found tha using this worked best:
< embed src="svgfile.svg" type="image/svg+xml" />
** Note that extra styling was required to remove box cropping and border.
Another alternative was to bring in a the SVG via CSS:
background-image: url(svg_file.svg);
-webkit-background-size: 100% 100%;
height: 296px;
width: 316px;
One thing that does seem a little flakey in Safari is styling SVG elements with CSS -Webkit-animation properties. doesn't seem to work great, but fine in Chrome.
Check out the link for the working files:
[http://bit.ly/KOtRqq][1]
[1]: http://bit.ly/KOtRqq
Cheers
K
| 2 |
8,889,692 | 01/17/2012 04:33:32 | 789,596 | 06/08/2011 16:58:14 | 20 | 1 | Extjs4 Ext.view.View selectionchange event trigger twise when select item | I am using Ext.view.View for my data view. When I select one item 'selectionchange' event trigger twice. But without "multiSelect:true" it only trigger once.
Ext.define('myViewView', {
extend: 'Ext.view.View',
alias: 'widget.myViewView',
store: myContentStore,
cls: 'content-view-view',
tpl: myContentViewTpl,
multiSelect: true,
trackOver: true,
overItemCls: 'x-item-over',
itemSelector: '.thumb-wrap',
emptyText: emptyDataText,
resizable: true,
style: {
overflow: 'auto'
},
listeners: {
selectionchange: function(dv, selections) {
}
},
prepareData: function(data) {
Ext.apply(data, {
sizeString: Ext.util.Format.fileSize(data.size),
modifiedString: Ext.util.Format.date(data.modified, "m-d-Y:g-i-a"),
fileFormatPath: createBreadCrumb(data.filePath, false)
});
return data;
}
});
| extjs | extjs4 | dataview | multi-select | null | null | open | Extjs4 Ext.view.View selectionchange event trigger twise when select item
===
I am using Ext.view.View for my data view. When I select one item 'selectionchange' event trigger twice. But without "multiSelect:true" it only trigger once.
Ext.define('myViewView', {
extend: 'Ext.view.View',
alias: 'widget.myViewView',
store: myContentStore,
cls: 'content-view-view',
tpl: myContentViewTpl,
multiSelect: true,
trackOver: true,
overItemCls: 'x-item-over',
itemSelector: '.thumb-wrap',
emptyText: emptyDataText,
resizable: true,
style: {
overflow: 'auto'
},
listeners: {
selectionchange: function(dv, selections) {
}
},
prepareData: function(data) {
Ext.apply(data, {
sizeString: Ext.util.Format.fileSize(data.size),
modifiedString: Ext.util.Format.date(data.modified, "m-d-Y:g-i-a"),
fileFormatPath: createBreadCrumb(data.filePath, false)
});
return data;
}
});
| 0 |
9,259,728 | 02/13/2012 11:32:17 | 581,085 | 01/19/2011 07:44:20 | 23 | 0 | Embeddable Reporting tool for C# | Is there any way to embed in my application a reporting tool so the user can make their own reports? Most software give you the opportunity to create some predifined reports that go with you application but if the user wants a new report then he/she will have to use a different reporting tool or the programer has to put the new report to the software again.
thanks | reporting | null | null | null | null | 07/01/2012 01:28:16 | not a real question | Embeddable Reporting tool for C#
===
Is there any way to embed in my application a reporting tool so the user can make their own reports? Most software give you the opportunity to create some predifined reports that go with you application but if the user wants a new report then he/she will have to use a different reporting tool or the programer has to put the new report to the software again.
thanks | 1 |
8,358,594 | 12/02/2011 15:27:14 | 304,961 | 03/30/2010 09:49:45 | 603 | 19 | Add flash AS3 custome module in bright cove player | I trying to build one web service call in flash AS3 and after response I try to load Bright cove player but not getting how to add this module in bright cove player?
can anybody help me out?
Thanks in advance.
Rohit
| flash | actionscript-3 | brightcove | null | null | 12/02/2011 23:48:05 | not a real question | Add flash AS3 custome module in bright cove player
===
I trying to build one web service call in flash AS3 and after response I try to load Bright cove player but not getting how to add this module in bright cove player?
can anybody help me out?
Thanks in advance.
Rohit
| 1 |
305,654 | 11/20/2008 15:30:37 | 30,330 | 10/22/2008 11:28:43 | 14 | 7 | What PHP-specific questions would you ask in a job interview? | We're having a PHP freelancer come by next week, and are assuming he knows his way around PHP. But of course, we would like to make sure. What questions would you ask a candidate in a PHP job interview?
Would you have them write some sort of bubblesort op paper, without the aid of a computer? Would you ask array-specific questions, OOP or SQL? I'd be interested to know how to pick out the good (PHP) programmer, without scaring them off with too many detailed questions. | php | php5 | interview-questions | null | null | 11/30/2011 02:43:45 | not constructive | What PHP-specific questions would you ask in a job interview?
===
We're having a PHP freelancer come by next week, and are assuming he knows his way around PHP. But of course, we would like to make sure. What questions would you ask a candidate in a PHP job interview?
Would you have them write some sort of bubblesort op paper, without the aid of a computer? Would you ask array-specific questions, OOP or SQL? I'd be interested to know how to pick out the good (PHP) programmer, without scaring them off with too many detailed questions. | 4 |
6,539,792 | 06/30/2011 19:04:23 | 803,603 | 06/17/2011 16:35:22 | 49 | 0 | I can't find the source code for .NET XML WEB SERVICES STEP BY STEP | I have the book: Microsoft .NET XML WEB SERVICES step by step by Adam freeman and Allen jones( Microsoft press)
I am trying to download the sourcecode. I followed the instructions written in the book but I can’t find it in the web site:
To download the sample code, follow these steps.
1.Establish a connection to the Internet.
2.Using your browser, navigate to the Web site for this book; the address is http://www.microsoft.com/mspress/books/5955.asp.
3.On the right side of the Web page, in the More Information area, click the Companion Content link.
4.Click the Download Sample Code link for the programming language you are interested in using. The page includes a link for the C# sample code and another for the Visual Basic .NET sample code.
5.The download link opens a Web Package executable file containing a license agreement. To copy the sample files onto your hard disk, click the link to run the executable and then accept the license agreement that is presented. By default, the sample files will be copied to the C:\XMLWebServicesSBS folder. During the installation process, you’ll be given the option of changing that destination folder, although to minimize confusion with the instructions we provide in the book’s exercises, we suggest you use the default folder path.
See Step 3? I don’t see the companion content link. Am I missing something? Can you send me the source code?
Am I missing something? Any thoughts?
Thanks
Saro | web-services | books | null | null | null | 06/30/2011 19:46:46 | too localized | I can't find the source code for .NET XML WEB SERVICES STEP BY STEP
===
I have the book: Microsoft .NET XML WEB SERVICES step by step by Adam freeman and Allen jones( Microsoft press)
I am trying to download the sourcecode. I followed the instructions written in the book but I can’t find it in the web site:
To download the sample code, follow these steps.
1.Establish a connection to the Internet.
2.Using your browser, navigate to the Web site for this book; the address is http://www.microsoft.com/mspress/books/5955.asp.
3.On the right side of the Web page, in the More Information area, click the Companion Content link.
4.Click the Download Sample Code link for the programming language you are interested in using. The page includes a link for the C# sample code and another for the Visual Basic .NET sample code.
5.The download link opens a Web Package executable file containing a license agreement. To copy the sample files onto your hard disk, click the link to run the executable and then accept the license agreement that is presented. By default, the sample files will be copied to the C:\XMLWebServicesSBS folder. During the installation process, you’ll be given the option of changing that destination folder, although to minimize confusion with the instructions we provide in the book’s exercises, we suggest you use the default folder path.
See Step 3? I don’t see the companion content link. Am I missing something? Can you send me the source code?
Am I missing something? Any thoughts?
Thanks
Saro | 3 |
6,539,801 | 06/30/2011 19:04:53 | 166,251 | 08/31/2009 21:40:12 | 4,309 | 378 | Reminder - \r\n or \n\r ? | I just can't remember those. So, what is the right way to properly terminate old fashioned ASCII files? | c# | c++ | c | ascii | null | null | open | Reminder - \r\n or \n\r ?
===
I just can't remember those. So, what is the right way to properly terminate old fashioned ASCII files? | 0 |
9,975,035 | 04/02/2012 10:49:30 | 1,307,808 | 04/02/2012 10:44:09 | 1 | 0 | I want to put a hashmap in a list and then clear it | I am facing this problem in my code that is I have a hashmap which I need to put in an arraylist in a loop, and then clear the hashmap so that i can reuse it in the loop itself.. My code is:
public static HashMap p(Map<String, LinkedHashSet<String>> map2){
int currvalue = 0;
int counter = 0;
int flag = 0;
int c = 0;
ArrayList keys = new ArrayList(map2.keySet());
ArrayList values = new ArrayList(map2.values());
HashMap subgraph = new HashMap();
HashMap total = new HashMap();
ArrayList sg = new ArrayList();
System.out.println(keys.size());
for(int i = 0;i<keys.size();i++){
if(counter<=3){
subgraph.put(keys.get(i),values.get(i));
//System.out.println(subgraph.entrySet());
counter++;
flag++;
if(flag == 3){
sg.add(subgraph);
//System.out.println(sg.iterator().next());
subgraph.clear();
counter = 0;
flag = 0;
}
}
}
if(flag>0){
sg.add(subgraph);
subgraph.clear();
//System.out.println(sg.iterator().next());
counter = 0;
flag = 0;
}
for(int k=0;k<sg.size();k++){
total.put(currvalue++,sg.get(k));
}
System.out.println(total.values());
return total;
}
| list | arraylist | hashmap | clear | null | 04/19/2012 13:40:45 | not a real question | I want to put a hashmap in a list and then clear it
===
I am facing this problem in my code that is I have a hashmap which I need to put in an arraylist in a loop, and then clear the hashmap so that i can reuse it in the loop itself.. My code is:
public static HashMap p(Map<String, LinkedHashSet<String>> map2){
int currvalue = 0;
int counter = 0;
int flag = 0;
int c = 0;
ArrayList keys = new ArrayList(map2.keySet());
ArrayList values = new ArrayList(map2.values());
HashMap subgraph = new HashMap();
HashMap total = new HashMap();
ArrayList sg = new ArrayList();
System.out.println(keys.size());
for(int i = 0;i<keys.size();i++){
if(counter<=3){
subgraph.put(keys.get(i),values.get(i));
//System.out.println(subgraph.entrySet());
counter++;
flag++;
if(flag == 3){
sg.add(subgraph);
//System.out.println(sg.iterator().next());
subgraph.clear();
counter = 0;
flag = 0;
}
}
}
if(flag>0){
sg.add(subgraph);
subgraph.clear();
//System.out.println(sg.iterator().next());
counter = 0;
flag = 0;
}
for(int k=0;k<sg.size();k++){
total.put(currvalue++,sg.get(k));
}
System.out.println(total.values());
return total;
}
| 1 |
7,013,966 | 08/10/2011 16:01:23 | 795,644 | 06/13/2011 08:56:57 | 32 | 0 | UIView in tab bar application moves up when navigating back to it | In my tab bar project every view controllers are kept under each navigation controller.
View shows up correctly in each tab.
Navigating to inner views works as well.
But when navigating back to the main view causes the uiview to lift up.
I tried using different size for the view.But no change.
Also my project is using Three 20 in the inner views to show the thumbnails,
Seeking for your help!
Thank you. | iphone | ios | tabs | null | null | null | open | UIView in tab bar application moves up when navigating back to it
===
In my tab bar project every view controllers are kept under each navigation controller.
View shows up correctly in each tab.
Navigating to inner views works as well.
But when navigating back to the main view causes the uiview to lift up.
I tried using different size for the view.But no change.
Also my project is using Three 20 in the inner views to show the thumbnails,
Seeking for your help!
Thank you. | 0 |
9,692,686 | 03/13/2012 21:46:52 | 696,485 | 04/07/2011 09:18:36 | 191 | 5 | 3D Rigid Registration - Minimal Points Analytic Solution - How to Build Rotation Matrices? | I have two sets of three (non-collinear) points, in three dimensions. I know the correspondence between the points - i.e. set 1 is {A, B, C} and set 2 is {A', B', C'}.
I want to find the combination of translation and rotation that will transform A' to A, B' to B, and C' to C. Note: There is no scaling involved. (I know this for certain, although I am curious about how to handle it if it did exist.)
I found what looks like a [solid explanation](https://docs.google.com/open?id=1o_uafQmeRKi4A2lAbMJPeo-BSnUSHBp4nJb6PLaHo8NvQWvaFQXD5qIFy8x4) while trying to work out how to do this. Section 2 (page 3) entitled "Three Point Registration" appears to be what I need to do. I understand steps 1 through 4 and 6 through 7 just fine, but 5 has me stumped.
5. Build the rotation matrices for both point sets:
Rl = [xl, yl, zl], Rr = [xr, yr, zr]
How do I do that???
Later I plan to implement a least squares solution, but I want to do this first. | algorithm | matrix | registration | algebra | null | null | open | 3D Rigid Registration - Minimal Points Analytic Solution - How to Build Rotation Matrices?
===
I have two sets of three (non-collinear) points, in three dimensions. I know the correspondence between the points - i.e. set 1 is {A, B, C} and set 2 is {A', B', C'}.
I want to find the combination of translation and rotation that will transform A' to A, B' to B, and C' to C. Note: There is no scaling involved. (I know this for certain, although I am curious about how to handle it if it did exist.)
I found what looks like a [solid explanation](https://docs.google.com/open?id=1o_uafQmeRKi4A2lAbMJPeo-BSnUSHBp4nJb6PLaHo8NvQWvaFQXD5qIFy8x4) while trying to work out how to do this. Section 2 (page 3) entitled "Three Point Registration" appears to be what I need to do. I understand steps 1 through 4 and 6 through 7 just fine, but 5 has me stumped.
5. Build the rotation matrices for both point sets:
Rl = [xl, yl, zl], Rr = [xr, yr, zr]
How do I do that???
Later I plan to implement a least squares solution, but I want to do this first. | 0 |
3,401,704 | 08/04/2010 00:16:02 | 212,429 | 11/16/2009 22:15:05 | 13 | 1 | Nested method calls vs. one-shot variables | What is the best practice when nesting method calls or using one-shot variables?
Should you never use one-shot variables?
example:
[persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType
configuration:nil
URL:[NSURL fileURLWithPath: [applicationSupportDirectory stringByAppendingPathComponent: @"storedata"]]
options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:NSMigratePersistentStoresAutomaticallyOption]
error:&error];
Should you always break up a nested method into one-shot variables?
example:
NSNumber *yesNumber = [NSNumber numberWithBool:YES];
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:yesNumber
forKey:NSMigratePersistentStoresAutomaticallyOption];
NSString *urlPath = [applicationSupportDirectory stringByAppendingPathComponent:@"storedata"];
NSURL *url = [NSURL fileURLWithPath: urlPath];
[persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType
configuration:nil
URL:url
options:optionsDict
error:&error];
Or should you use some combination of the two?
example:
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
forKey:NSMigratePersistentStoresAutomaticallyOption];
NSURL *url = [NSURL fileURLWithPath: [applicationSupportDirectory stringByAppendingPathComponent:@"storedata"]];
[persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType
configuration:nil
URL:url
options:optionsDict
error:&error];
I tend to go with a combination of the two but I would like to hear what everyone else has to say about this. In case it is not clear above, these "one-shot variables" are created for the sole purpose of breaking up the nested method and will not be used anywhere. | objective-c | coding-style | null | null | null | null | open | Nested method calls vs. one-shot variables
===
What is the best practice when nesting method calls or using one-shot variables?
Should you never use one-shot variables?
example:
[persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType
configuration:nil
URL:[NSURL fileURLWithPath: [applicationSupportDirectory stringByAppendingPathComponent: @"storedata"]]
options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:NSMigratePersistentStoresAutomaticallyOption]
error:&error];
Should you always break up a nested method into one-shot variables?
example:
NSNumber *yesNumber = [NSNumber numberWithBool:YES];
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:yesNumber
forKey:NSMigratePersistentStoresAutomaticallyOption];
NSString *urlPath = [applicationSupportDirectory stringByAppendingPathComponent:@"storedata"];
NSURL *url = [NSURL fileURLWithPath: urlPath];
[persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType
configuration:nil
URL:url
options:optionsDict
error:&error];
Or should you use some combination of the two?
example:
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
forKey:NSMigratePersistentStoresAutomaticallyOption];
NSURL *url = [NSURL fileURLWithPath: [applicationSupportDirectory stringByAppendingPathComponent:@"storedata"]];
[persistentStoreCoordinator addPersistentStoreWithType:NSXMLStoreType
configuration:nil
URL:url
options:optionsDict
error:&error];
I tend to go with a combination of the two but I would like to hear what everyone else has to say about this. In case it is not clear above, these "one-shot variables" are created for the sole purpose of breaking up the nested method and will not be used anywhere. | 0 |
6,883,820 | 07/30/2011 14:37:24 | 767,920 | 08/30/2009 07:49:27 | 846 | 17 | creating an proxy class for an webservice in vs 2005 | i have an webservice
1: when i add an weservice using webreference using vs 2005 it creates me reference.cs, wsdl, disco file
2: but when i create an proxy class using wsdl.exe
wsdl /out:myProxyClass.cs http://hostServer/WebserviceRoot/WebServiceName.asmx?WSDL
it creates only .cs file it does not create an wsdl, disco files
is there anything we have to enable to get disco, wsdl files
any help would be great
Thanks
Prince | visual-studio | null | null | null | null | null | open | creating an proxy class for an webservice in vs 2005
===
i have an webservice
1: when i add an weservice using webreference using vs 2005 it creates me reference.cs, wsdl, disco file
2: but when i create an proxy class using wsdl.exe
wsdl /out:myProxyClass.cs http://hostServer/WebserviceRoot/WebServiceName.asmx?WSDL
it creates only .cs file it does not create an wsdl, disco files
is there anything we have to enable to get disco, wsdl files
any help would be great
Thanks
Prince | 0 |
11,019,010 | 06/13/2012 16:09:35 | 1,189,566 | 02/04/2012 16:20:18 | 23 | 0 | Convert byte[] to String (unknown byte[] type) | So I'm a pretty amateur programmer, trying to follow some examples for creating a small auditing system for this application I'm working on.
The framework we're using (StrataFrame) on top of C# .NET 4.0 requires that the auditted values be stored as byte arrays. I followed a small example of their forum that had me do this;
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
System.IO.MemoryStream outstream = new System.IO.MemoryStream();
foreach (DataColumn dc in jobHeaderBO1.CurrentDataTable.Columns)
{
if (!dr[dc.ColumnName, DataRowVersion.Original].Equals(dr[dc.ColumnName, DataRowVersion.Current]))
{
formatter.Serialize(outstream, dr[dc.ColumnName, DataRowVersion.Current] + " " + dr[dc.ColumnName, DataRowVersion.Original]);
Auditor.ShouldAuditDataChanges(jobHeaderBO1);
Auditor.InsertAuditEvent("JOB HEADER", dc.ColumnName + " changed.", outstream.ToArray());
Auditor.InsertAuditRecords(jobHeaderBO1);
}
}
So that all works as far as I can tell- records get inserted to the appropriate table and when I look at it it's a bunch of garbage. So now I need to present that garbage to the user!
I found a few examples that say just do things such as:
string oldv = System.Text.Encoding.UTF8.GetString(adf.adf_OldValue);
string newv = System.Text.Encoding.UTF8.GetString(adf.adf_NewValue);
When I print out oldv and newv, the values don't display properly. Some of the fields that stored text mostly show fine, but dates and numbers don't. I guess the issue is that I have no idea what type of encoding it is, and I can't find out either. Any suggestions?
| .net | c#-4.0 | null | null | null | 07/02/2012 14:01:19 | not a real question | Convert byte[] to String (unknown byte[] type)
===
So I'm a pretty amateur programmer, trying to follow some examples for creating a small auditing system for this application I'm working on.
The framework we're using (StrataFrame) on top of C# .NET 4.0 requires that the auditted values be stored as byte arrays. I followed a small example of their forum that had me do this;
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
System.IO.MemoryStream outstream = new System.IO.MemoryStream();
foreach (DataColumn dc in jobHeaderBO1.CurrentDataTable.Columns)
{
if (!dr[dc.ColumnName, DataRowVersion.Original].Equals(dr[dc.ColumnName, DataRowVersion.Current]))
{
formatter.Serialize(outstream, dr[dc.ColumnName, DataRowVersion.Current] + " " + dr[dc.ColumnName, DataRowVersion.Original]);
Auditor.ShouldAuditDataChanges(jobHeaderBO1);
Auditor.InsertAuditEvent("JOB HEADER", dc.ColumnName + " changed.", outstream.ToArray());
Auditor.InsertAuditRecords(jobHeaderBO1);
}
}
So that all works as far as I can tell- records get inserted to the appropriate table and when I look at it it's a bunch of garbage. So now I need to present that garbage to the user!
I found a few examples that say just do things such as:
string oldv = System.Text.Encoding.UTF8.GetString(adf.adf_OldValue);
string newv = System.Text.Encoding.UTF8.GetString(adf.adf_NewValue);
When I print out oldv and newv, the values don't display properly. Some of the fields that stored text mostly show fine, but dates and numbers don't. I guess the issue is that I have no idea what type of encoding it is, and I can't find out either. Any suggestions?
| 1 |
10,966,015 | 06/10/2012 02:39:41 | 1,116,870 | 12/26/2011 23:35:42 | 45 | 2 | QFile VS ifstream. Which is faster? | I'm trying to figure out which is faster, as well as learn how to benchmark. Do you think this is an accurate way to test QFile VS ifstream?
[http://ideone.com/ipkGh][1]
[1]: http://ideone.com/ipkGh | c++ | qt | benchmarking | ifstream | qfile | 06/10/2012 22:50:45 | off topic | QFile VS ifstream. Which is faster?
===
I'm trying to figure out which is faster, as well as learn how to benchmark. Do you think this is an accurate way to test QFile VS ifstream?
[http://ideone.com/ipkGh][1]
[1]: http://ideone.com/ipkGh | 2 |
10,315,368 | 04/25/2012 12:13:44 | 1,349,377 | 04/22/2012 10:13:58 | 1 | 0 | Press and Release behavior for Buttons in Windows Forms Application | I want to have "press" and "release" behavior for a button in my windows form. How can this be achieved?
Many thanks. | winforms | button | null | null | null | null | open | Press and Release behavior for Buttons in Windows Forms Application
===
I want to have "press" and "release" behavior for a button in my windows form. How can this be achieved?
Many thanks. | 0 |
7,473,581 | 09/19/2011 15:43:52 | 952,960 | 09/19/2011 15:24:41 | 1 | 0 | Zen Cart Vs Magento | What are the advantages and disadvantages of Zen Cart and Magento?
Plz list the scenarios in which i should prefer one of them? | php | magento | zen-cart | null | null | 09/19/2011 19:29:43 | not constructive | Zen Cart Vs Magento
===
What are the advantages and disadvantages of Zen Cart and Magento?
Plz list the scenarios in which i should prefer one of them? | 4 |
5,226,428 | 03/07/2011 23:11:26 | 679,601 | 02/04/2010 00:02:49 | 166 | 11 | Does PHP File Upload work on all devices | I am curious as to know if the **basic PHP File Upload procedure** will work on all devices.
Such as:
- All Major Browsers
- Mobile Phones (iPhone, Blackberry, Android, Palm)
I need to be able to upload Videos/Photos from any device onto our server, will there be any issues that you can forsee? | php | file-upload | mobile | mobile-web | null | null | open | Does PHP File Upload work on all devices
===
I am curious as to know if the **basic PHP File Upload procedure** will work on all devices.
Such as:
- All Major Browsers
- Mobile Phones (iPhone, Blackberry, Android, Palm)
I need to be able to upload Videos/Photos from any device onto our server, will there be any issues that you can forsee? | 0 |
6,927,189 | 08/03/2011 13:28:08 | 131,560 | 07/01/2009 08:47:28 | 585 | 33 | How do i setup WPF Streaming of video or live footage | I need to make an application where several clients (WPF) will stream the same movie (from disk) or live footage, captured by webcam through a server. It should be possible for the client to request a particular "channel" or video (kinda like on demand TV). I looked into the Smooth streaming IIS module, but that seems to be Silverlight Only. Any ideas on how to do this. Currently i have access to an IIS or a WCF service serving other content to my clients (images primarily). Any ideas on how to do this, the solution should be able to support around 25-50 clients streaming.
| c# | wpf | wcf | streaming | null | 08/05/2011 13:53:06 | not constructive | How do i setup WPF Streaming of video or live footage
===
I need to make an application where several clients (WPF) will stream the same movie (from disk) or live footage, captured by webcam through a server. It should be possible for the client to request a particular "channel" or video (kinda like on demand TV). I looked into the Smooth streaming IIS module, but that seems to be Silverlight Only. Any ideas on how to do this. Currently i have access to an IIS or a WCF service serving other content to my clients (images primarily). Any ideas on how to do this, the solution should be able to support around 25-50 clients streaming.
| 4 |
9,819,124 | 03/22/2012 09:06:23 | 844,177 | 07/14/2011 08:54:19 | 30 | 5 | How to delete all git aliases at once? | How can I delete all existing git aliases at once? I tried _git config --unset-all ..._ but was unable to figure out the correct syntax for this command. | git | terminal | null | null | null | null | open | How to delete all git aliases at once?
===
How can I delete all existing git aliases at once? I tried _git config --unset-all ..._ but was unable to figure out the correct syntax for this command. | 0 |
1,906,564 | 12/15/2009 10:41:52 | 176,003 | 09/19/2009 19:00:08 | 1 | 0 | Onshore work methods V Offshore Supplier work methods - how to strike a balance? | Any advice on the best way to strike a balance between the work methods of an offshore supplier and the work methods of a new onshore team?
We have an offshore supplier with about 2 years who have their own working practices and methods. I was bought in as the first onshore developer for my company with the view to vetting the code that comes in and putting together some best practices.
Now from what I've seen there are lots of holes in their process (e.g. estimation, planning, code reviews, coding standards from about 10 years ago, no concept of mocking, refactoring etc).
I need to be seen as a problem solver and not a problem creator but also I need to try and be somewhat forceful of what they are doing needs improving and at the end of the day they are a supplier. I would appreciate any advice.
Thanks.
| work-habits | null | null | null | null | 01/23/2012 17:07:44 | off topic | Onshore work methods V Offshore Supplier work methods - how to strike a balance?
===
Any advice on the best way to strike a balance between the work methods of an offshore supplier and the work methods of a new onshore team?
We have an offshore supplier with about 2 years who have their own working practices and methods. I was bought in as the first onshore developer for my company with the view to vetting the code that comes in and putting together some best practices.
Now from what I've seen there are lots of holes in their process (e.g. estimation, planning, code reviews, coding standards from about 10 years ago, no concept of mocking, refactoring etc).
I need to be seen as a problem solver and not a problem creator but also I need to try and be somewhat forceful of what they are doing needs improving and at the end of the day they are a supplier. I would appreciate any advice.
Thanks.
| 2 |
752,119 | 04/15/2009 15:01:29 | 541,996 | 04/15/2009 15:01:29 | 1 | 0 | ASP.net Delphi dynamic imagebutton onclick event | I'm having a bit of trouble with an old delphi.net application.
I need to show some thumbnail images on a specific location on the page, and when the user clicks the image show the image.
The images are rather small so I havn't bothered with thumbnail generation.
The problem is that I can't get the onclick event working.
Here is my code: (This is in the page_load event)
filer := Directory.GetFiles(dirstr,soegestr);
for f in filer do
begin
img := ImageButton.Create;
img.ImageUrl := f;
img.Width := 30;
img.Height := 50;
img.Style.Add('margin-right','10px');
include(img.Click, FragtbrevsBilledeClick);
PanelBilleder.Controls.Add(img);
end;
include does nothing. The onclick event just triggers a postback.
I'm not a reguler web developer so alternative ways to solve the problem is also welcome! :-)
| delphi | asp.net | imagebutton | dynamic | click | null | open | ASP.net Delphi dynamic imagebutton onclick event
===
I'm having a bit of trouble with an old delphi.net application.
I need to show some thumbnail images on a specific location on the page, and when the user clicks the image show the image.
The images are rather small so I havn't bothered with thumbnail generation.
The problem is that I can't get the onclick event working.
Here is my code: (This is in the page_load event)
filer := Directory.GetFiles(dirstr,soegestr);
for f in filer do
begin
img := ImageButton.Create;
img.ImageUrl := f;
img.Width := 30;
img.Height := 50;
img.Style.Add('margin-right','10px');
include(img.Click, FragtbrevsBilledeClick);
PanelBilleder.Controls.Add(img);
end;
include does nothing. The onclick event just triggers a postback.
I'm not a reguler web developer so alternative ways to solve the problem is also welcome! :-)
| 0 |
7,708,338 | 10/10/2011 03:43:58 | 987,014 | 10/10/2011 03:04:13 | 1 | 0 | Why isn't the developer app working properly? | So I've been having this problem for the last couple of days...
I created a page for my business under my regular Facebook account. I want to be able to integrate it with my business website. When I go to the "developer" link at the bottom of the page, then click on "apps" at the top, it takes me to a page where it has a button to "edit app" or "create new app". When I click on the "edit app" button, I get taken to a "page not found" page. When I click on the "create new app" button, just as a box pops up saying its loading, I quickly get forwarded right back to my profile page. I checked my account settings, there's nothing found under the apps section for the Facebook developer apps. I'm using Google chrome browser, so does that make a difference? This is holding up a few things with integration, site design/building.
Another issue I have is that when I click on certain links, I get an /undefined message.
If someone has any similar experiences or can help guide me through fixing this, I'd appreciate it so I can continue working on other aspects of my site & business... | facebook | api | integration | apps | platform | 10/10/2011 06:25:52 | off topic | Why isn't the developer app working properly?
===
So I've been having this problem for the last couple of days...
I created a page for my business under my regular Facebook account. I want to be able to integrate it with my business website. When I go to the "developer" link at the bottom of the page, then click on "apps" at the top, it takes me to a page where it has a button to "edit app" or "create new app". When I click on the "edit app" button, I get taken to a "page not found" page. When I click on the "create new app" button, just as a box pops up saying its loading, I quickly get forwarded right back to my profile page. I checked my account settings, there's nothing found under the apps section for the Facebook developer apps. I'm using Google chrome browser, so does that make a difference? This is holding up a few things with integration, site design/building.
Another issue I have is that when I click on certain links, I get an /undefined message.
If someone has any similar experiences or can help guide me through fixing this, I'd appreciate it so I can continue working on other aspects of my site & business... | 2 |
1,688,989 | 11/06/2009 17:12:33 | 73,315 | 03/03/2009 17:23:35 | 277 | 18 | UTF-8 to Latin-1: XLookupString receiving a UTF-8 code | I'm trying to use the function XLookupString.
According to the [documentation][1], it is supposed to return a Latin-1 code. How could I convert it or what should I use instead this function so I get a UTF-8 code?
Thanks.
[1]: http://tronche.com/gui/x/xlib/utilities/XLookupString.html | x | linux | xlib | null | null | null | open | UTF-8 to Latin-1: XLookupString receiving a UTF-8 code
===
I'm trying to use the function XLookupString.
According to the [documentation][1], it is supposed to return a Latin-1 code. How could I convert it or what should I use instead this function so I get a UTF-8 code?
Thanks.
[1]: http://tronche.com/gui/x/xlib/utilities/XLookupString.html | 0 |
5,812,238 | 04/28/2011 00:23:11 | 263,004 | 01/31/2010 17:46:21 | 12,040 | 439 | Sanitizing Tomcat log entries | In our logs we're seeing credit-card numbers due to people hitting some of the ULRs in our app with CC info (I have no idea why they are doing this). We want to sanitize this information (because of PCI considerations) and not even persist it to disk.
Hence, I want to be able to sanitize log entry before it hits the log file. I've been looking at Tomcat Valves (Access Log Valve). Is this the way to go? | security | tomcat | logging | pci | null | null | open | Sanitizing Tomcat log entries
===
In our logs we're seeing credit-card numbers due to people hitting some of the ULRs in our app with CC info (I have no idea why they are doing this). We want to sanitize this information (because of PCI considerations) and not even persist it to disk.
Hence, I want to be able to sanitize log entry before it hits the log file. I've been looking at Tomcat Valves (Access Log Valve). Is this the way to go? | 0 |
2,842,993 | 05/16/2010 08:00:58 | 238,626 | 12/25/2009 17:08:58 | 265 | 14 | How to highlight a taskbar item | In almost all messengers when your IM window is minimized to the taskbar, IM taskbar item changes color or gets brighter when you have a new message. I've been looking for any help on how to do this using .NET Winforms or WPF
Any code samples? | .net | c# | vb.net | winforms | null | null | open | How to highlight a taskbar item
===
In almost all messengers when your IM window is minimized to the taskbar, IM taskbar item changes color or gets brighter when you have a new message. I've been looking for any help on how to do this using .NET Winforms or WPF
Any code samples? | 0 |
8,130,586 | 11/15/2011 01:56:19 | 1,046,665 | 11/15/2011 01:51:32 | 1 | 0 | Assigning words to a variable on visual Studio | I just need to know how to assign a specific word to a variable such as 'x' in Visual Studio. What is the proper syntax or assignment operator? | visual-studio | null | null | null | null | 11/15/2011 10:25:06 | not a real question | Assigning words to a variable on visual Studio
===
I just need to know how to assign a specific word to a variable such as 'x' in Visual Studio. What is the proper syntax or assignment operator? | 1 |
11,112,654 | 06/20/2012 04:03:49 | 1,462,992 | 06/18/2012 07:22:26 | 1 | 1 | How to web structure? | i have 6 web sites, mydomain.com this is my first web site, directory is public_html and other 5 is in public_html/domain.com
I didn't recognize it will work like mydomain.com/domain.com.
The main problem is a link deis twice. for example:
domain.com/index.php&option... if this link dies
mydomain.com/domain.com/index.php&option... dies too. I want to fix it. Is there any way to rewrite the directions. Example:
mydomain.com/domain.com/index.php&option... -> domain.com/index.php&option... etc | http-status-code-404 | null | null | null | null | null | open | How to web structure?
===
i have 6 web sites, mydomain.com this is my first web site, directory is public_html and other 5 is in public_html/domain.com
I didn't recognize it will work like mydomain.com/domain.com.
The main problem is a link deis twice. for example:
domain.com/index.php&option... if this link dies
mydomain.com/domain.com/index.php&option... dies too. I want to fix it. Is there any way to rewrite the directions. Example:
mydomain.com/domain.com/index.php&option... -> domain.com/index.php&option... etc | 0 |
10,832,211 | 05/31/2012 10:54:58 | 1,323,746 | 04/10/2012 10:02:19 | 10 | 0 | Opening HDFS folder | Good day
I Have some questions about the following Command in Hadoop (as I am new to Linux/Ubuntu):
bin/hadoop dfs -copyFromLocal /tmp/folder /user/hduser/folder
This copies the files from the local file system to HDFS; would it be possible to access the HDFS from Ubuntu's GUI? without using "-ls" in shell? like in, I want to open the folder where the HDFS files are located in...Would this be possible?
Thank you | ubuntu | hadoop | null | null | null | 06/02/2012 03:56:05 | off topic | Opening HDFS folder
===
Good day
I Have some questions about the following Command in Hadoop (as I am new to Linux/Ubuntu):
bin/hadoop dfs -copyFromLocal /tmp/folder /user/hduser/folder
This copies the files from the local file system to HDFS; would it be possible to access the HDFS from Ubuntu's GUI? without using "-ls" in shell? like in, I want to open the folder where the HDFS files are located in...Would this be possible?
Thank you | 2 |
4,183,638 | 11/15/2010 10:59:30 | 453,875 | 09/21/2010 11:52:43 | 6 | 3 | Why do IT projects become too complex and how to avoid it ? | I'm at my last year of study (master) and i'm preparing my memoir about "Why do IT projects become too complex and how to avoid it ?". Have you ever encoutered projects having complex codes without efficiency and are not maintainable? During my internship, i had to use webservices with SOAP (generating classes, etc.). It was really hard for me to understand how SOAP works because i was used to REST when i developped webservices ... i was wondering why do we persist in using complex applications?
Waiting after your opinions :)
| web-services | web-applications | project | null | null | 11/15/2010 14:39:57 | not constructive | Why do IT projects become too complex and how to avoid it ?
===
I'm at my last year of study (master) and i'm preparing my memoir about "Why do IT projects become too complex and how to avoid it ?". Have you ever encoutered projects having complex codes without efficiency and are not maintainable? During my internship, i had to use webservices with SOAP (generating classes, etc.). It was really hard for me to understand how SOAP works because i was used to REST when i developped webservices ... i was wondering why do we persist in using complex applications?
Waiting after your opinions :)
| 4 |
11,501,495 | 07/16/2012 09:25:46 | 1,407,363 | 05/21/2012 08:10:10 | 9 | 4 | xtemplate parsing in sencha | '<tpl for="ticketData[0]">',
'{activeColor}',
'</tpl>',
I have to use the value of activeColor at many places, so is there any way to store the value of activeColor in a variable and use it instead of parsing it everytime.... | sencha-touch | sencha | sencha-touch-2 | null | null | 07/17/2012 11:35:02 | not a real question | xtemplate parsing in sencha
===
'<tpl for="ticketData[0]">',
'{activeColor}',
'</tpl>',
I have to use the value of activeColor at many places, so is there any way to store the value of activeColor in a variable and use it instead of parsing it everytime.... | 1 |
3,350,582 | 07/28/2010 07:02:06 | 44,269 | 12/08/2008 11:34:34 | 7,460 | 235 | How do I strongly type criteria when using NHibernate's CreateCriteria method? | I'm currently using NHibernate, for the first time, with Fluent NHibernate. I've gotten everything setup nicely, however now I've come to actual doing some data retrieval, it seems to have fallen short.
I was expecting NHibernate, to allow me to do something like:
session.CreateCriteria<TblDocket>()
.Add(Restrictions.Eq(x=> x.DocketNumber, "10101"));
However, this doesn't appear to be the case and I seem to have to write:
session.CreateCriteria<TblDocket>()
.Add(Restrictions.Eq("DocketNumber", "10101"));
That'll be wonderful when I rename any properties! I've always though hard coded strings in code is bad, especially when the strings relate to property names.
Is there any way I can strongly type these restrictions? I had a look at [this][1] blog post, but it seems quite messy, is there a nicer solution?
[1]: http://jeffhandley.com/archive/2010/04/10/memberof.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+JeffHandley+%28Jeff+Handley%29 | nhibernate | fluent-nhibernate | c#4.0 | strong-typing | null | null | open | How do I strongly type criteria when using NHibernate's CreateCriteria method?
===
I'm currently using NHibernate, for the first time, with Fluent NHibernate. I've gotten everything setup nicely, however now I've come to actual doing some data retrieval, it seems to have fallen short.
I was expecting NHibernate, to allow me to do something like:
session.CreateCriteria<TblDocket>()
.Add(Restrictions.Eq(x=> x.DocketNumber, "10101"));
However, this doesn't appear to be the case and I seem to have to write:
session.CreateCriteria<TblDocket>()
.Add(Restrictions.Eq("DocketNumber", "10101"));
That'll be wonderful when I rename any properties! I've always though hard coded strings in code is bad, especially when the strings relate to property names.
Is there any way I can strongly type these restrictions? I had a look at [this][1] blog post, but it seems quite messy, is there a nicer solution?
[1]: http://jeffhandley.com/archive/2010/04/10/memberof.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+JeffHandley+%28Jeff+Handley%29 | 0 |
10,968,671 | 06/10/2012 12:24:18 | 1,080,517 | 12/04/2011 20:51:32 | 147 | 12 | Socket communication between two apps on Android | I have got huge problem with my Android app and I would like to ask you for help.
I am currently writing Android Clietn-Server app using sockets. I have found lots of tutorils on the Internet and from them I have created basics for my project. However, all tutorials are only for one message send and that's all. I need to send more of them so I've been trying to modify it.
This are code fragments responsible for server and client. The rest is not important at this time.
**Server:**
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
serverStatus = (TextView) findViewById(R.id.server_status);
recivedMsg = (TextView)findViewById(R.id.rec_msg);
SERVERIP = getLocalIpAddress();
Thread fst = new Thread(new ServerThread());
fst.start();
}
public class ServerThread implements Runnable {
public void run() {
try {
if (SERVERIP != null) {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Listening on IP: " + SERVERIP);
}
});
serverSocket = new ServerSocket(SERVERPORT);
while (true) {
// listen for incoming clients
Socket client = serverSocket.accept();
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Connected." + System.getProperty("line.separator"));
}
});
try {
line = null;
while (connected) {
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
if((line = in.readLine())!=null)
{
Log.d("ServerActivity", line);
handler.post(new Runnable() {
@Override
public void run() {
if(recivedMsg.equals("CLOSE"))
{
recivedMsg.append("CLOSE socket");
connected = false;
}
else
{
recivedMsg.append("MSG: " + line + System.getProperty("line.separator"));
}
// do whatever you want to the front end
// this is where you can be creative
}
});
}
else
{
recivedMsg.append("empty" + System.getProperty("line.separator"));
}
}
break;
} catch (Exception e) {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Oops. Connection interrupted. Please reconnect your phones.");
}
});
e.printStackTrace();
}
}
} else {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Couldn't detect internet connection.");
}
});
}
} catch (Exception e) {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Error");
}
});
e.printStackTrace();
}
}
}
**Client**
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
serverIp = (EditText) findViewById(R.id.server_ip);
connectPhones = (Button) findViewById(R.id.connect_phones);
sendField = (EditText) findViewById(R.id.send_field);
sendMsg = (Button) findViewById(R.id.msg_send);
connectPhones.setOnClickListener(connectListener);
sendMsg.setOnClickListener(sendMessage);
}
@Override
protected void onStop() {
super.onStop();
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
//send output msg
String outMsg = "CLOSE";
out.write(outMsg);
out.flush();
// make sure you close the socket upon exiting
s.close();
} catch (IOException e) {
e.printStackTrace();
}
}
private OnClickListener connectListener = new OnClickListener() {
@Override
public void onClick(View v) {
serverIpAddress = serverIp.getText().toString();
runTcpConnection();
sendMessageToServer("Msg");
}
};
private OnClickListener sendMessage = new OnClickListener() {
@Override
public void onClick(View v) {
sendMessageToServer(sendField.getText().toString());
}
};
private void runTcpConnection() {
try {
s = new Socket(serverIpAddress, SERVERPORT);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
//send output msg
String outMsg = "TCP connecting to " + SERVERPORT + System.getProperty("line.separator");
out.write(outMsg);
out.flush();
Log.i("TcpClient", "sent: " + outMsg);
SystemClock.sleep(10);
s.close();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
};
public void sendMessageToServer(String str) {
try {
s = new Socket(serverIpAddress, SERVERPORT);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
//send output msg
String outMsg = str + System.getProperty("line.separator");
out.write(outMsg);
out.flush();
Log.i("TcpClient", "sent: " + outMsg);
s.close();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("", "hello222");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("", "hello4333");
}
}
For now devices connect correctly. Moreover They are sending the first connection messages (those in `OnClickListener connectListener`). **The problem is that when I am trying to send another message using `sendMessageToServer` it is impossible. Those messages shows only after client activity is destroyed.**
Very interesting is that without `SystemClock.sleep(10);` listener `runTcpConnection()` behave strange. Only 'Connected.' displays on server.
Can someone tell me what I have to do to be able to send messages normally?
**EDIT:**
This are things that I have found:
- If I am at the connection sending more messages than all are empty (null) and after the second one connection error shows - please reconnect phones
- If I am at the connection sending more messages without s.close line in `sendMessageToServer ` only one message is passing through. No error is displayed after it.
- The message form `runTcpConnection` shows always (except when in this function is no SystemClock.sleep(10))
Hope it will help someone to diagnose my error. | java | android | sockets | chat | null | null | open | Socket communication between two apps on Android
===
I have got huge problem with my Android app and I would like to ask you for help.
I am currently writing Android Clietn-Server app using sockets. I have found lots of tutorils on the Internet and from them I have created basics for my project. However, all tutorials are only for one message send and that's all. I need to send more of them so I've been trying to modify it.
This are code fragments responsible for server and client. The rest is not important at this time.
**Server:**
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
serverStatus = (TextView) findViewById(R.id.server_status);
recivedMsg = (TextView)findViewById(R.id.rec_msg);
SERVERIP = getLocalIpAddress();
Thread fst = new Thread(new ServerThread());
fst.start();
}
public class ServerThread implements Runnable {
public void run() {
try {
if (SERVERIP != null) {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Listening on IP: " + SERVERIP);
}
});
serverSocket = new ServerSocket(SERVERPORT);
while (true) {
// listen for incoming clients
Socket client = serverSocket.accept();
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Connected." + System.getProperty("line.separator"));
}
});
try {
line = null;
while (connected) {
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
if((line = in.readLine())!=null)
{
Log.d("ServerActivity", line);
handler.post(new Runnable() {
@Override
public void run() {
if(recivedMsg.equals("CLOSE"))
{
recivedMsg.append("CLOSE socket");
connected = false;
}
else
{
recivedMsg.append("MSG: " + line + System.getProperty("line.separator"));
}
// do whatever you want to the front end
// this is where you can be creative
}
});
}
else
{
recivedMsg.append("empty" + System.getProperty("line.separator"));
}
}
break;
} catch (Exception e) {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Oops. Connection interrupted. Please reconnect your phones.");
}
});
e.printStackTrace();
}
}
} else {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Couldn't detect internet connection.");
}
});
}
} catch (Exception e) {
handler.post(new Runnable() {
@Override
public void run() {
serverStatus.setText("Error");
}
});
e.printStackTrace();
}
}
}
**Client**
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
serverIp = (EditText) findViewById(R.id.server_ip);
connectPhones = (Button) findViewById(R.id.connect_phones);
sendField = (EditText) findViewById(R.id.send_field);
sendMsg = (Button) findViewById(R.id.msg_send);
connectPhones.setOnClickListener(connectListener);
sendMsg.setOnClickListener(sendMessage);
}
@Override
protected void onStop() {
super.onStop();
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
//send output msg
String outMsg = "CLOSE";
out.write(outMsg);
out.flush();
// make sure you close the socket upon exiting
s.close();
} catch (IOException e) {
e.printStackTrace();
}
}
private OnClickListener connectListener = new OnClickListener() {
@Override
public void onClick(View v) {
serverIpAddress = serverIp.getText().toString();
runTcpConnection();
sendMessageToServer("Msg");
}
};
private OnClickListener sendMessage = new OnClickListener() {
@Override
public void onClick(View v) {
sendMessageToServer(sendField.getText().toString());
}
};
private void runTcpConnection() {
try {
s = new Socket(serverIpAddress, SERVERPORT);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
//send output msg
String outMsg = "TCP connecting to " + SERVERPORT + System.getProperty("line.separator");
out.write(outMsg);
out.flush();
Log.i("TcpClient", "sent: " + outMsg);
SystemClock.sleep(10);
s.close();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
};
public void sendMessageToServer(String str) {
try {
s = new Socket(serverIpAddress, SERVERPORT);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
//send output msg
String outMsg = str + System.getProperty("line.separator");
out.write(outMsg);
out.flush();
Log.i("TcpClient", "sent: " + outMsg);
s.close();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("", "hello222");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.d("", "hello4333");
}
}
For now devices connect correctly. Moreover They are sending the first connection messages (those in `OnClickListener connectListener`). **The problem is that when I am trying to send another message using `sendMessageToServer` it is impossible. Those messages shows only after client activity is destroyed.**
Very interesting is that without `SystemClock.sleep(10);` listener `runTcpConnection()` behave strange. Only 'Connected.' displays on server.
Can someone tell me what I have to do to be able to send messages normally?
**EDIT:**
This are things that I have found:
- If I am at the connection sending more messages than all are empty (null) and after the second one connection error shows - please reconnect phones
- If I am at the connection sending more messages without s.close line in `sendMessageToServer ` only one message is passing through. No error is displayed after it.
- The message form `runTcpConnection` shows always (except when in this function is no SystemClock.sleep(10))
Hope it will help someone to diagnose my error. | 0 |
8,662,540 | 12/28/2011 23:43:09 | 62,539 | 02/04/2009 18:12:58 | 2,321 | 57 | how do I add a missing bundle in Eclipse? | When installing tools for AWS in Eclipse, I encountered the following error:
> Cannot complete the install because one or more required items could not be found.
Software currently installed: Amazon SimpleDB Management 1.0.0.v201111161400 (com.amazonaws.eclipse.datatools.enablement.simpledb.feature.feature.group 1.0.0.v201111161400)
Missing requirement: Eclipse Data Tools Platform Amazon SimpleDB UI Plug-in 1.0.0.v201111161400 (com.amazonaws.eclipse.datatools.enablement.simpledb.ui 1.0.0.v201111161400) requires 'bundle org.eclipse.datatools.sqltools.sqlscrapbook 1.0.0' but it could not be found
Cannot satisfy dependency:
From: Amazon SimpleDB Management 1.0.0.v201111161400 (com.amazonaws.eclipse.datatools.enablement.simpledb.feature.feature.group 1.0.0.v201111161400)
To: com.amazonaws.eclipse.datatools.enablement.simpledb.ui [1.0.0.v201111161400]
What is the problem here and how do I resolve it? Sorry, but I am new to Eclipse and Java dev in general. Could the following message be the key?
> requires 'bundle org.eclipse.datatools.sqltools.sqlscrapbook 1.0.0' but it could not be found | java | eclipse | swing | null | null | null | open | how do I add a missing bundle in Eclipse?
===
When installing tools for AWS in Eclipse, I encountered the following error:
> Cannot complete the install because one or more required items could not be found.
Software currently installed: Amazon SimpleDB Management 1.0.0.v201111161400 (com.amazonaws.eclipse.datatools.enablement.simpledb.feature.feature.group 1.0.0.v201111161400)
Missing requirement: Eclipse Data Tools Platform Amazon SimpleDB UI Plug-in 1.0.0.v201111161400 (com.amazonaws.eclipse.datatools.enablement.simpledb.ui 1.0.0.v201111161400) requires 'bundle org.eclipse.datatools.sqltools.sqlscrapbook 1.0.0' but it could not be found
Cannot satisfy dependency:
From: Amazon SimpleDB Management 1.0.0.v201111161400 (com.amazonaws.eclipse.datatools.enablement.simpledb.feature.feature.group 1.0.0.v201111161400)
To: com.amazonaws.eclipse.datatools.enablement.simpledb.ui [1.0.0.v201111161400]
What is the problem here and how do I resolve it? Sorry, but I am new to Eclipse and Java dev in general. Could the following message be the key?
> requires 'bundle org.eclipse.datatools.sqltools.sqlscrapbook 1.0.0' but it could not be found | 0 |
7,421,131 | 09/14/2011 18:24:50 | 845,823 | 07/15/2011 04:54:17 | 1 | 0 | Regular expression that matches one word but not followed immediately by another word | I am trying to build a regular expression to do the following:<br />
<br /><b>"There is a pool table"</b> should not return a match because <b>'pool' is immediately followed by 'table'</b><br />
<br />However, <b>"There is a pool and there is a table"</b> should return a match <b>for 'pool'</b> as 'table' is somewhere else in the sentence.<br />
<br />I also want to build a regexp for the reverse case where I want to match a word not preceded immediately by another word. For example:<br />
<br />"There is a bird" should return a match for 'bird' but "There is no bird" should not return a match because 'bird' is preceded immediately by 'no'. | regex | null | null | null | null | 09/15/2011 06:04:01 | not a real question | Regular expression that matches one word but not followed immediately by another word
===
I am trying to build a regular expression to do the following:<br />
<br /><b>"There is a pool table"</b> should not return a match because <b>'pool' is immediately followed by 'table'</b><br />
<br />However, <b>"There is a pool and there is a table"</b> should return a match <b>for 'pool'</b> as 'table' is somewhere else in the sentence.<br />
<br />I also want to build a regexp for the reverse case where I want to match a word not preceded immediately by another word. For example:<br />
<br />"There is a bird" should return a match for 'bird' but "There is no bird" should not return a match because 'bird' is preceded immediately by 'no'. | 1 |
11,282,007 | 07/01/2012 12:38:19 | 1,494,243 | 07/01/2012 12:32:05 | 1 | 0 | create xml file by c# in spacial format | i want create xml file by c# in this format
can you can me?
i have one file and i want to create a file with this format.
but i dont know with wich of the class in c# i can do it.
<table>
<independentVar>aero/h_b-mac-ft</independentVar>
<tableData>
0 1.229
0.1 1.124
0.15 1.116
0.2 1.124
0.3 1.105
0.4 1.041
0.5 1.034
0.6 1.019
0.7 1.008
0.8 1.003
0.9 1.001
1 1
1.1 1
</tableData>
</table> | c# | xml | file | datatable | null | 07/02/2012 03:16:09 | not constructive | create xml file by c# in spacial format
===
i want create xml file by c# in this format
can you can me?
i have one file and i want to create a file with this format.
but i dont know with wich of the class in c# i can do it.
<table>
<independentVar>aero/h_b-mac-ft</independentVar>
<tableData>
0 1.229
0.1 1.124
0.15 1.116
0.2 1.124
0.3 1.105
0.4 1.041
0.5 1.034
0.6 1.019
0.7 1.008
0.8 1.003
0.9 1.001
1 1
1.1 1
</tableData>
</table> | 4 |
11,360,275 | 07/06/2012 10:16:02 | 1,338,152 | 04/17/2012 07:57:21 | 1 | 0 | load local js and css on server side html in webview | I am loading html page from my localhost server in webview. I want to load js and css from resources to that html. Is there any way to do this? Please help. | javascript | html | css | ios | uiwebview | 07/06/2012 11:04:42 | not a real question | load local js and css on server side html in webview
===
I am loading html page from my localhost server in webview. I want to load js and css from resources to that html. Is there any way to do this? Please help. | 1 |
9,784,667 | 03/20/2012 10:05:05 | 1,273,337 | 03/16/2012 06:05:24 | 8 | 0 | Force close when repeating image from gallery | I have created application that displays image gallery and on click of image of gallery it will be displayed in zoom view in ImageView below it..now my problem is when i am repeating the image from first after visiting all images,i got Force close error because i have set first image as default when my gallery page is opened..so what is the solution for this?? | android | android-sdk-2.2 | null | null | null | 03/21/2012 01:41:21 | not a real question | Force close when repeating image from gallery
===
I have created application that displays image gallery and on click of image of gallery it will be displayed in zoom view in ImageView below it..now my problem is when i am repeating the image from first after visiting all images,i got Force close error because i have set first image as default when my gallery page is opened..so what is the solution for this?? | 1 |
5,742,418 | 04/21/2011 09:54:02 | 718,680 | 04/21/2011 09:35:01 | 1 | 0 | How to get Modules list in symfony | I hope you all are doing your best.
I am new to symfony and I am learning it. I want to get all working modules and their methods dynamically to bulild a list to implement ACL.
like:
foreach(getModules() as $module)
{
echo $moudule .' has following methods: ';
foreach( $module as $method )
{
echo $method.'<br />';
}
}
Above code is not a valid code. it is just an idea to get things.
Please any suggestion?
Thank you in advance! | methods | symfony | module | get | all | null | open | How to get Modules list in symfony
===
I hope you all are doing your best.
I am new to symfony and I am learning it. I want to get all working modules and their methods dynamically to bulild a list to implement ACL.
like:
foreach(getModules() as $module)
{
echo $moudule .' has following methods: ';
foreach( $module as $method )
{
echo $method.'<br />';
}
}
Above code is not a valid code. it is just an idea to get things.
Please any suggestion?
Thank you in advance! | 0 |
2,217,183 | 02/07/2010 15:12:38 | 263,375 | 02/01/2010 09:44:06 | 1 | 0 | C++ Pac-Man : SDL or Qt ? | I have to code a Pac-Man clone in C++ for a school project, and I'm hesitating between SDL and Qt for the graphical implementation.
I have already a little experience with SDL, but I wanted to give Qt a try. I was asking myself if it is "technically" realisable and if Qt is a good choice for that. I know that it have an animation framework in it, but I wanted to hear from your experiences.
To summarize: is Qt a good framework for making games ?
Thank you. | sdl | qt | c++ | null | null | 02/20/2012 22:09:06 | not constructive | C++ Pac-Man : SDL or Qt ?
===
I have to code a Pac-Man clone in C++ for a school project, and I'm hesitating between SDL and Qt for the graphical implementation.
I have already a little experience with SDL, but I wanted to give Qt a try. I was asking myself if it is "technically" realisable and if Qt is a good choice for that. I know that it have an animation framework in it, but I wanted to hear from your experiences.
To summarize: is Qt a good framework for making games ?
Thank you. | 4 |
11,016,160 | 06/13/2012 13:43:38 | 1,325,517 | 04/11/2012 02:49:10 | 16 | 0 | how to get start and end date of a week from given year and month | i like to have a code in c#, where it should return start and End date of the week.
Example **StarandEndDateOfWeek(int year, int month, int week);**
if input is **StarandEndDateOfWeek(2012, 6, 2)** then expected output as
**4/6/2012 - 10/6/2012**
Thanks and appreciate in advance. | c# | datetime | null | null | null | 06/14/2012 14:09:38 | not a real question | how to get start and end date of a week from given year and month
===
i like to have a code in c#, where it should return start and End date of the week.
Example **StarandEndDateOfWeek(int year, int month, int week);**
if input is **StarandEndDateOfWeek(2012, 6, 2)** then expected output as
**4/6/2012 - 10/6/2012**
Thanks and appreciate in advance. | 1 |
61,972 | 09/15/2008 07:28:56 | 6,390 | 09/15/2008 07:28:56 | 1 | 0 | JavaScript sqlite | Best recommendations for accessing and manipulation of sqlite databases from JavaScript. | javascript | sqlite | null | null | null | null | open | JavaScript sqlite
===
Best recommendations for accessing and manipulation of sqlite databases from JavaScript. | 0 |
10,193,809 | 04/17/2012 15:05:13 | 442,496 | 09/08/2010 14:00:31 | 382 | 31 | Path app native objective c? | relatively new to iphone dev, but i was interested in the app Path.
its a social network app but its so beautifully created.
is this native objective c?
or does it use a js framework such as a Cappuccino?
the UI feels very much like html5.
thanks,
dave | iphone | objective-c | ios | null | null | 04/17/2012 16:21:08 | off topic | Path app native objective c?
===
relatively new to iphone dev, but i was interested in the app Path.
its a social network app but its so beautifully created.
is this native objective c?
or does it use a js framework such as a Cappuccino?
the UI feels very much like html5.
thanks,
dave | 2 |
9,000,934 | 01/25/2012 10:15:05 | 437,879 | 09/02/2010 11:16:00 | 43 | 5 | Actual Book / Online Resource for the Java Virtual Machine | Is there an up to date book available which target the insides of the java virtual machine?
Long ago I read this book: http://www.artima.com/insidejvm/blurb.html.
But I can't find any up to date book with similar content. | java | jvm | null | null | null | null | open | Actual Book / Online Resource for the Java Virtual Machine
===
Is there an up to date book available which target the insides of the java virtual machine?
Long ago I read this book: http://www.artima.com/insidejvm/blurb.html.
But I can't find any up to date book with similar content. | 0 |
9,781,963 | 03/20/2012 05:54:21 | 1,237,533 | 02/28/2012 09:31:05 | 19 | 0 | UNEXPECTED T_CONSTANT_ENCAPSED_STRING Error | I am getting an UNEXPECTED T_CONSTANT_ENCAPSED_STRING error in this line
$portfolio_html.='<li> <a href=" ' /*. HTTP_SERVER . $ilpage['portfolio'] .
'?cmd=zoom&item=' . $portfolio_item['id'] . '&id=' . $portfolio_item['user_id']
.'*/ '"><img height="54" width="60" src="images/portfolio_uploads
/orig_'.$portfolio_item['image'].'"></a></li>';
Can any body help?? | php | null | null | null | null | 03/20/2012 12:37:51 | too localized | UNEXPECTED T_CONSTANT_ENCAPSED_STRING Error
===
I am getting an UNEXPECTED T_CONSTANT_ENCAPSED_STRING error in this line
$portfolio_html.='<li> <a href=" ' /*. HTTP_SERVER . $ilpage['portfolio'] .
'?cmd=zoom&item=' . $portfolio_item['id'] . '&id=' . $portfolio_item['user_id']
.'*/ '"><img height="54" width="60" src="images/portfolio_uploads
/orig_'.$portfolio_item['image'].'"></a></li>';
Can any body help?? | 3 |
8,454,823 | 12/10/2011 06:14:55 | 128,071 | 06/24/2009 08:39:06 | 1,522 | 0 | For Loop and split is not working | Using VB6
While running the below code, i am getting error.
Code
Dim a as string
a = "0008,0009,1011,1208"
dim strArray as string() = a.Split(',')
for each item as string in strArray
.....
next
How to solve this.
Need VB6 code Help | vb | vb6 | null | null | null | 12/27/2011 03:18:01 | not a real question | For Loop and split is not working
===
Using VB6
While running the below code, i am getting error.
Code
Dim a as string
a = "0008,0009,1011,1208"
dim strArray as string() = a.Split(',')
for each item as string in strArray
.....
next
How to solve this.
Need VB6 code Help | 1 |
7,620,623 | 10/01/2011 13:44:04 | 310,370 | 04/06/2010 20:22:21 | 683 | 7 | Understanding the "using" statement in asp.net 4.0 - C# | Are there any difference between these 2 codes ? Which one should be used ?
asp.net 4.0 , c#
code 1 :
using System;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;
public static class DbConnection
{
public static string srConnectionString = "server=localhost;database=mydb;uid=sa;pwd=mypw;";
public static DataSet db_Select_Query(string strQuery)
{
DataSet dSet = new DataSet();
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
SqlDataAdapter DA = new SqlDataAdapter(strQuery, connection);
DA.Fill(dSet);
}
return dSet;
}
catch
{
if (srConnectionString.IndexOf("select Id from tblAspErrors") != -1)
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
strQuery = strQuery.Replace("'", "''");
SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection);
command.ExecuteNonQuery();
}
}
return dSet;
}
}
public static void db_Update_Delete_Query(string strQuery)
{
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
SqlCommand command = new SqlCommand(strQuery, connection);
command.ExecuteNonQuery();
}
}
catch
{
strQuery = strQuery.Replace("'", "''");
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection);
command.ExecuteNonQuery();
}
}
}
}
code 2 :
using System;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;
public static class DbConnection
{
public static string srConnectionString = "server=localhost;database=mydb;uid=sa;pwd=mypw;";
public static DataSet db_Select_Query(string strQuery)
{
DataSet dSet = new DataSet();
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
using (SqlDataAdapter DA = new SqlDataAdapter(strQuery, connection))
{
DA.Fill(dSet);
}
}
return dSet;
}
catch
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
if (srConnectionString.IndexOf("select Id from tblAspErrors") != -1)
{
connection.Open();
strQuery = strQuery.Replace("'", "''");
using (SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection))
{
command.ExecuteNonQuery();
}
}
}
return dSet;
}
}
public static void db_Update_Delete_Query(string strQuery)
{
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand(strQuery, connection))
{
command.ExecuteNonQuery();
}
}
}
catch
{
strQuery = strQuery.Replace("'", "''");
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection))
{
command.ExecuteNonQuery();
}
}
}
}
}
| c# | .net | asp.net | using | statement | 10/02/2011 10:39:00 | too localized | Understanding the "using" statement in asp.net 4.0 - C#
===
Are there any difference between these 2 codes ? Which one should be used ?
asp.net 4.0 , c#
code 1 :
using System;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;
public static class DbConnection
{
public static string srConnectionString = "server=localhost;database=mydb;uid=sa;pwd=mypw;";
public static DataSet db_Select_Query(string strQuery)
{
DataSet dSet = new DataSet();
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
SqlDataAdapter DA = new SqlDataAdapter(strQuery, connection);
DA.Fill(dSet);
}
return dSet;
}
catch
{
if (srConnectionString.IndexOf("select Id from tblAspErrors") != -1)
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
strQuery = strQuery.Replace("'", "''");
SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection);
command.ExecuteNonQuery();
}
}
return dSet;
}
}
public static void db_Update_Delete_Query(string strQuery)
{
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
SqlCommand command = new SqlCommand(strQuery, connection);
command.ExecuteNonQuery();
}
}
catch
{
strQuery = strQuery.Replace("'", "''");
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection);
command.ExecuteNonQuery();
}
}
}
}
code 2 :
using System;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;
public static class DbConnection
{
public static string srConnectionString = "server=localhost;database=mydb;uid=sa;pwd=mypw;";
public static DataSet db_Select_Query(string strQuery)
{
DataSet dSet = new DataSet();
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
using (SqlDataAdapter DA = new SqlDataAdapter(strQuery, connection))
{
DA.Fill(dSet);
}
}
return dSet;
}
catch
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
if (srConnectionString.IndexOf("select Id from tblAspErrors") != -1)
{
connection.Open();
strQuery = strQuery.Replace("'", "''");
using (SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection))
{
command.ExecuteNonQuery();
}
}
}
return dSet;
}
}
public static void db_Update_Delete_Query(string strQuery)
{
try
{
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand(strQuery, connection))
{
command.ExecuteNonQuery();
}
}
}
catch
{
strQuery = strQuery.Replace("'", "''");
using (SqlConnection connection = new SqlConnection(srConnectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand("insert into tblSqlErrors values ('" + strQuery + "')", connection))
{
command.ExecuteNonQuery();
}
}
}
}
}
| 3 |
9,895,610 | 03/27/2012 18:43:02 | 1,296,349 | 03/27/2012 18:38:21 | 1 | 0 | Rewrite all requests to a specific subdirectory to homepage | I'd like to push all users sending a request to a particular subdirectory back to the homepage. E.g.;
http://test.example.com/apps/
http://test.example.com/apps/sd1
http://test.example.com/apps/fjwoiejf/jiejn
Should all rewrite to:
http://test.example.com
The web server is Apache. | apache | mod-rewrite | null | null | null | 03/28/2012 19:52:36 | off topic | Rewrite all requests to a specific subdirectory to homepage
===
I'd like to push all users sending a request to a particular subdirectory back to the homepage. E.g.;
http://test.example.com/apps/
http://test.example.com/apps/sd1
http://test.example.com/apps/fjwoiejf/jiejn
Should all rewrite to:
http://test.example.com
The web server is Apache. | 2 |
10,996,366 | 06/12/2012 12:09:33 | 1,451,172 | 06/12/2012 12:05:15 | 1 | 0 | "Cannot assign requested address" this error is coming in the SCTP code for me? | I need the solution for this, that how can i resolve this. From existing post I am not able to get the answer.
I know the reason for this error but not able to find a solution for this.
Please help for this to me? | sctp | null | null | null | null | 07/09/2012 19:23:37 | not a real question | "Cannot assign requested address" this error is coming in the SCTP code for me?
===
I need the solution for this, that how can i resolve this. From existing post I am not able to get the answer.
I know the reason for this error but not able to find a solution for this.
Please help for this to me? | 1 |
970,573 | 06/09/2009 14:58:59 | 100,516 | 05/03/2009 22:15:07 | 388 | 46 | Hibernate error: cannot resolve table | I'm trying to make work the example from hibernate reference.
I've got simple table Pupil with id, name and age fields. I've created correct (as I think) java-class for it according to all java-beans rules.
I've created configuration file - hibernate.cfg.xml, jusl like in the example from reference.
I've created hibernate mapping for one class Pupil, and here is the error occured.
<hibernate-mapping>
<class name="Pupil" table="pupils">
...
</class>
</hibernate-mapping>
table="pupils" is red in my IDE and I see message "cannot resolve table pupils". I've also founded very strange note in reference which says that most users fail with the same problem trying to run the example.
Ah.. I'm very angry with this example.. IMO if authors know that there is such problem they should add some information about it.
But, how should I fix it? I don't want to deal with Ant here and with other instruments used in example. I'm using MySql 5.0, but I think it doesn't matter. | hibernate | table | mapping | null | null | null | open | Hibernate error: cannot resolve table
===
I'm trying to make work the example from hibernate reference.
I've got simple table Pupil with id, name and age fields. I've created correct (as I think) java-class for it according to all java-beans rules.
I've created configuration file - hibernate.cfg.xml, jusl like in the example from reference.
I've created hibernate mapping for one class Pupil, and here is the error occured.
<hibernate-mapping>
<class name="Pupil" table="pupils">
...
</class>
</hibernate-mapping>
table="pupils" is red in my IDE and I see message "cannot resolve table pupils". I've also founded very strange note in reference which says that most users fail with the same problem trying to run the example.
Ah.. I'm very angry with this example.. IMO if authors know that there is such problem they should add some information about it.
But, how should I fix it? I don't want to deal with Ant here and with other instruments used in example. I'm using MySql 5.0, but I think it doesn't matter. | 0 |
7,210,111 | 08/26/2011 20:15:23 | 914,756 | 08/26/2011 20:10:38 | 1 | 0 | How to display something other than "$nan" or "$-inf" in a custom calculator? | I am creating an app that calculates 6 input fields. I can't figure out how to make the output say "check data" if the user submits bad information in a field or "Empty Field" if the user left a field blank. Currently, the output will state either "$nan" or "$-inf".
Does anyone have an idea how I would handle this? | xcode | null | null | null | null | 08/27/2011 05:48:53 | not a real question | How to display something other than "$nan" or "$-inf" in a custom calculator?
===
I am creating an app that calculates 6 input fields. I can't figure out how to make the output say "check data" if the user submits bad information in a field or "Empty Field" if the user left a field blank. Currently, the output will state either "$nan" or "$-inf".
Does anyone have an idea how I would handle this? | 1 |
10,823,192 | 05/30/2012 19:46:18 | 598,666 | 02/01/2011 15:53:21 | 3 | 0 | Adding pdf file to existing pdf collection using iTextSharp | I have 4-5 PDFs have that could have 2-3 pages each. I then merge all the pdf together using iTextSharp. So it looks like 1122233444555 (each set of # represents a pdf. The duplicating represents the pages) The whole set is the new PDF.
We have a requirement where after the pdfs have merged, we may need to insert another PDF (2 pages) in between 2 & 3. How would I go about inserting after the last page of 2 and before the first page of 3? So it should now look like 1122266633444555.
We are not storing the # of pages so I don't want to rely on passing in the page numbers. Can I write some hidden file names in each page and use itextsharp to read the hidden information? Then I can say add pdf 666 after the last page of 222. | itextsharp | null | null | null | null | null | open | Adding pdf file to existing pdf collection using iTextSharp
===
I have 4-5 PDFs have that could have 2-3 pages each. I then merge all the pdf together using iTextSharp. So it looks like 1122233444555 (each set of # represents a pdf. The duplicating represents the pages) The whole set is the new PDF.
We have a requirement where after the pdfs have merged, we may need to insert another PDF (2 pages) in between 2 & 3. How would I go about inserting after the last page of 2 and before the first page of 3? So it should now look like 1122266633444555.
We are not storing the # of pages so I don't want to rely on passing in the page numbers. Can I write some hidden file names in each page and use itextsharp to read the hidden information? Then I can say add pdf 666 after the last page of 222. | 0 |
9,569,099 | 03/05/2012 15:20:09 | 692,513 | 04/05/2011 08:48:18 | 54 | 3 | MySQL Condition WHERE | I have an SQL statement that I want to change based on some $_GET variables in the URL. My inital query is:
"SELECT * FROM 'node' WHERE status = 1"
If the user uses my script with a variable appended up such as "http://mysite.com/search.php?id=40"
Then it should look like:
"SELECT * FROM 'node' WHERE status = 1 AND id = 40"
Another example is:
If the user uses my script with a variable appended up such as "http://mysite.com/search.php?id=40&published=yes"
Then it should look like:
"SELECT * FROM 'node' WHERE status = 1 AND id = 40 AND published = yes"
Also, if a GET variable is not included such as http://mysite.com/search.php?published=yes" it should read:
"SELECT * FROM 'node' WHERE status = 1 AND published = yes"
Is there a way of doing this in the PHP code itself to omit and include WHERE clauses based on what is available from the url?
Cheers,
Garry.
| php | mysql | where | null | null | 03/05/2012 17:46:50 | too localized | MySQL Condition WHERE
===
I have an SQL statement that I want to change based on some $_GET variables in the URL. My inital query is:
"SELECT * FROM 'node' WHERE status = 1"
If the user uses my script with a variable appended up such as "http://mysite.com/search.php?id=40"
Then it should look like:
"SELECT * FROM 'node' WHERE status = 1 AND id = 40"
Another example is:
If the user uses my script with a variable appended up such as "http://mysite.com/search.php?id=40&published=yes"
Then it should look like:
"SELECT * FROM 'node' WHERE status = 1 AND id = 40 AND published = yes"
Also, if a GET variable is not included such as http://mysite.com/search.php?published=yes" it should read:
"SELECT * FROM 'node' WHERE status = 1 AND published = yes"
Is there a way of doing this in the PHP code itself to omit and include WHERE clauses based on what is available from the url?
Cheers,
Garry.
| 3 |
10,850,697 | 06/01/2012 12:54:33 | 1,150,923 | 01/15/2012 21:55:01 | 986 | 18 | Django / Python (PEP 8): If I want to name a model class called Property. Should I leave it as Property or Property_? | I know that `property()` is a keyword in Python, but I want to name a model class as `Property`. Something simple like this:
class Property(models.Model):
name = models.CharField(max_length=135)
owner = models.ForeignKey(User, related_name='properties_from_owner')
address_line_one = models.CharField(max_length=135)
address_line_two = models.CharField(max_length=135, blank=True)
city = models.CharField(max_length=135)
state = models.CharField(max_length=135)
zip_code = models.CharField(max_length=135)
Should I call the class `Property` or `Property_`? Now I know Python is case-sensitive, but the reason I ask is because in Django the `Property` model class is identified as `myapp.property`.
In other models that relates to `Property` I added a `_` to the fields like this
class UserProfile(models.Model):
user = models.OneToOneField(User, related_name='userprofile_from_user')
property_ = models.ForeignKey(Property, related_name='userprofiles_from_property')
| python | django | django-models | pep8 | null | 06/04/2012 16:41:27 | not constructive | Django / Python (PEP 8): If I want to name a model class called Property. Should I leave it as Property or Property_?
===
I know that `property()` is a keyword in Python, but I want to name a model class as `Property`. Something simple like this:
class Property(models.Model):
name = models.CharField(max_length=135)
owner = models.ForeignKey(User, related_name='properties_from_owner')
address_line_one = models.CharField(max_length=135)
address_line_two = models.CharField(max_length=135, blank=True)
city = models.CharField(max_length=135)
state = models.CharField(max_length=135)
zip_code = models.CharField(max_length=135)
Should I call the class `Property` or `Property_`? Now I know Python is case-sensitive, but the reason I ask is because in Django the `Property` model class is identified as `myapp.property`.
In other models that relates to `Property` I added a `_` to the fields like this
class UserProfile(models.Model):
user = models.OneToOneField(User, related_name='userprofile_from_user')
property_ = models.ForeignKey(Property, related_name='userprofiles_from_property')
| 4 |
7,417,211 | 09/14/2011 13:35:23 | 884,002 | 08/08/2011 11:54:41 | 1 | 0 | Zedgraph export to Excel | Has anyone exported a zedgraph image into excel?
Sample code most welcome
Thanks | c# | excel | zedgraph | null | null | 09/15/2011 09:19:08 | not a real question | Zedgraph export to Excel
===
Has anyone exported a zedgraph image into excel?
Sample code most welcome
Thanks | 1 |
10,483,637 | 05/07/2012 14:12:41 | 732,362 | 04/30/2011 12:03:05 | 25 | 0 | Jar dependency management in Kettle | Is there a way to specify dependent jars in Kettle while calling a jar file? or do i have to include all dependent jars with jar being called by kettle?
Thanks! | dependencies | executable-jar | kettle | null | null | null | open | Jar dependency management in Kettle
===
Is there a way to specify dependent jars in Kettle while calling a jar file? or do i have to include all dependent jars with jar being called by kettle?
Thanks! | 0 |
8,684,578 | 12/30/2011 22:15:33 | 291,024 | 03/10/2010 22:53:44 | 581 | 39 | Obtain address of first element of an array stored as an object | I need to obtain the memory address of the first element of an array of arbitrary type, which is stored as a type of Object. For instance the array could be a double[] or an int[], but in the code it will be typed as an Object.
While it is straightforward to obtain the address of an array of known type, obtaining an address of an object is not allowed in C#. Is there a type (other than Object) that I could use to store such an array and whose memory address can be more easily obtained? Or is there a way to use Interop/Reflection to access the address directly without need for an intermediate data copy?
Notice in the second line below that a double[] is stored as an object. And notice in the fixed() line that I am trying to obtain the address of o, which is not allowed in C#.
Thanks in advance!
int len=100;
object o = new double [len];
unsafe
{
fixed(int*ptr=&o)
for (int index = 0; index < len; index++)
{
// access data directly to copy it, etc...
}
} | c# | .net | reflection | managed | unsafe | null | open | Obtain address of first element of an array stored as an object
===
I need to obtain the memory address of the first element of an array of arbitrary type, which is stored as a type of Object. For instance the array could be a double[] or an int[], but in the code it will be typed as an Object.
While it is straightforward to obtain the address of an array of known type, obtaining an address of an object is not allowed in C#. Is there a type (other than Object) that I could use to store such an array and whose memory address can be more easily obtained? Or is there a way to use Interop/Reflection to access the address directly without need for an intermediate data copy?
Notice in the second line below that a double[] is stored as an object. And notice in the fixed() line that I am trying to obtain the address of o, which is not allowed in C#.
Thanks in advance!
int len=100;
object o = new double [len];
unsafe
{
fixed(int*ptr=&o)
for (int index = 0; index < len; index++)
{
// access data directly to copy it, etc...
}
} | 0 |
468,817 | 01/22/2009 11:46:23 | 2,983 | 08/26/2008 10:09:24 | 64 | 7 | Has anyone done a survey on open source programmers? | I've tried to research this through searching, but got nowhere. Has anyone done a survey of open source programmers to answer questions such as:
- Do you do this as part of your job?
- If so, how much of your job is it?
- If you do it in your spare time, how
much time do you spend on it?
- Are you a student?
- What motivates you?
I'm amazed at how many lines of open source code have been written, and I wonder where it all comes from.
I'm not wanting to do such a survey myself, it's only curiosity, not something I need to find out.
| open-source | survey | null | null | null | 05/23/2011 13:18:25 | off topic | Has anyone done a survey on open source programmers?
===
I've tried to research this through searching, but got nowhere. Has anyone done a survey of open source programmers to answer questions such as:
- Do you do this as part of your job?
- If so, how much of your job is it?
- If you do it in your spare time, how
much time do you spend on it?
- Are you a student?
- What motivates you?
I'm amazed at how many lines of open source code have been written, and I wonder where it all comes from.
I'm not wanting to do such a survey myself, it's only curiosity, not something I need to find out.
| 2 |
5,852,895 | 05/02/2011 02:03:55 | 176,855 | 09/21/2009 23:30:14 | 11 | 0 | Can you or How can you make custom functions MongoDB like db.mydbname.customFunction()? | I'd like to know if you could write custom functions in MongoDB similar to a stored procedure for queries? | sql | nosql | mongodb | null | null | null | open | Can you or How can you make custom functions MongoDB like db.mydbname.customFunction()?
===
I'd like to know if you could write custom functions in MongoDB similar to a stored procedure for queries? | 0 |
6,039,468 | 05/18/2011 03:09:52 | 512,994 | 11/19/2010 02:29:18 | 260 | 10 | NetBeans webservice client stubs - incompatible type? | I generated my client side stubs for a NetBeans webservice.
The webservice implementation uses a local POJO from my project. The generated stubs have created a revision of this POJO for use. When I'm using the service, I want to use the original POJO, not the generated type..? Type casting doesn't work.
i.e. (note the packages)
package adiib.ws.harmoniser;
@WebMethod(operationName = "getStartupLogMessages")
public ArrayList<LogMessage> getStartupLogMessages() {
return startupLogMessages;
}
The POJO _LogMessage_ reads:
package adiib.shared;
public class LogMessage implements Serializable
{
private static final long serialVersionUID = 8379681391654158512L;
private String exceptionMessage;
private String customMessage;
private String stackTrace;
private LogMessageEnum classification;
private String effectiveTime;
private String exceptionClassName;
private String throwerClassName;
public LogMessage(){}
public LogMessage(String exceptionMessage, String customMessage,
String stackTrace, LogMessageEnum classification, String effectiveTime,
String exceptionClassName, String throwerClassName)
{
this.exceptionMessage = exceptionMessage;
this.customMessage = customMessage;
this.stackTrace = stackTrace;
this.classification = classification;
this.effectiveTime = effectiveTime;
this.exceptionClassName = exceptionClassName;
this.throwerClassName = throwerClassName;
}
public String getCustomMessage() {
return customMessage;
}
public void setCustomMessage(String customMessage) {
this.customMessage = customMessage;
}
public String getExceptionMessage() {
return exceptionMessage;
}
public void setExceptionMessage(String exceptionMessage) {
this.exceptionMessage = exceptionMessage;
}
public LogMessageEnum getClassification() {
return classification;
}
public void setClassification(LogMessageEnum classification) {
this.classification = classification;
}
public String getEffectiveTime() {
return effectiveTime;
}
public void setEffectiveTime(String effectiveTime) {
this.effectiveTime = effectiveTime;
}
public String getStackTrace() {
return stackTrace;
}
public void setStackTrace(String stackTrace) {
this.stackTrace = stackTrace;
}
public String getExceptionClassName() {
return exceptionClassName;
}
public void setExceptionClassName(String exceptionClassName) {
this.exceptionClassName = exceptionClassName;
}
public String getThrowerClassName() {
return throwerClassName;
}
public void setThrowerClassName(String throwerClassName) {
this.throwerClassName = throwerClassName;
}
}
Now, on the client side when I'm trying to use the webservice method like so:
package adiib.server;
private void getStartupLogMessages() {
private static List<LogMessage> logMessages = new ArrayList<LogMessage>();
dsto.adiib.ws.client.harmoniser.AdiibHarmoniser_Service service = new dsto.adiib.ws.client.harmoniser.AdiibHarmoniser_Service();
dsto.adiib.ws.client.harmoniser.AdiibHarmoniser port = service.getAdiibHarmoniserPort();
List<dsto.adiib.ws.client.harmoniser.LogMessage> startupLogMessages = port.getStartupLogMessages();
for (adiib.ws.client.harmoniser.LogMessage logMessage : startupLogMessages) {
/*
* this fails becuase it's looking for adiib.ws.client.harmoniser.LogMessage
* not adiib.shared.LogMessage; adiib.ws.client.harmoniser.LogMessage is the
* generated type..
*/
logMessages.add((LogMessage) logMessage);
}
}
Any ideas? All I can think is creating a conversion method.. that seems wrong.
WulfgarPro | java | web-services | jax-ws | null | null | null | open | NetBeans webservice client stubs - incompatible type?
===
I generated my client side stubs for a NetBeans webservice.
The webservice implementation uses a local POJO from my project. The generated stubs have created a revision of this POJO for use. When I'm using the service, I want to use the original POJO, not the generated type..? Type casting doesn't work.
i.e. (note the packages)
package adiib.ws.harmoniser;
@WebMethod(operationName = "getStartupLogMessages")
public ArrayList<LogMessage> getStartupLogMessages() {
return startupLogMessages;
}
The POJO _LogMessage_ reads:
package adiib.shared;
public class LogMessage implements Serializable
{
private static final long serialVersionUID = 8379681391654158512L;
private String exceptionMessage;
private String customMessage;
private String stackTrace;
private LogMessageEnum classification;
private String effectiveTime;
private String exceptionClassName;
private String throwerClassName;
public LogMessage(){}
public LogMessage(String exceptionMessage, String customMessage,
String stackTrace, LogMessageEnum classification, String effectiveTime,
String exceptionClassName, String throwerClassName)
{
this.exceptionMessage = exceptionMessage;
this.customMessage = customMessage;
this.stackTrace = stackTrace;
this.classification = classification;
this.effectiveTime = effectiveTime;
this.exceptionClassName = exceptionClassName;
this.throwerClassName = throwerClassName;
}
public String getCustomMessage() {
return customMessage;
}
public void setCustomMessage(String customMessage) {
this.customMessage = customMessage;
}
public String getExceptionMessage() {
return exceptionMessage;
}
public void setExceptionMessage(String exceptionMessage) {
this.exceptionMessage = exceptionMessage;
}
public LogMessageEnum getClassification() {
return classification;
}
public void setClassification(LogMessageEnum classification) {
this.classification = classification;
}
public String getEffectiveTime() {
return effectiveTime;
}
public void setEffectiveTime(String effectiveTime) {
this.effectiveTime = effectiveTime;
}
public String getStackTrace() {
return stackTrace;
}
public void setStackTrace(String stackTrace) {
this.stackTrace = stackTrace;
}
public String getExceptionClassName() {
return exceptionClassName;
}
public void setExceptionClassName(String exceptionClassName) {
this.exceptionClassName = exceptionClassName;
}
public String getThrowerClassName() {
return throwerClassName;
}
public void setThrowerClassName(String throwerClassName) {
this.throwerClassName = throwerClassName;
}
}
Now, on the client side when I'm trying to use the webservice method like so:
package adiib.server;
private void getStartupLogMessages() {
private static List<LogMessage> logMessages = new ArrayList<LogMessage>();
dsto.adiib.ws.client.harmoniser.AdiibHarmoniser_Service service = new dsto.adiib.ws.client.harmoniser.AdiibHarmoniser_Service();
dsto.adiib.ws.client.harmoniser.AdiibHarmoniser port = service.getAdiibHarmoniserPort();
List<dsto.adiib.ws.client.harmoniser.LogMessage> startupLogMessages = port.getStartupLogMessages();
for (adiib.ws.client.harmoniser.LogMessage logMessage : startupLogMessages) {
/*
* this fails becuase it's looking for adiib.ws.client.harmoniser.LogMessage
* not adiib.shared.LogMessage; adiib.ws.client.harmoniser.LogMessage is the
* generated type..
*/
logMessages.add((LogMessage) logMessage);
}
}
Any ideas? All I can think is creating a conversion method.. that seems wrong.
WulfgarPro | 0 |
11,236,231 | 06/27/2012 23:35:29 | 1,143,024 | 01/11/2012 11:08:00 | 64 | 1 | MasterViewController Splitview Popover | i have a masterview controller which is apart of a splitview and has a array of alloc/inited view controllers. When didselectrowatindex i push it with self.detailedView.navigation push. So my problem is when i push to those views i try to set the left baritem in viewdidload and wire that up to a (Ibaction)PopPressed which makes a instance of masterviewcontroller and use self.pop = [[UIPopoverController alloc] initWithContentViewController:mvc]; [self.pop presentPopoverFromRect:CGRectMake(0,0,-100,-100) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
So with that i can get the popover view controller to display but when i click on the cell the function gets called but it doesn't push again.
//Assigned to left button to make Masterview display again
- (IBAction)PopPressed:(id)sender {
if (self.pop) {
[self.pop dismissPopoverAnimated:YES];
}
if(self.masterPopoverController)
{
[self.masterPopoverController dismissPopoverAnimated:YES];
}
MasterViewController *mvc = [[MasterViewController alloc]init];
self.pop = [[UIPopoverController alloc] initWithContentViewController:mvc];
[self.pop presentPopoverFromRect:CGRectMake(0,0,-100,-100) inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
//how I'm pushing the views form master
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"this got called %i", indexPath.row);
[self.detailViewController.navigationController pushViewController:[_objects objectAtIndex:indexPath.row] animated:YES];
} | ios5 | uisplitviewcontroller | tableview | uipopovercontroller | null | null | open | MasterViewController Splitview Popover
===
i have a masterview controller which is apart of a splitview and has a array of alloc/inited view controllers. When didselectrowatindex i push it with self.detailedView.navigation push. So my problem is when i push to those views i try to set the left baritem in viewdidload and wire that up to a (Ibaction)PopPressed which makes a instance of masterviewcontroller and use self.pop = [[UIPopoverController alloc] initWithContentViewController:mvc]; [self.pop presentPopoverFromRect:CGRectMake(0,0,-100,-100) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
So with that i can get the popover view controller to display but when i click on the cell the function gets called but it doesn't push again.
//Assigned to left button to make Masterview display again
- (IBAction)PopPressed:(id)sender {
if (self.pop) {
[self.pop dismissPopoverAnimated:YES];
}
if(self.masterPopoverController)
{
[self.masterPopoverController dismissPopoverAnimated:YES];
}
MasterViewController *mvc = [[MasterViewController alloc]init];
self.pop = [[UIPopoverController alloc] initWithContentViewController:mvc];
[self.pop presentPopoverFromRect:CGRectMake(0,0,-100,-100) inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
//how I'm pushing the views form master
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"this got called %i", indexPath.row);
[self.detailViewController.navigationController pushViewController:[_objects objectAtIndex:indexPath.row] animated:YES];
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.