Shuffling
Shuffling is a very interesting programming problem, Almost everybody can come up with a good algorithm using a simple rand() function, but it gets a little tricky when one has to perform a in place shuffle (i.e. w/o using any extra memory). Knuth's Algorithm described in the Art of Computer programming, Vol 2 (which is based on Fisher Yates algorithm) is regarded as one the best known algorithm for the problem. The description on wikipedia is a little clearer and goes like this:1. Let A1 := 1, A2 := 2 and so on up to AN := N, and let n := N.2. Pick a random number k between 1 and n inclusive.3. If k ≠ n, swap the values of Ak and An.4. Alternately, instead of going n to 1 we can do a forward pass like here: int N = array.length; for (int i = 0; i < N; i++) { int r = i + (int) (Math.random() * (N-i)); int t = array[r]; array[r] = array[i]; array[i] = t; } To turn the Java example above into an example of Sattolo's algorithm, simply replace rng.nextInt(n) with rng.nextInt(n-1) in the code.
mysql - Can HTML be embedded inside PHP "if" statement
Password Safe
ATVBackup - atv-bootloader - Apple TV bootloader
Note: This requires "recovery-0.6.tar.gz" or greater. The previous versions do not contain all the required command-line tools. You have bought an AppleTV and want to alter the original internal PATA disk. What we do is take advantage of the self-restoring capability that is already built into the AppleTV EFI fireware. Warning You might use "dd" to copy the entire disk but that's a waste of time and storage space and "dd" is not the correct tool to copy GPT format disks. Let's get started, first build atv-bootloader on a USB pen disk with telnet support. This is the USB flash drive created in atv-bootloader on a USB pen disk parted -s /dev/sdb unit s print Model: SanDisk Cruzer Micro (scsi)Disk /dev/sdb: 501759sSector size (logical/physical): 512B/512BPartition Table: gpt Number Start End Size File system Name Flags 1 40s 69671s 69632s hfs+ primary atvrecv Add the ext3 partition The ending sector is the max sectors - 34 sectors (501759s - 34s = 501725s) mkdir src dst mkdir tmp mkdir staging <?
Clearing a float container without source markup
(This clearing technique was developed by Tony Aslett, of csscreator.com. The earliest known mention of the basic :after idea is found here.) Notice as of March 4th, 2008: The article you are reading is getting a bit old and much new information on the subject of clearing has appeared since it was written. Clearing Floats The Old Fashioned Way When a float is contained within a container box that has a visible border or background, that float does not automatically force the container's bottom edge down as the float is made taller. This float-enclosing behavior in IE can also be 'toggled' off again just by hovering of links within the container, if that hovering alters either the link background or one of several other CSS properties. The W3C suggests placing a "cleared" element last in the container box, which is then recognized by the container height, forcing the container to enclose the float above that cleared element too. <div><! Problems With The Method Using :after Toggle Trouble
PDF To WORD Converter - Freeware
LinuxUSBPenBoot - atv-bootloader - Apple TV bootloader
In this guide, we will build an atv-bootloader based USB flash disk that can be used for standalone boot. We will also enable telnet so we don't need a USB keyboard attached and can do everything remotely using a telnet session using a wired network connection. Unfortunately, wireless is not supported at this time. Since atv-bootloader contains all the disk tools required for creating GPT formatted partitions, one can use it to boot, partition and install Linux with a USB cdrom using only the AppleTV. We need our standard items for creating an AppleTV "Recovery" partition. parted --version parted (GNU parted) 1.8.8Copyright (C) 2007 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later < is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Written by < Verify that it looks fine and the atvrecv flag is set
PHP for Beginners: Building Your First Simple CMS
The Magic of PHP + MySQL It’s safe to say that nearly every website that’s up-to-date these days is using some form of content management system (CMS). While there are a ton of great free options that provide us with a CMS to power a website (WordPress, Drupal, etc.), it doesn’t hurt to peek under the hood and get a feel for how these systems work. To get our feet wet as back-end developers, we’ll be creating a simple PHP class that will: Create a databaseConnect to a databaseDisplay a form with two fieldsSave the form data in the databaseDisplay the saved data from the database Download Files This class is intended to give you a feel for how PHP and MySQL interact together, and to show the basics of a CMS. Building the Class Our first step is to simply lay out the class in a file named ‘simpleCMS.php’ so we have a road map to work with. As you can see, we’re creating one class with four variables and five methods. The Variables Build the Database Connect to the Database Build the Form <! <?
pageSnap
「長い間店に通っているし、数えきれないほど指名もしてきたこのキャバ嬢は、あと何回指名をすれば落とせるのか」など、キャバクラが疑似恋愛だと頭では分かっていても、男はみんなキャバクラの世界に夢を見ます。 また、そんな男に夢を見させてあげることで、キャバ嬢たちは金を吸い上げていく。男とキャバ嬢の駆け引きには、いつも高額なお金が飛び交います。 男はお気に入りのキャバ嬢の気を引くためにお金を払って指名し、高級なお店で同伴出勤し、ときには高額なブランド品などをプレゼントします。 そのため、このキャバクラの世界には考えられないような様々な「嘘」が存在します。 ■「ウチの店で出している1本10万円のドンペリは本当は偽物で卸値が2000円なんです」 ■「キープボトルは水槽で一括管理して、ほかの客にバレないように注ぎ足して出しています」 ■「店側はキャバ嬢をランク分けして、最後は枕営業しなければいけないほどのキツイノルマを課す」 ■「同僚のキャバ嬢の携帯電話から顧客情報を盗み、嫌がらせメールを送って客を奪う」 以上のような、普通では耳を疑うような事実もキャバクラの世界では本当に存在するので、これまでキャバクラで遊んだことがある方からすれば、にわかには信じられないかもしれません。 しかし、男と女の疑似恋愛という形のないものに、キャバクラで高額なお金を払っている以上、こうした「嘘」が存在していても仕方がないのではないでしょうか。 そして、最後までお客さんを騙し続けるために、これらの「嘘」が一般の客の耳に入ることはほとんどありません。 さらに、これらの「嘘」はさまざまな場所や人によって歪みを生じさせ、キャバクラへ通うお客さんとキャバ嬢の間に憎しみを生み出している場合すらあります。 このサイトでは実際にキャバクラ関係者の声を数多く集め、虚構と欲望に満ちたキャバクラの世界を紹介していきます。 またこれからキャバクラで働きたいという女性にとっても役立つ内容がたくさんあるので、ぜひ参考になれば幸いです。
Time Machine for every Unix out there - IMHO
rsync is one of the tools that have gradually infiltrated my day to day tool-box (aside Vim and Zsh). Using rsync it’s very easy to mimic Mac OS X new feature called Time Machine. In this article I’ll show how to do it, but there is still a nice GUI missing – for those who like it shiny. What Time Machine does Time Machine makes a snapshot of your files every hour. So if you lose a file, or did a devastating change to one of your files, simply go back in time until you find your file or a version that’s not corrupted. Incrementally backing up all files every hour so that you can access them in reversed chronological order isn’t that hard with standard Unix utilities like rsync. Making full backups in no time every hour You can use this method to make a backup every hour or every ten minutes if you like. So, here the command to make the backup: rsync -aP --link-dest=PATHTO/$PREVIOUSBACKUP $SOURCE $CURRENTBACKUP Lets go through the parameters step by step. #! #! Advanced rsync parameters Hard-Links
60 High Quality Free Web Templates and Layouts
When it comes to building your website with the most perfect design and usability, web templates always come in handy. These ready-made web themes take the pain out of creating a website from scratch and come with all sorts of useful and advanced features. To help you make the best choice among a gamut of different web templates, here are 50 of the best, free and high quality website templates that you can download and customize for your own use. 60 Free Beautiful PSD Website Templates to Download 60 Free Beautiful PSD Website Templates to Download Are you looking for some stunning PSD website templates to give your website a fresh look? App Starter App Starter is a multi-colored, single-page web theme, which works well to publicise your web or mobile applications. Appy Appy, a single-page template that comes with a modern web design. Asymmetry Asymmetry is a web template for creating business and portfolio websites. Avana Bow Boxus Boxus is a colorful template for agencies of all types. Datarc