Option Explicit | |
Private Declare Function URLDownloadToFile Lib "urlmon" _ | |
Alias "URLDownloadToFileA" (ByVal pCaller As Long, _ | |
ByVal szURL As String, ByVal szFileName As String, _ | |
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long | |
Dim Ret As Long | |
'~~> This is where the images will be saved. Change as applicable |
- Start by telling your audience what they will take away from your talk.
- (1) organize a talk and save hours of time;
- (2) categorize information on your slides and keep your audience engaged
- (3) feel more confident and excited about giving a presentation.
- Speak less than the time allotted.
- Use silence effectivel
- Pause periodically
- Emphasize key words
String#gsub is one of the most used Ruby methods in the wild. Just about every Ruby programmer knows about the method and uses it fairly regularly.
Here’s a quick refresher of the typical gsub usage:
# using string match 'John Wayne'.gsub('John', 'Bruce') => "Bruce Wayne"
You don't want scan for this, as it makes little sense. You can use String#match which will return a MatchData object, you can then call #captures to return an Array of captures. Something like this:
#!/usr/bin/env ruby string = "RyanOnRails: This is a test" one, two, three = string.match(/(^.*)(:)(.*)/i).captures
http://www.rubyinside.com/21-ruby-tricks-902.html
A typical way to extract data from text using a regular expression is to use the match method. There is a shortcut, however, that can take the pain out of the process:
email = "Fred Bloggs "
#!/usr/bin/env ruby | |
require 'pdf/reader' # gem install pdf-reader | |
# credits to : | |
# https://github.com/yob/pdf-reader/blob/master/examples/text.rb | |
# usage example: | |
# ruby pdf2txt.rb /path-to-file/file1.pdf [/path-to-file/file2.pdf..] | |
ARGV.each do |filename| | |
PDF::Reader.open(filename) do |reader| |
In our journey through the world of test automation with ruby we have found that sometimes the data we need to validate is locked up in some .pdf formatted file and can be difficult to get at. The 3Qi Labs team decided there had to be a way to automate the extraction and parsing of these PDF’s within our test automation scripts and the search began. Enter Xpdf.
There are many programs/ruby libraries that can do a the parsing job we need done such as PDFMiner, PoDoFo, Origami, and the PDF-Reader gem, but we have found Xpdf to be a the best choice for our needs to both view and parse out the data from pdf files when your testing includes doing some validation of the contents of generated pdf files. Xpdf is an open source viewer for Adobe “.pdf” files that includes a set of utilities to do just about everything you would want to do to a PDF: extracting the PDF’s info or attachments or images or converting the PDF to a bitmap format, but the utility we are after here is Xpdf’s text
and unlimited project sites
https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages/