Re: [julia-users] Re: Defining a new numeric type with minimal effort

2016-06-11 Thread Jeffrey Sarnoff
; > So, put simply: What is the Julia way of ensuring that I pass a valid > probability to my function (figure between 0 and 1). Please do not tell me > that I am supposed to use @assert statements x) > I would feel that a new type would be the cleanest way to do so? > > Best, >

Re: [julia-users] Re: Defining a new numeric type with minimal effort

2016-06-10 Thread Jeffrey Sarnoff
<:Real, T2<:Real}(::Type{Probability{T1}}, x::T2) = > Probability(convert(T1, x)) > > > should do the job as now any Probability can be converted to any concrete > subtype of Real and "+" shoud be implemented there ;) > Very strange, how does Julia handle inheritance at a

[julia-users] Re: Memory corruption when using BigFloats

2016-06-07 Thread Jeffrey Sarnoff
t64 values with BigFloat math (that can lead to Float64 overflow which looks as if it were a BigFloat problem). On Tuesday, June 7, 2016 at 5:49:09 PM UTC-4, Jeffrey Sarnoff wrote: > > e.g. >> > bigpi = BigFloat(pi); > > dump( bigpi ) > > string( bigpi )# if possible &

[julia-users] Re: Memory corruption when using BigFloats

2016-06-07 Thread Jeffrey Sarnoff
> > e.g. > bigpi = BigFloat(pi); dump( bigpi ) string( bigpi )# if possible On Tuesday, June 7, 2016 at 2:05:34 PM UTC-4, Pablo Zubieta wrote: > > It would help to have all the fields of the BigFloat, not only d (but also > prec, sign and exp). I think it can be a problem with the

[julia-users] Re: parametrized type with inner constructor fails

2016-06-06 Thread Jeffrey Sarnoff
from http://docs.julialang.org/en/latest/manual/constructors/ ...This automatic provision of constructors is equivalent to the following explicit declaration: type Point{T<:Real} > > x::T > > y::T > > >> Point(x,y) = new(x,y) > > end > > >> Point{T<:Real}(x::T, y::T) = Point{T}(x,y) > >

[julia-users] Re: given two strings, find the index of the first nonmatching character

2016-06-06 Thread Jeffrey Sarnoff
thanks On Monday, June 6, 2016 at 7:43:28 PM UTC-4, David P. Sanders wrote: > > Wrapped in a function, obviously. > > El lunes, 6 de junio de 2016, 19:41:10 (UTC-4), David P. Sanders escribió: >> >> >> >> El lunes, 6 de junio de 2016, 18:53:

[julia-users] given two strings, find the index of the first nonmatching character

2016-06-06 Thread Jeffrey Sarnoff
``` indexOfFirstNonmatching("abcd","abcd") == 0 indexOfFirstNonmatching("abcd","abdc") == 3 ``` what is a fast way to do this with strings of 50-1000 characters?

Re: [julia-users] Re: Congratulations to Keno

2016-05-29 Thread Jeffrey Sarnoff
Keno, Sometimes things just seem to go right. One of those times is when you work on Julia. Congratulations on the degree and the job, Jeffrey Sarnoff On Sunday, May 29, 2016 at 8:48:03 AM UTC-4, Jonathan Malmaud wrote: > > What are the health care benefits like? > > On Satu

Re: [julia-users] collect([1 2]) in 0.5.0-

2016-05-26 Thread Jeffrey Sarnoff
n A). > Cf. https://github.com/JuliaLang/julia/issues/16029 > > > > On Wed, May 25, 2016 at 7:07 PM, Jeffrey Sarnoff > > <jeffrey...@gmail.com > wrote: > > > I hope Julia is not ready to drop the immediacy of clarity when it > > > is new-found and c

Re: [julia-users] Re: Lack of an explicit return in Julia, heartache or happiness?

2016-05-25 Thread Jeffrey Sarnoff
That is a good point, well explained. If by default nonshort Julia functions evaluate as nothing, then the default evaluand is nothing -- and so does nothing wrong. "So Julia's got that goin' for her, which is nice." -- *Carl Spackler (Bill Murray in Caddyshack), paraphrased* On Wednesday,

Re: [julia-users] collect([1 2]) in 0.5.0-

2016-05-25 Thread Jeffrey Sarnoff
I hope Julia is not ready to drop the immediacy of clarity when it is new-found and current use adjacent (e.g. "shape-preserving f(g(x) for x in A)"). It is reasonable that `collect` become this better version of its prior self; and, if desired, a vector-only version would have a new name or

Re: [julia-users] Re: Lack of an explicit return in Julia, heartache or happiness?

2016-05-24 Thread Jeffrey Sarnoff
Just modify Compat.jl so it offers compatibility with future versions of Julia ... using Compat @compat function g()::Int # stuff end function fg(args...) g() end # returns an Int, so it must return something @compat function h()::Void # stuff end function fh(args...) h() end # returns

Re: [julia-users] Lack of an explicit return in Julia, heartache or happiness?

2016-05-24 Thread Jeffrey Sarnoff
) end On Tuesday, May 24, 2016 at 4:03:56 PM UTC-4, David Anthoff wrote: > > I think that is a way too complicated rule, no one will know anymore what > is happening. > > > > *From:* julia...@googlegroups.com [mailto: > julia...@googlegroups.com ] *On Behalf Of

Re: [julia-users] Lack of an explicit return in Julia, heartache or happiness?

2016-05-24 Thread Jeffrey Sarnoff
Rather than impose `return nothing` on all unshortly functions that do not provide an explicit return, perhaps limit postpending `return nothing` to functions that neither provide an explicit return anywhere within the function body nor have as the final line of the function (before

[julia-users] Re: How to make a macro that is a synonym for another macro?

2016-05-24 Thread Jeffrey Sarnoff
quote @macroWithVeryLongName( $(esc(a)), $(esc(b)) ) end end ``` ( having an operator that is as $(esc(x)) does would help imo --- macroWith__Name( ʆa, ʆb ) ) On Tuesday, May 24, 2016 at 2:10:17 AM UTC-4, Jeffrey Sarnoff wrote: > > unearthed the solution Nesting Macros > <http://julia-programming-l

[julia-users] Re: How to make a macro that is a synonym for another macro?

2016-05-24 Thread Jeffrey Sarnoff
s done right) On Tuesday, May 24, 2016 at 1:17:36 AM UTC-4, Jeffrey Sarnoff wrote: > > I'm sure there is a way to pass macro arguments through to another macro > that takes the same arguments > > macro sameAction(a,b) >@macroWithVeryLongName(a,b) # I know this does not w

[julia-users] Re: How to make a macro that is a synonym for another macro?

2016-05-23 Thread Jeffrey Sarnoff
: > > With function you could do: > > someverylongfunctionname() = 5 > foo = someverylongfunctionname > foo() > > Idk why the same thing doesn't work for macros :( > > @someverylongmacroname() = :(5) > @foo = @someverylongmacroname > @foo() > > > Dne úterý 24. kvě

[julia-users] How to make a macro that is a synonym for another macro?

2016-05-23 Thread Jeffrey Sarnoff
I have a macro, macroWithVeryLongName(a,b), and I want a macro that does the same thing that uses a short name for convenience, sameAction(a,b).

[julia-users] Re: Does rationalize ever round to zero?

2016-05-10 Thread Jeffrey Sarnoff
You can post it as an issue. On Tuesday, May 10, 2016 at 4:21:18 PM UTC-4, Jeffrey Sarnoff wrote: > > This appears to be a bug. The docs for rationalize > <http://docs.julialang.org/en/latest/stdlib/math> say > rationalize([*Type=Int*, ]*x; tol=eps(x)*) Approximate floating

[julia-users] Re: Does rationalize ever round to zero?

2016-05-10 Thread Jeffrey Sarnoff
This appears to be a bug. The docs for rationalize say rationalize([*Type=Int*, ]*x; tol=eps(x)*) Approximate floating point number x as a Rational number with components of the given integer type. The result will differ from x by no more than

[julia-users] [ANN] Book: Julia High Performance

2016-05-07 Thread Jeffrey Sarnoff
Congratulations and Cheers, Avik.

[julia-users] Re: Good practices for constrained constructors

2016-04-26 Thread Jeffrey Sarnoff
try this: type LoHiPair{T<:Real} lo::T hi::T function LoHiPair{A}(lo::A, hi::A) if lo > hi throw( error("out of order") ) end new(lo, hi) end end LoHiPair{T<:Real}(lo::T, hi::T) = LoHiPair{T}(lo, hi) On Tuesday, April 26, 2016 at 3:57:59 PM

[julia-users] Re: Creating symbols

2016-04-21 Thread Jeffrey Sarnoff
in julia, to see ÷ type \div followed by the Tab key (press '\' 'd' 'i' 'v' 'tab' ) On Thursday, April 21, 2016 at 11:43:41 AM UTC-4, Henri Girard wrote: > > I am trying to get the symbol for division, instead /, how to create > it ? or get it working in code ? > > Le mercredi 20

Re: [julia-users] Creating symbols

2016-04-21 Thread Jeffrey Sarnoff
I understand making a pull request. I don't know how to set up code to deprecate something in that context. On Thursday, April 21, 2016 at 6:20:26 AM UTC-4, Jeffrey Sarnoff wrote: > > I meant AST analysis not sed (simple 6am typo). > > On Thursday, April 21, 2016 at 6:13:37 AM UT

Re: [julia-users] Creating symbols

2016-04-21 Thread Jeffrey Sarnoff
I meant AST analysis not sed (simple 6am typo). On Thursday, April 21, 2016 at 6:13:37 AM UTC-4, Jeffrey Sarnoff wrote: > > I am advocating for gathering the known misfits and fitting them aright > yesterday or today (maybe you are reading this tomorrow). > > The "ma

Re: [julia-users] Creating symbols

2016-04-21 Thread Jeffrey Sarnoff
I am advocating for gathering the known misfits and fitting them aright yesterday or today (maybe you are reading this tomorrow). The "massively breakingness" of symbol/Symbol or any others does not phase me, In part, the clean workings of Julia's deprecation mechanism does smooth the

[julia-users] Re: Rounding to zero from positive or negative numbers results in positive or negative zero.

2016-04-19 Thread Jeffrey Sarnoff
Hi, You have discovered that IEEE standard floating point numbers have two distinct zeros: 0.0 and -0.0. They compare `==` even though they are not `===`. If you want to consider +0.0 and -0.0 to be the same, use `==` or `!=` not `===` or `!==` when testing floating point values (the other

Re: [julia-users] Re: methods ambiguity

2016-04-19 Thread Jeffrey Sarnoff
+1 (what Stefan said) Is there a way to auto-generate something appropriate that takes care of the ambiguity with Bool that pops up frequently, for numerical methods that never intend being called with Bool arg(s)? On Tuesday, April 19, 2016 at 3:08:20 PM UTC-4, Stefan Karpinski wrote: > >

[julia-users] Re: [ANN] VulkanCore

2016-04-10 Thread Jeffrey Sarnoff
> > One of the more exciting use cases of Vulkan is running Julia kernels over > GPU-Arrays and then seamlessly visualizing the results. > Enabling this will be a lot of work. > It looks like using Vulkan, when ready, it will take less work to get work done. On Saturday, April 9, 2016 at

[julia-users] Re: Fast multiprecision integers?

2016-04-08 Thread Jeffrey Sarnoff
Julia has functions for checked integer arithmetic on the base integer types which raise an OverflowError(). using Base.Checked # now these functions are available for use: # checked_neg, checked_abs, checked_add, checked_sub, checked_mul # checked_div, checked_rem, checked_fld, checked_mod,

[julia-users] Re: Error installing hydrogen for Atom

2016-04-07 Thread Jeffrey Sarnoff
I have experienced this too. Hydrogen has never been a load-and-go proposition for Julia on Windows. Before this, there were other hang-ups and some have had their roots in something an earlier release of Atom on Win was doing or not doing. I have downloaded a version of Juno/LT that works

Re: [julia-users] assignment form function with empty body

2016-04-07 Thread Jeffrey Sarnoff
ok On Thursday, April 7, 2016 at 1:48:50 PM UTC-4, Yichao Yu wrote: > > > > On Thu, Apr 7, 2016 at 1:14 PM, Jeffrey Sarnoff <jeffrey...@gmail.com > > wrote: > >> thanks for the coverage Tamas; I did not check v0.4. from >> >> Julia Version 0.5.0-dev

Re: [julia-users] assignment form function with empty body

2016-04-07 Thread Jeffrey Sarnoff
thanks for the coverage Tamas; I did not check v0.4. from Julia Version 0.5.0-dev+3313 Commit 5e01b1a (2016-03-29 15:14 UTC) System: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i7-4960X CPU @ 3.60GHz Empty blocks, the ultimate in code compression. With v0.5.0-dev, used as he

[julia-users] Re: How to specify only concrete subtype of abstract supertype in a parametric function?

2016-04-07 Thread Jeffrey Sarnoff
Martin, If you want to implement file loading, and you care that only entities of type File get accepted through the loading function's function signature (excluding the Type File as an accepted entity), Julia does that naturally. All you were overlooking is the part where an actual File entity

[julia-users] Re: assignment form function with empty body

2016-04-07 Thread Jeffrey Sarnoff
foo(x) = nothing gives a function that returns nothing, unexceptionally. foo(x) = begin end gives a function that generates an exceptional opcode for `unreachable` On Thursday, April 7, 2016 at 7:04:52 AM UTC-4, Tamas Papp wrote: > > Hi, > > What's the most compact form of writing a function

[julia-users] Re: Help with convoluted types and Vararg

2016-04-06 Thread Jeffrey Sarnoff
this works -- more than than .. well no type Foo x::Vector{} end z = [Pair((+,1,5,7), 3), Pair((-,6,5,3,5,8), 1)] Foo(z) Foo( Pair{A,Int64}[ (+,1,5,7)=>3, (-,6,5,3,5,8)=>1 ] ) On Tuesday, April 5, 2016 at 2:51:39 PM UTC-4, Seth wrote: > > Hi all, > > I have the following on 0.4.6-pre+18: >

[julia-users] Re: Small package for timing sections of code and pretty printing the results

2016-04-06 Thread Jeffrey Sarnoff
4:07:22 AM UTC+2, Jeffrey Sarnoff wrote: >> >> You might have an option to show "wall time / call" >> or just include it in the table however you like the columns. >> >> section | avg time | number| time used | time used >

[julia-users] Re: enforcing homogeneity of vector elements in function signature

2016-04-06 Thread Jeffrey Sarnoff
That the Union does not work (and that reasonable people have written the example expecting the Union to work) is good feedback -- a surprise where Julia is motivated to become unsurprising. Julia requires there to be two distinct outer method signatures (Na != Nb, T1 != T2) to absorb

[julia-users] Re: Small package for timing sections of code and pretty printing the results

2016-04-05 Thread Jeffrey Sarnoff
% of total --|---||--| in a loop | 101.156 |5 | 505.779ms |16 On Tuesday, April 5, 2016 at 9:39:38 PM UTC-4, Jeffrey Sarnoff wrote: > > This is very useful and much appreciated. Thank you. > > On Tuesday, April 5, 20

[julia-users] Re: Small package for timing sections of code and pretty printing the results

2016-04-05 Thread Jeffrey Sarnoff
This is very useful and much appreciated. Thank you. On Tuesday, April 5, 2016 at 3:42:45 PM UTC-4, Kristoffer Carlsson wrote: > > Hello everyone, > > I put up a new (unregistered) small package for timing different sections > of code. It works similar to @time in Base but you also give the

[julia-users] Re: Outer constructor to initialize parametric type

2016-04-05 Thread Jeffrey Sarnoff
starting with your `*T*` parameterized type type Foo{*T*} x::Vector{*T*} end When you create a new element of type Foo by giving the concrete type a vector of some sort, say [1,2,3], newFoo = Foo( [1,2,3] ) you do not write out the *T*, nor do you explicitly give it its appropriate

[julia-users] Re: enforcing homogeneity of vector elements in function signature

2016-04-05 Thread Jeffrey Sarnoff
If I understand your question, you want to accept e.g. both [Foo{Int,2}((1,2)), Foo{Int,2)((2,3))] and [Foo{Int,2}((1,2)), Foo{Int,3)((2,3,4)) ] and then do something with them, and you want to reject e.g. [Foo{Int,2((1,2)), Foo{Float64,2}((2.0,3.0))]. Having two method signatures that

[julia-users] Re: Small packages?

2016-04-04 Thread Jeffrey Sarnoff
Julia allows you to have submodules; you can collect some of your tiny packages into MyUtilityPackages (sketched, not run) module MyUtilityPackages module StringUtilities export stringfunction function stringfunction .. end end module IntegerUtilities export

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-04 Thread Jeffrey Sarnoff
Since supertype(Number) == Any, the most abstract number-like entity that Julia has to offer with the current hierarchy is Number. Most packages I have seen that implement number-like types which are outside of the Reals use Number as their supertype. This is more helpful, generally, than

[julia-users] Re: Can Julia handle a large number of methods for a function (and a lot of types)?

2016-03-27 Thread Jeffrey Sarnoff
*I use this to think about inter type relationships -- and wrote it above, ymmv ymwv!* * read{T<:Scope}(scope::T{Tektronix}) = ...* On Sunday, March 27, 2016 at 7:21:19 PM UTC-4, Jeffrey Sarnoff wrote: > > Glad to know you are up to speed ... > Try

[julia-users] Re: Can Julia handle a large number of methods for a function (and a lot of types)?

2016-03-27 Thread Jeffrey Sarnoff
lz wrote: > > Hi Jeffrey, > > On Sunday, March 27, 2016 at 3:51:18 PM UTC+2, Jeffrey Sarnoff wrote: >> >> Assuming your handshaking and signal management is keeping information >> available in some easy to discern and decode manner and you are not pushi

[julia-users] Re: hypot question

2016-03-27 Thread Jeffrey Sarnoff
Andreas gave you the correct answer as it happened: issue 3101 and on 2013-May-16 Later that year, responding to issue 4465

[julia-users] Re: Can Julia handle a large number of methods for a function (and a lot of types)?

2016-03-27 Thread Jeffrey Sarnoff
stages of action or reflection very loosely coupled and choosing types/structures to ease specific subtasks also may help. On Sunday, March 27, 2016 at 9:51:18 AM UTC-4, Jeffrey Sarnoff wrote: > > Assuming your handshaking and signal management is keeping information > available in

[julia-users] Re: Can Julia handle a large number of methods for a function (and a lot of types)?

2016-03-27 Thread Jeffrey Sarnoff
Assuming your handshaking and signal management is keeping information available in some easy to discern and decode manner and you are not pushing latency issues, Julia should be a good platform for that. Compilation time usually is not a concern -- and you can make your package autoprecompile

[julia-users] Re: hypot question

2016-03-26 Thread Jeffrey Sarnoff
Looking at your note, I noticed this: * hypot(Inf,NaN) == hypot(NaN,Inf) == Inf* That cannot be correct because *sqrt(x^2 + NaN^2) => sqrt(x^2 + NaN) => sqrt(NaN) => NaN* On Saturday, March 26, 2016 at 3:23:32 PM UTC-4, feza wrote: > > Why is hypot1 preferred (in Base) over hypot2 ? To me

Re: [julia-users] ANN: Quantumoptics.jl - a quantum optics toolbox for julia

2016-03-25 Thread Jeffrey Sarnoff
I don't know much about Quantum Optics beyond the fact that they were essential in seeing gravity waves. I do know nice docs -- and yours are. On Thursday, March 24, 2016 at 3:12:48 PM UTC-4, Sebastian Krämer wrote: > > Okay, thanks again. > > I also followed your advice and renamed the project

[julia-users] "in some cases using ifelse .. can eliminate the branch" [what cases]

2016-03-23 Thread Jeffrey Sarnoff
ifelse(condition::Bool, x, y) Return x if condition is true, otherwise return y. This differs from ? or if in that it is an ordinary function, so all the arguments are evaluated first. In some cases, using ifelse instead of an if statement can eliminate the branch in generated code

[julia-users] Re: Problems knowing when a promote_rule exists, and

2016-03-22 Thread Jeffrey Sarnoff
There is something that happens through [and it is either a guess or a partially coherent reflection that implicates] the ways that Nemo establishes shallow abstract hierarchies and short sequences of abstract subordination and how they work to clarify both the heavy interconnectedness of

[julia-users] Re: Problems knowing when a promote_rule exists, and

2016-03-22 Thread Jeffrey Sarnoff
aside: would it help others to find this to have a new thread that links here with the subject: why does checking that a promote_rule exists work in the REPL and not inside a module? On Tuesday, March 22, 2016 at 6:39:51 PM UTC-4, Jeffrey Sarnoff wrote

[julia-users] Re: Problems with in, == and Tuples of types

2016-03-22 Thread Jeffrey Sarnoff
That is not supposed to be how it works! As I recall there was a meetup where JeffB explains that promote_rule always never cares about the order of its arguments and internals generate lookups for both orderings. On Tuesday, March 22, 2016 at 6:26:51 PM UTC-4, Bill Hart wrote: > > OK I

[julia-users] Re: Problems with in, == and Tuples of types

2016-03-22 Thread Jeffrey Sarnoff
`@StefanKarpinski`? On Tuesday, March 22, 2016 at 5:10:03 PM UTC-4, Jeffrey Sarnoff wrote: > > afaik, Julia does elegant -- but I have no insight into the situation at > hand; tossing this to `@stefankarpinski` > > On Tuesday, March 22, 2016 at 3:52:23 PM UTC-4, Bill Hart wrot

[julia-users] Re: Problems with in, == and Tuples of types

2016-03-22 Thread Jeffrey Sarnoff
create the promote_rule_exists function in the REPL and call > it instead, it returns true. > > I have no idea why it would return a different value depending whether it > is inside a module or not. > > Any ideas? > > Bill. > > > > On Tuesday, 22 March 2016 20:03:4

[julia-users] Re: Problems with in, == and Tuples of types

2016-03-22 Thread Jeffrey Sarnoff
This checks whether a specific promote rule exists: promotionExists{T1, T2}( ::Type{T1}, ::Type{T2} ) = (Union{} != promote_rule(T1,T2)) On Tuesday, March 22, 2016 at 11:37:56 AM UTC-4, Bill Hart wrote: > > I'm having trouble understanding the following behaviour > in 0.5.0-dev+3171. I

Re: [julia-users] Tools for creating presentation slides with Julia code?

2016-03-22 Thread Jeffrey Sarnoff
I have been using Beamer in LaTeX with minted: copied or transcribed sections from the REPL into nice looking code using the minted environment.

[julia-users] Re: facing problem in building Pakages

2016-03-22 Thread Jeffrey Sarnoff
true On Tuesday, March 22, 2016 at 1:29:50 AM UTC-4, kunal singh wrote: > > trying using g++compiler-4.7 or above > > On Tuesday, March 22, 2016 at 6:28:06 AM UTC+5:30, Jeffrey Sarnoff wrote: >> >> For others, the package is here: SymEngine.jl >> <ht

[julia-users] Re: facing problem in building Pakages

2016-03-21 Thread Jeffrey Sarnoff
For others, the package is here: SymEngine.jl There is more difficulty within the package as it currently configured for distribution. It does not build properly for me on Linux. ERROR: LoadError: failed process: (`cmake ...`) ... while loading

Re: [julia-users] Re: Nothing conditional operator

2016-03-20 Thread Jeffrey Sarnoff
ood solution to this pattern, but there's >> been some discussion about it: >> https://github.com/JuliaLang/julia/issues/15174 >> >> You should definitely use a Nullable instead of returning nothing. >> >> >> Regards >> >> Le samedi 19 mars

[julia-users] Re: Is the terminology "keyword parameters" appropriate

2016-03-19 Thread Jeffrey Sarnoff
A parameter is a placeholder and an argument is a value held in place. Yes: in your example using a function plot, x and y are positional > parameters and style, width, color are keyword parameters. "solid" is the default value for the keyword style, it becomes the keyword's argument each

[julia-users] Re: Setting up Julia on Ubuntu 12.04

2016-03-19 Thread Jeffrey Sarnoff
Have you tried using the "Generic Linux binaries" http://julialang.org/downloads/ ? On Wednesday, March 2, 2016 at 9:44:37 PM UTC-5, karthik senthil wrote: > > Hey Tobias, > > Some relevant error lines from the log file - > >

[julia-users] Re: SharedArray - How to access across processes without a disk backed mmap'd file

2016-03-19 Thread Jeffrey Sarnoff
I have no idea. Maybe clarifying the distinction between "have a process create an anonymous backed SharedArray and dispatch work over it on other processes" and "use a named non-disk (virtual file) backed SharedArray from independent processes" would assist someone else in offering a

[julia-users] Re: Using PyPlot to work with obj files, noob question on arrays

2016-03-19 Thread Jeffrey Sarnoff
It is not clear to me what you are doing. Are you using https://github.com/JuliaIO/MeshIO.jl and https://github.com/JuliaGeometry/Meshes.jl ? (If not, start there). On Tuesday, March 8, 2016 at 8:18:04 AM UTC-5, kleinsplash wrote: > > Hi, > > I want to just load a mesh and plot it along with a

[julia-users] Re: Stuck with using and LOAD_PATH

2016-03-19 Thread Jeffrey Sarnoff
You don't need to do all that. The package manager is very helpful: http://docs.julialang.org/en/release-0.4/manual/packages/ For your own (local) packaged modules you can use Pkg.register("MyModuleName","MIT") On Wednesday, March 16, 2016 at 9:42:37 AM UTC-4, Gregory Salvan wrote: > > Hi, >

[julia-users] Re: fft normalization

2016-03-19 Thread Jeffrey Sarnoff
What do you feel is missing? On Monday, March 14, 2016 at 6:20:39 PM UTC-4, CrocoDuck O'Ducks wrote: > > Hi there cool people! > > I am making some Julia experiments around fft, conv and normalization. > Long story short, by using signals for which it is simple to calculate > analytically

[julia-users] Re: Nothing conditional operator

2016-03-19 Thread Jeffrey Sarnoff
You may be misusing nothing. It is unusual that a function would return nothing some of the time and something other times. Take a look at http://docs.julialang.org/en/latest/manual/faq/#nothingness-and-missing-values If you have additional questions about this, please give an example of what

[julia-users] Re: Is there going to be an abstract type/trait-ocalypse?

2016-03-18 Thread Jeffrey Sarnoff
There is much discussion about the ways forward here is a good place to look: https://github.com/JuliaLang/julia/issues/6975 fwiw, many people would like to be able to meld multiple kinds to express qualia and there is active interest in finding the elegant answer. On Thursday, March 17,

[julia-users] Re: how to write a julia rand conformant randfloat() with exponent range given

2016-03-18 Thread Jeffrey Sarnoff
19, 2016 at 12:06:32 AM UTC-4, Jeffrey Sarnoff wrote: > > I am not that familiar with rand stuff, and I'd like to get this right. > > The result should play well with other rand functions and give n > ldexp(randSignficand, randExponent) values where the range for the > signifi

[julia-users] how to write a julia rand conformant randfloat() with exponent range given

2016-03-18 Thread Jeffrey Sarnoff
I am not that familiar with rand stuff, and I'd like to get this right. The result should play well with other rand functions and give n ldexp(randSignficand, randExponent) values where the range for the significand and the exponent are specifiable. Thanks for any guidance.

[julia-users] Re: Is Julia good language to program expert systems ? Rete Algorithm ? Rules engine

2016-03-13 Thread Jeffrey Sarnoff
Is the product recommendation engine developing its recommendations strictly by following rules, or by property+condition+action logic, or by probing a database of what others have preferred and matching the requestor to some subset of qualities tracked within the database, or another way, or

[julia-users] Re: Column matrices: literals and conversion

2016-03-13 Thread Jeffrey Sarnoff
:11:37 AM UTC-4, Jeffrey Sarnoff wrote: > > +1 *that this can be changed* > > On Sunday, March 13, 2016 at 4:42:44 AM UTC-4, Toivo Henningsson wrote: >> >> The way I understand it, Julia has no syntax for single column (size >> (n,1)) matrix literals. >>

[julia-users] Re: Column matrices: literals and conversion

2016-03-13 Thread Jeffrey Sarnoff
+1 *that this can be changed* On Sunday, March 13, 2016 at 4:42:44 AM UTC-4, Toivo Henningsson wrote: > > The way I understand it, Julia has no syntax for single column (size > (n,1)) matrix literals. > Of course > > [1 2] > > [1 2; > 3 4] > > both create matrices, and I would

[julia-users] Re: error while loading shared libraries: libjulia.so

2016-03-12 Thread Jeffrey Sarnoff
Try using a prebuilt installation for your operating system: http://julialang.org/downloads/ On Wednesday, March 9, 2016 at 7:38:34 PM UTC-5, Manu Jain wrote: > > My julia code compile successfully. But when I try to run the excecutable > it shows - "error while loading shared libraries:

[julia-users] Re: GSoC Matrix and Fast Bignums

2016-03-12 Thread Jeffrey Sarnoff
Hello Juan, I have some experience with Julia's BigNums and have experimented with faster fixed precision (128 bits) floating point type implementations (and don't know about Julia's Matrix work, and am not involved with GSoC). For a small first place, I suggest something that will increase

[julia-users] Re: what name would you give to the functional 'complement' of trunc()?

2016-03-12 Thread Jeffrey Sarnoff
meaning, I’d go with stretch. > > // T > > On Saturday, March 12, 2016 at 2:04:23 PM UTC+1, Dan wrote: > > trunc_to_inf and add an alias trunc_to_zero for regular trunc ?? >> >> On Saturday, March 12, 2016 at 1:49:41 PM UTC+2, Jeffrey Sarnoff wrote: >>> >&

[julia-users] what name would you give to the functional 'complement' of trunc()?

2016-03-12 Thread Jeffrey Sarnoff
x = trunc(fp) yields fp rounded towards zero to the closest integer valued float. What name would you give to the complementary function, rounding away from zero to the closest integer valued float? stretch(fp) = signbit(fp) ? floor(fp) : ceil(fp) # abs(trunc(fp) - stretch(fp)) is 0.0 when

Re: [julia-users] Type parameters and Numbers

2016-03-11 Thread Jeffrey Sarnoff
and with that, goes: import Base: length length{N}(x::SomeType{N}) = N On Wednesday, March 9, 2016 at 5:18:18 AM UTC-5, jw3126 wrote: > > Nice this is much cleaner! > > On Wednesday, March 9, 2016 at 10:49:03 AM UTC+1, Milan Bouchet-Valat > wrote: >> >> Le mercredi 09 mars 2016 à 01:41 -0800,

Re: [julia-users] Code doesn't work, i can't figure out why? Please have a look!

2016-03-11 Thread Jeffrey Sarnoff
Julie, it may help someone else to understand what is needed if you would share what it is that you are trying to accomplish in words. On Friday, March 11, 2016 at 12:24:36 PM UTC-5, Julia Tylors wrote: > > Maybe the code generated should be looking something like this : > > > GenSym(0) = >

Re: [julia-users] Re: good practice question: dispatch on type or on type instance

2016-03-11 Thread Jeffrey Sarnoff
Val types exist for their flexibility -- which is a powerful addition, when needed. In some sense, Val types run around the usual category-focused manner and behavior for Types and in that documentation, the key phrase is "consistency across Julia." That is consistency in the use of Val

[julia-users] Re: good practice question: dispatch on type or on type instance

2016-03-10 Thread Jeffrey Sarnoff
<:AbstractFloat}(::T) = precision(T) On Thursday, March 10, 2016 at 2:15:05 PM UTC-5, Jeffrey Sarnoff wrote: > > There are situations in which dispatching off of Type(s) is necessary. > Dispatching through Types by way of typed instances (realizations) is more > common, and the only

[julia-users] Re: good practice question: dispatch on type or on type instance

2016-03-10 Thread Jeffrey Sarnoff
:42:56 PM UTC-5, ben wrote: > > Thanks. I understand that, but is there a specific reason why doing: > > takedecision{H <: Dice}(::Type{H}) > > is bad / not as good? > > On Thursday, March 10, 2016 at 1:06:01 PM UTC-5, Jeffrey Sarnoff wrote: >> >> when you do &

[julia-users] Re: good practice question: dispatch on type or on type instance

2016-03-10 Thread Jeffrey Sarnoff
when you do immutable Dice end or type Dice end you create a singleton type -- there can be only one instance (or all instances are that identical single instance). To realize a singleton type, call it: myDice = Dice(); myCoin = Coin() now, you can use choose(x::Dice) = println("throw the

Re: [julia-users] ccall using streams and printing to STDOUT, string

2016-03-09 Thread Jeffrey Sarnoff
Thanks again. I found a way through the apps' internal get_string. On Wednesday, March 9, 2016 at 7:41:32 PM UTC-5, Jeffrey Sarnoff wrote: > > can it be used to convert a c FILE (STDOUT) to a specific julia IO object? > > On Wed, Mar 9, 2016 at 6:43 PM, Yichao Yu <yyc1...@g

Re: [julia-users] ccall using streams and printing to STDOUT, string

2016-03-09 Thread Jeffrey Sarnoff
can it be used to convert a c FILE (STDOUT) to a specific julia IO object? On Wed, Mar 9, 2016 at 6:43 PM, Yichao Yu <yyc1...@gmail.com> wrote: > On Wed, Mar 9, 2016 at 5:36 PM, Yichao Yu <yyc1...@gmail.com> wrote: > > On Wed, Mar 9, 2016 at 5:21 PM, Jeffrey Sarn

Re: [julia-users] Re: What to read to understand finishing v0.5?

2016-03-09 Thread Jeffrey Sarnoff
g on this?" etc. > > > On Wed, Mar 9, 2016 at 5:02 PM, Jeffrey Sarnoff > <jeffrey...@gmail.com > wrote: > > With the ability to add methods to an abstract type, so we do not lose > that > > important capability; makes sense to me. > > > > On Wedne

Re: [julia-users] ccall using streams and printing to STDOUT, string

2016-03-09 Thread Jeffrey Sarnoff
own line) unknown function (ip: 0x401865) /home/jas/Desktop/Juliav05: line 2: 4104 Segmentation fault /usr/bin/julia _ (generic Linux version of julia) On Wednesday, March 9, 2016 at 2:55:31 PM UTC-5, Jeffrey Sarnoff wrote: > > Thank you, much appreciated. > > On W

Re: [julia-users] ccall using streams and printing to STDOUT, string

2016-03-09 Thread Jeffrey Sarnoff
Thank you, much appreciated. On Wednesday, March 9, 2016 at 2:52:01 PM UTC-5, Yichao Yu wrote: > > On Wed, Mar 9, 2016 at 1:05 PM, Jeffrey Sarnoff > <jeffrey...@gmail.com > wrote: > > I am bound to the api, at least for calling into the application. I > don't &

Re: [julia-users] ccall using streams and printing to STDOUT, string

2016-03-09 Thread Jeffrey Sarnoff
I am bound to the api, at least for calling into the application. I don't know how to do either of the things you recommend. Could you point me to an example? On Wednesday, March 9, 2016 at 12:58:20 PM UTC-5, Yichao Yu wrote: > > > On Mar 9, 2016 12:38 PM, "Jeffrey Sar

[julia-users] ccall using streams and printing to STDOUT, string

2016-03-09 Thread Jeffrey Sarnoff
I am trying to wrap this so it will (a) print to STDOUT (b) (if possible) print to a string: void arf_fprint(FILE ** file*, const arf_t * x*)¶ Prints *x* as an integer mantissa and exponent to the stream

[julia-users] Re: QuantLib in Julia: JQuantLib (very very alpha stage at this point!)

2016-03-01 Thread Jeffrey Sarnoff
As Eric suggests, naming it QuantLib.jl works best with the package ecosystem and it is not in use elsewhere. On Tuesday, March 1, 2016 at 8:40:32 AM UTC-5, Luigi Ballabio wrote: > > Very interesting--drop me a line if you want me to add a link to your > project on the QuantLib site. One thing

Re: [julia-users] Re: QuantLib in Julia: JQuantLib (very very alpha stage at this point!)

2016-03-01 Thread Jeffrey Sarnoff
As Eric suggested, calling it QuantLib.jl works best for package standardization, and is not used elsewhere. On Tue, Mar 1, 2016 at 5:09 AM, Luigi Ballabio wrote: > Very interesting--drop me a line if you want me to add a link to your > project on the QuantLib site.

[julia-users] Re: QuantLib in Julia: JQuantLib (very very alpha stage at this point!)

2016-02-29 Thread Jeffrey Sarnoff
nice undertaking! On Monday, February 29, 2016 at 11:32:16 AM UTC-5, Christopher Alexander wrote: > > Hello all, I'd like to point people in the direction of a package I've > been working on: JQuantLib, to get some feedback. Basically, I am trying > to write a version of the very popular

[julia-users] Re: Defining a new numeric type with minimal effort

2016-02-29 Thread Jeffrey Sarnoff
Kevin, If all that you ask of this type is that it does arithmetic, clamps any negative values to zero, and clamps any values greater than one to one, that is easy enough. Just note that arithmetic with probabilities usually is more subtle than that. import Base: +,-,*,/ immutable

[julia-users] Re: [ANN] GLVisualize

2016-02-26 Thread Jeffrey Sarnoff
Last night I was wondering about what software to use to make visualizables; there was nothing for that within Julia then. You must work very fast. Thank you. On Friday, February 26, 2016 at 5:11:02 PM UTC-5, Simon Danisch wrote: > > Hi > > this is the first release of GLVisualize.jl >

[julia-users] Re: sizeof confusion and converting arrays

2016-02-25 Thread Jeffrey Sarnoff
as Erik says: immutable Point # immutable is the kind of type to use when you want memory to be immediate x::Cdouble y::Cdouble end a = [Point(0.0, 0.0),Point(0.2,0.3),Point(1.1, 1.3)] sizeof(a) 48 On Thursday, February 25, 2016 at 4:34:20 PM UTC-5, Martin Kuzma wrote: > > I have the the

[julia-users] Re: deepcopy_internal and arrays

2016-02-24 Thread Jeffrey Sarnoff
(offered with the caveat that I cannot answer your question) It seems to me that duplicating any singleton is incorrect, and so this is appropriately an "issue" with deepcopy. On Tuesday, February 23, 2016 at 10:10:24 AM UTC-5, Bill Hart wrote: > > Just correcting a typo in my question (the

[julia-users] Re: Loading a module without loading its submodules

2016-02-24 Thread Jeffrey Sarnoff
end end Then, before using ScikitLearn, define skLinearModel true. julia> skLinearModel=true julia> using ScikitLearn On Wednesday, February 24, 2016 at 4:28:08 PM UTC-5, Cedric St-Jean wrote: On Wednesday, February 24, 2016 at 4:15:49 PM UTC-5, Jeffrey Sarnoff wrote: > >

<    1   2   3   4   5   6   >