Checkstyle for ActionScript (Flex) - apache-flex

HI,
I'm currently working on a project that uses Flex and Java. In Java we easily enforced a coding standard with Checkstyle, and we want to do this for Flex.
Does anybody know of a tool similar to Checkstyle that would allow coding standard checks?
(I've googled for this but found only one project written in python and it seams abandoned)
Thanks

The long and the short is that there is... kind of, but only for Actionscript, and you have to test it yourself... There is a prototype of an Actionscript 3 version, but it is not even in Beta yet (and I admit that I haven't had the time to test it). I haven't found anything similar for XML, let alone MXML. This is in at least one list of feature requests for Flex 4, however.

I'm working too on a project uses Flex and Java. Like you, in Java, we easily use plugins like checkstyle, findBug, javaNcss or PMD. My personal project is to do this for Flex. I have test the prototype 'checkStyleas3' but it just verify the code source en returns you 0 or -1 as result. So you will have (me too in fact), to implement this prototype if you want to do more than that.

Keep an eye on this : http://blog.joa-ebert.com/2009/05/20/as3v-preview/

Related

Avalonedit Show syntax error

when I develop a custom language IDE using avalonedit, I encountered a problem. I use regex to check the syntax, and it works as designed. However, I want to show the syntax error with wave text mark. I did search at google, yet the solution is either outdated or not feasible. Any ideas? Thanks ahead.
AvalonEdit does not have this functionality built-in. However it provides all the infrastructure needed to implement it yourself. In the SharpDevelop IDE we have an implementation that should suit your needs.
You'll need some of the code from the SharpDevelop repository (https://github.com/icsharpcode/SharpDevelop/):
TextMarkerService, TextMarker
and its related interfaces and enums.
To make it easier for you, I have created a small sample application:
https://github.com/siegfriedpammer/AvalonEditSamples/tree/master/TextMarkerSample
It uses the AvalonEdit 5 nuget package and contains the classes mentioned above, plus a WPF Window to test it.

Unstructured Actionscript file and ActionScript Class?

I am new in ActionScript . I want to know that when should we use an Unstructured ActionScript file and when should we make a Class of ActionScript file? Does it effect the performance of Application ?If yes , HOW??? Please help me finding the comprehensive answer of above question.
Thanks!
Regards
I can only think of a handful of instances in which it might make sense to use a non-class based structure in an ActionScript project:
You're quickly prototyping a simple piece of functionality (even then it's just as easy, assuming you're using ActionScript 3.0, to put your code in a class and set it as the Document as it is to use a non-class file via include)
You're dealing with non-class based legacy code
You're using the timeline to structure your code (usually not a great idea for anything much more complicated than a banner)
You're writing your project in ActionScript 1.0 (in which case you should really consider upgrading)
In all other cases, the tiny hit in performance resulting from the additional scaffolding of a class-based system will be more than offset by the advantages of it being well-structured.
If you're using Flex, I think you'll have to work quite hard not to use classes.

Is there something like .NET Reflector for Qt?

Once I've seen a nice tool called .NET Reflector. It can show the entire object hierarchy of .Net binaries/apps (sorry if the term is wrong).
Is there something like this for Qt? As Qt has very good QMetaObject abilities, it should be possible to traverse object-trees, call methods(slots), change properties, etc.
I am currently re-factoring a Qt project. The naming of variables is very domain specific and I am not the expert in this domain. So, it is difficult for me to map a widget-variable to the widget on the screen. Such tool would be a great help for me to understand the code.
Thank you very much in advance!
For simple uses you might want to take a look at QObject::dumpObjectTree()
If you need something more advanced there's kspy
kspy: examines the internal state of a
Qt/KDE app KSpy is a tiny library
which can be used to graphically
display the QObjects in use by a
Qt/KDE app. In addition to the object
tree, you can also view the
properties, signals and slots of any
QObject. Basically it provides much
the same info as
QObject::dumpObjectTree() and
QObject::dumpObjectInfo(), but in a
much more convenient form. KSpy has
minimal overhead for the application,
because the kspy library is loaded
dynamically using KLibLoader. See /usr
/share/doc/kspy/README for usage
instructions. This package is part of
the KDE Software Development Kit.
It depends on KDE's klibloader so if you are not under KDE you have to modify it but it should be rather easy. Sources are here.
There's QSpy project. It inspects all QWidgets of running application. I'm not sure how well it works, because I couldn't use it on Mac OS X. Maybe on Windows it works better. https://github.com/sashao/martlet
http://qt-apps.org/content/show.php/QSpy?content=102287

Updating a Sharepoint List from flex

I have been trying to find a way to connect Flex to sharepoint in an elegant way that allows me to update lists, build charts, and create widgets with FLEX on the client-side. I have researched this extensively but I am running into circles.
I understand the basics of Flex data connection/webservices/etc... , I just can't seem to get my head around how to use the sharepoint list services.
Does anybody out there have a nice detailed example of what I'm trying to achieve? Simple examples work too! :)
Thanks so much Everyone!
-E.
Look at the "SOAP query example" or the WSDL from the SharePoint web-service (e.g. .../_vti_bin/lists.asmx?op=GetListItems or ../_vti_bin/lists.asmx?op=GetListItems&WSDL) and then look at the corresponding MSDN documentation (such as GetListItems) on how to "use" the web-service.
It takes a little bit of familiarity to "know" to map viewFields with <viewFields>...</viewFields> (most work like this), but... the MSDN documentation (if prodded carefully) says "what" to put in the XML where the WSDL just gives the near-useless outline. There are a number of examples in the tubes (and related SO questions) of hand-rolled SOAP access for SP for various tasks.
Microsoft also has some Open Specifications -- the link is always hard for me to find. Lots of stuff under the SharePoint branch. YMMV and it's mostly white-paper, but a good resource.
Not sure what tools Flex has but because of the limited WSDL support, most of the mapping has to be hand-coded or come from a better definition source -- hopefully "an existing library" which can be used directly or modified-to-suit.
I would highly recommend using a tool for testing the service access -- e.g. soapUI, which actually has a horrid UI -- because even the littlest error will come back with a cryptic error messages. Also, make sure to use SOAP 1.2.
Happy (less than maximal pain) coding.
P.S. A more specific question about a specific web-service would likely yield better responses.

SQLite with MFC

I want to use SQLite within my MFC application.
for that, i'll create an object whose job is to interact directly with the DB(SQLite) to insulate the rest of the app from the DB code.
can anyone point me to a good tutorial ?
i'll need operations such as (create,delete,insert,update,createdb,dropdb and so on...)
Thanks.
There's a page in the SQLite site that lists many available wrappers - here. The C++ wrapper Daniel mentions in his answer is probably the most common one, though it does not support Unicode and the SQLite dll that comes with it is quite dated. There's a Unicode version of that wrapper here, but it's a bit buggy and requires some more work. It could, however, save you the trouble of writing the whole thing from scratch.
Have a look at this. This was really easy to port to MFC classes, but it will get you started.
http://www.codeproject.com/KB/database/CppSQLite.aspx
Or you can just do #include "sqlite3.h", add sqlite3.lib to your linker and use sqlite3.dll directly with the C api. That's what I did in my MFC app.
And you can even statically link sqlite3 into your app. Download the amalgamation and include it! It adds about 400 k.
Please define your problem more clearly.
sqlite can be coding with c, and you can read the sample in their site.

Resources