Skip to content

Flauschig Dev. Blog

I program therefore I am

  • Home
Expand Search Form

CSS formatted Table

Roemer Thursday, 30. July 2009 0

I’m not good in Graphics so I mostly use the default HTML Table with border=1 which does look pretty awkward…

So I decided to create a little CSS to make the default Table look a bit nicer.

Here’s the CSS:
Continue reading CSS formatted Table

Categories HTML / CSS, Programming Tags formatting, Hover, Table

PHP, MySQLi and Dynamic Parameter Binding

Roemer Thursday, 30. July 2009 2

I worked with PHP and MySQLi for the last few days and still don’t like it that much but got used to it.

Something that was annoying me pretty much was the Binding of Parameters in an SQL-Statement.
So I decided to write a little Helper Function for this. Continue reading PHP, MySQLi and Dynamic Parameter Binding

Categories PHP, Programming Tags Binding, Dynamic, MySQLi, Parameter

Copy/Move Files from Portable Device

Roemer Friday, 10. July 2009 5

I tried to make a simple Application which connects to my Digital Camera (which is detected as Portable Device) and Copy or Move the Files to my Harddisk (and put them in Directories, named by the DateTaken of the Photo). At first I tried to use the .NET FolderBrowserDialog but it was soon clear, that it can’t handle Portable Devices and doesn’t even show them.

My approach was to use the shell32.dll. It contains a BrowseForFolder which is able to handle Portable Devices. Continue reading Copy/Move Files from Portable Device

Categories C#, Programming Tags BrowseForFolder, DigiCam, Digital Camera, Files, Portable Device, Shell32

Get additional Image Metadata

Roemer Friday, 10. July 2009 2

An Image can contain additional Information about the Camera or the Date it was taken. It’s quite easy to access those Information with C-Sharp. All you need to do is to add a Reference to PresentationCore and WindowsBase, include the System.Windows.Media.Imaging Namespace and use the following Code-Snippet as a StartingPoint:

public DateTime GetDateTaken(string filePath)
{
    using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
    {
        BitmapFrame bitmapFrame = BitmapFrame.Create(fileStream, BitmapCreateOptions.DelayCreation, BitmapCacheOption.None);
        BitmapMetadata bitmapMetadata = bitmapFrame.Metadata as BitmapMetadata;
        return DateTime.Parse(bitmapMetadata.DateTaken);
    }
}
Categories C#, Programming Tags BitmapFrame, BitmapMetadata, DateTaken, Image, Metadata

Reformat Code in Visual Studio

Roemer Wednesday, 27. May 2009 0

The Feature to automatically reformat the Code in Visual Studio is quite nice. But I always forget the combination for it so here they are:

Reformat only the selected Code (keeps Breakpoints):

  1. Select the Code you want to reformat
  2. Press Ctrl-K
  3. Press Ctrl-F

Reformat the Code in the active File (keeps Breakpoints):

  1. Press Ctrl-K
  2. Press Ctrl-D

Reformat the Code in the active File (looses Breakpoints):

  1. Press Ctrl-A (Select All)
  2. Press Ctrl-X (Cut)
  3. Press Ctrl-V (Paste)
Categories General, Programming Tags Reformat, Visual Studio, VSS

Custom Diff/Merge Tools in Team Foundation

Roemer Tuesday, 19. May 2009 2

The default Diff/Merge Tool from Team Foundation is everything else than sophisticated… But who cares, it’s pretty easy to use your favorite Tools for Diffing and Merging. Continue reading Custom Diff/Merge Tools in Team Foundation

Categories Tools Tags Compare, Diff, Merge, TFS, Visual Studio

Project

Roemer Monday, 18. May 2009 0

So true…

Project

Source: Unknown

Categories Fun Tags Comic

Asynchronous Operations in WCF

Roemer Monday, 18. May 2009 0

There are multiple possibilities to call an Operation Asynchronous from a WCF Service:

Event Based Model

In this model, you register to a Completed-Event and call your Operation with an Async appended. The Callback Method is run on the same Thread that was used to call the Async Request, so you don’t need to invoke it in case you’re modifying the UI.

Example:

public void AsyncCall()
{
    MyServiceClient client = new MyServiceClient();
    client.SomeMethodCompleted += SomeMethodCompletedCallback;
    client.SomeMethodAsync(<Your Parameters>);
}

public void SomeMethodCompletedCallback(object sender, SomeMethodCompletedEventArgs e)
{
    MyServiceClient client = sender as MyServiceClient;
    if (client != null)
    {
        client.Close();
    }
    <Your Return Value> = e.Result;
}

 

IAsyncResult Model (Client-Side)

In this model, you call your Operation with a prepending Begin. Note that the Callback is running on a Worker-Thread so if you’re modifying the UI, don’t forget to invoke in the Callback.

Example:

public void AsyncCall()
{
    MyServiceClient client = new MyServiceClient();
    client.BeginSomeMethod(<Your Parameters>, new AsyncCallback(OnEndSomeMethod), client);
}

public void OnEndSomeMethod(IAsyncResult asyncResult)
{
    MyServiceClient client = asyncResult.AsyncState as MyServiceClient;
    if (client != null)
    {
        <Your Return Value> = client.EndSomeMethod(asyncResult)
        client.Close();
    }
}

 

IAsyncResult Model (Server-Side)

This is the only “true” Asynchronous Model. It will run in a Server-Thread so you are able to get the status of a pending Operation or even cancel it. The implementation is more time-consuming than the other two but, in some cases, worth the effort.
I suggest you Google for some examples.
 


 

There is a very good series of posts at Dan Rigsby’s Blog
starting at this Post. Have a look at it to get more information and examples.

Categories C#, Programming Tags Async, Begin, WCF

Sheep Overflow!

Roemer Friday, 15. May 2009 1

cant_sleep

(Click for original size)

Source: xkcd

Categories Fun Tags Comic

WCF Service on IIS7

Roemer Friday, 15. May 2009 1

When you try to access a WCF-Service with your Browser you might see the following Error:

HTTP Error 404.3 – Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

If that happens, you probably don’t have the Service Model registered with your IIS.

Here’s how to register it:

  1. Start the command window (cmd) as an Administrator.
  2. Navigate to:
    C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\
  3. In case you are running on a 64Bit machine, than navigate to:
    C:\Windows\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation\
  4. Run the following Command: ServiceModelReg –i

You now should be able to access your Webservice.

Categories ASP, Programming Tags 404, Handler, IIS, SVC, WCF
Previous 1 2 3 … 6 7 8 9 10 11 Next

Categories

  • Azure (1)
  • Fun (3)
  • Programming (71)
    • ASP (9)
    • C# (37)
    • General (5)
    • HTML / CSS (5)
    • PHP (2)
    • SQL (4)
    • WPF (2)
    • XML (2)
    • XNA (2)
  • Tools (22)
    • PowerShell (3)
    • VisualStudio (7)
  • Uncategorized (17)

Authors

  • Roemer
  • executor
  • Samuel
  • against

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tag Cloud

4.0 Binding BrowseForFolder Comic Control DataObject DateTaken DigiCam Digital Camera DragDrop Dynamic Files formatting Generic Hover Image launchy Logitech macros Metadata Model Multithreading MySQLi Parameter Portable Device powershell powershell formatting PreventAutoID prevent auto ID productivity project references references reflection SDK Shell32 Table Tools Type View ViewModel Visual Studio VS VS macros WCF XNA

Views

  • PHP, MySQLi and Dynamic Parameter Binding - 291,976 views
  • ASP.NET Postback to new Window or Popup - 41,036 views
  • Copy/Move Files from Portable Device - 38,191 views
  • Fix “The following Web projects must be converted to the new Web Site format.” Error - 29,269 views
  • Custom Diff/Merge Tools in Team Foundation - 27,850 views
  • ASP.NET 4 BrowserCaps (or: what were they thinking?) - 25,844 views
  • Win7 Boot from VHD – Part II - 23,942 views
  • Wake on Lan (WOL) with Asus z-97 Deluxe and Windows 8.1 / 10 and Synology Diskstation - 17,136 views
  • Get full page screenshot with ChromeDriver 2 - 16,148 views
  • Facebook Sliding Like Box Script - 11,490 views

Users Online

1 User Online

Flauschig Dev. Blog © 2025