Montag, 31. Mai 2010

Using exfat formatted partitions / drives on ubuntu (linux)

Let's get started right away: Why would someone use exFat to format external drives (yeah never use it to format an internal HD, use NTFS or ext). So here's why (by wikipedia)
exFAT can be used where the NTFS file system is not a feasible solution, due to data structure overhead, or where the file size or directory restrictions of previous versions of the FAT file system are unacceptable.
Ok I want a fs that doesn't have the security features of NTFS and one which has overcome the 4 GB file size limitation of FAT32. Yeah there's a file size limitation in FAT32 - you won't be able to copy a file bigger than 4 GB to your FAT32 harddisk, in other words, you'd have to split HD movies / videos.

Ok enough rambling, here we go - how to use exfat READONLY (you won't find write support as of May 2010) on ubuntu:

  1. Download this gem, a deb made by bluehappybyte. It's source code can be found here on launchpad.
  2. Install the .deb file or compile the source.

Now you're ready to read from exfat, but remember, you won't be able to write to it. Also Ubuntu won't automount exfat partitions, you'll have to do it by yourself (either write a script or do it on the go), here's how to mount a exfat partition with the above driver installed (run the command in your terminal or from a script - whatever):

sudo mount -t exfat /dev/[device] /home/[user]/Desktop/Mountpoint

Mittwoch, 26. Mai 2010

Javascript sorting functions

I recently used some array sorting in javascript (array.sort([callback])). Here are some (hopefully) useful functions which can sort strings and numbers (including currency values) ascending and descending.

// sorting functions
// sort numbers asc
function sortNumberAsc(a, b) {
    var sortBy = $.fn.microView.sortedBy;
    aa = a[sortBy].replace(/[^0-9.,]/, '');
    bb = b[sortBy].replace(/[^0-9.,]/, '');
    return (aa - bb)
}; 
// sort numbers desc
function sortNumberDesc(a, b) {
    var sortBy = $.fn.microView.sortedBy;
    aa = a[sortBy].replace(/[^0-9.,]/, '');
    bb = b[sortBy].replace(/[^0-9.,]/, '');
    return (bb - aa)
}; 
// sort text asc
function sortTextAsc(a,b){
    var sortBy = $.fn.microView.sortedBy;
    if(a[sortBy] == b[sortBy]){
 if(a[sortBy] == b[sortBy]) return 0;
 return (a[sortBy] < b[sortBy]) ? -1 : 1;
    }
    return (a[sortBy] < b[sortBy]) ? -1 : 1;
}; 

// sort text desc
function sortTextDesc(a,b){
    var sortBy = $.fn.microView.sortedBy;
    if(a[sortBy] == b[sortBy]){
 if(a[sortBy] == b[sortBy]) return 0;
 return (a[sortBy] > b[sortBy]) ? -1 : 1;
    }
    return (a[sortBy] > b[sortBy]) ? -1 : 1;
};

Donnerstag, 20. Mai 2010

Elementary Tainted Update



Changes
- Bluish touch to the buttons (on hover)
- Nicer looking window buttons on the metacity theme
- For the best experience get droid sans and use it as an application font :-)

Download it here

MicroMenu

Ok... here' another small and easy to use JQuery plugin. It's a menu that looks like those nice big Web2.0 service website-menus.

Here we go with a short Demonstration, give it a try and Download the plugin if you like what you see.

There are a few options, they're pretty easy to use, so go ahead and play with them.

orientation: 'left',
        backgroundCssClass : 'micromenu-background',
        hoverCssClass : 'micromenu-hover',
        hasChildCssClass : 'micromenu-has-child',
        childCssClass : 'micromenu-child',
        childWidth : 400,
        childHeight : 200,
        showAnimation : function(obj) { obj.show() },
        hideAnimation : function(obj) { obj.hide() }

Mittwoch, 19. Mai 2010

Elementary Tainted


There we go, a new GTK Theme. No the name pretty much says it all... or not. Its a light gray theme with dark titles and bars and a darkish panel.

But wait! You need some stuff installed to make the theme work
- GTK Engine Equinox
- GTK Engine Murrine
- And if you don't want to use another one the elementary icon set


Montag, 17. Mai 2010

Editors for web design on Linux

In this post I'm going to compare a few text, html, css and js editors for linux. There won't be a Dreamweaver or Frontpage clone here, because frankly, I don't like those "web IDE's", I don't like them at all. They are bloated, generate code I don't like and are just kinda slow.  Of course for JAVA related programming, use netbeans or eclipse and for .NET projects Visual Studio.

My all time favourite text editor is notepad++, which is small, fast and plugin-enabled. Sadly, it's windows only. Following are e few alternatives to notepad++ on Linux. The editors I'll list all have syntax highlighting for multiple languages, are small and fast, tabs for multiple documents and some are even plugin-enabled.




Great syntax highlighting (tons of languages).

Has a side pane for documents.

A fullscreen setting - great for small screens.

Supports plugins.

Doesn't support projects.

No debugging. 








Comes with a nice set of tools (Make RPMs etc).

Supports JavaScript projects.

JavaScript debugger.

Supports Plugins.

Built-In CVS support.






Supports overview over functions in left pane.

Supports plugins.

Does not support projects.

The menus aren't easy to navigate.






This list will grow as I try more editors, so far my favorite is Anjunta IDE, because it's small, clean and supports everything I need - it's like Visual Studio meets Notepad.

Freitag, 14. Mai 2010

Beautiful icon sets for web and application development

Following a list of beautiful icon sets I like to use for web and application development.
Pinvoke Fugue Icons


2'800 Icons
16 x 16 px
PNG file format



FAMFAMFAM Silk icons

700+ Icons
16 x 16 px
PNG file format

Silk Companion
adds 460 + icons to silk



PixeloPhilia


66 Icons
32 x 32 px
PNG file format



Sweetie Base-Pack


160+ Icons
8 x 8 - 24 x 24 px
PNG file format (8 and 24 bit)
PSD file format
Download Here



Vaga

60+ Icons
16 x 16 px
PNG file format
Download Here



Circular Icons

100+ Icons
16 x 16 px
PNG file format
Download Here



BWPX Icons


250+ Icons
18 x 18 px
GIF file format
Download Here



Splashy Icons


483 Icons
16 x 16 px
PNG file format
Download Here



LED Icon Set


500 Icons
16 x 16 px
PNG file format
Download Here




MONO Icons
108 Icons
32 x 32 px
PNG file format
Download Here



Farm-Fresh Web Icons


1000 Icons
16 x 16 and 32 x 32 px
PNG file format
Download Here




WOO Functions


178 Icons
32 x 32 px
PNG file format
Download Here



Token


126 Icons
16 x 16 - 256 x 256 px
PNG file format
Download Here



Free Web Design Icon Set 


310 Iccos
16 x 16 px
PNG file format
Download Here



Flavour Extended


452 Icons
48 x 48 px
PNG, PSD file formats
Download Here


Boolean: The Pixel Icon City


100 Icons
16 x 16 px
PNG file format
Download Here

Donnerstag, 13. Mai 2010

Reading excel file with C#

Excel files can easily be read from C# using OleDbDataAdapter. You just need the correct connection string - and that's where it gets a little complicated. You have to specify the version of Excel in the connection string.

Now there are pretty many connection strings that look like this one floating around the Internet

string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=" + fileName + ";" +
    "Extended Properties=Excel 8.0;";

Don't use this one, use this one instead:

string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" +
    "Data Source=" + fileName + ";" +
    "Extended Properties=Excel 12.0;";

The first connection string provides access only to older (Excel 97) Excel files - which nowadays isn't really of any use anymore. The second one uses THE ACE OLEDB Driver in version 12.0, which is able to handle the new Excel format (files with the extension .xlsx).

The other thing we need is an OleDbDataAdapter, which can be found in the following namespace

using System.Data.OleDb;

Now we got all this settled, let's take a look at the actual code

using System.Data.OleDb;

namespace Examples.Data
{

class ExcelAdapter
    {
        private OleDbDataAdapter dataAdapter;
        private DataSet dataSet;
        private DataTable dataTable;

        private String fileName;

        public ExcelAdapter(String fileName)
        {
            this.Load(fileName);
            this.fileName = fileName;
        }

        public void Reload()
        {
            this.Load(this.fileName);
        }

        private List Load(String fileName)
        {
            string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" +
                "Data Source=" + fileName + ";" +
                "Extended Properties=Excel 12.0;";

            this.dataAdapter = new OleDbDataAdapter("SELECT * FROM [Blonskij$]", connectionString);

            this.dataSet = new DataSet();

            this.dataAdapter.Fill(this.dataSet, "ExcelInfo");
            this.dataTable = this.dataSet.Tables["ExcelInfo"];
            foreach (DataRow row in this.dataTable.AsEnumerable())
            {
                
            }

            return new List();
        }
    }}

Now mind the following line

this.dataAdapter = new OleDbDataAdapter("SELECT * FROM [MySheet$]", connectionString);

Here you have to specify the Sheet in the chosen Excel file.

That's that. I hope it helps.

Mittwoch, 12. Mai 2010

Micro Select

Here we go, an easy to use Select-Replacement. Just fire up the old JQuery and get a nice Selectbox.


Demo
Try it here

Usage
The Html:
var microSelectOptions = {
    size: 5
   }
     google.load("jquery", "1.4.1");
    
     google.setOnLoadCallback(function() {
    $('.microselect').microSelect(microSelectOptions);
    $('.microselectExpand').microSelect({expand: true});
     });


Note that the options must be defined outside the document.ready (or it's google aequivalent) so it can be reachable by the buttons.


<div>
   <select id="myMicroSelect" class="microselect">
    <option value="lagwagon">Lagwagon</option>
      <option value="avail">Avail</option>
      <option value="nofx">NOFX</option>
      <option value="wizo">WIZO</option>
      <option value="propagandhi">Propagandhi</option>
      <option value="nouseforaname">No Use For a Name</option>
      <option value="descendents">Descendents</option>
      <option value="mxpx">MxPx</option>
   </select>
  </div>
  <br />
  <button onClick="$.fn.microSelect.add($('#myMicroSelect'), 'The Soviettes', 'thesoviettes', microSelectOptions);">Add</button>
  <button onClick="$.fn.microSelect.remove($('#myMicroSelect'), 'nofx', microSelectOptions);">Remove</button>
  <button onClick="alert($.fn.microSelect.getSelected($('#myMicroSelect')));">Get Selected</button>


Options
{
    title: 'Hover here to select',
    size: 5,
    checkboxes: false,
    multiple: true,
    expand: false,
    cssClassTitle: 'micro-select-title',
    cssClassSelected: 'micro-selected',
    cssClassUnselected: 'micro-unselected',
    cssClassHoverSelected: 'micro-hover-selected',
    cssClassHoverUnselected: 'micro-hover-unselected'
}


Download
Download Here

Montag, 10. Mai 2010

Office 2010 Buttons

Those are some buttons in the png format (normal, hover and pressed state). They kinda look like the buttons in Microsoft Office 2010.

Download here

Micro Accordion

JQuery Micro Accordion Plugin is a small (1.33 KB) plugin that creates a simple accordion - no bells or whistles. It's pretty easy to use just download it at the bottom of this post. A demo is included in the download.

Features
  • It hasn't much features (you're not going to need anyway ...)
  • Easy to implement.
  • Supports custom Animations.
  • It's small!

Screenshot



Demo
Try it here

Usage
The HTML Code:
<div class="microaccordion">
 <div class="micro">
  <a href="#">Title 1</a>
  <div>Content 1</div>
 </div>
 <div class="micro">
  <a href="#">Title 2</a>
  <div>Content 2</div>
 </div>
</div>

The JS Code:
$('.microaccordion').microAccordion({
 cssClassOpen: 'header-open',
 cssClassClosed: 'header-closed',
 cssClassHoverOpen: 'header-hover-open',
 cssClassHoverClosed: 'header-hover-closed',
 cssClassContent: 'content',
 openSingle: true,
 closeFunction: function (obj) {
   obj.hide();
 },
 toggleFunction: function (obj) {
   obj.toggle();
 }
});

Questions or problems? Just leave a comment.


Download
Get the following file hosted on ubuntu one:
Download Here

Samstag, 8. Mai 2010

Elementary BW Update 2


Changes
- New (Office-like) buttons
- Changed scrollbars
- Changed scalers
- Other minor fixes (Nautilus etc.)

Download Here

Freitag, 7. Mai 2010

Nature Wallpaper Pack


The Wallpaper Pack contains 14 Wallpapers (they are big enough) of nature in all it's beauty.

Download here:

Donnerstag, 6. Mai 2010

JQuery plugin to filter Telerik MVC Grid

This is a JQuery Plugin that enables you to filter the Telerik MVC Grid from outside the grid itself.


Changes
10.05.2010: Sorry guys, there was an debug alert in the script. I removed it in version 0.2.

10.06.2010: You're now able to put different values into a textbox, just put a ";" between them. So a textbox using the delimiters is handled the same as multiple textboxes with separate values. The column and operator settings will be applied to all elements.

What do I need?
Well, JQuery and the Telerik MVC Grid

Where do I start?
1. Give the grid a name, i.e. filteredGrid.
2. Put this one into document ready: $('#filteredGrid').gridFilter();

The "Apply Button"
By default, the apply button has to have the following class: "applyFilterButton"

What do I do in my html?
<input type="checkbox" class="gridfilter gf-op-range gf-col-Chambers" value="4::5" />
<input type="checkbox" class="gridfilter gf-op-range gf-col-Chambers" value="5::6" />
<input type="checkbox" class="gridfilter gf-op-eq gf-col-Chambers" value="5" />
<input type="checkbox" class="gridfilter gf-op-ne gf-col-Chambers" value="5" />
<input type="checkbox" class="gridfilter gf-op-gt gf-col-Chambers" value="5" />
<input type="radio" name="radiogroup" class="gridfilter gf-op-eq gf-col-Type" value="0" />
<input type="radio" name="radiogroup" class="gridfilter gf-op-eq gf-col-Type" value="1" />
<input type="radio" name="radiogroup" class="gridfilter gf-op-eq gf-col-Type" value="2" />
<input type="text" class="gridfilter gf-op-substringof gf-col-City" value="er" />
<input type="text" class="gridfilter gf-op-endswith gf-col-City" value="rn" />
<input type="text" class="gridfilter gf-op-startswith gf-col-City" value="be" />

Ok those are some pretty nice examples. Basically you give the input 3 classes:
the gridfilter class, the gf-op- class and the gf-col- class.


http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-client-api.html


Name of the column you wish to filter

This one goes out to all the Vulcans
To the logic, operations on the same column get connected with an OR expression, different
columns get connected by an AND expression:

(column1 OR column1) AND (column2) AND (column3 OR column3)

I think thats pretty much it.. here you go with a nice CNF (conjunctive normal form) :-)

Download
Get it here (Version 0.2)
Get the newest version here (Version 0.3) (Changes)

Have fun!

Ugly Java UI of the month: May


Well I start a nice column this month. I'd like to make anyone aware of the shockingly ugly Java Applications that torture our eyes and our screens since the dawn of the Internet. Actually even longer. Java was developed in the mid 90ies - by Sun. Yeah right Sun. Not the newspaper, no, the company that recently got bought by Oracle... Just to do some DBMS Ranting as well, I hate Oracle DB's as they are generally a very, very big pain in the ass. So maybe there will be a JAVA-ORACLE-DBMS hybrid soon, I'd call it MEGAGAMERA, after the Japanese movie monster Gamera - because it would look like shit (java) and be as big a thing as an upgrade or a migration of a ORACLE database (yeah, it's easier to print your data and let students type in record by record into your new database).

Oh well, heres the ugly java application of the month. Actually, I don't even know if it's still in use... maybe in development countries? Yeah.. Limewire, here we go.


... if it wasn't pink, it would look even worse. Especially the tabs, you know.. 'round 100 years into the future... when we will have usable e-paper... I'm sure Java tabs will still look like shit.

Mittwoch, 5. Mai 2010

Elementary BW Update

Download here:


Changes:
- Metacity theme is now based on the beautiful Lucidity Theme.
- Buttons get darker on hover and not brighter.
- GTKEntry (Textboxes) rounded.

Cheers mates :-)



Dienstag, 4. Mai 2010

Slapped Together Elementary BW



Here we go, I slapped together quite a nice (well beauty lies in the eye of the beholder and such) Gtk and Metacity theme, it's based upon the Murrine and the Equinox Gtk engine.

Since it's my first try creating themes for Gnome I used existing Themes as a basis (Names and Links are mentioned insie the Source). Well to install the theme make sure you got the newest Murrine and Equinox engines.


Again. What you need to use this theme:
  • Murrine Gtk Engine
  • Equinox Gtk Engine
  • Elementary Icon Theme



Download it here:



(Yes it's on a Microsoft site, but well I like Microsoft and I like Linux - I always try to merge the best of both worlds - now Novell on the other hand ...)

JQuery Plugin Visual Studio Item Template

Here's a JQuery Plugin Item Template for Visual Studio (2010 but I guess it works with the older versions too - btw upgrade! :-))



1. Download file from above
2. Import template in Visual Studio
2.1 Drink a beer.
2.2 Copy the Zip File to: C:\Users\\Documents\Visual Studio 2010\Templates\ItemTemplates

Have fun.

BTW. The content of the added js file looks like this:

// Template generated by Daenu Probst http://codebrewery.blogspot.com/
// Based upon the excellent article http://www.learningjquery.com/2007/10/a-plugin-development-pattern
// Icon by http://jyrik.deviantart.com/

(function ($) {
    $.fn.pluginName = function (options) {
        var opts = $.extend({}, $.fn.pluginName.defaults, options);

        // iterate and reformat each matched element
        return this.each(function () {
            var obj = $(this);

            // ... Put your fancy JQuery_Plugin1 code here ...
        });
    };

    // private functions
    function myPrivateFunction(param1, param2) {
        // private function code
    };

    // public functions
    $.fn.pluginName.myPublicFunction = function (param1, param2) {
        // public function code
    };

    // public variables
    $.fn.pluginName.myPublicVariable = 'value1';

    // public accessible defaults
    // access with: $.fn.pluginName.defaults.option1 = 'value3';
    $.fn.pluginName.defaults = {
        option1: 'value1',
        option2: 'value2'
    };
})(jQuery);

Montag, 3. Mai 2010

Pankiewicz 1.1

Oh, it's all about drugs.

Future pharmacists handy tool.
Download Version 1.1 here:

Socialize!