15 July 2015

Selecting Pixels by Brightness

Just ran into that time again when I want to preserve the shadows in a nicely backgrounded image. I usually end up saying, "screw it," and mask out the object and add in a fake background. Blah.

To select pixels based on their "brightness" (luminosity), ctrl-click the RGB channel.

To keep the shadows, invert the selection, and combine it with a masked layer of the object in question.

06 July 2015

Frequency Separation

Using the high-pass method (vs. image-apply):

  1. Create two duplicate layers ("texture" on top and "tone" next)
  2. With regards to the texture layer
    1. Apply a high-pass filter using a pixel radius to capture all fine details but not tonal or volume changes
    2. Blending mode to Linear Light
    3. Opacity to 50%
  3. Gaussian blur the tone layer with the same pixel radius used for the high-pass filter

26 March 2014

Freaky Amazing Details

I picked up this Photoshop sharpening technique from these sources:

https://www.youtube.com/watch?v=ZV9u0Wu8L0M
http://fstoppers.com/sharpening-with-blur-bring-back-insane-detail-with-this-quick-technique

And because no one on the web seems capable of putting together a simple step-by-step tutorial:

  1. Make 2 copies of the original image (3 layers total)
  2. Group the top two layers
  3. Change the group's blending mode to Overlay
  4. With regards to the group's top layer:
    1. Blending mode to Vivid Light
    2. Invert the layer
    3. Apply a Surface Blur filter (better yet, change it to a smart object with the filter)
Seems like a radius=8 and threshold=10 is a good place to start for the layer.

24 March 2014

Capturing mouse coordinates on touchmove events

I'm testing a relatively recent version of Android, iOS, and Chrome to capture mouse coordinates during a move event. I was having trouble with Android, surprisingly, and found this to solve it:

on Chrome and iOS off the jquery event object passed to the touchmove event listener, simply event.pageX and event.pageY returned coordinates as expected. However, Android always returned zero.

You can find a bunch of posts about needing to preventDefault to get the touchmove event to trigger in the first place....

But to get the coordinates, this object seems to work:

window.event.touches[0]

 So I'm using something along these lines ...

if (window.event.touches) event = window.event.touches[0];

Then I use event.pageX and event.pageY as expected...

20 March 2014

Data Cache on Excel Pivot Tables

I'm just starting to get more familiar with Excel's pivot tables and their functions. I've noticed that changing the grouping on one table affects the grouping on another table, even though they are completely separate pivot tables.

Turns out this is Excel's "data caching" in order to save memory and disk space. Great, I'm very happy Excel's saving disk space on my whopping 300 records of data, but this reminds me of Office's warnings of having a "large amount" of data left on the clipboard.

Um, hello, Office dev team, it's 2014. Let's raise that bar of what a "large amount" of data really is.

Tangent. Back to pivot table grouping.

See here: http://office.microsoft.com/en-us/excel-help/unshare-a-data-cache-between-pivottable-reports-HA010226675.aspx

20 February 2014

Slow LAN speeds between Windows 7 machine and Server 2003

I upgraded a few machines from Windows XP to Windows 7 recently, and all has been well for several weeks. Yesterday, two machines (relatively old Dell desktops) started exhibiting extremely slow connections to our Windows 2003 server. However, connections to other Windows 7 machines were a-okay. All machines are gigabit cabled.

Luckily, a coworker had found a solution to this months ago, so I wanted to make note of it here:

From the command line with admin privileges:

netsh int tcp set heauristics disabled
netsh int tcp set global autotuninglevel=disabled

... then reset the network adapter.

09 January 2014

VBA Name Parser

There are plenty of simple name parsers out there, but I needed one that would handle titles, suffixes, prepositions / particles (I'm no grammar expert), etc. This is what I hacked together for a VBA function in Excel:

(Things could be cleaned up more if VBA had better array functions built in, specifically pop and shift...)

Pass in "n" the name to be parsed and "piece," which is an integer 1 thru 5 for:
1: title
2: first name
3: middle name(s)
4: last name
5: suffix


Function Namify(n, piece) as String
    Dim Pieces() As String
    Pieces = Split(n)
    
    Dim Letters() As String
    
    Dim Length As Integer
    Length = UBound(Pieces) + 1
    
    Namify = ""
    If Length < 1 Then Exit Function
    
    If piece = 1 And IsTitle(Pieces(0)) Then
        Namify = Pieces(0)
    ElseIf piece = 5 And IsSuffix(Pieces(Length - 1)) Then
        Namify = Pieces(Length - 1)
    ElseIf Length = 1 Then
        If piece = 2 Then Namify = Pieces(0)
    ElseIf Length = 2 Then
    
        If IsTitle(Pieces(0)) Then
            If piece = 4 Then Namify = Pieces(1)
            Exit Function
        ElseIf IsParticle(Pieces(0)) Then
            If piece = 4 Then Namify = Pieces(0) & " " & Pieces(1)
            Exit Function
        End If
        
        'look for joined abbreviations
        Letters = Split(Pieces(0), ".")
        If UBound(Letters) > 1 Then
        
            If piece = 2 Or piece = 3 Then
                Namify = Letters(piece - 2) & "."
            ElseIf piece = 4 Then
                Namify = Pieces(1)
            End If
            
        'first name
        ElseIf piece = 2 Then
            Namify = Pieces(0)
        ElseIf piece = 4 And Not IsSuffix(Pieces(1)) Then
            Namify = Pieces(1)
        ElseIf piece = 5 And IsSuffix(Pieces(1)) Then
            Namify = Pieces(1)
        End If
        
    ElseIf Length = 3 Then
    
        If IsTitle(Pieces(0)) Then
            
            Namify = Namify(Pieces(1) & " " & Pieces(2), piece)
            
        ElseIf IsSuffix(Pieces(2)) Then
        
            If piece = 5 Then
                Namify = Pieces(2)
            Else
                Namify = Namify(Pieces(0) & " " & Pieces(1), piece)
            End If
            
        ElseIf IsParticle(Pieces(1)) Then
            
            If piece = 2 Then
                Namify = Pieces(0)
            ElseIf piece = 4 Then
                Namify = Pieces(1) & " " & Pieces(2)
            End If
            
        ElseIf piece < 5 And piece > 1 Then
        
            Namify = Pieces(piece - 2)
        
        End If
        
    ElseIf Length = 4 Then
    
        If IsTitle(Pieces(0)) Then
        
            Namify = Namify(Pieces(1) & " " & Pieces(2) & " " & Pieces(3), piece)
        
        ElseIf IsSuffix(Pieces(3)) Then
            
            If piece = 5 Then
                Namify = Pieces(3)
            Else
                Namify = Namify(Pieces(0) & " " & Pieces(1) & " " & Pieces(2), piece)
            End If
            
        Else
        
            If piece = 2 Then
                Namify = Pieces(0)
            ElseIf piece = 3 Then
                If IsParticle(Pieces(2)) Then
                    If Not IsParticle(Pieces(1)) Then
                        Namify = Pieces(1)
                    End If
                ElseIf Not IsParticle(Pieces(1)) Then
                    Namify = Pieces(1) & " " & Pieces(2)
                End If
            ElseIf piece = 4 Then
                If IsParticle(Pieces(1)) Then
                    Namify = Pieces(1) & " " & Pieces(2) & " " & Pieces(3)
                ElseIf IsParticle(Pieces(2)) Then
                    Namify = Pieces(2) & " " & Pieces(3)
                Else
                    Namify = Pieces(3)
                End If
            End If
        
        End If
        
    ElseIf Length = 5 Then
        
        If IsTitle(Pieces(0)) Then
            Namify = Namify(Pieces(1) & " " & Pieces(2) & " " & Pieces(3) & " " & Pieces(4), piece)
        ElseIf IsSuffix(Pieces(4)) Then
            Namify = Namify(Pieces(0) & " " & Pieces(1) & " " & Pieces(2) & " " & Pieces(3), piece)
        Else
            If piece = 2 Then
                Namify = Pieces(0)
            ElseIf piece = 3 Then
                Namify = Pieces(1) & " " & Pieces(2)
                If Not IsParticle(Pieces(3)) Then
                    Namify = Namify & " " & Pieces(3)
                End If
            ElseIf piece = 4 Then
                If IsParticle(Pieces(3)) Then
                    Namify = Pieces(3) & " " & Pieces(4)
                Else
                    Namify = Pieces(4)
                End If
            End If
        End If
    
    ElseIf Length = 6 Then
        
        If IsTitle(Pieces(0)) Then
            Namify = Namify(Pieces(1) & " " & Pieces(2) & " " & Pieces(3) & " " & Pieces(4) & " " & Pieces(5), piece)
        ElseIf IsSuffix(Pieces(5)) Then
            Namify = Namify(Pieces(0) & " " & Pieces(1) & " " & Pieces(2) & " " & Pieces(3) & " " & Pieces(4), piece)
        End If
    End If
    
    ' clean up hanging commas
    If Right(Namify, 1) = "," Then
        Namify = Mid(Namify, 1, Len(Namify) - 1)
    End If
    
End Function

Function IsTitle(t As String) As Boolean
    Dim Titles As Variant
    Titles = Array("Mr", "Mr.", "Ms", "Ms.", "Mrs", "Mrs.", "Dr", "Dr.", "Sir", "Miss")
    IsTitle = (UBound(Filter(Titles, t)) > -1)
End Function

Function IsSuffix(s As String) As Boolean
    Dim Suffixes As Variant
    Suffixes = Array("II", "III", "IV", "V", "Jr", "Jr.", "Sr", "Sr.", "PhD", "Ph.D", "MD", "M.D.", "PE", "P.E.", "Ctech", "P.Eng.")
    IsSuffix = (UBound(Filter(Suffixes, s)) > -1)
End Function

Function IsParticle(p As String) As Boolean
    Dim Particles As Variant
    Particles = Array("de", "De", "le", "Le", "la", "La", "du", "Du", "von", "Von", "van", "Van", "O")
    IsParticle = (UBound(Filter(Particles, p)) > -1)
End Function

12 April 2013

NCARB Ad Compaign

I was flipping through a copy of Dwell the other day, and I came across this advertisement from NCARB:


NCARB is the National Council of Architectural Registration Boards, which is the organization that forces architects to undergo at least seven different wallet-drains, I mean exams, in order to become an architect. I think it's safe to say this group should have their finger on the pulse of the industry.

And this is why I found the ad disgraceful and a confirmation of why I deviated from the profession (into structural engineering). First statement: "change the WORLD your WAY," a great summary of how many architects see themselves: as self-prophesied global impact changers. Okay, fine, we all know architects are egomaniacs. We kinda love them for that. Let's continue...

"The demanding academic schedule. The years of internship. The rigorous exam. All to earn a license and call yourself an architect. No one said it would be easy. If you're going to change the world, would you want it any other way?"

So if I knew little about the profession, I would surmise that architects are most proud of 1. Having a really laborious education, 2. Having a really long internship, 3. Taking a hard exam, and the best one, 4. Simply being able to call yourself an "architect."

I'm sure NCARB had good intentions for this kind of campaign, but I think their aiming is quite off. Architects are proud of being expert collaborators, cutting-edge technical experts, deep carers for both the built and natural environments, and creators of buildings that -- yes -- change the world around you. But most of my (licensed) architect friends could pretty much care less what people call them.

Just for a counter-example, I find this short article, despite it being a sponsored advertisement, a far better motivator for one to consider becoming an architect:
http://www.archdaily.com/358419/clients-want-to-know-how-to-get-your-dream-home/

Here's more on the NCARB campaign:
http://www.ncarb.org/becoming-an-architect/change-the-world

My soon-to-be-wife, an architect, got a raise after becoming licensed. How much? 2.5%. While she loved the company, she also has the mathematical skills to figure that that raise would take her years to pay back the cost of the exams. To be fair, you need a license to make it into any top-tier position at a firm. Period. So it has that value -- heaven forbid that be part of an ad campaign. But no, we're left advertising to the world that we aspire to simply being able to call ourselves "architects." Comon, NCARB, do better.

11 April 2013

Facebook Favorites Privacy

After pulling my hair out and nearly deciding to quit Facebook altogether, I finally came across this post that helped explain how to control the privacy of your "Favorites."

For example, I was doing my regular check-up on my online presence, and I found that Facebook was sharing with the world several new "Favorites" of mine, such as music, books, and other... well, private things. I was confounded because to my knowledge I had set "Friends of Friends" as pretty much the circle of privacy for everything.

So to a solution:

  1. View your profile
  2. Click "Likes" under the "Apps" section
  3. There you will find the section labelled, "Favorites"
    (seriously, monkeys are doing FB's semantic design)
  4. Click "Edit" and finally you may discover like I did, that all this is still Public
To be fair, I don't think I ever edited these privacy settings because I never added anything to my "Favorites." But what I've learned is that "Liking" things automatically adds those things to my "Favorites."

Can someone inform FB that there is a world of difference between "Liking" something and calling something my "Favorite?"

21 March 2013

Sparkframe

While working several years in structural engineering / architecture and dealing with the crude marriage between email and Revit, I decided to finally push out a platform to provide what I see as a much better way to communicate with written words (emails / texts / chats / etc). This add-in for Revit, Sparkframe, provides a straight-forward way to continue communicating but adds some key features: in particular, live chat, direct linking to BIM elements, screenshot attachments, and simple-to-use task management.

It may sound like another personal information management system (i.e. Outlook), but because everything is directly tied to Revit elements, workflows can be more efficient, consistent, and less error-prone.

So instead of emailing a team member about "the wall between gridlines A-2 and A-5," send your comment to that person and attach the actual wall to the comment.

In the same way, instead of writing on a post-it "re-layout bathrooms," add yourself a task in Sparkframe attached to the actual bathroom.

By doing so, design intentions and decisions (DIDs) are made more clear, team members can follow along better (managers in particular), and design processes can be more easily transferred from one member to another, adding flexibility to design teams.

And what's better? It's all browser-based, meaning accessibility from mobile devices. More clarity, more flexibility, less errors. Check it out:

Sparkframe

Adam

21 February 2013

3D Doodling

This project was announced very recently on Kickstarter:

http://www.kickstarter.com/projects/1351910088/3doodler-the-worlds-first-3d-printing-pen


While the immediate application is interesting for a design studio, I think combining it with a more rigorous digital model could open many doors to increasing the production of study models for an architectural design studio. For instance, this approach could produce the paper stencils over which a 3Doodler could produce a  quick wireframe for construction.

[2012-04-10_2136%255B4%255D.png]

02 September 2012

iPad Soft Restart

I have a music app (looking at you, Synology DS audio) that tends to freeze up on occasion. Well, actually, it doesn't freeze, but rather seems to get stuck between songs sometimes. Anyways, this prompted me to hunt down, without much hope, how to "force close" an app, to use a more Android-centric term.

To my surprise, turns out you can...

  1. Hold down the Wake/Sleep button to get the red shut-down slider.
  2. But instead of sliding that sucker, hold the Home button for a few seconds.
This takes you back to the home screen and seems to shut down all apps, which took care of my problem.

31 May 2012

Billboard Top Debuts

In my never-ending quest to find sources for "good music" — whatever that may mean — I hacked together a Yahoo Pipe from the Billboard 200 that spits back a rough list of the top debuts. Billboard provides an API service, but I didn't want to sign up for a key and read thru documentation. They provide a public feed of the top 200, which I believe is updated daily, which is fine, but I don't want to sift through 200 items in my Reader every day to find the changes. And to make this a bit more tricky, the only real info provided in the feed is album rank, but you can get the feed pre-sorted by weeks-on-chart.

So the pipe truncates to the first X number of albums with the lowest number of weeks on the chart, and then it filters to only those in the top X ranks. Those two variables are sent to the pipe as a query string, so I may need to tweak those. Respectively, 40 and 15 seem to do a good job right now.


30 January 2012

Color at the End of this Tunnel

fireworks, anyone?

I started this game several years ago. It got interrupted by several things, such as work, moving, getting licensed, finishing another game started previously, moving again, new job, moving again ... You get the picture.

So it's down to the music. I could still refine the UI experience a hundred more times, but I think I just need to get this project done while the time (and winter) is here. And nothing but the music stands in my way. Too bad my piano's 4,000 miles away. Where are you, Live? Actually, I've already started to to take samples and clips from inudge and assemble them in Live with some midi instruments and effects. So far, so good.

A 2012 release appears likely. Heh.




05 January 2012

Skills

Just got this in my inbox:


Am I playing The Sims? Some sort of RPG? When did real life become a character sheet stat builder?

11 December 2011

Privacy


Maybe I'm a bit paranoid, but I've been trying to pay more attention to the app permission requests now flooding phones and laptops. For example, I was going to install Amazon's Wishlist Browser Button, but was informed by Chrome that it needs permission to access all my "data on all websites."

What scares me (besides the fact that Google knows everything about me) is the horde of people out there installing these sorts of apps, giving full legal permission to a company like Amazon to look over their shoulder as they read their bank statements and compose personal emails.

Meanwhile, phone carriers actively monitor their user's keystrokes. Okay, so there may be not "threat" to security or privacy there, but I'm sure there's certain concern brewing.

I'm a huge fan of Pandora (sadly not available outside the US), but raised an eyebrow when their app wanted access to all of my contacts. On one hand, playing radio does not require knowing who my friends are. On the other hand, this is probably a large part of why Pandora is still free to use because they can sell this info to third parties, which they certainly do.

So here I am, questioning my new friends, Google, Amazon, and probably a slew of nameless demographic analytics companies ("Consumer Recreation Services," heh). They likely know more about me than my closest friends and relatives. It's scary, but I'm an optimist that this will make my life more enjoyable. Someday. I just need to get over the paranoia and install that wishlist button...

09 December 2011

Right Triangles && Integers

Now that I'm in the world of creating exams, I find that it is helpful to keep as many integers involved as possible so that students don't get hung up on significant figures and rounding. In the end, more integers means easier grading.

Also, the problems (it's a statics class at the moment ... stupid pun) involve lots of right triangles, and one can use a 3-4-5 triangle only so many times before it becomes passé.

A little ruby spits out leg dimensions of uniquely proportioned right triangles with integer legs:

http://codepad.org/O43BQ0H0

(lookUp marks legs that are a multiple)

Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
4 x 3
12 x 5
15 x 8
21 x 20
35 x 12
40 x 9
45 x 28
55 x 48
60 x 11
72 x 65
80 x 39
91 x 60
99 x 20
105 x 88
112 x 15
132 x 85      ***
140 x 51      ***
165 x 52
168 x 95
180 x 19
195 x 28

26 November 2011

Lightroom Backups

I've been using Adobe's Lightroom 3 for a few months now, and due to my limited laptop hard drive space, I need to start seriously learning backup options. I'm working with JPG / NEF pairs ("side cars" if I have my LR terminology down). A few things I've learned:

  • Lightroom keeps all edits and metadata changes in its own catalog stashed somewhere out of sight
  • You can choose "Save Metadata" on a folder in LR, which will output in the same folder an XMP file with all the metadata of all images
    • Note: this does not save the metadata to the originals in order to avoid file corruptions
    • So it's really just a means to move / copy / apply metadata to files via LR's catalog
  • There are a series of "Publish" options for sending images to Facebook, Flickr, hard drives, etc. But this feels more like, well, a publishing feature and not a backup feature.
Because I want to backup a folder with edits, metadata, and original files, the proper choice seems to be "Export this Folder as Catalog..." This creates a new folder that contains copies of all the above: edits, metadata, and original files. Once this is done, I send these exported folders for typical backup.