Found 5 results for tag "search"
VIM Search and Replace
November 30th 2015 12:05 pm

While I like to use
vim
as my text editor of choice while in a Linux system, I hated the fact that I had to find each instance of a word and manually type out the replaced word.So, I found a solution: (thank you VIM Wiki)
:%s/The
%s
command works just like wq
, so you need to proceed it with a colon. But here's how it works:
:%s/FIND/REPLACE/OPTIONSI hope this seems straight forward, but here's the breakdown:
%s
- initiate the :substitute
feature
FIND
- the word/phrase you want to find
REPLACE
- the word/phrase you want to replace it with
OPTIONS
- there are a series of options you can include, the most popular one being g
Here is an example:
:%s/cat/dog/gThis replaces all instances of "cat" with the word "dog". Simple, right?
Options
Here is the list of options I have come up with so far:c
- ask for confirmation (similiar to the -i
flag)i
- case insensitive search/replace I
- case sensitive (the flag \C
can also be tacked on to the word in case you want the word to be case sensitive only):%s/\<cat\>/dog/g
- while not in the Options field, this searches for the whole words only (such as "cat", but not "categories")
There are plenty of other examples on the VIM Wiki page, but I thought I'd post this guide here for my benefit and anybody elses that needs it.
Job Hunt Progress
January 27th 2014 05:47 am
I felt it was necessary to report my latest status regarding my "job hunt" so far.
Over the past 6 months, I have been searching for a job to bring in additional income. Here are my results:
9/14/13:
Kitchen & Company - Never heard back
Trader Joes - Denied at interview
Haywood Community College (Director of Small Business Center) - After a long and frustrating application process, where my application and transcripts were sent to the wrong department twice, I never received a return call
9/25/2013:
Target - Denied on 1/17/14
Biltmore (IT) - Denied
Biltmore (Dishwasher) - Denied
Biltmore (Security) - 1 interview, then Denied
12/3/13:
Regal Cinemas (Floor Staff) - Never heard back/Application Expired
12/14/13:
WCU (Grounds Keeper) - Still "In Progress"
WCU (Instructor) - Still "In Progress"
WCU (Assistant) - Denied
WCU (IT Services) - Denied
UNCA (Journey) - Still "In Progress"
1/6/14:
MedWest (IT) - 1 interview, then never heard back
1/12/14:
Art & Logic - 1 return email, completed a sample task, then Denied on 2/19/14 (although, according to the email, my work was better than what they usually receive, but it wasn't good enough to move on)
BCGTrans - Never heard back
KISS (Book company) - Never heard back
Followup Boss - Denied
TOKY - Never heard back
Morrison Agency - Never heard back
Authenticff - Never heard back
McKinley - Denied
1/25/14 (at this point, I just didn't care where/what the job was):
Lowes (Overnight Stock) - Turned down within 12 hours
Bi-Lo (Stock) - Denied even before I finished the application
Ingles - TBA
Harris Teeter (3rd Shift Stocker) - Application expired (3/25/14)
Although I'm hopeful for Ingles and/or Harris Teeter, nobody can say that I didn't try, or "Getting a job is easy". I've been trying, trust me. That's26 44 49 50 62 64 84 87 applications in 8 months (as of 4/18/14).
Over the past 6 months, I have been searching for a job to bring in additional income. Here are my results:
9/14/13:
Kitchen & Company - Never heard back
Trader Joes - Denied at interview
Haywood Community College (Director of Small Business Center) - After a long and frustrating application process, where my application and transcripts were sent to the wrong department twice, I never received a return call
9/25/2013:
Target - Denied on 1/17/14
Biltmore (IT) - Denied
Biltmore (Dishwasher) - Denied
Biltmore (Security) - 1 interview, then Denied
12/3/13:
Regal Cinemas (Floor Staff) - Never heard back/Application Expired
12/14/13:
WCU (Grounds Keeper) - Still "In Progress"
WCU (Instructor) - Still "In Progress"
WCU (Assistant) - Denied
WCU (IT Services) - Denied
UNCA (Journey) - Still "In Progress"
1/6/14:
MedWest (IT) - 1 interview, then never heard back
1/12/14:
Art & Logic - 1 return email, completed a sample task, then Denied on 2/19/14 (although, according to the email, my work was better than what they usually receive, but it wasn't good enough to move on)
BCGTrans - Never heard back
KISS (Book company) - Never heard back
Followup Boss - Denied
TOKY - Never heard back
Morrison Agency - Never heard back
Authenticff - Never heard back
McKinley - Denied
1/25/14 (at this point, I just didn't care where/what the job was):
Lowes (Overnight Stock) - Turned down within 12 hours
Bi-Lo (Stock) - Denied even before I finished the application
Ingles - TBA
Harris Teeter (3rd Shift Stocker) - Application expired (3/25/14)
Although I'm hopeful for Ingles and/or Harris Teeter, nobody can say that I didn't try, or "Getting a job is easy". I've been trying, trust me. That's
Viewing Recent Purchases via Google
April 2nd 2013 02:35 pm
I was browsing for the voltage requirements for an item I recently purchased through Amazon when I found this neat little trick with Google:
I was browsing for HDE, the seller of a nice little camera I bought, when this box on the right popped up.

I thought it was kind of cool, so I clicked on "1 item from Amazon.com" (which took me to https://google.com/search?&q=my+purchases) and I saw this:

Google used my Gmail information and told me (very concisely) what the recent orders were, their expected delivery dates, and a tracking link for each (if it can find a relevant one).
I didn't expect to find this, but hey, one more way that Google is making my life easier.
(PS: You will need an active Gmail account for this to work)
(PPS: You can also just Google "my purchases" and the search result page will come up as well - you don't have to go through these steps to find that page)
I was browsing for HDE, the seller of a nice little camera I bought, when this box on the right popped up.

I thought it was kind of cool, so I clicked on "1 item from Amazon.com" (which took me to https://google.com/search?&q=my+purchases) and I saw this:

Google used my Gmail information and told me (very concisely) what the recent orders were, their expected delivery dates, and a tracking link for each (if it can find a relevant one).
I didn't expect to find this, but hey, one more way that Google is making my life easier.
(PS: You will need an active Gmail account for this to work)
(PPS: You can also just Google "my purchases" and the search result page will come up as well - you don't have to go through these steps to find that page)
Find text in files with GREP
November 2nd 2011 06:01 pm
I needed to reference this quite frequently, so I thought I'd post it here.
Ever had the frustration of needing to find a certain
You could
Use
All you need to do is type in
Ever had the frustration of needing to find a certain
string
inside files on a Linux OS via a terminal/command line? It'd be nice to have something like the Windows File Finder (when it works) to search for text inside of a file and report the file back.You could
cat
each file and use grep [string]
to spit back each line, then write down the filename. But there is an easier way.Use
grep
first instead of piping it!All you need to do is type in
grep -lir "[phrase]" [directory]and that's all there is to it (the quotations are optional). By using the command
grep
instead of using it after a pipe "|", this can search through files in an instant instead of having to manually search through each file.
The -l
(that's a lowercase "L") puts out files that match (as opposed to -v
which shows all files that don't match).
The i
makes the search query case insensitive.
Lastly, the r
makes grep recursive in folders.
Simple as that. Of course, you can have the results spit back to you if you just press Enter
, or you can output it to a file by using the >
operator, like so:
grep -lir "cout" . > output.txt(my VB and C++ friends should like this)
Tueday's over already?
November 17th 2010 10:19 am

Yesterday seemed to fly by. Keat didn't have class in the morning, but she still had to be there to sign in, so we were up and out of the apartment by noon. I actually got a lot of sleep on Monday night, but I was always so tired during the day. Can't figure that out.
Anyway, after I got to the office, I decided to spruce up on th jQuery I'd been studying. I fixed a few Fire & Ice issues (along with implementing jQuery on the spot), and did a little sales work on the side. Didn't get 1 of our potential customers that I'd been working with for about 3 weeks, but that's okay. Sooner or later, we'll get more customers.
I also figured out that by using a border-code in CSS, I can eliminate the "rounded box images" I had been using so much. This actually makes it easier for me because I don't have to create custom-color images for each rounded box I want. The CSS automatically rounds the box for me, and uses the supplied div/img without any additional markup! What a time-saver!
.round_border, .round_box{ -moz-border-radius:12px; -khtml-border-radius: 12px; -webkit-border-radius: 12px; border-radius:12px; }
I also added a few features to the blog; the main one being the "Search" feature (others being the bottom gear margin fix and the Newer/Older buttons, but the Search feature took me the longest to add/fix). Using the round box CSS method, I also made that input field rounded as well. How cool is that? I wanted to use jQuery to automatically highlight the searched term when found in the context, but that took too long. With my limited knowledge and the examples from jquery.com, it turns out that the example I was using would actually go through the whole context and replace every word with
&;lt;span>word
, which can get very resource-heavy and it took about 10-20 seconds for the page to load. After unsucessfully finding a method for $('#content').find(':contains('+query+').replaceWith(''+query+'')
, only to find that the jQuery statement would end up in a recursive loop, I decided to make it server-side and have the replacement function in PHP instead of jQuery. That actually made things a lot faster and I found a case-insensitive function that allowed for replacement of the original capitalization (if existed). That saved me a few hours.On to a different topic: I finally successfully implemented the Active/Inactive feature on the Business Accelerator form builder, but it took me forever to figure out why the variable wasn't being passed right. It turns out that I actually had my custom function get each array type in the form and (after passing it through a "Save" page with jQuery and AJAX), compile the whole thing into an orderly form with proper syntax. So in order to find the Active/Inactive variable, the function was trying to find a variable in an array that didn't exist, which is why the variable wasn't being passed. After I realized that, I took the custom parser out and made the Active/Inactive and Debug variables parse first (since they're only checkboxes), and parse the rest of the array-based form later. That solved that issue.
I'm still working on the form builder, and Milestone 4 should be done within a day or so (with respect to the world around me). If things go right, I should have it done by Spring. That'd be awesome.
I'm also going to be adding a "Projects" tab to this site for project tracking. Let's see how well that goes.
On another topic, I finished Eureka 3.5 and I'm excited to see what happens next. Season 4 isn't out on Netflix Instant yet, and Hulu only has episodes 5-9 until the season returns in 2011. I may watch 4:5-9 and watch 4:1-4 when Instant comes out, but I don't know right now. I may not be able to hold the excitement if Season 4 has 20 episodes, which means Instant is a ways off.
After yesterday's long work day (I got home around 9ish), Keat and I cooked dinner and watch the Eureka Pilot. It's a good series, I don't mind watching it again, plus Keat wanted to watch it from the beginning. She went to bed around 11 (maybe 12?), and I was up working on a few loose ends before I hit the sack around 2 (and missed the post for the day). Then, this mornings alarm woke me up around 8. Why must the winter be so cold? I wanted to call it a "sick day" and crawl back under the covers. But, work has to get done........
Tags:#eureka #netflix #xkcd #css #jquery #search #accelerator #hulu