ld: library not found for -lfl on Mac using Flex and Bison

I was trying the first example of the Flex & Bison O’Reilly book and got an error. After some searching I found the solution.

The command line was:

cc lex.yy.c -flf

Error I got:

ld: Library not found for -lfl
clang: error: linker command failed with exit code 1

Apparently OS X doesn’t include libfl.a. libl.a offers the same functionality. So changing the command line to

cc lex.yy.c -ll

does the trick.

Invoking RESTful and AMF services from Flex using WCF / MVC / FluorineFX in .NET

Rich Internet ApplicationsI’ve written a small Rich Internet Application using Flex and [dot]NET. Data from [dot]NET is returned to Flex using different technologies being MVC, WCF and FluorineFX.

In dot[NET], there are two MVC controllers, RestJsonController and RestXmlController. They both have about the same logic, but one returns Json, the other XML. There’s also a UserService with methods made public using both WCF and FluorineFX. For WCF, REST is used with both GET (WebGet) and POST(WebInvoke).

On the Flex side, REST calls are being done using URLLoader and URLRequest.  There are examples using GET and examples using POST. You’ll also see that URLVariables, Json strings or XML are used to transport data. For the AMF calls, a RemoteObject is used to call a FluorineFx gateway.

Flex only supports the HTTP Verbs GET and POST, so full REST isn’t really possible.

I created the example in Visual Studio 2010 (ASP.NET MVC 3 Web Application) and Flash Builder 4.5 Premium (SDK Version 4.5.1). You can easily open the .NET solution. The Flex source is configured to call localhost on port 53259, so make sure the .NET WebApp is started on that port (or change the Flex source code). For the Flex project, import it using ‘Existing Projects into Workspace’. Since Flash Builder has a problem with relative paths (adobe, please have a look at that), you’ll have to change some things. In the properties of the project, go to Flex Build Path, and set the Output folder to [root example project]/FlexDotNetREST/Flex, being the Flex folder under the root of the .NET Web App. Then right click FlexRest.mxml –> Run As –> Run Configurations… URL or path to launch should be http://localhost:53259/Flex/FlexRest.html.

A zip of the example can be downloaded here.

As I wife recently gave birth to a second daughter, I haven’t got the time anymore to blog a lot. So, explaining this will be difficult. But you have the source and I’ve written a lot of comment in the source it self. So check it out and let me know if it was useful.

Be sure to go and read some articles and blog posts on REST, especially the difference between low REST and high REST (lo-REST – hi-REST). A lot of developers/managers/companies think they have a RESTful api, but actually, they don’t.

http://blog.jonnay.net/archives/665-Hi-Rest-and-Lo-Rest,-two-broken-halves-of-the-tower-of-Babylon.html
http://lesscode.org/2006/03/19/high-low-rest/

WCF REST
REST in Windows Communication Foundation (WCF)
A Developer’s Introduction to Windows Communication Foundation 4

Continue reading

ITunes Icon

How to Remove Broken or Dead Tracks from iTunes

ITunes IconApple has provided a script to do just this particular trick, and to make use of it you just need to do these things in order:

  1. Close iTunes if you have it open
  2. Go to the web page, right-click on it, and save the page as a file, making sure you change the extension to .js. So for instance, in Firefox, right-click on the page, choose Save page As”¦ and change the file name from RemoveDeadTracks.txt to RemoveDeadTracks.js.
  3. Open Windows Explorer and browse to the file you just saved
  4. Double-click on the file.

The script will open iTunes, and then start running through and removing dead links. In my case it took around ten minutes and correctly removed nearly two thousand links.

ITunesRemoved

 

 

 

 

 

 

Another interesting tool which I haven’t tried is this one. Apparently it only works on iOs.

 

 

 

Flex Icon

Packaging a Flex Mobile Project using Ant for Android, BlackBerry or iOs

Flex IconIf you want to package a Flex Mobile Project using Ant, you’ll first need to compile your project to get a swf. ADT is the tool need to package your application. First of all, if you want lots of information, I recommend installing the Adobe Community Help.

Remember you can also do this by creating a Release Build (right click project –> Export… –> Flash Builder –> Release Build) of your Flex Mobile Project.

Continue reading

Flex Icon

Compiling a Mobile Flex Project using Ant and launching the swf using the Air Debug Launcher

Flex IconFirst of all, compiling a Mobile Flex Project is not the same as packaging one. Compiling is creating an swf, packaging is creating a ipa or apk file (Android or iOs). I’ll deal with packaging in a later post. If you double click on a compiled Mobile Flex Project swf, you wont see a thing. If you want to see your swf in action, you’ll have to use the Air Debug Launcher, ADL. Off course, instead of using Ant, you can also use the command prompt or Flash Builder.

Continue reading

Asp.NET

Problem Event Handlers in a Default Document in IIS 7 or IIS 7.5 Integrated Mode with FluorineFX Http Module

FluorineFxSome while ago I noticed that an OnClick isn’t triggered when a default aspx page is loaded (for instance browsing to http://localhost/test) but it is when browsing directly to http://localhost/test/default.aspx. The default document is set to Default.aspx, but for some reason, the click event isn’t triggered when doing a Postback.

Continue reading

Web Cache

Forcing browsers to revalidate static content in IIS – Asp.NET

Web CacheHow do you force browsers to revalidate static content like an swf, xml, txt, … files? We often have this problem with customers and advise them to clear their cache. Not a very good solution don’t you think?

So how do you solve this? We could append the version of our product to the static files, so that with a new release, browsers wouldn’t hit their cache loading the file. A condition for this to work would be that the home page (default page) should always be the latest version from the server. This page would have references to the static files with version appended to them.

What about browsers asking the server if a newer version is available. In comes the must-revalidate header.

Continue reading

Flex Icon

Updating a Flex Mobile App on Android & iOs

Flex IconWhen I was first starting to look, I thought it would be done in the same way an Air Application is updated (see here and here for more info on updating air projects). Updating Flex Mobile Apps doesn’t work this way. Quote:
The AIR update framework is only supported in the desktop profile. It is not supported for extended desktop applications (applications installed with a native installer), and it is not supported on the mobile profile (iPhone applications written with ActionScript 3.0). Check the Updater.isSupported property at runtime to see if the update framework is supported.
If you would trace out Updater.isSupported in your Flex Mobile Project, is would return false.

Continue reading

Sql Server 2008 Logo

Change Collation Sql Server 2008 Database

 

Sql 2008To change the collation of Sql Server 2008 Database, you’ll first need to drop the objects in the database that are dependent of the collation (like functions for instance). Otherwise you will get an error like this

The object ‘…’ is dependent on database collation.

Once you’ve dropped these objects, you can set the collation using this t-sql

 

 

1
2
3
4
5
6
ALTER DATABASE [dbname]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE [dbname]
COLLATE SQL_Latin1_General_CP1_CI_AS
ALTER DATABASE [dbname]
SET MULTI_USER

After this, you’ll have to recreate your dropped objects.

Sql Server 2008 Logo

Moving FileStream data to a new location or renaming it (basically the same)

Sql 2008You’ll just have to detach the existing database, then rename the FileStream folder and then attach it again using following sql:






1
2
3
4
5
6
7
8
9
USE [master]
GO
CREATE DATABASE [televic-edu3-dev-one-channel] ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\...\DATA\name.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\...\DATA\name.ldf' ),
FILEGROUP [FileStreamGroup] CONTAINS FILESTREAM DEFAULT
( NAME = N'name_FSData',
FILENAME = N'C:\Program Files\Microsoft SQL Server\...\DATA\name' )
FOR ATTACH

name_FSData will be the name of the renamed folder.

More information on other ways to do it here.