Navigation

3/19/2013

Directions to Library - Geolocation

This uses Google Maps API to detect location of mobile device, and then show map & directions to one fixed location, like a library branch.


First add this line:

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true">
</script>


Second add these functions:

<script>
 (function () {
  var directionsService = new google.maps.DirectionsService(),
   directionsDisplay = new google.maps.DirectionsRenderer(),
   createMap = function (start) {
    var travel = {
      origin : (start.coords)? new google.maps.LatLng(start.lat, start.lng) : start.address,
      destination :"38.936165,-76.996363",
      travelMode : google.maps.DirectionsTravelMode.DRIVING
      // Exchanging DRIVING to WALKING above can prove quite amusing :-)
     },
     mapOptions = {
      zoom: 10,
      // Default view: lat & lng of center of map, CUA Law School
      center : new google.maps.LatLng(38.936165,-76.996363),
      mapTypeId: google.maps.MapTypeId.ROADMAP
     };
    map = new google.maps.Map(document.getElementById("map-image"), mapOptions);
    directionsDisplay.setMap(map);
    directionsDisplay.setPanel(document.getElementById("map-directions"));
    directionsService.route(travel, function(result, status) {
     if (status === google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(result);
     }
    });
   };
 
    // Check for geolocation support 
 
   if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function (position) {
      // Success!
      createMap({
       coords : true,
       lat : position.coords.latitude,
       lng : position.coords.longitude
      });
     }, 
     function () {
      // Gelocation fallback: If can not get location
      createMap({
       coords : false,
       address : "3600 John McCormack Rd., NE Washington DC 20064"
      });
     }
    );
   }
   else {
    // No geolocation fallback: Defaults CUA LAW
    createMap({
     coords : false,
     address : "3600 John McCormack Rd., NE Washington DC 20064"
    });
   }
 })();
</script>
<div id="map-container">
<div id="map-image">&nbsp;</div>
<div id="map-directions">&nbsp;</div>
</div>


Styles to make to control look and feel:

<p><style type="text/css"> 
        #map-container {
            overflow: hidden;
        }
        #map-image {
            width: 500px;
            height: 400px;
            margin:auto;
            
            
        }
        #map-directions {
            width: 500px;
            margin:auto;
            background:#FFF;
            
        }
    </style></p>



How to do the same thing with other mapping services:

Bing  

3/18/2013

Sierra desktop client install - java error

Installing the new Sierra java client for our Innovative Interfaces OPAC was easy, just use this URL


http://your.iii.server.com/sierra/desktop

but in some computers (about a quarter) gave the following java error:
"Gadget needs Java click here to install"  and just had a general link to java.com website.


This link worked in starting the java machine install:

http://iii.server.name/web/gadgets/sierraDesktopApp/noWebStart/Web_Installers/install.htm 

Important:

When running install for Sierra, use domain name (eg  iii.yourservername.edu) instead of IP address.

Sierra does not work if use IP address for the Innovative Server address, use domain name instead.


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

Note:

See comment below,  John H has suggested that adding your server URL to  Compatibility View Settings in Java Security settings will solve this problem.

3/07/2013

Android screen capture (HTC phone)



HTC EVO 5
Hold down power button and press home.



More general case:






6 Ways To Take Screenshots On Android

By Chris Hoffman

Whether you’re a blogger taking a screenshot of Android apps or just someone that wants to show off their Android setup to your friends, the process of taking those snapshots can be a pain. While Android 4.0 offers a built-in way to take a good screenshot, that’s little consolation if you’re still using an older version of the Android operating system.
No matter what device you have, you can take a screen image without rooting your device. But rooting your device offers you some neat tricks — even if you’re using Android 4.0. You can take a screenshot by shaking your device or wirelessly via a web browser.

Take a Screenshot with Android 4.0 (Ice Cream Sandwich)

If you’re using Android 4.0 or later, this is easy. Just press and hold the Volume Down and Power buttons at the same time. You’ll see an animation on the screen, indicating that the screen photo was saved. Android will save the image to your Gallery. Launch the Gallery app and tap Screenshots to view and share your screenshot.
screenshot

Android SDK

You can take a screenshot on any Android device using Google’s Android SDK. After you’ve set up the Android SDK, all you have to do is connect your Android phone or tablet to your computer with its USB cable and fire up the SDK.
This isn’t the most user-friendly application to set up, but it’s easy to use once you’ve set it up. We’ve got a guide to setting up the SDK and taking screenshots.
take screenshots on android

AShot aka Android Screen Capture

AShot is a free, open-source way to take screen images of your Android device from your computer. It requires the Android SDK installed and properly configured. AShot offers a variety of advantages over the Android SDK screenshot feature, including near-real-time streaming of your Android’s screen to the Ashot application on your computer. You won’t have to keep clicking the Refresh button, as in the SDK. For more information, check out our AShot walkthrough.
take screenshots on android

Manufacturer Shortcuts

Some manufacturers build special screenshot shortcuts into their pre-Android 4.0 devices. For example, on many Samsung Android devices, including the Galaxy Note and Galaxy S II (pre-Ice Cream Sandwich versions), you can press the Home and Power buttons at the same time to take a screen snapshot – in practice, you’ll press and hold the Home button, then quickly press the Power button. On the Galaxy S, press and hold the Back button and the Power button, or try pressing the Back button and double-tapping the Home button.
Different pre-Android 4.0 devices use a variety of different shortcuts – give it a Google and you might find that your device has a built-in screenshot shortcut you don’t know about.
take screenshots on android

Device-Specific Apps

These manufacturer-specific hooks into the OS allow some apps to provide an easy-to-use, on-device way to take screen image.  For example, Samsung Galaxy S, Galaxy Tab, and Galaxy S II (pre-ICS) users can use Screen Capture Shortcut Free to capture a screenshot without rooting their phones.
Another example of a device-specific app is AndroSS, which can take screen images on Android without root access on Tegra devices. If you’re not sure whether a device-specific app exists for your device, search the Google Play Store and see.
take screenshot android

Root Apps

The reason you have to jump through the hoops above instead of simply installing a screenshot app is because of Android’s security model. Android doesn’t allow apps to view your device’s screen – this could be a security problem. For example, a malicious app could spy on your online banking sessions. There’s no permission apps can request to take snapshots of your screen.
To give an app permission to view your screen, you’ll need to root your Android. After rooting your Android, you can install one of the many screen snapshot applications that require root from Google Play. There are many options to choose from, although many of them are paid apps. aScreenshot is a free app that worked for me. You can take a screenshot in a variety of ways, including shaking your device, tapping a notification, or setting a delay. Other apps have similar features.
take screenshot android
AirDroid, an awesome free app we’ve covered in the directory, also supports taking a screen shot on rooted devices. You can capture those images wirelessly via your web browser. AirDroid can control many other aspects of your device from a browser, too.
screenshot



3/05/2013

Can't delete files because of “thumbs.db” File In Use, Windows 7 bug


From Hardanswers:

Error “The action can’t be completed because the folder or a file in it is open in another program. Close the file or folder and try again” and it mentions Thumbs.db



Locked thumbs.db


To fix this, disable the caching of thumbnails in hidden thumbs.db files via the Group Policy Editor as below:
  1. Run gpedit.msc
  2. Navigate to:
    User Configuration\Administrative Templates\Windows Components\Windows Explorer
    Set “Turn off the caching of thumbnails in hidden thumbs.db files” to Enable.
  3. You may need to log off or force group policy to update before this takes effect, I am not sure.
    To force group policy to update, run gpudate /force

Group Policy Editor


Or see the following Microsoft KB article which contains a Fix It to do this for you (and instructions on how to do it via the registry if you have a version of Windows 7 without the Group Policy Editor).

3/02/2013

MS Access report - how to do numbering rows


Microsoft access reports, how to create numbered rows.

http://office.microsoft.com/en-us/access-help/counting-in-reports-HA001137763.aspx

Counting (numbering) the items

Sometimes you want to number the items in your report. For instance, in the Sales by product report, you might want "1" to precede the first item in a product group, "2" to precede the second item, and so on. When the next product group begins, the counting starts over, and "1" precedes the first item. I discussed a technique for doing this in the "Summing in reports" article, in the section Tip: Numbering the rows. Because it's a common request related to counting in reports, I'll also revisit it briefly here.

Numbering the items in a report

You can number the items in your report by using a calculated control and the RunningSum property. First, you create a text box and set its ControlSource property to =1.

Then, you set the RunningSum property for the text box. If you want the numbering to start over for each group, set the property to Over Group. If you want to accumulate a running sum for the entire report, set the property to Over All. For more information about running sums and the RunningSum property, see the section Calculating running sums (cumulative totals), in the "Summing in reports" article.

The expression sets the value of the text box control to "1". Because the RunningSum property is used to accumulate the value, the value in the text box is increased by one for every row. The Sales by Product with Running Sum and Numbered Rows report, in the sample database, demonstrates this technique. Entering a period (.) in the Format property box appends a period to the end of the number.

For detailed step-by-step instructions for numbering the items, see the following expandable section:

HideStep-by-step: How to number the items in a report

To open the report in Design view

  1. In the Database window, under Objects, click Reports.
  2. Click the report, and then click Design in the Database window.
To create the text box control

  1. In the Detail section, click where you want the number to appear.
  2. In the Toolbox, click the Text Box tool.
 Note   If the Toolbox is not visible, on the View menu, click Toolbox.
  1. In the Detail section of the report, drag the pointer to create a text box, making sure that it's wide enough to accommodate the largest item number. For example, if you will likely have one hundred orders, you will need space for at least three characters (100). If a label appears next to the text box, delete the label.
  2. Select the text box, and then click Properties on the View menu.
  3. Click the All tab, and then type txtItemNumber in the Name property box.
  4. Click the Data tab, and then select Over Group in the Running Sum property box.
  5. Type =1 in the Control Source property box.
  6. Click the Format tab, and then type #. in the Format property box.
  7. Close the property sheet.
  8. On the File menu, click Save and then close the report.

2/18/2013

Selecting text in MS Word: rectangles


To select an rectangle of text in Microsoft Word:

To select a rectangle of text

  • Hold down the ALT key, press down on the left-click button of your mouse, and then drag the cursor over the text to select.
    —or—
  • Hold down the SHIFT+ALT keys and press any Arrow key.


To get in mode for selecting rectangular blocks of text:

Ctrl+Shift+F8: Begin selecting a rectangular block of text—use the arrow keys to size the rectangle; cut, copy, or press Esc to exit this selection mode. (Does not seem to work on Mac.)


1/11/2013

Embed Powerpoint into web page via Skydrive

Here is quick way to put powerpoint slide show on web:
http://www.microsoft.com/web/solutions/powerpoint-embed.aspx


1/03/2013

Remote Desktop Connection error: No RDC licenses available


Got the following error message using Remote Desktop in Windows 7:

  • Remote session was disconnected because there are no Remote Desktop client access licenses available for this computer. Please contact the server administrator

Here is the fix, use REGEDIT to delete this key:


  1. The solution is delete the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing
  2. Right-Click on the Remote Desktop Connection icon PROPERTIES, then ADVANCED PROPERTIES and select “Run as Administrator“.
    This repopulates the key correctly.


Sometime, just step one will solve problem, if not, do second as well.



To map local drive to remote machine

12/07/2012

IIS HTTP error 404.11 - due to bad filename, plus signs



With URL:    http://server.name.here.com/SIERRA+FUN+FACTS.docx

Got the error message below.  First tried tinkering with mimetype (application/msword) but then decided just to change the filename

http://server.name.here.com/SIERRA-FUN-FACTS.docx

Getting rid of  +  signs solved the problem.




HTTP Error 404.11 - Not Found

The request filtering module is configured to deny a request that contains a double escape sequence.

Detailed Error Information
Module RequestFilteringModule
Notification BeginRequest
Handler StaticFile
Error Code 0x00000000
Requested URL http://255.255.255.255:80/SIERRA+FUN+FACTS.docx
Physical Path C:\libraryfiles\Web Documents\SIERRA+FUN+FACTS.docx
Logon Method Not yet determined
Logon User Not yet determined
Most likely causes:
  • The request contained a double escape sequence and request filtering is configured on the Web server to deny double escape sequences.
Things you can try:
  • Verify the configuration/system.webServer/security/requestFiltering@allowDoubleEscaping setting in the applicationhost.config or web.confg file.

11/06/2012

HP 4200 Laserjet - Installing fuser

Here is a video on installing maintenance kit and fuser in an HP 4200 printer:







Nov 2012: install fuser in circ printer (HP 4200), last one only looked like it lasted 13000 pages, not 200000 that they should last

Got replacement fuser from http://www.usaprinterguy.com/  nice step by step instruction sheet, new rollers, free return shipping for old fuser, good price.

10/24/2012

Android Emulator - Upgrading to AVD Manager 20.0.3

I upgraded to Android Emulator  AVD Manager 20.0.3, and keyboard entry did not work, just the virtual keyboard.  To fix this

  1. Go to AVD Mananger.
  2. Select the particular AVD and click on Edit
  3. Go to the Hardware section, click on New.
  4. Select the Property Name : Keyboard Support
  5. By default, it is added with a value of 'no'. Just click on the value column and change it to 'yes'.
  6. Click on Edit AVD again.
This will add a property hw.keyboard=yes in config.ini file for the AVD.

10/22/2012

Detect mobile device via Javascript, switch to mobile page


Our CMS is looks poor on mobile drives, looked at javascript to switch to a different page on detecting mobile device:


<script type="text/javascript">
var mobile = (/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge|maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent.toLowerCase()));
if (mobile){ document.writeln("<h2>
<a href='http://your.server.com/m.asp?insert_room=1'>Tap here for MOBILE version...</a></h2>
");
 
    }

</script>


I replaced the document switch:
document.location = 'http://your.server.com/m/'

with just adding a link to a different page:
document.writeln("<h2>
<a href='http://your.server.com/m.asp?insert_room=1'>Tap here for MOBILE version...</a></h2>

10/19/2012

HTML Tutorials

Here are top HTML tutorials for beginners, clean, nice layouts, minimum of advertisements:


http://www.w3schools.com/html/html_intro.asp

http://htmldog.com/guides/htmlbeginner/

http://www.stepbystephtml.com/


Still looking for lists of other peoples picks.

10/18/2012

xcopy command - backup


Trying to use XCOPY got "INVALID PATH" error.

xcopy "Q:\TECH SRV\"    /s /y

Just remove the final slash on the SOURCE directory:
xcopy "Q:\TECH SRV"    /s /y

good reference page on XCOPY 

On the destination, you do need the final slash, otherwise it askes is this a file name or directory name?

xcopy "Q:\ADMIN"   "E:\Q drive\ADMIN\" /s /y


I use the following to add date to folder name:

xcopy "Q:\ADMIN"   "E:\Backups- Q and W drives\20%date:~10,4%\Q drive - 20%date:~10,4%-%date:~4,2%-%date:~7,2%\ADMIN\" /s /y
20%date:~10,4%    year
%date:~4,2%       month

%date:~7,2%       day

10/10/2012

Login Directly Into Windows 7 Without Entering Password

Have several lobby PCs where it is open to public (locked down with Deep Freeze & Proxy table), here are steps to Login Directly Into Windows 7 Without Entering Password 



Every time Windows 7 is started it asks you to select the username and enter the password to access your system, there is no doubt that it is a very important security measure, but what if you are the only user
of your system?  In windows 7, you can easily get rid of the login prompt window, go through the following steps to achieve it.

Go to Start and type netplwiz in the Start Search and hit Enter. The User Accounts dialogue box will be displaye, just uncheck "Users must ..."  box



autologin

9/21/2012

VBA code to ESC from Access Form entry

In Microsoft Access 2010 database, wanted to create button that did same as pressing ESC key;

Found blog post on Use code to "undo" things in Access 

DoCmd.RunCommand acCmdUndo

If there is nothing in the form, nothing can be UNdone, get error 2046.  Added error handling,  just close the form, and exit the subroutine.


Private Sub Button_Click()
On Error GoTo ErrorHandler
DoCmd.RunCommand acCmdUndo
DoCmd.Close acForm, "Faculty Purchases - FY 2012", acSaveYes
Exit Sub
ErrorHandler:

Select Case Err

         Case 2046:    ' Error 2046: "Nothing can be UNDOne"
                       
         DoCmd.Close acForm, "Faculty Purchases - FY 2012", acSaveYes
         Exit Sub
        
         Case Else:      ' An error other than 2046 has occurred.
            ' Display the error number and the error text.
            MsgBox "Error # " & Err & " : " & Error(Err)

      End Select
End Sub

8/07/2012

6/06/2012

Windows 7 Startup folder


Your personal startup folder should be
C:\Users\<USER NAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

The All Users startup folder should be
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup


C:\Users\<USER NAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Place shortcuts to run at startup in this location.

Screen saver - before login, Windows XP



If you select the Screen Saver tab of the Desktop control panel applet you can configure Power saving settings which include powering off the monitor after x minutes. To enable the monitor to power off for the logon screen perform the following on each machine:
  1. Start the registry editor (regedit.exe)
  2. Move to HKEY_USERS\.DEFAULT\Control Panel\Desktop
  3. Double click PowerOffActive and set to 1. Click OK
  4. Double click ScreenSaveActive and set to 1. Click OK
  5. Double click SCRNSAVE.EXE (if present) and set to "(NONE)" (don't type the quotes). Click OK
  6. Move to HKEY_USERS\.DEFAULT\Control Panel\PowerCfg
  7. Double click CurrentPowerPolicy and set to 0 (the Home/Office Desk power setting configuration). Click OK
  8. Close the registry editor
  9. Reboot the machine