サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
新内閣発足
www.petefreitag.com
FOR Loop for (i=1;i LTE ArrayLen(array);i=i+1) { WriteOutput(array[i]); } User Defined Function (UDF) function funky(mojo) { var dojo = 0; if (arguments.mojo EQ dojo) { return "mojo"; } else { return "no-mojo"; } } Switch Case switch(fruit) { case "apple": WriteOutput("I like Apples"); break; case "orange": WriteOutput("I like Oranges"); break; default: WriteOutput("I like fruit"); } If / Else If
CREATE DATABASE CREATE DATABASE dbName; CREATE TABLE (with auto numbering integer id) CREATE TABLE tableName ( id serial PRIMARY KEY, name varchar(50) UNIQUE NOT NULL, dateCreated timestamp DEFAULT current_timestamp ); Add a primary key ALTER TABLE tableName ADD PRIMARY KEY (id); Create an INDEX CREATE UNIQUE INDEX indexName ON tableName (columnNames); Backup a database (command line) pg_dump dbNa
Updated February 26, 2024, First Published September 14, 2005 by Pete Freitag There are lots of ways to select a random record or row from a database table. Here are some example SQL statements that don't require additional application logic, but each database server requires different SQL syntax. Select a random row with MySQL: SELECT column FROM table ORDER BY RAND() LIMIT 1 Select a random row
Updated August 8, 2024, First Published January 2, 2007 by Pete Freitag Every programmer loves to optimize, even when we know we shouldn't. To satisfy your cravings MySQL has several keywords that can be placed in your SQL statement to give the database server an explicit optimization instruction. I should point out that using the hints incorrectly will most likely cause your queries to perform wo
September 22, 2005 by Pete Freitag You can make one of those orange XML or RSS buttons or icons without using an image with CSS. Here's how: CSS: .feed { border:1px solid;border-color:#FC9 #630 #330 #F96;padding:0 3px;font:bold 10px verdana,sans-serif;color:#FFF;background:#F60;text-decoration:none;margin:4px; } HTML: <a href="/rss/" class="feed">FEED</a> Example: FEED
Updated November 9, 2023, First Published August 11, 2005 by Pete Freitag Another performance option in MySQL is the DELAY_KEY_WRITE option. According to the MySQL documentation the option makes index updates faster because they are not flushed to disk until the table is closed. Note that this option applies only to MyISAM tables, You can enable it on a table by table basis using the following SQL
This document is a summary or outline of Sun's document: Tuning Garbage collection with the 1.4.2 Hotspot JVM located here: http://java.sun.com/docs/hotspot/gc1.4.2/ (link no longer works) 1.0 Introduction For many applications garbage collection performance is not significant Default collector should be first choice 2.0 Generations Most straightforward GC will just iterate over every object in th
Updated November 16, 2023, First Published June 24, 2005 by Pete Freitag Jeffery Zeldman proclaims that tag clouds are the new mullets. However, as I'm sure you're aware some people just can't resist the mullet. I actually find my tag cloud quite handy because it lists all my tags on one page, and I can see what topics I post about most frequently quite easily. I also use it as a way to see which
Updated November 17, 2023, First Published December 13, 2005 by Pete Freitag Here's the AJAX prototype example that I used in my AJAX presentation today. I wanted to give an example of a good use of AJAX, and at the same time keep it simple. So I thought a good example would be to build a zip code verifier. As soon as the person enters the zip code it makes a request to the server to see if the zi
Updated June 25, 2024, First Published December 6, 2005 by Pete Freitag Here are 20 things you can do to make your apache configuration more secure. Disclaimer: The thing about security is that there are no guarantees or absolutes. These suggestions should make your server a bit tighter, but don't think your server is necessarily secure after following these suggestions. Additionally some of these
Updated August 8, 2024, First Published November 30, 2005 by Pete Freitag Thinking and Making has a good article called: Friendly URLs improve usability and user experience. I've always been a big fan of the friendly urls, when I see a site that uses friendly URL's I get a sense of elegance, and cleanliness. I like to use mod_rewrite with Apache (there are a number of alternatives to mod_rewrite f
Updated November 17, 2023, First Published September 21, 2005 by Pete Freitag Here are four things I didn't know you could do in a google search until recently: Fuzzy Search - Search for ~music player, and google searches for music player, mp3 player, audio player, and other words that have similar meanings to music. Number Ranges - Searches for a range of numbers, for example mp3 player 20..60 GB
Updated November 17, 2023, First Published September 22, 2005 by Pete Freitag I never cease to be amazed at what problems can be solved with pure CSS. Here are 20 CSS techniques, tips and tricks that you may find handy: CSS Uppercase Rounded Corners Rounded Corners without images Creating a Netflix style star ratings Tableless forms Styling Lists with CSS 2 Column Layout Technique 3 Column Layout
Updated May 28, 2025, First Published September 13, 2005 by Pete Freitag If you can learn HTML, you can easily learn how to build your own RSS 2.0 feeds. I'll take you through the steps to creating an RSS feed from scratch. Step 1: XML Declaration Since RSS 2.0 must validate as XML, the first line in your rss feed must be the XML declaration. <?xml version="1.0" encoding="utf-8"?> The encoding is
Updated November 17, 2023, First Published September 1, 2005 by Pete Freitag Lets face it, unless you have a photographic memory, no developer can remember all the different functions, options, tags, etc. that exist. Documentation can be cumbersome at times, thats why I like cheat sheets. They are quick references that feature the most commonly forgotten things on a specific topic. You can print t
Updated June 4, 2024, First Published October 6, 2005 by Pete Freitag Update 2023 - While SoloSub did gain some success, the decline of RSS aggregators has lead it to be shut down as well, it was fun while it lasted, and it even got some press from places like TechCrunch. You may have noticed that I've had this solosub button on my site for a while, I launched the solosub service while back (early
Updated December 6, 2023, First Published February 2, 2005 by Pete Freitag It's pretty easy to add a CSS stylesheet to your RSS feeds. I created one in about 10 minutes for my RSS feed. You can do a lot more with an XSL stylesheet (turn links into clickable links, etc), but CSS can make your feed look much less scary for the non-technical crowd. And the good news is you probably already know CSS,
Updated June 4, 2024, First Published November 26, 2004 by Pete Freitag New Amazon Deals Shopping Web Site I just launched a new web site for Finding deals on Amazon called SpendFish. The site is built with CFML, and is still in Beta - there are tons more things I plan on adding to the site. Such as RSS feeds, improved layout, and more advanced searching options. But for now it is usable, and I've
Updated November 16, 2023, First Published May 6, 2005 by Pete Freitag Update: Dashboard Widgets are no longer a feature of Mac OS, so this is just a historical record of what it was. I have had Mac OSX 10.4 Tiger for 3 days, and I have already released my first Dashboard Widget called Dash Shopper - Amazon Product Search Dashboard Widget. The widget supports multiple locales US, UK, Canada, Germa
このページを最初にブックマークしてみませんか?
『Pete Freitag's Blog』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く