ADM Blog No matter how you see things, reality changes when you reach understanding

25Jan/100

Static files locked by Jetty in Eclipse

jetty logo2 Static files locked by Jetty in Eclipse If you use Jetty you might notice that once it's running you can't edit any static files because it says they are already in use and locked.
Why ? Because Jetty buffers static content for webapps such as html files, css files, images etc and uses memory mapped files to do this if the NIO connectors are being used. The problem is that on Windows, memory mapping a file causes the file to be locked, so that the file cannot be updated or replaced. This means that effectively you have to stop Jetty in order to update a file.

In case this happens follow these steps:

1. Extract the runjettyrun_1.0.1.jar in the eclipse plugin directory
2. Extract the jetty-6.1.6.jar in the lib directory of the previous jar.
3. Edit the file org\mortbay\jetty\webapp\webdefault.xml and change the "useFileMappedBuffer" to false. It should look like the following:

1
2
3
4
<init -param>
      <param -name>useFileMappedBuffer</param>
      <param -value>false</param>
</init>

4. Pack everything back up and overwrite the runjettyrun jar in the plugin directory.
5. If you still get the error after step 4 start eclipse.exe with -clean and then recreate the Jetty configuration. (It just need to replace whatever jar's it copies in your workspace .plugins dir)

20Jan/100

Every day the same dream

Just brilliant. By molleindustria

15Jan/100

Adding ellipsis points in a TextArea component in Flex

The goal here is to use a TextArea component to display some text that doesn't quite fit in the specified region and ellipsis points (...) should be showed to let user know the text is trimmed. Standard stuff right ? But Flex doesn't do it by itself and I thought someone might look for this.

My problem was with a Flex app that uses i18n and in some languages the text didn't fit the box, the scroll bar policy was off and user had no idea there was more text in there and didn't had the possibility to scroll further. Anyway, here it is :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	<mx :Script>
		< ![CDATA[
 
			[Bindable]
			private var text : String = 'The quick brown fox jumped over the lazy dog. ' +
						    'The quick brown fox jumped over the lazy dog. ' +
						    'The quick brown fox jumped over the lazy dog. ' +
						    'The quick brown fox jumped over the lazy dog. ' +
						    'The quick brown fox jumped over the lazy dog. ';
 
			private function trim(text : String) : String 
			{
				box.text = text;
				box.validateNow();
				if(box.maxVerticalScrollPosition > 0) {
					text = text.replace("...", "");
					text = text.substr(0, text.length - 1) + "...";
				} else {
					return text
				}
				return trim(text);	
			}
 
		]]>
	</mx>
 
	<mx :TextArea id="box"
		verticalScrollPolicy="off"
		width="250"
		height="50"
		wordWrap="true"	
		text="{trim(this.text)}"
		paddingBottom="0"	
		editable="false" />

Flex Output

14Jan/101

windows 7 quotes problem

windows7 150x150 windows 7 quotes problemIf you have a problem with quotes in Windows 7, try to switch the keyboard layout from "United States - International" to "US"

After installing Windows 7, I discovered the following behavior in the code editor: Pressing the quote (') or double-quote (") key once would have no effect. Pressing any key after that would produce both the double quote character and the next character.

The problem is caused but by regional settings - I solved it by switching from "United States - International" to "US" keyboard layout.

Go to Control Panel->Region and Language->Keyboards and Languages tab->click Change keyboards... where you add English (United States) - Us to the list and then select it as default from the top drop down list.

14Nov/090

Flex vs Silverlight vs AJAX

Our Transylvania Flex Group 3th event will be held this Saturday (November 21, 2009) in Cluj-Napoca.
This one will be a showdown between RIA technologies, with advocates from our Betfair Office. Iosif George for Flex, Vlad Nemes for AJAX and Silviu Niculita from RIASolutionsGroup for Silvelight.

Registration is free and you can signup for the event here. See you there !

Flex vs Silvelight vs AJAX

Page 3 of 131234510...Last »
Uses wordpress plugins developed by www.wpdevelop.com