<?xml version="1.0" encoding="UTF-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="en-US">
	<title>NoshBar's Dumping Ground</title>
	<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php" />
	<modified>2026-09-12T05:24:18Z</modified>
	<author>
		<name>NoshBar</name>
	</author>
	<copyright>Copyright 2026, NoshBar</copyright>
	<generator url="http://www.sourceforge.net/projects/sphpblog" version="0.7.0">SPHPBLOG</generator>
	<entry>
		<title>Howto quickly change permissions and delete a folder.</title>
		<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry140511-170330" />
		<content type="text/html" mode="escaped"><![CDATA[Ever had one of those folders that doesn&#039;t technically belong to you and -even though you&#039;ve got Administrator rights- you can&#039;t delete it?<br /><br />The usual way is to right-click the folder, select security, click advanced, change the owner of it and all subitems to you, then accept, then right-click and open it again so that you can grant full rights on the folder to you...<br /><br />Well, say now you want to do this for a bunch of folders, say an existing Windows installation on a drive you&#039;re using from within a newer Windows installation... it&#039;s a huge pain in the gluteus maximus.<br /><br />Why not <strike>Zoidberg</strike> a DOS batch file?<br /><pre>takeown /F %1\* /R /A<br />icacls %1\*.* /T /grant administrators:F<br />rmdir /S /Q %1</pre><br />Example usage: <code>deleteit.bat e:\windows</code><br /><br /><strong>Note:</strong> if <code>icacls</code> is not available, try just <code>cacls</code> which also works, but first prompts you if you&#039;re sure.]]></content>
		<id>http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry140511-170330</id>
		<issued>2014-05-11T00:00:00Z</issued>
		<modified>2014-05-11T00:00:00Z</modified>
	</entry>
	<entry>
		<title>DWScript in a DLL</title>
		<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry140419-154008" />
		<content type="text/html" mode="escaped"><![CDATA[Or to be quite silly:<br />Delphi Web Scripting in a Dynamic Link Library for running Object Pascal scripts in C [and other languages]<br /><br /><h3>What it is.</h3><br /><a href="https://github.com/noshbar/c_dwscript" >This</a> is a simple Windows DLL <em>(<a href="https://github.com/noshbar/c_dwscript" >32-bit DLL provided</a>)</em> that enables you to compile and run Object Pascal scripts from within your favourite language (provided it supports loading DLL&#039;s with the stdcall calling convention) using the <a href="http://www.delphitools.info/dwscript/" >DWScript engine</a> by Eric Grange.<br /><br />Support for calling functions in the Pascal script is supported, as well as registering functions from e.g., C that the script can call. (A sample C wrapper and example are included in the <strong>&quot;c_interface&quot;</strong> folder).<br /><br />Available under the <a href="http://www.mozilla.org/MPL/1.1/" >Mozilla Public License 1.1</a><br /><br />Why? Who can honestly say they&#039;ve never wanted to run hand-optimised assembler inlined into Pascal Script from within Visual Basic 6? <a href="https://www.youtube.com/watch?v=T4TlVRsm8v0" >I know I have.</a><br /><br /><h3>Features.</h3><br /><ul><li>Run full Object Pascal scripts from within your application</li><li>Jitter can be enabled for JIT compilation, speeding up code &quot;quite a lot&quot;.<br />I obtained nearly double the execution performance in some cases e.g, running my smallPT renderer conversion without JIT enabled took 39 seconds, whereas the JIT enabled one only took 25 seconds.<br /><strong>[*only when compiled with Delphi for now]</strong></li><li>OLE support can be enabled<br /><strong>[*only when compiled with Delphi for now]</strong></li><li>ASM support can be enabled<br /><strong>[*requires NASM executable in the same path as the DLL]</strong></li><li>The provided DLL was built using Delphi XE 5 from an SVN checkout of the DWScript sources on the 18th of April 2014.</li></ul><br /><br /><h3>Using.</h3><br />A simple C example would be something like this:<br /><pre>HMODULE handle = DWScript_initialise(&quot;dwscript.dll&quot;);  <br />//you can make as many contexts as you like, but cannot mix and match contexts as you wish<br />DWScriptContext context = DWScript_createContext(DWScript_Flags_Ole | DWScript_Flags_Asm);<br />//add any local C functions into the context with DWScript_addFunction()<br />//and DWScript_addParameter() before compiling<br />DWScript_compile(context, &quot;begin end.&quot;, DWScript_Flags_Jitter); //only necessary once per context<br />DWScript_execute(context, DWScript_Flags_None); //call as many times as you like<br />DWScript_destroyContext(context);<br />DWScript_finalise(handle);<br /></pre><br /><br /><h3>Ideas / TODO</h3><br /><ul><li>Instead of the horrendous fixed-array of unions parameter nonsense going on, you could optionally make the functions take varargs and make calling them a much-more straight-forward affair.  <br />My only worry then is that you&#039;d have to change from stdcall to cdecl, thereby losing the ability to use this DLL from within certain languages.</li><li>Fix Unicode/AnsiString conversions  /  Implement Unicode support</li><li>Add the ability to run a script in a non-blocking manner.</li><li>Add debugger support so that you can set breakpoints in the code, etc.</li><li>Make error handling and reporting not suck.</li></ul><br /><br /><h3>Free Pascal Notes.</h3><br /><strong>TL;DR;</strong> Only <a href="https://dl.dropboxusercontent.com/u/4716604/fpc2.7.1.7z" >this</a> binary collection of FPC 2.7.1 works for me.<br /><br />I initially started this project using <a href="http://www.freepascal.org/" >Free Pascal</a>.<br /><br />As DWScript uses Generics, I needed a newer version of the Free Pascal compiler than what they provide on their home page (2.6).<br /><br />Fortunately I had <a href="http://sourceforge.net/projects/laz4android/" >Laz4Android</a> installed, which came with a build of FPC 2.7.1  <br />This also provided me with the Masks unit that some DWScript units needed.  <br /><em>(I found mine in laz4android/components/lazutils)</em><br /><br />I initially made some horrible hacks to the DWScript code to just get it compiling <em>(deleting entire classes, casting wide to ansi strings, etc.)</em>, a simple proof-of-concept to see if it was worthwhile continuing.<br /><br />Once I had a working DLL, I decided to update my version of Laz4Android to see if it fared any better at the Generics stuff...<br /><pre>Error: Undefined symbol: VMT_$DWSUTILS_$$_$GENDEF386</pre><br />Hmm, Google had nothing on it, nothing on GENDEF386, couldn&#039;t find mention of this in the sources.  <br />Oh well, no worry, I&#039;ll just try:<br /><ul><li>compiling FPC from SVN</li><li><a href="http://www.crossfpc.com/" >CrossFPC</a></li><li><a href="http://www.pilotlogic.com/sitejoom/index.php/codetyphon" >CodeTyphon</a></li><li>A random version of Laz4Android I found</li><li>Building it all on the command line using FPC, then linking it all manually with verbosity set to &quot;I can show you the world&quot;</li></ul>...<br /><pre>Error: Undefined symbol: VMT_$DWSUTILS_$$_$GENDEF386</pre>Well screw you too.<br /><br />I&#039;ve done some investigation into it, I built a little Python Pascal Parser to detect differentiating Interface/Implementation function descriptions and found some things... but nothing the compiler seems upset about.  <br />So instead, if you want to use Free Pascal to compile this, you can try using the binary dump of FPC2.7.1 I took from my working version of Laz4Android from <a href="https://dl.dropboxusercontent.com/u/4716604/fpc2.7.1.7z" >here</a>.]]></content>
		<id>http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry140419-154008</id>
		<issued>2014-04-19T00:00:00Z</issued>
		<modified>2014-04-19T00:00:00Z</modified>
	</entry>
	<entry>
		<title>smallpt Turbo Pascal 3 port</title>
		<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry130301-123650" />
		<content type="text/html" mode="escaped"><![CDATA[<center><a href="images/smallpt_25000_big.jpg"><img src="/images/smallpt_25000.jpg" alt=""  /></a></center><br />Because I suffer from rare diseases (like getting to know people in shops really well then not being able to go there anymore because I feel like I&#039;m making them feel awkward), I ended up porting the <a href="http://www.kevinbeason.com/smallpt/" >smallpt</a> global illumination renderer from 99 lines of C++ code to 666 lines of Turbo Pascal 3 code.<br /><br />Doing this meant I got to play with loads of things:<ul><li>Turbo Pascal 1, 3, 4, 5 and 7, Delphi...</li><li>Lazarus</li><li>FreePascal (for Android and iPhone and GBA)</li><li>Pascal Script and DWScript (hint: unless you&#039;ve run out of paint to watch dry, you really want to use the DWScript version)</li><li>FreeDOS</li><li>Virtual Machines like Bochs, VirtualBox, DOSBox</li></ul><br /><br /><center><a href="images/compilation_big.jpg"><img src="/images/compilation.jpg" alt=""  /></a></center><br /><br />See most of the gory blah-blah details <a href="/static.php?page=smallpt_tp" >here</a>]]></content>
		<id>http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry130301-123650</id>
		<issued>2013-03-01T00:00:00Z</issued>
		<modified>2013-03-01T00:00:00Z</modified>
	</entry>
	<entry>
		<title>Velleman USB Experiment kit + Piezo + RtMidi + LoopBe1 + Addictive Drums demo = electric drums</title>
		<link rel="alternate" type="text/html" href="http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry110318-000130" />
		<content type="text/html" mode="escaped"><![CDATA[<center><iframe width="420" height="315" src="http://www.youtube.com/embed/5lHW27dW6ms" frameborder="0" allowfullscreen></iframe></center><br /><br />Being stupid is a wonderful thing: you discover new things every day.<br />I bought a <a href="http://www.vellemanusa.com/us/enu/product/view/?id=500349" >Velleman USB Experiment board</a> from <a href="http://maplin.co.uk/Module.aspx?ModuleNo=42857" >Maplin</a> as an exercise in learning how to solder.<br /><br />One embarrassing turn led to another, and eventually I &quot;discovered&quot; that piezo buzzers generate current when you mash them.<br /><br />That sparked the idea to use the piezo buzzers as a drum pad by converting the voltage into velocity sensitive MIDI notes.<br /><br />Sadly, it had all been done <a href="http://www.youtube.com/watch?v=PWmygy80FNE" >before</a>, <a href="http://www.youtube.com/watch?v=id9FRyI8T7k" >many</a>, <a href="http://www.youtube.com/watch?v=wApYgpp7Eo0" >many</a>, <a href="http://www.edrum.info/forum/index.php?PHPSESSID=6e62c3f5542cf32ca9c370bbb503c8e7&amp;board=1.0" >many</a> times.<br /><br />But this is for all you Velleman owners out there.<br /><br />See <a href="http://noshbar.xtreemhost.com" >http://noshbar.xtreemhost.com</a>   or <a href="http://www.noshbar.co.cc" >http://www.noshbar.co.cc</a> if that ever works again.]]></content>
		<id>http://iwasdeportedandalligotwasthislousydomain.co.uk/index.php?entry=entry110318-000130</id>
		<issued>2011-03-18T00:00:00Z</issued>
		<modified>2011-03-18T00:00:00Z</modified>
	</entry>
</feed>
