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
2,717
08/05/2008 19:11:57
342
08/04/2008 19:59:52
61
10
Organizing Documents
I’ve got a lot of PDFs/CHMs and they are getting out of control. So I’ve decided to do something about it. First I hit Google and didn’t get very far - the range of programs are very naff. Then I hit [metafilter][1] and got a lot more results. From there I learnt there is a lot of programs that do exactly what I want, look stylish and some are even free, but unfortunately they are all written for the Mac, except one that doesn’t do what I want (it does it all online I want it offline). All I want is a program that you can point at a directory and that will plow through them and list your documents. It can make guesses at content by keyword and the list the abstract (if it has one of course) and allow me to tag it. For instance, does the PDF book [Pragmatic Unit Testing in C#][2] belong in Unit Testing folder, the C# folder or the Pragmatic Bookshelf folder? It doesn’t it belongs in all three. Apparently iTunes does what I want it to, but I don’t want to install a music program to organize my PDF’s - it doesn’t seem right… Your suggestions? [1]: http://www.metafilter.com/ [2]: http://www.pragprog.com/titles/utc2/pragmatic-unit-testing-in-c-with-nunit-2nd-ed
pdf
organizing
chm
null
null
08/21/2011 07:49:28
off topic
Organizing Documents === I’ve got a lot of PDFs/CHMs and they are getting out of control. So I’ve decided to do something about it. First I hit Google and didn’t get very far - the range of programs are very naff. Then I hit [metafilter][1] and got a lot more results. From there I learnt there is a lot of programs that do exactly what I want, look stylish and some are even free, but unfortunately they are all written for the Mac, except one that doesn’t do what I want (it does it all online I want it offline). All I want is a program that you can point at a directory and that will plow through them and list your documents. It can make guesses at content by keyword and the list the abstract (if it has one of course) and allow me to tag it. For instance, does the PDF book [Pragmatic Unit Testing in C#][2] belong in Unit Testing folder, the C# folder or the Pragmatic Bookshelf folder? It doesn’t it belongs in all three. Apparently iTunes does what I want it to, but I don’t want to install a music program to organize my PDF’s - it doesn’t seem right… Your suggestions? [1]: http://www.metafilter.com/ [2]: http://www.pragprog.com/titles/utc2/pragmatic-unit-testing-in-c-with-nunit-2nd-ed
2
9,856,476
03/24/2012 23:07:10
1,290,607
03/24/2012 23:00:09
1
0
Diffrent file for diffrent user
I'm new in here so if I make any mistakes in not saying something that I should.Just tell me and I'll tell ya everything. So.Back to my question.I am trying to make a forum. I already have setted the login and register for it but my problem now is: -Don't have a single idea on how to create a different file for every different subject(thread) that users are going to create.My first look was at the fopen() function...But You can't add html and php when writing in the file fwrite()...Or could you? So I'm sure it can be done but I really don't know how to do it.I have in mind what kind of database I should create for a threads and what kind of database I should create for comments and how to join them together.(Something like: This thread has been created by: ). But don't have an idea on how to create a different file for every subject.Any Ideas would be apreciated. Ty for reading and if you require any different details I would gladly give them to you.Thank you again!
php
mysql
null
null
null
03/25/2012 19:00:27
not constructive
Diffrent file for diffrent user === I'm new in here so if I make any mistakes in not saying something that I should.Just tell me and I'll tell ya everything. So.Back to my question.I am trying to make a forum. I already have setted the login and register for it but my problem now is: -Don't have a single idea on how to create a different file for every different subject(thread) that users are going to create.My first look was at the fopen() function...But You can't add html and php when writing in the file fwrite()...Or could you? So I'm sure it can be done but I really don't know how to do it.I have in mind what kind of database I should create for a threads and what kind of database I should create for comments and how to join them together.(Something like: This thread has been created by: ). But don't have an idea on how to create a different file for every subject.Any Ideas would be apreciated. Ty for reading and if you require any different details I would gladly give them to you.Thank you again!
4
3,722,742
09/15/2010 23:55:36
448,941
09/15/2010 22:48:17
6
0
What websites present artwork well?
I'm a painter who's building a website portfolio/print shop. I was wondering if anyone had seen some exceptionally good layout design in presenting a variety of paintings. My go-to resource so far has been the MOMA, but they are a little cluttered for my taste. Googling it has resulted in some seriously hideous and chaotic design, and surprisingly Smashingmag doesn't really have any useful articles. Input on what you like to see in an online gallery would be incredibly appreciated. Cheers! *Edit*: [Here's what I have so far, if that's useful to anyone.](http://wednesdaywolf.com) It's mostly CSS with Galleria.
html
image
null
null
null
09/15/2010 23:58:30
off topic
What websites present artwork well? === I'm a painter who's building a website portfolio/print shop. I was wondering if anyone had seen some exceptionally good layout design in presenting a variety of paintings. My go-to resource so far has been the MOMA, but they are a little cluttered for my taste. Googling it has resulted in some seriously hideous and chaotic design, and surprisingly Smashingmag doesn't really have any useful articles. Input on what you like to see in an online gallery would be incredibly appreciated. Cheers! *Edit*: [Here's what I have so far, if that's useful to anyone.](http://wednesdaywolf.com) It's mostly CSS with Galleria.
2
2,890,155
05/22/2010 23:31:52
339,654
05/12/2010 19:21:25
11
0
VB.net Simple IRC Client
How would I go about making a simple IRC client with these things What I am using: Nickname TextBox Connect Button Message TextBox Send Message Button Refresh Button ListBox Restrictions: No commands at all just being able to send messages I am using a listbox for recieving messages
.net
vb.net
client
irc
null
null
open
VB.net Simple IRC Client === How would I go about making a simple IRC client with these things What I am using: Nickname TextBox Connect Button Message TextBox Send Message Button Refresh Button ListBox Restrictions: No commands at all just being able to send messages I am using a listbox for recieving messages
0
5,356,567
03/18/2011 18:55:41
666,561
03/18/2011 18:55:41
1
0
Regular Expression in C#
Using regular expression what would be the best way to find an unknown pattern in a string? Is this even possible using Regex, I would just like a bit of guidance.
c#
regex
null
null
null
03/18/2011 23:51:00
not a real question
Regular Expression in C# === Using regular expression what would be the best way to find an unknown pattern in a string? Is this even possible using Regex, I would just like a bit of guidance.
1
11,544,812
07/18/2012 15:23:18
934,988
09/08/2011 14:12:32
104
0
Bug in VarToDateAsString
Delphi has next function: function VarToDateAsString(const V: TVarData): TDateTime; .... LResult := VarDateFromStr(S, VAR_LOCALE_USER_DEFAULT, 0, Result); it will be VarDateFromStr('07;12;18', VAR_LOCALE_USER_DEFAULT, 0, Result); then Result will be equal Result = '07;18;12' **How cat It fix if possible ?**
delphi
datetime
variants
null
null
07/19/2012 01:17:03
not a real question
Bug in VarToDateAsString === Delphi has next function: function VarToDateAsString(const V: TVarData): TDateTime; .... LResult := VarDateFromStr(S, VAR_LOCALE_USER_DEFAULT, 0, Result); it will be VarDateFromStr('07;12;18', VAR_LOCALE_USER_DEFAULT, 0, Result); then Result will be equal Result = '07;18;12' **How cat It fix if possible ?**
1
5,564,099
04/06/2011 09:20:59
694,501
04/06/2011 09:06:18
1
0
PHP write in file
I want to write something in a textfile. $myFile = "meinung.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "Floppy Jalopy\n"; fwrite($fh, $stringData); $stringData = "Pointy Pinto\n"; fwrite($fh, $stringData); fclose($fh); when i want to execute this, it says "cant open file" what did i make wrong?
php
null
null
null
null
null
open
PHP write in file === I want to write something in a textfile. $myFile = "meinung.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "Floppy Jalopy\n"; fwrite($fh, $stringData); $stringData = "Pointy Pinto\n"; fwrite($fh, $stringData); fclose($fh); when i want to execute this, it says "cant open file" what did i make wrong?
0
9,371,153
02/21/2012 02:06:14
1,159,828
01/20/2012 02:15:58
4
0
Trying to set this html iframe at a certain place on my page?
Im trying to set this html i-frame at a certain place on my page in the body but I can't figure out what code to use or how? <div style="overflow: hidden; width: 333px; height: 156px; position src="h: relative;" id="i_div"><iframe name="i_frame"http://url.com/click.php?aff=2057&amp;camp=2056&amp;crt=6077&amp" style="border: 0pt none ; left: -585px; top: -273px; positionabsolute; width: 1024px; height: 576px;" scrolling="no"></iframe></div>
html
css
null
null
null
02/21/2012 04:33:27
not a real question
Trying to set this html iframe at a certain place on my page? === Im trying to set this html i-frame at a certain place on my page in the body but I can't figure out what code to use or how? <div style="overflow: hidden; width: 333px; height: 156px; position src="h: relative;" id="i_div"><iframe name="i_frame"http://url.com/click.php?aff=2057&amp;camp=2056&amp;crt=6077&amp" style="border: 0pt none ; left: -585px; top: -273px; positionabsolute; width: 1024px; height: 576px;" scrolling="no"></iframe></div>
1
8,775,292
01/08/2012 04:03:18
1,136,700
01/08/2012 04:02:19
1
0
Will Readlock and Writelock cause startvation for writer?
In solving reader write problem, I try to use ReentrantReadWriteLock. I know that all readers can acquire the readlock at the same time, however, writelock has to be wait for all readlock be release. will this cause the writer to in the starvation state if we have a lot of readers?
java
null
null
null
null
null
open
Will Readlock and Writelock cause startvation for writer? === In solving reader write problem, I try to use ReentrantReadWriteLock. I know that all readers can acquire the readlock at the same time, however, writelock has to be wait for all readlock be release. will this cause the writer to in the starvation state if we have a lot of readers?
0
11,400,396
07/09/2012 17:52:48
1,125,403
01/01/2012 20:56:09
1
0
Rails and Devise, how to inherit method registrations#update for use json callback?
I create fullajax app, and i need to change user settings with json callback. I tried to use this [solution][1] (with RegistrationsController#update), but it doesn't work. [1]: http://stackoverflow.com/questions/5973327/using-devise-1-3-to-authenticate-json-login-requests/8402035#8402035
ruby-on-rails
ruby
devise
null
null
07/10/2012 01:51:48
not a real question
Rails and Devise, how to inherit method registrations#update for use json callback? === I create fullajax app, and i need to change user settings with json callback. I tried to use this [solution][1] (with RegistrationsController#update), but it doesn't work. [1]: http://stackoverflow.com/questions/5973327/using-devise-1-3-to-authenticate-json-login-requests/8402035#8402035
1
9,948,526
03/30/2012 18:28:00
1,303,218
03/30/2012 12:17:46
3
0
C++ Search for all substings between "+" and "n" characters
I'm trying to change some equations from input file to a "readable" form. Currently I need to read all numerical values (as substrings, will convert them to int later) within a string P. All the values I'm interested with are between "+" and "n" characters (in this order for one loop, and the inverted order for other loop). I need a loop which finds all of them and save them to array (of unknown size, since I don't know how long the string P will be). Input examples (strings P in quotes): 1. "+n2+-n" First loop (reads from + to n) so substrings C are: "", "-" The second loop (reads from n to +) so substrings E are: "2", "" 2."+2n3+3n2+n" First loop: "2", "3", "" Second loop: "3", "2", "" 3."+-n14+-11n+1" First loop: "-", "-11" Second loop: "14", "" I could add "+" to the end of the P string if solution requires. ps. If someone's have an idea how to extract a constant from the end of string seen in example 3 (+1, or any other) I would really appreciate. The hard thing is I cannot tell how long it'll be (can by +1 can be -300000 or so). Please post some C++ code examples of the solution.
c++
reading
substrings
null
null
07/11/2012 19:29:19
not a real question
C++ Search for all substings between "+" and "n" characters === I'm trying to change some equations from input file to a "readable" form. Currently I need to read all numerical values (as substrings, will convert them to int later) within a string P. All the values I'm interested with are between "+" and "n" characters (in this order for one loop, and the inverted order for other loop). I need a loop which finds all of them and save them to array (of unknown size, since I don't know how long the string P will be). Input examples (strings P in quotes): 1. "+n2+-n" First loop (reads from + to n) so substrings C are: "", "-" The second loop (reads from n to +) so substrings E are: "2", "" 2."+2n3+3n2+n" First loop: "2", "3", "" Second loop: "3", "2", "" 3."+-n14+-11n+1" First loop: "-", "-11" Second loop: "14", "" I could add "+" to the end of the P string if solution requires. ps. If someone's have an idea how to extract a constant from the end of string seen in example 3 (+1, or any other) I would really appreciate. The hard thing is I cannot tell how long it'll be (can by +1 can be -300000 or so). Please post some C++ code examples of the solution.
1
7,360,770
09/09/2011 11:11:02
676,757
03/25/2011 13:07:31
31
1
Failed to insert a row
What is wrong with following code? Without smiley function it works and with **$tz = smiley($this->text);** doesn't. I tried to put to display the errors but .. mhmm doesn't works.. 0 errors ini_set('display_errors',1); error_reporting(E_ALL); <?php class ChatLine extends ChatBase { protected $text = '', $author = '', $gravatar = ''; public function save() { $tz = smiley($this->text); DB::query(" INSERT INTO webchat_lines (author, gravatar, text) VALUES ( '".DB::esc($this->author)."', '".DB::esc($this->gravatar)."', '".$tz."' )"); // Returns the MySQLi object of the DB class return DB::getMySQLiObject(); } public function smiley($text) { $privatesmilies = array( ":)" => "smile1.gif", ";)" => "wink.gif" ); reset($privatesmilies); while (list($code, $url) = each($privatesmilies)) $text = str_replace($code, "<img src=http://127.0.0.1/chat/img/$url align=absmiddle/>", $text); return $text; } } ?>
php
mysql
insert
null
null
09/09/2011 11:35:37
not a real question
Failed to insert a row === What is wrong with following code? Without smiley function it works and with **$tz = smiley($this->text);** doesn't. I tried to put to display the errors but .. mhmm doesn't works.. 0 errors ini_set('display_errors',1); error_reporting(E_ALL); <?php class ChatLine extends ChatBase { protected $text = '', $author = '', $gravatar = ''; public function save() { $tz = smiley($this->text); DB::query(" INSERT INTO webchat_lines (author, gravatar, text) VALUES ( '".DB::esc($this->author)."', '".DB::esc($this->gravatar)."', '".$tz."' )"); // Returns the MySQLi object of the DB class return DB::getMySQLiObject(); } public function smiley($text) { $privatesmilies = array( ":)" => "smile1.gif", ";)" => "wink.gif" ); reset($privatesmilies); while (list($code, $url) = each($privatesmilies)) $text = str_replace($code, "<img src=http://127.0.0.1/chat/img/$url align=absmiddle/>", $text); return $text; } } ?>
1
4,458,408
12/16/2010 07:34:11
192,344
10/19/2009 10:06:50
54
2
how to use php call limux GPG encript file with a passphase
I have a task which need to use gpg to encript the upload file in php my code is ("echo '1234' | gpg --passphrase-fd 0 -c /path/aaa.jpg "); it works by paste the code in linux but not work by php any solution
php
gpg
null
null
null
null
open
how to use php call limux GPG encript file with a passphase === I have a task which need to use gpg to encript the upload file in php my code is ("echo '1234' | gpg --passphrase-fd 0 -c /path/aaa.jpg "); it works by paste the code in linux but not work by php any solution
0
4,109,056
11/05/2010 18:47:57
494,523
11/02/2010 09:09:35
44
0
C# UdpClient server and client issue.
**This is my server code** byte[] data = new byte[1024]; IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 9050); UdpClient newsock = new UdpClient(ipep); Console.WriteLine("Waiting for a client..."); IPEndPoint send = new IPEndPoint(IPAddress.Any, 0); byte[] data1 = newsock.Receive(ref send); int test1 = BitConverter.ToInt32(data1, 0); Console.WriteLine("test1 = {0}", test1); **This is my client code** byte[] data = new byte[1024]; string stringData; UdpClient server = new UdpClient("127.0.0.1", 9050); IPEndPoint send = new IPEndPoint(IPAddress.Any, 0); int test1 = 45; byte[] data1 = BitConverter.GetBytes(test1); server.Send(data1, data1.Length); According to my client and server, The client is the one sending data to server. But my requirement is other way around! and im unable to do that.. When i try adding this code to the server byte[] buffer = ASCIIEncoding.ASCII.GetBytes("Hello Client"); newsock.Send(buffer, buffer.Length); I get an Exception as `The operation is not allowed on non-connected sockets.` Can some one help me?
c#
sockets
networking
udp
udpclient
null
open
C# UdpClient server and client issue. === **This is my server code** byte[] data = new byte[1024]; IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 9050); UdpClient newsock = new UdpClient(ipep); Console.WriteLine("Waiting for a client..."); IPEndPoint send = new IPEndPoint(IPAddress.Any, 0); byte[] data1 = newsock.Receive(ref send); int test1 = BitConverter.ToInt32(data1, 0); Console.WriteLine("test1 = {0}", test1); **This is my client code** byte[] data = new byte[1024]; string stringData; UdpClient server = new UdpClient("127.0.0.1", 9050); IPEndPoint send = new IPEndPoint(IPAddress.Any, 0); int test1 = 45; byte[] data1 = BitConverter.GetBytes(test1); server.Send(data1, data1.Length); According to my client and server, The client is the one sending data to server. But my requirement is other way around! and im unable to do that.. When i try adding this code to the server byte[] buffer = ASCIIEncoding.ASCII.GetBytes("Hello Client"); newsock.Send(buffer, buffer.Length); I get an Exception as `The operation is not allowed on non-connected sockets.` Can some one help me?
0
1,943,276
12/21/2009 23:22:20
3,788
08/30/2008 19:55:42
2,096
106
What does the '&' operator do in C++?
n00b question. I am a C guy and I'm trying to understand some C++ code. I have the following function declaration: int foo(const string &myname) { cout << "called foo for: " << myname << endl; return 0; } How does the function signature differ from the equivalent C: int foo(const char *myname) Is there a difference between using `string *myname` vs `string &myname`? What is the difference between `&` in C++ and `*` in C to indicate pointers? Similarly: const string &GetMethodName() { ... } What is the `&` doing here? Is there some website that explains how `&` is used differently in C vs C++?
c++
ampersand
operator
null
null
null
open
What does the '&' operator do in C++? === n00b question. I am a C guy and I'm trying to understand some C++ code. I have the following function declaration: int foo(const string &myname) { cout << "called foo for: " << myname << endl; return 0; } How does the function signature differ from the equivalent C: int foo(const char *myname) Is there a difference between using `string *myname` vs `string &myname`? What is the difference between `&` in C++ and `*` in C to indicate pointers? Similarly: const string &GetMethodName() { ... } What is the `&` doing here? Is there some website that explains how `&` is used differently in C vs C++?
0
6,375,332
06/16/2011 16:30:04
801,923
06/16/2011 16:30:04
1
0
ASP.NET Partial Postback form value problem
In my page_load I am creating a HiddenField newField= new HiddenField(); and then I am assigning newField.ID = "someid" and Value="0" to it. on a partial postback (triggered by an UpdatePanel) i am then checking Request.Form["someid"] in the panel_Load event during the postback. but the request returns null as someid wasn't posted back. (not contained in the Request.Form collection) Why could this be? Thanks
javascript
asp.net
updatepanel
postback
null
null
open
ASP.NET Partial Postback form value problem === In my page_load I am creating a HiddenField newField= new HiddenField(); and then I am assigning newField.ID = "someid" and Value="0" to it. on a partial postback (triggered by an UpdatePanel) i am then checking Request.Form["someid"] in the panel_Load event during the postback. but the request returns null as someid wasn't posted back. (not contained in the Request.Form collection) Why could this be? Thanks
0
1,597,451
10/20/2009 21:32:25
193,411
10/20/2009 21:32:25
1
0
Unhandled exception logging facility for non-ASP apps? (ELMAH for console apps)
Is there a facility similar to ELMAH but for non-ASP applications? One that will handle all unhandled exceptions and write them to multiple sources? Or is there some way to easily capture all unhandled exceptions, similar to Application_Error in an ASP.NET Global.asax.cs file? If that can be done, I can then just use NLog or similar to log them. Was just hopeful a framework similar to ELMAH existed.
logging
c#
exception-handling
null
null
null
open
Unhandled exception logging facility for non-ASP apps? (ELMAH for console apps) === Is there a facility similar to ELMAH but for non-ASP applications? One that will handle all unhandled exceptions and write them to multiple sources? Or is there some way to easily capture all unhandled exceptions, similar to Application_Error in an ASP.NET Global.asax.cs file? If that can be done, I can then just use NLog or similar to log them. Was just hopeful a framework similar to ELMAH existed.
0
10,887,358
06/04/2012 19:47:26
1,382,907
05/08/2012 18:56:26
1
0
How to change color of focus rectangle of items in QTreeView?
Is it possible to easily change color of dotted focus rectangle for items (rows consisting of multiple QStandardItems) in QTreeView ? In stylesheet **QTreeView::item:focus** does not work and I can't reimplement **paint** function in custom **QItemDelegate** since it overrides my stylesheet settings. Thanks in advance
qt
qt4
null
null
null
null
open
How to change color of focus rectangle of items in QTreeView? === Is it possible to easily change color of dotted focus rectangle for items (rows consisting of multiple QStandardItems) in QTreeView ? In stylesheet **QTreeView::item:focus** does not work and I can't reimplement **paint** function in custom **QItemDelegate** since it overrides my stylesheet settings. Thanks in advance
0
10,850,315
06/01/2012 12:31:16
662,819
03/16/2011 15:52:26
268
9
Squid: forward to proxy
Hi I'm trying to setup squid to redirect all incomming requests through a remote proxy with authentication. I found this: http://oss.org.cn/man/newsoft/squid/Squid_FAQ/FAQ-4.html#ss4.9 My problem however is, that I need to have multiple forwards running. In other words: When a request arrives from localhost:8081 it should be forwarded to remote proxy on port 8081 with user:pass and When a request arrives from localhost:8083 it should be forwarded to remote proxy on port 8083 with user:pass Can someone help me with a .conf snippet?
proxy
squid
null
null
null
06/04/2012 14:05:53
off topic
Squid: forward to proxy === Hi I'm trying to setup squid to redirect all incomming requests through a remote proxy with authentication. I found this: http://oss.org.cn/man/newsoft/squid/Squid_FAQ/FAQ-4.html#ss4.9 My problem however is, that I need to have multiple forwards running. In other words: When a request arrives from localhost:8081 it should be forwarded to remote proxy on port 8081 with user:pass and When a request arrives from localhost:8083 it should be forwarded to remote proxy on port 8083 with user:pass Can someone help me with a .conf snippet?
2
778,104
04/22/2009 16:25:32
54,922
01/14/2009 08:41:08
21
3
C# Windows Service throws an exception when trying to call a COM library.
I'm writing an application that uses a COM library. I have a class library that wraps the calls to the COM library and adds some more functionality. Eventually this will run as a Windows Service. For now I test it using a Winforms test harness. When the class library is created by the test harness everything seems to be working OK. The problems start when I try to run it as a service. It is created OK and even the first call to the COM is OK. The COM object then raises an event that I handle and in response to the result in the event I call another function in the COM library. The function is invoked successfully in the case when I run it from the test harness but when running as a Service an exception is thrown: System.InvalidCastException occurred Message="Unable to cast COM object of type '' to interface type ''. This operation failed because the QueryInterface call on the COM component for the interface with IID '{350ADD2A-18CB-4D9C-BE28-48D53F14E6FB}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))." I can see that there are threading issues. In the test harness case all this calls happen on the main thread and in the case of the Windows Service both the Service OnStart override and the COM event handler are on different threads. I've been trying different things without success. Any suggestions? Rad.
c#
.net
error-handling
windows-services
null
12/19/2011 05:12:06
too localized
C# Windows Service throws an exception when trying to call a COM library. === I'm writing an application that uses a COM library. I have a class library that wraps the calls to the COM library and adds some more functionality. Eventually this will run as a Windows Service. For now I test it using a Winforms test harness. When the class library is created by the test harness everything seems to be working OK. The problems start when I try to run it as a service. It is created OK and even the first call to the COM is OK. The COM object then raises an event that I handle and in response to the result in the event I call another function in the COM library. The function is invoked successfully in the case when I run it from the test harness but when running as a Service an exception is thrown: System.InvalidCastException occurred Message="Unable to cast COM object of type '' to interface type ''. This operation failed because the QueryInterface call on the COM component for the interface with IID '{350ADD2A-18CB-4D9C-BE28-48D53F14E6FB}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))." I can see that there are threading issues. In the test harness case all this calls happen on the main thread and in the case of the Windows Service both the Service OnStart override and the COM event handler are on different threads. I've been trying different things without success. Any suggestions? Rad.
3
4,038,385
10/27/2010 22:52:39
32,484
10/29/2008 17:48:46
5,640
119
What skills are required for a job as a developer on a highly transactional system?
I see a lot of jobs ad for developers to work on highly transactional web applications. I assume this is a site with a lot of database transactions, but what skills are needed for a project like this? Apart from exceptional database skills, is there anything else?
career-development
null
null
null
null
01/27/2012 03:09:52
off topic
What skills are required for a job as a developer on a highly transactional system? === I see a lot of jobs ad for developers to work on highly transactional web applications. I assume this is a site with a lot of database transactions, but what skills are needed for a project like this? Apart from exceptional database skills, is there anything else?
2
9,100,685
02/01/2012 17:51:36
1,180,169
01/31/2012 11:17:34
1
0
Python simple function exercise
I'll try to keep it as short as possible. I've got some simple exercise to do: 1. Add a function named list_benefits()- that returns the following list of strings: "More organized code", "More readable code", "Easier code reuse", "Allowing programmers to share and connect code together" 2. Add a function named build_sentence(info) which receives a single argument containing a string and returns a sentence starting with the given string and ending with the string " is a benefit of functions!" __________________________________________________________ #Add your functions here (before the existing functions) def name_the_benefits_of_functions(): list_of_benefits = list_benefits() for benefit in list_of_benefits: print build_sentence(benefit) name_the_benefits_of_functions() __________________________________________________________
python
null
null
null
null
02/01/2012 18:03:31
not a real question
Python simple function exercise === I'll try to keep it as short as possible. I've got some simple exercise to do: 1. Add a function named list_benefits()- that returns the following list of strings: "More organized code", "More readable code", "Easier code reuse", "Allowing programmers to share and connect code together" 2. Add a function named build_sentence(info) which receives a single argument containing a string and returns a sentence starting with the given string and ending with the string " is a benefit of functions!" __________________________________________________________ #Add your functions here (before the existing functions) def name_the_benefits_of_functions(): list_of_benefits = list_benefits() for benefit in list_of_benefits: print build_sentence(benefit) name_the_benefits_of_functions() __________________________________________________________
1
8,153,368
11/16/2011 14:36:53
237,555
12/23/2009 11:55:10
503
11
what is the secret of appearing titles on google search result very fast?
I need to know how stackoverflow's questiones appear on google search result very fast I know what are points google consider to rank some title but I think the architecture of design is important because they appear very fast after some minutes I ask a question and I have been seen it in google result just in a minute. what is the secret ? Is there any relation between asp.net-mvc web application with that or not asp.net application could be fast in google result.
asp.net
asp.net-mvc
google
null
null
12/02/2011 16:26:15
off topic
what is the secret of appearing titles on google search result very fast? === I need to know how stackoverflow's questiones appear on google search result very fast I know what are points google consider to rank some title but I think the architecture of design is important because they appear very fast after some minutes I ask a question and I have been seen it in google result just in a minute. what is the secret ? Is there any relation between asp.net-mvc web application with that or not asp.net application could be fast in google result.
2
4,145,113
11/10/2010 13:47:31
503,269
11/10/2010 13:38:44
1
0
How to Display data from a plist using cocos2d iphone ?
I am creating a game of questions and answers for iphone using cocos2d, and I wonder how can I do to display the question on the screen using ccLabel seeking data from a plist. can someone help me with this!
cocos2d
cocos2d-iphone
plist
null
null
null
open
How to Display data from a plist using cocos2d iphone ? === I am creating a game of questions and answers for iphone using cocos2d, and I wonder how can I do to display the question on the screen using ccLabel seeking data from a plist. can someone help me with this!
0
11,253,401
06/28/2012 21:48:23
584,448
01/21/2011 12:45:53
626
10
Connect an android tablet to ethernet
I use tablet with android in a professional environment and the it department doesn't accept to install wifi. My tablet need to synchronise with csv file on a lan share. I'm looking for solutions. Is it possible to connect a tablet on ethernet (possibly with builtin firmware) ? If yes, which model ? On the Ethernet I looked for solutions and I found some interesting links : - http://forum.xda-developers.com/showthread.php?t=1274656 / a pack to add ethernet support to asus - http://www.sosandroid.fr/forumAndroid/topic1980.html iconia tab a500 - http://discuz-android.blogspot.fr/2011/07/step-by-step-to-enable-lan-access-for.html motorola xoom Does someone has an experience. I prefer avoid root my tablet or use a custom firmware or launch some custom command when connected to the network. but if no android tablet come with this feature built in .. I will use it alternate solution : connect the tablet to the pc with usb and access the lan share located on the computer (it was possible with windows mobile) and maybe access the whole network. I own a galaxy tab 8.9 and the best would be to find a solution with that tablet Do you have any information to point ? regards
android
null
null
null
null
06/28/2012 23:07:31
off topic
Connect an android tablet to ethernet === I use tablet with android in a professional environment and the it department doesn't accept to install wifi. My tablet need to synchronise with csv file on a lan share. I'm looking for solutions. Is it possible to connect a tablet on ethernet (possibly with builtin firmware) ? If yes, which model ? On the Ethernet I looked for solutions and I found some interesting links : - http://forum.xda-developers.com/showthread.php?t=1274656 / a pack to add ethernet support to asus - http://www.sosandroid.fr/forumAndroid/topic1980.html iconia tab a500 - http://discuz-android.blogspot.fr/2011/07/step-by-step-to-enable-lan-access-for.html motorola xoom Does someone has an experience. I prefer avoid root my tablet or use a custom firmware or launch some custom command when connected to the network. but if no android tablet come with this feature built in .. I will use it alternate solution : connect the tablet to the pc with usb and access the lan share located on the computer (it was possible with windows mobile) and maybe access the whole network. I own a galaxy tab 8.9 and the best would be to find a solution with that tablet Do you have any information to point ? regards
2
10,530,150
05/10/2012 08:26:38
1,350,571
04/23/2012 05:42:43
1
0
how to set stack_size, stack_addr and guardsize when creating a thread
I'm reading APUE these days, and just found an issue. One common way to use pthread_attr_setstack is to 1. malloc a chuck of memory 2. set the addr and length by the method Then here comes my question, what if I want to use the guard-size to protect my data? Say I need A bytes of memory, and B bytes for guard-size. Shall I malloc A+B bytes, or malloc A bytes?
pthreads
posix
null
null
null
null
open
how to set stack_size, stack_addr and guardsize when creating a thread === I'm reading APUE these days, and just found an issue. One common way to use pthread_attr_setstack is to 1. malloc a chuck of memory 2. set the addr and length by the method Then here comes my question, what if I want to use the guard-size to protect my data? Say I need A bytes of memory, and B bytes for guard-size. Shall I malloc A+B bytes, or malloc A bytes?
0
7,927,404
10/28/2011 09:25:11
342,235
05/16/2010 06:20:51
3,430
18
How to improve this scala code which is checking if two byte arrays are same?
I have a method to compare two byte arrays. The code is java-style, and there are many "if-else"s. def assertArray(b1: Array[Byte], b2: Array[Byte]) { if (b1 == null && b2 == null) return; else if (b1 != null && b2 != null) { if (b1.length != b2.length) throw new AssertionError("b1.length != b2.length") else { for (i <- b1.indices) { if (b1(i) != b2(i)) throw new AssertionError("b1(%d) != b2(%d)".format(i, i)) } } } else { throw new AssertionError("b1 is null while b2 is not, vice versa") } } I have tried as following, but it's not simplified the code much: (Option(b1), Option(b2)) match { case (Some(b1), Some(b2)) => if ( b1.length == b2.length ) { for (i <- b1.indices) { if (b1(i) != b2(i)) throw new AssertionError("b1(%d) != b2(%d)".format(i, i)) } } else { throw new AssertionError("b1.length != b2.length") } case (None, None) => _ case _ => throw new AssertionError("b1 is null while b2 is not, vice versa") }
java
scala
compare
null
null
null
open
How to improve this scala code which is checking if two byte arrays are same? === I have a method to compare two byte arrays. The code is java-style, and there are many "if-else"s. def assertArray(b1: Array[Byte], b2: Array[Byte]) { if (b1 == null && b2 == null) return; else if (b1 != null && b2 != null) { if (b1.length != b2.length) throw new AssertionError("b1.length != b2.length") else { for (i <- b1.indices) { if (b1(i) != b2(i)) throw new AssertionError("b1(%d) != b2(%d)".format(i, i)) } } } else { throw new AssertionError("b1 is null while b2 is not, vice versa") } } I have tried as following, but it's not simplified the code much: (Option(b1), Option(b2)) match { case (Some(b1), Some(b2)) => if ( b1.length == b2.length ) { for (i <- b1.indices) { if (b1(i) != b2(i)) throw new AssertionError("b1(%d) != b2(%d)".format(i, i)) } } else { throw new AssertionError("b1.length != b2.length") } case (None, None) => _ case _ => throw new AssertionError("b1 is null while b2 is not, vice versa") }
0
10,433,597
05/03/2012 14:34:47
1,278,712
03/19/2012 13:58:20
1
0
iPhone app header change when user in call
In my iPhon app i need to display time for other place .Now i have the current time of the place how to continue the time with following situations Time has to refresh every time the app is launched, or the app comes back from the suspended state.
iphone
objective-c
xcode
null
null
null
open
iPhone app header change when user in call === In my iPhon app i need to display time for other place .Now i have the current time of the place how to continue the time with following situations Time has to refresh every time the app is launched, or the app comes back from the suspended state.
0
3,886,327
10/07/2010 22:25:08
348,905
05/24/2010 11:55:46
8
3
How do I make my WPF User Control's dependency properties update my view model?
I'm trying to create a user control with dependency properties to bind to. Internally I have a ComboBox that is bound to these same properties, but the binding only works one way. The ComboBox fills from the ItemsSource, but SelectedItem doesn't get updated back to the viewmodel I'm binding to. A simplified example: This is the view model to bind with the user control: public class PeopleViewModel : INotifyPropertyChanged { public PeopleViewModel() { People = new List<string>( new [] {"John", "Alfred","Dave"}); SelectedPerson = People.FirstOrDefault(); } public event PropertyChangedEventHandler PropertyChanged; private IEnumerable<string> _people; public IEnumerable<string> People { get { return _people; } set { _people = value; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("People")); } } } private string _selectedPerson; public string SelectedPerson { get { return _selectedPerson; } set { _selectedPerson = value; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("SelectedPerson")); } } } } This is the User control: <UserControl x:Class="PeopleControlTest.PeopleControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="56" d:DesignWidth="637"> <StackPanel > <ComboBox Margin="11" ItemsSource="{Binding BoundPeople, RelativeSource={RelativeSource AncestorType=UserControl}}" SelectedItem="{Binding BoundSelectedPerson, RelativeSource={RelativeSource AncestorType=UserControl}}"/> </StackPanel> </UserControl> with code behind public partial class PeopleControl : UserControl { public PeopleControl() { InitializeComponent(); } public static readonly DependencyProperty BoundPeopleProperty = DependencyProperty.Register("BoundPeople", typeof(IEnumerable<string>), typeof(PeopleControl), new UIPropertyMetadata(null)); public static readonly DependencyProperty BoundSelectedPersonProperty = DependencyProperty.Register("BoundSelectedPerson", typeof(string), typeof(PeopleControl), new UIPropertyMetadata("")); public IEnumerable<string> BoundPeople { get { return (IEnumerable<string>)GetValue(BoundPeopleProperty); } set { SetValue(BoundPeopleProperty, value); } } public string BoundSelectedPerson { get { return (string)GetValue(BoundSelectedPersonProperty); } set { SetValue(BoundSelectedPersonProperty, value); } } } And this is how I bind the user control in the main window (with the windows data context set to an instance of the viewmodel) <Window x:Class="PeopleControlTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:PeopleControlTest" Title="MainWindow" Height="350" Width="525"> <Grid> <controls:PeopleControl BoundPeople="{Binding People}" BoundSelectedPerson="{Binding SelectedPerson}"/> </Grid> </Window> The combobox in the user control fills with the names, but when I select a different name this doesn't get updated back to the view model. Any idea what I'm missing here? Thanks!
binding
wpf-usercontrols
null
null
null
null
open
How do I make my WPF User Control's dependency properties update my view model? === I'm trying to create a user control with dependency properties to bind to. Internally I have a ComboBox that is bound to these same properties, but the binding only works one way. The ComboBox fills from the ItemsSource, but SelectedItem doesn't get updated back to the viewmodel I'm binding to. A simplified example: This is the view model to bind with the user control: public class PeopleViewModel : INotifyPropertyChanged { public PeopleViewModel() { People = new List<string>( new [] {"John", "Alfred","Dave"}); SelectedPerson = People.FirstOrDefault(); } public event PropertyChangedEventHandler PropertyChanged; private IEnumerable<string> _people; public IEnumerable<string> People { get { return _people; } set { _people = value; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("People")); } } } private string _selectedPerson; public string SelectedPerson { get { return _selectedPerson; } set { _selectedPerson = value; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("SelectedPerson")); } } } } This is the User control: <UserControl x:Class="PeopleControlTest.PeopleControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="56" d:DesignWidth="637"> <StackPanel > <ComboBox Margin="11" ItemsSource="{Binding BoundPeople, RelativeSource={RelativeSource AncestorType=UserControl}}" SelectedItem="{Binding BoundSelectedPerson, RelativeSource={RelativeSource AncestorType=UserControl}}"/> </StackPanel> </UserControl> with code behind public partial class PeopleControl : UserControl { public PeopleControl() { InitializeComponent(); } public static readonly DependencyProperty BoundPeopleProperty = DependencyProperty.Register("BoundPeople", typeof(IEnumerable<string>), typeof(PeopleControl), new UIPropertyMetadata(null)); public static readonly DependencyProperty BoundSelectedPersonProperty = DependencyProperty.Register("BoundSelectedPerson", typeof(string), typeof(PeopleControl), new UIPropertyMetadata("")); public IEnumerable<string> BoundPeople { get { return (IEnumerable<string>)GetValue(BoundPeopleProperty); } set { SetValue(BoundPeopleProperty, value); } } public string BoundSelectedPerson { get { return (string)GetValue(BoundSelectedPersonProperty); } set { SetValue(BoundSelectedPersonProperty, value); } } } And this is how I bind the user control in the main window (with the windows data context set to an instance of the viewmodel) <Window x:Class="PeopleControlTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:PeopleControlTest" Title="MainWindow" Height="350" Width="525"> <Grid> <controls:PeopleControl BoundPeople="{Binding People}" BoundSelectedPerson="{Binding SelectedPerson}"/> </Grid> </Window> The combobox in the user control fills with the names, but when I select a different name this doesn't get updated back to the view model. Any idea what I'm missing here? Thanks!
0
4,230,960
11/20/2010 02:52:17
307,413
04/02/2010 02:58:52
56
4
How does Common Lisp's "loop for" macro work with multiple "and"ed counters?
The following Common Lisp code does not produce the output I would expect it to: (loop for a from 5 to 10 and b = a do (format t "~d ~d~%" a b)) Using SCBL, it produces this output: 5 5 6 5 7 6 8 7 9 8 10 9 I was expecting the values of a and b to be the same on each line. I have searched the web for good documentation of the loop macro in this instance but couldn't find much. I'd appreciate any insight!
common-lisp
null
null
null
null
null
open
How does Common Lisp's "loop for" macro work with multiple "and"ed counters? === The following Common Lisp code does not produce the output I would expect it to: (loop for a from 5 to 10 and b = a do (format t "~d ~d~%" a b)) Using SCBL, it produces this output: 5 5 6 5 7 6 8 7 9 8 10 9 I was expecting the values of a and b to be the same on each line. I have searched the web for good documentation of the loop macro in this instance but couldn't find much. I'd appreciate any insight!
0
11,193,513
06/25/2012 16:40:53
701,254
04/10/2011 21:15:12
159
0
Resize external javascript
Can the below external javascript be resized ? Below I have attempted to wrap it in a div and set the width on the div, but it is not resizing. <div width = "100"><script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/23232.js"></script> <noscript><a href="http://polldaddy.com/poll/23232/">Test</a></noscript> </div> Note, this poll does not acutally exist.
javascript
jquery
null
null
null
06/25/2012 16:52:23
not a real question
Resize external javascript === Can the below external javascript be resized ? Below I have attempted to wrap it in a div and set the width on the div, but it is not resizing. <div width = "100"><script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/23232.js"></script> <noscript><a href="http://polldaddy.com/poll/23232/">Test</a></noscript> </div> Note, this poll does not acutally exist.
1
5,052,910
02/19/2011 19:08:20
587,920
01/24/2011 18:15:53
142
5
ASP.NET MVC Project Structure
I would like any input on the structure I should use for my solution/projects. There is going to be an ASP.NET MVC Web Application, WinForms Application and a WCF/Webservices that would be exposed to outside vendors. GTG is the abbreviation for the business name. I was thinking this: Layer 1) EF4/Repositories<br> Layer 2) POCO's<br> Layer 3) Services<br> Layer 4)<br><br> a) MVC Web App (View Models, Views, Controllers)<br> b) WinForms App<br> c) Web Services/WCF Services How should I name these? Does this look ok?
asp.net
asp.net-mvc
projects-and-solutions
null
null
02/20/2011 01:33:29
not a real question
ASP.NET MVC Project Structure === I would like any input on the structure I should use for my solution/projects. There is going to be an ASP.NET MVC Web Application, WinForms Application and a WCF/Webservices that would be exposed to outside vendors. GTG is the abbreviation for the business name. I was thinking this: Layer 1) EF4/Repositories<br> Layer 2) POCO's<br> Layer 3) Services<br> Layer 4)<br><br> a) MVC Web App (View Models, Views, Controllers)<br> b) WinForms App<br> c) Web Services/WCF Services How should I name these? Does this look ok?
1
10,383,224
04/30/2012 11:50:17
1,365,732
04/30/2012 11:45:11
1
0
Using Bluff Plugin Grails
I am using bluff plugin in grails.but when i am trying to draw the graph in pdf graphs are not displaying please help me to solve this.This is the first post in stackoverflow i am unsure where to post this. Thanks & Regards, Nithya.
grails-plugin
null
null
null
null
05/01/2012 12:22:47
not a real question
Using Bluff Plugin Grails === I am using bluff plugin in grails.but when i am trying to draw the graph in pdf graphs are not displaying please help me to solve this.This is the first post in stackoverflow i am unsure where to post this. Thanks & Regards, Nithya.
1
8,390,905
12/05/2011 19:46:04
1,082,123
12/05/2011 18:49:12
11
0
Artisteer exported html files doesn't display correct in other editors?
After designing my webpage in [Artisteer][1] I exported html files and I want to edit my html files in Visual Studio but the problem is it doesn't display correctly (also in other editors such as DreamWeaver or Expression Web). I read all the solutions that other people suggested but none of them work! What I can do? [1]: http://www.artisteer.com/
html
editor
null
null
null
12/06/2011 19:54:40
off topic
Artisteer exported html files doesn't display correct in other editors? === After designing my webpage in [Artisteer][1] I exported html files and I want to edit my html files in Visual Studio but the problem is it doesn't display correctly (also in other editors such as DreamWeaver or Expression Web). I read all the solutions that other people suggested but none of them work! What I can do? [1]: http://www.artisteer.com/
2
11,627,045
07/24/2012 08:32:05
1,236,352
02/27/2012 19:26:35
35
1
what hook should I use to output extension after body text
Using mediawiki. I have installed the extension http://www.mediawiki.org/wiki/Extension:Contribution_Credits, which is called with the main body text <?php $this->html('bodytext') ?> in my skin.php file. I would like to insert some code (comment section) inbetween the main body text of my page and the contribution credits. At the moment the contribution credits extension uses the hook: $wgHooks['OutputPageBeforeHTML'][] = 'addFooter'; what can I change this to so it isn't called with the main body text but rather just above the { $this->html('catlinks'); } section? Thanks
mediawiki
null
null
null
null
null
open
what hook should I use to output extension after body text === Using mediawiki. I have installed the extension http://www.mediawiki.org/wiki/Extension:Contribution_Credits, which is called with the main body text <?php $this->html('bodytext') ?> in my skin.php file. I would like to insert some code (comment section) inbetween the main body text of my page and the contribution credits. At the moment the contribution credits extension uses the hook: $wgHooks['OutputPageBeforeHTML'][] = 'addFooter'; what can I change this to so it isn't called with the main body text but rather just above the { $this->html('catlinks'); } section? Thanks
0
10,275,947
04/23/2012 06:45:01
576,671
01/15/2011 11:25:54
418
11
Does each developer needs its own Google Map Api-key?
I just started to play around with the Google map api in Android. I did generate my *MD5 certificate fingerprint* on **debug.keystore** as explained in https://developers.google.com/maps/documentation/android/mapkey and later generated the Api key with this link: http://code.google.com/android/maps-api-signup.html It is working well as expected. But the problem is that we are a couple of different programmers that share the same code base and it seems weird that each programmer should create its own key and change the xml file in order to get it to work. ***Is there any way to create a more global key for the google map API that can be shared among developers?*** Using Google API console https://code.google.com/apis/console , I also created a key for Google Map API, and added the other programmer to the project as team members, but that code does not seem to work. not even for me! ***What is the difference between the first API code and this code? which one should be used?*** Thanks for any explanations
android
google-maps-api-3
google-api
api-key
null
null
open
Does each developer needs its own Google Map Api-key? === I just started to play around with the Google map api in Android. I did generate my *MD5 certificate fingerprint* on **debug.keystore** as explained in https://developers.google.com/maps/documentation/android/mapkey and later generated the Api key with this link: http://code.google.com/android/maps-api-signup.html It is working well as expected. But the problem is that we are a couple of different programmers that share the same code base and it seems weird that each programmer should create its own key and change the xml file in order to get it to work. ***Is there any way to create a more global key for the google map API that can be shared among developers?*** Using Google API console https://code.google.com/apis/console , I also created a key for Google Map API, and added the other programmer to the project as team members, but that code does not seem to work. not even for me! ***What is the difference between the first API code and this code? which one should be used?*** Thanks for any explanations
0
3,065,598
06/17/2010 20:58:35
216,511
11/22/2009 15:49:23
11
3
What is the best way to detect white color?
I'm trying to detect white objects in a video. The first step is to filter the image so that it leaves only white-color pixels. My first approach was using HSV color space and then checking for high level of VAL channel. Here is the code: //convert image to hsv cvCvtColor( src, hsv, CV_BGR2HSV ); cvCvtPixToPlane( hsv, h_plane, s_plane, v_plane, 0 ); for(int x=0;x<srcSize.width;x++){ for(int y=0;y<srcSize.height;y++){ uchar * hue=&((uchar*) (h_plane->imageData+h_plane->widthStep*y))[x]; uchar * sat=&((uchar*) (s_plane->imageData+s_plane->widthStep*y))[x]; uchar * val=&((uchar*) (v_plane->imageData+v_plane->widthStep*y))[x]; if((*val>170)) *hue=255; else *hue=0; } } leaving the result in the hue channel. Unfortunately, this approach is very sensitive to lighting. I'm sure there is a better way. Any suggestions?
image-processing
colors
opencv
null
null
05/22/2012 14:18:32
not constructive
What is the best way to detect white color? === I'm trying to detect white objects in a video. The first step is to filter the image so that it leaves only white-color pixels. My first approach was using HSV color space and then checking for high level of VAL channel. Here is the code: //convert image to hsv cvCvtColor( src, hsv, CV_BGR2HSV ); cvCvtPixToPlane( hsv, h_plane, s_plane, v_plane, 0 ); for(int x=0;x<srcSize.width;x++){ for(int y=0;y<srcSize.height;y++){ uchar * hue=&((uchar*) (h_plane->imageData+h_plane->widthStep*y))[x]; uchar * sat=&((uchar*) (s_plane->imageData+s_plane->widthStep*y))[x]; uchar * val=&((uchar*) (v_plane->imageData+v_plane->widthStep*y))[x]; if((*val>170)) *hue=255; else *hue=0; } } leaving the result in the hue channel. Unfortunately, this approach is very sensitive to lighting. I'm sure there is a better way. Any suggestions?
4
11,736,510
07/31/2012 08:57:17
1,526,781
07/15/2012 11:07:44
34
0
Database Access Time - Dependant on language?
If I am going to use a SQLite database to store my data, I was wondering if the language of my program which requests the data will have any outcome on the access time. For example, if I have my 100mb SQL database and I need to search if for a certain value, would I get faster results if I wrote my program in C as opposed to PHP to query and return the result from SQL? I’m guessing the language doesn’t make a lot of difference since it is SQLite that is doing most of the heavy work, but I might be wrong.
sql
database
sqlite
null
null
null
open
Database Access Time - Dependant on language? === If I am going to use a SQLite database to store my data, I was wondering if the language of my program which requests the data will have any outcome on the access time. For example, if I have my 100mb SQL database and I need to search if for a certain value, would I get faster results if I wrote my program in C as opposed to PHP to query and return the result from SQL? I’m guessing the language doesn’t make a lot of difference since it is SQLite that is doing most of the heavy work, but I might be wrong.
0
7,776,150
10/15/2011 06:09:18
990,769
10/12/2011 05:11:55
6
0
Windows not genuine leading to missing OS?
I was getting the "This copy of Windows is not genuine" message on a pc I bought from Puget Systems: Asus P8P67 Pro REV 3.0 Motherboard, Intel Core i7 QUAD CORE 2600K 3.4 GHz 95W, with my OS on a 300GB Intel 320 SSD. I didn't think much of it since it wasn't effecting my daily computer use and figured I would get to it when I had more time. Today, my computer crashed right after telling me that my VMware version of Ubuntu Linux wasn't working. (Sorry, I can't remember the exact failure message) After this failed at trying to recover the damage (there was a recover option), the computer blue screened. After trying to restart, now I'm getting the "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key" message. I've already tried going into my BIOS and setting the boot preference to the SSD which had/has Windows7 on it. I've tried to include everything that might be effecting the current problem (missing OS), please help me!
windows-7
null
null
null
null
10/15/2011 06:17:18
off topic
Windows not genuine leading to missing OS? === I was getting the "This copy of Windows is not genuine" message on a pc I bought from Puget Systems: Asus P8P67 Pro REV 3.0 Motherboard, Intel Core i7 QUAD CORE 2600K 3.4 GHz 95W, with my OS on a 300GB Intel 320 SSD. I didn't think much of it since it wasn't effecting my daily computer use and figured I would get to it when I had more time. Today, my computer crashed right after telling me that my VMware version of Ubuntu Linux wasn't working. (Sorry, I can't remember the exact failure message) After this failed at trying to recover the damage (there was a recover option), the computer blue screened. After trying to restart, now I'm getting the "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key" message. I've already tried going into my BIOS and setting the boot preference to the SSD which had/has Windows7 on it. I've tried to include everything that might be effecting the current problem (missing OS), please help me!
2
11,717,650
07/30/2012 08:16:54
1,562,264
07/30/2012 07:45:39
1
0
calling cuda API using C
this is my code that calls a cuda API,i run it in visual studio 2008.it opens an window but doesn't show anything!can u tell me what is my problem? #include <iostream> #include <stdio.h> #include <cuda.h> #include <conio.h> #include <windows.h> int main() { HRESULT __stdcall NVGetHWEncodeCaps(); getch(); return 0; } 'num2.exe': Loaded 'C:\Windows\System32\ntdll.dll' 'num2.exe': Loaded 'C:\Windows\System32\kernel32.dll' 'num2.exe': Loaded 'C:\Windows\System32\KernelBase.dll' 'num2.exe': Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\cudart64_42_9.dll', Binary was not built with debug information. The thread 'Win64 Thread' (0x28c) has exited with code -1073741510 (0xc000013a). The program '[2648] num2.exe: Native' has exited with code -1073741510 (0xc000013a). ////////// NVGetHWEncodeCaps Description: Query if the GPU supports the NVIDIA CUDA Video encoder Syntax: HRESULT __stdcall NVGetHWEncodeCaps(void) Parameter: None Return Value: S_OK: CUDA based encoding is supported E_FAIL: No CUDA capability present Remarks: None
api
cuda
null
null
null
07/30/2012 20:48:40
not a real question
calling cuda API using C === this is my code that calls a cuda API,i run it in visual studio 2008.it opens an window but doesn't show anything!can u tell me what is my problem? #include <iostream> #include <stdio.h> #include <cuda.h> #include <conio.h> #include <windows.h> int main() { HRESULT __stdcall NVGetHWEncodeCaps(); getch(); return 0; } 'num2.exe': Loaded 'C:\Windows\System32\ntdll.dll' 'num2.exe': Loaded 'C:\Windows\System32\kernel32.dll' 'num2.exe': Loaded 'C:\Windows\System32\KernelBase.dll' 'num2.exe': Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\cudart64_42_9.dll', Binary was not built with debug information. The thread 'Win64 Thread' (0x28c) has exited with code -1073741510 (0xc000013a). The program '[2648] num2.exe: Native' has exited with code -1073741510 (0xc000013a). ////////// NVGetHWEncodeCaps Description: Query if the GPU supports the NVIDIA CUDA Video encoder Syntax: HRESULT __stdcall NVGetHWEncodeCaps(void) Parameter: None Return Value: S_OK: CUDA based encoding is supported E_FAIL: No CUDA capability present Remarks: None
1
11,330,477
07/04/2012 13:53:44
1,488,501
06/28/2012 12:11:41
1
0
Datepicker dialog keeps making month column disappear on clicking set
I'm trying to use a datepicker dialog, everything works. It's just that when I click "set" the month column vanishes a second before the rest of the dialog does. What's wrong ? Here's the class I'm using package com.educren.launcher.activities; import java.util.Calendar; import android.app.Activity; import android.app.DatePickerDialog; import android.app.DatePickerDialog.OnDateSetListener; import android.app.Dialog; import android.app.DialogFragment; import android.os.Bundle; public class DatePickerFragment extends DialogFragment { private Activity mActivity; public DatePickerFragment(Activity callback) { mActivity = callback; } public Dialog onCreateDialog(Bundle savedInstanceState) { //set the year to current minus 4, middle of the likely age range int year = Calendar.getInstance().get(Calendar.YEAR)-4; int month = 6; int day = 16; //This returns a dialog with the default date for the user to change. return new DatePickerDialog(getActivity(), (OnDateSetListener) mActivity, year, month, day); } }
android
datepicker
fragment
null
null
null
open
Datepicker dialog keeps making month column disappear on clicking set === I'm trying to use a datepicker dialog, everything works. It's just that when I click "set" the month column vanishes a second before the rest of the dialog does. What's wrong ? Here's the class I'm using package com.educren.launcher.activities; import java.util.Calendar; import android.app.Activity; import android.app.DatePickerDialog; import android.app.DatePickerDialog.OnDateSetListener; import android.app.Dialog; import android.app.DialogFragment; import android.os.Bundle; public class DatePickerFragment extends DialogFragment { private Activity mActivity; public DatePickerFragment(Activity callback) { mActivity = callback; } public Dialog onCreateDialog(Bundle savedInstanceState) { //set the year to current minus 4, middle of the likely age range int year = Calendar.getInstance().get(Calendar.YEAR)-4; int month = 6; int day = 16; //This returns a dialog with the default date for the user to change. return new DatePickerDialog(getActivity(), (OnDateSetListener) mActivity, year, month, day); } }
0
3,222,427
07/11/2010 08:46:53
466,534
04/21/2010 12:03:08
800
5
question about malloc function
i am new in c++and can anybody give me a few example how use malloc in c++ code?
c++
null
null
null
null
07/11/2010 19:38:43
not a real question
question about malloc function === i am new in c++and can anybody give me a few example how use malloc in c++ code?
1
6,591,261
07/06/2011 03:29:05
244,095
01/05/2010 16:37:16
51
9
Installation instructions for Fat Free CRM?
Does anyone know of a tutorial or detailed instruction set for installing Fat Free CRM? The instructions on github are clearly meant for experienced rails developers not stupid newbies like me. When I try downloading the source code to my Mac, rails won't work and I get dozens and dozens of errors when I try to start the server. (There are way too many to even post here) I also tried setting up a new app and painstakingly copying and pasting the files from the source into the new app after it complained numerous times that it could not find the rails server. Now it continues kvetching about syntax errors and dependencies in a dozen or so files and complaining about my gems. I did properly update the database yaml file and have tried updating my gems and running bundle many, many times but the spaghetti bowl of errors never seems to resolve much. This is the latest Rails 3 version of the app so why would it not work and why does it seem to think that half the gems are deprecated? Other people don't seem to be getting these types of errors. I'm clearly missing something that is plainly obvious to the rest of the world and have somehow majorly screwed up the installation. How does the process of downloading a complete app differ from installing a plugin? (I've never had this much trouble with plugins.) Does anyone know of an idiot-proof checklist for downloading, installing and setting up this app? After three months of trying to make this work, I am beyond frustrated. Thanks so much.
ruby-on-rails
crm
null
null
null
null
open
Installation instructions for Fat Free CRM? === Does anyone know of a tutorial or detailed instruction set for installing Fat Free CRM? The instructions on github are clearly meant for experienced rails developers not stupid newbies like me. When I try downloading the source code to my Mac, rails won't work and I get dozens and dozens of errors when I try to start the server. (There are way too many to even post here) I also tried setting up a new app and painstakingly copying and pasting the files from the source into the new app after it complained numerous times that it could not find the rails server. Now it continues kvetching about syntax errors and dependencies in a dozen or so files and complaining about my gems. I did properly update the database yaml file and have tried updating my gems and running bundle many, many times but the spaghetti bowl of errors never seems to resolve much. This is the latest Rails 3 version of the app so why would it not work and why does it seem to think that half the gems are deprecated? Other people don't seem to be getting these types of errors. I'm clearly missing something that is plainly obvious to the rest of the world and have somehow majorly screwed up the installation. How does the process of downloading a complete app differ from installing a plugin? (I've never had this much trouble with plugins.) Does anyone know of an idiot-proof checklist for downloading, installing and setting up this app? After three months of trying to make this work, I am beyond frustrated. Thanks so much.
0
7,782,897
10/16/2011 07:13:36
209,834
11/12/2009 18:04:46
54
11
What tools are available for calculating code coverage using broI have gotwser automation tests
I have a website written in ASP.NET MVC 3. I have put together some browser automation tests that target this website. I want to use this same set of tests to calculate the code coverage of the website code. I know that NCover does this kind of work but based on my knowledge there are two issues. One, NCover gives code coverage figures for both framework's code and my code. Two, it's costly.
code-coverage
selenium2
null
null
null
null
open
What tools are available for calculating code coverage using broI have gotwser automation tests === I have a website written in ASP.NET MVC 3. I have put together some browser automation tests that target this website. I want to use this same set of tests to calculate the code coverage of the website code. I know that NCover does this kind of work but based on my knowledge there are two issues. One, NCover gives code coverage figures for both framework's code and my code. Two, it's costly.
0
3,637,558
09/03/2010 16:08:31
432,002
08/26/2010 15:17:55
1
0
java programming language
what is 'this' keyword and what's its functions?
javascript
null
null
null
null
09/03/2010 16:15:20
not a real question
java programming language === what is 'this' keyword and what's its functions?
1
11,564,607
07/19/2012 15:51:55
592,835
01/27/2011 20:18:39
2,500
179
Why all classes in .NET globally inherits from Object class
Its very interesting for me which advantages gives "global root class" approach fro framework. In shorts words what reasons resulted the .NEt framework was designed to have one root **object** class with general functionality suitable for all classes. Nowdays we are designing new framework for internal use (the framework under SAP platform) and we all devided into two camps - first who thinks that framerowk should have global root, and the second - who thinks opposite. I am at "global root" camp. And my reasons what such approach would yields good flexibility and development costs reduction cause we will not develop general functionality any more. So, Im very interesting to know what reasons really push .NET architectors to design framework in such way. Maybe somebody read the answer to this question in a blog of someone from the .NET developer team?
.net
architecture
null
null
null
07/19/2012 15:57:24
off topic
Why all classes in .NET globally inherits from Object class === Its very interesting for me which advantages gives "global root class" approach fro framework. In shorts words what reasons resulted the .NEt framework was designed to have one root **object** class with general functionality suitable for all classes. Nowdays we are designing new framework for internal use (the framework under SAP platform) and we all devided into two camps - first who thinks that framerowk should have global root, and the second - who thinks opposite. I am at "global root" camp. And my reasons what such approach would yields good flexibility and development costs reduction cause we will not develop general functionality any more. So, Im very interesting to know what reasons really push .NET architectors to design framework in such way. Maybe somebody read the answer to this question in a blog of someone from the .NET developer team?
2
8,342,499
12/01/2011 13:58:15
900,360
08/18/2011 10:03:58
105
13
Can we have mini-StackOverflows inside StackOverflow?
**I don't have enough rep on meta. Please, migrate it there.** This will be a great tool for teachers/educators/universities/colleges. SO is a great tool. But community has grown too much for starters and at times quite intimidating too. I personally found my students quite intimidated due to coldness of community towards starters. Yes, these are not great questions. But everyone deserves a chance at a fresh start. And this will keep poor questions away from main-stream. so, (different than SO) can we have smaller StackOverflow for small groups. Group's questions will not appear in main site, but followers can answer any question if they find themselves up to that.
stackoverflow.com
null
null
null
null
12/01/2011 14:07:03
off topic
Can we have mini-StackOverflows inside StackOverflow? === **I don't have enough rep on meta. Please, migrate it there.** This will be a great tool for teachers/educators/universities/colleges. SO is a great tool. But community has grown too much for starters and at times quite intimidating too. I personally found my students quite intimidated due to coldness of community towards starters. Yes, these are not great questions. But everyone deserves a chance at a fresh start. And this will keep poor questions away from main-stream. so, (different than SO) can we have smaller StackOverflow for small groups. Group's questions will not appear in main site, but followers can answer any question if they find themselves up to that.
2
7,518,309
09/22/2011 16:34:57
121,400
06/11/2009 15:18:12
317
41
help with jquery
This is what I am working on: http://jsfiddle.net/5Wxb4/ I am trying to add an "adjust cost" function. a. they enter qty = 1 for item1. The cost becomes 1x725=725. Install Subtotal is also 725. estimate total is 725. b. they enter qty = 2 for item2. The cost becomes 2x100=200. Service Subtotal is 200. Estimate total is 925. c. hey enter qty = 1 for item3. The cost becomes 1x15=15. Service Subtotal is 215. Estimate total is 940. d. now, I want to adjust the total for item2. Say from 200 to 150. I need to show service subtotal = 165 and estimate total = 890. I am using hidden fields like "oldTotal", "oldAdjTotal" to track what was the original values. I appreciate any help...
jquery
null
null
null
null
09/23/2011 17:36:03
too localized
help with jquery === This is what I am working on: http://jsfiddle.net/5Wxb4/ I am trying to add an "adjust cost" function. a. they enter qty = 1 for item1. The cost becomes 1x725=725. Install Subtotal is also 725. estimate total is 725. b. they enter qty = 2 for item2. The cost becomes 2x100=200. Service Subtotal is 200. Estimate total is 925. c. hey enter qty = 1 for item3. The cost becomes 1x15=15. Service Subtotal is 215. Estimate total is 940. d. now, I want to adjust the total for item2. Say from 200 to 150. I need to show service subtotal = 165 and estimate total = 890. I am using hidden fields like "oldTotal", "oldAdjTotal" to track what was the original values. I appreciate any help...
3
9,612,031
03/08/2012 02:16:07
506,912
11/13/2010 19:01:37
14
0
Matlab structure arrays treated as vectors
I'd like my program to not treat this: {0:1000} {ones(1,1000)} not as vectors when I input them for my structure array. Any idea on how to do this? Thanks in advance.
arrays
matlab
structure
null
null
null
open
Matlab structure arrays treated as vectors === I'd like my program to not treat this: {0:1000} {ones(1,1000)} not as vectors when I input them for my structure array. Any idea on how to do this? Thanks in advance.
0
9,882,783
03/27/2012 02:57:44
1,289,022
03/23/2012 19:21:25
18
0
Python classes and unittest
I'm working through python for rookies, and i've come across a question in which I had to make a class, and subclasses which is fine(i presume ive done it right) but I now have to include some testing with the unittest module and i can't figure out how to impliment this, any help would be appreciated. class BankAccount: def __init__(self): self.balance = 0 def withdraw(self,amount): if self.balance - amount <= 0: print "Overdrawn, please try another option." else: self.balance -= amount return self.balance def deposit(self, amount): self.balance += amount return self.balance def interest(self, amount): percent = self.balance / 100.0 * amount self.balance = self.balance + percent return self.balance class CreditAccount(BankAccount): def withdraw(self,amount): if self.balance - amount <= 0: self.balance = self.balance - amount - 5 print "Overdrawn, you have been charged £5 for this." return self.balance else: self.balance -= amount return self.balance class StudentAccount(BankAccount): def __innit__(self): self.balance = 500 def withdraw(self, amount): if self.balance - amount >= -3000: self.balance -= amount return self.balance else: print "£3000 Overdraft limit reached" return self.balance account = BankAccount() account1=CreditAccount() account2=StudentAccount() account2.deposit(500)
python
unit-testing
class
subclass
null
03/31/2012 23:52:42
not a real question
Python classes and unittest === I'm working through python for rookies, and i've come across a question in which I had to make a class, and subclasses which is fine(i presume ive done it right) but I now have to include some testing with the unittest module and i can't figure out how to impliment this, any help would be appreciated. class BankAccount: def __init__(self): self.balance = 0 def withdraw(self,amount): if self.balance - amount <= 0: print "Overdrawn, please try another option." else: self.balance -= amount return self.balance def deposit(self, amount): self.balance += amount return self.balance def interest(self, amount): percent = self.balance / 100.0 * amount self.balance = self.balance + percent return self.balance class CreditAccount(BankAccount): def withdraw(self,amount): if self.balance - amount <= 0: self.balance = self.balance - amount - 5 print "Overdrawn, you have been charged £5 for this." return self.balance else: self.balance -= amount return self.balance class StudentAccount(BankAccount): def __innit__(self): self.balance = 500 def withdraw(self, amount): if self.balance - amount >= -3000: self.balance -= amount return self.balance else: print "£3000 Overdraft limit reached" return self.balance account = BankAccount() account1=CreditAccount() account2=StudentAccount() account2.deposit(500)
1
6,856,123
07/28/2011 08:34:43
148,926
08/01/2009 11:36:50
397
33
hudson : map SVN credentials to emails
I bet this is highlighted in documentation somewhere but I'm a bit lazy right now. How do we set up mapping from SVN credentials to emails we use in notifications in case Hudson observes a failed build after a checkin? It would be nice to compare TeamCity extensive notifications setup with the same of Hudson or Jenkins. Just some link to the proper place in the docs would do as well. Thanks, Anton **UPD**: the main problem we face now is to notify only the offender, not all developers.
java
continuous-integration
hudson
build-process
null
null
open
hudson : map SVN credentials to emails === I bet this is highlighted in documentation somewhere but I'm a bit lazy right now. How do we set up mapping from SVN credentials to emails we use in notifications in case Hudson observes a failed build after a checkin? It would be nice to compare TeamCity extensive notifications setup with the same of Hudson or Jenkins. Just some link to the proper place in the docs would do as well. Thanks, Anton **UPD**: the main problem we face now is to notify only the offender, not all developers.
0
3,223,029
07/11/2010 12:25:37
180,784
09/28/2009 22:58:39
1,684
103
Save custom object array in instance state
I have a `List<CustomObject>` (where `CustomObject` comes from an external library -- I can't make changes to it). I want to save this in `onSaveInstanceState(Bundle)`, but I can't seem to do it. Here are the options that I've tried: outState.putSerializable(KEY, (ArrayList<CustomObject>) myList); // because myList is instantiated as an ArrayList outState.putSerializable(KEY, myList.toArray()); Both options **work** when switching orientation on the phone (yes, `onSaveInstanceState` is called when switching orientation -- I checked in logcat). However, when the current activity tries to start another one (with `startActivity(Intent)`), Android pauses the current activity and calls `onSaveInstanceState()` again. This time, it fails, for some reason unknown to me. The fishy thing is that `onSaveInstanceState()` executes successfully. The stack trace printed doesn't point to any of my code: E/AndroidRuntime(23898): java.lang.RuntimeException: Parcel: unable to marshal value my.custom.Object@5e07e43b E/AndroidRuntime(23898): at android.os.Parcel.writeValue(Parcel.java:1087) E/AndroidRuntime(23898): at android.os.Parcel.writeArray(Parcel.java:519) E/AndroidRuntime(23898): at android.os.Parcel.writeValue(Parcel.java:1072) E/AndroidRuntime(23898): at android.os.Parcel.writeMapInternal(Parcel.java:469) E/AndroidRuntime(23898): at android.os.Bundle.writeToParcel(Bundle.java:1445) E/AndroidRuntime(23898): at android.os.Parcel.writeBundle(Parcel.java:483) E/AndroidRuntime(23898): at android.app.ActivityManagerProxy.activityPaused(ActivityManagerNative.java:1427) E/AndroidRuntime(23898): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3106) E/AndroidRuntime(23898): at android.app.ActivityThread.access$2400(ActivityThread.java:119) E/AndroidRuntime(23898): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870) E/AndroidRuntime(23898): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(23898): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime(23898): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime(23898): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(23898): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime(23898): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime(23898): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime(23898): at dalvik.system.NativeStart.main(Native Method) Is there any way to store custom objects in the instance state?
java
android
serialization
null
null
null
open
Save custom object array in instance state === I have a `List<CustomObject>` (where `CustomObject` comes from an external library -- I can't make changes to it). I want to save this in `onSaveInstanceState(Bundle)`, but I can't seem to do it. Here are the options that I've tried: outState.putSerializable(KEY, (ArrayList<CustomObject>) myList); // because myList is instantiated as an ArrayList outState.putSerializable(KEY, myList.toArray()); Both options **work** when switching orientation on the phone (yes, `onSaveInstanceState` is called when switching orientation -- I checked in logcat). However, when the current activity tries to start another one (with `startActivity(Intent)`), Android pauses the current activity and calls `onSaveInstanceState()` again. This time, it fails, for some reason unknown to me. The fishy thing is that `onSaveInstanceState()` executes successfully. The stack trace printed doesn't point to any of my code: E/AndroidRuntime(23898): java.lang.RuntimeException: Parcel: unable to marshal value my.custom.Object@5e07e43b E/AndroidRuntime(23898): at android.os.Parcel.writeValue(Parcel.java:1087) E/AndroidRuntime(23898): at android.os.Parcel.writeArray(Parcel.java:519) E/AndroidRuntime(23898): at android.os.Parcel.writeValue(Parcel.java:1072) E/AndroidRuntime(23898): at android.os.Parcel.writeMapInternal(Parcel.java:469) E/AndroidRuntime(23898): at android.os.Bundle.writeToParcel(Bundle.java:1445) E/AndroidRuntime(23898): at android.os.Parcel.writeBundle(Parcel.java:483) E/AndroidRuntime(23898): at android.app.ActivityManagerProxy.activityPaused(ActivityManagerNative.java:1427) E/AndroidRuntime(23898): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3106) E/AndroidRuntime(23898): at android.app.ActivityThread.access$2400(ActivityThread.java:119) E/AndroidRuntime(23898): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870) E/AndroidRuntime(23898): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(23898): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime(23898): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime(23898): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(23898): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime(23898): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime(23898): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime(23898): at dalvik.system.NativeStart.main(Native Method) Is there any way to store custom objects in the instance state?
0
5,383,757
03/21/2011 21:07:46
491,880
10/30/2010 00:41:43
46
4
Scaling/Panning a UIImageView using pinch and swipe gestures (Free Code)
I couldn't find any great examples of doing pinch to scale and rotate and swiping to pan. Here is some code that hopefully someone will find useful. You can drop this in anywhere just need to hookup the variable 'imgView' to your UIImageView. Make sure the UIView of the viewcontroller containing the imageview has multitouch enabled. Feel free to edit this to fix any formatting issues. ============================================ #import <UIKit/UIKit.h> @interface EditView : UIViewController { IBOutlet UIView* imgView; double previousDistance; int timeSinceLastDoubleTouch; } - (CGAffineTransform) scaleFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *) secondTouch; - (CGAffineTransform) rotationFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *)secondTouch; @end Here is the .m file: // // EditView.m // PictureFrames // #import "EditView.h" double angleBetweenPoints(CGPoint p1, CGPoint p2){ return atan2(p2.y-p1.y,p2.x-p1.x); } double distanceBetweenPoints(CGPoint p1, CGPoint p2){ return sqrt((p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y)); } @implementation EditView -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ previousDistance = 0; } -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { if([touches count] == 2) { NSArray *firstTwoTouches = [[event allTouches] allObjects]; UITouch *firstTouch = [firstTwoTouches objectAtIndex:0]; UITouch *secondTouch = [firstTwoTouches objectAtIndex:1]; CGAffineTransform transform1 = [self scaleFromTouch:firstTouch secondTouch:secondTouch]; CGAffineTransform transform2 = [self rotationFromTouch:firstTouch secondTouch:secondTouch]; imgView.transform = CGAffineTransformConcat(imgView.transform,transform1); imgView.transform = CGAffineTransformConcat(imgView.transform,transform2); timeSinceLastDoubleTouch = 0; }else{ if(timeSinceLastDoubleTouch<10){ // often times at the end of a rotate/scale gesture // one finger will lift before the other so ignore // that effect by waiting timeSinceLastDoubleTouch++; return; } NSArray *touches = [[event allTouches] allObjects]; UITouch *firstTouch = [touches objectAtIndex:0]; CGPoint pt = [firstTouch locationInView:self.view]; CGPoint pt2 = [firstTouch previousLocationInView:self.view]; double dx = pt.x - pt2.x; double dy = pt.y - pt2.y; CGAffineTransform transform = CGAffineTransformMakeTranslation(dx, dy); imgView.transform=CGAffineTransformConcat(imgView.transform, transform); } } -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ timeSinceLastDoubleTouch = 999; } - (CGAffineTransform) scaleFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *) secondTouch { CGFloat currentDistance = distanceBetweenPoints([firstTouch locationInView:self.view], [secondTouch locationInView:self.view]); if(previousDistance == 0){ previousDistance = currentDistance; } CGFloat ratio = (currentDistance-previousDistance)/previousDistance +1.0; CGAffineTransform transform=CGAffineTransformMakeScale(ratio,ratio); previousDistance = currentDistance; return transform; } -(CGAffineTransform) rotationFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *)secondTouch { CGFloat currentAngle = angleBetweenPoints([firstTouch locationInView:self.view], [secondTouch locationInView:self.view]); CGFloat lastAngle = angleBetweenPoints([firstTouch previousLocationInView:self.view], [secondTouch previousLocationInView:self.view]); double total = (currentAngle-lastAngle); return CGAffineTransformMakeRotation(total); } @end
iphone
uiimageview
code-snippets
null
null
03/23/2011 12:31:24
not a real question
Scaling/Panning a UIImageView using pinch and swipe gestures (Free Code) === I couldn't find any great examples of doing pinch to scale and rotate and swiping to pan. Here is some code that hopefully someone will find useful. You can drop this in anywhere just need to hookup the variable 'imgView' to your UIImageView. Make sure the UIView of the viewcontroller containing the imageview has multitouch enabled. Feel free to edit this to fix any formatting issues. ============================================ #import <UIKit/UIKit.h> @interface EditView : UIViewController { IBOutlet UIView* imgView; double previousDistance; int timeSinceLastDoubleTouch; } - (CGAffineTransform) scaleFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *) secondTouch; - (CGAffineTransform) rotationFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *)secondTouch; @end Here is the .m file: // // EditView.m // PictureFrames // #import "EditView.h" double angleBetweenPoints(CGPoint p1, CGPoint p2){ return atan2(p2.y-p1.y,p2.x-p1.x); } double distanceBetweenPoints(CGPoint p1, CGPoint p2){ return sqrt((p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y)); } @implementation EditView -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ previousDistance = 0; } -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { if([touches count] == 2) { NSArray *firstTwoTouches = [[event allTouches] allObjects]; UITouch *firstTouch = [firstTwoTouches objectAtIndex:0]; UITouch *secondTouch = [firstTwoTouches objectAtIndex:1]; CGAffineTransform transform1 = [self scaleFromTouch:firstTouch secondTouch:secondTouch]; CGAffineTransform transform2 = [self rotationFromTouch:firstTouch secondTouch:secondTouch]; imgView.transform = CGAffineTransformConcat(imgView.transform,transform1); imgView.transform = CGAffineTransformConcat(imgView.transform,transform2); timeSinceLastDoubleTouch = 0; }else{ if(timeSinceLastDoubleTouch<10){ // often times at the end of a rotate/scale gesture // one finger will lift before the other so ignore // that effect by waiting timeSinceLastDoubleTouch++; return; } NSArray *touches = [[event allTouches] allObjects]; UITouch *firstTouch = [touches objectAtIndex:0]; CGPoint pt = [firstTouch locationInView:self.view]; CGPoint pt2 = [firstTouch previousLocationInView:self.view]; double dx = pt.x - pt2.x; double dy = pt.y - pt2.y; CGAffineTransform transform = CGAffineTransformMakeTranslation(dx, dy); imgView.transform=CGAffineTransformConcat(imgView.transform, transform); } } -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ timeSinceLastDoubleTouch = 999; } - (CGAffineTransform) scaleFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *) secondTouch { CGFloat currentDistance = distanceBetweenPoints([firstTouch locationInView:self.view], [secondTouch locationInView:self.view]); if(previousDistance == 0){ previousDistance = currentDistance; } CGFloat ratio = (currentDistance-previousDistance)/previousDistance +1.0; CGAffineTransform transform=CGAffineTransformMakeScale(ratio,ratio); previousDistance = currentDistance; return transform; } -(CGAffineTransform) rotationFromTouch:(UITouch *)firstTouch secondTouch:(UITouch *)secondTouch { CGFloat currentAngle = angleBetweenPoints([firstTouch locationInView:self.view], [secondTouch locationInView:self.view]); CGFloat lastAngle = angleBetweenPoints([firstTouch previousLocationInView:self.view], [secondTouch previousLocationInView:self.view]); double total = (currentAngle-lastAngle); return CGAffineTransformMakeRotation(total); } @end
1
6,453,168
06/23/2011 11:16:23
340,554
05/13/2010 17:54:39
818
14
PHP script doesn't run anymore
I have a php script that I use it like a cient to connect to a Java server with MySql. It worked yersterday, but today doesn't do anything anymore. Anyone experienced this ? What could the problem be ? edit: when i run it from command line, it doesnt output anything: C:\Users\astan>"c:\Program Files (x86)\PHP\php.exe" c:\Users\astan\Downloa ds\workspace\workspace\VR\src\test\php\VR.php C:\Users\astan>
php
mysql
null
null
null
06/23/2011 12:55:42
not a real question
PHP script doesn't run anymore === I have a php script that I use it like a cient to connect to a Java server with MySql. It worked yersterday, but today doesn't do anything anymore. Anyone experienced this ? What could the problem be ? edit: when i run it from command line, it doesnt output anything: C:\Users\astan>"c:\Program Files (x86)\PHP\php.exe" c:\Users\astan\Downloa ds\workspace\workspace\VR\src\test\php\VR.php C:\Users\astan>
1
5,842,870
04/30/2011 15:48:18
326,544
04/27/2010 04:04:32
394
5
Faster Port Forwarding
I wrote an application in Pyhon that needs to ocmmunicate with a server for almost everything. The problem is, when the request is sent to the server, and the response sent back, it takes way too long. I think it is because of all of the port forwarding. My question is, is there a way I can make this faster from a software level? If so, how?
python
performance
communication
portforwarding
null
04/30/2011 17:10:46
not a real question
Faster Port Forwarding === I wrote an application in Pyhon that needs to ocmmunicate with a server for almost everything. The problem is, when the request is sent to the server, and the response sent back, it takes way too long. I think it is because of all of the port forwarding. My question is, is there a way I can make this faster from a software level? If so, how?
1
8,601,469
12/22/2011 08:59:10
296,516
03/18/2010 12:56:50
168
4
EasyFacebook Android SDK, crashes and won't give photos
Sorry for bugging you with similar questions, but I can't still figure out what's the problem. :( Here's my code so far: public void loginSuccess(Facebook facebook) { GraphApi graphApi = new GraphApi(facebook); User user = new User(); try{ user = graphApi.getMyAccountInfo(); //graphApi.setStatus("Hello, world!"); //update your status if logged in } catch(EasyFacebookError e){ Log.d("TAG: ", e.toString()); } fbLoginManager.displayToast("Hey, " + user.getFirst_name() + "! Login success!"); TextView tv = (TextView)findViewById(R.id.textView1); try{ Log.e("info", user.getEmail() ); /// <- this three work fine! Log.e("info", user.getBirthday() ); Log.e("info", user.getGender() ); List<Album> albList = graphApi.getAllAlbumsMy(); // CRASHES WITH: // ERROR/EasyFacebookAndroid(17091): Could not parse '1324505559&__paging_token=299722003399806' into a date or time. List<Photo> photos = graphApi.getAllPhotosMy(); tv.setText( String.valueOf( photos.size() ) ); // doesn't crash, but returns "0" } catch (Exception e) { Log.e("x","ERROR!"); } } The problem is that *List<Album> albList = graphApi.getAllAlbumsMy();* crashes and *List<Photo> photos = graphApi.getAllPhotosMy();* returns 0. What did I miss? Thanks!
android
facebook
null
null
null
null
open
EasyFacebook Android SDK, crashes and won't give photos === Sorry for bugging you with similar questions, but I can't still figure out what's the problem. :( Here's my code so far: public void loginSuccess(Facebook facebook) { GraphApi graphApi = new GraphApi(facebook); User user = new User(); try{ user = graphApi.getMyAccountInfo(); //graphApi.setStatus("Hello, world!"); //update your status if logged in } catch(EasyFacebookError e){ Log.d("TAG: ", e.toString()); } fbLoginManager.displayToast("Hey, " + user.getFirst_name() + "! Login success!"); TextView tv = (TextView)findViewById(R.id.textView1); try{ Log.e("info", user.getEmail() ); /// <- this three work fine! Log.e("info", user.getBirthday() ); Log.e("info", user.getGender() ); List<Album> albList = graphApi.getAllAlbumsMy(); // CRASHES WITH: // ERROR/EasyFacebookAndroid(17091): Could not parse '1324505559&__paging_token=299722003399806' into a date or time. List<Photo> photos = graphApi.getAllPhotosMy(); tv.setText( String.valueOf( photos.size() ) ); // doesn't crash, but returns "0" } catch (Exception e) { Log.e("x","ERROR!"); } } The problem is that *List<Album> albList = graphApi.getAllAlbumsMy();* crashes and *List<Photo> photos = graphApi.getAllPhotosMy();* returns 0. What did I miss? Thanks!
0
11,552,787
07/19/2012 01:35:56
456,218
09/23/2010 13:39:16
736
1
Does vector in ARGV mean one-dimensional array?
Just curious about the term vector in programming field?
c
argv
null
null
null
07/19/2012 06:40:13
not a real question
Does vector in ARGV mean one-dimensional array? === Just curious about the term vector in programming field?
1
10,122,462
04/12/2012 11:16:23
1,328,929
04/12/2012 11:11:04
1
0
Website with an iframe inside
Does anyone have any ideas how to design a website with an iframe inside , like a gallery , to browse inside urls , but still remain on the basic site ? Something like this : http://ru.trovit.com/nedvizhimost/index.php/cod.frame/url.http%253A%252F%252Fwww.mesto.ru%252Fhouse-sale%252F1165477/id_ad.123131lZaNE/type.1/what.%D0%B4%D0%BE%D0%BC%20%D0%BB%D0%B5%D0%BD%D0%B8%D0%BD%D0%B3%D1%80%D0%B0%D0%B4%D1%81%D0%BA%D0%B0%D1%8F%20%D0%BE%D0%B1%D0%BB%D0%B0%D1%81%D1%82%D1%8C/pos.2/org.1/frame_pos.2/publisher_id./referer_id.51/t.1
iframe
website
null
null
null
04/13/2012 16:17:37
not a real question
Website with an iframe inside === Does anyone have any ideas how to design a website with an iframe inside , like a gallery , to browse inside urls , but still remain on the basic site ? Something like this : http://ru.trovit.com/nedvizhimost/index.php/cod.frame/url.http%253A%252F%252Fwww.mesto.ru%252Fhouse-sale%252F1165477/id_ad.123131lZaNE/type.1/what.%D0%B4%D0%BE%D0%BC%20%D0%BB%D0%B5%D0%BD%D0%B8%D0%BD%D0%B3%D1%80%D0%B0%D0%B4%D1%81%D0%BA%D0%B0%D1%8F%20%D0%BE%D0%B1%D0%BB%D0%B0%D1%81%D1%82%D1%8C/pos.2/org.1/frame_pos.2/publisher_id./referer_id.51/t.1
1
3,667,499
09/08/2010 12:03:39
441,602
09/07/2010 15:42:44
1
0
write plug-in system in c++
Good time of day! Prompt please me, where can I find information about creating a system of plug-ins in C + +?
c++
plugins
null
null
null
09/08/2010 13:22:20
not a real question
write plug-in system in c++ === Good time of day! Prompt please me, where can I find information about creating a system of plug-ins in C + +?
1
8,949,916
01/21/2012 01:18:11
1,161,742
01/21/2012 01:04:15
1
0
Would Asyncronous TCP networking be a better option for a dedicated server with up to 32 players playing at the same time in C#?
This is my first question at Stack Overflow, so I'm pretty unsure if I've asked this question properly or in the right place, so sorry if I have done something wrong. Currently I'm planning to design a dedicated server in C# for an XNA game where up to 32 players will be able to connect at the same time. I have had experience in networking with System.Net, but I've not had to deal with quite a large player count before. I know from heart that creating and destroying threads (especially one for each player) is not going to be a good idea, and I'm unsure whether or not to use a ThreadPool due to the "wait in line when no threads are available" nature. So, I've decided (pretty much as my only last option) to use Async to handle the large client count. But I'm still unsure whether or not this is a wise choice, or if I should be using something else to suit my demanding needs. Apologies if this question sounds bleak, but I'm pretty stumped - help much appreciated!
c#
asynchronous
xna
system.net
system.net.sockets
null
open
Would Asyncronous TCP networking be a better option for a dedicated server with up to 32 players playing at the same time in C#? === This is my first question at Stack Overflow, so I'm pretty unsure if I've asked this question properly or in the right place, so sorry if I have done something wrong. Currently I'm planning to design a dedicated server in C# for an XNA game where up to 32 players will be able to connect at the same time. I have had experience in networking with System.Net, but I've not had to deal with quite a large player count before. I know from heart that creating and destroying threads (especially one for each player) is not going to be a good idea, and I'm unsure whether or not to use a ThreadPool due to the "wait in line when no threads are available" nature. So, I've decided (pretty much as my only last option) to use Async to handle the large client count. But I'm still unsure whether or not this is a wise choice, or if I should be using something else to suit my demanding needs. Apologies if this question sounds bleak, but I'm pretty stumped - help much appreciated!
0
10,009,728
04/04/2012 10:57:40
1,312,622
04/04/2012 10:46:55
1
0
Linking to file not in website root?
Hi hope someone can help, I have the following little problem: Ubuntu server 64bit current release running 2 virtual websites Folder structure **site1** (This site is available to the web) /var/www/site1 **site2** (intranet) /var/www/site2 /var/www/site2/pdf/order_pdf/ So from site1 I have tried to link to a file contained in site2 with the following: <a href="../site2/pdf/prder_pdf/filename.pdf but this doesn't seem to work, hope someone can help?
html
ubuntu
links
null
null
null
open
Linking to file not in website root? === Hi hope someone can help, I have the following little problem: Ubuntu server 64bit current release running 2 virtual websites Folder structure **site1** (This site is available to the web) /var/www/site1 **site2** (intranet) /var/www/site2 /var/www/site2/pdf/order_pdf/ So from site1 I have tried to link to a file contained in site2 with the following: <a href="../site2/pdf/prder_pdf/filename.pdf but this doesn't seem to work, hope someone can help?
0
9,287,081
02/15/2012 02:21:57
1,177,261
01/30/2012 03:19:52
18
0
tic-tac-toe trouble
Hello I'm 17 and trying to learn how to code. I am having trouble debugging this section of code and would appreciate some help. bool checkifwin(char grid[3][3], char player) { if ( checkverticle(char grid[3][3], char player) || checkhorizontal(char grid[3][3], char player) || checkdiagonal( grid[3][3], player) return true; else return false; }; It says expected primary-expression before char.
c++
null
null
null
null
null
open
tic-tac-toe trouble === Hello I'm 17 and trying to learn how to code. I am having trouble debugging this section of code and would appreciate some help. bool checkifwin(char grid[3][3], char player) { if ( checkverticle(char grid[3][3], char player) || checkhorizontal(char grid[3][3], char player) || checkdiagonal( grid[3][3], player) return true; else return false; }; It says expected primary-expression before char.
0
3,604,718
08/30/2010 22:30:58
407,054
07/30/2010 19:03:51
13
2
Looking for *the* URL regular expression
Dudes, do you have it?
regex
url
null
null
null
08/31/2010 01:13:41
not a real question
Looking for *the* URL regular expression === Dudes, do you have it?
1
3,411,566
08/05/2010 03:35:54
275,677
02/17/2010 23:31:50
47
0
How can I detect non-western characters?
I want to disallow certain UTF-8 input (server-side), e.g. eastern languages, where example input might be " 伊 ". However, I do want to continue supporting other latin or "latin-like" characters, such as the welsh ŵ and ŷ, so [checking against latin-1 is not possible][1]. What are my options? (if language specific, PHP preferred) Thanks very much. [1]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1#Coverage
php
encoding
utf-8
character-encoding
latin1
null
open
How can I detect non-western characters? === I want to disallow certain UTF-8 input (server-side), e.g. eastern languages, where example input might be " 伊 ". However, I do want to continue supporting other latin or "latin-like" characters, such as the welsh ŵ and ŷ, so [checking against latin-1 is not possible][1]. What are my options? (if language specific, PHP preferred) Thanks very much. [1]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1#Coverage
0
7,867,010
10/23/2011 15:19:53
1,009,625
10/23/2011 15:11:30
1
0
Can't start Mircosoft SQl Server 2008 R2
I can't start MSQL Server 2008 Management Studio as i don't know what is the sa username or password or how to create it http://img849.imageshack.us/img849/751/capturewm.png can any one tell me how to create a sa username or how to login into MSQL Server 2008 Management Studio as this annoying problem prevent me too from adding New database server (Microsoft sql server) in my plesk panel . thank you
windows
plesk
null
null
null
11/12/2011 08:53:44
off topic
Can't start Mircosoft SQl Server 2008 R2 === I can't start MSQL Server 2008 Management Studio as i don't know what is the sa username or password or how to create it http://img849.imageshack.us/img849/751/capturewm.png can any one tell me how to create a sa username or how to login into MSQL Server 2008 Management Studio as this annoying problem prevent me too from adding New database server (Microsoft sql server) in my plesk panel . thank you
2
10,970,039
06/10/2012 15:43:22
1,009,669
09/18/2011 04:14:03
601
20
libgdx my first triangle tutorial not working?
Following the My First Triangle tutorial from this link: [My First Triangle][1] the desktop version works perfectly fine, however when i deploy the android emulator version i get this error: Unfortunately, MyFirstTriangleAndroid has stopped. Any suggestions to help fix this problem? I'm using libgdx-0.9.4. here is the catlog: 06-10 15:32:00.623: D/dalvikvm(528): Not late-enabling CheckJNI (already on) 06-10 15:32:01.653: E/dalvikvm(528): Could not find class 'com.test.myfirsttriangle.MyFirstTriangle', referenced from method com.test.myfirsttriangle.MyFirstTriangleAndroidActivity.onCreate 06-10 15:32:01.653: W/dalvikvm(528): VFY: unable to resolve new-instance 684 (Lcom/test/myfirsttriangle/MyFirstTriangle;) in Lcom/test/myfirsttriangle/MyFirstTriangleAndroidActivity; 06-10 15:32:01.653: D/dalvikvm(528): VFY: replacing opcode 0x22 at 0x0003 06-10 15:32:01.653: D/dalvikvm(528): DexOpt: unable to opt direct call 0x1c88 at 0x05 in Lcom/test/myfirsttriangle/MyFirstTriangleAndroidActivity;.onCreate 06-10 15:32:01.713: D/dalvikvm(528): Trying to load lib /data/data/com.test.myfirsttriangle/lib/libgdx.so 0x412a58e8 06-10 15:32:01.713: D/dalvikvm(528): Added shared lib /data/data/com.test.myfirsttriangle/lib/libgdx.so 0x412a58e8 06-10 15:32:01.713: D/dalvikvm(528): No JNI_OnLoad found in /data/data/com.test.myfirsttriangle/lib/libgdx.so 0x412a58e8, skipping init 06-10 15:32:01.783: D/AndroidRuntime(528): Shutting down VM 06-10 15:32:01.783: W/dalvikvm(528): threadid=1: thread exiting with uncaught exception (group=0x409c01f8) 06-10 15:32:01.793: E/AndroidRuntime(528): FATAL EXCEPTION: main 06-10 15:32:01.793: E/AndroidRuntime(528): java.lang.NoClassDefFoundError: com.test.myfirsttriangle.MyFirstTriangle 06-10 15:32:01.793: E/AndroidRuntime(528): at com.test.myfirsttriangle.MyFirstTriangleAndroidActivity.onCreate(MyFirstTriangleAndroidActivity.java:11) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.Activity.performCreate(Activity.java:4465) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.access$600(ActivityThread.java:123) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.os.Handler.dispatchMessage(Handler.java:99) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.os.Looper.loop(Looper.java:137) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-10 15:32:01.793: E/AndroidRuntime(528): at java.lang.reflect.Method.invokeNative(Native Method) 06-10 15:32:01.793: E/AndroidRuntime(528): at java.lang.reflect.Method.invoke(Method.java:511) 06-10 15:32:01.793: E/AndroidRuntime(528): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-10 15:32:01.793: E/AndroidRuntime(528): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-10 15:32:01.793: E/AndroidRuntime(528): at dalvik.system.NativeStart.main(Native Method) 06-10 15:32:06.703: I/Process(528): Sending signal. PID: 528 SIG: 9 [1]: http://code.google.com/p/libgdx/wiki/MyFirstTriangle
android
android-emulator
android-ndk
libgdx
null
null
open
libgdx my first triangle tutorial not working? === Following the My First Triangle tutorial from this link: [My First Triangle][1] the desktop version works perfectly fine, however when i deploy the android emulator version i get this error: Unfortunately, MyFirstTriangleAndroid has stopped. Any suggestions to help fix this problem? I'm using libgdx-0.9.4. here is the catlog: 06-10 15:32:00.623: D/dalvikvm(528): Not late-enabling CheckJNI (already on) 06-10 15:32:01.653: E/dalvikvm(528): Could not find class 'com.test.myfirsttriangle.MyFirstTriangle', referenced from method com.test.myfirsttriangle.MyFirstTriangleAndroidActivity.onCreate 06-10 15:32:01.653: W/dalvikvm(528): VFY: unable to resolve new-instance 684 (Lcom/test/myfirsttriangle/MyFirstTriangle;) in Lcom/test/myfirsttriangle/MyFirstTriangleAndroidActivity; 06-10 15:32:01.653: D/dalvikvm(528): VFY: replacing opcode 0x22 at 0x0003 06-10 15:32:01.653: D/dalvikvm(528): DexOpt: unable to opt direct call 0x1c88 at 0x05 in Lcom/test/myfirsttriangle/MyFirstTriangleAndroidActivity;.onCreate 06-10 15:32:01.713: D/dalvikvm(528): Trying to load lib /data/data/com.test.myfirsttriangle/lib/libgdx.so 0x412a58e8 06-10 15:32:01.713: D/dalvikvm(528): Added shared lib /data/data/com.test.myfirsttriangle/lib/libgdx.so 0x412a58e8 06-10 15:32:01.713: D/dalvikvm(528): No JNI_OnLoad found in /data/data/com.test.myfirsttriangle/lib/libgdx.so 0x412a58e8, skipping init 06-10 15:32:01.783: D/AndroidRuntime(528): Shutting down VM 06-10 15:32:01.783: W/dalvikvm(528): threadid=1: thread exiting with uncaught exception (group=0x409c01f8) 06-10 15:32:01.793: E/AndroidRuntime(528): FATAL EXCEPTION: main 06-10 15:32:01.793: E/AndroidRuntime(528): java.lang.NoClassDefFoundError: com.test.myfirsttriangle.MyFirstTriangle 06-10 15:32:01.793: E/AndroidRuntime(528): at com.test.myfirsttriangle.MyFirstTriangleAndroidActivity.onCreate(MyFirstTriangleAndroidActivity.java:11) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.Activity.performCreate(Activity.java:4465) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.access$600(ActivityThread.java:123) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.os.Handler.dispatchMessage(Handler.java:99) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.os.Looper.loop(Looper.java:137) 06-10 15:32:01.793: E/AndroidRuntime(528): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-10 15:32:01.793: E/AndroidRuntime(528): at java.lang.reflect.Method.invokeNative(Native Method) 06-10 15:32:01.793: E/AndroidRuntime(528): at java.lang.reflect.Method.invoke(Method.java:511) 06-10 15:32:01.793: E/AndroidRuntime(528): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-10 15:32:01.793: E/AndroidRuntime(528): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-10 15:32:01.793: E/AndroidRuntime(528): at dalvik.system.NativeStart.main(Native Method) 06-10 15:32:06.703: I/Process(528): Sending signal. PID: 528 SIG: 9 [1]: http://code.google.com/p/libgdx/wiki/MyFirstTriangle
0
4,245,592
11/22/2010 12:54:57
503,276
11/10/2010 13:42:15
1
0
Save a file with saveas dialog?
Can I save a file without the save as dialog?
c#
null
null
null
null
11/22/2010 21:40:19
not a real question
Save a file with saveas dialog? === Can I save a file without the save as dialog?
1
5,723,784
04/19/2011 23:05:52
643,843
03/03/2011 23:14:34
148
11
PHP DOMDocument: Problem with intendation
I just started using the DOMDocument Object since I want to parse an uploaded HTML File and then use it as a template for my cms. I'm loading HTML from a file and - for testing purpose - save it as a new html file without changing anything. The problem is: the intendation is messed up. Here's what my HTML file looks like: <!DOCTYPE html> <html> <head> <title>DOM Testpage</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="language" content="deutsch, de" /> </head> <body> <div class="pageOverlay"></div> <div style="height:100px;"></div> <div id="LoginForm"> <div id="LoginLogo"> Here's some Text <br /> And another Text with some German Umlauts: öäü ÖÄÜ ß and so on... <br /> </div> <form method="post" action=""> <!-- Here be dragons. And a nice comment --> <input type="text" name="cms_user" value="" class="InputText " data-defaultvalue="Username" title="Please enter your username." style="margin:0px 0px 20px 0px;" /> <input type="password" name="cms_password" value="" class="InputText " data-defaultvalue="Password" title="Please enter your password." style="margin:0px 0px 20px 0px;" /> <input type="checkbox" name="cms_remember_login" value="1" id="cms_remember_login" /> <label for="cms_remember_login" style="line-height:14px; margin-left:5px;">Remember Login</label> <!-- Another comment This one's even longer --> <input type="submit" name="submitLogin" value="Login" /> </form> </div> </body> </html> The PHP part: <?php $lo_dom = new DOMDocument(); $lo_dom->loadHTMLFile("test.html"); $lo_dom->saveHTMLFile("templates/test_neu.html"); ?> When I open the new HTML file, the source looks like this: <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>DOM Testpage</title><meta name="language" content="deutsch, de"></head><body> <div class="pageOverlay"></div> <div style="height:100px;"></div> <div id="LoginForm"> <div id="LoginLogo"> Here's some Text <br> And another Text with some German Umlauts: &ouml;&auml;&uuml; &Ouml;&Auml;&Uuml; &szlig; and so on... <br></div> <form method="post" action=""> <!-- Here be dragons. And a nice comment --> <input type="text" name="cms_user" value="" class="InputText " data-defaultvalue="Username" title="Please enter your username." style="margin:0px 0px 20px 0px;"><input type="password" name="cms_password" value="" class="InputText " data-defaultvalue="Password" title="Please enter your password." style="margin:0px 0px 20px 0px;"><input type="checkbox" name="cms_remember_login" value="1" id="cms_remember_login"><label for="cms_remember_login" style="line-height:14px; margin-left:5px;">Remember Login</label> <!-- Another comment This one's even longer --> <input type="submit" name="submitLogin" value="Login"></form> </div> </body></html> I already tried setting `preserveWhiteSpace` and `formatOutput` but that doesn't change anything. It's not a big deal at all but it'd be nice if the output would look like the input. Any ideas how to fix this? And another question: is there a way to manually insert a `\n` linebreak after I added another node with `appendChild()`? Thanks in advance
php
source-code
domdocument
null
null
null
open
PHP DOMDocument: Problem with intendation === I just started using the DOMDocument Object since I want to parse an uploaded HTML File and then use it as a template for my cms. I'm loading HTML from a file and - for testing purpose - save it as a new html file without changing anything. The problem is: the intendation is messed up. Here's what my HTML file looks like: <!DOCTYPE html> <html> <head> <title>DOM Testpage</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="language" content="deutsch, de" /> </head> <body> <div class="pageOverlay"></div> <div style="height:100px;"></div> <div id="LoginForm"> <div id="LoginLogo"> Here's some Text <br /> And another Text with some German Umlauts: öäü ÖÄÜ ß and so on... <br /> </div> <form method="post" action=""> <!-- Here be dragons. And a nice comment --> <input type="text" name="cms_user" value="" class="InputText " data-defaultvalue="Username" title="Please enter your username." style="margin:0px 0px 20px 0px;" /> <input type="password" name="cms_password" value="" class="InputText " data-defaultvalue="Password" title="Please enter your password." style="margin:0px 0px 20px 0px;" /> <input type="checkbox" name="cms_remember_login" value="1" id="cms_remember_login" /> <label for="cms_remember_login" style="line-height:14px; margin-left:5px;">Remember Login</label> <!-- Another comment This one's even longer --> <input type="submit" name="submitLogin" value="Login" /> </form> </div> </body> </html> The PHP part: <?php $lo_dom = new DOMDocument(); $lo_dom->loadHTMLFile("test.html"); $lo_dom->saveHTMLFile("templates/test_neu.html"); ?> When I open the new HTML file, the source looks like this: <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>DOM Testpage</title><meta name="language" content="deutsch, de"></head><body> <div class="pageOverlay"></div> <div style="height:100px;"></div> <div id="LoginForm"> <div id="LoginLogo"> Here's some Text <br> And another Text with some German Umlauts: &ouml;&auml;&uuml; &Ouml;&Auml;&Uuml; &szlig; and so on... <br></div> <form method="post" action=""> <!-- Here be dragons. And a nice comment --> <input type="text" name="cms_user" value="" class="InputText " data-defaultvalue="Username" title="Please enter your username." style="margin:0px 0px 20px 0px;"><input type="password" name="cms_password" value="" class="InputText " data-defaultvalue="Password" title="Please enter your password." style="margin:0px 0px 20px 0px;"><input type="checkbox" name="cms_remember_login" value="1" id="cms_remember_login"><label for="cms_remember_login" style="line-height:14px; margin-left:5px;">Remember Login</label> <!-- Another comment This one's even longer --> <input type="submit" name="submitLogin" value="Login"></form> </div> </body></html> I already tried setting `preserveWhiteSpace` and `formatOutput` but that doesn't change anything. It's not a big deal at all but it'd be nice if the output would look like the input. Any ideas how to fix this? And another question: is there a way to manually insert a `\n` linebreak after I added another node with `appendChild()`? Thanks in advance
0
10,730,568
05/24/2012 03:01:20
651,174
03/09/2011 08:26:41
1,931
51
Make a submit input un-clickable
I have the following input: <input type="submit" name="next" value="Next"> How would I make this item un-clickable via jQuery? (i.e., it may only be clicked **after** certain validation criteria are met) ?
javascript
jquery
null
null
null
null
open
Make a submit input un-clickable === I have the following input: <input type="submit" name="next" value="Next"> How would I make this item un-clickable via jQuery? (i.e., it may only be clicked **after** certain validation criteria are met) ?
0
6,210,602
06/02/2011 04:59:36
657,745
03/13/2011 18:08:08
70
5
grails and version control specific to plugins
I am using 1.3.7 on a windows system, the plugins are placed in a different folder and I have made a few changes in the code related to the plugins. I now need to check in this project into svn, how do i go about doing it ? specifically how do i check in he plugins ? When a team mate of mine checks out this project, where will he find the plugins ? I realize that similar questions have been asked [here][1] and [here][2] However they do not address this specific problem. [1]: http://stackoverflow.com/questions/956445/grails-applications-and-version-control [2]: http://stackoverflow.com/questions/4201578/what-grails-project-files-should-not-be-added-to-version-control-grails-1-3-x
version-control
grails
null
null
null
null
open
grails and version control specific to plugins === I am using 1.3.7 on a windows system, the plugins are placed in a different folder and I have made a few changes in the code related to the plugins. I now need to check in this project into svn, how do i go about doing it ? specifically how do i check in he plugins ? When a team mate of mine checks out this project, where will he find the plugins ? I realize that similar questions have been asked [here][1] and [here][2] However they do not address this specific problem. [1]: http://stackoverflow.com/questions/956445/grails-applications-and-version-control [2]: http://stackoverflow.com/questions/4201578/what-grails-project-files-should-not-be-added-to-version-control-grails-1-3-x
0
5,428,275
03/25/2011 03:36:26
666,384
03/18/2011 16:45:58
6
0
Creating a understandable Doubly Linked List
I am trying to create a generic doubly linked list , and I am having trouble getting my head around it. Does anyone have an example of a very simple implementation of Doubly Linked List using C#? Thanks
c#
linked-list
double
null
null
null
open
Creating a understandable Doubly Linked List === I am trying to create a generic doubly linked list , and I am having trouble getting my head around it. Does anyone have an example of a very simple implementation of Doubly Linked List using C#? Thanks
0
3,191,297
07/07/2010 01:25:56
357,820
06/03/2010 18:44:39
1
0
Unity 3D: code help (java)
--------- I'll get right to the point... I would like to display text and have a GUI option for leaving the scene once you collect 5 *wood. If you chose NOT to leave the scene than I would like it to disable the script "Timer" (Tagged 'Timer', In the Hierarchy its called 'Timer'). If you chose TO leave than I would like it to call the script named 'Fade Screen To Black' (Attached to the 'Main Camera' (A Child Of First Person 'Controller') tagged 'MainCamera') and change the scene to 'Credits' after 1 second. I am willing to give credit for a WORKING script and I am willing to think about other options... *5 of the wood tag Thank you guys for helping me so much! -Gibson of GBSoftware-
java
unity
null
null
null
null
open
Unity 3D: code help (java) === --------- I'll get right to the point... I would like to display text and have a GUI option for leaving the scene once you collect 5 *wood. If you chose NOT to leave the scene than I would like it to disable the script "Timer" (Tagged 'Timer', In the Hierarchy its called 'Timer'). If you chose TO leave than I would like it to call the script named 'Fade Screen To Black' (Attached to the 'Main Camera' (A Child Of First Person 'Controller') tagged 'MainCamera') and change the scene to 'Credits' after 1 second. I am willing to give credit for a WORKING script and I am willing to think about other options... *5 of the wood tag Thank you guys for helping me so much! -Gibson of GBSoftware-
0
10,827,289
05/31/2012 04:03:54
1,427,422
05/31/2012 03:49:17
1
0
Custom Post Type Pagination for Cusotm Query
I am digging the this one for a few days! I brought it from premium theme markets! I would like to make pagination for the below code!. Please any one can Help me! That can output the actual pagination!. I have also tried with custom post type pagination plugins!, But it doesn't work!I use $category and $post_number as a variable! Please ! <?php global $post,$wpdb; if($category) { $sqlsql = "and p.ID in (select tr.object_id from $wpdb->term_relationships tr join $wpdb->term_taxonomy t on t.term_taxonomy_id=tr.term_taxonomy_id where t.term_id in ($category) )"; } $sql = "select p.* from $wpdb->posts p where p.post_type='".CUSTOM_POST_TYPE1."' and p.post_status='publish' $sqlsql order by p.post_date desc,p.post_title asc limit $post_number"; $latest_menus = $wpdb->get_results($sql); foreach($latest_menus as $post) : setup_postdata($post); //Here will be the the content endforeach; ?>
wordpress
null
null
null
null
null
open
Custom Post Type Pagination for Cusotm Query === I am digging the this one for a few days! I brought it from premium theme markets! I would like to make pagination for the below code!. Please any one can Help me! That can output the actual pagination!. I have also tried with custom post type pagination plugins!, But it doesn't work!I use $category and $post_number as a variable! Please ! <?php global $post,$wpdb; if($category) { $sqlsql = "and p.ID in (select tr.object_id from $wpdb->term_relationships tr join $wpdb->term_taxonomy t on t.term_taxonomy_id=tr.term_taxonomy_id where t.term_id in ($category) )"; } $sql = "select p.* from $wpdb->posts p where p.post_type='".CUSTOM_POST_TYPE1."' and p.post_status='publish' $sqlsql order by p.post_date desc,p.post_title asc limit $post_number"; $latest_menus = $wpdb->get_results($sql); foreach($latest_menus as $post) : setup_postdata($post); //Here will be the the content endforeach; ?>
0
8,011,157
11/04/2011 14:53:45
924,999
09/02/2011 09:39:41
65
0
SCALA LIFT - Loop through MongoJsonObjectListField
I have a MongoJsonObjectListField in the format: List(PresentationPanel(Black Board,black-board,1)) When I attempt to do : presentation_model.panels.foreach{panel => /* DO SOMETHING */ } I get: value foreach is not a member of [Object] What's the correct way to do this? Thanks in advance, any help much appreciated :)
scala
mongodb
lift
null
null
null
open
SCALA LIFT - Loop through MongoJsonObjectListField === I have a MongoJsonObjectListField in the format: List(PresentationPanel(Black Board,black-board,1)) When I attempt to do : presentation_model.panels.foreach{panel => /* DO SOMETHING */ } I get: value foreach is not a member of [Object] What's the correct way to do this? Thanks in advance, any help much appreciated :)
0
9,087,695
01/31/2012 22:06:45
1,136,386
01/07/2012 20:30:57
1
0
need a batch-scripting god
I need a procedure that will check for files with certain extensions and then rename the parent folder to the base-filename of those files. I have directories like this: C:\Temp\sorting Folder.jpg Backdrop.jpg mymovies.xml Filename.mov Filename.sub Please excuse the caveman-code here: set PROC=C:\Temp for /D %%g IN ("%PROC%") do ( set RNAME=%%g pushd %RNAME% ) for /F %%i in ('dir /b /ad) do ( set filename=%%i if %RNAME%=%filename% (goto :EOF) if exist %~na.mov move "C:Temp\%RNAME%" "C:\Temp\%filename%" if exist %~na.sub move "C:\Temp\%RNAME%" "C:\Temp\%filename%" ) ) I can use .vbs or .bat.
vb
batch
null
null
null
02/01/2012 13:57:16
not a real question
need a batch-scripting god === I need a procedure that will check for files with certain extensions and then rename the parent folder to the base-filename of those files. I have directories like this: C:\Temp\sorting Folder.jpg Backdrop.jpg mymovies.xml Filename.mov Filename.sub Please excuse the caveman-code here: set PROC=C:\Temp for /D %%g IN ("%PROC%") do ( set RNAME=%%g pushd %RNAME% ) for /F %%i in ('dir /b /ad) do ( set filename=%%i if %RNAME%=%filename% (goto :EOF) if exist %~na.mov move "C:Temp\%RNAME%" "C:\Temp\%filename%" if exist %~na.sub move "C:\Temp\%RNAME%" "C:\Temp\%filename%" ) ) I can use .vbs or .bat.
1
9,715,412
03/15/2012 07:21:30
371,181
06/19/2010 18:49:25
4,253
412
Google Chrome Native Client compared with plugin or extension
I am new to Native Client; and new to plugins/extensions too. It strikes me that plugins/extensions are "better" than NaCl in some respects: 1. Can compile plugin/extension anywhere/anyhow to produce a plain old DLL or a .so; NaCL needs binary produced only by the NaCl toolchain. 2. Plugin/extension is portable across browsers (e.g., it is supposed to run in FIrefox and more, as well as in Chrome). This because plugins/extensions adhere to a de facto standard introduced in Netscape 3. If that's all true, then what are the advantages of NaCl over plugins/extensions?
google-chrome
plugins
extension
native-client
null
07/26/2012 15:57:57
not constructive
Google Chrome Native Client compared with plugin or extension === I am new to Native Client; and new to plugins/extensions too. It strikes me that plugins/extensions are "better" than NaCl in some respects: 1. Can compile plugin/extension anywhere/anyhow to produce a plain old DLL or a .so; NaCL needs binary produced only by the NaCl toolchain. 2. Plugin/extension is portable across browsers (e.g., it is supposed to run in FIrefox and more, as well as in Chrome). This because plugins/extensions adhere to a de facto standard introduced in Netscape 3. If that's all true, then what are the advantages of NaCl over plugins/extensions?
4
5,147,904
02/28/2011 21:43:21
638,412
01/26/2011 04:15:54
1
0
I have a web design layout- how do I translate it into html?
I have a web design layout but don't know how to translate it into html/CSS so that it looks exactly like the images of my layout.
html
null
null
null
null
02/28/2011 21:46:00
not a real question
I have a web design layout- how do I translate it into html? === I have a web design layout but don't know how to translate it into html/CSS so that it looks exactly like the images of my layout.
1
8,868,188
01/15/2012 07:24:13
1,047,753
11/15/2011 14:14:39
15
0
Do I use form.cs or program.cs in C#?
I have created a form that gives a open file windows dialog. With this form I want to pass the filename I open to the main function in order to use the data in the file. I wish to know if I should code in the form.cs or the program.cs window!
c#
forms
null
null
null
01/15/2012 17:23:15
not a real question
Do I use form.cs or program.cs in C#? === I have created a form that gives a open file windows dialog. With this form I want to pass the filename I open to the main function in order to use the data in the file. I wish to know if I should code in the form.cs or the program.cs window!
1
5,525,074
04/02/2011 18:33:38
468,512
10/06/2010 21:56:03
18
2
Collision detection for loop problem, only one array item tested?
*[I apologise if this isn't really an in depth question, but I wanted to solve this once and for all]* I was trying to get look into quadtrees, but already ran into trouble getting collision detection without any optimization working properly. Did a search and found a pretty neat example: http://wonderfl.net/c/kyLx (onenterframeC part mostly) Trying to imitate this, it won't work the same. Only some collisions are detected between particular objects. When the objects are not moving it seems to work alot better for some reason. I really can't figure out whats the problem, the code is essentially the same as the sample. I did not blindy copy pasted it, I understands whats happening except for this part: if (j <= i) continue; J would never become bigger that I right? The line also completely removes any working collisions for me. Here is what I did: [view result here: http://martinowullems.com/collision.swf Main class package { import com.martino.objects.Square; import com.martino.world.TestWorld; import flash.display.MovieClip; import flash.events.Event; import net.hires.debug.Stats; /** * ... * @author Martino Wullems */ public class CollisionTest extends MovieClip { var world:TestWorld; public function CollisionTest() { addEventListener(Event.ADDED_TO_STAGE, onStage); } private function onStage(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, onStage); SetupWorld(); addChild(new Stats()); } private function SetupWorld():void { world = new TestWorld(); addChild(world); addObjects(50); } private function addObjects(amount:int):void { for (var i:int = 0; i < amount; ++i) { var square:Square = new Square(14); world.addObject(square); square.x = Math.random() * stage.stageWidth; square.y = Math.random() * stage.stageHeight; square.speedX = (Math.random() * 1) + 1; square.speedY = (Math.random() * 1) + 1; } } } } TestWorld package com.martino.world { import com.martino.objects.Ball; import com.martino.objects.CollisionObject; import flash.display.MovieClip; import flash.events.Event; /** * ... * @author Martino Wullems */ public class TestWorld extends MovieClip { public var objects:Array; public function TestWorld() { initWorld(); } private function initWorld():void { objects = new Array(); addEventListener(Event.ENTER_FRAME, loopWorld); } private function loopWorld(e:Event):void { for (var i:int = 0; i < objects.length; i++) { MoveObject(objects[i]); CheckCollision(i, objects[i]); } } private function CheckCollision(i:int, object:CollisionObject):void { //for (var j:int = i + 1; i < objects.length; j++) { for (var j:int = 0; j < objects.length; j++) { //if (j <= i) //continue; var objectB:CollisionObject = objects[j]; //hittest if (object.hitTestObject(objectB)) { object.isHit = true; objectB.isHit = true; }else { object.isHit = false; objectB.isHit = false; } ///////////////// // CHECK X Y // //////////////// /*if (object.x + object.width < objectB.x) { } else if (object.x > objectB.x + objectB.width) { object.isHit = objectB.isHit = false; } else if (object.y + object.height < objectB.y) { object.isHit = objectB.isHit = false; } else if (object.y > objectB.y + objectB.height) { object.isHit = objectB.isHit = false; } else { object.isHit = objectB.isHit = true; }*/ object.debugDraw(); objectB.debugDraw(); } } private function MoveObject(object:CollisionObject):void { object.x += object.speedX; object.y += object.speedY; //////////////////// //check boundaries// //////////////////// if (object.x > stage.stageWidth) { object.speedX *= -1; }else if (object.x < 0) { object.speedX *= -1; }else if (object.y > stage.stageHeight) { object.speedY *= -1; }else if (object.y < 0) { object.speedY *= -1; } } public function addObject(object:CollisionObject):void { objects.push(object); addChild(object); } } } CollisionObject package com.martino.objects { import flash.display.Sprite; import flash.events.MouseEvent; /** * ... * @author Martino Wullems */ public class CollisionObject extends Sprite { public var size:int; public var speedX:int = 0; public var speedY:int = 0; public var graphic:Sprite; var sleeping:Boolean = false; public var isHit:Boolean = false; public function CollisionObject() { addEventListener(MouseEvent.MOUSE_DOWN, grab); addEventListener(MouseEvent.MOUSE_UP, letGo); } private function grab(e:MouseEvent):void { startDrag(); speedX = 0; speedY = 0; } private function letGo(e:MouseEvent):void { stopDrag(); } public function Collision():void{ } public function debugDraw():void { } } } Square package com.martino.objects { import flash.display.Sprite; /** * ... * @author Martino Wullems */ public class Square extends CollisionObject { public var hitGraphic:Sprite; public function Square(Size:int) { size = Size; drawSquare(); } private function drawSquare():void { graphic = new Sprite(); graphic.graphics.beginFill(0xFF0000); graphic.graphics.drawRect(0, 0, size, size); graphic.graphics.endFill(); addChild(graphic); hitGraphic = new Sprite(); hitGraphic.graphics.beginFill(0x0066FF); hitGraphic.graphics.drawRect(0, 0, size, size); hitGraphic.graphics.endFill(); addChild(hitGraphic); hitGraphic.visible = false; } override public function Collision():void { trace("I collided with a friend (inside joke)"); } public override function debugDraw():void { if (isHit) { graphic.visible = false; hitGraphic.visible = true; }else { graphic.visible = true; hitGraphic.visible = false; } } } } Any help would greatly be appreciated, want to get further on this !
actionscript-3
garbage-collection
null
null
null
null
open
Collision detection for loop problem, only one array item tested? === *[I apologise if this isn't really an in depth question, but I wanted to solve this once and for all]* I was trying to get look into quadtrees, but already ran into trouble getting collision detection without any optimization working properly. Did a search and found a pretty neat example: http://wonderfl.net/c/kyLx (onenterframeC part mostly) Trying to imitate this, it won't work the same. Only some collisions are detected between particular objects. When the objects are not moving it seems to work alot better for some reason. I really can't figure out whats the problem, the code is essentially the same as the sample. I did not blindy copy pasted it, I understands whats happening except for this part: if (j <= i) continue; J would never become bigger that I right? The line also completely removes any working collisions for me. Here is what I did: [view result here: http://martinowullems.com/collision.swf Main class package { import com.martino.objects.Square; import com.martino.world.TestWorld; import flash.display.MovieClip; import flash.events.Event; import net.hires.debug.Stats; /** * ... * @author Martino Wullems */ public class CollisionTest extends MovieClip { var world:TestWorld; public function CollisionTest() { addEventListener(Event.ADDED_TO_STAGE, onStage); } private function onStage(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, onStage); SetupWorld(); addChild(new Stats()); } private function SetupWorld():void { world = new TestWorld(); addChild(world); addObjects(50); } private function addObjects(amount:int):void { for (var i:int = 0; i < amount; ++i) { var square:Square = new Square(14); world.addObject(square); square.x = Math.random() * stage.stageWidth; square.y = Math.random() * stage.stageHeight; square.speedX = (Math.random() * 1) + 1; square.speedY = (Math.random() * 1) + 1; } } } } TestWorld package com.martino.world { import com.martino.objects.Ball; import com.martino.objects.CollisionObject; import flash.display.MovieClip; import flash.events.Event; /** * ... * @author Martino Wullems */ public class TestWorld extends MovieClip { public var objects:Array; public function TestWorld() { initWorld(); } private function initWorld():void { objects = new Array(); addEventListener(Event.ENTER_FRAME, loopWorld); } private function loopWorld(e:Event):void { for (var i:int = 0; i < objects.length; i++) { MoveObject(objects[i]); CheckCollision(i, objects[i]); } } private function CheckCollision(i:int, object:CollisionObject):void { //for (var j:int = i + 1; i < objects.length; j++) { for (var j:int = 0; j < objects.length; j++) { //if (j <= i) //continue; var objectB:CollisionObject = objects[j]; //hittest if (object.hitTestObject(objectB)) { object.isHit = true; objectB.isHit = true; }else { object.isHit = false; objectB.isHit = false; } ///////////////// // CHECK X Y // //////////////// /*if (object.x + object.width < objectB.x) { } else if (object.x > objectB.x + objectB.width) { object.isHit = objectB.isHit = false; } else if (object.y + object.height < objectB.y) { object.isHit = objectB.isHit = false; } else if (object.y > objectB.y + objectB.height) { object.isHit = objectB.isHit = false; } else { object.isHit = objectB.isHit = true; }*/ object.debugDraw(); objectB.debugDraw(); } } private function MoveObject(object:CollisionObject):void { object.x += object.speedX; object.y += object.speedY; //////////////////// //check boundaries// //////////////////// if (object.x > stage.stageWidth) { object.speedX *= -1; }else if (object.x < 0) { object.speedX *= -1; }else if (object.y > stage.stageHeight) { object.speedY *= -1; }else if (object.y < 0) { object.speedY *= -1; } } public function addObject(object:CollisionObject):void { objects.push(object); addChild(object); } } } CollisionObject package com.martino.objects { import flash.display.Sprite; import flash.events.MouseEvent; /** * ... * @author Martino Wullems */ public class CollisionObject extends Sprite { public var size:int; public var speedX:int = 0; public var speedY:int = 0; public var graphic:Sprite; var sleeping:Boolean = false; public var isHit:Boolean = false; public function CollisionObject() { addEventListener(MouseEvent.MOUSE_DOWN, grab); addEventListener(MouseEvent.MOUSE_UP, letGo); } private function grab(e:MouseEvent):void { startDrag(); speedX = 0; speedY = 0; } private function letGo(e:MouseEvent):void { stopDrag(); } public function Collision():void{ } public function debugDraw():void { } } } Square package com.martino.objects { import flash.display.Sprite; /** * ... * @author Martino Wullems */ public class Square extends CollisionObject { public var hitGraphic:Sprite; public function Square(Size:int) { size = Size; drawSquare(); } private function drawSquare():void { graphic = new Sprite(); graphic.graphics.beginFill(0xFF0000); graphic.graphics.drawRect(0, 0, size, size); graphic.graphics.endFill(); addChild(graphic); hitGraphic = new Sprite(); hitGraphic.graphics.beginFill(0x0066FF); hitGraphic.graphics.drawRect(0, 0, size, size); hitGraphic.graphics.endFill(); addChild(hitGraphic); hitGraphic.visible = false; } override public function Collision():void { trace("I collided with a friend (inside joke)"); } public override function debugDraw():void { if (isHit) { graphic.visible = false; hitGraphic.visible = true; }else { graphic.visible = true; hitGraphic.visible = false; } } } } Any help would greatly be appreciated, want to get further on this !
0
1,365,722
09/02/2009 03:38:31
122,032
06/12/2009 14:05:53
1
0
Center Google Map Based on geocoded IP
Basically whenever someones opens up my (Google) map I want it default to their approximate location. Is there an easy way to do it with Google's API or do I have to write a custom code (this is python based app)?
google-maps
javascript
python
django
null
null
open
Center Google Map Based on geocoded IP === Basically whenever someones opens up my (Google) map I want it default to their approximate location. Is there an easy way to do it with Google's API or do I have to write a custom code (this is python based app)?
0
5,991,920
05/13/2011 12:35:44
752,373
05/13/2011 12:35:44
1
0
Apache jUDDI: Finding Templates
I'm using jUDDI v3.0.4 client to inquiry a UDDI server (juddi-portal-bundle-3.0.4). My interest is to find a service (which I succeeded) and query for its Binding Templates, in fact to get the Access Point WSDL to be able to query the WebService later. I only can get the Access point if I know the BindingTemplate key, which I get via Pluto portal released with the UDDI Server. When I try to query for the BindingTemplates of a service, with a FindBinding object, I get "javax.xml.ws.soap.SOAPFaultException: At least one categoryBag, find_tModel or tModelBag must be supplied". But I cannot fill in any of those in the FindBinding object. Am I missing something?, is that not the correct way of getting a service template and its WSDL later? Thanks. Oscar.
java
uddi
null
null
null
null
open
Apache jUDDI: Finding Templates === I'm using jUDDI v3.0.4 client to inquiry a UDDI server (juddi-portal-bundle-3.0.4). My interest is to find a service (which I succeeded) and query for its Binding Templates, in fact to get the Access Point WSDL to be able to query the WebService later. I only can get the Access point if I know the BindingTemplate key, which I get via Pluto portal released with the UDDI Server. When I try to query for the BindingTemplates of a service, with a FindBinding object, I get "javax.xml.ws.soap.SOAPFaultException: At least one categoryBag, find_tModel or tModelBag must be supplied". But I cannot fill in any of those in the FindBinding object. Am I missing something?, is that not the correct way of getting a service template and its WSDL later? Thanks. Oscar.
0
6,400,487
06/19/2011 04:10:31
663,148
03/16/2011 19:31:05
53
0
Connect Sql Server database to Android Application using web services.
I wanted to connect to Sql Server database using android application so that I can store data and retrieve data in Sql Sever using some code written in Java for Android Application... How can I do that thing.. Any tutorials or links will be appreciated..
android
sql-server
web-services
null
null
06/19/2011 10:58:24
not a real question
Connect Sql Server database to Android Application using web services. === I wanted to connect to Sql Server database using android application so that I can store data and retrieve data in Sql Sever using some code written in Java for Android Application... How can I do that thing.. Any tutorials or links will be appreciated..
1
11,293,181
07/02/2012 11:55:36
1,474,367
06/22/2012 09:11:53
2
0
Creating Dynamic Menus
I have to create dynamic menus from the database and can someone please help me in the code,Thanks in Advance .
c#
asp.net
null
null
null
07/02/2012 15:15:08
not a real question
Creating Dynamic Menus === I have to create dynamic menus from the database and can someone please help me in the code,Thanks in Advance .
1
3,780,146
09/23/2010 15:51:08
426,227
08/20/2010 10:23:26
77
13
Use modal view as "normal" view
I want to use a modal view (`UIViewController`) as a "normal" view, which can be pushed on the navigation controller stack. Normally, a modal view is presented like this: LoginViewController *myView = [[MyViewController alloc] init]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView]; [self.navigationController presentModalViewController:navController animated:YES]; [myView release]; myView = nil; [navController release]; navController = nil; But I want to do something like this: [[self navigationController] pushViewController:myView animated:YES]; The problem is that my modal view has a right and a left button. So I would have to check how the view is loaded and present the buttons in another way. The idea behind this is to have the back button. So I can use the same modal view a few times.
iphone
objective-c
cocoa-touch
uiviewcontroller
null
null
open
Use modal view as "normal" view === I want to use a modal view (`UIViewController`) as a "normal" view, which can be pushed on the navigation controller stack. Normally, a modal view is presented like this: LoginViewController *myView = [[MyViewController alloc] init]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView]; [self.navigationController presentModalViewController:navController animated:YES]; [myView release]; myView = nil; [navController release]; navController = nil; But I want to do something like this: [[self navigationController] pushViewController:myView animated:YES]; The problem is that my modal view has a right and a left button. So I would have to check how the view is loaded and present the buttons in another way. The idea behind this is to have the back button. So I can use the same modal view a few times.
0
11,542,415
07/18/2012 13:21:33
1,376,228
05/05/2012 03:11:56
1
1
3D visualize depth information in OpenGL
I have a depth data stored in a text file, then I load it into a matrix z. After create the mesh grid, I want to visualize the depth data as a 3D image. My work is the same with the function "surf" in Matlab. Here is my code: load file and create grid FILE * pFile; long lSize; char * fBuffer; size_t result; char* Token = (char*)calloc(8,sizeof(char)); pFile = fopen("td.txt","r"); if(pFile == NULL){ std::cerr<< "File Open Failed...\n"; exit(-1); } // obtain file size: fseek (pFile , 0 , SEEK_END); lSize = ftell (pFile); rewind (pFile); // allocate memory to contain the whole file: fBuffer = (char*) malloc (sizeof(char)*lSize); if (fBuffer == NULL) {std::cerr<< "Memory error \n"; exit (2);} result = fread (fBuffer, 1, lSize, pFile); //if (result != lSize) {std::cerr<< "Reading error \n"; exit (3);} float oct; bool bk_for=false; Token = (char*)strtok(fBuffer," \n"); for(i=0; i< HEIGHT; i++){ for(j=0; j< WIDTH; j++){ //mesh grid from -1 to 1 x[i][j] = 2.0*((float) j + 0.5)/WIDTH - 1.0; y[i][j] = 2.0*((float) i + 0.5)/HEIGHT - 1.0; oct = atof(Token); z[i][j] = oct; std::cout<<z[i][j]<<" "; Token = (char*)strtok( NULL," \n" ); if( Token == NULL){ bk_for=true; break; } } if(bk_for == true) break; std::cout<< "\n"; } and to show the image int i,j; GLfloat nx,ny,nz; // Clears the screen and depth buffer. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glBegin(GL_QUADS); for (i = 0; i < (HEIGHT-1); i++) { for (j = 0; j < (WIDTH-1); j++) { normal(x[i][j],y[i][j],z[i][j], x[i+1][j],y[i+1][j],z[i+1][j], x[i][j+1],y[i][j+1],z[i][j+1], &nx,&ny,&nz); glNormal3f(nx,ny,nz); glVertex3f(x[i][j],y[i][j],z[i][j]); glVertex3f(x[i+1][j],y[i+1][j],z[i+1][j]); glVertex3f(x[i+1][j+1],y[i+1][j+1],z[i+1][j+1]); glVertex3f(x[i][j+1],y[i][j+1],z[i][j+1]); } } glEnd(); glutSwapBuffers(); glutPostRedisplay(); glFlush(); But I still cannot get the result I want. Could anyone help me to overcome it? Thank you very much!
opengl
3d
null
null
null
07/19/2012 13:38:49
not a real question
3D visualize depth information in OpenGL === I have a depth data stored in a text file, then I load it into a matrix z. After create the mesh grid, I want to visualize the depth data as a 3D image. My work is the same with the function "surf" in Matlab. Here is my code: load file and create grid FILE * pFile; long lSize; char * fBuffer; size_t result; char* Token = (char*)calloc(8,sizeof(char)); pFile = fopen("td.txt","r"); if(pFile == NULL){ std::cerr<< "File Open Failed...\n"; exit(-1); } // obtain file size: fseek (pFile , 0 , SEEK_END); lSize = ftell (pFile); rewind (pFile); // allocate memory to contain the whole file: fBuffer = (char*) malloc (sizeof(char)*lSize); if (fBuffer == NULL) {std::cerr<< "Memory error \n"; exit (2);} result = fread (fBuffer, 1, lSize, pFile); //if (result != lSize) {std::cerr<< "Reading error \n"; exit (3);} float oct; bool bk_for=false; Token = (char*)strtok(fBuffer," \n"); for(i=0; i< HEIGHT; i++){ for(j=0; j< WIDTH; j++){ //mesh grid from -1 to 1 x[i][j] = 2.0*((float) j + 0.5)/WIDTH - 1.0; y[i][j] = 2.0*((float) i + 0.5)/HEIGHT - 1.0; oct = atof(Token); z[i][j] = oct; std::cout<<z[i][j]<<" "; Token = (char*)strtok( NULL," \n" ); if( Token == NULL){ bk_for=true; break; } } if(bk_for == true) break; std::cout<< "\n"; } and to show the image int i,j; GLfloat nx,ny,nz; // Clears the screen and depth buffer. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glBegin(GL_QUADS); for (i = 0; i < (HEIGHT-1); i++) { for (j = 0; j < (WIDTH-1); j++) { normal(x[i][j],y[i][j],z[i][j], x[i+1][j],y[i+1][j],z[i+1][j], x[i][j+1],y[i][j+1],z[i][j+1], &nx,&ny,&nz); glNormal3f(nx,ny,nz); glVertex3f(x[i][j],y[i][j],z[i][j]); glVertex3f(x[i+1][j],y[i+1][j],z[i+1][j]); glVertex3f(x[i+1][j+1],y[i+1][j+1],z[i+1][j+1]); glVertex3f(x[i][j+1],y[i][j+1],z[i][j+1]); } } glEnd(); glutSwapBuffers(); glutPostRedisplay(); glFlush(); But I still cannot get the result I want. Could anyone help me to overcome it? Thank you very much!
1
7,040,241
08/12/2011 12:42:26
878,563
08/04/2011 12:19:52
16
0
how can i use variable of without functions (javascript)
how can i use variable of without functions: sample: var name = 'Jim'; function is_name() { alert(name); } is_name() //alert : Jim tanX
javascript
function
null
null
null
08/12/2011 12:52:01
not a real question
how can i use variable of without functions (javascript) === how can i use variable of without functions: sample: var name = 'Jim'; function is_name() { alert(name); } is_name() //alert : Jim tanX
1
6,313,560
06/11/2011 01:45:05
760,935
05/19/2011 11:07:21
1
0
How to dual boot mac os on my intel pc
I have install mac os in windows in vmware on Intel-PC But It very slow access when i run Iphone program. I want to boot in differnt partition. so i can access windows 7 and mac os.
osx
null
null
null
null
06/11/2011 02:05:45
off topic
How to dual boot mac os on my intel pc === I have install mac os in windows in vmware on Intel-PC But It very slow access when i run Iphone program. I want to boot in differnt partition. so i can access windows 7 and mac os.
2
10,737,726
05/24/2012 12:41:22
1,048,871
11/16/2011 03:28:00
45
1
java - random level generation for sidescrolling platformer
I'm creating a game in Java with Slick and I've gotten to a point where I want to make my levels randomly generated. That's the problem. I've been fiddling with creating random levels using a multidimensional array for about an hour and i just can't seem to get the logic right. Here's what I've got Random r = new Random(); int totalLength = 0; int totalHeight = 24; // maximum Y value for(int i=0; i<5; i++) { int length = r.nextInt(10)+6; int height = r.nextInt(4); for(int y=totalHeight; y<=totalHeight-height; y++) { for(int x=totalLength; x<=totalLength+length; x++) { map[y][x] = i; } } totalHeight -= height; totalLength += length; //System.out.println(length); } And this is what the map looks like ![Crappy map](http://i.imgur.com/r7GfJ.png) Can anyone give me some tips? I'm a complete newbie with random generation so pseudo code will be appreciated :)
java
random
slick2d
procedural-generation
null
05/25/2012 11:15:19
off topic
java - random level generation for sidescrolling platformer === I'm creating a game in Java with Slick and I've gotten to a point where I want to make my levels randomly generated. That's the problem. I've been fiddling with creating random levels using a multidimensional array for about an hour and i just can't seem to get the logic right. Here's what I've got Random r = new Random(); int totalLength = 0; int totalHeight = 24; // maximum Y value for(int i=0; i<5; i++) { int length = r.nextInt(10)+6; int height = r.nextInt(4); for(int y=totalHeight; y<=totalHeight-height; y++) { for(int x=totalLength; x<=totalLength+length; x++) { map[y][x] = i; } } totalHeight -= height; totalLength += length; //System.out.println(length); } And this is what the map looks like ![Crappy map](http://i.imgur.com/r7GfJ.png) Can anyone give me some tips? I'm a complete newbie with random generation so pseudo code will be appreciated :)
2
11,567,522
07/19/2012 18:59:05
1,232,048
02/25/2012 03:35:59
104
4
Javascript object literal inside object literal
In the following JavaScript example, are we seeing 2 object literals as properties of an object literal? dw_Tooltip.content_vars = { link1: { img: 'images/dw-btn.gif', txt: 'dyn-web button', w: 100 }, link2: { img: 'images/dot-com-btn.gif', txt: 'dyn-web.com button', w: 184 } }
javascript
oop
object
null
null
07/20/2012 01:52:45
not a real question
Javascript object literal inside object literal === In the following JavaScript example, are we seeing 2 object literals as properties of an object literal? dw_Tooltip.content_vars = { link1: { img: 'images/dw-btn.gif', txt: 'dyn-web button', w: 100 }, link2: { img: 'images/dot-com-btn.gif', txt: 'dyn-web.com button', w: 184 } }
1
2,145,888
01/27/2010 10:00:40
83,557
03/27/2009 09:46:30
1
0
Liferay development in Eclipse
I've seen that most of the documentation in the Liferay Wiki (concerning Eclipse plugins and the like) refers to Liferay version 4.x. Are there up-to-date resources for developing Liferay portlets with eclipse (3.5)?
liferay
eclipse
null
null
null
05/25/2012 02:27:55
not constructive
Liferay development in Eclipse === I've seen that most of the documentation in the Liferay Wiki (concerning Eclipse plugins and the like) refers to Liferay version 4.x. Are there up-to-date resources for developing Liferay portlets with eclipse (3.5)?
4
4,346,503
12/03/2010 14:30:23
509,070
11/16/2010 04:13:56
18
0
NHibernate - Session Singleton C#
Trying to migrate NHibernate into an existing C# WinForms app and I am currently looking for the best way to manage sessions. I am only learning NHibernate so please excuse my lack of knowledge, can someone please provide me with any Session management code which we can use, most of the implementations that we have found are for web apps. Any help is appreciated.
c#
nhibernate
session
singleton
null
null
open
NHibernate - Session Singleton C# === Trying to migrate NHibernate into an existing C# WinForms app and I am currently looking for the best way to manage sessions. I am only learning NHibernate so please excuse my lack of knowledge, can someone please provide me with any Session management code which we can use, most of the implementations that we have found are for web apps. Any help is appreciated.
0
4,746,865
01/20/2011 12:03:25
578,577
01/17/2011 13:26:18
43
1
PHP: Is there a difference between operators AND and && here?
I have the following code and don't think *and* is needed, i.e. && should be used, as there is nothing to assign the left part to? if($_REQUEST['foo'] != 'abc' and $_REQUEST['bar'] == 'def') { echo "all your base"; } So it should be: if($_REQUEST['foo'] != 'abc' && $_REQUEST['bar'] == 'def') { echo "all your base"; }
php
null
null
null
null
null
open
PHP: Is there a difference between operators AND and && here? === I have the following code and don't think *and* is needed, i.e. && should be used, as there is nothing to assign the left part to? if($_REQUEST['foo'] != 'abc' and $_REQUEST['bar'] == 'def') { echo "all your base"; } So it should be: if($_REQUEST['foo'] != 'abc' && $_REQUEST['bar'] == 'def') { echo "all your base"; }
0
5,019,442
02/16/2011 16:53:14
613,769
02/11/2011 23:15:32
1
0
URL Rewriting subdomain
I'll be quick on what im trying to do, basically I have a user profile page that will be my url, let's say, profile.php?user=alex So now what is working fine in my .htaccess file is changing that into website.com/alex for quicker access. For other purpose, I would need that to be basically alex.website.com, but I couldnt figure out a way to rewrite my URL to that, instead of having a subdomain for every user. If you have any idea if it's possible & how I would go on doing this, I would appreciate it alot! Thank you Alex
.htaccess
mod-rewrite
null
null
null
null
open
URL Rewriting subdomain === I'll be quick on what im trying to do, basically I have a user profile page that will be my url, let's say, profile.php?user=alex So now what is working fine in my .htaccess file is changing that into website.com/alex for quicker access. For other purpose, I would need that to be basically alex.website.com, but I couldnt figure out a way to rewrite my URL to that, instead of having a subdomain for every user. If you have any idea if it's possible & how I would go on doing this, I would appreciate it alot! Thank you Alex
0
9,439,223
02/24/2012 22:57:49
1,143,641
01/11/2012 16:30:59
1
0
Torque 3d versus Ogre 3d?
Well Id just like to to ask everyones opinion on which people would recommand: Ogre 3d which is free found here http://www.ogre3d.org or Torque 3d which costs 179 dollars found here http://www.garagegames.com/products/torque-3d I will be going into my fourth and final year in college soon and I just want to start preparing for it now. I am doing games development and money isnt an option. Id just like to get peoples honest opinions Thanking You Alan
c++
ogre3d
null
null
null
02/26/2012 05:37:17
not constructive
Torque 3d versus Ogre 3d? === Well Id just like to to ask everyones opinion on which people would recommand: Ogre 3d which is free found here http://www.ogre3d.org or Torque 3d which costs 179 dollars found here http://www.garagegames.com/products/torque-3d I will be going into my fourth and final year in college soon and I just want to start preparing for it now. I am doing games development and money isnt an option. Id just like to get peoples honest opinions Thanking You Alan
4
5,990,823
05/13/2011 10:50:19
243,483
01/04/2010 21:27:35
367
19
Why ruby 1.9 is faster than python 2.7 and 3.2 ?
I read this bunch of links : http://pack.li/L ruby 1.9 seems to be 2 times faster than 1.8... and faster than python 2.7 and 3.2 I made some tests, it is not only on recursion (I knew python was bad about that), put for more standard stuff also. So here is my question : How the ruby team have done that ? 2x improvement ? Do they include an JIT compiler/optimizer or something ?
python
ruby
performance
null
null
05/15/2011 11:14:57
not a real question
Why ruby 1.9 is faster than python 2.7 and 3.2 ? === I read this bunch of links : http://pack.li/L ruby 1.9 seems to be 2 times faster than 1.8... and faster than python 2.7 and 3.2 I made some tests, it is not only on recursion (I knew python was bad about that), put for more standard stuff also. So here is my question : How the ruby team have done that ? 2x improvement ? Do they include an JIT compiler/optimizer or something ?
1
3,858,180
10/04/2010 18:47:01
47,468
12/18/2008 16:36:57
79
1
create aqua style buttons using php
is it possible to create an image like this one using php with the help of GD/ImageMagick? This image was generated by Web Button Maker Delux, which is a .NET App. So i think, may be there is an way for me to generate one using PHP. So any help on that please? Thanks, Anjan ![alt text][1] [1]: http://i.stack.imgur.com/SFek8.png
php
gd
imagemagick
null
null
null
open
create aqua style buttons using php === is it possible to create an image like this one using php with the help of GD/ImageMagick? This image was generated by Web Button Maker Delux, which is a .NET App. So i think, may be there is an way for me to generate one using PHP. So any help on that please? Thanks, Anjan ![alt text][1] [1]: http://i.stack.imgur.com/SFek8.png
0
7,167,363
08/23/2011 20:50:57
166,291
08/31/2009 23:14:23
289
0
C# WebRequest - .timeout question
For a little more background, please see: http://stackoverflow.com/questions/7166237/problem-with-c-http-put-request-code I am using the C# WebRequest method to upload a file to S3. I already have a pre-signed URL that S3 is giving me for the upload. I originally had a problem where if I was uploading a large file, the transfer would stop a few minutes after starting. A comment on my other post said it was the .timeout that was causing it. Sure enough it was. My question is this: What should I set the .timeout to or how can I calculate what to set it do based on the size of the file that I am going to transfer? <br><br>I don't want to start a WebRequest with a 60 minute timeout when I am only going to be sending a small file to S3, but then again I could also be uploading a gigabyte file to S3 also and if the timeout goes off before the file is done, the transfer will be interrupted. Also how would I trap for a connection timeout? Would the .timeout be used for that also? What if I only want to try a connection for 30 seconds to see if S3 responds to my web PUT request and if doesn't then have it timeout. My code is: WebRequest request = WebRequest.Create(PUT_URL_FINAL[0]); //PUT_URL_FINAL IS THE PRE-SIGNED AMAZON S3 URL THAT I AM SENDING THE FILE TO request.Timeout = 360000; //6 minutes -- If the transfer is over 6 minutes, it stops. request.Method = "PUT"; //result3 is the filename that I am sending request.ContentType = MimeType(GlobalClass.AppDir + Path.DirectorySeparatorChar + "unzip" + Path.DirectorySeparatorChar + System.Web.HttpUtility.UrlEncode(result3)); byte[] byteArray = File.ReadAllBytes( GlobalClass.AppDir + Path.DirectorySeparatorChar + "unzip" + Path.DirectorySeparatorChar + System.Web.HttpUtility.UrlEncode(result3)); request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); //This will return "OK" if successful. WebResponse response = request.GetResponse(); Console.WriteLine("++ HttpWebResponse: " + ((HttpWebResponse)response).StatusDescription);
c#
http
timeout
webrequest
null
null
open
C# WebRequest - .timeout question === For a little more background, please see: http://stackoverflow.com/questions/7166237/problem-with-c-http-put-request-code I am using the C# WebRequest method to upload a file to S3. I already have a pre-signed URL that S3 is giving me for the upload. I originally had a problem where if I was uploading a large file, the transfer would stop a few minutes after starting. A comment on my other post said it was the .timeout that was causing it. Sure enough it was. My question is this: What should I set the .timeout to or how can I calculate what to set it do based on the size of the file that I am going to transfer? <br><br>I don't want to start a WebRequest with a 60 minute timeout when I am only going to be sending a small file to S3, but then again I could also be uploading a gigabyte file to S3 also and if the timeout goes off before the file is done, the transfer will be interrupted. Also how would I trap for a connection timeout? Would the .timeout be used for that also? What if I only want to try a connection for 30 seconds to see if S3 responds to my web PUT request and if doesn't then have it timeout. My code is: WebRequest request = WebRequest.Create(PUT_URL_FINAL[0]); //PUT_URL_FINAL IS THE PRE-SIGNED AMAZON S3 URL THAT I AM SENDING THE FILE TO request.Timeout = 360000; //6 minutes -- If the transfer is over 6 minutes, it stops. request.Method = "PUT"; //result3 is the filename that I am sending request.ContentType = MimeType(GlobalClass.AppDir + Path.DirectorySeparatorChar + "unzip" + Path.DirectorySeparatorChar + System.Web.HttpUtility.UrlEncode(result3)); byte[] byteArray = File.ReadAllBytes( GlobalClass.AppDir + Path.DirectorySeparatorChar + "unzip" + Path.DirectorySeparatorChar + System.Web.HttpUtility.UrlEncode(result3)); request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); //This will return "OK" if successful. WebResponse response = request.GetResponse(); Console.WriteLine("++ HttpWebResponse: " + ((HttpWebResponse)response).StatusDescription);
0
8,005,208
11/04/2011 05:24:48
1,029,093
11/04/2011 05:11:23
1
0
Has anyone used Gideros Platform?
I found out about the Gideros Platform by accident today. It's a game engine for iOS and Android in beta, but it seems to be developing quickly. There doesn't seem to be much information out there beyond their website, so I was wondering if anyone had any experience with it. I just started Android game programming with libgdx, so I don't want to switch over unless it's worth it.
android
ios
lua
game-engine
null
11/04/2011 09:11:57
not constructive
Has anyone used Gideros Platform? === I found out about the Gideros Platform by accident today. It's a game engine for iOS and Android in beta, but it seems to be developing quickly. There doesn't seem to be much information out there beyond their website, so I was wondering if anyone had any experience with it. I just started Android game programming with libgdx, so I don't want to switch over unless it's worth it.
4
10,446,489
05/04/2012 09:48:30
1,235,305
02/27/2012 10:14:48
423
54
PHP programming logic for framework
Ive been working on a website for a while slowly building more and more functions and the core started to look like a small framework. So i decided to actually try a and make a small framework for future projects. Now ive been using php a while so but I don't have much experience in large sites/projects so i would love to have your opinion on my current code. Now i just set up this sort of flow-chart idea and I hope you guys get the idea by this. ![flowchart][1] Now i would love your opinion on this. and maybe some advice, that would be awesome. since this is not a question with one awnser ill accept the answer that help me improve the logic the most Thanks in advance :) [1]: http://i.stack.imgur.com/ho0ph.png
php
frameworks
logic
guidance
null
05/04/2012 11:37:50
not constructive
PHP programming logic for framework === Ive been working on a website for a while slowly building more and more functions and the core started to look like a small framework. So i decided to actually try a and make a small framework for future projects. Now ive been using php a while so but I don't have much experience in large sites/projects so i would love to have your opinion on my current code. Now i just set up this sort of flow-chart idea and I hope you guys get the idea by this. ![flowchart][1] Now i would love your opinion on this. and maybe some advice, that would be awesome. since this is not a question with one awnser ill accept the answer that help me improve the logic the most Thanks in advance :) [1]: http://i.stack.imgur.com/ho0ph.png
4
9,150,361
02/05/2012 15:17:03
1,190,727
02/05/2012 14:54:32
1
0
How to use a IMultiCastEvent from the spring4d?
Good day! I'm try to start usage the collections part of a spring4d. But I cann't subscribe to the collection changing events. Get the error: [DCC Error]: E2008 Incompatible types at: var TestList: TObjectList<TObject>; begin ... List initialization code ... TestList.OnNotify.Add(TestHandler); <--- Error here end The OnNotify property of the TObjectList declared as: `property OnNotify: ICollectionNotifyDelegate<T>`, where ICollectionNotifyDelegate<T> = interface(IMulticastEvent<Generics.Collections.TCollectionNotifyEvent<T>>) end; i.e. the OnNotify.Add method expects a Generics.Collections.TCollectionNotifyEvent<T>, which declared as: TCollectionNotifyEvent<T> = procedure(Sender: TObject; const Item: T; Action: TCollectionNotification) of object; my event handler declared as: procedure TTestClass.TestHandler(Sender: TObject; const Item: TObject; Action: TCollectionNotification); begin end; I'm confused %) please help )
delphi
null
null
null
null
null
open
How to use a IMultiCastEvent from the spring4d? === Good day! I'm try to start usage the collections part of a spring4d. But I cann't subscribe to the collection changing events. Get the error: [DCC Error]: E2008 Incompatible types at: var TestList: TObjectList<TObject>; begin ... List initialization code ... TestList.OnNotify.Add(TestHandler); <--- Error here end The OnNotify property of the TObjectList declared as: `property OnNotify: ICollectionNotifyDelegate<T>`, where ICollectionNotifyDelegate<T> = interface(IMulticastEvent<Generics.Collections.TCollectionNotifyEvent<T>>) end; i.e. the OnNotify.Add method expects a Generics.Collections.TCollectionNotifyEvent<T>, which declared as: TCollectionNotifyEvent<T> = procedure(Sender: TObject; const Item: T; Action: TCollectionNotification) of object; my event handler declared as: procedure TTestClass.TestHandler(Sender: TObject; const Item: TObject; Action: TCollectionNotification); begin end; I'm confused %) please help )
0