Re: [julia-users] parse Unicode string to Float64

2016-10-25 Thread Chris Stook
The StringEncodings package solves the problem. Thank all, Chris

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Chris Stook
I just need a vector of the values. The names are known from the circuit file. The problem is really just with converting the string to a Float64 value when the file is Unicode from LTspiceXVII. Everything works fine with the ASCII from LTspiceIV. More specifically, the capturing block

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Chris Stook
The circuit file is test1.asc ( https://github.com/cstook/LTspice.jl/blob/master/test/test1.asc). You should be able to open it with LTspice and run the simulation to produce the log file. The log file is a human readable text file, which I am parsing to get the measurements. LTspiceIV used

[julia-users] Re: parse Unicode string to Float64

2016-10-25 Thread Chris Stook
The file ( https://github.com/cstook/LTspice.jl/blob/LTspiceXVII_compat/test/test1.log) is a .log file produced by LTspiceXVII ( http://www.linear.com/designtools/software/). I'm using regular expressions to parse the file. The code below shows the problem. io = open("test1.log","r") for line

[julia-users] parse Unicode string to Float64

2016-10-24 Thread Chris Stook
I'm trying to parse a text file which contains some floating point numbers. The number 2.5 is represented by the string "\x002\0.\x005\0". Parse will not convert this to a Float64. Print works (prints "2.5") in Atom and Jupyter, but not in the REPL. _ _ _ _(_)_ | A fresh approach

Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
That makes sense. I should have seen that. Thank you!

[julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
Calling objects of type T is only valid if N arguments are provided. What is the correct syntax for this? immutable T{N} t :: NTuple{N,Any} end (x::T)(args...) = error("wrong number of arguments") function {N}(x::T{N})(args::Varargs{Any,N}) print("do stuff here") end syntax: invalid

[julia-users] Re: Overload what to fix "Julia Client - Internal Error" with subtype of AbstractArray?

2016-09-29 Thread Chris Stook
That fixed it. Thank you!

[julia-users] Overload what to fix "Julia Client - Internal Error" with subtype of AbstractArray?

2016-09-29 Thread Chris Stook
I have defined a simple subtype of AbstractArray which keeps track if an array has been modified by the user. Base.show, Base.showcompact, and Base.display are overloaded. This works in the REPL, but with Atom I receive the following error. Julia Client - Internal Error MethodError: no

Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-12 Thread Chris Stook
On Monday, September 12, 2016 at 7:22:39 PM UTC-4, Chris Stook wrote: > > Last post was incomplete. > > abstract AbstractFoo > > macro commonfields() > return :( > bar; > foo; > ) > end > > type Foo <: AbstractFoo > @common

Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-12 Thread Chris Stook
Last post was incomplete. abstract AbstractFoo macro commonfields() return :( bar foo ) end type Foo <: AbstractFoo @commonfields() end type Foobar <: AbstractFoo @commonfields() barbaz bazbaz end Chris

Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-12 Thread Chris Stook
I use a macro to avoid retyping common fields. abstract AbstractFoo macro commonfields() return :( type Foo <: AbstractFoo bar baz end type Foobar <: AbstractFoo bar baz barbaz bazbaz end

Re: [julia-users] Re: help with deepcopy_internal

2016-08-24 Thread Chris Stook
s this. >> >> You shouldn't need to define deepcopy_internal for custom types in >> general, unless your type needs special serialization support (e.g. if it >> has pointer to C memory) >> >> >>> >>> >>> On Tuesday, August 23, 2016 at

[julia-users] help with deepcopy_internal

2016-08-23 Thread Chris Stook
I created this simple example to try to understand deepcopy_internal. type SelfReferential obj::SelfReferential SelfReferential() = (x = new(); x.obj = x) end function deepcopy_internal(sr::SelfReferential, oidd::ObjectIdDict) # if haskey(oidd,sr) #return oidd[sr] # else new_obj =

Re: [julia-users] Re: IJulia kernel dies repeatedly with 0.5.0-rc2

2016-08-15 Thread Chris Stook
rc0 also works for me. On Mon, Aug 15, 2016 at 3:25 AM, Rock Pereira wrote: > On Windows 10 x64: > > > Pkg.build("ZMQ") fails with rc2, but works fine with rc0 > > Pkg.build("IJulia") also succeeds with rc0 > The rc0 kernel is working fine in Jupyter >

[julia-users] Re: Problem with atom-julia-client with 0.5.0-rc2

2016-08-14 Thread Chris Stook
t discussion on the updates...Archie > > On Sunday, August 14, 2016 at 6:09:30 PM UTC-4, Chris Stook wrote: >> >> I switched atom-julia-client to 0.5.0-rc2. >> In REPL: >> Pkg.update() >> In atom: >> changed Julia path to: >> C:\Users\Chris\AppData\Local\Julia

[julia-users] Problem with atom-julia-client with 0.5.0-rc2

2016-08-14 Thread Chris Stook
I switched atom-julia-client to 0.5.0-rc2. In REPL: Pkg.update() In atom: changed Julia path to: C:\Users\Chris\AppData\Local\Julia-0.5.0-rc2\bin\julia.exe Now whenever I click anywhere in an Julia file or type any character in a Julia file, I receive one of the following two errors.

Re: [julia-users] Re: preferred way to dispatch on first element of array?

2016-08-12 Thread Chris Stook
Carlsson <kcarl...@gmail.com > > wrote: > >> No, since the only thing the compiler sees is Vector{Any}. >> >> >> On Friday, August 12, 2016 at 11:36:54 PM UTC+2, Chris Stook wrote: >>> >>> Is there a way to dispatch on the type of the first element o

[julia-users] Re: preferred way to dispatch on first element of array?

2016-08-12 Thread Chris Stook
Thank you. On Friday, August 12, 2016 at 5:52:48 PM UTC-4, Kristoffer Carlsson wrote: > > No, since the only thing the compiler sees is Vector{Any}. > > On Friday, August 12, 2016 at 11:36:54 PM UTC+2, Chris Stook wrote: >> >> Is there a way to dispatch on the t

[julia-users] Re: IJulia kernel dies repeatedly with 0.5.0-rc2

2016-08-12 Thread Chris Stook
2.0 - WinRPM0.2.0 - ZMQ 0.3.4 - Zlib 0.1.12 julia> On Friday, August 12, 2016 at 6:48:24 PM UTC-4, Steven G. Johnson wrote: > > > > On Friday, August 12, 2016 at 5:27:38 PM UTC-4, Chris Stook wrote: >&

[julia-users] Re: IJulia kernel dies repeatedly with 0.5.0-rc2

2016-08-12 Thread Chris Stook
s\julia-0.5 ==[ BUILD ERRORS ]== WARNING: ZMQ had build errors. - packages with build errors remain installed in C:\Users\Chris\.julia\v0.5 - build the package(s) and all dependencies with `Pkg.build("ZMQ")` - build a single package by running its `deps/build.jl` script ==

[julia-users] preferred way to dispatch on first element of array?

2016-08-12 Thread Chris Stook
Is there a way to dispatch on the type of the first element of an array without passing the first element as a separate argument. for example: a = Array{Any,1} function f(a::Array{Any,1}, a1::Int) # do int stuff here end function f(a::Array{Any,1}, a1::Float64) # do float stuff here end

[julia-users] IJulia kernel dies repeatedly with 0.5.0-rc2

2016-08-12 Thread Chris Stook
I'm using Windows 10. I updated to 0.5.0-rc2, then performed the following updates. Pkg.update() Pkg.build("IJulia") There were lots of warnings, and ZMQ failed to build. Now, when I open IJulia the kernel repeatedly dies and restarts. Is there a fix for this? If I just need to wait for

Re: [julia-users] excessive memory allocation with @printf at compile time

2016-01-07 Thread Chris Stook
You can see what I did here. https://github.com/cstook/FTD2XX.jl/blob/master/src/ft_ee_read__ft_ee_program.jl There are a bunch of @printf 's starting at line 450. I'm learning Julia. There may be a better

[julia-users] Overload Base.show for a Array of specific type

2015-10-16 Thread Chris Stook
Is it possible to overload show for an array of a specific type? See example below. In [1]: type a_type b_element :: Int64 c_element :: Int64 end d_array = [a_type(1,2),a_type(3,4),a_type(5,6)] Out[1]: 3-element Array{a_type,1}: a_type(1,2) a_type(3,4) a_type(5,6) In [2]: function

Re: [julia-users] Overload Base.show for a Array of specific type

2015-10-16 Thread Chris Stook
Thanks!

[julia-users] excessive memory allocation with @printf at compile time

2015-10-04 Thread Chris Stook
I am having difficulty troubleshooting a memory allocation problem in a show method for a user defined type. Compiling the show method with 126 @printf macros takes 197 seconds and allocates 5.57GB of memory. The next call takes 0.014 seconds and allocates 27.141KB. I moved the type and it's

Re: [julia-users] excessive memory allocation with @printf at compile time

2015-10-04 Thread Chris Stook
No problem. Thank you.

Re: [julia-users] How do I pass an event handle via ccall?

2015-09-29 Thread Chris Stook
That simple detailed explanation is exactly what I needed. Thank you.

Re: [julia-users] How do I pass an event handle via ccall?

2015-09-28 Thread Chris Stook
> > Thank you. > I have reviewed the suggested material. I'm probably in way over my head with this, but I'd like to learn, so I'm going to ask what is probably a novice question. What is the difference between an event and a callback function? I think I understand how a callback works. I

Re: [julia-users] How do I pass an event handle via ccall?

2015-09-27 Thread Chris Stook
Thanks! I'll read the section on SignalAsyncWork more carefully. - Chris

[julia-users] How do I pass an event handle via ccall?

2015-09-27 Thread Chris Stook
I am wrapping this c library: http://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer's_Guide(FT_71).pdf The function FT_SetEventNotification requires passing a handle to an event. The closest thing I see in julia is a Condition(). Would it make sense to pass a pointer to

[julia-users] Re: Pkg.build("IJulia") failed with rc2

2015-09-20 Thread Chris Stook
Went back to rc1. IJulia is OK now. -Chris On Sunday, September 20, 2015 at 4:15:35 AM UTC-4, Chris Stook wrote: > > After updating to rc2, Pkg.build("IJulia") resulted in an infinite cycle > of errors. After watching the errors for a a few minutes I hit ctrl-C a >

[julia-users] Pkg.build("IJulia") failed with rc2

2015-09-20 Thread Chris Stook
After updating to rc2, Pkg.build("IJulia") resulted in an infinite cycle of errors. After watching the errors for a a few minutes I hit ctrl-C a few times to stop. I then tried to build WinRPM. This also resulted is a cycle of errors. Next I quit julia, deleted the v0.4 directory, restarted

[julia-users] Re: How do I install Clang.jl on Windows 7?

2015-09-11 Thread Chris Stook
Last night I took an old PC, installed Ubuntu, and got Clang working. This was much easier than Windows. Thanks for all the replies. Chris

[julia-users] How do I install Clang.jl on Windows 7?

2015-09-10 Thread Chris Stook
Here is what I tried so far... Downloaded Clang for Windows (64-bit) from http://llvm.org/releases/download.html Is this libclang? Where do I get libclang-dev? Clang installation fails with the following message. Installing MSVC integration... Failed to find MSBuild toolsets directory. MSVC

[julia-users] Re: How do I install Clang.jl on Windows 7?

2015-09-10 Thread Chris Stook
> > Thanks for the suggestion. BinDeps.debug gives the same error. > > BinDeps.debug("Clang") > INFO: Reading build script... could not spawn `which llvm-config`: no such file or directory (ENOENT) while loading C:\Users\Chris\.julia\v0.3\Clang\deps\build.jl, in expression starting on

[julia-users] Package to work with LTspice simulations in julia

2015-09-05 Thread Chris Stook
I've created a package to work with LTspice simulations in julia. https://github.com/cstook/LTspice.jl Chris