« first day (1193 days earlier)      last day (3305 days later) » 

6:55 AM
Eh. Why this doesn't produce a result? Minimize[{a + b, a >= 0 && b > 0 && a + 1 == 2^b}, {a, b}, Integers]
Shouldn't be that hard.
 
 
3 hours later…
10:08 AM
Hey guys! I asked this before but I no longer remember how you do it. Which function should I use to edit a plot after it was outputed. For instance, changing the plot label?
 
11:04 AM
no one works on weekends :P
 
I doubt hanging on chat is work for many...
 
hey, i'm working even though I have this in here on the 2nd screen! :o
 
 
3 hours later…
1:52 PM
A quick question, how can I write a data object in Mathematica, like ContinuousWaveletData? For example, it has many properties that can be used like ContinuousWaveletData[...]["Properties"].
 
 
2 hours later…
3:35 PM
@xslittlegrass
myDataType[_]["Properties"] := {"Prop1", "Prop2"}
myDataType[a_]["Prop1"] := Length@a
myDataType[{1, 2, 3}]["Prop1"]
I've never been so impressed with Google Maps/Earth 3D as when someone asked me about a float trip down the Colorado River.
 
3:57 PM
@MichaelHale Thanks! How about the data structure with more than one elements, for example myDataType[a,b,c] ?
 
@xslittlegrass __ (BlankSequence) just like you would for single-level downvalues.
 
@MichaelHale OK that works. Do you know some code examples of this kind of user-defined data structure somewhere?
 
 
1 hour later…
5:23 PM
@xslittlegrass No, I'm only familiar with it from objects and operator forms from Wolfram. I'd just start coding however feels simplest and then you can always adjust later if you run into problems.
 
 
2 hours later…
7:21 PM
@MichaelHale OK, thanks!
 
@MichaelHale I see steam there! wanna add me? :)
 
@Sosi Sure! In GTA 5 now. Same username? I'm wakebrdkid I think. I'll add you in a bit.
 
I'll add you, my username is chicha there ;)
I can't find you. I'm currently called "Chicha | Buying cards"
gotta change that
 
7:55 PM
20
Q: How to implement FittedModel like objects

GabrielIn the course of making some RLink wrappers I want to have some richer containers like Mathematica does with its FittedModel code. I thought I had a good idea of how this might be done, i.e make a custom Format specification that hides some arguments and use DownValues to give different parts of...

(pretty much what Michael suggested above)
 
8:14 PM
@Sosi Try wakebrdkid12. I don't think I was quick enough to avoid a number. If that doesn't work I'll add you in a bit. Typing on phone now.
 
@MichaelHale I'm not find that either :\ it's ok, whenever you have the time!
 
@rm-rf Thanks, that's very useful! When using this data objects (like FittedModel, ContinuousWaveletData, etc.), it's very convenient and coherent. I've been always wanted to learn how to structure a package with coherence similar to those objects. So are you aware of any source specifically discuss this kind of objects/data structure in Mathematica?
@rm-rf Also, Do you know any examples of this kind of data objects in the AddOn package folder that I can look at the source code?
 
8:35 PM
@Sosi Added you
 
@MichaelHale gotcha! thanks!
I dont know why I wasn't finding you
 
8:52 PM
Does anyone have problem with DistributeDefinitions? On my computer it sometimes takes forever to distribute the definitions.have
 
9:18 PM
@xslittlegrass Sorry, don't know much about stuff in the add on folders. I've used this style extensively to create custom data objects in my packages but none of them are public.
 
9:44 PM
@rm-rf OK, thanks anyway.
 
Is it only in my mind that it doesn't make sense that ReplacePart[list,{All,3}->2] doesn't work, but ReplacePart[list,{_,3}->2] does?
 
10:05 PM
@Sosi I think I agree with the implementation here. Note that {All, 3} is not a valid specification even for Part. I'm guessing ReplacePart is implemented as a replacement rule applied to the array rules for the input list. This makes sense given that you can use patterns and it can also be applied to sparse arrays.
A very simple toy implementation of ReplacePart like my guess:
ClearAll@replacePart
replacePart[list_, patt_ -> value_] :=
ArrayRules[list] /. HoldPattern[pos_?(MatchQ[patt]) -> _] :> pos -> value // SparseArray // Normal

replacePart[{{1, 2}, {3, 4}}, {_, 1} -> x]
(* {{x, 2}, {x, 4}} *)
 

« first day (1193 days earlier)      last day (3305 days later) »