8 Reusable Code Snippet Topics
Remove Filter
|
|
Earlier I posted a snippet which showed [how to create a 2 dimensional string array from an SQLite database table](https://www.daniweb.com/software-development/csharp/code/494083/sqlite-database-table-to-2-dimensional-string-array-). This snippet is the reverse, if you will, where we create an SQLite database table from a 2d string array. It should be noted that this code has it's limitations, … |
|
The following snippet will show, how you can pass a data array to a function, and generate a table with N columns. `$data` contains some dummy data, which can come from any data source. Then you call `createHtmlTable` passing the data, the number of columns you want, and a function, … |
|
In addition to [my post in this thread](http://www.daniweb.com/web-development/php/threads/429740/php-best-practice#post1841569) I've decided to post an extended example, which also implements functions for inserts and updates. I hope the code is straightforward enough. If not, reply and let me know. The table structure I've used for my test is the following: CREATE TABLE … |
|
View the full tutorial at [URL="http://www.effectivewebdesign.co.nz/tutorial.php"]http://www.effectivewebdesign.co.nz/tutorial.php[/URL] I have tested this many times and it works fine. Please don't complain unless you really can't get it working, Just PM me and I'll fill in the blanks Happy Coding :) |
|
Lookup table is usually the fastest method to find function value, if number of values is small. Here we demonstrate the principle by using task of showing the value of byte as binary string or transforming binary string to byte binary value. |
|
This is a program which declares two vectors of 6 elements each of type double. One vector is named weight and the other is named rate. The program uses a loop to prompt the user for a weight in ounces and a postage rate for that weight and then stores … |
|
To view this tutorial with notes at [URL="http://www.effectivewebdesign.co.nz/tutorial.php"]http://www.effectivewebdesign.co.nz/tutorial.php[/URL] yes I am aware this is more php than mysql. howerver I get asked how to do it so often I thought I'd post it here aswell :) |
|
As I told before here is second implementation of one word anagrams, which prepares lookup table for all available words, if it is not generated and afterwards uses it for fast lookup. The implementation of lookup table generation is quite unoptimized, but it is only done once per vocabulary. If … |
The End.