[julia-users] Using generators

2016-10-02 Thread cormullion
Aren't generators to do with when the results are produced (on demand), rather 
than how they're specified?

[julia-users] Best compile and benchmark for haswell and broadwell architectures?

2016-10-01 Thread cormullion
I asked a similar question last week. The standard recommendation is 
https://github.com/JuliaCI/BaseBenchmarks.jl. It didn't really meet what I was 
looking for -- a quick, easy to run benchmark to compare machines -- but you 
may find it useful for your purposes.


[julia-users] Re: Benchmarking Julia

2016-09-27 Thread cormullion
Well the thing is that running a script from Cairo.jl/samples takes 10 seconds 
on my new iMac upgraded to Sierra and 2 seconds on my old one, which is too old 
to upgrade the OS to Sierra. I thought I'd try 'measuring' Julia on both the 
old iMac and the new one, to see if there was an overall degradation with the 
new OS. But it became a fractal problem of installation dependencies, so I've 
kind of given up. :)

[julia-users] Re: Benchmarking Julia

2016-09-27 Thread cormullion
Ah, yes. Strange. Thanks.

Trying to install it looks like it's not the simple solution I was looking for.

WARNING: The following packages do not have relocatable bottles, 
installation may fail!

sed: .git/GITHUB_HEADERS: No such file or directory

Xcode can be updated from the App Store.

I might try for something a bit simpler... :)


[julia-users] Re: Benchmarking Julia

2016-09-27 Thread cormullion
Thanks! How do I get hold of it:

julia> Pkg.add("BaseBenchmarks")
ERROR: unknown package BaseBenchmarks
 in macro expansion at ./pkg/entry.jl:53 [inlined]
 in (::Base.Pkg.Entry.##2#5{String,Base.Pkg.Types.VersionSet})() at 
./task.jl:360
 in sync_end() at ./task.jl:311
 in macro expansion at ./task.jl:327 [inlined]


[julia-users] Benchmarking Julia

2016-09-27 Thread cormullion
I've become convinced that upgrading my Mac to the latest OS (Sierra) has 
slowed down Julia in some areas. (One test showed a fourfold speed 
reduction compared with the same test running on the last release.) But to 
get some real-world numbers and eliminate some obvious explanations I'm 
looking for something simple to install that measures general Julia 
performance on a particular processor, compared only with itself (not 
compared with Octave or C, for example). 

Is there a ready-made suite of benchmarks that can be easily run on 0.4.7 
and 0.5 that gives a score I can use to compare with other computers 
running Julia?



[julia-users] Want to contribute to Julia

2016-09-12 Thread cormullion
If you're still in learning_julia mode, you could help out by checking the 
Julia wikibook (https://en.wikibooks.org/wiki/Introducing_Julia) for 0.5 
compatibility. I've been through it once to update some of the more obvious 
changes and deprecations —  but "you gotta catch em all", as they say!

[julia-users] Want to contribute to Julia

2016-09-12 Thread cormullion
If you're still in learning_julia mode, you could help out by checking the 
Julia wikibook (https://en.wikibooks.org/wiki/Introducing_Julia) for 0.5 
compatibility. I've been through it once to update some of the more obvious 
changes and deprecations —  but "you gotta catch em all", as they say!

[julia-users] Re: Maps in Julia?

2016-09-11 Thread cormullion
@Kaj Cool, I didn't know anyone was using Luxor.jl — perhaps I shouldn't have 
made so many changes recently... :)

[julia-users] Julia implementation

2016-05-24 Thread cormullion
Click on the colored bar on the main page: https://github.com/JuliaLang/julia

The current percentage is 66.5% Julia. 2//3...

There's some plumbing in C, and the parsing's in Scheme. 

[julia-users] "A Taste of Julia" - Didier Verna - ACCU 2016 - youtube

2016-05-24 Thread cormullion
A presentation  introducing Julia from a Lisp 
perspective:

https://youtu.be/8m11sbfegoY


[julia-users] Re: Julia text editor on iPad?

2016-05-11 Thread cormullion
Textastic can use TextMate 
definitions: 
http://www.textasticapp.com/v6/manual/lessons/How_can_I_add_my_own_syntax_definitions__themes_and_templates.html

Koder, another main contender, doesn't let you add syntax highlighting yet.


[julia-users] Image not saving

2016-04-28 Thread cormullion
When I plotted a Julia set, I used this:

array = Array{UInt8}(size, size, 3)
imOutput = Images.colorim(array)


then for each pixel

imOutput.data[x, y, :] = [r, g, b]

then to output:

FileIO.save(filename, imOutput)



[julia-users] Re: macros design

2016-04-20 Thread cormullion
https://github.com/JuliaLang/julia/blob/3c354b4a391307d84915445bdd6fb464371f30fc/doc/at_macro_reasons

[julia-users] Re: Change bold text in REPL to normal

2016-04-20 Thread cormullion
Thanks, useful info. Although, I don't mind the colors. It's the forced 
bolding that looks so bad... :(
>
>

Re: [julia-users] Googling the functions I need in Julia is hard

2016-02-14 Thread cormullion
On Saturday, February 13, 2016 at 1:02:50 PM UTC, Stefan Karpinski wrote:
>
> Improvements are welcomed.


Hey Stefan. Here's my suggestion:

Until the Grand Overarching Documentation system is available, you could do 
worse than a custom Google search engine. This lets you add a few selected 
sites to index, and you don't therefore have to qualify the search with 
"julia" or "julialang" all the time. (Thus you won't have to keep visiting 
the pages of Julia Lang or seeing fractals all the time...)

I'm not a big fan of the Google, but it doesn't work too bad and I can't 
see too many downsides with having something like this on the main Julia 
site for now.

Here's a quick demo I mocked up. I'm sure someone could do something more 
impressive with the Google Search Engine API 
(https://developers.google.com/custom-search/docs/overview). 




It's currently at http://steampiano.net/julia-search/index.html.



Re: [julia-users] readall() from osascript process (MacOS X)?

2016-02-04 Thread cormullion
Thanks!

Re: [julia-users] readall() from osascript process (MacOS X)?

2016-02-04 Thread cormullion
Yay, it all works, thanks again. BTW, it's for this hacky script that I use 
when editing text files — it pads out the second part of each line starting at 
a particular character so that all the lines are vertically aligned on that 
character (probably much easier in other editors...).

 function readwrite()
 userinput = readall(`osascript -e "display dialog \"Align on\" default 
answer \"#\""`)
 chr = chomp(last(split(userinput, ':')))
 widest = 1
 # read all input into array
 buffer = []
 while !eof(STDIN)
 line = chomp(readline(STDIN))
 chrpos = contains(line, chr)
 if chrpos
 if searchindex(line, chr) > widest
 widest = searchindex(line, chr)
 end
 end
 push!(buffer, line)
 end

 for line in buffer
 chrpos = contains(line, chr)
 if chrpos && (line != "")
 # chop line in two
 chrpos = searchindex(line, chr)
 firsthalf = line[1:chrpos-1]
 secondhalf = line[chrpos:end]
 newline = rpad(firsthalf, widest, " ") * secondhalf
 println(newline)
 else
 # don't bother
 println(line)
 end
 end
 end



[julia-users] readall() from osascript process (MacOS X)?

2016-02-03 Thread cormullion
I'd like to get some information from running the `osascript` command on 
MacOS X, For example:

julia> run(`osascript -e "display dialog \"Character\" default answer 
\"#\""`)
button returned:OK, text returned:#

julia> typeof(ans)
Void

I tried to use `readall` to read the result that's printed/returned, but no 
luck.

julia> readall(run(`osascript -e "display dialog \"Character\" default 
answer \"#\""`))
button returned:OK, text returned:#
ERROR: MethodError: `readall` has no method matching readall(::Void)

Anyone know of a trick to get information back from this process?



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

2016-01-26 Thread cormullion
After some success with an external function definition, I had a go at a PR. 
Using github isn't my favourite computer-based activity, but let's see how it 
goes.

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

2016-01-26 Thread cormullion
@tshort - Thanks, that's what I forgot... ! It works fine, I'll see about 
making a pull request. (The thing about Cairo and Cairo.jl is — once you get it 
installed and working, you don't want to mess with it... :))

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

2016-01-25 Thread cormullion
I'd like to open a pull request, but I wouldn't know exactly what to put in 
it... :) I was wondering whether I could test the syntax of such a new function 
first, without actually adding it to the Cairo module. It. It might not be 
possible, of course...

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

2016-01-25 Thread cormullion
I noticed that Cairo offers a function called `cairo_paint_with_alpha`, 
that accompanies `cairo_paint`, 
(http://cairographics.org/manual/cairo-cairo-t.html#cairo-paint).

At present Julia's Cairo.jl doesn't seem to have this defined. Is it 
possible to test it out by defining it using `ccall`, but without adding it 
to Cairo.jl? I was thinking something like:

using Cairo

function paint_with_alpha(ctx::CairoContext, a = 0.5)
ccall((:cairo_paint_with_alpha, _jl_libcairo), Ptr{Void},
(Ptr{Void}, Float64),
ctx.ptr, a)  
end

which doesn't work, obviously, cos I'm just guessing at the syntax...

If it works, it could be added to a pull request.



[julia-users] Ambiguous methods warnings for DataFrames and Images

2016-01-21 Thread cormullion
Just wondering if there's a solution in the future for this trivial but mildly 
irritating problem:

julia> using DataFrames, Images
WARNING: New definition
.+(Images.AbstractImageDirect, AbstractArray) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:22
is ambiguous with:
.+(AbstractArray, Union{DataArrays.PooledDataArray, 
DataArrays.DataArray}, AbstractArray...) at 
/Users/me/.julia/v0.4/DataArrays/src/broadcast.jl:297.
To fix, define
.+(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, 
DataArrays.DataArray})
before the new definition.

and so on for 150 lines. It's not a major problem, of course (I just ignore 
it). But I'm curious as to what the fix will be. 

Re: [julia-users] reshape() and shared data

2016-01-08 Thread cormullion
Thanks for the explanation, Tim! Seems a bit odd, but if everybody's happy 
with it, that's cool. :)


Re: [julia-users] reshape() and shared data

2016-01-08 Thread cormullion
I was thinking more that the lack of an exclamation after 'reshape' makes you 
think that the array is unchanged, whereas it has changed, since you can no 
longer push to it as before. But it's more a problem for my understanding than 
anything else... :)

[julia-users] Re: Survey: what documentation platforms do you use? Are you happy?

2015-12-21 Thread cormullion
In the future, perhaps all Julia documentation, both for Base and for 
registered packages, will be in a central location, indexed and 
cross-linked (like Matlab, Mathematica, SciPy, only even better...) Perhaps 
written in a single documentation system written in Julia. I'm looking 
forward to helping out.


Re: [julia-users] The sound of clashing symbols

2015-12-20 Thread cormullion
Thanks Jeff. 

It would be cool if you could say somewhere that the default (unqualified) 
function call always uses A, but that you can sometimes use a qualified 
version (B). One day, perhaps... :)


[julia-users] The sound of clashing symbols

2015-12-19 Thread cormullion
Sorry for this basic question, but I've got myself confused...

Suppose I use 2 modules, A and B. Both modules export a function, let's say 
it's `save()`. Julia warns me that the symbols clash. I don't want to have to 
use the module name to qualify every function imported from A and B (after 
`import` not `using`). I'd like to just have, say `B.save()` and `save()` 
(which uses the A version), and use the non-clashing symbols without qualifying 
them. 

it seems that I have to modify all the local code whenever modules A or B 
decide to export a new symbol... You'd have to use `import` and qualify every 
imported symbol when using it to be guaranteed safe against changes to imported 
packages...?

Re: [julia-users] Proposal: NoveltyColors.jl

2015-12-02 Thread cormullion
I'm using [ColorSchemes.jl](https://github.com/cormullion/ColorSchemes.jl) for 
my own purposes, but I'm happy to rename it if someone else wants the name.

[julia-users] Re: Proposal: NoveltyColors.jl

2015-11-25 Thread cormullion
Nice idea. I confess I'm slightly not too keen on the word "Novelty" - 
reminds me of cheap Christmas presents... :)  You could consider making the 
package a bit more general...  For my purposes I've been using a small bit 
of code that extracts a selection of colors from images to make a palette. 
Basically, it's this:

using Images, Colors, Clustering

function dominant_colors(img, n=10, i=10, tolerance=0.01; resize = 1)
w, h = size(img)
neww = round(Int, w/resize)
newh = round(Int, w/resize)
smaller_image = Images.imresize(img, (neww, newh))
imdata = convert(Array{Float64}, 
raw(separate(smaller_image).data))/256
w, h, nchannels = size(imdata)
d = transpose(reshape(imdata, w*h, nchannels))
R = kmeans(d, n, maxiter=i, tol=tolerance)
cols = RGB{Float64}[]
for i in 1:nchannels:length(R.centers)
push!(cols, RGB(R.centers[i], R.centers[i+1], R.centers[i+2]))
end
return cols, R.cweights/sum(R.cweights)
end

sorted_palette, wts = 
dominant_colors(imread("/tmp/van-gogh-starry-sky.png"), 10, 40, resize=3)

which gives a selection of colors from the image (with weights if needed). 
An interesting feature of this is that the results always vary slightly 
each time - sometimes I stack them to see the differences:








[julia-users] Re: Update to latest Cairo?

2015-11-11 Thread cormullion
Cheers Tony. Will await developments with interest.

On Wednesday, November 11, 2015 at 5:45:08 PM UTC, Tony Kelman wrote:
>
> I think Elliot Saba (@staticfloat on github) is working on this, see 
> https://github.com/staticfloat/homebrew-juliadeps/issues/84 and 
> https://github.com/staticfloat/homebrew-juliadeps/commits/staging - he's 
> been updating most things to the latest upstream versions from what I can 
> see.
>
>
> On Wednesday, November 11, 2015 at 9:01:52 AM UTC-8, cormu...@mac.com 
> wrote:
>>
>> I'm still struggling with Cairo text-rendering bugs, but I noticed that 
>> there's a new version of Cairo that's been released (
>> http://cairographics.org/news/cairo-1.14.4/), which may have fixed them. 
>> Presumably this doesn't need any change to Cairo.jl?
>>
>> How would I install this? I don't think I use homebrew (outside Julia) 
>> because that creates problems with dual installations — Julia manages its 
>> own version of Homebrew?
>>
>>
>>
>>

[julia-users] Update to latest Cairo?

2015-11-11 Thread cormullion
I'm still struggling with Cairo text-rendering bugs, but I noticed that 
there's a new version of Cairo that's been released (
http://cairographics.org/news/cairo-1.14.4/), which may have fixed them. 
Presumably this doesn't need any change to Cairo.jl?

How would I install this? I don't think I use homebrew (outside Julia) 
because that creates problems with dual installations — Julia manages its 
own version of Homebrew?





[julia-users] Re: Chi square test in Julia?

2015-11-10 Thread cormullion
Try a matrix?

Re: [julia-users] Github wiki permission

2015-11-07 Thread cormullion
Github is a black box to me, I don't know how the ne'er-do-wells get access 
to the JuliaGraphics organization...

These 'deposits':

   https://github.com/JuliaGraphics/Immerse.jl/pulse

aren't real PRs, since they 404. Just some Github loophole, I suppose.



Re: [julia-users] Github wiki permission

2015-11-06 Thread cormullion
issues and PRs too

https://github.com/JuliaGraphics/Colors.jl/pulse


[julia-users] Github wiki permission

2015-11-06 Thread cormullion
The wiki on 
[https://github.com/JuliaGraphics/Colors.jl](https://github.com/JuliaGraphics/Colors.jl/wiki)
 
is being spammed today. The github documentation says:

"By default, every user can make changes to public wikis, but you can 
configure this to be enabled only for collaborators on your repository."

This would probably be a good idea?



Re: [julia-users] Github wiki permission

2015-11-06 Thread cormullion
Looks like every wiki in JuliaGraphics is now being spammed. Needs somebody 
with some minor superpowers to change the permissions... :)

[julia-users] Re: Creating variables programmatically

2015-11-03 Thread cormullion
Hi Patrick. I'm never sure about things like this, but it seemed like a 
good approach to investigate. I want to load 20 or so images from disk and 
access them using predictable names.

On Tuesday, November 3, 2015 at 2:05:45 PM UTC, Patrick Kofod Mogensen 
wrote:
>
> I know this does _not_ answer your question, but are you really sure you 
> want to do this? Can't you just push your variables to an array, and access 
> them as x[1], x[2], ... ?
>


Re: [julia-users] Creating variables programmatically

2015-11-03 Thread cormullion
Thanks! Looks like a solution.

On Tuesday, November 3, 2015 at 2:10:09 PM UTC, Yichao Yu wrote:
>
> On Tue, Nov 3, 2015 at 8:40 AM,   wrote: 
> > I can't work out the syntax for creating symbols and assigning values to 
> the 
> > variables in a loop. Here's a simple example: 
>
> You can only do this in global scope and you need to do this with 
> `eval`. (Since you are basically creating an expression at runtime to 
> execute). 
>
>

[julia-users] Creating variables programmatically

2015-11-03 Thread cormullion
I can't work out the syntax for creating symbols and assigning values to 
the variables in a loop. Here's a simple example:

Starting with this basic idea:

julia> for n in 1:10
 println("x_$(n)")
  end

I'd like to do this:

julia> for n in 1:10
symbol("x_$(n)") = n
  end
   ERROR: syntax: "(string # n)" is not a valid function 
argument name

to create variables called x_1, x_2, and assign numeric values to them... 
 (Numbers in this example, but will be image data eventually.)

Also, for better formatting for variable names:

julia> "x_$(@sprintf "%03d" 2)"
"x_002"

but this gives a similar error when used with symbol():

julia> for n in 1:10
 symbol("x_$(@sprintf "%03d" 2)") = n
end

ERROR: syntax: "(string # (let (block (= #21#out (call (. 
#0=# (inert IOBuffer (= #22###x#6979 2) (local 
#27#neg #26#pt #25#len #20#exp #23#do_out #24#args) (if (call (. #0# (inert 
isfinite)) #22###x#6979) (block (= (tuple
   #23#do_out #24#args) (call (. #0# (inert decode_dec)) #21#out 
#22###x#6979 # 2 -1 #)) (if #23#do_out 
(block (= (tuple #25#len #26#pt #27#neg) #24#args) (&& #27#neg (call (. #0# 
(inert write)) #21#out #)) (&& (comparison (call (. #0# (inert -)) (call (. #0# 
(inert -)) 2 #27#neg) #26#pt) (. #0# (inert >)) 0) (call (. #0# (inert 
write)) #21#out #)) (call (. #0# (inert write)) 
#21#out (call (. #0# (inert pointer)) (. #0# (inert DIGITS)))
   #26#pt (call (. #0# (inert write)) #21#out (block (line 145 
printf.jl) (if (call (. #0# (inert isnan)) #22###x#6979) # 
(if (comparison #22###x#6979 (. #0# (inert <)) 0) # #) (. #0# (inert nothing)) (call (. #0# (inert takebuf_string))
  #21#out" is not a valid function argument name

Perhaps `symbol` isn't what I want here?



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

2015-10-24 Thread cormullion
Perhaps

first(sort(map(f -> (realpath(f), unix2datetime(stat(f).mtime)), 
readdir()), by = t -> last(t), rev=true))

would do if there's no better way.


Re: [julia-users] Re: Everything I wrote in version .3 is now 'depreciated'

2015-10-17 Thread cormullion
It might also be worth looking at using Lint.jl.

[julia-users] Re: Help wanted - does Cairo.jl work for everyone else except me?

2015-10-11 Thread cormullion
Thanks for that. I also reproduced the bug on MacOS 10.10 Yosemite. So I 
don't think it's the Mac version.

On Saturday, October 10, 2015 at 6:37:38 PM UTC+1, Andreas Lobinger wrote:
>
> I attached a question to the libcairo mailing list:
> http://lists.cairographics.org/archives/cairo/2015-October/026503.html
>
>

Re: [julia-users] Help wanted - does Cairo.jl work for everyone else except me?

2015-10-10 Thread cormullion
Yup, that's a fail. I'm glad I'm not the only one. What systems are you 
running?

On Saturday, October 10, 2015 at 5:48:03 PM UTC+1, Rob J Goedman wrote:
>
>
> Hi, this is what I get. Looks pretty much like your description.
>
>
> Regards,
> Rob
>
> On Oct 10, 2015, at 9:18 AM, cormu...@mac.com  wrote:
>
> I'm trying to find out why Cairo.jl/text_path() doesn't work for me, but 
> seems to work for others. If you have Cairo.jl installed, could you run the 
> sample_text.jl test file:
>
> $ julia ~/.julia/v0.4/Cairo/samples/sample_text.jl
>
> There are lots of deprecations, but — the output file is called 
> sample_text.png (probably created in your current directory) — if the test 
> is successful, you'll see the words "Hello" and "Void". But on my system 
> (MacOS X El Capitan, Julia v0.4.0 (2015-10-08 06:20 UTC) freshly installed) 
> I only see "Hello", plus a bunch of collapsed glyphs, because text_path() 
> doesn't work for me. I'd really like to know whether anyone else shares 
> this problem or whether it's just me. :)
>
>
>

[julia-users] Help wanted - does Cairo.jl work for everyone else except me?

2015-10-10 Thread cormullion
I'm trying to find out why Cairo.jl/text_path() doesn't work for me, but 
seems to work for others. If you have Cairo.jl installed, could you run the 
sample_text.jl test file:

$ julia ~/.julia/v0.4/Cairo/samples/sample_text.jl

There are lots of deprecations, but — the output file is called 
sample_text.png (probably created in your current directory) — if the test 
is successful, you'll see the words "Hello" and "Void". But on my system 
(MacOS X El Capitan, Julia v0.4.0 (2015-10-08 06:20 UTC) freshly installed) 
I only see "Hello", plus a bunch of collapsed glyphs, because text_path() 
doesn't work for me. I'd really like to know whether anyone else shares 
this problem or whether it's just me. :)



[julia-users] Re: Ambiguous methods warning method

2015-10-07 Thread cormullion
Oops, thanks. It's even more "fairly well known" now. :)

[julia-users] Ambiguous methods warning method

2015-10-07 Thread cormullion
Assuming this is the correct behavior, is there a way to get a better user 
experience:

   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-rc4 (2015-10-04 03:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/   |  x86_64-apple-darwin13.4.0

julia> using Colors, Images, Gadfly
WARNING: New definition
-(DataArrays.DataArray, AbstractArray) at 
/Users/me/.julia/v0.4/DataArrays/src/operators.jl:326
is ambiguous with:
-(AbstractArray, Images.AbstractImageDirect) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:37.
To fix, define
-(DataArrays.DataArray, Images.AbstractImageDirect)
before the new definition.
WARNING: New definition
-(AbstractArray, DataArrays.DataArray) at 
/Users/me/.julia/v0.4/DataArrays/src/operators.jl:326
is ambiguous with:
-(Images.AbstractImageDirect, AbstractArray) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:35.
To fix, define
-(Images.AbstractImageDirect, DataArrays.DataArray)
before the new definition.
WARNING: New definition
-(DataArrays.AbstractDataArray, AbstractArray) at 
/Users/me/.julia/v0.4/DataArrays/src/operators.jl:349
is ambiguous with:
-(AbstractArray, Images.AbstractImageDirect) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:37.
To fix, define
-(DataArrays.AbstractDataArray, Images.AbstractImageDirect)
before the new definition.
WARNING: New definition
-(AbstractArray, DataArrays.AbstractDataArray) at 
/Users/me/.julia/v0.4/DataArrays/src/operators.jl:349
is ambiguous with:
-(Images.AbstractImageDirect, AbstractArray) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:35.
To fix, define
-(Images.AbstractImageDirect, DataArrays.AbstractDataArray)
before the new definition.
WARNING: New definition
.==(AbstractArray{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, 
N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}}) at 
/Users/me/.julia/v0.4/DataArrays/src/broadcast.jl:317
is ambiguous with:
.==(Images.AbstractImageDirect{Bool, N<:Any}, AbstractArray{Bool, 
N<:Any}) at /Users/me/.julia/v0.4/Images/src/algorithms.jl:133.
To fix, define
.==(Images.AbstractImageDirect{Bool, N<:Any}, 
Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, 
R<:Integer, N<:Any}})
before the new definition.
WARNING: New definition
.==(AbstractArray, Union{DataArrays.DataArray, 
DataArrays.PooledDataArray}) at 
/Users/me/.julia/v0.4/DataArrays/src/broadcast.jl:272
is ambiguous with:
.==(Images.AbstractImageDirect{Bool, N<:Any}, AbstractArray{Bool, 
N<:Any}) at /Users/me/.julia/v0.4/Images/src/algorithms.jl:133.
To fix, define
.==(Images.AbstractImageDirect{Bool, N<:Any}, 
Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, 
R<:Integer, N<:Any}})
before the new definition.
WARNING: New definition
.==(AbstractArray, Union{DataArrays.DataArray, 
DataArrays.PooledDataArray}) at 
/Users/me/.julia/v0.4/DataArrays/src/broadcast.jl:272
is ambiguous with:
.==(Images.AbstractImageDirect, AbstractArray) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:134.
To fix, define
.==(Images.AbstractImageDirect, Union{DataArrays.DataArray, 
DataArrays.PooledDataArray})
before the new definition.
WARNING: New definition
+(AbstractArray, DataArrays.DataArray) at 
/Users/me/.julia/v0.4/DataArrays/src/operators.jl:326
is ambiguous with:
+(Images.AbstractImageDirect, AbstractArray) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:18.
To fix, define
+(Images.AbstractImageDirect, DataArrays.DataArray)
before the new definition.
WARNING: New definition
+(AbstractArray, DataArrays.AbstractDataArray) at 
/Users/me/.julia/v0.4/DataArrays/src/operators.jl:349
is ambiguous with:
+(Images.AbstractImageDirect, AbstractArray) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:18.
To fix, define
+(Images.AbstractImageDirect, DataArrays.AbstractDataArray)
before the new definition.
WARNING: New definition
.*(Union{DataArrays.DataArray, DataArrays.PooledDataArray}, 
AbstractArray...) at /Users/me/.julia/v0.4/DataArrays/src/broadcast.jl:282
is ambiguous with:
.*(AbstractArray, Images.AbstractImageDirect) at 
/Users/me/.julia/v0.4/Images/src/algorithms.jl:52.
To fix, define
.*(Union{DataArrays.DataArray, DataArrays.PooledDataArray}, 
Images.AbstractImageDirect)
before the new definition.
WARNING: New definition
.*(AbstractArray, Union{DataArrays.DataArray, 
DataArrays.PooledDataArray}, AbstractArray...) at 
/Users/me/.julia/v0.4/DataArrays/src/broadcast.jl:282
is ambiguous with:

[julia-users] Re: issue with "plot"

2015-10-01 Thread cormullion
I got as far as this with Graphs. After installing GraphViz, you can do 
something like this:

using Graphs

g = simple_graph(3)
add_edge!(g, 1, 2)
add_edge!(g, 3, 2)
add_edge!(g, 3, 1)

f = open("/tmp/simple_graph.dot", "w")

to_dot(g, f)

close(f)

run(`/usr/local/bin/dot -Tpdf /tmp/simple_graph.dot 
-o/tmp/simple_graph.pdf`);

run(`open -a /Applications/Preview.app/ /tmp/simple_graph.pdf`)

which avoids this X11/XQuartz stuff.


[julia-users] Displaying images in Jupyter notebook

2015-09-29 Thread cormullion
I installed Jupyter and opened a new notebook. It works fine (Jupyter 
4.0.6, Julia 0.4.0-rc2). Now I want to start using Images.jl. So:

using Images
img = imread("/tmp/simple.png")

But I get this response:

UnableToOpenConfigureFile `coder.xml' @ 
warning/configure.c/GetConfigureOptions/706

 in error at 
/Applications/Julia-0.4.0.app/Contents/Resources/julia/lib/julia/sys.dylib
 in error at /Users/me/.julia/v0.4/Images/src/ioformats/libmagickwand.jl:146
 in setimageformat at 
/Users/me/.julia/v0.4/Images/src/ioformats/libmagickwand.jl:328
 in getblob at 
/Users/me/.julia/v0.4/Images/src/ioformats/libmagickwand.jl:208
 in writemime at /Users/me/.julia/v0.4/Images/src/io.jl:226
 in base64encode at base64.jl:160
 in display_dict at /Users/me/.julia/v0.4/IJulia/src/execute_request.jl:32


However, in a terminal these commands work fine:

julia> using Images

julia> img = imread("/tmp/simple.png")
RGB4 Images.Image with:
  data: 3000x2308 
Array{ColorTypes.RGB4{FixedPointNumbers.UfixedBase{UInt8,8}},2}
  properties:
imagedescription: 
spatialorder:  x y
pixelspacing:  1 1

Which suggests I have to configure something in Jupyter to connect 
something to something else, since ordinary Julia seems to be happy with 
the imagemagick stuff. 
I'd welcome some clues...

(I'm keen on trying Images.jl. But at the moment I can but glimpse its 
promised magnificence on the far horizon... :)
 


[julia-users] Re: Displaying images in Jupyter notebook

2015-09-29 Thread cormullion
thanks Steven. I looked again through Images' issues, and it might be related 
to this one: https://github.com/timholy/Images.jl/issues/237 . 

[julia-users] Re: Pango Font calls - guidance on coding with an eye to adding to Cairo.jl

2015-09-14 Thread cormullion
Drawing.jl looks more sophisticated -- I might switch to it myself :)  I 
suppose the experts use Cairo or Compose directly, so the focus of these type 
of packages should be on ease of use/simplicity...

Re: [julia-users] Find sequence in array?

2015-09-12 Thread cormullion
Hi Milan - thanks for the clues! I found `Base._searchindex`, which work 
for integers:

julia> a = rand(1:10, 100);

julia> Base._searchindex(a, [19272, 52257], 1)

   86

It's pretty quick, too.



[julia-users] Find sequence in array?

2015-09-11 Thread cormullion
Is there a Julia function/method to find the location(s) of a sequence of 
elements in a 1-D array?

With strings, you can do:

search("longstring", "str")

5:7

so with arrays it would hopefully be something like:

searcharray( [1, 3, 5, 7, 9, 11, 13], [5, 7, 9])

3:5





[julia-users] Re: Good, short set of slides introducing Julia

2015-09-09 Thread cormullion
google for Carlos Becker's Julia presentation -- nice looking short 
presentation comparing Julia with Matlab.

[julia-users] Re: The new Dict syntax in 0.4 is very verbose

2015-09-03 Thread cormullion
Early adopters shouldn't throw stones... :) But in fact I quite like the 
new Dict syntax, which seems to be more explicit and readable. Curly braces 
seem to be gainfully employed elsewhere doing type stuff. And experts can 
make short cuts, either in Julia or in their editors...

I confess I'm a bit puzzled by having to change `[1:10]` to `[1:10...]`, 
but then again, `collect(1:10)` is more explicit and readable. So I think 
it's progress.

I suppose, as a former user of The Programming Language Formerly Known as 
Mathematica", I might be more grateful than others for a  less 
punctuation-heavy language syntax. Mathematica Wizards can fluently read 
and write code like this:

 lcm = Fold[#/#2/._~_~x_|_:>#x&,1,{##}]&

but I'm happy with a more readable approach.


[julia-users] Re: The new Dict syntax in 0.4 is very verbose

2015-09-03 Thread cormullion
"Why is [1:10...] a puzzle?"

Just that a new user might expect to see or use the ellipsis in its 
conventional position:

[1...10]

rather than at the end:

[1:10...]




Re: [julia-users] Help for 'mean' (version 0.4)

2015-09-01 Thread cormullion
You're right, Matt, my testing does odd things. (In version 0.3, `mean = 0` 
used to give a warning, it doesn't any more).

I'm pleased that you can get help on 0. A little disappointed that you 
can't get help on all the integers... :) 


[julia-users] Help for 'mean' (version 0.4)

2015-09-01 Thread cormullion
Using 0.4: 

help?> mean
search: mean mean! median median! SegmentationFault macroexpand 
module_parent Meta enumerate Enumerate timedwait primes mask 
remotecall remotecall_wait remotecall_fetch MethodTable

  0 (zero; BrE: /ˈzɪərəʊ/ or AmE: /ˈziːroʊ/) is both a number and the 
numerical digit used to represent that number in numerals. It fulfills a 
central role in 
  mathematics as the additive identity of the integers, real numbers, 
and many other algebraic structures. As a digit, 0 is used as a placeholder 
in 
  place value systems. Names for the number 0 in English include zero, 
nought or (US) naught (/ˈnɔːt/), nil, or — in contexts where at least one 
  adjacent digit distinguishes it from the letter "O" — oh or o 
(/ˈoʊ/). Informal or slang terms for zero include zilch and zip. Ought and 
aught (/ˈɔːt/), 
  as well as cipher, have also been used historically.

I like this, but was expecting information about the `mean` function... :)

I tried a few other words, but couldn't get their definitions. Disappointed 
not to find `zilch`:

Couldn't find zilch
Perhaps you meant zip

True enough.

Or perhaps this is just a nice Easter egg, rather than an interesting 
glitch in the software matrix...



Re: [julia-users] Always display all deprecation warnings (0.4)?

2015-08-30 Thread cormullion
Thanks Tim, that's useful (no more restarting). All I need now are these 
hooks https://github.com/JuliaLang/julia/issues/6445
 (https://github.com/JuliaLang/julia/issues/6445)!


[julia-users] Always display all deprecation warnings (0.4)?

2015-08-29 Thread cormullion
I'm trying to understand the changes in 0.4, and the deprecation warnings 
are very useful. But they only appear once or twice, then they stop. 

It would be really useful to be able to (for a while at least), see them 
all the time. Experimenting with different syntax at the moment means 
exit()ing and restarting, so as to see (and examine) the deprecation 
warnings again. I would rather be annoyed by seeing them all again than to 
forget the correct syntax merely because the terminal's been open for two 
weeks... :)

 Is there are flag for this? (julia --depwarn=yes) doesn't do it, I suppose 
'yes' means 'once or twice' here.)



[julia-users] Re: Set precision when printing to file

2015-06-18 Thread cormullion
You could use a type:

julia type Out
  n::Float64
   end

julia function Base.show(io::IO, n::Out)
   print(io, $(round(n.n, 2)))
   end
show (generic function with 83 methods)

then you can just use Out(x) whenever you want x rounded to 2 d.p.

julia for i in 0.7454539:1.5:5
   println(i is $i and displayed as $(Out(i)))
   end
i is 0.7454539 and displayed as 0.75
i is 2.24545392 and displayed as 2.25
i is 3.74545392 and displayed as 3.75   



[julia-users] code style: indentation?

2015-06-16 Thread cormullion
Hi!

In Contributing.md, it says:

4 spaces per indentation level, no tabs

so perhaps your use of 8 is the cause?


[julia-users] hex2num() query

2015-06-04 Thread cormullion
What's the logic behind the results from `hex2num()`:

julia hex2num(1)
1.0f-45

julia hex2num(2)
3.0f-45

julia hex2num(3)
4.0f-45

julia hex2num(A)
1.4f-44



Re: [julia-users] hex2num() query

2015-06-04 Thread cormullion
Ah, OK. Thanks. I now realise I'm looking for `parseint(..., 16)` ;)


[julia-users] Type produced by a comprehension

2015-05-13 Thread cormullion
Currently having a mental block about this here. Why does this code:

julia [(d,d) for d in 1.0:10.0]
10-element Array{(Float64,Float64),1}:
 (1.0,1.0)  
 (2.0,2.0)  
 (3.0,3.0)  
 (4.0,4.0)  
 (5.0,5.0)  
 (6.0,6.0)  
 (7.0,7.0)  
 (8.0,8.0)  
 (9.0,9.0)  
 (10.0,10.0)

produce an array of floats, but this less direct version:

julia x_vals = [d for d in 1.0:10.0]
10-element Array{Float64,1}:
  1.0
  2.0
  3.0
  4.0
  5.0
  6.0
  7.0
  8.0
  9.0
 10.0

julia [(d,d) for d in x_vals]
10-element Array{(Any,Any),1}:
 (1.0,1.0)  
 (2.0,2.0)  
 (3.0,3.0)  
 (4.0,4.0)  
 (5.0,5.0)  
 (6.0,6.0)  
 (7.0,7.0)  
 (8.0,8.0)  
 (9.0,9.0)  
 (10.0,10.0)

produces an array of Any?


[julia-users] Re: Type produced by a comprehension

2015-05-13 Thread cormullion
Aha, yes of course. I lifted the code out of a function to inspect it more 
closely, and it all went downhill from there... :)

I can't say I really understand why there are type inference problems here, but 
I'm happy with the explanation.

Thanks!

[julia-users] Curious about bytes allocated message

2015-05-01 Thread cormullion
I noticed that one `@time` operation I ran reported thus:

elapsed time: 8648.482715526 seconds (1874163946136 bytes allocated, 13.23% 
gc time)

I've no problem with that, but I'm wondering how Julia can say it's allocated 
that many bytes... I don't I've got that many bytes to spare - and my computer 
hasn't crashed (like it used to when Mathematica took all the memory ... :)). 

So I'm assuming I'm wrong in my naive assumption that the message says that 
Julia is taking that much memory for itself all in one lump. Does bytes 
allocated mean something other than that?



Re: [julia-users] Is the official name of the language Julia or julia?

2015-04-13 Thread cormullion
About that font:

Twitter discussion with Muthu Nedumaran:
https://twitter.com/typographica/status/572304422610452480

FontsInUse entry: 
http://fontsinuse.com/typefaces/38527/mn-latin



Re: [julia-users] Is the official name of the language Julia or julia?

2015-04-13 Thread cormullion
The only remaining question is the significance of the four colored circles in 
the logo... :) Where's a symbologist when you need one?

[julia-users] gadfly plot of array with single nonzero element

2015-03-20 Thread cormullion
You could insert this line:

a[a .==0] = 0.1

to tweak the zero values so that they plot...

Yes, not an elegant solution!

Re: [julia-users] parse() and line numbers

2015-03-18 Thread cormullion
Thanks, Isaiah. I see there's already an issue for this at 
https://github.com/jakebolewski/JuliaParser.jl/issues/4. 

[julia-users] parse() and line numbers

2015-03-17 Thread cormullion
Is there a way to prevent the generation of line numbers:

julia jt = for i in 1:10
   println(i)
   end
   
for i in 1:10\nprintln(i)\nend\n

julia parse(jt)
:(for i = 1:10 # line 2:   
println(i)
end)

julia 

or of retaining any comments that were in the string:

julia jt = for i in 1:10
 # printing now   -—
 println(i)
   end
   
 julia parse(jt) ...

cheers



Re: [julia-users] See full output in REPL?

2015-03-03 Thread cormullion

Thanks, it works! Although a global/persistent setting would be better... :)


Re: [julia-users] See full output in REPL?

2015-03-03 Thread cormullion
Perhaps automatically switching to a 'less'- type of output after a certain 
threshold is reached could be possible one day. Typing showall before every 
command isn't ideal.

[julia-users] Re: Gadfly legend for different layers

2015-02-27 Thread cormullion
Guide?

Guide.manual_color_key(Key Title, [Thing One, Thing Two], 
[color(red), color(green)]),



[julia-users] Introducing Julia wikibook

2015-02-12 Thread cormullion
Ah, this is just my personal preferred way to learn Julia — I'm surprised 
Google managed to track it down for searches...

[julia-users] Gadfly: Text labels rather than numbers along x-axis of plot?

2015-02-04 Thread cormullion
Given this simple graph:

plot(x=1:12,y=rand(5), Guide.xticks(ticks=[1:12]))

where the 12 values correspond to the months January through December.

Instead of seeing 1 ..12 along the x-axis, I'd like to see the month names. 
Is this possible?


[julia-users] Re: Gadfly: Text labels rather than numbers along x-axis of plot?

2015-02-04 Thread cormullion
Thanks! Scale.x_discrete was the clue I needed. And I didn't realise you 
could use dates directly...



[julia-users] Re: Google Summer of Code: Your Project Suggestions

2015-01-20 Thread cormullion
JuliaGraphics https://github.com/juliagraphics,  Geometry2D 
https://github.com/mroughan/Geometry2D.jl, etc. would be attractive to 
graphics-oriented programmers...


[julia-users] I made my Christmas presents with Julia

2014-12-27 Thread cormullion
I used Julia to make my Christmas presents this year. It's not very 
impressive code (my code never is), but it works, and the end results were 
well received.

https://github.com/cormullion/spiral-moon-calendar.jl

Happy New Year!




Re: [julia-users] I made my Christmas presents with Julia

2014-12-27 Thread cormullion
Thanks, and help yourself! (Results not guaranteed for use in lycanthropic 
research applications.) And my bad Julia code looks better than my bad 
Mathematica code... :)

On Saturday, December 27, 2014 3:38:35 PM UTC, Mike Innes wrote:

 Who cares how impressive the code is when the result looks that good? ;)

 This is really nice and I might have to print a copy for myself, if that's 
 alright with you. Happy new year to you too!

 


[julia-users] Macros with multiple expressions - attempting to inject variable as each's first argument

2014-11-22 Thread cormullion
I hadn't thought of using macros —good idea. My approach to using Cairo was to 
create a module that calls Cairo functions but maintaining a current context, 
so I can write:

using EasyCairo, Color
newpng(1600, 1000)
background(color(black))
setopacity(0.7)
setcolor(0, 1, 0)
rect(0,0,256,256, fill)
setcolor(0, 1, 1)
setline(10.0)
move(0, 0)
line(256, 256)
move(256, 0)
line(0, 256)
stroke()
finishpng(/tmp/test.png)
run(`open /tmp/test.png`)

It's the lightest sprinkling of syntactic sugar...

[julia-users] Re: atan2 ?

2014-11-08 Thread cormullion
I think the other main exception is Mathematica's ArcTan(x,y)...


[julia-users] Cairo - PDF

2014-11-03 Thread cormullion
This is my Hello world for Cairo in Julia outputting to PNG:

using Cairo

imwidth = 200
imheight = 200

c = CairoRGBSurface(imwidth,imheight)
cr = CairoContext(c)

set_source_rgba(cr, 1, 0.7, 0.2, 0.9)
set_line_width(cr, 1)
circle(cr, 100, 100, 50)
stroke(cr)

select_font_face (cr, Helvetica, Cairo.FONT_SLANT_NORMAL, 
Cairo.FONT_WEIGHT_NORMAL)
set_font_size (cr, 12)
move_to(cr, 100,100)
show_text(cr,Hello world)

write_to_png(c,/tmp/helloworld.png)
run(`open /tmp/helloworld.png`)


But I prefer to output to PDF. I've got as far as finding this:

c = CairoPDFSurface(/tmp/helloworld.pdf, imwidth, imheight)


but there's isn't a write_to_pdf() function (obviously?). But I can't get 
any output.

Pkg.installed() gives:

 Cairo = v0.2.20

and I'm on version 0.3.0.




[julia-users] Re: Cairo - PDF

2014-11-03 Thread cormullion
Thanks Tobias! Your clue led me to the point in the source where it goes:

for name in (:finish,:flush,:mark_dirty) 

@eval begin

$name(surface::CairoSurface) = 
ccall(($(string(cairo_surface_,name)),_jl_libcairo),  

Void, (Ptr{Void},), surface.ptr)

end

end
 
and finish(surface) appears to work well:

c = CairoPDFSurface(/tmp/helloworld.pdf,imwidth,imheight)
cr = CairoContext(c)
...
...
finish(c)



On Monday, November 3, 2014 9:03:10 PM UTC, Tobias Knopp wrote:

 Maybe use the Julia wrapper for  cairo_surface_flush?

 Am Montag, 3. November 2014 17:27:23 UTC+1 schrieb cormu...@mac.com:

 This is my Hello world for Cairo in Julia outputting to PNG:

 using Cairo

 imwidth = 200
 imheight = 200

 c = CairoRGBSurface(imwidth,imheight)
 cr = CairoContext(c)

 set_source_rgba(cr, 1, 0.7, 0.2, 0.9)
 set_line_width(cr, 1)
 circle(cr, 100, 100, 50)
 stroke(cr)

 select_font_face (cr, Helvetica, Cairo.FONT_SLANT_NORMAL, 
 Cairo.FONT_WEIGHT_NORMAL)
 set_font_size (cr, 12)
 move_to(cr, 100,100)
 show_text(cr,Hello world)

 write_to_png(c,/tmp/helloworld.png)
 run(`open /tmp/helloworld.png`)


 But I prefer to output to PDF. I've got as far as finding this:

 c = CairoPDFSurface(/tmp/helloworld.pdf, imwidth, imheight)


 but there's isn't a write_to_pdf() function (obviously?). But I can't get 
 any output.

 Pkg.installed() gives:

  Cairo = v0.2.20

 and I'm on version 0.3.0.




[julia-users] Loading data just once

2014-10-09 Thread cormullion
A beginner's question...

I'm writing a function that wants to load a set of data from a file, 
depending on an argument passed to the function (so a different argument 
requires a different set of data to be loaded). I'd like each set of data 
to be stored somehow in separate variables so that when the function is 
called again with the same argument, it doesn't have to load that 
particular data again (because it takes 5 seconds to load).

I'm not sure whether this requires the use of global variables? I looked 
through the documents (
http://julia.readthedocs.org/en/latest/search/?q=global) but didn't gain 
enlightenment. :)

I think I can test for the existence of a previously-defined variable using:

if !isdefined(symbol(string(dataset)))
   dataset = include($(dataset).jl)
end

but I'm not convinced this works correctly, because this creates a variable 
inside the function...



[julia-users] Re: Loading data just once

2014-10-09 Thread cormullion
Some good suggestions, thanks! I'll see how I get on with memo-izing things 
as well.


[julia-users] Re: WINSTON ERROR: StepRange not defined

2014-09-16 Thread cormullion
Even if you use the release version of 0.3, it still might not work. For 
example:


julia using Winston
ERROR: could not open file /Users/me/.julia/v0.3/Tk/src/../deps/deps.jl
in include at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include_from_node1 at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include_from_node1 at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:54
in include at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include_from_node1 at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in include_from_node1 at 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/lib/julia/sys.dylib
in reload_path at loading.jl:152
in _require at loading.jl:67
in require at loading.jl:51
while loading /Users/me/.julia/v0.3/Tk/src/Tk.jl, in expression starting on 
line 19
while loading /Users/me/.julia/v0.3/Winston/src/tk.jl, in expression 
starting on line 1
while loading /Users/me/.julia/v0.3/Winston/src/Winston.jl, in expression 
starting on line 2699


Earlier today, it kept on trying to launch the (uninstalled) X11 
application.

But I'm sure that this is not happening to everyone...

I'm thinking to delete the whole .julia directory and start from fresh... :(


[julia-users] Gadfly/pango critical error using Julia version 0.3

2014-09-12 Thread cormullion
Trying to create a Gadfly plot, I saw this message:
 

(process:8158): Pango-CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
  '/usr/local/Cellar/pango/1.36.5/etc/pango/pango.modules'
You should create this file by running:
  pango-querymodules  
'/usr/local/Cellar/pango/1.36.5/etc/pango/pango.modules'


It's nice that the message is suggesting a possible solution to the 
problem...

But what is this  

  pango-querymodules  
'/usr/local/Cellar/pango/1.36.5/etc/pango/pango.modules'

It doesn't work in a terminal, and doesn't work anywhere else.

julia using Gadfly
julia p = plot(x=rand(5,5), y=rand(5,5), Geom.point)
julia draw(PNG(myplot.png, 12cm, 6cm), p)

I had previously run Pkg.update() to update everything.





Re: [julia-users] Gadfly/pango critical error using Julia version 0.3

2014-09-12 Thread cormullion
On Friday, September 12, 2014 5:52:38 PM UTC+1, Elliot Saba wrote:

 How did you install pango?

I didn't/haven't - first I've heard of it. I thought it must have been 
installed along with Gadfly/Cairo whatever...  


Re: [julia-users] Gadfly/pango critical error using Julia version 0.3

2014-09-12 Thread cormullion

On Friday, September 12, 2014 6:08:47 PM UTC+1, cormu...@mac.com wrote:

 On Friday, September 12, 2014 5:52:38 PM UTC+1, Elliot Saba wrote:

 How did you install pango?

 I didn't/haven't - first I've heard of it. I thought it must have been 
 installed along with Gadfly/Cairo whatever...  


I should mention that this is a regression, rather than an *ab initio* failure. 
I've managed to make and output plots before, using v0.3, but something has 
broken at some point due to some update. (Or we can blame Apple... :)


Re: [julia-users] Gadfly/pango critical error using Julia version 0.3

2014-09-12 Thread cormullion
I'm on the latest MacOS release (Mavericks), on an iMac.

julia versioninfo()
Julia Version 0.3.0
Commit 7681878* (2014-08-20 20:43 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.3.0)
  CPU: Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3



[julia-users] Passing an expression to a macro

2014-09-09 Thread cormullion
Just puzzling over this simple problem I'm having while learning about 
macros. Here's an expression:

julia e = quote
   a = 2
   b  = 3
   end

quote  # none, line 2:
a = 2 # line 3:
b = 3
end


If I go through this simply, I'll get a crack at each element of the args 
array: 

 

julia for i in e.args
   println(the arg is , i)
   end

 

the arg is  # none, line 2:
the arg is a = 2
the arg is  # line 3:
the arg is b = 3


If I try to write a macro:
 

julia macro my(exp)
  for i in exp.args
  println(the arg is , eval(i))
  end
  end

and call it like this:
 

julia @my :e
the arg is begin  # none, line 2:
a = 2 # line 3:
b = 3
end


it does all the elements at once.

It's probably a simple thing, but I could do with a hint!

cheers



[julia-users] Re: Passing an expression to a macro

2014-09-09 Thread cormullion
Thanks to you both, I now see where I went wrong - I'm going to back up and 
try again in a lower gear... :)


Re: ANN: python-markdown2 -- another Python implementation of Markdown

2007-11-06 Thread cormullion


On 6 Nov 2007, at 07:20, Trent Mick wrote:


On 11/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Thanks! Although there were other problems as well, after this one
went away. Not being a Python-eer, I'll leave it for now.


As of revision 85 markdown2.py should work with Python 2.3. Please let
me know if it fails for you.


Need to find it first - I can't see it on the [downloads tab](http:// 
code.google.com/p/python-markdown2/downloads/list)?


(Oops - I'm typing Markdown in Apple Mail... that might not be a good  
idea... ;-)  )

___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: ANN: python-markdown2 -- another Python implementation of Markdown

2007-11-06 Thread cormullion

On 6 Nov 2007, at 18:38, [EMAIL PROTECTED] wrote:



On 6 Nov 2007, at 07:20, Trent Mick wrote:


On 11/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Thanks! Although there were other problems as well, after this one
went away. Not being a Python-eer, I'll leave it for now.


As of revision 85 markdown2.py should work with Python 2.3. Please  
let

me know if it fails for you.


Need to find it first - I can't see it on the [downloads tab] 
(http://code.google.com/p/python-markdown2/downloads/list)?


(Oops - I'm typing Markdown in Apple Mail... that might not be a  
good idea... ;-)  )


Apparently this message has been deemed unacceptable for public  
deliver by someone called Richard Taytor.


Sorry to everyone about that.

Please acccept my apologies and my future absence from this list.


___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: ANN: python-markdown2 -- another Python implementation of Markdown

2007-11-05 Thread cormullion

On 5 Nov 2007, at 10:13, Jacob Rus wrote:


[EMAIL PROTECTED] wrote:

  for ch in '\\`*_{}[]()#+-.!')


Generator expressions were introduced in python 2.4 I believe.   
You'll want to add `[` and `]` on the inside of those parentheses,  
to make this a list comprehension instead, and things should then  
just work fine.


(so that means this bit will look like:

 for ch in '\\`*_{}[]()#+-.!'])

and there will additionally be another `[` after a `(` somewhere in  
the previous few lines.)


Thanks! Although there were other problems as well, after this one  
went away. Not being a Python-eer, I'll leave it for now.


___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: ANN: python-markdown2 -- another Python implementation of Markdown

2007-11-04 Thread cormullion

On 3 Nov 2007, at 00:12, Trent Mick wrote:


I'm announcing python-markdown2 -- another Python implementation of
Markdown. (MIT license.)


Hi Trent. Is it possible to run this from the BBEdit Unix Filters  
menu? I've just dropped it into the right folder, but running it on a  
text selection gives this:


Syntax error line 88. Invalid syntax:

  for ch in '\\`*_{}[]()#+-.!')


Have I done something wrong? (I just copied the code from Safari at  
http://python-markdown2.googlecode.com/svn/trunk/markdown2.py ...



___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


Re: ANN: python-markdown2 -- another Python implementation of Markdown

2007-11-04 Thread cormullion

On 4 Nov 2007, at 22:21, Trent Mick wrote:


Hi Trent. Is it possible to run this from the BBEdit Unix Filters
menu? I've just dropped it into the right folder, but running it on a
text selection gives this:

Syntax error line 88. Invalid syntax:

   for ch in '\\`*_{}[]()#+-.!')



I believe this is a case of markdown2.py not working with older
versions of Python. Do you know what version of Python BBEdit is using
here? (I don't use BBEdit so I'm not sure if it is using the system
Python or its own private build of Python.

I've started an issue for this:
  http://code.google.com/p/python-markdown2/issues/detail?id=4

If you could add your Python version as a comment on that issue, that
would be great. Following up via email if fine too, tho.


I don't know about BBEdit's privates, but the system version is  
presumably:


$ python -u
Python 2.3.5 (#1, Aug 19 2006, 21:31:42)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin

This is the standard Tiger install I expect.


___
Markdown-Discuss mailing list
Markdown-Discuss@six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


  1   2   >