Any hint on how to do this?:
type parms
r::Vector{Float64}
K::Vector{Float64}
end
r=rand(N)*(0.05-0.001)+0.001
K=rand(N)*100+1
p=Vector{parms}
p[1]=parms(r,K)
p[2]=parms(r,K)
etc
I get error:
no method setindex!(Type{Array{parms,1}}, parms, Int64)
while loading In[36], in
This line
p=Vector{parms}
seems like it’s not what you want. You want to create an object of that type,
not the type, I imagine.
To do that, try
parms[]
or
Array(parms, 0)
— Jon
On Jun 15, 2014, at 11:24 PM, Jon Norberg jon.norb...@ecology.su.se wrote:
p=Vector{parms}
When I'm working with time series data I often end up with things like this:
function lowpass(lp::Float64, input::Float64, g::Float64)
hp::Float64 = input - lp
lp += g * hp
[lp, hp]
end
s = 0.0;
data=[flatten([t, lowpass(s, sin(t), 0.5)]) for t in linspace(0,2pi,20)]
20-element
Depending on the number of samples in your actual problem this might not be
very performant (because ... is slow for large arrays) but here’s an
approach using vcat. I had to generate the data slightly differently from
you, because I had no function flatten.
julia data =
Thanks!
On Monday, June 16, 2014 8:26:11 AM UTC+2, John Myles White wrote:
This line
p=Vector{parms}
seems like it’s not what you want. You want to create an object of that
type, not the type, I imagine.
To do that, try
parms[]
or
Array(parms, 0)
— Jon
On Jun 15, 2014, at
I suspect it is easier to just pre-allocate an array of the correct
dimensions and then assign into it. Something like this:
function lowpassarray(arr::Vector{Float64})
out = Array(Float64, length(arr), 3)
s = 0.0
for i in 1:length(arr)
out[i, 1] = arr[i]
out[i, 2],
See also #964 https://github.com/JuliaLang/julia/issues/964
Ivar
kl. 11:48:47 UTC+2 mandag 16. juni 2014 skrev Cristóvão Duarte Sousa
følgende:
While I've been used to use threads (heavyweight ones) everywhere in my
projects, I'm starting to understand and really love the coroutines.
They
Thanks Ivar. I see the issue is under investigation.
On Mon, Jun 16, 2014 at 11:15 AM, Ivar Nesje iva...@gmail.com wrote:
See also #964 https://github.com/JuliaLang/julia/issues/964
Ivar
kl. 11:48:47 UTC+2 mandag 16. juni 2014 skrev Cristóvão Duarte Sousa
følgende:
While I've been used
Hey everyone -
Several posts had popped up over the past few month about creating a
centralized location for Julia content. I'm proud to announce
that http://www.juliabloggers.com/ is now live! This is still very much a
work-in-progress, as the theme is fairly vanilla and I need to work out
Thanks a lot, this is great!
Am Montag, 16. Juni 2014 13:17:47 UTC+2 schrieb Randy Zwitch:
Hey everyone -
Several posts had popped up over the past few month about creating a
centralized location for Julia content. I'm proud to announce that
http://www.juliabloggers.com/ is now live!
Nice!
I'm missing a feature: something to help me pull this into my RSS reader.
If it feels shady to re-publish an aggregated blog like this in RSS, at
least a list of the feeds that are currently pulled in would be nice, but
ultimately I'd like to add juliabloggers.com to my feedly and get
Thanks for putting this together, Randy. It's going to be really good to
have all these blogs together in one place finally.
On Mon, Jun 16, 2014 at 7:32 AM, Tomas Lycken tomas.lyc...@gmail.com
wrote:
Nice!
I'm missing a feature: something to help me pull this into my RSS reader.
If it
I have a random vector x = rand (10)
how to find the index of maximum but omitting to check any field eg not x [
5,7]
some like:
indmax y = (x [but not read [5,7]])
Paul
Nothing shady about it at all and a good reminder I need to add a visible
RSS icon.
Here's the feed:
http://www.juliabloggers.com/feed/
On Monday, June 16, 2014 7:32:49 AM UTC-4, Tomas Lycken wrote:
Nice!
I'm missing a feature: something to help me pull this into my RSS reader.
If it
Not an answer to your questions, but: you might want to keep an eye on (or
try out) this patch exposing labels and gotos at the user level. It was
developed by Daniel Jones for parser backend purposes, and might be useful
for a regex engine:
https://github.com/JuliaLang/julia/pull/5699
(I
In that case, it's ext4. Thanks for the RPM link, I'll try that if I can't
get the main repo to work.
On Sunday, June 15, 2014 5:39:43 AM UTC-4, Milan Bouchet-Valat wrote:
Le samedi 14 juin 2014 à 17:35 -0700, Jack Holland a écrit :
KDE, using bash.
KDE is your desktop environment, not
Looks great, Randy. Thanks for doing this.
— John
On Jun 16, 2014, at 5:52 AM, Randy Zwitch randy.zwi...@fuqua.duke.edu wrote:
Nothing shady about it at all and a good reminder I need to add a visible RSS
icon.
Here's the feed:
http://www.juliabloggers.com/feed/
On Monday, June
On Sunday, June 15, 2014 5:11:31 PM UTC-4, Kevin Squire wrote:
At one point while I was developing the OrderedDict class in
DataStructures.jl, I made it possible to sort it (and sorting regular
dictionaries returned an OrderedDict. It should be pretty easy to add that
functionality
On Sunday, June 15, 2014 6:23:00 PM UTC-4, Stefan Karpinski wrote:
Right, but for getting all the pairs in order, I don't think that ordering
them during insertion is helpful – it would be better to just sort them all
at once afterwards.
I think so too. Which is why I don't think a
Yep, I suspect that this approach is probably best:
d = Dict{String,Int}()
# count the words
a = [ (c,w) for (w,c) in d ]
sort!(a)
For very large data, this may take up too much memory, however. I'm not
sure if that's your situation. If your data is large enough to take up more
than half of
Dear all,
I thought you might find this paper
interesting: http://economics.sas.upenn.edu/~jesusfv/comparison_languages.pdf
It takes a standard model from macro economics and computes it's solution
with an identical algorithm in several languages. Julia is roughly 2.6
times slower than the
Maybe it would be good to verify the claim made at
https://github.com/jesusfv/Comparison-Programming-Languages-Economics/blob/master/RBC_Julia.jl#L9
I would think that specifying all those types wouldn’t matter much if the code
doesn’t have type-stability problems.
— John
On Jun 16, 2014, at
First, I agree with John that you don't have to declare the types in
general, like in a compiled language. It seems that Julia would be able to
infer the types of most variables in your codes.
There are several ways that your code's efficiency may be improved:
(1) You can use @inbounds to
I am trying to organize my current project so that I have a few separate
files/modules to keep things tidy, including a separate cli module for
invoking the program. But I am having some trouble bringing it all
together. The main of my project's layout is:
bin/
corpus
code/
Hi guys,
thanks for the comments. Notice that I'm not the author of this code [so
variable names are not on me :-) ] just tried to speed it up a bit. In
fact, declaring types before running the computation function and using
@inbounds made the code 24% faster than the benchmark version. here's my
On Sunday, June 15, 2014 9:33:32 PM UTC-4, Jacob Quinn wrote:
Yeah, I feel kind of torn on this on.
On the one hand, I've kind of grown used to the `is...` method naming
convention and it has nice discoverability properties (tab-completion) and
isn't generally too awkward (though double
We already have ifelse as the ternary function. If the function form has
different evaluation rules than the operator form, then it ought to have a
different name.
On Mon, Jun 16, 2014 at 12:34 PM, TR NS transf...@gmail.com wrote:
On Sunday, June 15, 2014 9:33:32 PM UTC-4, Jacob Quinn wrote:
That's an interesting comparison. Being on par with Java is quite
respectable. There's nothing really obvious to change with that code and it
definitely doesn't need so many type annotations – if the annotations do
improve the performance, it's possible that there's a type instability
somewhere
Made a modicum of progress. I am not sure why, but it stopped hanging, and
now I get a warning. replacing module Corpus and then an error that is
can't find Ngrams.
My `ngrams.jl` file starts out:
module Corpus
module Ngrams
And now I am pretty sure I totally don't understand how
`include` is like copy-pasting the code from the included file into the
spot where you called include.
You shouldn't have `module Corpus` in ngrams.jl.
-- Leah
On Mon, Jun 16, 2014 at 11:53 AM, TR NS transf...@gmail.com wrote:
Made a modicum of progress. I am not sure why, but it stopped
I think that the log in openlibm is slower than most system logs. On my
mac, if I use
mylog(x::Float64) = ccall((:log, libm), Float64, (Float64,), x)
the code runs 25 pct. faster. If I also use @inbounds and devectorise the
max(abs) it runs in 2.26 seconds on my machine. The C++ version with the
Hi all,
Just getting started with Julia and enjoying it greatly. I have been
working on porting some code from iPython notebooks to iJulia.
I am stumped moving this from Python though:
import requests
t =
Doing the math, that makes that optimized Julia version 18% slower than
C++, which is fast indeed.
On Mon, Jun 16, 2014 at 1:02 PM, Andreas Noack Jensen
andreasnoackjen...@gmail.com wrote:
I think that the log in openlibm is slower than most system logs. On my
mac, if I use
Great, thanks for the info on base/poll.jl
On Sunday, June 15, 2014 9:21:29 PM UTC-4, Jameson wrote:
It's is unclear what you are asking for.
The Julia Base library includes a high-performance, cross-platform
framework for responding to file change events on disk. (see base/poll.jl)
interesting!
just tried that - I defined mylog inside the computeTuned function
https://github.com/floswald/Comparison-Programming-Languages-Economics/blob/master/julia/floswald/model.jl#L193
but that actually slowed things down considerably. I'm on a mac as well,
but it seems that's not enough
Different systems have quite different libm implementations, both in terms
of speed and accuracy, which is why we have our own. It would be nice if we
could get our log to be faster.
On Mon, Jun 16, 2014 at 1:16 PM, Florian Oswald florian.osw...@gmail.com
wrote:
interesting!
just tried that -
On Monday, June 16, 2014 12:56:29 PM UTC-4, Leah Hanson wrote:
`include` is like copy-pasting the code from the included file into the
spot where you called include.
You shouldn't have `module Corpus` in ngrams.jl.
Thanks. That helps me understand include().
Unfortunately it doesn't seem
From the sound of it, one possibility is that you made it a private function
inside the computeTuned function. That creates the equivalent of an anonymous
function, which is slow. You need to make it a generic function (define it
outside computeTuned).
--Tim
On Monday, June 16, 2014 06:16:49
Here's an economics blog post that links to this study:
http://juliaeconomics.com/2014/06/15/why-i-started-a-blog-about-programming-julia-for-economics/
On Mon, Jun 16, 2014 at 1:30 PM, Tim Holy tim.h...@gmail.com wrote:
From the sound of it, one possibility is that you made it a private
On Monday, June 16, 2014 12:39:39 PM UTC-4, Stefan Karpinski wrote:
We already have ifelse as the ternary function. If the function form has
different evaluation rules than the operator form, then it ought to have a
different name.
Ok. I suppose it couldn't evaluate like the ternary
Could you post a gist with all the files? (https://gist.github.com/)
It would be easier to understand what's going on if I could see the whole
thing.
Have you tried switching the order of the imports? `cli.jl` won't be able
to see `ngrams.jl` if all of cli is included run first, before ngrams is
Good job on getting this going, need to figure out how to seperate out
Julia posts from my blog.
Could the theme be adjusted to point the source blog under the post title?
On Monday, June 16, 2014 11:05:02 AM UTC-4, John Myles White wrote:
Looks great, Randy. Thanks for doing this.
— John
a=rand(5,5)
how Delete row(s) or col(s) of array ?
Paul
No sugestion ?
Paul
W dniu poniedziałek, 16 czerwca 2014 14:06:23 UTC+2 użytkownik paul analyst
napisał:
I have a random vector x = rand (10)
how to find the index of maximum but omitting to check any field eg not x
[5,7]
some like:
indmax y = (x [but not read [5,7]])
Paul
You can see the project here:
https://github.com/openbohemians/corpus
But I've now changed the code to get it to work. I just had to throw the
`Corpus` module out the window and include `ngrams.jl` directly into
`cli.jl`. That works, but it doesn't get me anywhere with designing more
There's significantly less need for fine-grained modules in Julia. Is the
lack of submodules causing some kind of problem or just discomfort at their
absence?
On Mon, Jun 16, 2014 at 2:56 PM, TR NS transf...@gmail.com wrote:
You can see the project here:
I definitely plan on putting a more obvious attribution on the posts, I
just need to take a minute and refresh my PHP :)
I looked at your blog Iain, you're using Jekyll? For the dynamic platforms
like WordPress, every category and tag gets its own RSS feed. Not sure if
you need to custom build
There's no way to do that that I know of, but it might be possible (though
nontrivial) to implement functionality of that kind through a macro. Much
of the code in the Debug.jl package is dedicated to that kind of AST
analysis, though so far not exposed for other purposes.
deleting in place a matrix is not supported and does not make sense.
why is that?
you've for instance a 5x5 matrix and you want to delete an item.
deleteat! shifts subsequent items to fill the resulting gap, so you're
loosing dimensionality.
basically what you can do is this:
a =
Probably, it would be easier to simply write a loop
u = trues(length(x))
u[[5, 7]] = false
ir = 0
vr = -Inf
for i = 1:length(x)
if u[i] x[i] vr
ir = i
vr = x[i]
end
end
# ir would be what you want
If are your list of numbers are all positive, you can write this in a
Is there a way to handle signals such as SIGINT in Julia?
I'm not sure if it would help your case, but I did something similar for a
much simpler case. The result is kind of hideous but it works. I wanted to
expose a function called debug from the Lumberjack.jl logging package
as a macro, so function arguments would not be evaluated when the current
On Monday, June 16, 2014 3:07:36 PM UTC-4, Stefan Karpinski wrote:
There's significantly less need for fine-grained modules in Julia. Is the
lack of submodules causing some kind of problem or just discomfort at their
absence?
Is there? I always appreciated code that broke things up into
Generic functions are the reason this issue is less pressing in Julia.
Instead of Ngrams.report and Words.report or ngramsreport and wordsreport,
you can have report(x::Ngrams, ...) and report(x::Words, ...) – Ngrams,
Words and report can all live in the same namespace without any issues and
the
You should definitely not include the same code many times – in that case,
what you need is a module that all the users use.
On Mon, Jun 16, 2014 at 4:43 PM, Stefan Karpinski ste...@karpinski.org
wrote:
Generic functions are the reason this issue is less pressing in Julia.
Instead of
Hi
I am one of the authors of the paper :)
Our first version of the code did not declare types. It was thanks to
Florian's suggestion that we started doing it. We discovered, to our
surprise, that it reduced execution time by around 25%. I may be mistaken
but I do not think there are
Hi
1) Yes, we pre-compiled the function.
2) As I mentioned before, we tried the code with and without type
declaration, it makes a difference.
3) The variable names turns out to be quite useful because this code will
be eventually nested into a much larger project where it is convenient to
SIGINT gets converted to a InterruptException, that can be caught in a catch
statement. If you happened to be in a ccall, you might cause your program to be
in a corrupt state and leak resources such as memory.
I'm not sure how you can interact with other signals.
So many talented people have contributed so much to the Julia project that
it would not be possible to acknowledge them all.
Nonetheless, my recent work has made me especially appreciative of the work
of Tim Holy for the Profile code and the ProfileView package and of Dahua
Lin for the
Also, defining
mylog(x::Float64) = ccall((:log, libm), Float64, (Float64,), x)
made quite a bit of difference for me, from 1.92 to around 1.55. If I also add
@inbounds, I go down to 1.45, making Julia only twice as sslow as C++. Numba
still beats Julia, which kind of bothers me a bit
Thanks
Thank you! Reading your message was a very nice way to finish off my official
work
day.
Best,
--Tim
On Monday, June 16, 2014 02:48:56 PM Douglas Bates wrote:
So many talented people have contributed so much to the Julia project that
it would not be possible to acknowledge them all.
I was looking for a way to display a simulation in Julia. Originally I was
going to just use PyPlot, but it occurred to me it would be better to just
use Gtk+ + Cairo to do the drawing rather than something whose main purpose
is drawing graphs.
So far, following the examples on the Github
Ok, there is now more obvious attribution on each post, with the author
name and link of the original post prominently displayed before the article.
If anyone else has any other recommendations/requests (still need a logo!),
please let me know.
On Monday, June 16, 2014 3:13:25 PM UTC-4, Randy
interesting thanks!
On Monday, 16 June 2014 10:09:00 UTC-4, Isaiah wrote:
Not an answer to your questions, but: you might want to keep an eye on (or
try out) this patch exposing labels and gotos at the user level. It was
developed by Daniel Jones for parser backend purposes, and might be
ImageView's navigation.jl contains an example. The default branch is Tk
(because as far as binary distribution goes, Tk is solved and Gtk isn't
yet), but it has a gtk branch you can look at.
--Tim
On Monday, June 16, 2014 04:01:46 PM Abe Schneider wrote:
I was looking for a way to display a
Is there something wrong with the feed?
http://www.juliabloggers.com/feed/
juliabloggers.com
Entered url doesn't contain valid feed or doesn't link to feed. It is
also possible feed contains no items.
On 06/16/2014 08:52 PM, Randy Zwitch wrote:
Nothing shady about it at all and a good
I would definately use Julia's timers. See `Gtk.jl/src/cairo.jl` for an
example interface to the Cairo backing to a Gtk window (used in
`Winston.jl/src/gtk.jl`). If you are using this wrapper, call `draw(w)` to
force a redraw immediately, or `draw(w,false)` to queue a redraw request
for when Gtk
By a process of elimination, I determined that the only variable whose
declaration affected the run time was vGridCapital. The variable is
declared to be of type Array{Float64,1}, but is initialized as
vGridCapital = 0.5*capitalSteadyState:0.1:1.5*capitalSteadyState
which, unlike in
Ah! Excellent sleuthing. That's about the kind of thing I suspected was going
on.
On Jun 17, 2014, at 12:03 AM, Peter Simon psimon0...@gmail.com wrote:
By a process of elimination, I determined that the only variable whose
declaration affected the run time was vGridCapital. The variable
Big thx, it work,
Paul
W dniu 2014-06-16 21:24, Dahua Lin pisze:
|u =trues(length(x))
u[[5,7]]=false
ir =0
vr =-Inf
fori =1:length(x)
ifu[i]x[i]vr
ir =i
vr =x[i]
end
end
|
Thx, for this info
But not about items I need delete some rows ...
How fast delete rows in arrray, one [3,:]or more [[2,4],:] ?
Paul
W dniu 2014-06-16 21:22, Stefan Schwarz pisze:
deleting in place a matrix is not supported and does not make sense.
why is that?
you've for instance a 5x5
71 matches
Mail list logo