Bogiecom.com
  • About
  • Magento
  • Sitecore
  • WordPress

Category Archives: Uncategorized

MySQL Regex Column Name Selection

Posted on January 23, 2013 by bc-admin

If you’re like me, or if you’re not you might be at some point in your life… You may have a reason to lazily select all columns where the column name matches a pattern of sorts.

In my particular case, the data was organized in a fashion where several columns had the same name, but were also numbered. Since there were about 50 columns with the same pattern, I didn’t feel like writing out each column name.

1
2
3
4
5
6
7
SELECT CONCAT('SELECT ',
    GROUP_CONCAT(COLUMN_NAME SEPARATOR ', '),
    ' FROM ', 'test_db.test_table')
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_SCHEMA = 'test_db'
    AND TABLE_NAME = 'test_table'
    AND COLUMN_NAME RLIKE '^FieldDesc';

And this outputs the select statement for you

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SELECT DISTINCT FieldDesc6, FieldDesc7, FieldDesc8,
                FieldDesc9, FieldDesc10, FieldDesc11,
                FieldDesc12, FieldDesc13, FieldDesc14,
                FieldDesc15, FieldDesc16, FieldDesc17,
                FieldDesc18, FieldDesc19, FieldDesc20,
                FieldDesc21, FieldDesc22, FieldDesc23,
                FieldDesc24, FieldDesc25, FieldDesc26,
                FieldDesc27, FieldDesc28, FieldDesc29,
                FieldDesc30, FieldDesc31, FieldDesc32,
                FieldDesc33, FieldDesc34, FieldDesc35,
                FieldDesc36, FieldDesc37, FieldDesc38,
                FieldDesc39, FieldDesc40, FieldDesc41,
                FieldDesc42, FieldDesc43, FieldDesc44,
                FieldDesc45, FieldDesc46, FieldDesc47,
                FieldDesc48, FieldDesc49, FieldDesc50,
                FieldDesc51, FieldDesc52, FieldDesc53,
                FieldDesc54, FieldDesc55, FieldDesc56
                  FROM test_db.test_table;

Posted in MySQL, Uncategorized | Leave a comment |

Quick Recursive Array Iteration with PHP’s RecursiveArrayIterator

Posted on July 27, 2012 by bc-admin

Today I was trying to find one small variable in a massive PHP array.  However, var_dump and print_r weren’t outputting the contents of the array in a human readable way. So thanks to the RecursiveArrayIterator, I was able to spit out the variables in more legible manner.
Here’s how it went:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function recurse_array($arr){
$iter = new RecursiveArrayIterator($arr);
echo " ";
 
while($iter->valid()){
  if($iter->hasChildren()){
    echo "<ul><li>".$iter->key()." => ";
    recurse_array($iter->getChildren());
    echo "</li></ul>";
 
  }else{
 
    echo "<ul>
<li>".$iter->key()." => ".$iter->current()."</li>
    </ul>"; }
 
    $iter->next();
  }
echo "";
} recurse_array($thearray);

Posted in Uncategorized | Leave a comment |

Cleaning Tortoise SVN repo folder of all Dreamweaver _notes folders

Posted on May 11, 2012 by bc-admin

Recursively removing directories and/or files is always quicker this way! This particulary instance I needed to clean out the notes folder from an subversion repository (not necessarily necessary, but this can be applied wherever).

1
C:\Users\SloshDev> gci -include _notes -Recurse | %{ ri $_.FullName -recurse }

or you could…

1
C:\Users\SloshDev> Get-ChildItem -include _notes -Recurse | %{ remove-item $_.FullName -recurse }

Posted in Uncategorized | Leave a comment |

Is It Time for the Web to Abandon Flash? – PCWorld Business Center

Posted on February 4, 2010 by bc-admin

By Tony Bradley

The public battle between Adobe and Apple over bringing Flash to the iPhone, and now iPad, platforms has heated up the debate over the life expectancy of Flash as newer technologies, specifically the emerging HTML5 standard, enter the scene.

Adobe Flash helped to fill a void for a cross-platform multimedia experience on the Web. With the glaring exception of the iPhone and upcoming iPad, Flash can be found on virtually every other operating system–desktop and mobile, and for every Web browser….

Read Entire Article on PCWorld Business Center

Posted in Uncategorized | Leave a comment |

Make Your Web Site ‘Groovy’

Posted on February 2, 2010 by bc-admin

Forbes – Dan Woods
Instead, PHPers argue that PHP is the best choice for simple tasks involved in most Web sites and is actually faster to program for these tasks. …
Read Entire Article on Forbes

Posted in Uncategorized | Leave a comment |

CBC News – Canada – N.S. company helps build plasma rocket

Posted on January 30, 2010 by bc-admin

N.S. company helps build plasma rocket
Last Updated: Thursday, January 7, 2010 | 2:06 PM ET
CBC News
Engineers at Ad Astra Rocket Co. assemble a prototype plasma rocket engine using Nautel’s radio-frequency amplifiers. (Ad Astra Rocket Co.)A Nova Scotia company that builds transmitters for radio stations is helping develop a new plasma rocket engine that could cut a trip to Mars down to just 40 days…

Read Entire Article from CBC News

Posted in Uncategorized | Leave a comment |

How Will Oracle Ownership of MySQL Affect IBM, Microsoft? – Database from eWeek

Posted on January 30, 2010 by bc-admin

By: Brian Prince
2010-01-27

With its acquisition of Sun Microsystems, Oracle is bringing the MySQL database into the fold, which analysts agree will pose a challenge for Microsoft and IBM. IBM, however, says its strategy will be unaffected…

Read entire article from EWeek

Posted using ShareThis

Posted in Uncategorized | Leave a comment |

Web Development Renewed In ASP.NET MVC 2.0 — InformationWeek

Posted on January 30, 2010 by bc-admin

ASP.NET MVC provides added flexibility and control.

By Dino Esposito
InformationWeek
January 30, 2010 12:01 AM (From the February 1, 2010 issue)

ASP.NET is a stable, mature, and productive Web development platform, but the 8-year-old framework is showing signs of age. One alternative is MonoRail, a variation of the classic Web Forms model based on views (the HTML output) and controllers (methods executed in response to requests). MonoRail’s views are produced by an ad hoc engine that uses a source template and input data to produce the HTML.With MonoRail, you don’t focus on pages as you do with Web Forms. Instead, you focus on the actions being taken from the page (methods on a controller class) and its user interface (markup and data placeholders in the view). This leads to separation of concerns (SoC), where the functions of each feature in the program overlap as little as possible, and higher testability…

See Entire Article from InformationWeek

Posted in Uncategorized | Leave a comment |

CONTEST: Tweet to Win a Free Apple iPad!

Posted on January 30, 2010 by bc-admin

CONTEST: Tweet to Win a Free Apple iPad!

Posted using ShareThis

Posted in Uncategorized | Leave a comment |

Barnes & Nobles Nook – Wired.com

Posted on December 3, 2009 by bc-admin

If you just ordered a Kindle, stop reading now or you’re in for a giant dose of buyer’s remorse. Barnes and Noble unveiled a new e-book reader called ‘Nook’, and it is hot, both inside and out.

Nook looks a lot like Amazon’s white plastic e-book reader, only instead of the chiclet-keyboard there is a color multitouch screen, to be used as a keyboard or to browse books, cover-flow style. The machine runs Google’s Android OS and it will have wireless capability from AT&T.

The $260 Nook–same price as the Kindle 2–is expected to be on sale at the end of November.

read more on Wired.com

Posted using ShareThis

Posted in Uncategorized | Leave a comment |
Next Page »

Pages

  • About
  • Magento
  • Sitecore
  • WordPress

Archives

  • January 2017
  • December 2013
  • November 2013
  • February 2013
  • January 2013
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • November 2011
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • September 2009

Categories

  • .NET
  • Air Force
  • Apache Configuration
  • Bash
  • C#
  • Comma-Delimited
  • Custom Field Validator
  • Date Format
  • Dump Files
  • Files
  • Grep
  • Grooveshark
  • HTML
  • Image Resizing
  • Imagick
  • Integration
  • jQuery
  • Konami Code
  • Linux
  • Magento
  • Magento Third Party CMS Integration
  • Mini Shuttle
  • Miva Merchant 5.5
  • MySQL
  • PHP
  • Powershell
  • Regular Expressions
  • Rename-Item
  • Sed
  • Shell Scripting
  • Sitecore
  • Strings
  • Uncategorized
  • Updating Product Attributes
  • Video Games
  • Wordpress
  • X-37
  • XML
  • YUI Konami Event

CyberChimps WordPress Themes

© 2008 - 2016 Bogiecom.com