≡ Menu

Another Code School Profile Scraper Update

Merry Christmas!

This will be a short post – I guess Code School must make minor changes to their user profile code about this time each year, as it was just a year ago that I had to update this code.

Code School logo

For the codeschool.php file, change this:

/* disabling the anchor tags on each badge by changing to divs */
$full_content = str_replace("<a href","<div class",$full_content);
$full_content = str_replace("</a>","</div>",$full_content);

to this:

/* disabling the anchor tags on each badge by changing to divs */
$full_content = str_replace("<a rel=\"tooltip\" ","<div ",$full_content);
$full_content = str_replace("href=\"/learn","data-href=\"http://codeschool.com/learn",$full_content);
$full_content = str_replace("</a>","</div>",$full_content);

This will eliminate the links that would be intended to point at the Code School paths, but instead end up being broken links pointing at your own site.

Have a Happy New Year!

Connecting to an Oracle Database RAC with ColdFusion 11

ColdFusion Data Source Management page

Recently we’ve been moving quite a few servers and databases into our new datacenter, so I’ve been having to learn – more quickly than usual – about the often obscure differences between older and newer versions of various software including Solaris and Oracle Database.

A change to an Oracle RAC system caused the most interesting trouble I’ve had so far during this move.

In ColdFusion 11, there are native JDBC drivers for Oracle that are normally selected in the Data Source Management page using the logical and expected “Oracle” selection.

ColdFusion Data Source Management page

However, I was chagrined to find out that if you use this to try to connect to an Oracle Database that is load balanced with RAC, this selection will not work. Upon trying to connect, you will receive the error:

“[Macromedia][Oracle JDBC Driver][Oracle]ORA-12505 Connection refused, the specified SID (whatever string you put in the SID field) was not recognized by the Oracle server”

Neither Oracle nor Adobe documentation was much help on this. Fortunately, I came across a thread on the Adobe forum where a user was having this problem.

The answer is to, instead of selecting “Oracle”, select “other” in the Driver drop-down list. Then, use this connection string. The last variable (AlternateServers), appears to be optional. I’m not certain whether or not the IP addresses also need to be enclosed in parentheses.

jdbc:macromedia:oracle://(ORACLE SERVER):1521;SERVICENAME=(serviceName);sendStringParametersAsUnicode=false;MaxPooledState ments=1000;AlternateServers=((IP ADDRESS1),(IP address 2))

This is basically how I ended up setting the connection up:

CF other driver for Oracle RAC

Oracle MySQL Workbench / macOS High Sierra Bug Officially Fixed!

This is an update for a previous post.

Oracle has released version 6.3.10 of MySQL Workbench, fixing the results grid bug that only plagued users running macOS High Sierra.

MySQL Workbench with missing Results Grid

I was very glad to see this release, as I was contemplating switching to Toad for MySQL, which I quickly found out is not free anymore.

Sync iCloud Photos with iOS

iCloud Photo Sharing in iOS Settings. Image Credit: Business Insider http://static2.businessinsider.com/image/54591934ecad04974f8b4567-747-560/icloud-photo-sharing.jpg

This is not so much a software development topic as it is an iOS / iCloud issue that does not seem to be well-documented, but was solved only after discussing with Apple Support.

The scenario here is where an iOS device (an iPhone 8 Plus, in this case) gets restored from backup. During the time between the backup was made and was later restored onto the iPhone, a number of photos had been taken and uploaded to iCloud. After the phone was restored, the pictures were missing from the iPhone, yet could still be seen in the Photos app on a MacBook.

When looking up this issue, I found time after time, there does not seem to be a documented definitive way to force sync iCloud with your iOS device.

Having had some similar experience with this sort of thing before, I thought that turning off iCloud Photo Sharing in Settings and turning it back on might force a sync.

iCloud Photo Sharing in iOS Settings. Image Credit: Business Insider http://static2.businessinsider.com/image/54591934ecad04974f8b4567-747-560/icloud-photo-sharing.jpg

Before I turned it off, only ten or so pictures were missing. Now several thousand pictures disappeared from the iPhone. Needless to say, I was not pleased at this point. I checked Photos on the Mac, and they were still there, so I breathed a sigh of relief.

I then turned off Upload to My Photo Stream in Settings.

Upload to My Photo Stream in Settings. Image Credit: iMobie. https://imobie-resource.com/en/support/img/my-photo-stream-not-w.png

This didn’t seem to change anything, so I turned it back on. I then turned iCloud Photo Sharing back on, which automatically then turned Upload to My Photo Stream back off. I turned it back on so that both settings were on, as they were after the iPhone was restored. I then rebooted the iPhone. Still no change.

At this point, I thought time might solve the problem. Perhaps the photos needed to be re-downloaded from iCloud. I let the iPhone sit overnight to see if there was some change in the morning. By the next morning, there was still no change.

Time to contact Apple Support. After talking to a support tech for just a few minutes, a suggestion was made: on the Mac, navigate to iCloud.com, log in, and open Photos on the website. After doing so, all of the pictures – including the ones that were originally missing – appeared on the iPhone!

Whether or not this always works remains to be tested, but it solved my problem in this instance. For such an easy and quick fix, it’s worth trying.