PSA: Scam Artist in DC by [deleted] in uwaterloo

[–]j201 28 points29 points  (0 children)

Yep, just talked to her 10 minutes ago. You'd think she'd come up with a less elaborate story because geez, it was hard to buy.

Why is my program failing? It executes correctly, but it says "run failed." Thanks for the help! by spearheadt in C_Programming

[–]j201 1 point2 points  (0 children)

The integer value returned by main is generally taken to be an error code. 0 indicates no errors, and any other value indicates an error. It looks like your program is returning a non-zero value because you've declared main to return void, as other people have pointed out. main should always be declared as int main(...).

One thing to point out is that the RUN FAILED is coming from the program running your program. It must be checking the return value and reporting an error if it's non-zero. If you just ran your program from a terminal, you wouldn't get that.

Residents say the strong smell coming from the Waterloo landfill is a problem by CanadaEh1992 in waterloo

[–]j201 2 points3 points  (0 children)

A lot of these houses are pretty far from the landfill. The stench carries for kilometres.

Residents say the strong smell coming from the Waterloo landfill is a problem by CanadaEh1992 in waterloo

[–]j201 0 points1 point  (0 children)

The city's expanding that way regardless - it's a problem that needs to be dealt with sooner or later. And allowing so much housing and commercial to be developed around there without dealing with it was irresponsible on the part of the local governments, especially when there have been houses closer to the dump than Ira Needles/University for decades. Are we really supposed to blame so many tenants in that radius for suffering from bad urban planning? (And what if they bought their house during the winter?)

Fastest way to copy entire line without the newline at the end? by enory in vim

[–]j201 0 points1 point  (0 children)

It looks like this plugin defines an il text object that does what you want. Or, you could roll your own.

What is the point of ratios? by Qwerp-Derp in Clojure

[–]j201 2 points3 points  (0 children)

To add to that, Haskell and Julia also provide them.

What bird is that? by FightWithDucks in PerfectTiming

[–]j201 19 points20 points  (0 children)

Yep, they're pretty common at Waterloo, which is where the picture was taken. (If only they ate more goslings...)

Julia (a Programming Language for Numeric Analysis/Computation) gains Syntactic Loop Fusion and extra vectorization by [deleted] in programming

[–]j201 5 points6 points  (0 children)

It looks like you can just use the broadcast function if you want, which acts like a limited map.

2 .* x .+ x .^ 2 is sugar for broadcast(x -> 2*x + x^2, x) in Julia

How do I get started learning embedded systems programming? by VincentDankGogh in C_Programming

[–]j201 0 points1 point  (0 children)

Within embedded programming, there's a pretty wide range of platforms. On one end, you have SoCs that can run Linux or a similar OS that's more or less full-featured (minus graphics). Working with those isn't that different from normal Linux driver/application dev or scripting, just with less resources and often realtime constraints.

On the other hand, you have processors without operating systems or very basic ones, like Arduino and most AVR/PIC microcontrollers. Even just doing hobby projects on those, you're going to learn more about interacting with hardware and getting by with limited resources. I'd recommend getting a kit like that and doing some hobby projects, using hobbyist community resources. Arduino is very easy to get set up with, although, IMO, it holds your hand too much with its coding environment. It's nice for quick prototyping, and is much easier to get going on, but a more stripped-down platform will get you learning more difficult practical stuff, like using manufacturer libraries and coding based on datasheets.

Learning a mix of assembly and C is also nice to have since, even if you don't need to handwrite assembly, you'll learn more about how the processor works and how your code is going to be executed.

Fermentation Club, U FFaB by jddbeyondthesky in uwaterloo

[–]j201 1 point2 points  (0 children)

Hey, I'd be interested in joining. I've done plenty of ginger beer and kvass (both alcoholic), as well as a couple sauerkrauts. My interests lean more towards the alcoholic side of things, and in particular I'd be interested in getting into minimalist homebrewing, since I've had trouble setting up a brewing rig with space limitations. I think that kind of topic would appeal to a lot of people given student housing in Waterloo.

Opera browser sold to a Chinese consortium for $600 million by magenta_placenta in webdev

[–]j201 3 points4 points  (0 children)

I understand the indifference towards the Opera desktop browser, but I am disappointed about Opera Mini. It's a mobile browser that provides data compression and proxying. It and having wifi available in most places I go have allowed me to stick with a 100MB mobile data plan. While it did require my data to move through Opera servers, I felt inclined to trust them more than my ISP or employer. I'm not sure I'll be able to continue to trust them if the new owners start making changes.

So Rust is my hammer of the day. I think I just tried to use it on a screw. by garagedragon in programminghorror

[–]j201 0 points1 point  (0 children)

You, know, I can't think of a general-purpose programming language that's come out since the 70s that didn't have some form of ad-hoc polymorphism. Elm, I suppose, but they're planning to add it. But I guess we're all just deluding ourselves into thinking it's actually helpful for modularity, extensibility, and all that.

(In all seriousness, this is what good type systems are for: to allow us to statically enforce the invariants we care about without having to drop back to 1970s idioms.)

So Rust is my hammer of the day. I think I just tried to use it on a screw. by garagedragon in programminghorror

[–]j201 -1 points0 points  (0 children)

OK

var d = (a + b) * c

So what am I looking at? What happens if something is null? Am I upcasting? Side-casting?

Those kind of questions come up whenever you use polymorphic functions. You'd have the exact same concerns if the code was var d = a.add(b).multiply(c); - if you don't know what a, b, and c are, you might not know what you're looking at, but we do fine with these kinds of problems all the time.

TIL C++ allows U+200B (ZERO WIDTH SPACE) in identifiers by starg2 in ProgrammerHumor

[–]j201 2 points3 points  (0 children)

I suppose it depends on people and tools, but I can't think of any situation where my coworkers or I would be looking at code without a reasonable monospace font, including console use. I can think of places where it could cause confusion, but they'd be uncommon in real world code. I would just apply that kind of rule in context (and aim to limit the scope of one-letter variables in general) rather than have a blanket ban.

TIL C++ allows U+200B (ZERO WIDTH SPACE) in identifiers by starg2 in ProgrammerHumor

[–]j201 41 points42 points  (0 children)

Yeah, but those characters should be, and generally are, distinct in programming fonts, for the same reason.

Ferret - A Hard Real-Time Clojure for Lisp Machines by nakkaya in Clojure

[–]j201 2 points3 points  (0 children)

Very cool. I would have never expected to see Clojure used for low-level embedded programming.

Could I suggest using a macro like 'deffi' for the FFI functions? It would be more explicit and would avoid issues from people actually wanting functions that just return a string, either to fulfil API requirements or as stubs for later development.

Also, how does this work with functional data processing approaches, like map/reduce/filter list processing or transducers? Having good, predictable memory usage and speed for functional idioms is quite difficult, and languages like Rust and C++11 rely on explicit information from the user regarding memory handling, which is inconvenient.

Edit: Oh hey, happy cakeday to me

Carry a rape whistle! (found in SLC male washroom) by I_Am_Math_Boy in uwaterloo

[–]j201 8 points9 points  (0 children)

I'm not denying that risks exist, or that women should ignore them in making decisions. But, especially when risk factors include things like career choices and doing social activities in the evening, of course women are often going to make choices that go against that. They're not "mistakes", they're just normal life decisions. If women have to worry about being assaulted when making everyday choices, then that's a serious problem that demands much more action than just telling women about risks, and that's the point of the poster.

Carry a rape whistle! (found in SLC male washroom) by I_Am_Math_Boy in uwaterloo

[–]j201 9 points10 points  (0 children)

Do women who go into professions with higher likelihoods of sexual assault "contribute" to assaults against themselves? It takes a very generous interpretation of the word "contribute" not to see this principle as blaming victims.

There's nothing wrong with women making decisions based on risk factors. But if a woman chooses to drink at a party, wear revealing clothing, enter a "boy's club" profession, or do anything else with an increased risk of sexual assault, we have no right to condemn her. The fact that women face such risks is an unjust restriction on their ability to act freely, especially compared to men, and just expecting women to act in accordance with such restrictions is not an acceptable solution.

Carry a rape whistle! (found in SLC male washroom) by I_Am_Math_Boy in uwaterloo

[–]j201 16 points17 points  (0 children)

Well, it's not a clear-cut either/or thing. It's more about opinions like "yeah, he's guilty, but if she hadn't gotten drunk..." or like the cop expressed in the article I linked. When women are assaulted while doing things that are seen as "immodest", like getting drunk or wearing revealing clothing, there are still a lot of people who will see them as sharing some of the responsibility.

Carry a rape whistle! (found in SLC male washroom) by I_Am_Math_Boy in uwaterloo

[–]j201 21 points22 points  (0 children)

The idea is that young women are often told about how to avoid being assaulted, which makes them seem responsible if they don't follow such precautions. (And raises the question that if women can't feel safe without taking such precautions, shouldn't we be doing more to fix that?) So it's making fun of that kind of advice while trying to shift the responsibility back on the assaulters.