tag:blogger.com,1999:blog-83702632006160415332024-03-05T10:43:35.185-08:00The Eclectic TechieA technical blog by John Tabernik spanning various Microsoft technologies (including .NET, SQL Server, and SharePoint), iPhone development on the Mac, and PHP scripting (including Joomla and CRE Loaded).jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.comBlogger48125tag:blogger.com,1999:blog-8370263200616041533.post-81952166155595066562011-12-12T09:38:00.000-08:002011-12-12T09:38:13.862-08:00The Magic Camera is Up on the App Store!I outsourced my first iOS app, and it is now live <a href="http://itunes.apple.com/us/app/the-magic-camera-free/id481940663?ls=1&mt=8">here</a>. The Magic Camera lets you take a picture of someone, but instead of taking the picture, the app actually presents a picture from a set of images of people from around the world, animals, etc.<br />
<br />
I had a few goals in putting this together--first, I thought it would be a fun app, and it seems like the kids really enjoy it. Second, I wanted to get something new in the App Store, but I did not have time to write it myself. Finally, I wanted to develop a relationship with an outsourced team to develop more app in the future.<br />
<br />
The experience was a great one--the developer that I found on oDesk did a great job, and was extremely professional. Compared to costs that I have seen others describe for app development, I got this developed for an outstanding rate. And I think the quality of the final version is high.<br />
<br />
Anyway, it was a great first experience outsourcing the app. And if you have kids, they would probably enjoy this app, like my kids do! And it's free!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com1tag:blogger.com,1999:blog-8370263200616041533.post-56077580415956445502011-05-14T08:12:00.000-07:002011-05-14T08:12:13.330-07:00Dynamic WordPress content - getting content from another databaseI am currently working on a research project to catalog a number of events from recent history. The goal was to be able to create these events in one database and display them. Due to the sophistication and layout capabilities of WordPress, this seemed like a great framework to put the presentation into. But there are a few hurdles I needed to overcome--essentially, how could I create pages in WordPress in advance, and then, when they were requested, source events them from another database.<br />
<br />
The concept may or may not seem interesting, but my goal was to dig deeper into WordPress to understand some of the inner workings. Thanks to tons of great web sites where people share their knowledge (most notably John Faulds code example <a href="http://www.tyssendesign.com.au/articles/cms/connecting-to-external-database-from-within-wordpress/comment-page-1/#comment-2835">here</a>), and WordPress's own <a href="http://codex.wordpress.org/">outstanding documentation</a>, it was easy to develop some simple code to perform the function.<br />
<br />
First off, let me explain my approach. It was to create all the pages in WordPress first programmatically, placing an identifier into the content section. My goal would be to read this content section later, be able to determine what content to get from my secondary database based on this information, and then retrieve and display my new information. <br />
<br />
All you need to do is go into your functions.php page and introduce code like the following (note John Faulds' runSQL function copied here almost verbatim):<br />
<br />
<br />
function dynamic_content() {<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$content = get_the_content();<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo "<br />
<br />
";<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$sql = "select description from dates where date = '" . $content . "'";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$results = runSQL($sql);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//echo $sql;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>while ($row = mysql_fetch_array($results)) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo $row[0];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo "<br />
<br />
";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
}<br />
<br />
<br />
function runSQL($rsql) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$rootpasswd='<password>';</password><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$user='<user>';</user><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$db='<databasename>';</databasename><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$dbcnx = @mysql_connect('localhost',$user,$rootpasswd,true);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (!$dbcnx) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>echo '<br />
Unable to connect to the database server at this time.<br />
';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>exit();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>mysql_select_db($db, $dbcnx);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$result = mysql_query($rsql) or die ('test');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>return $result;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>mysql_close($connect);<br />
}<br />
<br />
<br />
<br />
<br />
This requires some explanation first. You will notice in your loop template pages that there are regular calls to "the_content". This function actually outputs content--and since my goal was to read this and replace it, the_content() is not acceptable.jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-60595228611784326272011-04-12T18:13:00.000-07:002011-04-12T18:13:27.898-07:00Review: Android BlowsUnderstand a few things first. I love competition. I firmly believe that competition is what makes people and companies strive to be better. More than anything, I wanted iPhone to have a strong competitor to keep it honest. Anyone who lived through the glorious chip revolution of the 1990's and saw the birth of PowerPC (who?) and AMD challenge the supremacy of Intel and the resulting monumental gains in chip technologies knows the good that comes out of companies fighting for their lives.<br />
<br />
Second, understand that dollar or dollar, I own more Google stock than I own Apple stock. Google is an amazing company, I genuinely believe they try to do all the right things, and I know if I was presented with some of the interview questions posed to potential Google employees, I would probably curl up, wimpering, into a fetal position.<br />
<br />
But I have to be honest. After almost five months of desperately wanting to just *like* the Android phone, I have to conclude that it is frustrating on a par with my Windows machines at work. Yes, it's that bad.<br />
<br />
Let's start with some specifics. I am using the Samsung Fascinate from Verizon. Specs appear to be about on par with most Android phones--1GHz Hummingbird processor, 384M of RAM. I love the sleek design and slim size--it is very iPhone-esque. A co-worker showed me, and between his positive review, my love of Google, general public praise for Android, and being able to get a smart phone with Verizon service, I could not pass it up.<br />
<br />
But it only took a few times of turning it on for me to be annoyed--the phone was about as responsive as a Pentium Pro circa 1998 running Windows Vista.<br />
<br />
So I went back to my co-worker, and he explained that you pretty much HAD to run a utility (he recommended the free version of Advanced Task Killer) that would aggressively kill applications in memory that were no longer needed. With a lot of experience with iPhone and iPad development, I was immediately skeptical. Does the operating system manage everything so poorly that third party apps need to be bolted on to make the experience bearable? Has Google made the equivalent of Windows for the smart phone????<br />
<br />
Advanced Task Killer immediately created it own set of problems. Since I installed it, I notice my keypad disappears at awkward times when I am using it mid-phone call--like when I am trying to enter my PIN to access my voicemail. I tried disabling ATK for the obvious tasks--like the phone--but that did not fix the problem. Turning down the aggressiveness of the task killing (I normally have it set to "Aggressive", not the top setting of "Crazy") does help, but then my phone is no longer responsive in any way again. I would call it a catch-22, but my keypad would disappear after I type the first 2.<br />
<br />
Next comes the most common app I would use on the phone, Mail. Strangely enough, the native mail app was so slow and sluggish, I switched over to the official Yahoo! mail app. This, let me tell you, is a real piece of work. Not only does it suffer from the absolutely embarrassing performance, it has weird quirks that you need to be aware of. For example, there is an Outbox. Once I sent an email, watched the message appear on the screen saying it was waiting to be sent, then waited until it disappeared. No problem. The next day, I found this not STUCK IN MY OUTBOX. I had synched mail probably 50 times. And of course I discovered this handy problem with an important email. Today, I just figured out the work around. When messages get stuck in your Outbox, start up the aforementioned Advanced Task Killer, kill Yahoo Mail, restart it, and hope for the best. It only took me 15 minutes to send this email today. Of course, in the future, I know I can just kill the application and restart it to actually send a note. Does this sound more and more like Windows to you???? (OK, you are thinking, Google is not responsible for what Yahoo publishes, right? I think I am within my rights to list this because (1) it is actually better than the native mail app, (2) I am sure the poor performance has something to do with the operating system since every Android app seems to suffer from it.) Oh, and did I mention the performance? If you are retrieving mail, don't even bother trying to scroll the display or even use the home button to get out of the app. If an app does not want to give up control to the operating system, you might as well set the phone down and let it do its thing for the 7 minutes--because it will NOT respond.<br />
<br />
Oh, and then let's talk about browsing. If I try to launch my My Yahoo! page in the native browser, the application crashes. I guess that is good, because I don't have to load up ATK to do it for me. In desperation, I switched to the Dolphin browser, which can be downloaded free. It is pretty good, has not crashed on me, and seems to perform pretty well. I recommend Google or Verizon (whoever is packaging the native browser on the Fascinate) switch to Dolphin. It would have saved me hating something else about the Android. And you would not have needed to read this paragraph.<br />
<br />
I had a lot of confidence in Android's overall approach. Be open. Run on all kinds of hardware. Open source the code so it can be understood, and possibly improved. But I would contend after 5 months of serious use that it is simply not finished. Android, if it will ever be a contender, is going to need either a major overhaul, a significantly higher hardware requirement to offset the unacceptable performance of the apps, or some combination of the two. The iPhone outshines it in so many ways, it is not even a contest. But the biggest way--it is just plain usable. Sure, bad connection speeds are a fact of life when you are not in wi-fi range. The iPhone is cool with that--maybe you can't get your mail right then, but you can scroll through the mail you do have, even press the home button to go do something else if mail isn't getting retrieved fast enough for you. Try doing this with an iPhone, then with your shiny new Android. You will want to put your Android through the nearest window.<br />
<br />
So, if you are in the market for a smart phone, PLEASE think carefully before you get an Android. If you are patient and like waiting on your devices, or if you are getting it for free and would have to pay for anything else, or you have never used a peripheral in your life that was not powered by Windows, you might be happy with it. But if you do not fit into one of these three categories, you owe it to yourself to look at all the choices out there....jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-92220912231506876342010-11-08T20:08:00.000-08:002010-11-08T20:14:29.818-08:00Building Web Sites with Microsoft TechnologiesI just finished a continuing education class at Lakeland Community College in Kirtland, OH. I am putting the slides for the class out here if they are useful to anyone.<br />
<br />
Here are the presentation and class materials for the 5 classes:<br />
<br />
<a href="https://docs.google.com/fileview?id=0B2kHxfGtE6TUNzk2M2EyZjgtMzc2Mi00NTAwLWE3YjQtMTJlMzUxZWIxY2Fi&hl=en">Part 1: ASP.NET</a><br />
<a href="https://docs.google.com/leaf?id=0B2kHxfGtE6TUYzc5YzNlOTYtODA5Zi00ODM1LWJkYWItNjc3YWNmMzMwMjA5&hl=en">Part 1: ASP.NET project files</a><br />
<a href="https://docs.google.com/fileview?id=0B2kHxfGtE6TUZDg2MTQ0Y2YtZGVlMC00ZDY1LWFmYzEtNDI1YjE1YTBjZjQy&hl=en">Part 2: .NET Framework</a><br />
<a href="https://docs.google.com/leaf?id=0B2kHxfGtE6TUMjA2YjI4ZjUtNWJhZC00OWE1LThhNTEtYTFkODQwZjFlNmM1&hl=en">Part 2: .NET Framework project files</a><br />
<a href="https://docs.google.com/fileview?id=0B2kHxfGtE6TUMjc2NjRkYTAtNWVkYS00MTc2LWI5OTQtYTE0YThhNzk5MGYz&hl=en">Part 3: Database concepts</a><br />
<a href="https://docs.google.com/fileview?id=0B2kHxfGtE6TUZDFkODEzOGUtZjE0YS00YjVjLWE0NjEtNTc4NTQ4NGVkNzJk&hl=en">Part 4: ADO.NET</a><br />
<a href="https://docs.google.com/leaf?id=0B2kHxfGtE6TUMGIzMTRjZTctY2FjZS00Mjg1LTgxNzktMDQ5Mzk1MDFjMmYy&hl=en">Part 4: ADO.NET project files</a><br />
<a href="https://docs.google.com/fileview?id=0B2kHxfGtE6TUMzQ0YTEzY2ItYzk1My00NjY4LThiODgtYWVmYmZhOTY2OTVl&hl=en">Part 5: Putting It All Together</a><br />
<a href="https://docs.google.com/leaf?id=0B2kHxfGtE6TUZDRjNTJjN2QtNTljNS00NGJjLWIwOTctMDUxNDYxMTY2ZTg5&hl=en">Part 5: Putting It All Together project files</a><br />
<br />
<br />
Questions? Shoot me an email.jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-27144730882749103632010-08-10T16:04:00.000-07:002010-08-10T16:05:21.324-07:00Great Free Differencing Tool for MacFor some odd reason, searching in Google for a file differencing tool for Mac does not return anything promising. The best I found easily was a blog post saying to use the FileMerge that gets installed with Xcode. You can run it from the command line.<br />
<br />
Command line? Look, I am a Microsoft developer most of the time. That means I both expect and need things to be kinda easy.<br />
<br />
Luckily, I searched a little further and found <a href="http://sourcegear.com/diffmerge/">Sourcegear's DiffMerge</a>. Just like you would expect, graphical, easy to use, and free.<br />
<br />
Thanks, Sourcegear!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-81742049927513837752010-07-09T19:27:00.000-07:002010-07-09T19:27:31.200-07:00Crank Out Some iPhone Apps - Outsource Them!If you have been reading my blog, you know my story--I am a Microsoft developer by day, and an iPhone/iPad developer by night. The problem--when you have a wife and kids and a house (or even a social life) this is not really sustainable for long.<br />
<br />
With iOS4 coming out, I have been doing a little less coding lately and a little more reading about iPhone development. One of the things I have been reading is books by others promising ways to write apps quickly or make money on iPhone apps. A lot of them I just laugh at. So when I read an ad promising to let me write iPhone quickly without writing code--well, I had to read the book just to see what they were promising.<br />
<br />
To my surprise, it was a really good idea! The book, <a href="http://ed64ad8wj6wlp70926ilo5ecvi.hop.clickbank.net/">How To Create iPhone Apps with No Programming Experience</a> is actually a great step-by-step methodology to get apps built the easy way--by explaining what you want and handing it off to someone else to code. The book comes with a few extras, the most interesting on how to make money with free apps, which you probably already know. But the book itself was a good read. If you have any thoughts about trying to write an iPhone yourself but just don't have the time, this is a great solution.<br />
<br />
The best part of the book was the description of some of the completely ridiculous apps that have made big money. The point being, of course, that marketing is every bit as important in the iPhone app gold rush as programming. You can have a slick app, but if you have no marketing plan, it will disappear in the mountain of apps released daily. Conversely, if you have an idea for an app that you can market, maybe a crazy simple app could make you rich. And if you outsource them, you can crank out ten in the time you would have done one yourself.<br />
<br />
Anyway, check out <a href="http://ed64ad8wj6wlp70926ilo5ecvi.hop.clickbank.net/">How To Create iPhone Apps with No Programming Experience</a>. It is a great no-nonsense approach to getting your app out there for people to download.<br />
<br />
BTW--I have unofficially crossed the 50,000 app download mark. How exciting is that!!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-2696672300747611942010-06-01T09:48:00.000-07:002010-06-03T00:48:27.204-07:00Review process for iPad apps--Yikes!So I submitted my first iPad app almost 2 weeks ago. After being lulled into a false sense of confidence following iPhone app reviews, I have had a bad experience with this review.<br />
<br />
iPhone app reviews had gotten down to a few days at the end of last year and earlier this year. So I expected the iPad app review for my first app to be, I don't know, vaguely like that.<br />
<br />
When I saw my app go from "submitted" to "in review" so quickly, I was very optimistic. But then came an extremely long delay. And OK, I am fine with a delay--I am sure everyone is submitted iPad apps right now.<br />
<br />
But then came the frustration. After 8 days (yes, 8 days) I get a notice that my app had been rejected. The reason? I had called it "FindIt for iPad" on the title screen, and this is a copyrighted term. Fair enough--I probably should have thought of that. But what required 8 days to figure out that "iPad" was prominently placed on the main page?????<br />
<br />
Then, of course, the process has to start over from scratch. Again, I get it--a new binary, and anything can be in it. So the new executable has to be completely tested. So we are now a full 16 days from the initial submittal. And I don't have much confidence that it is really being reviewed any more when it says "in review." (See rant above about "how did it take 8 days to figure out 'iPad' was prominently placed on the main page.")<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil-4rYi4sGRX9gpH1HbqRvcELeJgKvPr1F5mM5q0P0DrOlaWzWX_-nQM4jI09F6tRFnkcfmxPLe32movwPJUGu7UFFOJ_4j-WJolIXnDdnvjl8iDWIJY8P37lMVC64mnjyRkFhdT2k9_k/s1600/FindIt-Review.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil-4rYi4sGRX9gpH1HbqRvcELeJgKvPr1F5mM5q0P0DrOlaWzWX_-nQM4jI09F6tRFnkcfmxPLe32movwPJUGu7UFFOJ_4j-WJolIXnDdnvjl8iDWIJY8P37lMVC64mnjyRkFhdT2k9_k/s400/FindIt-Review.png" width="400" /></a></div><br />
Scary stuff. Hopefully this helps someone out there avoid the same issue I had.jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-3330041493433553452010-05-17T17:43:00.000-07:002010-05-17T17:43:07.891-07:00Anybody need $5/mo PHP hosting?So it turns out I overbought my PHP hosting a bit....and I have a bunch of extra bandwidth. It is great hosting from HostNine, including MySQL database, Control Panel, Fantastico Deluxe with Joomla and WordPress, etc etc. I bought a reseller account because I needed to host for several of my clients. This was a good deal, but I have a bunch of unneeded bandwidth that is going to waste.<br />
<br />
Anyway, let me know if you are interested. We can work out how much throughput and space you need. You can't get quality hosting like anywhere for $5/month!<br />
<br />
I think I can take on 4-5 new accounts, so I will offer this deal to the first 4 or 5 people to get in touch with me. Good luck!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com2tag:blogger.com,1999:blog-8370263200616041533.post-12974471760516914792010-05-17T16:53:00.000-07:002010-05-17T16:53:18.783-07:00Best. Mac Memory. Ever.I have really wanted for a while to upgrade my MacBook Pro from 4G to 8G, but I didn't want to fork over the $800 (recently dropped to $600) to get it from the Apple Store. There are lots of sites out there that offer premium memory for discount prices--how do you know you will get good memory and good customer service? You ask your other Mac friends where they get there memory!<br />
<br />
Luckily, my friend Dave Ferrell (a.k.a. XCodeGuy) has owned Macs for a long time and has a number of do's and don'ts when it comes to software, hardware, and peripherals. He recommended <a href="http://www.ramjet.com/index.html">RamJet.com</a>, which he said has great prices and the memory has always worked for him.<br />
<br />
I have to say the customer experience with RamJet was above average. Between the emails alerting me to the status of the order, the status of shipping, and the status of my refund, I was very impressed. Yes, I said REFUND. RamJet will buy back your existing memory for a nice price. I was able to buy my new memory for $359 and get $50 back for my Apple memory. So for almost 1/2 the price of the Apple memory, I got my 8G and I am loving it!<br />
<br />
So, if you need solid memory for less than you would pay for genuine Apple memory, you can't miss with RamJet. Thanks guys!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-49941228029123402762010-04-18T16:04:00.000-07:002010-04-18T16:04:40.806-07:00Pretty tired of Magic Mouse issuesAs you are probably aware, I am huge fan of the Mac and of Apple products. The are solid, well engineered, and I have had few issues with any Apply hardware.<br />
<br />
Except for the Magic Mouse, which has caused me a lot of frustration. My first mouse I got at Christmas of 2009 for use with my early-2009 unibody 2.66Ghz MacBook Pro. It worked great for a while--it was easy to make the transition to it, and I really like having the desktop even less cluttered because it is wireless.<br />
<br />
But then, after a few months, I started experiencing a strange issue. A large percentage of the time, even if I clicked all the way over to the left of the mouse, it would act like I was doing a right-click. After having my wife try it too (to make sure I wasn't doing something wrong) and confirm it was acting strangely, I took it back and had it replaced.<br />
<br />
Then, everything worked well for a few months. Until I disconnected the MacBook Pro from everything and used it away from my mouse and keyboard. Ever since I brought the MacBook Pro back and reconnected it, I have to manually disconnect and reconnect the mouse every time I start up my laptop.<br />
<br />
One of the things I love about Apple products is that they just work. We pay a premium for them, and they are worth it, because they save us time. But what about when they don't work? Then we paid a premium for junk--and worse yet, with high expectations, because Apple stuff is supposed to *just work*.<br />
<br />
This is definitely the kind of thing that would have annoyed me on the PC. On the Mac, I am just fed up. I want my money back.jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-16544368905137441652010-03-28T18:48:00.000-07:002010-03-28T18:48:04.256-07:00Detect IE6 and redirect to compatible site in CRE LoadedThere are tons are beautiful CRE Loaded sites--if you are ever in the market for one, I personally am a huge fan of <a href="http://www.algozone.com/">AlgoZone</a> and <a href="http://www.rockettheme.com/">RocketTheme</a> for CRE Loaded and Joomla themes. But one of the downsides of the nicer themes is compatibility issues. For those of you who have not jumped on the CSS bandwagon, or for others of you unaware of the "old days" of web development, there has been a huge shift over time in the way styles are applied to sites.<br />
<br />
In the old days, tables were your only tool. Whatever you needed to do, you created tables, nested tables, and played with table attributes. Tables could do a lot, but the final code for a complex page was all but incomprehensible, and forget trying to debug someone else's. It could be a real mess to find and fix errors, or to try to add new elements into pages.<br />
<br />
The shift over time has been to use CSS styles applied to DIV tags. This keeps a great deal of presentation details separate from the pages, allow for page content to be developed apart from really complex styles. In addition to separating the actual code, this also provides great ways to take a page and render it completely differently based completely on the CSS applied. Content management systems in particular make extensive use of this because their individual widgets can display simple content, and the CSS applied can really change the output. This would have been a very difficult job in the old table days.<br />
<br />
So back to CRE Loaded styles. I recently was working on putting a new template on a storefront, when one of my team members thought to look at the in IE6. The results were horrific. The site not only looked bad, elements such as the product menu just didn't show up. We ran some stats and found to our surprise that nearly 10% of potential customers coming to the store use IE6. So something had to be done.<br />
<br />
I decided the easiest solution was to set up another domain, check the browser type, and then redirect IE6 users to the other domain. Connection information in CRE Loaded would stay the same, so both sets of users would share the same database, and the job would be trivial.<br />
<br />
So, I searched the code and found a good place to put the IE6. The first step was the put the following in includes/application_top.php:<br />
<br />
<code><br />
// first.....since IE6 performs very badly with our template....<br />
// detect the browser and send all those poor souls to the<br />
// old template<br />
include('includes/browser_detect.php');<br />
<br />
$a_browser_data = browser_detection('full');<br />
if ( $a_browser_data[0] == 'ie' )<br />
{<br />
if ( $a_browser_data[1] <= 6 )
{
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$url = str_replace("www.myDomain.com", "www2.myDomain.com", $url);
header('Location: ' . $url ) ;
}
}
</code><br />
<br />
<br />
I found some great code to detect the browser type <a href="http://TechPatterns.com">here</a>. I put that code in includes/browser_detect.php.<br />
<br />
Then I went to test, and discovered that half the time I clicked on things, I was being redirected to the old site. After some seaching, I found that the domain is actually stored in a few pages of the php script. I changed those, and then I was staying consistently in the new site. Perfect.<br />
<br />
Next I went into the admin side of the new site, and changed the template. Oh wait. The default template is stored in the database! The database that I am sharing between the sites! Time for more analysis.<br />
<br />
I searched and searched through the code and discovered that DEFAULT_TEMPLATE was the variable that I needed to set, but DEFAULT_TEMPLATE was not set anywhere in the code. I realized my lack of PHP knowledge was hurting me, so I started looking up constant definition in PHP. It became clear that the value was being set somewhere, but searching the codebase had turned up nothing. Then I realized there must be somewhere in the code that all the configuration variables were being pulled in from the database and constants were being created for them.<br />
<br />
After more searching, I discovered the code I expected was in includes/application_top.php, not far from where I had inserted the above lines:<br />
<br />
<code><br />
// set application wide parameters<br />
$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);<br />
while ($configuration = tep_db_fetch_array($configuration_query)) {<br />
define($configuration['cfgKey'], $configuration['cfgValue']);<br />
}<br />
</code><br />
<br />
<br />
PHP does not allow you to redefine the constants either....so there was no way to let this loop occur and then redefine the value later. Instead, you could either put an if clause in the code, look for DEFAULT_TEMPLATE, and set the value there, or instead set your override value first, then check as you are looping to see if the value is already defined, and only define it if it is not. It was late at night, so I chose the first. The more bulletproof way would really be to set up an include to define overrides and then put the conditional logic in this loop to skip any values that are currently defined. When I have some free time I will definitely refactor this code.<br />
<br />
Anyone ever try to do anything like this? Let me know if you had a better solution. Thanks!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-22261982515262518042010-03-16T09:52:00.000-07:002010-03-16T09:52:56.163-07:00The Infamous "Access Denied" AJAX ErrorA client of mine had a website issue--the red X in the lower left in IE saying an error had occurred. I dug in a little and discovered the famous pop-up that you have probably seen if you have done any amount of AJAX development:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmXWqG1FTsgXdv-L4CeZOGyFyE21zu8ob_dur62min9govbuFTryonJjAQn7L8LHmTyz45TC9RLFzhiSgtiR3nBJ_d__OLEXObKJbRpfYv67CTDxjzMKtYjlq0VFBfmFXbPmEP6vqGt3o/s1600-h/AJAXerror.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmXWqG1FTsgXdv-L4CeZOGyFyE21zu8ob_dur62min9govbuFTryonJjAQn7L8LHmTyz45TC9RLFzhiSgtiR3nBJ_d__OLEXObKJbRpfYv67CTDxjzMKtYjlq0VFBfmFXbPmEP6vqGt3o/s320/AJAXerror.png" /></a></div><br />
<br />
The error message can change slightly depending on your browser, but you will get some variation of "This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?" or "Access denied" or "Access is denied."<br />
<br />
Essentially, here is the problem. It is not uncommon, especially in large corporate environments, for the web services being called to actually live in a different domain from the page that is rendered. Browsers consider it a security hole to be displaying data from site X and be performing an XmlHttpRequest against site Y. And this is probably for the best.<br />
<br />
To remedy this situation, you need to either (1) get your application and web services on the same domain or (2) provide some kind of proxy that allows for calling the web service on the other domain within your own domain.<br />
<br />
Sometimes this is easier said then done, but I was very lucky in my case. My client actually was using a domain name that resolved to the same domain the page was being served up from. They had created separation in case the web services and web sites were ever migrated to different machines. So, it was a simple matter of using the same domain for the services used by the web site.<br />
<br />
The client is actually moving in the direction of making all their machines the same, at least for this collection of web apps and services. It is not often a resolution to a problem is so easy. Anyway, this is something to keep in mind when you get the "access denied" error on an AJAX-enabled site.<br />
<br />
Good luck out there!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-17981376998331379152010-03-06T13:41:00.000-08:002010-03-06T13:41:43.346-08:00Draw text faster with CGContextShowTextAtPointThe FindIt puzzles have turned out pretty well, but there are still a few things I am not happy with. The things that bother me most--slow load times on the puzzle selection page and on the puzzle screen. The load time on the puzzle selection page is not horrible--usually 2 to 3 seconds. But my goal is to release an update to FindIt Premium that will include all the puzzle packs to date. If I am seeing 2-3 seconds for 10 puzzles, what will it be like at 30? This clearly needs to be improved.<br />
<br />
Luckily, this part was easier to figure out. To get the game out the door, I used text files for the data. With some time to step back and get the game cleaned up, I changed the puzzle metadata over from flat files to SQLite and Core Data. This has had a small impact on load time--around 2 seconds. Not that significant for just 10 puzzles, but in my profiling, and I seeing a significant increase as the number of puzzles increases. So my update for this should be coming out soon.<br />
<br />
But what about the main page load time? Again, I performed some analysis to determine what was the bottleneck. I had assumed loading the page data from files again was the problem. So I started commenting out code and testing. Sure enough, the puzzle data loaded very quickly from a single file. That wasn't it.<br />
<br />
Next I tried changing my looping logic, changed from a dynamically allocated NSMutableArray to an array I preallocated to the correct size, and even changed my short-cutting logic to decide whether to write out a letter or not. None of these were the culprit.<br />
<br />
But then I commented out my writing the letters to the screen with NSString drawInRect. Immediately, even my largest puzzles (85x85) loaded in a second. So I set out to find a more efficient way to write out text. As I learned more, I saw that drawInRect is really trying to do a lot for you--like using the output area of the text for alignment and clipping. I am just trying to write out a single letter, so this was all unnecessary overhead.<br />
<br />
If you are doing something like this, try CGContextShowTextAtPoint. This is a much more high-performance function that is not trying to align the text or perform clipping--it is just writing out the letters the way you tell it to. For me, this was perfect, and much more efficient. I noticed load time on even the largest puzzles was much more efficient, around 2 seconds or so, down from as many as 5.<br />
<br />
This is also good news since I plan to release an iPad version of FindIt. Sure, the processor is going to be faster, but I also plan to display a lot more on a page. Considering that, I wanted to be sure to have the efficiency tweaked for optimal performance.<br />
<br />
Hopefully this helps you too! Good luck with your iPhone and iPad development!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-85391901905727952872010-03-03T20:20:00.000-08:002010-03-03T20:20:13.416-08:00Caveat on Caching in ASP.NETIf you are working with the System.Web.Caching.Cache component in ASP.NET, there is something you should probably know. The cache is not a virtual location where data is being stored; instead, the cache is a collection, and as such, the objects being put into it are being put in by reference, not by value.<br />
<br />
I was working with a client today and they were experiencing an issue that no one could figure out. I dug into it, and discovered that they were doing the following:<br />
<br />
1) Creating an System.Xml.XmlDocument object and loading it with data<br />
2) Inserting this object into the cache<br />
3) Removing some nodes from the object<br />
<br />
<br />
Following a page transition, they were pulling the document back out of the cache, and they could not understand why nodes seemed to be disappearing. This is when I explained how the cache works, and that is it not saving a representation of the object when it is inserted into the cache, but rather putting the object into the cache collection.<br />
<br />
Just a good thing to know if you plan to be caching and changing objects. Good luck out there!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-14913305403202410232010-02-28T20:04:00.000-08:002010-02-28T20:04:43.269-08:00Expected specifier-qualifier-list before 'NSManagedObjectModel' error and how to fix itI was putting Core Data into an existing application. I was cutting and pasting a lot from the excellent Apple example, iPhoneCoreDataRecipes. No, this is not a bunch of code examples to show you how to get started with Core Data...but it is a working example of how to get an app up and running with Core Data using SQLite as a back-end persistent store.<br />
<br />
So, I was happily cutting and pasting code between iPhoneCoreDataRecipes and my iPhone app (the premium version of <a href="http://itunes.apple.com/us/app/findit-premium-word-find-game/id343745362?mt=8">FindIt</a>, if you must know) when I ran into the following error everywhere:<br />
<br />
Expected specifier-qualifier-list before 'NSManagedObjectModel'<br />
<br />
<br />
The object changed (i.e. it was not always 'NSManagedObjectModel') but the error was consistent. And yet I was copying everything over from the .m and .h files in the Apple example. Strange.<br />
<br />
My first thought was checking that I had included the Core Data framework in the app. Yup. That wasn't it.<br />
<br />
Then I realized--it was the global prefix file. I went and checked out the Apple example, and sure enough, Core Data was there. I just needed to through this into my <appname>_Prefix.pch file as well, and all the errors went away.<br />
<br />
Hope this helps you too!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com2tag:blogger.com,1999:blog-8370263200616041533.post-17662700040412687692010-02-28T18:18:00.000-08:002010-02-28T18:19:32.401-08:00This year's MacHeist is coming soon / Is Squeeze worth it?If you are a Mac user, don't miss this year's <a href="http://www.macheist.com/">MacHeist software bundle</a>, due to arrive March 2nd. MacHeist offers great niche software for free or nearly free. I usually find at least one piece of software in the bundle that I end up using regularly. Whatever else, it is cool to get your hands on new, high-quality, low-cost Mac software and take if for a spin.<br />
<br />
Right now, MacHeist is offering a free license for LateNiteSoft's <a href="http://www.latenitesoft.com/squeeze/">Squeeze for Mac</a>. The idea sounds awesome--just like compressing directories on the PC. If you are not aware of the process, file compressors sit in between the OS's file access methods and the file system, and make the files work exactly as they did before, but compressing them on writes and decompressing them on reads on the fly. The amazing part--since physical file access is typically the slowest part of the read or write, compression reduces disk access but increases CPU time. Since CPU is very cheap compared to the physical access, you usually *improve* performance while you are decreasing disk usage. This makes disk compression under most circumstances a no-brainer.<br />
<br />
But I had interesting results in using Squeeze. I had a directory of wave files that I tried to compress. The directory was around 200MB. Here is a screen capture of directory information from Path Finder:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCp5O4BmfJJdKuZ-ygAR-6-viOJECxIzVXlEpC0A_JgB6f6XDTFaRUXR4Og2hn8QyCqCPslvnD79eMf8rGiQENMTSW2tgNStGsQMp1v4F6wTbMZe7FgA6JM6ullQNy0VzVt9VFeCZghBs/s1600-h/Squeeze+-+Path+Finder+results.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCp5O4BmfJJdKuZ-ygAR-6-viOJECxIzVXlEpC0A_JgB6f6XDTFaRUXR4Og2hn8QyCqCPslvnD79eMf8rGiQENMTSW2tgNStGsQMp1v4F6wTbMZe7FgA6JM6ullQNy0VzVt9VFeCZghBs/s320/Squeeze+-+Path+Finder+results.png" /></a></div><br />
Here is what I saw in Squeeze:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRhs_YRhQ4-hOU9JK67Qo3O5KfGc8N_sCl59PujyNbHxTrocihk9Uc-LGBn_n5a5z-ceDpmgwBXSmYoo_hM_ZPAwlYXkrKCQv8BdN9yOCYa2wAHFNTC7EthDDz-FjI-9h9yElpRFac0o/s1600-h/Squeeze+results.png" imageanchor="1"><img border="0" height="46" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRhs_YRhQ4-hOU9JK67Qo3O5KfGc8N_sCl59PujyNbHxTrocihk9Uc-LGBn_n5a5z-ceDpmgwBXSmYoo_hM_ZPAwlYXkrKCQv8BdN9yOCYa2wAHFNTC7EthDDz-FjI-9h9yElpRFac0o/s400/Squeeze+results.png" width="400" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRhs_YRhQ4-hOU9JK67Qo3O5KfGc8N_sCl59PujyNbHxTrocihk9Uc-LGBn_n5a5z-ceDpmgwBXSmYoo_hM_ZPAwlYXkrKCQv8BdN9yOCYa2wAHFNTC7EthDDz-FjI-9h9yElpRFac0o/s1600-h/Squeeze+results.png" imageanchor="1"><br />
</a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRhs_YRhQ4-hOU9JK67Qo3O5KfGc8N_sCl59PujyNbHxTrocihk9Uc-LGBn_n5a5z-ceDpmgwBXSmYoo_hM_ZPAwlYXkrKCQv8BdN9yOCYa2wAHFNTC7EthDDz-FjI-9h9yElpRFac0o/s1600-h/Squeeze+results.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br />
</a></div><br />
Hmmmmm. 22GB saved on a 200MB directory? For some reason, I am skeptical. I am a developer, so I know fairly minor things like this happen--it is no reason to dismiss a piece of software. But this was in addition to the fact that is kept running, and I was not seeing significant compression on any directories. Anybody else have any good or bad stories to relate on Squeeze for Mac?jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-55882701585771172282010-02-02T09:41:00.000-08:002010-02-02T09:41:33.857-08:00Windows screen capture utilityYou probably run into this situation--you need to take a snapshot of a section of the screen for a million different reasons, either to show someone or document something or include in an email. I probably reach for a tool ten times a day to do this. The Mac and Windows Vista and 7 have this functionality built in; but what about those of us still working on XP at work?<br />
<br />
Enter Brian Scott's <a href="http://blogs.geekdojo.net/brian/articles/Cropper.aspx">Cropper</a>. Cropper is a simple, lightweight, and free solution to this problem. Install the app from the download at the like above and launch it. It will place the Cropper icon in your system tray. Then, when needed, you can double click this icon, and pop up a sliding control on the screen to select an area for copying.<br />
<br />
I used SnagIt for years and disliked several things--it seemed very bloated and slow to do simple screen captures. Plus, how many times did you highlight the upper left corner and start clicking and dragging only to see you had not gone up high enough or the left far enough? Then, you are pulled into the next screen, to exit out and try again. Painful.<br />
<br />
Cropper instead is very cool in that you can use the mouse or keyboard to move the selected area--even performing a "nudge" with the arroe keys. All around great piece of software. Thanks so much, Brian!!!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-39708075586451026062010-01-10T21:38:00.000-08:002010-01-10T21:38:38.541-08:00My concerns with Quattro WirelessI have several iPhone apps that are using Quattro Wireless as a major part of my ad serving. Quattro is a pretty good provider in that they seem to offer very competitive rates and typically have offered a pretty strong fill ratio.<br />
<br />
That is, until lately. I have noticed my fill ratio drop significantly, reaching between 20-30% in recent weeks, and hitting an abysmal 10% average for the last 3 days. I am sure Quattro has a lot of requests, with the huge growth in iPhone apps lately, and the unprecedented downloading that has been going on. But 10%??!?!? These guys are paid to provide a service, and I was not very happy with the previous 20-30% range.<br />
<br />
I really hope Apple buying Quattro can turn this kind of marked decline around. But I am not waiting to see what happens. Over the weekend, I converted my apps over to use the MobClix provider, which promises 100% fill rate--presumably caching ads and presenting them when a new one is not available from the provider.<br />
<br />
I am actually pretty impressed with MobClix. I used them for one of my apps, and I am slowly starting to convert over to them for other apps as well. Their framework is small, integration was simple, and I have noticed a significant reduction in application errors from users that are running MobClix over other providers. If you get a chance, check them out. If nothing else, the promise of 100% fill rate has really caught my attention!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com1tag:blogger.com,1999:blog-8370263200616041533.post-6646034395351157402009-12-18T19:00:00.000-08:002009-12-18T19:00:23.689-08:00Great Free HTML Editor for the MacAlthough I have searched several times with no luck for a good HTML editor for the Mac, today I decided I was done using TextEdit.<br />
<br />
Here is my criteria for a "good" HTML editor.<br />
<br />
1) The editor must provide some semblance of context highlighting. Just displaying the text is not good enough.<br />
<br />
2) The editor gets extra points for some of the features I have come to expect from using the Microsoft toolset--automatic completion of closing tags when I type the opening tag, outlining and the ability to collapse sections, and syntactical popups of available tags. Auto-identing would also get high marks.<br />
<br />
3) Support for CSS.<br />
<br />
4) Also, a huge bonus if there is some easy way to preview the output.<br />
<br />
5) The tool MUST be free.<br />
<br />
<br />
This all seems like a tall order, doesn't it? Especially when you add in #5.<br />
<br />
Well, friends, there is a tool that provides all the above and then some. Navigate your browser over to <a href="http://www.aptana.org/">Aptana</a> and download Studio. You can either download the standalone tool (around 85M) or the Eclipse plug-in if you have already downloaded Eclipse to build apps for the Android phone.<br />
<br />
Don't wait! Download it now. This is an unbelievable tool. And did I mention it's free?jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-33493551656705622532009-12-04T09:47:00.000-08:002009-12-04T09:47:59.846-08:00Using DateTime.ParseExact to load a DB2 timestamp to .NETIt would be nice if the only database you ever needed to access from .NET was SQL Server, or something similar to it, that .NET understood and worked with easily. One of my clients makes extensive use of DB2, though, and not a recent version--a version old enough that there is no LINQ provider. So, part of my job is working around some of the oddities of pulling out of DB2 and sometimes writing the result into .NET.<br />
<br />
Recently I had to pull a DB2 timestamp and save out something like a timestamp in SQL Server. As you probably know, the SQL Server timestamp is not a timestamp as all, at least not like DB2's. So when I needed to pull the timestamp from DB2 and get some semblance of a timestamp in SQL Server, I needed to convert to a DateTime in .NET.<br />
<br />
Luckily, DateTime.ParseExact was there to save the day. DateTime.ParseExact provides methods to allow you to describe in detail the format of the value you will be passing in, and have the resulting DateTime parse out the string exactly as you describe it.<br />
<br />
The solution is pretty simple (assuming dateField is the input string with the DB2 timestamp):<br />
<br />
<code><br />
Dim cultureInfo As New CultureInfo("en-US")<br />
Dim dateTime As DateTime = DateTime.ParseExact(dateField, "yyyy-MM-dd-HH.mm.ss.ffffff", cultureInfo)<br />
</code><br />
<br />
Note the ".ffffff" at the end of the format string. This allows you to specify fractions of a second, which will be coming in on the input string. Unfortunately, this information will be stripped off, and you will lose the fraction part. But at least you now have a DateTime you can save successfully into SQL Server!<br />
<br />
Good luck out there!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com1tag:blogger.com,1999:blog-8370263200616041533.post-67569947189687973882009-12-02T20:52:00.000-08:002009-12-02T20:52:43.552-08:00Zero to e-commerce in 2 days with CRE LoadedIf you have done any amount of freelance web development, you have probably been asked at some point to put together an e-commerce store front for someone. Most likely, the request also contained some caveats--like, the customer was just getting started, and wanted a store front for cheap, and they wanted it to be up pretty quickly (i.e. no long development cycle, with a minimum to the requirements gathering process), and they wanted some kind of admin tools so they did not have to contact you any time they wanted something simple like a price change.<br />
<br />
As a custom build, this would be nothing short of impossible. Hopefully your next thought is to use an existing framework and customize it, to accomplish the goals and get something up quickly and cheaply. Next, you are also thinking about hosting, which can be expensive too, depending the requirements of the tool you buy.<br />
<br />
I was presented with a similar request lately, so I started looking at some existing frameworks. My research took to through such disparate tools as DotNetNuke (of course the Microsoft guy would look at DNN) and MamboCharge, but I landed on CRE Loaded. CRE Loaded is a PHP script that has been developed on the popular OSCommerce framework. And the results are amazing.<br />
<br />
Some of the best parts of CRE Loaded are the multitude of plug-ins available (including secure credit card processing), the availability of resources (both people and web content that can assist), and the easy and speed of getting a store up and running. CRE Loaded brags about how quickly you can get a Payment Card Industry (PCI) compliant store up and running, which promises secure processing in an industry standard framework. And it is every bit as easy as they say.<br />
<br />
I recently got a store up in just a few days. I spent additional time tweaking the product, and learned a lot of the ins and outs. Let me tell you that if you plan to do any serious customization, or even maintain an inventory of even 100 items, you owe it to yourself to learn how to make changes in the SQL tables directly. I am sure CRE Loaded would rather you would either use their front end, or their custom load process--but if you know what you are doing, you can turn a difficult update across your entire inventory into a few minutes work.<br />
<br />
Case in point, I was setting up shipping for the store, and discovered that shipping requires product weights. The inventory list that I had gotten from the customer's POS system was missing a lot of things, not the least of which was shipping weights. So I had 3 options--go through the admin screens and add a weight to every item (probably close to an hour's work); extract the database to a spreadsheet, update the spreadsheet, and then reload the spreadsheet, praying that the only thing that would be changed would be the product weight (probably 15 minutes work, plus an undetermined amount of time to fix anything that might have been broken due to a typo, etc); or, write a SQL query to set every product weight to 1 pound (1 minute's work).<br />
<br />
If you are PHP person, you can also dig into the entire source, and tweak the application. This is not for those lacking caution, though, because it is a somewhat complex script, so I would not advise hacking into to it to make changes--spend some time first and figure out what it is doing. Another example, I had to make some changes to the shipping module to allow various flat rate shipping types, selectable by the customer. Currently, CRE Loaded expects that you will either use one flat rate, or chose from a number of different available shipping options. The moral of the story, though, is that will a little analysis, even this was a fairly easy change, and I could customize the app to meet the business' requirements.<br />
<br />
CRE Loaded offers a free version that is a bit limited, but the pro version does a lot and only costs the equivalent of a few hours' work. In am impressed with the speed, ease, and flexibility. If you need to get a storefront up, make sure you include it in the list of products you research. It is worth every penny!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-9242362634050904062009-11-11T09:39:00.000-08:002009-11-11T09:39:34.603-08:00CRE Loaded Automated LoadI am working on a project right now that is quite a challenge--making CRE Loaded work with an automated load from a separate POS system. CRE Loaded is a tremendous tool, but I don't think it was intended to provide automated capabilities to tie into an existing POS system.<br />
<br />
For those of you unfamiliar with it, CRE Loaded is a free, PHP-based storefront. You can find out more <a href="http://www.creloaded.org/">here</a>. CRE Loaded is based on the popular OSCommerce platform, and is a great way to get an appealing and flexible storefront up on the web quickly. In addition to the free version, there is a paid Pro version that provides additional capabilities and features.<br />
<br />
Generally, I have been very happy with CRE Loaded, but the loading process, called Easy Populate, is lacking. A few of the things you would expect to be there (automated loads, additional fields for the loads, and complete refresh of your entire store inventory) require stepping up to the Pro version, or are not available at all outside custom development. I believe the automated load of the store inventory is going to require hand coding of a CRON job to script out backing up the database, clearing it, and loading from a new import file.<br />
<br />
This is a bit of surprise because CRE Loaded seems to handle the vast majority of the desired functionality simply and easily, right out of the box. Personally, it seems like a pretty common feature to require handling a load from a POS system or other external system. Because of that, I am surprised at what seems like anemic capabilities to support load imports.<br />
<br />
That said, CRE Loaded is generally a great product, and the ability to write custom code as needed will even mitigate this issue. If you need to set up a storefront, I would put this at the top of your list to review. Just be sure you either don't need to handle external inventory, or can invest in custom code to fulfill this requirement.<br />
<br />
Good luck out there!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-48883085374366629092009-10-13T09:48:00.000-07:002009-10-13T09:48:20.890-07:00Default image not showing up for iPhone appI ran into an issue last night trying to set up the default image for the app I am about to submit to the AppStore. I have learned the first thing to look at is the capitalization when adding files to an XCode project. But there were a few other things I needed to do to get this working.<br />
<br />
So if you don't see your Default.png image showing up, try these steps:<br />
<br />
1) First, make sure your "Default.png" is named exactly that ("default.png" will not work).<br />
<br />
2) Second, make sure Default.png is in the root directory of your project.<br />
<br />
3) Do a clean of your target.<br />
<br />
4) Then build and your default image should show up.<br />
<br />
<br />
I also noticed that running this in the simulator was not helpful because my app started very quickly and the default image only displayed for a second. So, make sure you give this a try on the device to see how long the default image really displays.<br />
<br />
Good luck!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-39182948473363292062009-10-07T17:46:00.000-07:002009-10-07T17:49:57.258-07:00iPhone / Objective-C Code Examples (and .NET equivalents)I have found myself reusing a lot of the same code throughout my apps. I thought I would publish some tips and code snippets to hopefully get you going on your next project. Here they are, in no particular order. I also tried to put a .NET equivalent for those of you who, like me, are coming from a long .NET background.<br />
<br />
<br />
1) Use NSLog liberally to debug as you write your code. You can really do a lot with it. A few standard statements are for printing strings or numbers, and you can also print an Objective-C object. Here are the three I use most often:<br />
<br />
<code><br />
NSLog(@"%@", aString); // prints any NSString, for example<br />
NSLog(@"%d", anInt); // prints a signed int<br />
NSLog(@"%f", aFloat); // prints a float<br />
</code><br />
<br />
<br />
2) If you have a UITableView that you need to have updated, you can reload it with this command (assuming it is named "tableView"):<br />
<br />
<code><br />
[self.tableView reloadData];<br />
</code><br />
<br />
<br />
3) Need to iterate through a collection? Try this handy code snippet, which is similar to For Each in .NET languages:<br />
<br />
<code><br />
for (id currentObject in allObjects) {<br />
// do something here with currentObject<br />
}<br />
</code><br />
<br />
<br />
4) Here is how you can check to see if an object is certain type. This is a bit like using gettype or typeof in .NET to find a specific type:<br />
<br />
<code><br />
if ([myObject isKindOfClass:[TheClassIAmLookingFor class]]) {<br />
}<br />
</code><br />
<br />
<br />
5) Here is how you cast an object in Objective-C, like using CType or DirectCast in .NET:<br />
<br />
<code><br />
TypeToCastTo typeCastObject = (TypeToCastTo *)myObject;<br />
</code><br />
<br />
<br />
6) I show alert pop-ups a lot in my apps. Here is a simple example for an alert launched when a button is clicked, and responded to to perform some action.<br />
<br />
<code><br />
-(void)resetClicked:(id)sender withEvent: (UIEvent *) event {<br />
<br />
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Reset" message:@"Are you sure you want to reset this puzzle?\nAll of your work will be lost!" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];<br />
[alert show];<br />
[alert release];<br />
<br />
}<br />
<br />
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {<br />
// the user clicked the OK button<br />
if (buttonIndex == 1)<br />
{<br />
// reset logic goes here<br />
<br />
}<br />
<br />
}<br />
</code><br />
<br />
<br />
7) Split is a great function in .NET. Here is the Objective-C equivalent:<br />
<br />
<code><br />
NSArray *arrayOfValues = [commaDelimitedListOfValues componentsSeparatedByString:@","];<br />
</code><br />
<br />
<br />
More code snippets next time! Good luck!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0tag:blogger.com,1999:blog-8370263200616041533.post-71271690799087786442009-10-07T09:20:00.000-07:002009-10-07T09:36:24.438-07:00Update your AdWhirl SDK to 1.2.7 (and Include the AddressBook Framework)If you have not recently updated you AdWhirl SDK to 1.2.7, you may notice some big benefits if you do. I was seeing leaks before the upgrade, and a few random crashes. Both of these seem to be much improved, but also there seems to be a speed improvement as well.<br /><br />There is one caveat--when I replaced my 1.2.5 SDK with the 1.2.7 SDK, I started getting all kinds of compiler errors. I sent a note to AdWhirl support (which responded really quickly--thanks!) and they said you need to include the AddressBook framework into your app because it is by AdMob. I did not see this anywhere in the documentation, and of course, I did not expect it simply going from 1.2.5 to the more recent version. It is a 10 second fix, but I wanted everyone to be aware.<br /><br />Good luck!jtabernikhttp://www.blogger.com/profile/13434823401391118690noreply@blogger.com0