Re: [julia-users] Re: A Very Simple Benchmark for Brutal-force Loops in Several Languages: revised, Julia is fast!

2016-08-03 Thread hustf
Zhong, people chop wood and they play the piano, too. Fill in Julia or 
Excel where you like. 

Sisyphuss, VBA show a 4% speed GAIN through making nsamples and y() public 
variables. Try it out!



Re: [julia-users] Re: A Very Simple Benchmark for Brutal-force Loops in Several Languages: revised, Julia is fast!

2016-07-31 Thread hustf
It is nice to have a little check on speed from time to time. I still use 
VBA for easy cooperation with less programming savvy colleguaes.

Julia 1.17s.
VBA (excel alt + f11):12 s.

This is a bit unfair to neolithic man Joel Spolsky since no optimization 
was performed:

Sub benchmark()
nsamples = 100
Dim y() As Double
ReDim y(1 To nsamples)
x = y
For i = 1 To nsamples
x(i) = (i - 1) * 5 / (nsamples - 1)
Next
Debug.Print ("\nBrutal-force loops, 100 times:")
sngtime = Timer
For m = 1 To 100
For n = 1 To nsamples
y(n) = Cos(2 * x(n) + 5)
Next
Next
Debug.Print Timer - sngtime
End Sub



[julia-users] Re: GUI toolkits for Julia: Gtk vs Tk vs others

2016-03-28 Thread hustf
A better indication of what to go for may be looking at the testable 
packages which depend on Gtk, Tk & etc. 

A lot of good work is put into Gtk, but the hours we spend on resolving 
issues (on Windows and OsX) are not so interesting. I think Gtk needs a 
base of users who at least reports issues (I have had some instances with 
crashes which were difficult to pinpoint and resolve, and so gave up 
without contributing with error reports. Bad behaviour. ). But the buck 
don't always stop within the Julia community. Gtk is used to its max in the 
image manipulator Gimp (I assume), but even there the windows managing is 
sub par in my personal windowized opinion.

Blink also has dependencies, but with Chrom(ium?). That's extremely well 
developed software with pretty limitless possibilities - especially if you 
know the technologies already. 
https://www.youtube.com/watch?v=IqNUcXmbWWY=8=PLP8iPy9hna6Sdx4soiGrSefrmOPdUWixM

GLVisualize still has few users, but it's maturing fast and can potentially 
go very very far.


Re: [julia-users] Almost at 500 packages!

2016-03-28 Thread hustf
Skimming pkg.julialang.org is pleasantly impossible with 904 registered 
packages. This smells exponential growth.

Is there a tool to simply download the text files in all of the packages? 
Last time I checked, I wasn't able to do that with github commands. 

I think it would be impossible to foresee which information might be 
relevant while keeping the tool you're requesting fast and lightweight. The 
text files already contain all the info, and we can easily extract data 
like dependencies from them. So I inelegantly maintain a ghost folder 
structure with text files from packages I've tried out so far. 



[julia-users] Re: Coordinates of graph layout algorithms

2016-02-11 Thread hustf
GraphLayout is a nice and useful package which would be a pity to 
deprecate. Perhaps what is needed is just the courage and enthusiasm to 
change the interface or delete the less useful or tough to maintain parts?


[julia-users] Re: Coordinates of graph layout algorithms

2016-02-10 Thread hustf
There was an inspiring related thread a little while ago:

https://groups.google.com/forum/#!searchin/julia-users/graph$20glvisualize/julia-users/ybGrFVKGyDA/KEf6mY0mCwAJ

My impression is that this subject is full of heuristics, and for graphs 
like e.g. the complete Julia package system I believe interactivity is the 
most effective heuristics there is. Compose can't offer that so I have 
simply used a text file with a blacklist of nodes to remove, and a function 
to remove disconnected nodes.

One of the other heuristics to graph layouts is going 3d, projecting your 
nodes on a sphere, a torus etcetera. That's fascinating in itself. You can 
start out with a 2d layout and the spring stiffness model or your own 
variant of it. But if it never settles into a clarifying layout for the 
purpose, you may take that incomplete layout and project it on a spherical 
surface and voila you get clarity. Or a torus. This is quite fun. It's 
neither lightweight nor easy nor fully compatible with Mac OSX, but a more 
complex graph layout application with interactivity could be built using 
the current state of GLVisualize. That state, of course, is changing 
rapidly. 


Re: [julia-users] Re: Adding another function to Cairo.jl

2016-01-26 Thread hustf
tirsdag 26. januar 2016 13.29.06 UTC+1 skrev cormu...@mac.com følgende:
>
>  Using github isn't my favourite computer-based activity, but let's see 
> how it goes.


The blue shell background doesn't help much. It scares the willies out of 
me.


[julia-users] Re: Adding another function to Cairo.jl

2016-01-25 Thread hustf

>
>
> Isn't this what every package developer hopes for? Useful small additions 
in line with the original intent. Fork it, improve it and permit the owners 
to take it in if they like!I wonder sometimes where to put questions like 
this. Why don't you open an issue? (to be clear, I have nothing to do with 
Cairo, except as a user)
 
 

>  
>


[julia-users] Re: ANN: Julia v0.4.3 released

2016-01-24 Thread hustf
The Julia + Juno Ide Windows 64 bundles are still version 0.4.2.



torsdag 14. januar 2016 19.27.48 UTC+1 skrev Tony Kelman følgende:
>
> Hello all! The latest bugfix release of the Julia 0.4.x line has been 
> released. Binaries are available from the usual place 
> , and as is typical with such things, 
> please report all issues to either the issue tracker 
> , or email the julia-users 
> list. (If you reply to this message on julia-users, please do not cc 
> julia-news which is intended to be low-volume.)
>
> This is a bugfix release, see this commit log 
>  for the list 
> of bugs fixed between 0.4.2 and 0.4.3. Bugfix backports to the 0.4.x line 
> will be continuing with a target of one point release per month. If you are 
> a package author and want to rely on functionality that did not work in 
> earlier 0.4.x releases but does work in 0.4.3 in your package, please be 
> sure to change the minimum julia version in your REQUIRE file to 0.4.3 
> accordingly. If you're not sure about this, you can test your package 
> specifically against older 0.4.x releases on Travis and/or locally.
>
> These are recommended upgrades for anyone using previous releases, and 
> should act as drop-in replacements. If you find any regressions relative to 
> previous releases, please let us know.
>
> -Tony
>
>

[julia-users] Re: Running a julia script on the web

2016-01-18 Thread hustf
There are many ways to do something like that, and if your users will 
accept to log in with google accounts, I believe the easiest one may be 
running everything on JuliaBox.org

This is how well it can be done. Snapshot: 
 https://jiahao.github.io/julia-blog/2014/06/09/the-colors-of-chemistry.html 


[julia-users] Re: Shell commands in Julia 0.4.2 in Windows 10

2016-01-13 Thread hustf

I for one really miss the shell commands, which disappeared with 0.4.2. 

Fortunately, cd still works, but that's about it. pwd() inside of Julia is 
not so bad, but you soon tire of typing readdir()  instead of just ;ls. If 
there are more than a few files in the directory, the output is truncated, 
too. For new users testing Julia from the documentation this gives a pretty 
bad impression.

Fortunately, this seems to be a temporary state of affairs, and with the 
new git library integrated with Julia, the package system will be a lot 
faster, too. There is an explanation in the thread below. Just don't follow 
the (my) advice and cut down your PATH. If you meet problems with it, try 
rearranging the PATH variable or put the julia and atom paths in the 
"system" and not "user" part of the definition. You need to be logged in to 
an administrator account to change the system PATH definitions, I believe.

You will likely see less issues than I did with the PATH since Juno/ Atom/ 
Lighttable (or whatever it's really called) is now updated and gives more 
flexibility.

https://groups.google.com/forum/#!searchin/julia-users/powershell/julia-users/pHonnw8X3iw/Vcbuj5amAwAJ
 



Re: [julia-users] How to define methods of rearranged arguments

2016-01-08 Thread hustf
Tom, ask me anything about Visual Basic 6.0. I skipped the last 20 years of 
new programming languages. But I see your point very clearly, and plan to 
learn macros too. 


Re: [julia-users] How to define methods of rearranged arguments

2016-01-08 Thread hustf
Sorry for such a cursory answer. I believe I can say if-sentences are 
non-Julian in this case because the final machine code needs one version 
per possible type. The machine code will be type stable, just very very 
long and slow if you don`t do the smart thinking for the compiler. I have 
already spent some time looking at the generated code and optimizing it. 
The compiler seems to do a good job with type stability and "if" statements 
of this type

*y = < 0 ? 0 : 1*

where "a good job" means socks are blown off and whatnot. 

But macros don`t know a thing about type. They are working before concrete 
types are even born. 


Re: [julia-users] How to define methods of rearranged arguments

2016-01-08 Thread hustf
(I bet you spotted the error in the code line above. Good luck.)


Re: [julia-users] How to define methods of rearranged arguments

2016-01-08 Thread hustf
The "if"-sentences look kind of non-Julian, and it's very easy to introduce 
bugs that way in my humble experience. Makes for very long code, too, 
generally speaking. Would writing a macro for establishing the alternative 
sequences be shorter codewise and quicker to run? In a way, that is what is 
done implicitly with keyword arguments? I believe e.g. @vectorize_2 arg can 
be used for a roughly similiar purpose.


Re: [julia-users] How do you override the new() function?

2016-01-04 Thread hustf
That's right. You would need to delete the current context. Sometimes 
workspace() can help you out. For a better approach, read this:

http://discuss.junolab.org/t/announcing-julia-ide-work-in-atom/297


[julia-users] Re: What's in your .juliarc.jl file?

2015-12-25 Thread hustf
Based on earlier Julia users threads. This may no longer be compatible with 
0.3.11 and may be shortened.


println(".juliarc define function: lastfile()  ")
"
Name of last file in current directory
"
function lastfile()
#Name of last file in current directory
rd=readdir(pwd())
rd[indmax(map(mtime,rd))]
end

if VERSION >= v"0.4.0-dev+6521"
println("osol()  osopen()")

"
Windows or Mac, open the given file in current directory
"
function osopen(filename::AbstractString)
# open the file on Mac or on Windows
@osx? run(`open $filename`) : spawn(`cmd /C "$filename"`)
end


"
Windows or Mac, open the last file in current directory
"
function osol()
filename=lastfile()
@osx? run(`open $filename`) : spawn(`cmd /C "$filename"`)
end




[julia-users] Re: Windows shell commands, differences 0.4.1. to 0.4.2

2015-12-20 Thread hustf
Cleaning PATH does not really fix this properly. The path to Powershell, 
for example, is used by packages like BinDeps. Also, PATH seems to grow all 
by itself when left alone.

This pull request contains a partial fix for BinDeps (affecting 
installation of many packages).
https://github.com/JuliaLang/BinDeps.jl/pull/194


[julia-users] Re: Julia backtraces from C and thread safety in julia runtime.

2015-12-16 Thread hustf
Kristoffer, I poked a bit around on dealii.org without really diving into 
it. I've been using Ansys professionally for around fifteen years, but the 
difference to the performance we're seeing from games and generally 'out 
there' is hard to explain. I'm basically very unimpressed with what I'm 
doing 'most every day.  Parallellization works - in theory, but in practice 
performance on a desktop computer is best with one to four cores on a 
desktop computer. 

Have you tried comparing performance for such problems with, say, Ansys' 
sparse matrix solver?


[julia-users] Re: Windows shell commands, differences 0.4.1. to 0.4.2

2015-12-16 Thread hustf
That's a good way to explaining why most shell commands don't work, and I 
can adjust accordingly and move on.

I seem to be limited to running just the .exe-files in c:\windows\ and 
~\system32. Luckily, 'cmd.exe' (and where.exe) is among them, so I can make 
do by prefixing some commands with 'cmd'.

Since this is not widely reported by other users, I suppose either my PATH 
must be larger than most - or it's not a popular feature with windows users.

http://sourceforge.net/p/msys2/wiki/MSYS2%20introduction/

*When using the shells, try to remove as many entries from PATH as you can, 
ideally only leaving something like C:\Windows\system32. Mixing in programs 
from other MSYS2 installations, Cygwin installations or compiler toolchains 
is not supported and will probably break things in unexpected ways. Do not 
have these things in PATH when running MSYS2 unless you know exactly what 
you're doing.*



[julia-users] Re: Windows shell commands, differences 0.4.1. to 0.4.2

2015-12-14 Thread hustf
Tony, let me take the opportunity to give thanks for the good work you're 
putting down in general. I can't wait to get going with Immerse, for one. 

So there is an embedded copy of git inside of Julia...  With a different 
parameter set, depending on startup context I suppose.. 'Shell', of course, 
is not a clearly defined term and is only misleading when one, like I did, 
assumes that the shell is the parent process of Julia. I have looked into 
base.convert.jl in addition to trying to understand what you write 
properly, but the c-calls and pointers belong a couple of levels too close 
to the core of computing for my comfort.

I hope the tests below can point to a solution that works without much 
knowledge of internal workings. This issue (whichever program to blame) 
currently stops the potentially production-boosting atom client from 
connecting consistently to julia on this system. And the REPL must be 
accessed through terminal 4) below.

This post is so long and boring because it took a while to reproduce the 
exact behaviour above. But finally, 5) below is the 'terminal' context of 
the first post. Julia 0.4.2, 0.4.1 and 0.4.0 all produce different results 
in context 5). All reported below are 0.4.2 results.

1) Windows 10.0.10586 64 bit->Start->type cmd. Two choices pop up: 'Command 
prompt (desktop app), and 'Anaconda Command Prompt'. I choose the 
non-anaconda one. This is a shortcut with target 
'%windir%\system32\cmd.exe'. It starts with prompt 'c:\users\F>'. DIR 
works. LS, PWD and GIT don't work. My PATH includes 
'c:\users\f\appdata\local\julia-0.4.2\bin'. I type Julia. pwd() yields 
'c:\\users\\f'. homedir() yields the same. I type ;pwd, ;dir and ;ls and 
all three produce the error in the first post. 

2) Same as 1), but I choose the 'Anaconda' terminal. 'c:\users\f'  is 
replaced with 'c:\jpa\Anaconda'. Same behaviour as 1) except for the path.

3) Start->  PowerShell (desktop app). This is a shortcut with target 
'%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe'. The window 
caption says 'Windows Power Shell'. The text heading says ...2015 
Microsoft The prompt says 'PS C:\Users\F>'. LS, PWD and DIR works. GIT 
does not work. Same Julia behaviour as 1)

4) Start-> Git shell (desktop app). This is a shortcut with target 
'C:\Users\F\AppData\Local\GitHub\GitHub.appref-ms --open-shell'. The window 
caption says 'c:\windows\system32\windowsPowershell\v1.0\powershell.exe'. 
The heading is identical to 3), but the prompt says 
'c:\users\f\documents\github>' without the PS prefix. LS, DIR, PWD and GIT 
all work. In Julia, pwd() yields 'C:\\Users\\F\\Documents\\GitHub'. 
homedir() yields 'C:\\Users\\F'. ;ls, ;dir and ;pwd work too. 

5) Logout F, login Fro. With this user, the git shell preference is the 
'MS-DOS style' shell. Start-> Git shell (desktop app). This is a shortcut 
with target 'C:\Users\Fro\AppData\Local\GitHub\GitHub.appref-ms 
--open-shell'. The window caption says 'c:\windows\system32\cmd.exe'. The 
promt says 'c:\users\fro\documents\github>'. LS yields no output at all. 
DIR works. PWD 'is not recognized as an internal or external command'. GIT 
works. In Julia, pwd() yields 'C:\\Users\\Fro\\Documents\\GitHub'. 
homedir() yields 'C:\\Users\\Fro'. ;ls works. ;dir and ;pwd yields the 
error in the first post. 



[julia-users] Re: Windows shell commands, differences 0.4.1. to 0.4.2

2015-12-14 Thread hustf
Tony, thanks for explaining. Also thanks for the good work you're putting 
down (I can't wait to get going with Immerse, inspired by the youtube 
video). 'Shell' is not a clearly defined term and is only misleading when 
one, like me, assumed that the shell is the parent process of Julia. I have 
looked into base.convert.jl in addition to trying to understand what you 
write, but the c-calls and pointers is a couple of levels deeper than where 
I am now.

I hope the tests below can point to a solution; note this issue (whichever 
program to blame) currently stop the potentially production-boosting atom 
client from connecting consistently to julia on this system.

It took a while to reproduce the exact behaviour above. But finally, 5) 
below is the 'terminal' context of the first post. Julia 0.4.2, 0.4.1 and 
0.4.0 all produce different results in context 5). But all reported below 
are 0.4.2 results.

1) Windows 10.0.10586 64 bit->Start->type cmd. Two choices pop up: 'Command 
prompt (desktop app), and 'Anaconda Command Prompt'. I choose the 
non-anaconda one. This is a shortcut with target 
'%windir%\system32\cmd.exe'. It starts with prompt 'c:\users\F>'. DIR 
works. LS, PWD and GIT don't work. My PATH includes 
'c:\users\f\appdata\local\julia-0.4.2\bin'. I type Julia. pwd() yields 
'c:\\users\\f'. homedir() yields the same. I type ;pwd, ;dir and ;ls and 
all three produce the error in the first post. 

2) Same as 1), but I choose the 'Anaconda' terminal. 'c:\users\f'  is 
replaced with 'c:\jpa\Anaconda'. Same behaviour as 1) except for the path.

3) Start->  PowerShell (desktop app). This is a shortcut with target 
'%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe'. The window 
caption says 'Windows Power Shell'. The text heading says ...2015 
Microsoft The prompt says 'PS C:\Users\F>'. LS, PWD and DIR works. GIT 
does not work. Same Julia behaviour as 1)

4) Start-> Git shell (desktop app). This is a shortcut with target 
'C:\Users\F\AppData\Local\GitHub\GitHub.appref-ms --open-shell'. The window 
caption says 'c:\windows\system32\windowsPowershell\v1.0\powershell.exe'. 
The heading is identical to 3), but the prompt says 
'c:\users\f\documents\github>' without the PS prefix. LS, DIR, PWD and GIT 
all work. In Julia, pwd() yields 'C:\\Users\\F\\Documents\\GitHub'. 
homedir() yields 'C:\\Users\\F'. ;ls, ;dir and ;pwd work too. 

5) Logout F, login Fro. With this user, the git shell preference is the 
'MS-DOS style' shell. Start-> Git shell (desktop app). This is a shortcut 
with target 'C:\Users\Fro\AppData\Local\GitHub\GitHub.appref-ms 
--open-shell'. The window caption says 'c:\windows\system32\cmd.exe'. The 
promt says 'c:\users\fro\documents\github>'. LS yields no output at all. 
DIR works. PWD 'is not recognized as an internal or external command'. GIT 
works. In Julia, pwd() yields 'C:\\Users\\Fro\\Documents\\GitHub'. 
homedir() yields 'C:\\Users\\Fro'. ;ls works. ;dir and ;pwd yields the 
error in the first post. 



[julia-users] Windows shell commands, differences 0.4.1. to 0.4.2

2015-12-13 Thread hustf
I suspect this is a bug introduced in 0.4.2, and an issue on Julia language 
may be the right place for reporting. However, reading up on related issues 
has got me quite confused and it may already be a known issue. If anybody 
could briefly point to an explanation of how the shell commands are 
supposed to work, it would be nice. Shell commands (REPL and press ';') 
 certainly behaves different from what is intuitive for me, namely that 
shell commands call the parent context.

The gist of the new behaviour I'm seeing in 0.4.2 is briefly:
(when launched from a terminal)
shell> dir
*ERROR: could not spawn `dir`: no such file or directory (ENOENT)*
*in _jl_spawn at process.jl:262*
shell> ls
success


(when launched by double-clicking)
shell> dir
*ERROR: could not spawn `dir`: no such file or directory (ENOENT)*
*in _jl_spawn at process.jl:262*
   shell> ls
*ERROR: could not spawn `dir`: no such file or directory (ENOENT)*
*in _jl_spawn at process.jl:262*


For context, no matter which version of Julia, or from which context I 
launch it, I get:
shell> powershell \$PSVersionTable.PSVersion
Major  Minor  Build  Revision
-  -  -  
5  0  10586  0
 


[julia-users] Re: General question on indexing

2015-11-16 Thread hustf
Seth,
thanks for that, and yes we can move over there, but I need some time to 
study it before I contribute in the context. I've been looking at 
GraphLayout - spring.jl, and thinking along the same lines about speed. I'm 
delaying a commit because the package has a coherent coding style but which 
I find hard to follow - and an interface problem with Compose. Also, I 
don't realistically expect to make a real improvement except in my own 
skills.

>From the documentation and small tests, I did not expect any improvements 
using @simd as long as there are "if"-sentences in the middle of it. So 
perhaps this format of the adjacency matrix may help? This for both 
directed and non-directed graphs. The type definition AdjMatrix just a 
small adaption of Maq7 above. Each node could be processed from one row and 
a submatrix pointing to the positions of just the other nodes.

# using 'current node -neighbour node ' notation:
4x4 Array{Int64,2}:
  0  21  31  41
 12   0  32  42
 13  23   0  43
 14  24  34   0

julia> ama =AdjMatrix(am)
3x4 AdjMatrix:
 12  21  31  41
 13  23  32  42
 14  24  34  43



[julia-users] Re: General question on indexing

2015-11-16 Thread hustf
Seth, I appreciate that. As a novice programmer I appreciate to have 
exchanges with you guys who are making this. I'm using commercial software 
every day that hasn't made progress since the nineties. 

I worked through something like fifteen types for the adjacency matrix 
(and, by the way, tuples for storage worked out, but was slower). I suppose 
Julia is fast so that we don't actually need to optimize like this all the 
time, but it's an excellent lesson. 

In the example I gave above you may have noted some confusion about 
rows-columns order. Those algorithms which were adapted from text books or 
other languages seem to walk along rows. In Julia, you walk faster 
downhill. And with @simd. 


[julia-users] Re: General question on indexing

2015-11-14 Thread hustf
I believe this work-in-progress type may be adapted? I wanted to make this 
faster by using tuples or immutable fixed vectors to store the data or 
whatnot, but I guess I'm currently stuck. Help wanted.

Compared to looping unnecessarily over a full matrix, this speeds things up 
by around 35%.

immutable Maq7 <:AbstractMatrix{Int}
data::Array{Int64,2}   # upper triangular except diagonal, stored as a 
horizontal vector
width::Int64
function Maq7(mat::Matrix{Int64}) 
if issym(mat)
n=size(mat,1)
if n>1
v=mat[2:n,1]
for col = 2:(n-1)
append!(v,mat[(col+1):n,col])
end
new(v', size(mat,1))
else
error("Ouch, not > (1x1)")
end
else 
error("Ouch, not square symmetric")
end
end
end
Base.size(A::Maq7)= A.width, A.width 
Base.length(A::Maq7)= div(A.width*(A.width-1), 2)
Base.getindex(A::Maq7, i::Int) = Base.getindex(A.data, i) 
function Base.getindex(A::Maq7, r::Int , c::Int )
if c > r 
return getindex(A.data, div( (r-1)*(2*A.width -r) , 2 ) + c - r )
elseif r > c
return getindex(A.data, div( (c-1)*(2*A.width -c) , 2 ) + r - c )
else
return zero(eltype(A.data))
end
end
Base.linearindexing(::Type{Maq7}) = Base.LinearFast()



Example:
julia> ms
4x4 Array{Int64,2}:
 7  1  2   3
 1  8  4   5
 2  4  9   6
 3  5  6  10


julia> m=Maq7(ms)
4x4 Maq7:
 0  1  2  3
 1  0  4  5
 2  4  0  6
 3  5  6  0

julia> collect(m)
6-element Array{Int64,1}:
 1
 2
 3
 4
 5
 6


julia> length(m)
6






[julia-users] Re: Windows woes

2015-10-28 Thread hustf
This just came in:

1seconds   Windows 8.1 64 bit 0.4.0  an iMac from 2012, updated OS
3.5  seconds   Windows 8.1 64 bit 0.4.0  bootcamp on an iMac from 2012
3.5  seconds   Windows 8.1 64 bit 0.4.0  bootcamp on an iMac from 2012
20   seconds   Windows  10 32 bit 0.4.0  a brand new HP something small 
with a keyboard and touch screen
20   seconds   Windows  10 32 bit 0.3.11a brand new HP something small 
with a keyboard and touch screen

If this can be solved, I can learn Julia while on travel. That would be 
very nice.
The package manager delay is confirmed from memory.


[julia-users] Re: Windows woes

2015-10-28 Thread hustf
Tony, I also forgot to mention above. The small notebook has an SSD. It 
seems to me that 64 bit versus 32 bit is the big factor here, but the 32 
bit may have some bloatware virus program from HP.


[julia-users] Re: Windows woes

2015-10-28 Thread hustf
Tony, we can compare Github desktop too. The nominator below represents 32 
bit of course.  On battery, I should say. I wait until I see processor 
usage < 5% before clicking and retest Julia too:
Github desktop: 32  s / 9 s  = 3.5
Julia 0.4.0:20 s  / 3.5 s = ~5.7



[julia-users] Re: Finding last modified file in a folder

2015-10-25 Thread hustf
You can see I'm not exactly a group veteran from my formatting skills.
I want to direct thanks to Alan Bahm for the general shell open code, and 
ami for the open last idea.


[julia-users] Re: Finding last modified file in a folder

2015-10-25 Thread hustf
No sorting needed, just maximum.

I find the functions below useful when working from REPL. This is my 
.juliarc file. I tried to add documentation metadata to the function, but 
it does not work with version checks. 


println(".juliarc define function: lastfile()  ")

"""
Name of last file in current directory
...
"""
function lastfile()
#Name of last file in current directory
rd=readdir(pwd())
rd[indmax(map(mtime,rd))]
end

if VERSION >= v"0.4.0-dev+6521"
println("osol()  osopen() on > 0.3.11")

"""
Windows or Mac, open the given file in current directory
...
"""
function osopen(filename::AbstractString)
# open the file on Mac or on Windows
@osx? run(`open $filename`) : spawn(`cmd /C "$filename"`)
end


"""
Windows or Mac, open the last file in current directory
...
"""
function osol()
filename=lastfile()
@osx? run(`open $filename`) : spawn(`cmd /C "$filename"`)
end

end






[julia-users] Re: function form of using/import

2015-10-05 Thread hustf
It would be very nice to bring back that flexibility. Compose.jl is 
currently updated to using the 'Require' strategy. But  LibFontConfig 
doesn't compile on my install because of a missing library. And there I'm 
stuck in solving yet another dependency Possible, I'm sure, but I just 
wanted to make Jewel work on 0.4.

julia> ccall((:FcInit,:libfontconfig),UInt8,())
ERROR: error compiling anonymous: could not load library "libfontconfig"
no error


[julia-users] Nice way to replace 'nothing'?

2015-10-01 Thread hustf

A search in my package folder reveals around 800 instances of 'nothing', 
which is deprecated in 0.4. My not-so-nice fix, example from Compose.jl:

void()=return
ver = Pkg.installed(pkg)
ver == void() && try   # was nothing changed to void() 


I am not so sure it works in these cases (example from WinRPM.jl):

void()=return
if repomd === void()  # was nothing changed to void() 
   continue
end

What would be a better way? I'm tinkering with a lot of code I don't 
properly understand here, so the fix ought to be safe rather than optimal.


Re: [julia-users] Nice way to replace 'nothing'?

2015-10-01 Thread hustf
Nothing better! Thanks!