Thank you for your help.
I now have to make my script switch from file input to STDIN input if
required.
Le jeudi 15 janvier 2015 04:16:27 UTC+1, Isaiah a écrit :
>
> isaiah@titan:/tmp$ cat t3.jl
> x = readline(STDIN)
> println("input was: ", x)
> isaiah@titan:/tmp$ echo "hello" | julia t3.jl
Hello,
As a beginner Julia user I have the outlined problem and a peer review
request if there is any implications of the proposed technique.
The problem:
To have a matrix{T} shape continuous sub-view of a vector{T} store the
following code, using pointer to array, seem to work:
myView{T,
I don't know why my previous version won't work,BUT
```
macro nb(f, args...)
:($f($(arg...)))
end
```
will get the right result. What's the difference between `quote .. end` and
`:( .. )` then?
:P
On Thu, Jan 15, 2015 at 11:06 AM, Isaiah Norton
wrote:
> julia> macro nb(f,
isaiah@titan:/tmp$ cat t3.jl
x = readline(STDIN)
println("input was: ", x)
isaiah@titan:/tmp$ echo "hello" | julia t3.jl
input was: hello
On Wed, Jan 14, 2015 at 5:19 AM, wrote:
> Hi,
>
> I have written different scripts in julia for which the input is so far a
> file provided as an argument. T
julia> macro nb(f, args...)
arg1 = map(x->:($(esc(x))), args)
:($f($(arg1...)))
end
julia> @nb print arr
[0.0,0.020107, ...
If you haven't used it already, I would suggest to look at macroexpand to
see the expression resulting from each macro (for example,
And here are additional "unfortunate" behaviors with complex arithmetic as
currently implemented.
First, dividing nonzero by zero should give an infinite result. It does for
real, but not complex:
julia> 1/0
Inf
julia> 1/(0+0*im) # Should be some form of infinity
NaN + NaN*im
Second: Divi
I have installed the current version of Julia 0.3.5 and as far as I know
the Rmath library is no longer available (also it gave me an error when I
tried to install it). I have some previous programs that I have created
using Julia 0.2.0 in which I use Rmath. Is there any archive where I can
dow
Well, I don't get it very clearly. I learnt that 'esc' changes variable
names of a local variable in the macro. But I want to reference the global
variable out of the macro. I have little idea of Lisp macros, so I think I
still cannot handle this.
Would you please add more details?
Yi
On Wed, Jan
Your typeof() in f1 prints the run-time type of the array, the type of the
actual array returned by rfft(), but the code is generated using the
compile time type of the return from rfft(). But as Andreas shows, the
compile time type is incorrectly Any. Using Any the compiler has to
generate r
On Thursday, January 15, 2015 at 3:02:13 AM UTC+10, Steven G. Johnson wrote:
>
>
>
> On Tuesday, January 13, 2015 at 10:38:23 PM UTC-5, ele...@gmail.com wrote:
>>
>> Probably right if the mutations for adding extensions etc are not
>> conveniently available with Vector{uint8}.
>>
>
> It would ce
On Wednesday, January 14, 2015 at 4:19:35 PM UTC-5, Milan Bouchet-Valat
wrote:
Yes, zeros() only accepts integers currently. Maybe this could be
> changed to automatically do the conversion when possible.
>
See https://github.com/JuliaLang/julia/issues/1972
*julia> **type GGG end*
*julia> **call(::Type{GGG}, d::Int) = d*
*call (generic function with 858 methods)*
*julia> **GGG(4)*
*4*
*julia> **GGG(2)*
*2*
Cheers
Tobias
Am Mittwoch, 14. Januar 2015 23:09:26 UTC+1 schrieb Petr Krysl:
>
> Hi Tobias,
>
> Is there an example of the use
Also when I run similar code in python it would take 3 seconds. Am I doing
something wrong?
Hi Tobias,
Is there an example of the use of this new syntax for 0.4?
Thanks,
Petr
On Sunday, January 11, 2015 at 12:20:39 PM UTC-8, Tobias Knopp wrote:
>
> The call syntax is part of 0.4
>
> Cheers
>
> Tobi
>
> Am Sonntag, 11. Januar 2015 19:35:06 UTC+1 schrieb Petr Krysl:
>>
>> On Sunday,
Genial :)
El 14/01/2015 17:59, "Ismael VC" escribió:
> Foro julia-user-es, para discutir acerca de Julia en español: :D
>
> https://groups.google.com/forum/#!forum/julia-users-es
>
> OK, got it. Keno was right: you're actually redefining the cdCanvas type
> when calling include("../src/libcd_h.jl"). So you have both IUP.cdCanvas
> and cdCanvas.
>
Shit, I should have been able to find this myself.
Thanks a million. I hope to be able to pay back if I ever manage to ma
Le mercredi 14 janvier 2015 à 13:00 -0800, jspark a écrit :
>
>
> Hi,
>
>
>
> I am trying to port following simple Matlab code into Julia to get mu
>
>
> M=500
> m_plus=M*0.2;
> m_0=M*0.1;
> m_minus=M*0.7;
>
> mu_plus=0.15+0.5*(1:m_plus)/m_plus;
> mu_minus=-3*(1:m_minus
Hi,
I am trying to port following simple Matlab code into Julia to get
*mu*
M=500
m_plus=M*0.2;
m_0=M*0.1;
m_minus=M*0.7;
mu_plus=0.15+0.5*(1:m_plus)/m_plus;
mu_minus=-3*(1:m_minus)/m_minus;
mu_0=zeros(1,m_0);
*mu*=[mu_plus mu_0 mu_minus]
However, with Julia, t
Le mercredi 14 janvier 2015 à 11:59 -0800, J Luis a écrit :
>
> Just a shot in the dark, but if instead of this:
> ctgc_l = tCTC_l(C_NULL)
> ctgc_l.iup_canvas = t
> cdActivate(ctgc_l.iup_canvas)
>
> you do this:
> ctgc_l = tCTC_l(t)
>
Is there a way to provide a suggestion with the error?
It currently says this,
*julia> **factorial(21)*
*ERROR: OverflowError()*
* in factorial_lookup at combinatorics.jl:27*
* in factorial at combinatorics.jl:35*
Maybe it would be more useful if it said
*julia> **factorial(21)*
*ERROR: Ov
> Just a shot in the dark, but if instead of this:
> ctgc_l = tCTC_l(C_NULL)
> ctgc_l.iup_canvas = t
> cdActivate(ctgc_l.iup_canvas)
>
> you do this:
> ctgc_l = tCTC_l(t)
> cdActivate(ctgc_l.iup_canvas)
>
> does it make any difference?
>
unfortunately, no (and took care to comment line 1
Foro julia-user-es, para discutir acerca de Julia en español: :D
https://groups.google.com/forum/#!forum/julia-users-es
Le mercredi 14 janvier 2015 à 11:27 -0800, J Luis a écrit :
> OK, I've uploaded the code to IUP repo.
> What I mean in last message is that if I remove the type assignment in
> line 19 of
>
> https://github.com/joa-quim/IUP.jl/blob/master/examples/cdtest_.jl
>
> than the line 133 does not error,
OK, I've uploaded the code to IUP repo.
What I mean in last message is that if I remove the type assignment in line
19 of
https://github.com/joa-quim/IUP.jl/blob/master/examples/cdtest_.jl
than the line 133 does not error, otherwise it happens what I described.
Sorry but don't know how to make a
...también si piensan venir de visita este fin de semana! ;)
###
Hello everyone!
If you live in Mexico City, the metropolitan area or just plan to visit us
this weekend, you are wellcome this saturday at *KMMX*!
Details are in spanish, but you are interested, just ask! :D
El miércoles, 14 de
You can choose to defer those more complicated cases to Base:
signif(x::Float64, digits::Integer) = println("Felipe's swanky customized
signif")
signif(args…) = Base.signif(args…) # Punt to the Base implementation for
all other cases
On Wednesday, January 14, 2015 at 1:24:34 PM UTC-5, Felipe J
Hola a todos!
Si viven por el D.F. o la zona metropolitana los esperamos este sábado en
*KMMX*!
Detalles: http://www.meetup.com/julialang-mx
Alla nos vemos! :D
Le mercredi 14 janvier 2015 à 10:44 -0800, J Luis a écrit :
> What I found is if, for simplification, I restrict the type to (that
> is without type assignment)
>
> type tCTC_l
> iup_canvas
> end
>
> than it works. But if I change it to
>
> type tCTC_l
> iup_canvas::Ptr{cdCanvas}
> end
>
What I found is if, for simplification, I restrict the type to (that is
without type assignment)
type tCTC_l
iup_canvas
end
than it works. But if I change it to
type tCTC_l
iup_canvas::Ptr{cdCanvas}
end
it errors again. For curiosity I tried also
type tCTC_l
iup_canvas::Int64
end
I am guessing, that like Matlab, octave uses doubles to represent integers,
and hence you can go a bit farther than with integers. That should be the
same as factorial(21.0) in julia. Of course, you can also use BigInt and
such, which has already been discussed here.
-viral
On Tuesday, January
These capabilities are being actively developed. Beyond the parallel
section of the Julia manual, also see:
https://github.com/JuliaParallel/MPI.jl/
-viral
On Saturday, January 10, 2015 at 1:29:11 AM UTC+5:30, Francis Poulin wrote:
>
> Hello,
>
> I am very new to Julia and trying to learn how
Thank you, Steven. Your explanations are clear and helpful.
But then I don't know how to obtain the behavior I want.
A) I don't want to completely replace Base's signif because I still want
access to Julia's methods. For instance, my method only works in base 10,
so I don't want to lose Julia's
Due to an oversight on my part, I never made official packages out of CUDArt
and
CUFFT. That has now been rectified. As you might guess from the names, these
package are part of julia's growing collection of GPU-computing resources.
https://github.com/JuliaGPU/CUDArt.jl
https://github.com/Julia
Yes, an synthetic example would be nice, but I strongly suspect that if I
was able to create one than it would because I had found the problem.
quarta-feira, 14 de Janeiro de 2015 às 16:15:20 UTC, Milan Bouchet-Valat
escreveu:
>
> Le mercredi 14 janvier 2015 à 07:42 -0800, J Luis a écrit :
> >
Done in https://github.com/JuliaLang/julia/issues/9772
2015-01-14 10:19 GMT-05:00 Andreas Noack :
> There appears to be a problem with rfft.
>
> julia> @code_typed rfft(randn(10))
>
> 1-element Array{Any,1}:
>
> :($(Expr(:lambda, Any[:X],
> Any[Any[],Any[Any[:X,Array{Float64,1},0]],Any[]], :(beg
On Tuesday, January 13, 2015 at 10:38:23 PM UTC-5, ele...@gmail.com wrote:
>
> Probably right if the mutations for adding extensions etc are not
> conveniently available with Vector{uint8}.
>
It would certainly be possible to define these operations, e.g.
concatenation of a string with a bytev
Le mercredi 14 janvier 2015 à 07:42 -0800, J Luis a écrit :
> Well, I can make the current (failing) code available in the IUP repo
> but to run it implies installing the IUP lib, and IUP.jl which
> probably no one tested in other than Windows.
But the problem does not seem to involve IUP (or via a
Well, I can make the current (failing) code available in the IUP repo but
to run it implies installing the IUP lib, and IUP.jl which probably no one
tested in other than Windows.
quarta-feira, 14 de Janeiro de 2015 às 15:30:20 UTC, Milan Bouchet-Valat
escreveu:
>
> Le mercredi 14 janvier 2015 à
You need to use 'esc' -- see the hygiene part of the metaprog section in
the manual.
On Jan 14, 2015 8:56 AM, "yi lu" wrote:
> Hi,
>
> I am able to write a simple macro to drop brackets.
> https://gist.github.com/eccstartup/36637d96355bd5ca8188
>
> But there is some problem with this.
>
> You can
Le mercredi 14 janvier 2015 à 06:54 -0800, J Luis a écrit :
> I already fall in those two forms of troubles (double definition and
> double inclusion of the file where the type is defined) so I'm aware
> of it. As much as I can tell with grepping, that is not occurring
> now.
> Maybe a third (unkn
There appears to be a problem with rfft.
julia> @code_typed rfft(randn(10))
1-element Array{Any,1}:
:($(Expr(:lambda, Any[:X],
Any[Any[],Any[Any[:X,Array{Float64,1},0]],Any[]], :(begin # fftw.jl, line
639:
return rfft(X::Array{Float64,1},$(Expr(:new, UnitRange{Int64}, 1,
:(((top(getfi
I'm new to julia, trying to get PyPlot working. Eventually I hope to see
graphics in iJulia, but the GUI is not needed to reproduce the problem
detailed below.
At the command line, saying "julia" reveals the header logo, including
relevant version info:
Version 0.3.5 (2015-01-08 22:33 UTC)
Of
Hi,
I have written different scripts in julia for which the input is so far a
file provided as an argument. The output is printed on stdout.
I would like to be able to use them with files as input or to pipe them in
unix shell so the output of a script is taken as input by the next script
in th
Hi,
I am very new to Julia Programming.
Is there a package/easy way to project a point onto a constraint
line/plane, or
at least calculate the distance(maybe euclidean distance) between the point
and constraint plane/line and move the point later on by adding the
distance(later changed to vec
Hi all,
In the code below I define two functions, f1 and f2, that take a
three-dimensional array of Float64, computes the real FFT (rfft) and loops
once over the computed values of the rfft. In f1, a lot of time is spent in
the simple for loop, and many, many bytes are allocated. In f2, very li
Hi,
Yes, the method signatures should print out between the call the
checkreturntypes and the "The total number..." line. Currently, it often
prints out a lot of unnecessary new lines, so you may need to scroll up.
If you don't see that output at all, please file an issue on the
TypeCheck.jl gith
I already fall in those two forms of troubles (double definition and double
inclusion of the file where the type is defined) so I'm aware of it. As
much as I can tell with grepping, that is not occurring now.
Maybe a third (unknown to me) form of this type of issue?
quarta-feira, 14 de Janeiro
Are you maybe accidentally defining cdCanvas twice or in two different
modules?
On Wed, Jan 14, 2015 at 3:40 PM, J Luis wrote:
> BTW, if that matters, 'ctgc' is a global variable.
>
> quarta-feira, 14 de Janeiro de 2015 às 14:37:05 UTC, J Luis escreveu:
>
>> Hi, thanks for looking into this.
>>
BTW, if that matters, 'ctgc' is a global variable.
quarta-feira, 14 de Janeiro de 2015 às 14:37:05 UTC, J Luis escreveu:
>
> Hi, thanks for looking into this.
>
> If I make them show, as
>
> @show ctgc.iup_canvas
> ctgc.iup_canvas = t
> @show t
> @show ctgc.iup_canvas
>
> it 'shows'
>
> ctgc.i
On Jan 14, 2015, at 6:02 , Simon Danisch wrote:
>
> You could in addition use ImmutableArrays:
>
> immutable Packet{T}
> ID::{T}
> position::Vector3{T}
> direction::Vector3{T}
> energy::{T}
> time::{T}
> end
> Which makes Packet a bitstype, with efficient
Hi, thanks for looking into this.
If I make them show, as
@show ctgc.iup_canvas
ctgc.iup_canvas = t
@show t
@show ctgc.iup_canvas
it 'shows'
ctgc.iup_canvas => Ptr{cdCanvas} @0x
t => Ptr{cdCanvas} @0x22c6d6c0
ctgc.iup_canvas => Ptr{cdCanvas} @0x22c6d6c0
whic
Hi,
I am able to write a simple macro to drop brackets.
https://gist.github.com/eccstartup/36637d96355bd5ca8188
But there is some problem with this.
You can see the @nobrace macro that drop brackets of functions.
For example:
```
@nobrace map (x->x^2-1) 1:0.01:2
```
get a list of Float numbers.
Le mercredi 14 janvier 2015 à 05:32 -0800, J Luis a écrit :
> Hi,
> I have had quite some head-aches with types (converted from C structs)
> but this one wins.
>
> I have this type (from IUP)
>
>
> type tCTC
> iup_canvas::Ptr{cdCanvas}
> w::Cint
> h::Cint
> ...
>
> which I initializ
Hi,
I have had quite some head-aches with types (converted from C structs) but
this one wins.
I have this type (from IUP)
type tCTC
iup_canvas::Ptr{cdCanvas}
w::Cint
h::Cint
...
which I initialize as
ctgc = tCTC(
convert(Ptr{cdCanvas},0),
int32(0), int32(0),
...
a
It just hasn't been implemented, yet. Lexicon complains with "type
BasicREPL has no field interface". I'm guessing that a simpler approach
could be used in Lexicon, or it could be implemented in ESS (unfortunately,
no ESS developers really use Julia).
On Wed, Jan 14, 2015 at 4:23 AM, Tamas Papp w
Thanks Mike, this works.
On Wed, Jan 14, 2015 at 5:40 PM, Mike Innes wrote:
> I think that's because it's being parsed as
>
> @map (+1):10 11:20
>
> If you're using operators on their own, it's a good idea to put them in
> parens:
>
> @map (+) 1:10 11:20
>
> On 14 January 2015 at 09:36, yi lu
2015-01-14 11:43 GMT+01:00 Tim Holy :
> If you can, use
>
> immutable B
> x::A
> end
>
> The "type" version contains a reference to an A, not the entire A structure
> itself. The C analog of what you were doing would be
>
> struct B {
> A* x;
> };
>
> which of course doesn't have the same s
You could in addition use ImmutableArrays:
immutable Packet{T}
ID::{T}
position::Vector3{T}
direction::Vector3{T}
energy::{T}
time::{T}
end
Which makes Packet a bitstype, with efficient memory layout.
If you need to mutate these, there are actually ways, whe
If you can, use
immutable B
x::A
end
The "type" version contains a reference to an A, not the entire A structure
itself. The C analog of what you were doing would be
struct B {
A* x;
};
which of course doesn't have the same size as A.
--Tim
On Wednesday, January 14, 2015 02:22:19 AM
Just as a note regarding this new syntax for anyone reading:
It’s still being experimented with in Docile/Lexicon, though so far I’ve
found it much more enjoyable to use.
Package load times aren’t affected nearly as much as with @doc since
collection and parsing of docstrings
only happens once
Hi Jan,
since mutable julia object require a type tag, they always require a pointer
and cannot be structurally inlined. The assertion would hold if both types
were declared `immutable`.
On Wed, Jan 14, 2015 at 11:22 AM, Jan Niklas Hasse wrote:
> Hi!
>
> I'm new to Julia and was wondering why
>
Hi!
I'm new to Julia and was wondering why
type A
x::Ptr{Void}
y::Ptr{Void}
end
type B
x::A
end
assert(sizeof(A) == sizeof(B))
doesn't work while the C version
#include
struct A {
void* x;
void* y;
};
struct B {
A x;
};
int main() {
assert(sizeof(A) == sizeof(B
So I am trying the sublime IDE again after failing to resolve problems in
Juno. So far I got julia installed and working, but it is a bit slower on
running code than LightTable.
I am thinking about switching but I have two concerns
1. Plotting in Gadfly does not work
2. Plotting speed is slow.
There has been some talk about overloading `.` which could accommodate
your suggestion. Have a look at
https://github.com/JuliaLang/julia/issues/1974
On Tue, 2015-01-13 at 23:08, Ivan Ogasawara wrote:
> Hi, I am newbie yet, but maybe julia could have an operator to wrap a
> function call to spec
I think that's because it's being parsed as
@map (+1):10 11:20
If you're using operators on their own, it's a good idea to put them in
parens:
@map (+) 1:10 11:20
On 14 January 2015 at 09:36, yi lu wrote:
> @map + 1:10 11:20
>
> failed
> :)
>
> On Wed, Jan 14, 2015 at 5:23 PM, Mike Innes
> w
@map + 1:10 11:20
failed
:)
On Wed, Jan 14, 2015 at 5:23 PM, Mike Innes wrote:
> Using $(args...) should do the trick, I think.
>
> On 14 January 2015 at 09:20, yi lu wrote:
>
>> Hi,
>>
>> I want to write a macro which works as map function.
>>
>> It should work for these.
>>
>> ```
>> @map x-
Using $(args...) should do the trick, I think.
On 14 January 2015 at 09:20, yi lu wrote:
> Hi,
>
> I want to write a macro which works as map function.
>
> It should work for these.
>
> ```
> @map x->x+1 1:10
> @map + 1:10 11:20
> ```
>
> I know it is just copying the argument list in the macro
On Tue, Jan 13 2015, Tom Short wrote:
> If you want to try the Sims docs at the REPL, you'll need to checkout that
> package and enter "using Sims, Sims.Lib, Lexicon". Then you can do
> ?Resistor or ?"Capacitor.
>
> Note that the question mark doesn't work in ESS.
Is that an intrinsic limitation
Hi,
I want to write a macro which works as map function.
It should work for these.
```
@map x->x+1 1:10
@map + 1:10 11:20
```
I know it is just copying the argument list in the macro to the map
function, but I get stuck.
```
macro map(f,args...)
quote
map($f, $args...)
end
end
```
won
69 matches
Mail list logo