Die neue Pseudomoralstaatstrompete

Wahrscheinlich liegt es am Zeitpunkt, das momentan alle Dummschwätzgrössen deutscher Politik nicht mal versuchen irgendwelche sinnvollen Aussagen über Deutschland, das Ost-West-Verhältnis und was halt sonst noch ganz gut dazu passt in unseren Heutistmalvolksfeststaatdabinichmnalfröhlichstaat zu katapultieren, aber was der Phantasie vom Herrn Gauck da so vorschwebt, dass hat doch schon psychopathische Qualitäten. Man schmeisse Nostalgie, Sozialismus, ostdeutdsche Mentalität und diktaroische Herrschaft in einen Topf, stelle alles, was die DDR verunstaltet hat (inklusive Menschen) vor einen kulissenhaften Abgrund und heraus kommt eine selten doofe und substanziell dünnpfiffähnliche Systembeschönigung, bzw. TA vom 1.10.2004: "Im Gespräch mit dieser Zeitung warnte der DDR-Bürgerrechtler und einstige Bundesbeauftragte für die Stasi-Unterlagen, Joachim Gauck, vor einer wachsenden Sozialismus-Nostalgie in Ostdeutschland. 'Wer Jahrzehnte in einer Diktatur gelebt hat, neigt auch danach weiter dazu, nach oben zu blicken und auf Führung und Fürsorge zu hoffen', sagte er. Diese Mentalität sei 'tief verwurzelt', so Gauck, und wandele sich nur langsam. Seiner Ansicht nach schätzen zahlreiche Ostdeutsche die Freiheit, die sie 1989 errungen haben, nicht genug. Die oft anzutreffende Neigung zum Sozialismus entspringe einer 'romantischen Sehnsucht' nach einer geordneten, als gerecht empfundenen Welt."

How To: Mix OpenLaszlo, Air and Javascript/HTML to create a desktop application with local file access

 

Doing some development on the apolmb project I thought about a way to make the local filesystem accessible to an OpenLaszlo application. Since the Flash Player version 10 seems only to be able to load and save local files, but not get directory listings, I installed Adobe Air 1.5.3 SDK and Runtime on my Ubuntu machine, integrated it with the help of Aptana in Eclipse, started a new Air HTML/JavaScript project and embedded the OpenLaszlo-compiled SWF inside.

It resulted in Air application, which prints the content of local files. The Air package is available here. The readLocalFile function will return the content of any file on your local disk (e.g. "/var/log/auth.log" or "C:/autoexec.bat")

Bridging Air and OpenLaszlo with Javascript

The HTML container inside the Air project provides access to the to the local filesystem through the AIR API. Embedding the SWF with OpenLaszlos lz.embed.swf function provided in the embed-compressed.js makes it possible to call the JS-functions in the HTML container with lz.Browser.callJS() and receive the return values. Heres the code:


Adobe Air HTML container code (airpolmb.html):


<html>
    <head>
        <title>OpenLaszlo App in Air Runtime / JavaScript Bridge</title>
        <script type="text/javascript" src="lib/air/AIRAliases.js"></script>
        <script type="text/javascript" src="lps/includes/embed-compressed.js"/>
        <script type="text/javascript">

            // reads the content of a local text file
            function readLocalFile(fpath){
                var f = air.File.applicationDirectory.resolvePath(fpath);
               
                var fs = new air.FileStream();
                fs.open(f, air.FileMode.READ);
                var content = fs.readUTFBytes(fs.bytesAvailable);
                fs.close();
               
                return content;
            }

        </script>
    </head>
    <body>
        <script type="text/javascript">
          lz.embed.swf({url: 'airtest.lzx.swf10.swf', allowfullscreen: 'false', bgcolor: '#ffffff', 
                        width: '100%', height: '100%', id: 'lzapp', accessible: 'false', 
                        cancelmousewheel: false});

          lz.embed.lzapp.onloadstatus = function loadstatus(p) {
            // called with a percentage (0-100) indicating load progress
          }

          lz.embed.lzapp.onload = function loaded() {
            // called when this application is done loading
          }
        </script>
    </body>
</html>

OpenLaszlo code (airtest.lzx):


<canvas height="100%" width="100%" title="Airtest" proxied="false">
    
    <method name="receivedFromJavaScript" args="data">
    <![CDATA[
        Debug.write("Response data: ");
        Debug.write(data);
        this.response.setAttribute("text", data);
    ]]>
    </method>

    <simplelayout axis="y" spacing="10" />
    
    <view height="10"></view>
    <view x="10">
        <simplelayout axis="x" spacing="10" />    
        <text>JS function: </text>
        <edittext name="func" width="220">readLocalFile</edittext>
        <text> argument: </text>
        <edittext name="arg" width="220">LocalFile.txt</edittext>        
        <button text="call"
                onclick="lz.Browser.callJS(parent.func.getValue(), 
                canvas.receivedFromJavaScript, parent.arg.getValue())"/>
    
    </view>
    <text x="10" text="Response data:"/>
    <text x="10" name="response" multiline="true" resize="true"/>
    
</canvas>

 

Alternative way without lz.embed

A different way leading to nearly the same results is to totally leave the lz.embed stuff out, directly import the class flash.external.ExternalInterface in the LZX code and go further using call and callback methods directly. In this case the response value is delivered by the callback function instead of being included in the return value.

airpolmb-alt.html:


<html>
	<head>
        <title>OpenLaszlo App in Air Runtime / JavaScript Bridge Alternative</title>
        <script type="text/javascript" src="lib/air/AIRAliases.js"></script>
        <script type="text/javascript">

		    // returns the SWF object node
			function thisMovie(movieName) {
		         if (navigator.appName.indexOf("Microsoft") != -1) {
		             return window[movieName];
		         } else {
		             return document[movieName];
		         }
		     }

            // reads the content of a local text file
            function readLocalFile(fpath){
                var f = air.File.applicationDirectory.resolvePath(fpath);
				
                var fs = new air.FileStream();
                fs.open(f, air.FileMode.READ);
                var content = fs.readUTFBytes(fs.bytesAvailable);
                fs.close();
                
				thisMovie("lzapp").getJSData(content);
				
                return content;
            }
			
        </script>
	</head>

    <body>
	<object id="lzapp" type="application/x-shockwave-flash" width="100%" height="100%"> 
   			<param name="movie" value="app:/airtest-alt.lzx.swf10.swf"/>
    		<param name="wmode" value="opaque"/>
		</object>
    </body>
</html>

airtest-alt.lzx:


<canvas height="100%" width="100%" title="Airtest-AS3" proxied="false">
	
	<method name="receivedFromJavaScript" args="data">
	<![CDATA[
		Debug.write("Response data: ");
		Debug.write(data);
		this.response.setAttribute("text", data);
	]]>
	</method>
	
	<class name="FlashUtil" extends="node" >
		
	    <passthrough>
	      import flash.external.ExternalInterface;
	    </passthrough>
	    
	    <method name="callJS" args="...rest" allocation="class" >
	      ExternalInterface.call.apply(ExternalInterface, rest);
	      Debug.write(ExternalInterface, rest);
	    </method>
	    
	    <method name="initJSCallback" args="...rest" allocation="class" >
	      ExternalInterface.addCallback.apply(ExternalInterface, rest);
	      Debug.write('Init callback');
	    </method>

	</class>
	
	<script>
		lz.FlashUtil.initJSCallback("getJSData", canvas.receivedFromJavaScript);
	</script>

	<simplelayout axis="y" spacing="10" />
	
	<view height="10"></view>
	<view x="10">
		
		<simplelayout axis="x" spacing="10" />	
		<text>JS function: </text>
		<edittext name="func" width="220">readLocalFile</edittext>	
		<text> argument: </text>	
		<edittext name="arg" width="220">LocalFile.txt</edittext>
		<button text="call" 
				onclick="lz.FlashUtil.callJS(parent.func.getValue(), parent.arg.getValue())"/>
	
	</view>
	<text  x="10" text="Response data:"/>
	<text  x="10" name="response" multiline="true" resize="true"/>
	
</canvas>

During my investigation this two posts in the OpenLaszlo forum helped me the most.

Thanks to everybody in the OpenLaszlo community and at Laszlo Systems for sharing this great framework and all the help and ideas with all of us.

General Tags: 
General category: 

How To: Upgrade ext3 to ext4 if your Ubuntu installation is inside of an encrypted LVM2 partition

In general you can use this guide for the basics, make sure that you are using grub2 as the boot manager (if you boot from the partion you're going to convert) and you have a backup of all important data. You need to boot from a Live-CD or a USB-installation of Ubuntu to do the changes to your boot partion from there. Theres one little trick about how to get access to an encrypted LUKS LVM2-container. If you setup such a thing (e.g. by using Ubuntus alternate installer) also take a look here.

General Tags: 
General category: 

The dillout sound

Finally, for the first time in history mankind will be able to experience the dillout sound. The debut album of "zentrale für kompetenzüberschreitung" just left the non-existent studio and made its way directly to dillout.de. Look at / listen to / download / ignore it here.

 

Creative Commons License
zentrale für kompetenzüberschreitung by zentrale für kompetenzüberschreitung is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Germany License.

Do you like free music?
Find some more at
www.theblackriders.at/ and
dl.nin.com/theslip/

General category: 

How to fix and clean up your Windows

A little bit of care...

It's a common story and it seems like everybody can complain about his Windows installation. The reason for that might be the fact that Windows probably is not the best operating system around but most likely it's also the case that todays operating systems are complex software products and no matter how hard developers try to make it comfortable-to-use it requires some user knowledge and a little bit of care to run well over a longer period of time. The common solution to Windows problems is to reinstall Windows or buy a new computer. Both break a butterfly on a wheel.

This How-To will try to give you a little understanding in why your Windows slows down or programs stop working correctly and describe a few steps, you should walk through now if you haven't done any maintanance to your Windows before, and you can walk through again the next time when you have the feeling somethings wrong with your Windows. This How-To will work with Windows XP as well as Windows Vista.

Step 1: Backup your data

The risk that something goes wrong and the data on your drive gets lost by applying the following steps is low. But the probability that in the next year something will happen, which makes at least some of your data go away ( crash of your hard disk, accidental deletes, thievery) can't be ignored, Imagine which data you would miss after a crash of your hard disk and put a copy of this data on an external drive. You should always have a copy of your important data on two different disks. If it's personal data you may want to encrypt it, e.g. with Truecrypt.

Step 2: Clean up your disk(s) and the Windows registry

The following steps will fail if you are low on disk space. Be sure to free around 20 percent of your disk(s) space before you continuing with this How-To. And please don't worry, those 20 percent of disk space won't be filled at the end of the How-To. Delete personal files you don't need anymore. Be sure you have a backup of them in an external location.

In Windows Explorer, right-click your hard disk(s) and go to the properties option. Click the disk cleanup button if its available. Also use CCleaner to free some more space and repair the Windows registry.  The registry holds information that can, if invalid, noticeably slow down or make programs stop working in your Windows.

If you're generally low on disk space, here are some more tips for advanced users:

Step 3: Check your disk (optional)

We expect your disk to be working properly, but if you want to be completely sure right-click your hard disk(s) and go to the properties option, choose "Tools" and run a disk check. Choose the option which corrects errors. If Windows says it's necessary to reboot do this. The disk check might take some time, probaly even an hour or longer.

Step 4: Defragment your hard disk

My experience with slow Windows systems is that files are massively fragmented. If you use the whole capacity of your disk big files will be saved in thousands of fragments on Windows systems. Access to those files is much slower then. On a standard Windows system theres a special effect: One of the biggest files on your system is the so-called page file, where Windows by default swaps some of the data from the machines working memory. This page file will fragment in a horrible way and reduce your systems performance by a multiple. Just freeing some disk space won't help a lot.

So right-click your hard disk(s) and go to the properties option to start a complete defragmentation. This might take some time, probably one to three hours and it's wise to leave your computer alone during defragmentation because saving files might interrupt it. So time for something else now, we'll continue when defragmentation is finished...

Step 5: Install Microsoft Updates and Service Packs

Some problems and security leaks in Windows and other Microsoft software are solved by the monthly updates Microsoft delivers. To update all of your Microsoft products use Microsoft Update ( open this page in Internet Explorer ) instead of the default Windows Update, which only updates Windows. Confirm the installation of the latest updates, software and Service Packs and restart when everything is done.

Advanced: To free some disk space on Vista after installing Service Packs you can optionally use vsp1cln.exe ( since Vista SP2 the file is called "compclean.exe" ). Be aware that you can't uninstall the Service Pack anymore after that.

Step 6: Check for viruses and spyware

For a first check, use the Microsoft Windows Malicious Software Removal Tool. Next, I recommend installing Microsoft Serurity Essentials to free your computer from viruses and spyware and keep up protection in the future. If you're happy with a similar software already installed on your computer just go for a full scan.

Step 7: Check your firewall status

 The Windows Firewall will keep you safe from attacks through the wire  and is enabled by default. Please check if this is still the case.

Step 8: Update drivers and software (optional, advanced)

This last step may be better handled by a Windows user with advanced knowledge. So if you're not one yourself ask somebody who knows a bit more about computers. He will be very glad to hear that you already did the first seven steps on your own, because they are most pain.

Using the latest drivers and software will give you more security and better performance and sometimes even more functionality. Your computer manufacturer probably will provide the latest drivers for your system. The following software will help you to identify outdated software and drivers:

Everything fine now?

Now your Windows should perform better, at least for the next few months. If problems reoccur just walk through this How-To again.

If your Windows now still has problems something is really wrong.  If it's incredibly slow it might be that the mode of your drive fell back to PIO-mode. If Windows crashes from time to time your RAM or your hard disk may be seriously damaged. Check both for errors then.

And even if all this doesn't help, just create a new user profile and check if problems still show up when logging in with this new user. Sometimes you just need to throw away a screwed-up user profile to make Windows work again.

I hope this How-To helps you to be less annoyed by your Windows, please post comments if you feel like something could be improved here. Thanks!

Windows still annoys you?

Just install this wallpaper. Seriously,try Ubuntu.

General Tags: 
General category: 

What the Internet is about

Once I thought the Internet is great. Watching Southpark episodes, listening to webradios, reading profound articles on wikis, blogs or newssites,  downloading open source software, getting travel information and organizing daily life online it looked like the Internet consists of a lot of useful and interesting things. This attitude was put into a new perspective when I was trying to find a job in Internet business. Now I think the Internet, with a few exceptions, is great shit. It seemed like I've been actually using about 5% of the whole Internet and was disappointet with the job offers I got in that other 95%.

45 % marketing
My impression now is that the main part of the Internet  is just about marketing. It's about convincing people to buy special products or brands by using shady methods and dubious arguments just for the sake of making money with no other meaning. Since my life is half work and my life is not about a virtual amount of money on my bank account I don't want to work for marketing shit.

20% shopping
At least the second biggest part can be not ignored that easy, because it actually is about buying things, which helps peolpe to survive. But most of the things you can buy actually is luxurious shit produced under doubtful conditions wasting valueable resources. I don't want to support that.

15% porn
Never found a job offer for Internet porn business so I concluded those are the ones not telling about their projects or customers in public. It's a shame people loose their last piece of privacy here because they depend on the money or their last boyfriend takes revenge. This doesn't really make sense to work for too.  I think I couldn't stand the visual impression eight hours a day.

15% gaming and gambling
A short game to relax is nice but my impression is that most online gamers are addicts loosing their money and their life online. Don't want to loose my life too.

So I should be lucky there are 5% left now and that even those 5% have quite a few jobs to offer in the big, great shit Internet.

 

General category: 

Pages

Subscribe to logsalat on dillout.de RSS

ad ubuntu linux

Greenpeace Energy

www.lobbycontrol.de