Entityframework model diagram not showing

Sometimes when opening your entityframework model you’ll notice that none of the entities show in the diagram.

No amount of deleting or adding them again will work. Then try this.

Right click on the diagram and select ‘Move diagrams to Seperate file’.

In your solution explorer you will see a new file created, with the extension edmx.diagram.

Delete this file. Save the project and reopen your model diagram, the entity objects should now show.

Advertisements

The type or namespace name ‘Script’ does not exist in the namespace ‘System.Web’ (are you missing an assembly reference?)

Compiling an app you get the error

The type or namespace name ‘Script’ does not exist in the namespace ‘System.Web’ (are you missing an assembly reference?)

Just add a reference to System.Web.Extensions

and it should work.

 

 

Virtual glasses

A while back I made a post about how keen I was to see the Vuzix glasses. After they were made available I did a bit more research, and it turns out there are other, possibly better options.

Carl Zeiss Cinemizer OLED 1280×720 (720p reported), OLED, 35 deg FOV, $515, HDMI 1.4, 45inch @ 6 feet, headtracking optional
Vizux VR1200 852×480,  LCD, 35 deg FOV, $600, VGA, DVI & USB, 75inch @ 10 feet, headtracking included

 

After comparing the Carl Zeiss to the Vuzix options I can only conclude, if you’re in the market for a set of virtual glasses, the Carl Zeiss are the better option. Not only are they OLED but the resolution is massively better! Yes the Zeiss don’t have the trendy sport shade look that you can wear in the train or whatever. But for what I’d use it for that’s not a show stopper.

 

Error Code 10061: Connection refused – ASP.Net VS2010

 

Problem:

When running a local project from VS2010 I kept getting a connection refused error.

Solution:

If you are debugging or running your problem using localhost, check your proxy settings. They should be set to bypass proxy server for local connections.

 

FTP not showing all files conundrum!

Problem:

In short when querying a FTP server for a list of files, a number of files were not being shown, even though we knew they were there!

The story….

A client contacted us and asked us why we were not processing all the files they had made available on their FTP server. All files we have processed were marked with DONE in the filename. I took a look but there were no files not marked with DONE. The client insisted there were, and sent us a screenshot of said files. Oddly enough we couldn’t see these files.

After playing around with permissions, active vs passive mode, SFTP etc we weren’t a step closer to seeing the files. Trying FileZilla, Explorer, and the command line FTP didn’t show the files. BUT when I typed ‘ls’ to list files, I DID see them. Typing the command ‘ls -l’ to see attributes caused the files NOT to be shown!

Outputting the file list from ‘ls -l’ gave me and output of 817 lines (files) which totalled 70080 bytes for the listing. ‘ls’ gave me 930 lines in a total of 41198 bytes. The smaller output is because ‘ls’ doesn’t output extended attributes for each file. Now I read on some forums that FTP servers can limit the number of files returned to 2000, but obviosuly we weren’t even near this total…so that wasn’t the problem. For some reason 113 files just weren’t showing.

We contacted a collegue in Cape Town (we’re in Johannesburg). Using EXACTLY the same settings and version of FileZilla he COULD see all the files, even the ones we couldn’t when using FileZilla. So next I tried connecting to a server outside our ISA proxy server, and connecting to the FTP server using the commandline FTP. Hey Presto! I could see all files. So I thought it was a proxy issue..but after some further investigation this didn’t make sense.

Solution:

After a LOT of wasted time, I tried moving the already  processed DONE files into an archive folder, thereby decreasing the number of files in the active folder. Then suddenly the previously ‘invisible’ files were shown. So something with the number of files or size of the ouput from the directory listing is causing problems.

So while we solved the problem, I still don’t know the cause of this odd FTP behaviour 😦

Android internet via WIFI hotspot using a proxy requiring authentication

A slight diversion from actual programming. But worth the post.

Recently i got a Samsung Galaxy S GT-I9000 phone. Great phone, but not without its issues.
Anyway to skip to the meat of this problem.

Problem:

I wanted a way to connect the phone to the internet at work.
There’s 2 issues however.
1) The company doesn’t have a WIFI hotspot
2) The internet is of course behind a proxy that requires authentication.

So I had 2 issues I needed solving. A WIFI connection to the company internet, and a way to provide proxy addresses and authentication.
Now the latest firmware I have DOES support adding a proxy address, but, oddly enough, no way of adding authentication details. This is using Gingerbread.XWJVH and firmare 2.3.3.

I believe the Opera browser for the droid DOES support proxy authentication, but this is not what I was after. I wanted ALL apps on my phone to be able to connect to the net.

Solution

After digging a bit and reading some sources that require rooting the device, I found what for me is a viable solution, not rooting required!
Since I have a laptop that has WIFI, I thought I would create a WIFI-hotspot for my droid phone.
ONLY the default phone doesn’t detect ad-hoc wifi connections…no really it doesn’t!

Secondly I was sure there was a way for the laptop to handle the authentication, since the droid was useless at this.
So heres the answer I used

1) Install Connectify http://www.connectify.me/

This application creates a discoverable WIFI hotspot for your pphone.
I’m using the free version. After installing it requires a reboot.
Fill in the required settings under ‘settings’, and start the hotspot.
Congratulations! You now have a WIFI hotspot your droid can see.

Enable you phone’s wifi, scan and connect to the hotspot.
Under clients you can see when your phone has connected.

 
2) Enable internet sharing in windows, to enable other connections to share your internet.
Do this on the wireless adapter that connectify is using. In my case this is wireless network connection 2.

3) Download and install python for windows. This is needed for the next step.
http://www.python.org/download/

4) Download and install NTLMaps.
http://ntlmaps.sourceforge.net/
As far as I understand this. It works as a double proxy. Connections are made to the NTLMaps proxy, which routes them to your company proxy providing the given authentication.

Setup NTLMap for your specific case. I only had to change the following config settings
 LISTEN_PORT: 8082
 PARENT_PROXY: 10.205.0.41
 PARENT_PROXY_PORT: 8080
 ALLOW_EXTERNAL_CLIENTS: 1
 NT_DOMAIN: domain.org
 USER: username
 PASSWORD: password

5) Finally add the proxy details to your Android phone that NTLMap is using. In above example that is my computer name (or IP I guess) and the listen port, 8082. These settings can be found under the advaced WIFI settings for you phone.

Run NTLMap and Viola!
Your adroid is connected to the net!

UPDATE!! Unfortunately I seem to have found a problem with this solution. Some apps like Android Market, G-Talk etc use different ports to the standard HTTP port 80. I THINK is is causing them not to connect. But whatever the reason only the browser seems to be able to properly connect using above solution 😦 Awww that sux!

Cannot convert lambda expression to type … because it is not a delegate type

Here is a small gotcha .

The message is rather cryptic, but the solution is pretty simple.

Add

using System.Linq

to your code 😛

The project file contains a property value that is not valid – WPF error

Problem:

While developing a WPF application I had created a new project in my solution. I then copied several pages from one project to the new project. On running the application I got the wierd error “The project file contains a property value that is not valid”. I checked the files and codebehind over and over without finding the problem.

 

 

 

 

Solution:

Eventually the problem turned out to be the build action for the pages that I had copied! aaargh. They had been set to “ApplicationDefinition”, setting them back to “Page” solved the problem. Other files like images etc show similar issues so be aware of this!!

 

PRISM application

I’ve been tasked with building a simple proof of concept application by next week. It MUST be modular and loosely coupled. It SHOULD be portable to Silverlight and possibly mobile applications. Not actually having built a WPF application yet this has me excited. As a bonus I get to implement PRISM and the MVVM pattern plus choose a dependacy injection container.

Once the proof of concept succeeds this most likely be the basis of a complete overhaul of the existing systems we are working with! Wish me luck! 🙂

Update -Right now I’m feeling a bit overwhelmed. After reading some of a ‘Developer’s Guide to Microsoft Prism’ yesterday I had the impression I had a choice between 2 depedancy injection containers MEF or Unity (yes there are others but these 2 are for now the most logical choice).

After reading David Hill’s blog (http://blogs.msdn.com/b/dphill/archive/2009/12/09/prism-and-mef.aspx) it seems it can be argued that MEF isn’t even a DI container. In fact MEF and Unity can be used together with PRISM! Obviously I can’t expect to learn these concepts within a week.

Novint XIO

The Novint XIO looks very interesting indeed. I have the Novint Falcon and I can say its a top quality product. If the XIO has the same build quality as the the Falcon that certainly won’t be an issue.

I’ve done some Half-Life2, Team-fortress and Dead-Space 2 on the Falcon and the drivers are 99%. Dead Space 2 is already scarey enough, but add that gun recoil and geez it has you sweating. Will definately be keeping an eye on this product.