« first day (1846 days earlier)      last day (2655 days later) » 

2:30 AM
@QPaysTaxes If I literally translate your C code I get the following:
num = 1000;
count = 0;
halfNum = Floor[num/2 + 1];
For[i = 1, i <= halfNum, i++,
  If[Mod[num, i] == 0, count++]
  ];
count + 1
But in Mathematica you can do:
Length@Divisors@num
Or
DivisorSigma[0, num]
 
2:52 AM
@QPaysTaxes
myDivCount[num_] := Module[{count, halfNum, i},
  count = 0;
  halfNum = Floor[num/2 + 1];
  For[i = 1, i <= halfNum, i++,
   If[Mod[num, i] == 0,
    count++
    ]
   ];
  count + 1
  ]
Oops, add i as a local variable too
Looking at your attempt, you only want to use a delayed definition (:=) on your function, not variables. Then if you aren't wrapping the whole thing in Module or something, you need to put parentheses around the definition, or the definition will only go to the first semicolon.
You need to explicitly test if the Mod is 0 or use Divisible in the If. You only need Return if you want to return something that is not the value of the last expression. The value of the last expression is returned automatically.
 
 
5 hours later…
8:20 AM
@J.M. could we have some kind of collective topic about parser/highlighting bugs? mathematica.stackexchange.com/q/121466/5478
 
 
7 hours later…
3:37 PM
@Szabolcs Can SystemID from PacletInfo work with general OS name? Like "Windows"? It will not pass a paclet which $SystemID isn't included in SystemID. So to ban Linux I'd have to include every possible Windows id like "Windows-x86-64". Not so convenient.
@Szabolcs Tried to play with Qualifier but to no avail.
 
3:58 PM
@Kuba Good question, don't know ...
May need to go spelunking
 
@Szabolcs Can live without this but it is another question to ask WRI
 
@Kuba Spelunk[PacletManager`Package`systemIDMatches], seems all of them need to be listed
 
@Szabolcs that's a pity, would be nice to have string expressions based matching.
 
I'm trying to figure out what Qualifier is. I found a test (with comments) that considers two paclets to be the "same" if the name and qualifier matches.
 
@Szabolcs Ah, so there may be different packages for Win and OSX build around the same core. Makes sense but it doesn't do what I need :) and some existing values like Win or Win64 misslead me.
 
4:08 PM
I have the impression that the qualifier is there for distinguishing paclets, not for marking their compatibility.
there's a "full qualified name" which is either name-1.0.0 or name-qualifier-1.0.0
 
good to know
 
there are very few actual uses of the qualifier, and it can be a string like "Mac", which is neither $OperatingSystem nor $SystemID
 
Yep
 
@Kuba I think there are only two $SystemIDs for Windows right now. Windows and Windows-x86-64.
 
@Szabolcs what about OSX?
 
4:13 PM
currently "MacOSX-x86-64" only, there's no 32-bit kernel available
don't know the previous ones
Linux: Linux-x86-64, Linux, Linux-ARM, at least
I think the 32-bit Intel OS X $SystemID was MacOSX. But what about the PowerPC one before that? I don't know.
 
@Szabolcs you can add it here: mathematica.stackexchange.com/a/134949/5478 better that than nothing.
 
Perhaps do not filter the paclets by OS. Just let them load on any system, then check $OperatingSystem within the package
 
@Szabolcs yep, that is what I do atm but it would be nice to have more things done within PacletManager.
 
 
1 hour later…
5:39 PM
hi guys, can you help me on this ? i have a list of 3d vector list = {{1,2,3},{4,5,6},{6,7,8}} only much longer . every-time i try to add a 3 dimensional vector to the entire list mathematica says : "Objects of unequal length in \
{{1,1,1},{1,1,4},{1,1,7},{1,1,10},{1,1,13},{1,1,16},{1,1,19},{1,1,22},\
{1,1,25},{1,1,28},{1,1,31},{1,1,34},{1,4,1},{1,4,4},{1,4,7},{1,4,10},{\
1,4,13},{1,4,16},{1,4,19},{1,4,22},{1,4,25},{1,4,28},{1,4,31},{1,4,34}\
,{1,7,1},{1,7,4},{1,7,7},{1,7,10},{1,7,13},{1,7,16},{1,7,19},{1,7,22},\
i know it's probably something easy but shit i can't remember it
 
@Alucard You have to transpose the list, i.e. (list\[Transpose] + {1, 1, 1})\[Transpose] That's a long-time annoyance in Mathematica. See mathematica.stackexchange.com/q/23395/121 for one treatment of this. You can also use # + {1,1,1} & /@ list but that is an order of magnitude slower.
 
@Mr.Wizard oh thanks, i didn't know about this problem. that's weird, why haven't they fixed it?
they could just add an option in the plus function
 
@Alucard No, it's not just the Plus function, its any operation on an array of this type. There is some ambiguity in the operation (see Simon's self-Q&A I linked) and they may have wanted to avoid this. I suspect that now it is one of those things where they don't want to change established convention within the language, even if it is sub-optimal.
I am hoping that we eventually get a refresh of the language itself with certain changes necessary for optimal performance and also better handling of niggles like this. Something else that might be addressed at that time for example:
98
Q: Why are numeric division and subtraction not handled better in Mathematica?

Mr.WizardThere is something that has been troubling me for a while. At least through version 10.0 the performance of a / b and a - b is not equivalent to, and significantly inferior to, Divide[a, b] and Subtract[a, b], despite the fact that these are treated as equivalent in the documentation. As a ters...

@Alucard some arguably beneficial changes would break backward comparability. For an interesting example of this where it is apparently being argued over within WRI see this video:
 
5:54 PM
i guess these things happens when a program becomes popular and old
 

« first day (1846 days earlier)      last day (2655 days later) »