tag:blogger.com,1999:blog-83530780874560772062024-03-05T02:03:56.631-08:00Ctrl + wAlt+ DeleteWalthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-8353078087456077206.post-22286225026947707712013-01-08T12:27:00.003-08:002013-01-09T12:32:18.292-08:00Chrome Zoom ProblemWhile working on a bug at work I discovered an issue in Chrome when you zoom in or out to a certain level. There were two elements inside a container and one was floated to the right. When a certain zoom level was reached they became unaligned making the UI look buggy.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8P0adwjX934jln3F5b7igFTtnmMjMX1IpByvE8BShvx90VTwahMfhD3TwQgO0A1tNV-8N7anIMUH6xycvdZ7Qbv1DQFzoa1GFvXyX3K0DP1xJI3PGFLNNvqaYPNiCaB9M7Djo9UKDjgU/s1600/jacked-button.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8P0adwjX934jln3F5b7igFTtnmMjMX1IpByvE8BShvx90VTwahMfhD3TwQgO0A1tNV-8N7anIMUH6xycvdZ7Qbv1DQFzoa1GFvXyX3K0DP1xJI3PGFLNNvqaYPNiCaB9M7Djo9UKDjgU/s1600/jacked-button.png" /></a></div>
<br />
<div style="text-align: center;">
Figure 1 - Buggy button</div>
<br />
The solution was to simply switch the order of the two elements inside the container.<br />
<br />
Check it out on this JS fiddle (zoom to 90%) <a href="http://jsfiddle.net/Tk7Pp/">http://jsfiddle.net/Tk7Pp/</a><br />
<br />
<br />Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-24363119469719139912011-08-12T09:33:00.000-07:002011-12-01T16:23:51.677-08:00DOM Button Elements<div><br />While working on one of my projects I ran into a problem using the javascript:history.go(-1) script in an onclick event handler. After clicking the button my page wouldn't change.<br /></div><br /><div><br />After spending a while trying to figure why Chrome was the only browser to do this, my friend Jeff and I discovered the cause of our problem was the <button> tag. After further investigation we found that <button> by default has its type set to "submit" which causes postback behavior.<br />In order to work around this you have to specify the type as you would in an form input field: type="button".<br /></div><br /><div><br />We noticed in Chrome at least, that the button didn't cause any postback behavior when it wasn't wrapped in form tags. <br /></div>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-26926164117298074732011-07-26T15:46:00.000-07:002011-07-26T15:57:27.142-07:00Propel ORMAfter searching for good database abstraction systems for PHP I found a cool ORM called Propel. Some stuff that interested me right off:<div><ul><li>Ability to gen data access classes right off of an XML schema</li><li>Simple structure</li><li>Awesome syntax</li></ul><div>Anyway, on my path to being a Propel expert (right...) I ran into a few snags. At first, after not reading the dependency requirements, I fought to get a local pear installation working. After not being successful with that installation I read through the documentation again and saw the only required dependency was Phing. </div></div><div><br /></div><div>I followed Phing's non-pear installation instructions and then followed Propel's non-pear installation. When I went to execute the Propel generator batch file it said it could not locate 'phing.bat.' After opening the batch file I found this line:</div><div><br /></div><div>22 <span class="Apple-tab-span" style="white-space:pre"> if "%PHING_COMMAND%" == "" set PHING_COMMAND=phing.bat</span></div><div><br /></div><div>I changed it to:</div><div><br /></div><div>22<span class="Apple-tab-span" style="white-space:pre"> </span>if "%PHING_COMMAND%" == "" set PHING_COMMAND=[MyPathToPhing]\bin\phing.bat</div><div><br /></div><div>After doing so... I ran the batch file again and ran into another problem, it was saying it couldn't find some of the files required to run Phing. This was because the environmental variables required to run Phing need to be added to the batch file phing.bat. I added these commands to the top of my phing batch file:</div><div><br /></div><div><div>set PHP_COMMAND=C:\php\php.exe</div><div>set PHING_HOME=C:\phing</div><div>set PHP_CLASSPATH=C:\phing\classes</div><div>set PATH=%PATH%;%PHING_HOME%\bin</div></div><div><br /></div><div>And... whala, it worked!</div>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-40904664963229527682011-07-26T15:29:00.000-07:002011-07-26T15:39:03.404-07:00XOOM vs iPAD Part 2Due to overwhelming requests our company decided to purchase iPads instead of Xooms.<div><br /></div><div>We still feel Android's interface is less user-friendly than iOS. We've also seen several problems with the XOOM crashing in the operating system's built-in modules. Android's built-in browser also has noticeable screen lag when inputting data via the virtual qwerty keyboard. Despite flash support, several multimedia websites such as Hulu and Netflix won't run on the XOOM due t copyright agreements.</div><div><br /></div><div>Some of the major benefits we saw when shopping for the XOOM are quickly fading. SD external storage, for example, seems much less useful when you can sync files over wifi. I've had my XOOM for about 2 months now and never saw the need to use this feature.</div><div><br /></div><div>Hopefully Android will step up and make their operating system more robust. Presently it seems it was rushed into the consumer market before a stable OS environment existed.</div>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com1tag:blogger.com,1999:blog-8353078087456077206.post-14154081332840256352011-05-27T09:39:00.000-07:002011-05-27T09:53:26.276-07:00The iPad, the Xoom, and the Trash Can.<div>My department has recently been assigned the task of determining the best tablet solution for our organization. Due to the fact that the ASUS eee Transformer has been out of stock everywhere, we decided to test out the iPad 2 and XOOM tablets.</div><div><br /></div><div>Coming from previous experience with iOS I was a little biased and confused when I received my XOOM. Despite the definite advantages the XOOM offers ( expandable storage, open file downloads and application installation, and desktop widgets ) I was disappointed by Android's user interface; it felt anything but intuitive and there was next to no documentation to explain it.</div><div><br /></div><div>The quality of Android 3 applications also diminishes the appeal of tablets supporting this operating system. I have never seen so many applications crash, and so many applications with pitiful functionality and user interfaces. </div><div><br /></div><div>Unfortunately the only hope for the XOOM is that application developers step up their game. We've already found several high quality applications for the iPad and hope to see them on the XOOM in the near future.</div><div><br /></div><div>iOs Applications we like:</div><div><ul><li>Quick Office Pro - Word processing, presentations</li><li>iAnnotate - Note taking, allows you to highlight sections of PDF files</li></ul><div>Android Applications we like:</div></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>None currently</div>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-79050267555308286022011-02-23T07:28:00.001-08:002011-02-23T07:47:18.848-08:00Forcing canonical hostnamesDue to the restrictions of WCF services I was sent on a quest to find out how to manage allowing http://www.example.com and http://example.com. It wasn't as easy as I had hoped until I found this <a href="http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/">article</a>.<br /><br />I have seen all over the place that it is best practice to force canonical host names. This means example.com should be redirected to www.example.com. The problem with simple redirection is that it doesn't appear to redirect query strings so old links will break on you if you just use 301 redirects. <br /><br />I asked around and found out you can accomplish redirection and keep query strings using the rewrite module for IIS. You can download it <a href="http://go.microsoft.com/?linkid=9722533">here</a>.<br /><br />The module simply sits in IIS's main features view. You can easily set it up to redirect all of your example.com pages to www.example.com using the following settings:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIV4q3bKAVhSHnHh-zE0g3_ZaLtZ6pMbUaimQmu9RDW_aS7k8Kv0j9JzrZ2WAilpAmEcEj5Ndu6f1fj4YwSzp5pV-HxIoafaJ0iSsFmThUo5jumIlvBiGXG32wbJVXOD2f8WhPpj3t5ko/s1600/rewritemodule.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 256px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIV4q3bKAVhSHnHh-zE0g3_ZaLtZ6pMbUaimQmu9RDW_aS7k8Kv0j9JzrZ2WAilpAmEcEj5Ndu6f1fj4YwSzp5pV-HxIoafaJ0iSsFmThUo5jumIlvBiGXG32wbJVXOD2f8WhPpj3t5ko/s400/rewritemodule.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5576912000631523778" /></a>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-72418391884314805642011-02-02T14:21:00.000-08:002011-02-02T14:33:52.683-08:00WCF Service References<blockquote></blockquote>Today, I learned how much of a pain it is to deal with back-end security and Ajax. Not liking the idea of exposing my data using JSONP I decided to create a WCF service that I could call through an MVC model/controller.<div><br /></div><div>It was a major pain in the butt.</div><div><br /></div><div>I am still not sure about the security modes as I am very new at WCF but at least I got it functioning. One thing I discovered is if you are disabling security in wsHttpBinding's you need to include this: <servicesecurityaudit messageauthenticationauditlevel="None"> under your behavior and then add <code><br />    <bindings><br /><br />      <wsHttpBinding><br /><br />        <binding name="wsHttpBinding"><br /><br />          <security mode="None"/><br /><br />        </binding><br /><br />      </wsHttpBinding><br /><br />    </bindings><br /></code><br /> under <code><br />  <system.serviceModel><br /></code> I just did this for testing purposes and will definitely get it changed when I decide what authentication mode I want.</div>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-9087351337943211392010-12-15T10:24:00.000-08:002010-12-15T10:33:43.573-08:00jQuery watermark pluginLately I have been doing a lot of dynamic form input creation in my projects. In several situations it didn't made sense to use form labels; so my search began for a watermark script.<div><br /></div><div>I found a script called jupdnWatermark that took the approach of overlaying a label absolutely positioned with a span as its anchor. This method seemed like a good idea because you didn't have to worry about submitting the watermark data and filtering it. However, it created a major pain when it came to CSS. In almost every situation I ran into my css rules would distort those applied by the script. When I finally got that hashed out I noticed that in Safari and Chrome the first label was always higher than those following it. Eventually I gave up on that approach.</div><div><br /></div><div>Next, I turned to jfieldtag. It actually places the watermark values in each of the inputs, successfully avoiding the CSS mess. The problem with it was that it wouldn't work on dynamically generated form elements. I am not sure why, but didn't take much time to investigate.</div><div><br /></div><div>I finally got so frustrated that I wrote my own plugin called jDigitalWatermark. I will be posting it later on today once it passes my testing.</div>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-63041317640070311282009-11-12T13:35:00.001-08:002009-11-12T13:36:42.155-08:00Menu control problem.So there is a bug with the menu control in .net with IE8, Chrome and Safari. There has been a patch for .net that will fix the problem.<br /><br />http://code.msdn.microsoft.com/KB962351/Release/ProjectReleases.aspx?ReleaseId=2648Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-22679856074384332552009-11-12T13:35:00.000-08:002011-08-12T09:54:33.278-07:00Menu control problem.So there is a bug with the menu control in .net with IE8, Chrome and Safari. There has been a patch for .net that will fix the problem.
<br />
<br />http://code.msdn.microsoft.com/KB962351/Release/ProjectReleases.aspx?ReleaseId=2648Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-69098160773462286282009-10-03T09:17:00.000-07:002009-10-03T09:29:15.773-07:00CSS Drop Down MenuSo I ran into a problem using Javascript to make a drop down menu that supports IE 7. Then my friend told me I could do it with pure CSS and I decided to give it a shot. Initially I ran into a problem with IE7 handling absolute positioning differently than all the other browsers. I found out that in IE7 it takes the margins of the element into account when it positions it. So it is important to set it to zero.<br /><span style="font-size:78%;"><span style="font-family:arial;"></span></span><br />To see the example you can go to my site:<br /><a href="http://www.digitalhelpfiles.com/testing/index.html">HTML</a><br /><a href="http://www.digitalhelpfiles.com/testing/Stylesheet.css">CSS</a>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-60820473194459205632009-08-28T07:39:00.001-07:002009-08-28T07:42:50.214-07:00Getting user role ID'sOk, so I ran into this issue when I was working on a website using ASP.net's Membership class. I wanted to get the user role ID's instead of just their string names. That way if a string name changed I wouldn't have to go and update other tables.<br /><br />Anyway, I couldn't find anything on a method that does that for you but I did find an article on this site <a href="http://www.andreas-kraus.net/blog/aspnet-membership-get-the-userid-of-the-user/">http://www.andreas-kraus.net/blog/aspnet-membership-get-the-userid-of-the-user/</a> , which tells you how to get the user ID. From there you can just query the aspnet_UsersInRole table in your membership db and it will return all the role id's for that user.Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-24760157819184808622009-08-18T12:54:00.000-07:002010-09-16T07:43:06.050-07:00Subsonic 3 SetupI as a new programmer had a rather difficult time setting up Subsonic in VS Pro 2008 and there-after learning the syntax. So in this post I am going to post some instructions that might be of help to me and others in the future.<br /><br />First, make sure you have already created a connection string in your web.config or app.config file.<br /><br />1. First you download their Zip file <a href="http://subsonicproject.com/Download">here.</a><br />2. Extract the files and look for the directory T4 Templates >> Active Record.<br />3. Inside of the Active Record directory find the file "Settings.ttinclude".<br />4. Open it with a text editor and change line 21 to:<br />const string Namespace = "your desired namespace";<br />5 Set the ConnectionStringName equal to your connection string's id.<br />6. Set the DatabaseName constant to your database's name.<br />7. Save Settings.ttinclude.<br />8. Right click on your project and add a reference to SubSonic.Core.dll. It is found under the subsonic Bianaries folder.<br />9. Now this is the tricky part...I saw in their instructions that I needed to copy their files into my project and then in visual studio you are supposed to right click on their template files and then click on "Run custom tool". Unfortunately I couldn't see that option when I right clicked on the files. That is because you need to place them in a class library first. So you need to right click on your solution and add another project. Make it a class library project. Then go back and add a reference to it in your main website project.<br />10. Now copy all of the files from subsonic's T4 Templates folder into your new class library project. You also need to create an app.config file and add the connection string again to that file. You also need to add a reference to SubSonic.Core.dll.<br />11. Now right click on each one of the files and click "Run custom tool".<br />12. Now build your class project and build the solution, you may have to clean it before it will work properly.<br />13. Now if you add your namespace reference you should see a bunch of new variables. It looks like Subsonic 3 generates two classes for each table. One will be named the same as your table and the other one will be your table name with "Table" on the end.<br /><br />Each time you make a change to your database you will need to run the custom tool for each file and then rebuild.<br /><br />A simple select statement:<br /><span ><br />MyDatabase db = new MyDatabase();<br />SqlQuery simpleQuery = db.select.From <actualtablename>().Where(tablenameTable.idColumn).IsEqualTo(1);<br />List<actualtablename> blah = simpleQuery.ExecuteTypedList <actualtablename>()<br /></span><div><span ><br /></span></div><div><span class="Apple-style-span" style="font-size: x-small;">You can also use linq chained methods like this: </span><span class="Apple-style-span" style="font-size: x-small; ">person</span><span class="Apple-style-span" style="font-size: x-small; ">.find(s=>s.person_id = 10);</span></div><div><span class="Apple-style-span" style="font-size: x-small;">To create a new person row you just enter:</span></div><div><span class="Apple-style-span" style="font-size: x-small;">person p = new person();</span></div><div><span class="Apple-style-span" style="font-size: x-small;"> p.person_name = "bleh";</span></div><div><span class="Apple-style-span" style="font-size: x-small;">p.save();</span></div>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-12388184975687546682009-08-09T09:35:00.000-07:002011-08-12T09:54:33.286-07:00IIS, Windows XP and ASP.net<p> </p>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-52045293118154589492009-08-06T14:03:00.000-07:002009-08-06T14:15:06.817-07:00VS2008 Connection issue with SQL Server 2005So I was getting a strange error: "Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture = neutral, PublickKeyToken=89845dcd8080cc91 or one of its dependencies. The system cannot find the file specified.<br /><br />Luckily I found a fix on this site:<br /><br /><a href="http://www.aghausman.net/dotnet/could-not-load-file-or-assembly-microsoftsqlservermanagementsdksfc.html">http://www.aghausman.net/dotnet/could-not-load-file-or-assembly-microsoftsqlservermanagementsdksfc.html</a><br /><br /><br />He says to install the following files which can be downloaded at: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en#filelist">http://www.microsoft.com/downloads/details.aspx?FamilyId=C6C3E9EF-BA29-4A43-8D69-A2BED18FE73C&displaylang=en#filelist</a><br /><br />Microsoft SQL Server System CLR Types<br />Microsoft SQL Server 2008 Management Objects<br />Microsoft SQL Server 2008 Native ClientWalthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0tag:blogger.com,1999:blog-8353078087456077206.post-14405421277643512412009-07-22T15:08:00.000-07:002010-09-15T08:17:12.926-07:00Blog created.I have created this blog with the purpose of simply documenting all of the strange bugs/fixes that I run into while developing websites.<br /><br />Some of the current bugs I am working with are:<br /><br />1. IE 6 and 7 z-index issues with layering elements.<br />There are many different solutions or hacks to work around this issue. For IE6 and 7 I simply cloned the elements from the DOM, appended them to the body and absolutely positioned them to their correct location. Since they were lower on the DOM, IE6 and 7 gave them a higher Z-index.<br />Another approach is to use iFrames behind the content you want to display on top. This option isn't something that is W3 XHTML 1.0 Strict complient but it works.<br /><br />2. ASP.net menu control failure in IE8 and Google Chrome.<br />The answer to this was posted on google, you simply add the following code to the Page_Load method of your master page:<br /><br /><blockquote><br />if (Request.UserAgent.IndexOf("AppleWebKit") > 0)<br />{<br />Request.Browser.Adapters.Clear();<br />}<br /></blockquote><br />Source: <a href="http://www.google.com/support/forum/p/Chrome/thread?tid=77038ab254891705&hl=en">Here</a>Walthttp://www.blogger.com/profile/13792577367711871531noreply@blogger.com0