サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
2024年ランキング
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
SELECT a random row with SQL Updated on February 26, 2024 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 with
MySQL Optimization Hints Updated on August 08, 2024 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 worse,
The CSS XML / RSS Button Published on 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> Exam
MySQL DELAY_KEY_WRITE Option Updated on November 10, 2023 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
Java Performance Tuning: Garbage Collection Outline 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 straight
How To Make a Tag Cloud Updated on November 16, 2023 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 tags
AJAX Tutorial with Prototype Updated on November 17, 2023 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 zip c
20 ways to Secure Apache Configuration Updated on June 25, 2024 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
Howto make Friendly URLs Updated on August 08, 2024 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 for IIS
4 Google Tricks Updated on November 17, 2023 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 will match 20, 4
CSS Techniques Roundup - 20 CSS Tips and Tricks Updated on November 17, 2023 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
Howto Create an RSS 2.0 Feed Updated on May 26, 2020 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 opti
Cheat Sheet Roundup - Over 30 Cheatsheets for developers Updated on November 17, 2023 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 specif
SoloSub is for button overload Updated on June 04, 2024 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 (ear
Adding a CSS StyleSheet to your RSS Feed Updated on December 06, 2023 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
Amazon Deals Updated on June 04, 2024 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 found a lot of gr
Amazon Search Dashboard Widget for Tiger Updated on November 16, 2023 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
このページを最初にブックマークしてみませんか?
『Pete Freitag - ColdFusion, Java & Web Blog』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く