1.1. SETTINGUPYOURJULIAENVIRONMENT
11
Ifthatfileexistsinthepresentworkingdirectorywecanrunitwithinclude("test_script.jl")
(ToseewhatyourpresentworkingdirectoryisinaJuliasessiontypepwd())
Here’sanexample,wheretest_script.jlsitsindirectory/home/john/temp
julia> pwd()
"/home/john/temp"
julia> include("test_script.jl")
i = 1
i = 2
i = 3
(Ofcoursepathstofileswilllookdifferentondifferentoperatingsystems)
Ifthefileisnotinyourpwdyoucanrunitbygivingthefullpath—inthepresentcase
julia> include("/home/john/temp/test_script.jl")
Alternativelyyoucanchangeyourpwdtothelocationofthescript
julia> cd("/home/john/temp")
andthenrunusinginclude("test_script.jl")asbefore
EditingJuliaScripts HopefullyyoucannowrunJuliascripts
Youalsoneedtoknowhowtoeditthem
TextEditors Nothingbeatsthepowerandefficiencyofagoodtexteditorforworkingwithpro-
gramtext
Ataminimum,suchaneditorshouldprovide
• syntaxhighlightingforthelanguagesyouwanttoworkwith
• automaticindentation
• textmanipulationbasicssuchassearchandreplace,copyandpaste,etc.
TherearemanytexteditorsthatspeakJulia,andalotofthemarefree
Suggestions:
SublimeTextisamodern, popularandhighlyregardedtexteditorwitharelativelymoderate
learningcurve(notfreebuttrialperiodisunlimited)
Emacsisahighqualityfreeeditorwithasharperlearningcurve
Finally,ifyouwantanoutstandingfreetexteditoranddon’tmindaseeminglyverticallearning
curvepluslongdaysofpainandsufferingwhileallyourneuralpathwaysarerewired,tryVim
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Pdf compress - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
pdf custom paper size; change font size in fillable pdf form
Pdf compress - VB.NET PDF File Compress Library: Compress reduce PDF size in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Compression and Decompression Control SDK
pdf page size may not be reduced; change font size pdf fillable form
1.1. SETTINGUPYOURJULIAENVIRONMENT
12
IDEs IDEsareIntegratedDevelopmentEnvironments—theycombineaninterpreterandtext
editingfacilitiesintheoneapplication
ForJuliaoneniceoptionisJuno
Alternativelythere’sIJulia,whichisalittlebitdifferentagainbuthassomegreatfeaturesthatwe
nowdiscuss
IJulia
ToworkwithJuliainascientificcontextweneedataminimum
1. AnenvironmentforeditingandrunningJuliacode
2. Theabilitytogeneratefiguresandgraphics
AveryniceoptionthatprovidesthesefeaturesisIJulia
Asabonus,IJuliaalsoprovides
• Nicelyformattedoutputinthebrowser,includingtables,figures,animation,video,etc.
• Theabilitytomixinformattedtextandmathematicalexpressionsbetweencells
• FunctionstogeneratePDFslides,statichtml,etc.
WhetheryouendupusingIJuliaasyourprimaryworkenvironmentornot,you’llfindlearning
aboutitanexcellentinvestment
InstallingIJulia IJuliaservesasaJuliaabackendforJupyternotebook
TheJupyternotebookinturnhasarangeofdependenciesthatitneedstoworkproperly
AtpresenttheeasiestwaytoinstallalloftheseatonceistoinstalltheAnacondaPythondistribu-
tion
InstallingAnaconda InstallingAnacondaisstraightforward: downloadthebinaryandfollow
theinstructions
Ifyouareaskedduringtheinstallationprocesswhetheryou’dliketomakeAnacondayourdefault
Pythoninstallation,sayyes—youcanalwaysremoveitlater
Otherwiseyoucanacceptallofthedefaults
NotethatthepackagesinAnacondaupdateregularly—youcankeepuptodatebytypingconda
update anacondainaterminal
InstallingIJulia Justrun
julia> Pkg.add("IJulia")
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# TIFF: How to Use C#.NET Code to Compress TIFF Image File
Compress Tiff. C# TIFF - Compress TIFF Files in C#.NET. C# .NET APIs and Sample Codes for How to Compress TIFF Document. C#.NET: Compress TIFF Files Overview.
batch pdf compression; change font size in pdf
VB.NET PDF Library SDK to view, edit, convert, process PDF file
Generally speaking, you can use this .NET document imaging SDK to load, create, edit, convert, protect, compress, extract, and navigate PDF document (page).
change font size on pdf text box; pdf file compression
1.1. SETTINGUPYOURJULIAENVIRONMENT
13
Warning: TheIJuliawebsitestatesthatifyougetanerrormessageyoushouldremoveand
reinstall,orforcearebuildwithPkg.build("IJulia")
OtherRequirements We’llbewantingtoproduceplotsandwhilethereareseveraloptionswe’ll
startwithPyPlot
julia> Pkg.add("PyPlot")
Finally,sinceIJuliarunsinthebrowseritmightnowbeagoodideatoupdateyourbrowser
OnegoodoptionistoinstallafreemodernbrowsersuchasChromeorFirefox
InourexperienceChromeplayswellwithIJulia
GettingStarting TostartIJuliainthebrowser,openupaterminal(orcmdinWindows)andtype
jupyter notebook
Here’sanexampleofthekindofthingyoushouldsee
Inthiscasetheaddressislocalhost:8888/tree,whichindicatesthatthebrowseriscommunicat-
ingwithaJuliasessionviaport8888ofthelocalmachine
Thepageyouarelookingatiscalledthe“dashboard”
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# WPF PDF Viewer SDK to view, annotate, convert and print PDF in
Split PDF Document. File: Compress PDF. Page: Create Thumbnails. Page: Insert PDF Pages. Page: Delete Existing PDF Pages. Page: Replace
best way to compress pdf files; pdf font size change
VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to
Split PDF Document. File: Compress PDF. Page: Create Thumbnails. Page: Insert PDF Pages. Page: Delete Existing PDF Pages. Page: Replace
reader shrink pdf; adjusting page size in pdf
1.1. SETTINGUPYOURJULIAENVIRONMENT
14
Ifyouclickon“New”youshouldhavetheoptiontostartaJulianotebook
Here’swhatyourJulianotebookshouldlooklike:
Thenotebookdisplaysanactivecell,intowhichyoucantypeJuliacommands
NotebookBasics Noticethatinthepreviousfigurethecellissurroundedbyagreenborder
Thismeansthatthecellisineditmode
Asaresult,youcantypeinJuliacodeanditwillappearinthecell
Whenyou’rereadytoexecutethesecommands,hitShift-EnterinsteadoftheusualEnter
ModalEditing ThenextthingtounderstandabouttheJupyternotebookisthatitusesamodal
editingsystem
Thismeansthattheeffectoftypingatthekeyboarddependsonwhichmodeyouarein
Thetwomodesare
1. Editmode
• Indicatedbyagreenborderaroundonecell,asinthepicturesabove
• Whateveryoutypeappearsasisinthatcell
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
VB.NET Create PDF from Word Library to convert docx, doc to PDF in
Split PDF Document. File: Compress PDF. Page: Create Thumbnails. Page: Insert PDF Pages. Page: Delete Existing PDF Pages. Page: Replace
change page size of pdf document; pdf compression settings
VB.NET PDF- HTML5 PDF Viewer for VB.NET Project
Split PDF Document. File: Compress PDF. Page: Create Thumbnails. Page: Insert PDF Pages. Page: Delete Existing PDF Pages. Page: Replace
change font size in pdf text box; pdf reduce file size
1.1. SETTINGUPYOURJULIAENVIRONMENT
15
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# HTML5 PDF Viewer SDK to view PDF document online in C#.NET
Split PDF Document. File: Compress PDF. Page: Create Thumbnails. Page: Insert PDF Pages. Page: Delete Existing PDF Pages. Page: Replace
optimize scanned pdf; pdf optimized format
C# PDF Image Extract Library: Select, copy, paste PDF images in C#
PDF ›› C# PDF: Extract PDF Image. How to C#: Extract Image from PDF Document. Support PDF Image Extraction from a Page, a Region on a Page, and PDF Document.
pdf change font size in textbox; pdf paper size
1.1. SETTINGUPYOURJULIAENVIRONMENT
16
2. Commandmode
• Thegreenborderisreplacedbyagreyborder
• Keystrokesareinterpretedascommands—forexample, , typingbaddsanewcell
belowthecurrentone
Switchingmodes
• Toswitchtocommandmodefromeditmode,hittheEsckey
• Toswitchtoeditmodefromcommandmode,hitEnterorclickinacell
ThemodalbehavioroftheJupyternotebookisalittletrickyatfirstbutveryefficientwhenyou
getusedtoit
Formoredetailsonthemechanicsofusingthenotebook,seehere
Plots Asdiscussedabove,IJuliaintegratesnicelywiththeplottingpackagePyPlot.jl
PyPlotinturnreliesontheexcellentPythongraphicslibraryMatplotlib
OnceyouhavePyPlotinstalledyoucanloaditviausing PyPlot
We’lldiscussplottingindetaillateronbutfornowlet’sjustmakesurethatitworks
Here’sasampleprogramyoucanruninIJulia
using PyPlot
50
srand(1)
rand(n)
rand(n)
area pi .* (15 .* rand(n)).^# 0 to 15 point radiuses
scatter(x, y, , s=area, , alpha=0.5)
Don’tworryaboutthedetailsfornow—let’sjustrunitandseewhathappens
TheeasiestwaytorunthiscodeistocopyandpasteintoacellinthenotebookandShift-Enter
Thisiswhatyoushouldsee:
WorkingwiththeNotebook Let’sgooversomemoreJupyternotebookfeatures—enoughso
thatwecanpressaheadwithprogramming
TabCompletion AsimplebutusefulfeatureofIJuliaistabcompletion
Forexampleifyoutyperepandhitthetabkeyyou’llgetalistofallcommandsthatstartwith
rep
IJuliaoffersupthepossiblecompletions
Thishelpsremindyouofwhat’savailableandsavesabitoftyping
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
1.1. SETTINGUPYOURJULIAENVIRONMENT
17
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
1.1. SETTINGUPYOURJULIAENVIRONMENT
18
On-LineHelp TogethelpontheJuliafunctionsuchasrepmat,enter?repmat
Documentationshouldnowappearinthebrowser
OtherContent Inadditiontoexecutingcode,theJupyternotebookallowsyoutoembedtext,
equations,figuresandevenvideosinthepage
Forexample,hereweenteramixtureofplaintextandLaTeXinsteadofcode
NextweEsctoentercommandmodeandthentypemtoindicatethatwearewritingMarkdown,
amark-uplanguagesimilarto(butsimplerthan)LaTeX
(YoucanalsouseyourmousetoselectMarkdownfromtheCodedrop-downboxjustbelowthelist
ofmenuitems)
NowweShift + Entertoproducethis
ShellCommands Youcanexecuteshellcommands(systemcommands)inIJuliabyprepending
asemicolon
Forexample,;lswillexecutetheUNIXstyleshellcommandls,which—atleastforUNIXstyle
operatingsystems—liststhecontentsofthepresentworkingdirectory
Theseshellcommandsarehandledbyyourdefaultsystemshellandhenceareplatformspecific
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
1.1. SETTINGUPYOURJULIAENVIRONMENT
19
WorkingwithFiles TorunanexistingJuliafileusingthenotebookwecaneither
1. copyandpastethecontentsintoacellinthenotebook,or
2. useinclude("filename")inthesamemannerasfortheJuliainterpreterdiscussedabove
Moresophisticatedmethodsforworkingwithfilesareunderactivedevelopmentandshouldbe
on-linesoon
SharingNotebooks NotebookfilesarejusttextfilesstructuredinJSONandtypicallyending
with.ipynb
Anotebookcaneasilybesavedandsharedbetweenusers—youjustneedtopassaroundthe
ipynbfile
Toopenanexistingipynbfile,importitfromthedashboard(thefirstbrowserpagethatopens
whenyoustartJupyternotebook)andrunthecellsoreditasdiscussedabove
nbviewer TheJupyterorganizationhasasiteforsharingnotebookscallednbviewer
ThenotebooksyouseetherearestaticHTMLrepresentationsofnotebooks
However,eachnotebookcanbedownloadedasanipynbfilebyclickingonthedownloadiconat
thetoprightofitspage
Oncedownloadedyoucanopenitasanotebook,aswediscussedjustabove
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
1.1. SETTINGUPYOURJULIAENVIRONMENT
20
TheQuantEconLibrary
QuantEcon.jlisacommunitybasedcodelibrarycontainingopen sourcecodeforquantitative
economicmodeling
YoucaninstallthispackagethroughtheusualJuliapackagemanager:
julia> Pkg.add("QuantEcon")
Forexample,thefollowingcodecreatesadiscreteapproximationtoanAR(1)process
julia> using QuantEcon: tauchen
julia> tauchen(40.91)
([-6.88247,-2.29416,2.29416,6.88247],
4x4 Array{Float64,2}:
0.945853
0.0541468
2.92863e-10 0.0
0.00580845
0.974718
0.0194737
1.43534e-11
1.43534e-11 0.0194737
0.974718
0.00580845
2.08117e-27 2.92863e-10 0 0.0541468
0.945853
)
We’lllearnmoreaboutthelibraryaswegoalong
InstallingviaGitHub YoucanalsograbacopyofthefilesintheQuantEconlibrarydirectlyby
downloadingthezipfile—tryclickingthe“DownloadZIP”buttononthemainpage
Alternatively,youcangetacopyoftherepousingGit
FormoreinformationseeExercise1
Exercises
Exercise1 Ifyouhaven’theard, Gitisaversioncontrolsystem— apieceofsoftwareusedto
managedigitalprojectssuchascodelibraries
Inmanycasestheassociatedcollectionsoffiles—calledrepositories—arestoredonGitHub
GitHubisawonderlandofcollaborativecodingprojects
Gitistheunderlyingsoftwareusedtomanagetheseprojects
Gitisanextremelypowerfultoolfordistributedcollaboration—forexample,weuseittoshare
andsynchronizeallthesourcefilesfortheselectures
TherearetwomainflavorsofGit
1. theplainvanillacommandlineversion(whichwerecommend)
2. thepoint-and-clickGUIversions
Asanexercise,trygettingacopyoftheQuantEconrepositoryusingGit
(Perhapsgoogleforrecentrecommendationsmatchingyouroperatingsystem)
Ifyou’veinstalledthecommandlineversion,openupaterminalandenter
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Documents you may be interested
Documents you may be interested