A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label import. Show all posts
Showing posts with label import. Show all posts

Reserved keywords - Do Not Use these in your code

Do not use these names, you will get confusing errors...

Perl:

  • sub import


Mojolicious:

  • stash('data', ...)



iPhone: No new pictures or videos were found on this device

(Windows) Sometimes photos get "stuck" on the iPhone, and the usual method of right-clicking on the iPhone in My Computer and importing doesn't work. It errors: "No new pictures or videos were found on this device".

The fix is to rename the file C:\Users\[username]\AppData\Local\Microsoft\Photo Acquisition\PreviouslyAcquired.db

NOTE: AppData will probably be hidden - you must make hidden files and folders visible in Windows Explorer options.

(source)

How to use git with an svn repo

Do you have a subversion repo? Think you're stuck with outdated subversion workflows? Not anymore! Use the fabulous git to work with your subversion hosted code:

git svn clone https://example.com/path/to/trunk -T trunk -b branches -t tags

(may take a long time with large repos, e.g. several days)

Now you can rebase your code! You can do all your work with git - easily branch, stash, rebase, blame, etc. - and when you're done, push back to subversion.

(source)

See subversion branches:
git branch -r

Update the git repo (may take several hours for large repos - you don't need to run this more than once):
git svn fetch --fetch-all

Update the current branch (run this on trunk/master instead of "fetch" above):
git svn rebase

(source)

Importing with Wordpress

If you get a 500 Internal Server Error while importing a large file in Wordpress:

  • Just keep refreshing the page and re-submitting the data.
  • Items will continue to be added (and downloaded) a few at a time, and no item will be added twice.
Eventually all the data will be imported correctly.

Importing a module's namespace in Perl

Ever get this error for a module you've written?

Use of inherited AUTOLOAD for non-method X() is deprecated

Put this at the top of your module:

package My::Module;

use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(put the methods here);

And then in the main program:

use My::Module qw( the methods to import );

keywords: export import exporting