The book of inspiration

January 31, 2009

Scaled Remote Desktop

Filed under: life — Tags: , , , — zproxy @ 9:01 pm

Did you know you can apply scaling for your remote desktop connection? I didn’t. Now I do.

All you have to do is to add this line to your .rdp file.

smart sizing:i:1

If you feel limited by one concurrent terminal session you can grab a patch here. Remember you can shadow any another session.

January 24, 2009

Avalon Simon Says

Filed under: jsc — Tags: , — zproxy @ 7:15 pm

Avalon Simon Says

A multiplayer remake of Simon Says.

  • Game Dimensions: 800×480
  • Categories: Puzzles
  • Keywords: simon, multiplayer
  • Rating: Everyone

Did it with c# and jsc in one day! :)

January 22, 2009

SynchronizedCounter

Filed under: c# — zproxy @ 11:13 am

This is a code post. Skip it if you do not read code.

Have you ever wondered how easy would it be to have a simple synchronized counter? This is my version of it.

The value and the date is saved in the registry. It will infer the registry path via these attributes:

    8 assembly: AssemblyTitle
   11 assembly: AssemblyCompany

This is how you would use it in an infinite loop:

  154 var c = new SynchronizedCounter.ResetEachMinute("Index0");
  155
  156     while (true)
  157     {
  158         new { Counter = c.Increment().ToString("000000") }.ToConsole();
  159
  160         Thread.Sleep(1000 + new Random().Next(2000));
  161     }

In Vista and later you will need to add permissions for the program to modify the registry at its location.

synchronizedcounter

The implementation:

   14 internal static class Extensions
   15 {
   16     public static T ToConsole<T>(this T e)
   17     {
   18         Console.WriteLine(e.ToString());
   19
   20         return e;
   21     }
   22
   23
   24     public static string PathCombine(this string[] e)
   25     {
   26         var p = e[0];
   27
   28         for (int i = 1; i < e.Length; i++)
   29         {
   30             p = Path.Combine(p, e[i]);
   31         }
   32
   33         return p;
   34     }
   35
   36     public static TReturn ReadWrite<TReturn, A, B>(this RegistryKey k, Func<A, B, TReturn> h)
   37     {
   38         return InternalReadWrite<TReturn>(k, h);
   39     }
   40
   41     public static TReturn SynchronizedReadWrite<TReturn, A, B>(this RegistryKey k, Func<A, B, TReturn> h)
   42     {
   43         var n = typeof(TReturn).GUID.ToString();
   44         var s = new Semaphore(1, 1, n);
   45         s.WaitOne();
   46         try
   47         {
   48             return InternalReadWrite<TReturn>(k.CreateSubKey(n), h);
   49         }
   50         finally
   51         {
   52             s.Release();
   53             s.Close();
   54         }
   55     }
   56
   57     static TReturn InternalReadWrite<TReturn>(this RegistryKey k, Delegate h)
   58     {
   59         var s = (TReturn)h.DynamicInvoke(
   60             Enumerable.ToArray(
   61                 from p in h.Method.GetParameters()
   62                 let kv = k.GetValue(p.Name)
   63                 let v = kv == null ?
   64                     Activator.CreateInstance(p.ParameterType) :
   65                     Convert.ChangeType(kv, p.ParameterType)
   66                 select v
   67             )
   68         );
   69
   70         foreach (var p in typeof(TReturn).GetProperties())
   71             k.SetValue(p.Name, Convert.ToString(p.GetValue(s, null)));
   72
   73         return s;
   74     }
   75 }
   76
   77 public class SynchronizedCounter
   78 {
   79     /// <summary>
   80     /// Given the last date and value you will need to provide the next value
   81     /// </summary>
   82     public Func<DateTime, int, int> IncrementImplementation;
   83
   84     public SynchronizedCounter(string Name)
   85         : this(Assembly.GetEntryAssembly(), Name)
   86     {
   87
   88     }
   89
   90     public SynchronizedCounter(Assembly SoftwareAssembly, string Name)
   91     {
   92         if (SoftwareAssembly == null)
   93         {
   94             // In design mode we cannot save to registry
   95             Increment = () => 1;
   96             return;
   97         }
   98
   99         this.IncrementImplementation = (Date, Counter) => Counter + 1;
  100
  101         var k = Registry.LocalMachine.CreateSubKey(
  102             new[]
  103             {
  104                 "Software",
  105                 ((AssemblyCompanyAttribute)SoftwareAssembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false).Single()).Company,
  106                 ((AssemblyTitleAttribute)SoftwareAssembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false).Single()).Title,
  107                 Name
  108             }.PathCombine()
  109         );
  110
  111         Increment =
  112             () =>
  113                 k.SynchronizedReadWrite(
  114                     (DateTime Date, int Counter) =>
  115                     {
  116                         return new
  117                         {
  118                             Date = DateTime.Now,
  119                             Counter = IncrementImplementation(Date, Counter)
  120                         };
  121                     }
  122                 ).Counter;
  123     }
  124
  125     /// <summary>
  126     /// This function will read the registry, apply the increment implementation, 
  127     /// write to the registry and return the new counter
  128     /// </summary>
  129     public readonly Func<int> Increment;
  130
  131     public class ResetEachDay : SynchronizedCounter
  132     {
  133         public ResetEachDay(string Name)
  134             : base(Name)
  135         {
  136             this.IncrementImplementation =
  137                 (Date, Counter) =>
  138                     Date.Day == DateTime.Now.Day ? Counter + 1 : 1;
  139         }
  140     }
  141
  142     public class ResetEachMinute : SynchronizedCounter
  143     {
  144         public ResetEachMinute(string Name)
  145             : base(Name)
  146         {
  147             this.IncrementImplementation =
  148                 (Date, Counter) =>
  149                     Date.Minute == DateTime.Now.Minute ? Counter + 1 : 1;
  150         }
  151     }
  152 }

January 17, 2009

YouTube TV

Filed under: life — Tags: , — zproxy @ 7:33 am

Before there was the Infinitube.com, nut as of now you can finally use youtube as a VCR.

  1. Install User Agent Switcher 0.6.11 for FireFox
  2. Set Mozilla/5.0 (PLAYSTATION 3; 2.00) and Opera/9.23 (Nintendo Wii; U; ; 1038-58; Wii Internet Channel/1.0; en)
  3. Go to http://www.youtube.com/tv
  4. Press F11 (FireFox full screen)
  5. Connect your PC to the TV (See how-to videos)

January 16, 2009

The Making Of Doom

Filed under: life — Tags: , , , — zproxy @ 7:22 am

“The game designer shouldn’t be making a world in which the player is just a small part,” echoed Carmack. “The player’s the boss; it’s your duty to entertain him or her.” In the midst of this debate and other creative differences, Hall left Id to become project manager at Apogee. – gamesetwatch

See also:

January 15, 2009

Visual C++ EE does not support MFC

Filed under: visual studio — Tags: , — zproxy @ 1:36 pm

Little did I know that after installing Visual Studio C++ Express 2005 to a new IE8 test virtual machine along with the Windows Platform SDK and setting it up, I would be unable to compile a project dependent to the MFC.

fatal error C1083: Cannot open include file: ‘afxwin.h’: No such file or directory

That fact is actually written on this page.

What I did as a workaround was: I shared “Program Files\Microsoft Visual Studio 9.0\VC\atlmfc” folder from host to the virtual machine.

After a long compilation it gave more errors.

atlmfc\include\atlalloc.h(227) : error C2065: ‘_S1max’ : undeclared identifier

January 14, 2009

Stratus

Filed under: life — Tags: , , — zproxy @ 6:53 am

With Adobe Stratus you can build:

  • A video chat application
  • Multi-player games
  • Voice Over IP

January 13, 2009

Speeding. No one thinks big of you

Filed under: life — Tags: — zproxy @ 11:30 am

Share this video to everyone, and let us look at the statistics for traffic accidents next year.

January 12, 2009

Evacuation

Filed under: games — Tags: , — zproxy @ 8:54 am

evacuation

Evacuation: Flash, Puzzle, Ryan Chisholm - LINK

There also seems to be a paper board game available here.

there are no Terminal Server client access licenses

Filed under: life — Tags: , — zproxy @ 8:05 am

[Window Title]
Remote Desktop Disconnected

[Content]
The remote session was disconnected because there are no Terminal Server client access licenses available for this computer.
Please contact the server administrator.

[OK] [Help]

This is a bummer, especially if you are the server administrator.

At this point you still can use the mstsc /admin /v:myserver command to reconnect and dispose idle sessions to resume normal operation.

[Window Title]
Remote Desktop Connection Usage

[Content]
MSTSC [<connection file>] [/v:<server[:port]>] [/admin] [/f[ullscreen]]
[/w:<width> /h:<height>] [/public] | [/span] [/edit "connection file"] [/migrate]

“connection file” — Specifies the name of an .rdp file for the connection.

/v:<server[:port]> — Specifies the remote computer to which you want to
connect.

/admin — Connects you to the session for administering a server.

/f — Starts Remote Desktop in full-screen mode.

/w:<width> — Specifies the width of the Remote Desktop window.

/h:<height> — Specifies the height of the Remote Desktop window.

/public — Runs Remote Desktop in public mode.

/span — Matches the remote desktop width and height with the local
virtual desktop, spanning across multiple monitors if necessary. To span
across monitors, the monitors must all have the same height and be aligned
vertically.

/edit — Opens the specified .rdp connection file for editing.

/migrate — Migrates legacy connection files that were created with
Client Connection Manager to new .rdp connection files.

[OK]

Update: But if you are extremly unlucky, you wont be able to connect to it at all.

[Window Title]
Remote Desktop Disconnected
[Content]
Your Remote Desktop session has ended, possibly for one of the following reasons:
The administrator has ended the session.
An error occurred while the connection was being established.
A network problem occurred.
For help solving the problem, see “Troubleshoot Remote Desktop problems” in Help and Support.
[OK] [Help]

[Window Title]

Remote Desktop Disconnected
[Content]
Your Remote Desktop session has ended, possibly for one of the following reasons:
The administrator has ended the session.
An error occurred while the connection was being established.
A network problem occurred.
For help solving the problem, see “Troubleshoot Remote Desktop problems” in Help and Support.
[OK] [Help]
I had to attach a keyboard and a screen to the server just to realize a reboot would probably fix the issue – which it did. So if in doubt reboot.

January 11, 2009

No the other left

Filed under: life — Tags: , , , , , , — zproxy @ 2:52 pm

Neo (running in the corridor): “Need a little help.”
Tank: “Door on your left.”
Neo takes the door on his right
Tank: “No, the other left” – Theories on the matrix

We all know that quote don’t we.

Rewind to year 1993 and there you have Biker Mice From Mars. In this video (jump to 26:48) you got  Throttle saying the exact same line to Modo. Is there a connection? Also as the show was canceled only 3 episodes in it will continue with a fourth episode soon enough.

I loved that cartoon!

Here are the last episodes of the third season:

Once Upon a Time on Mars

sfxr – sound effects for all!

Filed under: life — Tags: — zproxy @ 8:52 am

Its original purpose was to provide a simple means of getting basic sound effects into a game for those people who were working hard to get their entries done within the 48 hours and didn’t have time to spend looking for suitable ways of doing this. – DrPetter

January 10, 2009

SGS2008: What Makes Games Fun?

Filed under: life — Tags: , — zproxy @ 10:50 am

See also:

January 8, 2009

Cannot login WSS with a domain user

Filed under: life — Tags: — zproxy @ 12:57 pm

Access denied. You do not have permission to perform this action or access this resource. Access requests are not enabled.

Delete the sharepoint version of your domain user.

Activation permission for the COM Server application with CLSID
{61738644-F196-11D0-9953-00C04FD919C1}

Windows Server 2008 x64

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{61738644-F196-11D0-9953-00C04FD919C1}
to the user NT AUTHORITY\NETWORK SERVICE SID (S-1-5-20) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

Fix it by reading this or this.

January 7, 2009

InteractiveOrdering via Avalon

Filed under: jsc — Tags: , , , — zproxy @ 8:25 am

Today I released another example project which demonstrates that you could develop an application for WPF but have it running as XBAP and additionally on flash player and javascript enabled browsers aswell.

In this application you are being aided in a comparison process and as a result you will get a preference list.

  1. XBAP version (IE)
  2. ActionScript version
  3. JavaScript version Via Coral Cache

Othe r posts in this series:

  1. WPF subset powered by Flash and DHTML
  2. WPF subset powered by Flash and DHTML Part 2
  3. AvalonExampleGallery

January 6, 2009

How’s it going?

Filed under: life — Tags: , — zproxy @ 7:55 am

The manager walks up to a developer for latest news, how does the poor sap respond?

  • It works on my machine
  • That’s weird!
  • But this was running before…
  • Some minor stuff has to be fixed
  • This must be a hardware problem
  • Someone tinkered with incoming data
  • But I didn’t touch that module
  • I’m almost finished
  • That’s will be done quickly
  • You can’t test everything.
  • It’s impossible that it will affect the other module
  • I remember that I fixed this bug already
  • Documentation is being written
  • This is not my program
  • I had lots of unexpected troubles
  • But the specification was always changing
  • I thought I found the bug
  • This change will be done in 5 minutes
  • I’m waiting for the others so I can test
  • Aside from the fact it is not working, what is your impression?

Update: Howto discourage from working overtime.

Update: Excuses for installing a game.

January 5, 2009

The Native Client

Filed under: life — Tags: , , — zproxy @ 7:06 am

The future will transform a thin client into a fat client. Lots of 3d goodness from 2008.

  1. Google Native Client – Quake
  2. Adobe Flash 10 Alchemy – Doom
  3. Adobe Flash 9 – Treasure Hunt – Wolfenstein (Multiplayer)
  4. Microsoft Silverlight – Quake
  5. Sun Java – Quake – Jake
  6. Javascript – Wolfenstein

January 4, 2009

Create a ringtone mmf for your mobile

Filed under: life — Tags: , , — zproxy @ 4:51 pm

The other day I was bored and did some audio capturing with my Vista machine. For recording I did not use the built-in Sound Recorder. Neither did I use the good old sndrec32. Instead I gave a shot at Audacity. A day after I was so fond of that newly created sound that I decided to create a new ringtone and load it onto my mobile phone. The phone only supported MIDI or MMF. The online Media Convert service traded my mp3 to the needed format. As a last step I had to upload that ringtone to a web server just to download it via the phone.

Here are the steps:

  1. Record a sound with a microphone
  2. Save it as wav or mp3
  3. Upload it to media convert
  4. Download the mmf version from media convert
  5. Upload the mmf version to a web server
  6. Download that with your mobile phone

Update: Alternate service.

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.