DreamBoard Native Functions - ios

Does anyone have a list of native DreamBoard functions?
For instance: nothing, ScrollViewDidScroll (which seems to be == to 'nothing'), stop, etc.
I can't find one in the docs. Also, the "Actions" syntax is oddly reminiscent of javascript, does this mean there's a setTimeout or wait equivalent? Please excuse the poor tagging. If you need me to be more detailed or specific, just ask.

Related

How to write checkers for searching specific system calls?

I'm still new and learning the way to write checkers for static clang analyzer. I need to do the checker on Linux based, and I've read a lot of materials from blogs and websites, but almost all of them are based on Xcode, and none of them are telling me how to search a specific system call.
I'm trying to write a checker on Linux which can tell users that the system call they are using is dangerous, and showing the reason why it may be leak.
Could anyone tell me if it is possible to do this kind of checker? And if it could be made, how should I do or where can I find these materials to do it?
This guide, How to write a Checker in 24 hours is pretty informative and includes an example of identifying calls to fopen around the 34th slide. I highly recommend looking at it yourself but I'll try and summarize the most relevant parts to get you started.
Each checker registers callback functions that are called to check certain properties. In your case your checker will make use of a call event function:
void checkPostCall(const CallEvent &Call, CheckerContext &C) const;
This member function on your checker will get called every time the static analyzer engine comes across a call event. You simply need to define your function to check if the call event is to the system call your are checking for. In the linked example they are looking for calls to fopen and so the beginning of their checkPostCall function looks something like this:
if(Call.isGlobalCFunction("fopen"))
//do stuff
Hopefully that's enough to help get your started!

Table with methods, how to handle/inspect them?

So without the context, I have a method that returns a table.
Trying to print it out, it seems that the table mainly contains methods to be called.
However not being very knowledgeable in LUA, i have no idea how to properly get some information about these methods i should call.
I tried to get documentation from the creator of the thing, but there is none as far as i know. And since this is inside computercraft (minecraft mod) i don't have a lot of features to rely on either.
So knowing only that it is a table with methods that i can call, how do i properly figure out how to call them, and with what parameters etc. ?
Generally speaking, modules/ libraries always come with docs, or a method to print the docs.
But if this is not the case, here's what you can do:
You can print everything in the table! This is a must, the names of the methods can be very useful
You can seek out help! Find people who have used the same module, and ask them how it works. Why solve something others have already figured out?
Use debug.getinfo and other hacky functions for the debug library! They can provide more info than anything else in the Lua standard libraries!
C-Side coding can reveal what Lua cannot! If you have access to the C-Side you can see exactly what the code is doing (or at least I think so)
Check out the source code! This shows you what the code does and how it does it
And above all else, experiment! Try the methods on different parameters, different values, and identify what it does through continuous testing!
Just knowing the names of the methods is not enough to figure how to call them.
Their names may be a clue, but there is no guarantee.
If the methods are written in Lua, you could use the debug API to discover the names of parameters, which again may just be an indication of how to call the methods.
Bottom line: you need documentation or example code.
I knew this existed, didn't know how it worked. So for future reference:
You can dump your peripherals and methods by doing /op_dump in the minecraft chat.
This generates an XML which writes out all methods it has found in peripherals OR objects/tables.
This means that you have to call every interesting method once, which generates the table as return. And then calling /op_dump will include that newly encountered object with all information about there methods/parameters etc.

How to capture keystrokes?

I'd like to make a simple Erlang console game. I need to control my "car" in that game by key strokes - key up or W key. Is there any way to do that? I read that wx library has such capability but I'm looking for something simple and in my opinion wx library is overkill. I want to grab an event not the character from stdin.
EDIT:
Ok, I've choosen ncurses and cecho as a Erlang library for that.
I know only 2 way to do this: gs and wx.
gs is a bit simpler but the first line of the documentation is a warning telling that gs is not recommended for new application, use wx instead :o)
wx isn't so complex, but its documentation is really poor, and simply refers to wxWidget one. at least there are some demo (demo, sudoku, xrc...) that helps to start to build something. And once you succeed to have your first panels and sizers working, it is really simple to get the key stroke or mouse events an react on them. My main difficulty was in displaying graphical things fast and smooth enough even if at the end it is only a few lines of code (a few 10s).
finally, the erlang console is meant to evaluate erlang expression, so there is no chance that you can capture simple event and control the display in that environment (at a reasonable effort at least).
You can try study kernel's modules group and user_drv but they both has undocumented interface and can be subject of change in any future Erlang/OPT version. You can also made your own driver or NIF to handle termios settings and make your own implementation.
BTW I would definitely stick with wx.

dwscript - can anyone help with editor-debugger examples please?

I'm looking at the excellent dwscript for Delphi see here which provides a useful set of classes to implement a built in pascal script for your Application. I would very much appreciate some help with an example of how to link together the supplied debugging interface with an editor so that I can create breakpoints (and ideally see watches). Has anyone gone along this route please?
Thanks,
Brian
Most of the debugger doc is currently in this post
http://delphitools.info/2010/12/03/spotlight-on-dwss-idebugger/
Also the debugger interface hasn't changed much (if at all) since the original DWScript II (on SourceForge), so the old demos there should hopefully still work with minimal adjustments.
http://sourceforge.net/projects/dws/
For breakpoints, you basically just check the source position of the Expr you get in DoDebug/OnDebug against the list of breakpoints. One simple and efficient way is to merely use TBits -using it as a boolean array of which lines have a breakpoint).
Evaluating/watching requires looking up a symbol, which will give you it's stack address, you can then lookup the value in the stack.
I'll try to add/update a debugging tasks demo for v2.2 (unless someone else does it before me ;) )
edit: as of 11-02-14 there is a TdwsDebugger component to facilitate debugging tasks.

Communication between delphi application and Windows NT system driver

I am trying to build a very simple driver. Its sole purpose will be to register "PsSetCreateProcessNotifyRoutine" and on callbacks recieved from kernel, notify my Win32 application about which proccesses are started and stoped.
I only know how to build such a simple driver with "DriverEntry" and "DriverUnload" and compile it with DDK. But I don't know how to actually implement communication. I know it can be done with IOCTL. But beyond that I am in the dark. I cannot find simple example of how to do that in Delphi. I only know it can be done.
So what I am looking for is some simple and understandable tutorial on how to do it or event better an example delphi program with acompaniying driver code. Maybe there are even other ways of communication.
Any help would be appriciated.
Doesn't matter if in Delphi or not. You have to use the function DeviceIoControl. Read the article in MSDN about it.
In short, you'll have to choose some IOCTL codes from the available set. Then you call DeviceIoControl with one of these codes and pass some data, and in driver you handle that request and return something else.
You can also handle standard IOCTLS, such as the ones generated by calling ReadFile or WriteFile in user-mode.
Don't look for a "tutorial how to do that in Delphi", just look for any tutorial. They're all the same, no matter the language, it's pure Win32/Native api stuff. Here's one for example, just googled it out.

Resources