Monday, October 10, 2016

CSS Responsive Videos

Again, these are old tricks but new to me as I get back into developing new sites rather than supporting Telerk based ones.  In the previous post I shared a CSS snippet on how to make images responsive.  Now onto video.  A lot of sites offer ways for you to copy some code that allows you to paste their videos into your various web sites.  Many use iframes to do this which can be a little problematic.

The following CSS snippet works for youtube videos at least.  I just take whatever copy/paste code form a given site that allows me to embed things and wrap it in a div with the class "vid".  Here is the CSS.


 .vid {  
   position: relative;  
   padding-bottom: 56.25%;  
   padding-top: 30px;  
   height: 0;  
   overflow: hidden;  
 }  
   .vid iframe, .video-container object, .video-container embed {  
     position: absolute;  
     top: 0;  
     left: 0;  
     width: 100%;  
     height: 100%;  

This seemed to work.  More information [HERE].

Getting the Strong Name PublicKeyTolken from an Assembly

[Update, if this doesn't work check the bottom]


Ok, this is .net 101, but I don't update assemblies that often so here is a recap of it so I remember in the future more for me than for you.

1) First, go the the assembly, right click it, get the details, write down the version number, that is probably old too.

2) Since you have the file open, copy it's path, then open up a Visual Studio command prompt.  Type in

sn -T (paste your path)\yourassemblydll

And it should output a new/correct PublicKeyTolken.

Copy and paste the new version and the new PublicKeyTolken text into your config file.  That should do it.

More info on this [HERE].

---------------------------------------

Well, this used to work all fine and good, but didn't work on a new machine that I have that just had visual Studio 2015 on it.  Here is what I had to do.


1) Navigate with file explorer to where the sn.exe file is located, for me it was here-
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools.  Copy that that path then open the Visual Studio developer prompt.

2) type cd then past the path in, hit enter.

3) Next, get the path to your dll that you want to get a strong name for.  Also write down the detail information like in step 1 in the old way above.

4) In the command prompt type sn.exe -T and hit enter.

That worked for me.

Thursday, October 06, 2016

CSS Responsive Images

This is an old trick but I didn't know it.  Here is how to make your images auto scale-

 img {  
      max-width:100%;  
      height:auto;  
 }  

More [HERE].

Also check out the new picture HTML 5 element [HERE].

Friday, September 30, 2016

Celebrating Some Depreciated Tech

Early this year I purchased an ASUS gaming laptop for development and I love it.  16 Gigs of RAM, I popped in a mk2 SSD, and the thing smokes.  But this post isn't about that.  This post is about my stall worth HP Pavilion dv6-6c35dx laptop that served me well for about three years.


I loved this laptop.  I probably had it up and running for 14 hours a day most of the time and it didn't give me any problems.  It had some gaming capability with the built in Radeon graphics card that did fine at low and sometimes medium settings playing all but the most latest games.  After about a year I put in a Samsung 840 EVO SSD and the thing really hummed.  Zero noise and fast boot times.  The six gigs of memory was just enough so I could comfortably develop on it, running virtual machines with 4 gigs of memory out of the six allocated to a particular VM.

I know HP laptops are hit and miss.  I supported HP laptops at a huge corporate cube farm early in my career and some of the models HP put out where just horrible.  I probably wouldn't have bought this one at all but dumped a cup of coffee on my Toshiba laptop and it fried. I needed a laptop for work now and at the time I liked the specs and the price of this HP so I took a risk and that little A8 Pavilion ended up being a great work horse.

Spec wise it was nothing that great, but for what I wanted to do with it it seemed perfect.  Light to medium gaming, opened applications and booted up lighting fast due to the later added SSD, quiet, never over-heated.  I miss it.

With Windows 10 coming out and Visual Studio 2015 on the way I had been debating getting a new laptop for a long time but this Pavilion just seemed to keep handling everything I could throw at it so I held off for awhile.  One of my dogs helped me take the plunge though, as it got it's tale caught in the power cord and yanked my poor Pavilion (which I had dropped and punished numerous times before without every having any problems) onto the floor and munched the monitor or the graphics card.  That was enough to in my mind justify buying a new machine.

I always felt kind of guilt though, like I had cheated.  I could still plug in my Pavilion into my TV and use it to watch internet moves through (graphics worked ok for external monitors so it probably was the display).  But tonight I decided to gut for parts my little Pavilion so it will be no more.

Work gave me a hand me down laptop and told me to use it last year so I have been.  Compared to my Pavilion and my ASUS the thing was a dog (incidentally it is a high-end HP work station laptop).  Today I couldn't stand how slow my work laptop was running so I yanked the Samsung SSD out of my Pavilion, cloned my work hard drive to it, and popped the SSD into my work computer.  Now my work computer is tolerable.  It felt like I was ripping out the soul of my little Pavilion though.

So there it is.  I was really blessed at purchasing that laptop at the time for under 600 and having it serve me so well.  I didn't research the purchase and bought it at Best Buy, usually two ingredients for a recipe for disaster, but I lucked out. I see you can buy these for under 200 bucks now, and most coming with an SSD.  For that price this laptop is still a good value, but my ASUS with all it's great specs is more of what I need now.

So I raise a glass and toast a great piece of technology that served me well: The HP Pavilion dv6-6c35dx.  I will probably yank the memory out of it tomorrow and toss it into the garbage as it isn't cost effective to try to fix the monitor.  You will be missed.

Wednesday, August 24, 2016

Telerik and Webforms: Trimming Paste on a RadComboBox

I had an issue with being able to trim incoming text into a radcombobox.  The code below is really simple but it took me a bit to figure out.  I'm stuck not using the latest release of Telerik's ASP.Net webform controls so maybe there is a different way to do this with later versions, but this worked for me.


I'm plugging into the RadComboBox's OnClientItemsRequesting by setting it to "MyItemsRequesting"

  function MyItemsRequesting(s, e) {  
     var txt = e.get_text();  
     if (txt != txt.trim()) {  
      e.set_cancel(true);  
      var d = document.getElementById("mymasternamepageifany" + "_mydropdownid_Input");  
      if (d != null) d.value = txt.trim();  
      s.requestItems(txt.trim(), false);  
     }  
   /* more code */  
  }  



Tuesday, August 02, 2016

Free FTP Program WinSCP

I've used the command line, File Explorer FTP, Smart FTP, Filezilla, and now have settled on the free WinSCP program for FTP type stuff.  It supports ftps and other formats and seems to work pretty well. It is also automatable but I haven't played with that yet.

Check it [HERE].

Visual Studio Image Library

Remember that pack of icons in Visual Studio 2010 that you could use in your projects?  I noticed them missing in Visual Studio 2015.  Apparently in order to save space Microsoft now has them as a download now.  

You can download these icons [HERE].

Thursday, June 30, 2016

Importing Access Tables into Sqlite

There are numerous ways to do this, this is how I did it.
  1. Download LibreOffice.
  2. Use Base to open your access .mdb database
  3. Right click on the table, click copy.
  4. Open Calc, create a new spread sheet, control V to paste in data that is in memory from when you right clicked copy on the table in Base.
  5. Export your new spread sheet in CVS format (I left all the default options).
  6. Open your SQLite DB (I use the SQLite Manager Plugin for Firefox to Manage SQLite DBs).
  7. Import the CSV file (again I left all the defaults except I did click use the first row as a header).
  8. Once imported, you can tweak the headers.  If the datatypes are slightly off, you might have to create a new table how you like it and then select into that table from the newly created imported table.
This was good for a simple table with about 30000 records.  Your mileage may very.  Happy coding.

Friday, May 06, 2016

Disable Codelense for Faster Visual Studio Performance (Visual Studio 2013+)

My work computer is an older machine that comes to an absolute crawl when opening up Visual Studio 2015.  One thing I did today to speed things up is to disable Codelense.

What is Codelense?  It is that new feature where if you are working in a team environment when you open up code you can see who created various pieces of code and how many modifies have happened to it and by who, plus probably other stats I'm unaware of. All fine and good but at the cost of a lot of performance I don't want it.

To disable Codelense-

Tools->Options->Text Editor->All Languages->Codelense.

Why Codelense is under Text Editor and all languages doesn't make a lot of sense to me but whatever.

This might help speed things up for you.  Happy coding.

More here-

https://stackoverflow.com/questions/20457796/how-to-turn-off-codelens-references

Tuesday, April 19, 2016

Crappy Hardware Not Worth It

OK, so for work I have the latest and greatest laptop...

Well, it was 5 years ago.

My work insist on buying "corporate" grade laptops that cost thousands of dollars.  The CIO gets the newest once a year or two, and then those of use who are remote get the hand-me-downs.  I'm about on the third wrung down.

I noticed something.  My home laptop, which is the latest and greatest ASUS light weight gaming laptop of course :)  boots up including entering my login in under 10 seconds.  From there I'm ready to go.

On my current hand-me-down work computer it is taking me from initial startup to actually having Visual Studio and a few other things up about 5 minutes.

So, for an argument for me at least a "consumer" grade gaming computer that rocks for about 1000 bucks-

Say I lose 2.5 minutes of productivity a day with booting my work laptop up and opening up software which is being generous (Visual Studio 2015 sometimes takes 2 or 3 minutes to boot).  So I'm not going to tell you how much I make but let's use a 50 dollar an hour figure.   Let's also take a 48 week work year.

48 Weeks x 5 Days a Week x 2.5 minutes = 10 hours a year of wasted productivity time x $50 and hour = $500 bucks.

Now considering corporations can right off hardware purchases as a business expense that is the equivalent of about $600 of buying power.  So that gives my company about $1200 worth of purchasing power for getting me a new laptop every two years.  And I would be totally happy with a "consumer" gaming machine (which has plenty of power and reliability) over a "corporate grade" block that cost 2x more.

My last "consumer" grade machine which at the time I also used for work because I didn't want the hand-me-downs ran flawlessly for about 14 hours a day 6 days a week for over 3 years while my co-workers "corporate" laptops tended to have issues.

Note, I haven't brought this up at work yet or cried about it there, but I might.  

So there is some ammo you can use for someone to justify getting a new machine.

Thursday, April 07, 2016

Common Free Software Packages I Use

Not too long ago I had to install all my apps on a new windows laptop.  In doing so I made a list of windows applications that I commonly use that are free or essentially free.  I hope it is useful.

  • Winamp - the old stand by for playing MP3 files.  
  • irfanview - another old stand by for image viewing and quick manipulation
  • e-sword.net - I'm a Christian, this is a great Bible / Bible study free package.  MySword on Android is good as well.
  • Virtual Clone Drive - Why burn an ISO to a DVD to use it if you don't have to?
  • 7-Zip (or Winzip) - Extends your base OS zip and unzip functionality to support more file types (like RAR files)
  • Libre Office - Decent enough, why pay for office if you don't have to?
  • Paint.Net - It ain't Photoshop but it will do in a pinch and it is free.
  • Visual Studio Community Edition - Essentially a full version of Visual Studio for free.  
  • SQLite Manager Extension for Firefox - using SQLite more and more for more and more things.  This extension for Firefox is kinda like SQL Manager for Sqlite.  There might be better ones but this one works great for me.
  • Notepad++ - I usually just use notepad but sometimes I like editing by column and Notepad++ supports that, also has great syntax highlighting support.
  • CC Cleaner - Keeps your Windows registry clean
  • Macrium Reflect - Need to clone a drive hassle free?  This is your beast.
  • Blender - For a little 3D fun
  • K-Lite Mega Code Pack - To make sure I can play videos from my phone.
  • Freemind - Mind mapping software.
  • CDBurnerXP - Free CD and DVD burner (not sure about Blue Ray support)
Maybe one day I'll come back and link to all these programs but you people are smart and can copy/paste into a google search like the rest of us.  Maybe there is one or two on the list you haven't heard of or had forgotten about.  Know of any that you think should be included on this list?  Add them to the comments.


Monday, March 07, 2016

Great Piece Disk Cloning of Software: Macrium Reflect

I got a new laptop and needed to clone a drive.  I saw reports saying that older Samsung drive software doesn't work with the new mk 2 SSD drives.  So I read a few recommendations for Macrium Reflect and gave it a whirl.

I cloned my 7200 RPM drive to my new SSD (including copying some hidden partitions just to be safe).  Went to the bios, changed to the boot order, and the SSD booted right up.  Took about 45 minutes.  I didn't have to hassle with boot sector / partial re-install of Windows 10 either.

Highly recommended piece of software.  I just used the free version, but the other versions can do all sorts of things like backup restores, imaging, and get this...into dissimilar hardware.

Check it here-

http://www.macrium.com/reflectfree.aspx