Saturday, February 28, 2015

How to fix AT&T Mobile Transfer problem with Wi-Fi blocking phone to phone transfers


I recently switched cell phone carriers to AT&T so as to upgrade my aging Android smart phone to a newer model.  When at the store, the sales rep installed their Android app called AT&T Mobile Transfer (Google Playstore Link) on my old phone and on the new phone and began a transfer of data from old phone to the new phone.  Since I had a lot of data on my old phone, we cancelled the transfer, so that I could continue the transfer from my Wi-Fi network at home.

However, when I got home and connected both phones to my Wi-Fi network, and attempted the transfer again, the app running on the new (receiving) phone displayed the following error:

Connection Issue
Cannot connect. Your Wi-Fi provider
is blocking phone to phone transfers. Please choose a different
Wi-Fi and try again.

Here is a screenshot of that error:


I called the AT&T technical support.  The technical support rep said that the Wi-Fi should be configured for peer-to-peer connections.  My router is a NETGEAR Genie Nighthawk R7000, and so I first looked at the UPnP setting, and found that it was selected.  So both the technical rep and I were puzzled by why this would not work.

After I got off the phone, I dug a bit more in the configuration and discovered that there is a Guest Network page that has an option:

Allow guests to see each other and access my local network

The normal wireless network I have configured (not this so-called "Guest Network") does not have this setting.

When I enabled the Guest Network, and connected both phones to this network, but without enabling the above option, I still got the error message. But when I enabled the above option and reconnected the phones to the Guest Network the error message went away and the transfer started.

This fixes the immediate problem, but it is quite puzzling that this special option was only available on the Guest Network, and apparently there is no way to enable this on the other "networks" in this router.

Below is a annotated (side-note: using the handy Nimbus Screenshot Firefox Extension ) screenshot of the NETGEAR Setup/Guest Network page where the above option is to be found:







Router Firmware Version was: V1.0.4.18_1.1.52


Saturday, March 2, 2013

How to switch from Google+ Photos back to Picasa Web Albums

Looking for how to find the secret link to a photo inside Google+ photos? This is what I found:

The Google+ view of the Photos did not allow me to find the secret link to a given photo within an album. The other interface which I believe is called Picasa Web Albums does.

Here is how to get back to the original Picasa Web Albums interface that has that feature:  Use this special link to display the Picasa Web Albums interface, not the Google+ interface:

https://picasaweb.google.com/lh/myphotos?noredirect=1

Here is I stumbled upon it:

  1. Login to your Google Account.
  2. Go to http://support.google.com/picasa/answer/157000?hl=en&ref_topic=1689652 
  3. Scroll down until you see "Picasa Web Albums".
  4. Notice it says "Looking for a simple way to get photos from your camera and computer on the web? Google's Picasa Web Albums provides 1GB of free storage that makes sharing your photos a snap. Visit http://picasaweb.google.com."
  5. Click on http://picasaweb.google.com.
  6. Wait for a little bit. At the top of the page that is loaded you will see a message that disappears after a few seconds/minute: "Click here to go back to Picasa Web Albums".  A screenshot is shown below.
  7. That link goes to https://picasaweb.google.com/lh/myphotos?noredirect=1.


Saturday, January 26, 2013

RaiiCaps with GCC: error: cannot declare ‘::main’ to be a template

The idea of the raiicap class is described at RaiiCap pattern: Injected Singleton alternative for C++. However, the version of GCC I am using is affected by a bug ([Bug c++/24449] Unable to declare friend main() from class template) that prevents using the raiicap idea directly without code modifications.

Below is an attempt at a workaround:

When MAIN_IS_THE_FRIEND is defined above, we fail the compile on GCC (version 4.6.3) with:

/usr/bin/g++ -g -fPIC -Wall -Werror -Wsynth -Wno-comment -Wreturn-type test.cpp -c -o test.o
test.cpp:13:41: error: cannot declare ‘::main’ to be a template
make: *** [test.o] Error 1

But if we undefine MAIN_IS_THE_FRIEND then the compile succeeds.

This may or may not prevent malicious intent: In practice, these classes will likely be defined in header files, which can be included in other translation units, and exploited. For instance, it might still be possible for someone to define their own file static version of mainSurrogate in their own translation unit, and use it in that other translation unit to instantiate instances of Resource. However, this may just be enough to keep the majority of developers within the bounds of the original intent.

Saturday, October 6, 2012

Gmail RTM Bookmarklet

I am evaluating the Remember The Milk task management system.  They have a bookmarklet that does not provide (as of 2012-10-06) a way to record the URL of the page the task was added from.  I played around with the mobile versions of the bookmarklet posted to Using the mobile Add as a generic Quick Add tool including all fields forum thread and could not get it to work. So I based my own on a modified copy of the original Gmail This! bookmarklet and edited it to create a message body with the fields I needed, including the URL off the current web page.

This bookmarklet opens up a new Gmail compose window and adds the required info to the body of the message. It appends a note for both the document title and the current selection. You can then manually add additional text into that note which is typically what I need to do to provide extra info about the task.

I left the Due field blank, as I know I will have to type that in anyhow. This is different from what the standard RTM bookmarklet as it expects you to highlight text of a date and/or time as the Due date.

This is just GMail compose window, so there is no auto-completion of existing Tags, which is something the original bookmarklet does that mine does not. I don't miss that much as I know what my tags are, which are kept to be short names.

Here is the bookmarklet text:

java_script:popw='';Q='';rtmMail='CHANGE_THIS';x=document;y=window;if(x.selection)%20{Q=x.selection.createRange().text;}else%20if%20(y.getSelection)%20{Q=y.getSelection();}else%20if%20(x.getSelection)%20{Q=x.getSelection();}popw=y.open('https://mail.google.com/mail?view=cm&tf=0&to='+encodeURIComponent(rtmMail)+'&su='+encodeURIComponent(document.title)+'&body='+encodeURIComponent('T: '+Q+'\n')+encodeURIComponent('D: \n')+encodeURIComponent('U: '+location.href)+encodeURIComponent("\n---\n"+document.title+"\n"+Q+"\n"),'gmailForm','scrollbars=yes,width=680,height=510,top=175,left=75,status=no,resizable=yes');if%20(!document.all)%20T%20=%20setTimeout('popw.focus()',50);void(0);

How to install:
  1. Select the text above and copy it to the clipboard (CTRL-C typically).
  2. Right mouse click on the Firefox toolbar, and select New Bookmark.
  3. Select the Link field, and paste the link text (CTRL-V typically).
  4. Remove the underscore character from "java_script".
  5. Change the "CHANGE_THIS" in the pasted text of the bookmarklet to be your Inbox Email Address (see How to). 
  6. Change the Name field to be GMail RTM.
  7. Click Save.
To use, highlight a part of a web page, and click the GMail RTM button on your toolbar.  Make any required changes and click Send.

(The platform and browser version I used: 32-bit Firefox 15.0.1 running on 64-bit Debian Linux (Testing).)

Sunday, May 27, 2012

Raspberry Transplanting Procedure

Overview


Below is the procedure I followed to transplant raspberries. This is a consolidation of various sources I found on the web (links are included). Primary sources were posts on http://ehow.com.

Equipment needed:

  • Garden gloves sturdy enough to deal with thorny raspberries.
  • Hand shovel or similar.
  • Garden shears for cutting the suckers roots.
  • Garden stakes for locating where the holes will go.
  • Tape measure to measure off the distances.

Procedure

  • When to transplant: This should be done in the 2nd year after the plant has grown. Transplant raspberry volunteers in April and May (see volunteer plants). Dig them up and move them when they have just begun to leaf out, with a few small leaves emerging. If possible, transplant during overcast weather, at the beginning of an overcast period, so the transplant will get 2 or 3 days to develop roots before the sun comes out. If transplanting during the summer months, use a sun shade for several weeks to provide the plant with reduced sunlight.
  • Locate the destination holes for the transplants (Select a full-sun location) by marking them with some stakes. Make the line east to west to maximize sun exposure during the summer. Space holes 3 feet apart to prevent the spread of disease, and rows 8 to 12 feet apart (note that one web page said spread them 2 feet apart). Destroy any perennial weeds growing near the destination holes including any wild raspberry or blackberry plants, because they can spread disease to your plants.
  • After the first frost, in early spring, identify the healthiest red raspberry plant from which to draw suckers. Look around the base of the mother plant for suckers (choose strong suckers with healthy roots), which are also known as daughter plants: find the off shoots from your main plant or plants that are popping up from the soil around the main plant. Put garden gloves on, because you will be working around the red raspberry's thorny canes. Use garden shears to snip roots that connect the daughter plant to the mother plant (It may be necessary to scoop some of the dirt away to find the root of the plant). Be careful to preserve a soil ball around the daughter plant's root system. When you find the roots, dig the plant out from that point. As you will see, some of the roots are actually part of your main plant. Go ahead and dig or cut away from those roots, as it will not harm your plants.
  • Be sure to loosen the soil around and under the raspberry sucker to remove it from the ground with its roots attached. Raspberry roots are shallow, growing no deeper than 10 inches. If you drive your spade into the ground to a depth of 1 foot, you should be able to take the baby bush out completely with its roots.
  • Dig out transplant candidates after the last spring frost and submerge their roots immediately in a bucket of water to keep the roots from drying out (but only if you are not going to transplant them immediately).
  • Take care to remove all old canes from bushes to be transplanted.
  • Plant one raspberry seedling per hole.
  • In the destination holes, insure to dig holes as deep as the daughter roots, and twice as wide as they are deep. Insure that the holes are large enough so that roots will not be crowded and an inch or two deeper than roots were growing previously (see also Set plant in a hole).
  • Fill holes with water and let them drain halfway down.
  • Use a shovel to tamp down the soil over the top of the newly transplanted red raspberry plant, being sure to cover roots. This is so that any water remaining in the hole will not leave a dry air-space when it drains out.
  • Trim all canes to 6 to 8 inches long (new small plants created by tipping can remain untrimmed). The reason is because "trimming back transplants may result in decreased fruiting the first year but will pay dividends in healthy growth". Check again that plants are solidly tamped in (i.e., do not leave dry air-spaces). (An alternative is to snip off two-thirds of the cane with garden shears to help encourage root development. Provide one inch of water. Consider planting at night to help the plant adapt to its new location.)
  • Keep soil consistently moist for at least a week, to help roots establish in new soil. Continue keeping soil moist during any dry spells until plants show solid new growth.
  • Do not immediately stake new plants; they must be trimmed and allowed to grow new canes first. In fact, since they do best with a trellis system, do the instructions in installing a trellis during the summer, or after the plants grow a bit.

Tips & Warnings

  • Your transplant should begin producing berries the following summer.
  • To help maintain moisture, reduce weeds and protect against the harshness of winter, maintain six inches of mulch around your transplant year round.  I ended up using lawn grass cuttings piled up high enough so that the suckers and other weeds cannot grow (just let the yard trimmings decompose around the plant which I believe will act as fertilizer for the raspberry bush).
  • Trimming back transplants may result in decreased fruiting the first year but will pay dividends in healthy growth.
  • The University of Maine recommends installing a trellis to support raspberry canes (They do best with a trellis system). Providing a place for the canes to climb reduces disease, improves fruit quality, and makes it easier to harvest the berries.

Saturday, May 19, 2012

Batch Image Resizing from the GIMP command-line

The following TinyScheme (Script-Fu) script resizes one or more image files as specified with a file glob, and writes the resized image files into an output directory:

(define (scale-to-max-fileglob
         file-pattern
         out-dir
         newmax
         )
  (let* ((filelist (cadr (file-glob file-pattern 1))))
    (while (not (null? filelist))
      (let* ((in-file (car filelist))
             (image (car (gimp-file-load RUN-NONINTERACTIVE in-file in-file)))
             (drawable (car (gimp-image-get-active-drawable image)))
             (old-width (car (gimp-image-width image)))
             (old-height (car (gimp-image-height image)))
             (old-max (max old-width old-height))
             (new-width (round (/ (* old-width newmax) old-max)))
             (new-height (round (/ (* old-height newmax) old-max))))
        ;; http://tinyurl.com/7bvura2 states "... because saving undo
        ;; steps can be time and memory intensive" and so we don't
        ;; care about undo operations for batch runs:
        (gimp-image-undo-disable image)
        (gimp-image-scale image new-width new-height)
        (let ((out-file
               (string-append out-dir
                              ;; Insert a slash character if
                              ;; not already at the tail-end
                              ;; of out-dir:
                              (if (char=? #\/ (car (last (string->list out-dir))))
                                  ""
                                  "/")
                              ;; Take the basename of in-file which may be a fully-qualified path:
                              (car (last (strbreakup in-file "/"))))))
          ;; The print function does not show output on standard
          ;; output, so use gimp-message instead:
          (gimp-message (string-append "   scale-to-max-fileglob: scaling "
                                       in-file " into " out-file
                                       " with these dimensions: "
                                       (number->string new-width) "x" (number->string new-height)))
          (gimp-file-save RUN-NONINTERACTIVE image drawable out-file out-file))
        (gimp-image-delete image))
      (set! filelist (cdr filelist)))))

Store this into ~/.gimp-2.6/scripts/batch-resize.scm and the definition of scale-to-max-fileglob will load into all future gimp sessions.


Example run: This was executed using GIMP 2.6 on a 64-bit Debian Linux machine.  The "script-fu-Warning" is coming from the gimp-message function:



user@somehost:/tmp/images_dir$ time gimp -i -b '(begin (scale-to-max-fileglob "*.jpg" "outdir" 1000) (gimp-quit 0))'

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-43-42_676.jpg into outdir/2012-05-19_16-43-42_676.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-44-35_210.jpg into outdir/2012-05-19_16-44-35_210.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-41-21_785.jpg into outdir/2012-05-19_16-41-21_785.jpg with these dimensions: 1000x562

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-44-02_760.jpg into outdir/2012-05-19_16-44-02_760.jpg with these dimensions: 1000x562

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-45-34_771.jpg into outdir/2012-05-19_16-45-34_771.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-43-15_141.jpg into outdir/2012-05-19_16-43-15_141.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-42-39_886.jpg into outdir/2012-05-19_16-42-39_886.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-45-13_128.jpg into outdir/2012-05-19_16-45-13_128.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-42-52_376.jpg into outdir/2012-05-19_16-42-52_376.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-41-49_429.jpg into outdir/2012-05-19_16-41-49_429.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-42-08_196.jpg into outdir/2012-05-19_16-42-08_196.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-41-54_552.jpg into outdir/2012-05-19_16-41-54_552.jpg with these dimensions: 562x1000

script-fu-Warning:    scale-to-max-fileglob: scaling 2012-05-19_16-42-34_497.jpg into outdir/2012-05-19_16-42-34_497.jpg with these dimensions: 562x1000



real    0m16.179s
user    0m13.229s
sys    0m2.236s




The above code was cobbled together from these sources:
  1. Christopher Campbell's blog: Batch image scaling with Gimp
  2. TinySCHEME Version 1.40 Manual is rather skimpy so you may desire to refer to The Racket Reference instead.
  3. Gimp Batch Mode Introduction

Saturday, October 8, 2011

Developing Software Productively through selective automation

How do you increase your software development productivity over the long haul? Here's how: Examine your daily task work to identify tasks that are amenable to automation, and then automate it. For me, this means to do the following:
  1. Maintain a constant awareness of all of your development activities, specifically patterns of behavior or groups of actions that are repeated multiple times throughout the day.
  2. Of those patterns, identify the ones that are comprised of tasks that do not change regardless of the circumstances.
  3. Determine if those tasks are amenable to automation (some will, some won't). This excludes tasks that should be delegated to someone else to do.
  4. Schedule time to encapsulate the tasks in a software routine.
  5. Make executing that routine mindless and effortless, by associating the execution of the routine to a new and unique combination of key-bindings in the main window of the primary editing tool you use (e.g. Emacs, Eclipse, Jedit, etc.).
Some may think that the "schedule time" item will eat into their productivity. However, I have found in practice that the time saved by automation will pay for itself over time. But there is one more benefit: Having a machine execute the tasks frees up your mind to think at a higher level of abstraction, in a given project. Making a task mindless and effortless has the goal of not distracting your mind from the flow of adding, deleting, and moving code around. Any requirement to pull down menus, bring other windows to the front, type in and execute long command lines, etc., are distracting to the mental process of software development and should be gradually eliminated by delegating those tasks to push-button automation. Therefore, as a software developer, those activities are best done right there in the text editing window itself, to be driven by carefully chosen key sequences that are easy to memorize. Below are some examples of tasks I discovered fit the above criteria, and that I could automate (this is specific to my focus on code development, but they could be generalized for other work domains):
  1. When the cursor is on a full or relative path to a file somewhere on the filesystem, typing a keystroke to open the file in the text editor. Compare that to opening up a new window, moving the mouse cursor into that window, navigating a file browser to find the file or typing in the full path to the file in the file system. Think about how often that task is done in given developers work day.
  2. When the cursor is sitting on a URL, typing a keystroke to open the URL in a browser. Think about how often you need to refer to reference material that is only on some remote web server somewhere.
  3. When the cursor is sitting on a symbol whose definition you need to alter, typing a keystroke to drive your editor to view and edit that definition. Compare that with using a file search to find the definition, and filter out the false positives.
  4. You need to go back to where you started when editing some code, so type a keystroke to go back to the place where you started. The idea here is that each time you navigate to a new view on some source, there is the equivalent of a "back" button in the form of a key sequence. This should be applicable for all types of navigation to some file, symbol, or web page.
  5. You need to reload your brain with the context after an interruption. The thing being automated away is the time wasted wondering where you left off, or clicking through various windows or views to answer that question. The solution is to track notes of decisions you are making in a searchable set of interlinked note files. This excludes writing them down on paper, since there is no search capability (and filing cabinets and other filing systems are yet another mental distraction). In my case, I use multiple text files that are interlinked (Muse mode in GNU Emacs). This also pays dividends later on when you need to refresh your memory on decisions that were made on the project done months later.