You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(29) |
Aug
(75) |
Sep
(32) |
Oct
(147) |
Nov
(31) |
Dec
(49) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(46) |
Feb
(35) |
Mar
(148) |
Apr
(33) |
May
(53) |
Jun
(46) |
Jul
(60) |
Aug
(44) |
Sep
(135) |
Oct
(23) |
Nov
(68) |
Dec
(42) |
2011 |
Jan
(94) |
Feb
(55) |
Mar
(114) |
Apr
(78) |
May
(64) |
Jun
(10) |
Jul
(31) |
Aug
(2) |
Sep
(25) |
Oct
(13) |
Nov
(8) |
Dec
(24) |
2012 |
Jan
(5) |
Feb
(33) |
Mar
(31) |
Apr
(19) |
May
(24) |
Jun
(23) |
Jul
(14) |
Aug
(15) |
Sep
(12) |
Oct
(3) |
Nov
(4) |
Dec
(19) |
2013 |
Jan
(8) |
Feb
(20) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(4) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(6) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Steven A. <ste...@gm...> - 2011-06-22 14:54:18
|
Hi, I am trying to parse some modified dates of files but I am running into a few problems. Below is the structure I have used to parse the date string from an FTP callback to a Date type in order to compare it with a file on the device: class FileWithDate { public final String fileName; public final Date fileDate; public FileWithDate(String fileName, String fileDate){ Date parsedDate = null; try { DateFormat formatter = new SimpleDateFormat("MMM dd HH:mm"); parsedDate = (Date)formatter.parse(fileDate); } catch (Exception e) { Logging.Error(e); } this.fileName = fileName; this.fileDate = parsedDate; } } Is there anything in the NSDate type I can use to parse a string to a date? Whenever I try to compile the code above on XCode it fails to build as it can't find the files. I guess this has not been written yet? Would be greatful for any help :) Steve |
From: Paul P. <bay...@gm...> - 2011-06-20 14:48:36
|
FYI - I implemented the C version of wait/notify/sleep/interrupt a few days ago, so you may use Thread.sleep(long) now. Thanks, Paul On Thu, May 19, 2011 at 1:38 PM, Alex Lewis <ale...@gm...> wrote: > Ah yes, take out the sleep and finished flag. Sorry that was mistakenly > left in from other tests I had been trying. Without the sleep and finished > flag the system output is still (when using the google url)... > > Received data [<!doctype html><html><head] > Finish loading > > So looking at the implementation of NSURLConnection calling > "connectionWithRequest" starts a new thread so the method calls should be > asynchronous back to the delegate? So I would expect the > "applicationDidFinishLaunching" method to finish quickly but whilst the > NSURLConnection thread is running to get the output generated by the > delegate. Looking at the code again I see there should be just the one > "Received data" message followed by the "Finish Loading" message but there > should be a lot more data in NSData's byte array. > > Thanks, > Alex > > > Just in case here's the modified code... > > @Override > public void applicationDidFinishLaunching(UIApplication app) { > try { > final NSURL url = NSURL.URLWithString("http://www.google.com"); > final NSMutableURLRequest req = new NSMutableURLRequest(url); > > NSURLConnectionDelegate delegate = new NSURLConnectionDelegate() { > @Override > public void connectionDidFailWithError( > NSURLConnection connection, NSError error) { > super.connectionDidFailWithError(connection, error); > System.out.println("Error [" + error + "]"); > } > > @Override > public void connectionDidFinishLoading( > NSURLConnection connection) { > super.connectionDidFinishLoading(connection); > System.out.println("Finish loading"); > } > > @Override > public void connectionDidReceiveData( > NSURLConnection connection, NSData data) { > super.connectionDidReceiveData(connection, data); > System.out.println("Received data [" + new String(data.getBytes()) > + "]"); > } > }; > > NSURLConnection.connectionWithRequest(req, delegate); > } > catch (Exception e) { > System.err.println("Exception doing HTTP" + e); > } > } > > On 19 May 2011 18:05, Arno Puder <ar...@pu...> wrote: > >> >> I'm not sure if you should do that sleep() in your code. The >> NSURLConnection delegate will most likely be executed in the context of >> the same thread that created it, but if you put that thread to sleep, >> problems will occur. Basically you implemented a busy wait which is >> never a good idea. This in not an XMLVM problem, IMHO. >> >> Arno >> >> >> On 5/19/11 6:53 AM, Alex Lewis wrote: >> > Hi, >> > I wrote a very simple Java->iPhone application to open a connection >> > and read the data in the response, but I found I only ever got back 26 >> > bytes of data. Here's the simplest code I could put together which >> > exhibits the problem... >> > >> > private boolean finished = false; >> > @Override >> > public void applicationDidFinishLaunching(UIApplication app) { >> > try { >> > final NSURL url = NSURL.URLWithString("http://www.google.com"); >> > final NSMutableURLRequest req = new NSMutableURLRequest(url); >> > NSURLConnectionDelegate delegate = new NSURLConnectionDelegate() { >> > @Override >> > public void connectionDidFailWithError( >> > NSURLConnection connection, NSError error) { >> > super.connectionDidFailWithError(connection, error); >> > System.out.println("Error [" + error + "]"); >> > } >> > @Override >> > public void connectionDidFinishLoading( >> > NSURLConnection connection) { >> > super.connectionDidFinishLoading(connection); >> > finished = true; >> > System.out.println("Finish loading"); >> > } >> > @Override >> > public void connectionDidReceiveData( >> > NSURLConnection connection, NSData data) { >> > super.connectionDidReceiveData(connection, data); >> > System.out.println("Received data [" + new String(data.getBytes()) + >> "]"); >> > } >> > }; >> > NSURLConnection.connectionWithRequest(req, delegate); >> > // Wait until all the data has been received or we hit a >> > 20s limit. >> > int i = 0; >> > while (!finished && i < 20) { >> > Thread.sleep(1000); >> > i++; >> > } >> > } >> > catch (Exception e) { >> > System.err.println("Exception doing HTTP" + e); >> > } >> > } >> > >> > I would have expected multiple "Received Data[.......]" messages but I >> > only ever get one of 26 characters. I took a look at the NSData java >> > class, specifically the readData method and I can see why it is failing. >> > The do/while loop in there only continues to read data if its buffer has >> > been filled and assumes that if the read() method returns a read count >> > of less than the buffer size that all the data has been read. Using the >> > code above the response contains an initial 26 bytes and consequently >> > stops as the buffer in NSData has not been completely filled. I wrote an >> > equivalent pure java application and it exhibits the same behaviour >> > using the readData code. Rewriting the readData method so it keeps >> > reading until -1 is returned and buffering the code appropriately >> > retrieves all the data which is approximately 9k bytes. >> > >> > Is this a bug or have I done something wrong? Would the code work >> > properly if the application were running on an iPhone rather than in the >> > Emulator? >> > >> > Thanks, >> > Alex >> > >> > >> > >> > >> ------------------------------------------------------------------------------ >> > What Every C/C++ and Fortran developer Should Know! >> > Read this article and learn how Intel has extended the reach of its >> > next-generation tools to help Windows* and Linux* C/C++ and Fortran >> > developers boost performance applications - including clusters. >> > http://p.sf.net/sfu/intel-dev2devmay >> > >> > >> > >> > _______________________________________________ >> > xmlvm-users mailing list >> > xml...@li... >> > https://lists.sourceforge.net/lists/listinfo/xmlvm-users >> >> >> ------------------------------------------------------------------------------ >> What Every C/C++ and Fortran developer Should Know! >> Read this article and learn how Intel has extended the reach of its >> next-generation tools to help Windows* and Linux* C/C++ and Fortran >> developers boost performance applications - including clusters. >> http://p.sf.net/sfu/intel-dev2devmay >> _______________________________________________ >> xmlvm-users mailing list >> xml...@li... >> https://lists.sourceforge.net/lists/listinfo/xmlvm-users >> > > > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > |
From: Arno P. <ar...@pu...> - 2011-06-15 09:15:55
|
fixed. Couple of notes: - ReflectionTest is a console app. With the fix I just committed you can also run it with --target=iphonec, but note that the output will be on the console as ReflectionTest has no UI. - Note that the C backend does not yet support return types other than void for method invocations done via reflection. I will fix that soon. ReflectionTest does not do this, so it should work just fine. Arno On 6/15/11 2:32 AM, Sal wrote: > > Hello, > > I just did a fresh SVN checkout and built a test app via: > > java -Xmx700m -jar dist/xmlvm.jar --target=iphonec > --in=bin/org/xmlvm/test/ReflectionTest.class --out=ReflectionTest > > opened the xcode project, and get this error when building: > > /Users/username/Documents/iphonedev/xmlvm/ReflectionTest/dist/../build/xcode/src/app/native_org_xmlvm_runtime_XMLVMUtil.m:9:39: > error: org_xmlvm_iphone_NSString.h: No such file or directory > > Am I doing anything wrong? Thanks in advance for any help! > > - Sal > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > > > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |
From: Panayotis K. <pan...@pa...> - 2011-06-15 06:48:02
|
I am happy to announce that the demo projects that are inside the XMLVM repository now compile with the C backend! There is a recent update of the build scripts which allow on demand usage of C or Objective C backend. The parameter to control this is inside the "xmlvm.properties" file, property named "xmlvm.backend" You can upgrade your current projects with this command: xmlvm --skeleton=iphone:update --app-name=... --out=... Note, some files might need some manual fine-tuning, to inherit your project options |
From: Sal <sv...@gm...> - 2011-06-15 01:11:58
|
Ok - Found and manually added those missing files (is that correct?) But now the error is: /ReflectionTest/dist/../build/xcode/src/app/org_xmlvm_iphone_NSObject.h:26: error: 'XMLVM_ITABLE_SIZE_org_xmlvm_iphone_NSObject' undeclared here (not in a function) Let me know if any insight!! Thanks, - Sal On Tue, Jun 14, 2011 at 8:32 PM, Sal <sv...@gm...> wrote: > > Hello, > > I just did a fresh SVN checkout and built a test app via: > > java -Xmx700m -jar dist/xmlvm.jar --target=iphonec > --in=bin/org/xmlvm/test/ReflectionTest.class --out=ReflectionTest > > opened the xcode project, and get this error when building: > > /Users/username/Documents/iphonedev/xmlvm/ReflectionTest/dist/../build/xcode/src/app/native_org_xmlvm_runtime_XMLVMUtil.m:9:39: > error: org_xmlvm_iphone_NSString.h: No such file or directory > > Am I doing anything wrong? Thanks in advance for any help! > > - Sal > |
From: Sal <sv...@gm...> - 2011-06-15 00:32:36
|
Hello, I just did a fresh SVN checkout and built a test app via: java -Xmx700m -jar dist/xmlvm.jar --target=iphonec --in=bin/org/xmlvm/test/ReflectionTest.class --out=ReflectionTest opened the xcode project, and get this error when building: /Users/username/Documents/iphonedev/xmlvm/ReflectionTest/dist/../build/xcode/src/app/native_org_xmlvm_runtime_XMLVMUtil.m:9:39: error: org_xmlvm_iphone_NSString.h: No such file or directory Am I doing anything wrong? Thanks in advance for any help! - Sal |
From: Panayotis K. <pan...@pa...> - 2011-06-14 14:43:12
|
On 14 Ιουν 2011, at 4:47 μ.μ., Yenwen Feng wrote: > Hi, > > This is my first time trying out XMLVM. I was able to compile the project, but failed to compile the demos. > Below is the exception I got: > > BUILD FAILED > D:\java\xmlvm\build.xml:340: The following error occurred while executing this line: > D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\nbproject\xmlvm.xml:95: The following error occurred while executing this line: > D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\nbproject\build-Xcode.xml:48: java.io.IOException: Unable to use path D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\build\plugins\objc > at org.xmlvm.ant.SrcPluginExtractor.execute(SrcPluginExtractor.java:90) > at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) > at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) > > > > > After taking a look at the source code, I found out that there is a absolute path problem in SrcPluginExtractor.java. > See below: > > ### Eclipse Workspace Patch 1.0 > #P xmlvm > Index: src/tools/ant/xcode-updater/org/xmlvm/ant/SrcPluginExtractor.java > =================================================================== > --- src/tools/ant/xcode-updater/org/xmlvm/ant/SrcPluginExtractor.java (revision 1718) > +++ src/tools/ant/xcode-updater/org/xmlvm/ant/SrcPluginExtractor.java (working copy) > @@ -144,8 +144,9 @@ > } > > private File getProjectFile(String path) { > - if (path.startsWith("/")) > - return new File(path); > + File p = new File(path); > + if(p.isAbsolute()) > + return p; > return new File(getProject().getBaseDir(), path).getAbsoluteFile(); > } > > > How this helps. Please note that an iPhone project can only be compiled with a Mac. You can not compile it under Windows. |
From: Yenwen F. <tem...@gm...> - 2011-06-14 13:47:57
|
Hi, This is my first time trying out XMLVM. I was able to compile the project, but failed to compile the demos. Below is the exception I got: BUILD FAILED D:\java\xmlvm\build.xml:340: The following error occurred while executing this line: D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\nbproject\xmlvm.xml:95: The following error occurred while executing this line: D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\nbproject\build-Xcode.xml:48: java.io.IOException: Unable to use path D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\D:\java\xmlvm\demo\iphone\ihelloworld\fullscreen\build\plugins\objc at org.xmlvm.ant.SrcPluginExtractor.execute(SrcPluginExtractor.java:90) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) After taking a look at the source code, I found out that there is a absolute path problem in SrcPluginExtractor.java. See below: ### Eclipse Workspace Patch 1.0 #P xmlvm Index: src/tools/ant/xcode-updater/org/xmlvm/ant/SrcPluginExtractor.java =================================================================== --- src/tools/ant/xcode-updater/org/xmlvm/ant/SrcPluginExtractor.java (revision 1718) +++ src/tools/ant/xcode-updater/org/xmlvm/ant/SrcPluginExtractor.java (working copy) @@ -144,8 +144,9 @@ } private File getProjectFile(String path) { - if (path.startsWith("/")) - return new File(path); + File p = new File(path); + if(p.isAbsolute()) + return p; return new File(getProject().getBaseDir(), path).getAbsoluteFile(); } How this helps. BR, Yenwen |
From: Daniel v. d. H. <mo...@da...> - 2011-06-10 21:54:22
|
Hello,the survey results are available online at:English: http://www.slideshare.net/dvdh/survey-results-cross-platform-development-of-mobile-applicationsDeutsch: http://www.slideshare.net/dvdh/umfrageergebnisse-crossplatform-entwicklung-mobiler-anwendungenThank you again for your participation and patience!Best regardsDaniel von der Helm |
From: Arno P. <ar...@pu...> - 2011-05-30 07:08:56
|
you use Long.toString(long, int) in your program but that method isn't implemented for the Objective-C backend. You can either implement the missing method or try the C backend. Arno On 5/29/11 11:29 PM, cpsingh wrote: > Hi Arno > I am getting the following error message when i am executing the App. My > app is made in Java and converted in Iphone using Mac. > [Session started at 2011-05-29 19:40:22 +0530.] > 2011-05-29 19:40:25.492 Untitled[5369:207] +[java_lang_Long > toString___long_int::]: unrecognized selector sent to class 0xcaa80 > 2011-05-29 19:40:25.496 Untitled[5369:207] *** Terminating app due to > uncaught exception 'NSInvalidArgumentException', reason: > '+[java_lang_Long toString___long_int::]: unrecognized selector sent to > class 0xcaa80' > *** Call stack at first throw: > ( > 0 CoreFoundation 0x00f2bbe9 __exceptionPreprocess + 185 > 1 libobjc.A.dylib 0x010805c2 objc_exception_throw + 47 > 2 CoreFoundation 0x00f2d7bb +[NSObject(NSObject) > doesNotRecognizeSelector:] + 187 > 3 CoreFoundation 0x00e9d366 ___forwarding___ + 966 > 4 CoreFoundation 0x00e9cf22 _CF_forwarding_prep_0 + 50 > 5 Untitled 0x00006296 -[counterfeit_tms_OTPAlgo > byteArrayToHex___byte_ARRAYTYPE:] + 979 > 6 Untitled 0x00008d63 +[counterfeit_tms_OTPAlgo > main___java_lang_String_ARRAYTYPE:] + 464 > 7 Untitled 0x000095db main + 278 > 8 Untitled 0x00001e75 start + 53 > ) > terminate called after throwing an instance of 'NSException' |
From: cpsingh <cp...@ak...> - 2011-05-30 06:30:09
|
Hi Arno I am getting the following error message when i am executing the App. My app is made in Java and converted in Iphone using Mac. [Session started at 2011-05-29 19:40:22 +0530.] 2011-05-29 19:40:25.492 Untitled[5369:207] +[java_lang_Long toString___long_int::]: unrecognized selector sent to class 0xcaa80 2011-05-29 19:40:25.496 Untitled[5369:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[java_lang_Long toString___long_int::]: unrecognized selector sent to class 0xcaa80' *** Call stack at first throw: ( 0 CoreFoundation 0x00f2bbe9 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x010805c2 objc_exception_throw + 47 2 CoreFoundation 0x00f2d7bb +[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3 CoreFoundation 0x00e9d366 ___forwarding___ + 966 4 CoreFoundation 0x00e9cf22 _CF_forwarding_prep_0 + 50 5 Untitled 0x00006296 -[counterfeit_tms_OTPAlgo byteArrayToHex___byte_ARRAYTYPE:] + 979 6 Untitled 0x00008d63 +[counterfeit_tms_OTPAlgo main___java_lang_String_ARRAYTYPE:] + 464 7 Untitled 0x000095db main + 278 8 Untitled 0x00001e75 start + 53 ) terminate called after throwing an instance of 'NSException' |
From: Paul P. <bay...@gm...> - 2011-05-26 16:35:04
|
That's good! I'll get off my soapbox :) On Thu, May 26, 2011 at 11:11 AM, Panayotis Katsaloulis < pan...@pa...> wrote: > > On May 25, 2011, at 5:55 PM, Paul Poley wrote: > > > I'm going to go off on a tangent here, not really directed at this > conversation, but somewhat relevant. > > > > My opinion is that reflection is a necessary evil that should be avoided > whenever possible. One of the key words in that is "necessary." A great > use of reflection is for web services or other generated code. And that > equivalent is appropriately used in XMLVM. I believe it is okay in this > type of situation because all parts using reflection are generated & not > typed by hand. E.g. a web service is generated & a client is generated, so > if an update occurs, we just regenerate. > > > > The "evil" part, in my opinion, comes when developers are manually typing > method names & class names into Strings, thus avoiding the compiler. This > is unfortunately not a rarity in the real world, such as in configuration > files. My hope is that as annotations gain muster, they will help squash > that practice where they can. > > > > I realize there are exceptions to what I just said, but I still try to > avoid it at all costs. Since reflection is learned at a more advanced > stage, it seems it is sometimes considered advantageous & advanced to use > it, but I believe that to be a misconception. > > > > Anyways, I am not trying to contradict anything in this email chain, but > rather just get on my soapbox about "evil" reflection & have a conversation > in general. I'm interested if anyone has some other thoughts on this. > > > > Paul > > Exactly, this is the spirit of this change - to get rid of reflection. :) > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > |
From: Panayotis K. <pan...@pa...> - 2011-05-26 16:11:16
|
On May 25, 2011, at 5:55 PM, Paul Poley wrote: > I'm going to go off on a tangent here, not really directed at this conversation, but somewhat relevant. > > My opinion is that reflection is a necessary evil that should be avoided whenever possible. One of the key words in that is "necessary." A great use of reflection is for web services or other generated code. And that equivalent is appropriately used in XMLVM. I believe it is okay in this type of situation because all parts using reflection are generated & not typed by hand. E.g. a web service is generated & a client is generated, so if an update occurs, we just regenerate. > > The "evil" part, in my opinion, comes when developers are manually typing method names & class names into Strings, thus avoiding the compiler. This is unfortunately not a rarity in the real world, such as in configuration files. My hope is that as annotations gain muster, they will help squash that practice where they can. > > I realize there are exceptions to what I just said, but I still try to avoid it at all costs. Since reflection is learned at a more advanced stage, it seems it is sometimes considered advantageous & advanced to use it, but I believe that to be a misconception. > > Anyways, I am not trying to contradict anything in this email chain, but rather just get on my soapbox about "evil" reflection & have a conversation in general. I'm interested if anyone has some other thoughts on this. > > Paul Exactly, this is the spirit of this change - to get rid of reflection. :) |
From: Paul P. <bay...@gm...> - 2011-05-25 14:55:51
|
I'm going to go off on a tangent here, not really directed at this conversation, but somewhat relevant. My opinion is that reflection is a necessary evil that should be avoided whenever possible. One of the key words in that is "necessary." A great use of reflection is for web services or other generated code. And that equivalent is appropriately used in XMLVM. I believe it is okay in this type of situation because all parts using reflection are generated & not typed by hand. E.g. a web service is generated & a client is generated, so if an update occurs, we just regenerate. The "evil" part, in my opinion, comes when developers are manually typing method names & class names into Strings, thus avoiding the compiler. This is unfortunately not a rarity in the real world, such as in configuration files. My hope is that as annotations gain muster, they will help squash that practice where they can. I realize there are exceptions to what I just said, but I still try to avoid it at all costs. Since reflection is learned at a more advanced stage, it seems it is sometimes considered advantageous & advanced to use it, but I believe that to be a misconception. Anyways, I am not trying to contradict anything in this email chain, but rather just get on my soapbox about "evil" reflection & have a conversation in general. I'm interested if anyone has some other thoughts on this. Paul On Fri, May 20, 2011 at 2:10 AM, Panayotis Katsaloulis < pan...@pa...> wrote: > > On May 20, 2011, at 9:56 AM, Arno Puder wrote: > > > hmm. Do you want to be able to call arbitrary *methods* or a certain > method on arbitrary *objects*? For the former you need reflected, for > the latter not. Actually, take a look at [DispatcherObject run] (in > NSObject.m) to get an idea how you can invoke a Java method from C code. > > > > certain method, arbitrary objects. > I did, I actually found these two parts: > java_lang_reflect_Method* method = (*(JAVA_OBJECT (*)(JAVA_OBJECT, > JAVA_OBJECT, JAVA_OBJECT)) targetClass->tib->vtable[ > XMLVM_VTABLE_IDX_java_lang_Class_getMethod___java_lang_String_java_lang_Class_1ARRAY])(targetClass, > methodName, paramTypes); > and > (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT, JAVA_OBJECT)) method->tib-> > vtable[ > XMLVM_VTABLE_IDX_java_lang_reflect_Method_invoke___java_lang_Object_java_lang_Object_1ARRAY])(method, > target, params); > but I am a bit confused how to decode it. > Moreover it seems that they use reflection - that's why I asked. > > > And a last probably silly question: > > How do I convert an ObjC String to java_lang_String ? > > (and for completeness and back?) > > > NSString* toNSString(JAVA_OBJECT o) > JAVA_OBJECT toJavaString(NSString* str) > > both defined in NSString.m > > > Oh , I missed that part - I was looking under java_lang_String :) > > > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > |
From: Domenico De F. <dom...@gm...> - 2011-05-23 10:22:03
|
Hi all, I spread the voice about my Java2iPhone project and the many wonders of XMLVM :-) A colleague now asks me to try to cross-compile an Android application to iPhone, something I've never tried. Starting from the Eclipse project, I created an XMLVM migration project followig the documentation and tried to cross-compile. I have a couple of questions about this now: 1) Is it still possible, from the XMLVM project, to run the app in the Android simulator? I tried to set the External Tool Configuration to the -run-Android target but it seems it runs the cross-compilation every time. Also, I tried the simple Run As Android Application but I get some errors on the XMLVM build files that should not be involved in the process. 2) This is something I never really understood also in Java2iPhone: If my project uses some external libraries like, let's say, a JSON parser, how can I tell XMLVM to cross-compile them too? In Java2iPhone when I had the necessity, I just retrieved the Java source code for the library and imported it in my project; however it seems to be reasonable that it should be possible to directly tell XMLVM to cross-compile the jar file since it contains .class files too. Is it done using the -in argument? In that case, is there a way of using it without the need for the command line? It would be more confortable to launch XMLVM from eclipse just setting the -in argument somewhere, instead of having to compile the java project and then use the command line to run XMLVM. Thank you for your help! -- Domenico De Fano |
From: Arno P. <ar...@pu...> - 2011-05-21 21:29:55
|
ah, ok. Now I understand. That should be OK. The values will be cast to an unsigned short by the C compiler. Perhaps it would be better to emit an unsigned short for clarity, but the current version should still be correct. Arno On 5/20/11 12:14 AM, Panayotis Katsaloulis wrote: > > On May 20, 2011, at 9:58 AM, Arno Puder wrote: > >> >> please send a small, self-contained example. >> >> Arno > > The iFireworks project. > There are 13 entries like this. > For a quick list: > cat .../constant_pool.m | grep JAVA_ARRAY_CHAR | grep - > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |
From: Markus B. <mar...@go...> - 2011-05-20 10:37:52
|
Thank you. That's just the information I needed. 2011/5/19 Arno Puder <ar...@pu...> > > > On 5/19/11 12:28 AM, Markus Balsam wrote: > >> Hello Arno, >> >> first of all thanks for your quick response! >> >> to 1. I am aware that I can see the API in the locations you mentioned. >> I asked that question with some written/detailed documentation in mind. >> But I guess the official Android/iOS documentations will be ok. >> > > I would consider this a key aspect of XMLVM: you can use the official > Android and iOS documentation. > > > to 2. I know that your API doesn't feature all the Cocoa classes and I >> am sure that your API is correct. What I really wanted to know was if >> the classes themselves are complete, meaning that for example your >> WebView implementation features ALL the methods the UIWebView class has. >> > > Not every compatibility class has all the methods. You will need to check > that with the official documentation. > > > to 4. In my case it is very important that I can send http requests and >> handle either json or xml responses. Is that possible with your current >> API? >> > > HTTP requests are supported. We are currently working on XML parsing > support for the C backend. For json I imagine it is just a matter of > including an appropriate implementation via --in=json-impl.jar > > Arno > |
From: Panayotis K. <pan...@pa...> - 2011-05-20 07:53:06
|
On May 20, 2011, at 10:14 AM, Panayotis Katsaloulis wrote: > > On May 20, 2011, at 9:58 AM, Arno Puder wrote: > >> >> please send a small, self-contained example. >> >> Arno > > The iFireworks project. > There are 13 entries like this. > For a quick list: > cat .../constant_pool.m | grep JAVA_ARRAY_CHAR | grep - I was also trying to add a simple unicode string in the beginning of this demo. Namely at the very beginning after applicationDidFinishLaunching, I added this code: System.out.println("QQQQ-Καλημέρα!"); I checked it and this does not contain any negative values. When run, Xcode fails to attach to the executable and the binary crashes. |
From: Panayotis K. <pan...@pa...> - 2011-05-20 07:15:02
|
On May 20, 2011, at 9:58 AM, Arno Puder wrote: > > please send a small, self-contained example. > > Arno The iFireworks project. There are 13 entries like this. For a quick list: cat .../constant_pool.m | grep JAVA_ARRAY_CHAR | grep - |
From: Panayotis K. <pan...@pa...> - 2011-05-20 07:10:45
|
On May 20, 2011, at 9:56 AM, Arno Puder wrote: > > hmm. Do you want to be able to call arbitrary *methods* or a certain > method on arbitrary *objects*? For the former you need reflected, for > the latter not. Actually, take a look at [DispatcherObject run] (in > NSObject.m) to get an idea how you can invoke a Java method from C code. certain method, arbitrary objects. I did, I actually found these two parts: java_lang_reflect_Method* method = (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT, JAVA_OBJECT)) targetClass->tib->vtable[XMLVM_VTABLE_IDX_java_lang_Class_getMethod___java_lang_String_java_lang_Class_1ARRAY])(targetClass, methodName, paramTypes); and (*(JAVA_OBJECT (*)(JAVA_OBJECT, JAVA_OBJECT, JAVA_OBJECT)) method->tib->vtable[XMLVM_VTABLE_IDX_java_lang_reflect_Method_invoke___java_lang_Object_java_lang_Object_1ARRAY])(method, target, params); but I am a bit confused how to decode it. Moreover it seems that they use reflection - that's why I asked. >> And a last probably silly question: >> How do I convert an ObjC String to java_lang_String ? >> (and for completeness and back?) > > NSString* toNSString(JAVA_OBJECT o) > JAVA_OBJECT toJavaString(NSString* str) > > both defined in NSString.m > Oh , I missed that part - I was looking under java_lang_String :) |
From: Arno P. <ar...@pu...> - 2011-05-20 06:58:17
|
please send a small, self-contained example. Arno On 5/19/11 11:56 PM, Panayotis Katsaloulis wrote: > Hello all! > > When I had a peek at the file constant_pool.m (whereI believe is the pool for all static Strings), I found some entries with negative values. > Since the Java char datatype is an unsigned short, I have the feeling that these numbers are not right. > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |
From: Arno P. <ar...@pu...> - 2011-05-20 06:57:06
|
On 5/19/11 11:47 PM, Panayotis Katsaloulis wrote: >>> 1) what is the reason of this variable >>> >>> static NSObject* dispatchObject = nil; >>> >>> in the NSObject class of the C backend? >> >> The C wrapper use this object to call the performSelectorOnMainThread: >> method on a real Objective-C object. > > The reason I ask is because I can not find it anywhere in the code, and probably it is a leftover. ah, ok, you are right. It is indeed a left-over. The dispatcher object is created in performSelectorOnMainThread. >>> 2) I have a JAVA_OBJECT , say "o1" >>> This object, (in java) it has a specific method, let's say >>> public void myMethod(Object val) {..} >>> >>> How do I call this method from inside C, given I have the pointer o1 of this object? >> >> It depends if the call is made through an interface type or class type. >> I suggest that you write a mini-Java program that does this call (in >> Java) and then cross-compile it with --target=posix. Then you can look >> at the generated code. > > I want to do this in the compatibility library for arbitrary objects, in order to implement a method of an interface, so I don't know in advance what this would be. > Do you believe I should use reflection then? hmm. Do you want to be able to call arbitrary *methods* or a certain method on arbitrary *objects*? For the former you need reflected, for the latter not. Actually, take a look at [DispatcherObject run] (in NSObject.m) to get an idea how you can invoke a Java method from C code. > And a last probably silly question: > How do I convert an ObjC String to java_lang_String ? > (and for completeness and back?) NSString* toNSString(JAVA_OBJECT o) JAVA_OBJECT toJavaString(NSString* str) both defined in NSString.m Arno |
From: Panayotis K. <pan...@pa...> - 2011-05-20 06:56:33
|
Hello all! When I had a peek at the file constant_pool.m (whereI believe is the pool for all static Strings), I found some entries with negative values. Since the Java char datatype is an unsigned short, I have the feeling that these numbers are not right. |
From: Panayotis K. <pan...@pa...> - 2011-05-20 06:47:33
|
First of all, thank you Arno for being for one more time helpful. On May 20, 2011, at 4:18 AM, Arno Puder wrote: > > > On 5/19/11 4:35 PM, Panayotis Katsaloulis wrote: >> I have two questions: >> >> 1) what is the reason of this variable >> >> static NSObject* dispatchObject = nil; >> >> in the NSObject class of the C backend? > > The C wrapper use this object to call the performSelectorOnMainThread: > method on a real Objective-C object. The reason I ask is because I can not find it anywhere in the code, and probably it is a leftover. >> 2) I have a JAVA_OBJECT , say "o1" >> This object, (in java) it has a specific method, let's say >> public void myMethod(Object val) {..} >> >> How do I call this method from inside C, given I have the pointer o1 of this object? > > It depends if the call is made through an interface type or class type. > I suggest that you write a mini-Java program that does this call (in > Java) and then cross-compile it with --target=posix. Then you can look > at the generated code. I want to do this in the compatibility library for arbitrary objects, in order to implement a method of an interface, so I don't know in advance what this would be. Do you believe I should use reflection then? And a last probably silly question: How do I convert an ObjC String to java_lang_String ? (and for completeness and back?) |
From: Arno P. <ar...@pu...> - 2011-05-20 01:19:20
|
On 5/19/11 4:35 PM, Panayotis Katsaloulis wrote: > I have two questions: > > 1) what is the reason of this variable > > static NSObject* dispatchObject = nil; > > in the NSObject class of the C backend? The C wrapper use this object to call the performSelectorOnMainThread: method on a real Objective-C object. > 2) I have a JAVA_OBJECT , say "o1" > This object, (in java) it has a specific method, let's say > public void myMethod(Object val) {..} > > How do I call this method from inside C, given I have the pointer o1 of this object? It depends if the call is made through an interface type or class type. I suggest that you write a mini-Java program that does this call (in Java) and then cross-compile it with --target=posix. Then you can look at the generated code. Arno |