search results matching tag: adjustment

» channel: learn

go advanced with your query
Search took 0.001 seconds

    Videos (159)     Sift Talk (36)     Blogs (12)     Comments (1000)   

BSR (Member Profile)

Tabs v(ersu)s Spaces from Silicon Valley S3E6

MilkmanDan says...

(**EDIT** hmm, code HTML tag doesn't seem to allow whitespace to show at the beginning of lines, so I'm replacing spaces with _underscores_ in the pseudocode below)

Code uses spaces or tabs to visually distinguish the flow of the program, what code belongs to what functions / loops / whatever.

Here's some C-style "pseudocode" that should get the idea across:

void function fizzbuzz {
__for (i = 1; i <= 100; i++) {
____set print_number to true;
____If i is divisible by 3
______print "Fizz";
______set print_number to false;
____If i is divisible by 5
______print "Buzz";
______set print_number to false;
____If print_number, print i;
____print a newline;
__}
}


The braces { } show the beginning and ending of a "function" (essentially one of potentially many self-contained algorithms in a program) and the beginning and ending of a "for loop" (that will repeat the code inside it some number of times). And the "if" statements will only perform the stuff after them IF the test they perform evaluates to true.

So in that pseudocode, there's sort of 4 tiers or things going on. First is the function (named "fizzbuzz"). Since functions are kind of the most basic structural unit of the code, they are on the far left -- not indented at all. Sorta like Roman Numerals in an outline.

Then, the actual content of that function (the code that makes up its algorithm) is set a consistent amount of space to the right to make it clear that it is contained inside the function. That can be done with *1* tab, or some consistent amount of spaces so that it lines up. The only thing in that tier is the "for loop" and the braces that show its beginning and end.

Then the content of the for loop is set a bit further to the right (with another space or another set number of spaces). All of the "if" statements are at that 3rd tier level, along with a bit more code at the beginning and end. Then, the actual content of the if statements is set one more tier to the right to help distinguish that it will only run IF the conditions are met.

That pseudocode uses spaces for all of the tiering -- 2 spaces per tier. I'm a tab person like the guy Richard in the video, because it seems easier to press tab once per tier than hitting the spacebar 2/3/4 times per tier. But it really is just a personal preference issue, because as he said in the video, by the time the code is compiled (turned into an executable file that the computer can run) the final result will be the same whether the programmer used spaces or tabs.

But like with many things, Silicon Valley really hits the nail on the head here. Programmers tend to be very set in their ways and anal about their style preferences for code. If we have to go through someone else's code that doesn't follow our style conventions exactly, it kinda tends to throw us out of whack. To make an analogy with something less nerdy, consider how annoying it can be when someone borrows your car and you have to adjust the seat / mirrors / radio stations etc. when you get back in.

eric3579 said:

Don't think i've ever used a tab outside filling in a form or playing video games. Does the tab thing have more to do with writing code?

Old man jamming out to Metallica

Drachen_Jager says...

I read an article recently about a study of '80s kids and how they adjusted. Grouped by music preference, Heavy Metal fans were the happiest and best-adjusted of all.

So I guess that means I might be happy and well-adjusted one day... >sigh<

Why Is Salt So Bad for You, Anyway?

transmorpher says...

Your taste buds adjust within about a week, and things actually begin to taste better, because you can taste the flavours of the actual ingredients instead of just salt.

If you gradually ease off the salt, you never even notice (until you eat something that isn't salt reduced, and it will taste way too salty).


It's a lot easier than using a penis pump or popping viagra's later in life ;-)

SeesThruYou said:

Eat well, stay fit, and DIE anyway. I'd rather live 50 years as a free man, than 100 years in a prison. Pass the salt, please.

New Rule: The Lesser of Two Evils

MilkmanDan says...

I appreciate your argument, but I don't share your alarm.

Displaced by sea level rise (which would be a gradual thing, but I agree very serious), combined with droughts/floods might potentially fall under "decimation". But only, I think, to the historical definition of 10% dead. Include wars resulting from territory and resource squabbles (should that count as fallout of climate change?), and it could be (much) worse. But still not on a 4-year timescale.

Second, if we're already "way past the tipping point", it logically follows that blame for that can't really be laid on Trump. His policies can certainly make things worse, but I think that 4 years of terrible climate policy in ONE country on Earth (granted, a country with a lot of influence) simply aren't going to be catastrophically, drastically worse than 4 years of magically ideal climate policy (even in a hypothetical scenario where Nader or Stein or Clinton or whatever ideal person was president and could dictate perfect climate policy without being filtered by congress).


So to answer your question, basically no, I don't think that "raising our emission levels exponentially while advocating closed borders will have an irreversible negative effect on the planet and humanity."

One, "exponentially" is an exaggeration. US emissions under Trump won't be an order of magnitude higher than they were under Obama, or would have been under Clinton. In the range of 10% to 50% higher seems well possible, but 100% higher (double) would be next to impossible. Worse, yes. Exponentially worse, no.

Two, "irreversible" is a word I would hesitate to use because it carries an implication that there is some magic bullet to immediately fix things. If a plague wiped humanity off the face of the Earth tomorrow, it would take some time for climate to adjust to pre-industrial levels. Like you said, it might take 25-50 years before things even could start getting better. But eventually, it could be mostly like we were never here. Some things about climate would never be the same, but in broad terms, things could get back to "normal" eventually.

On the other hand, if the plague wipes us all out on the last day of Trump's 4 years in office, it might take longer for that adjustment to happen. But not by a comparatively massive margin. So that's why I dislike "irreversible"; depending on what timescale you are referencing things are either already irreversible, or pretty close to a statistical wash (what's another 4 years in a recovery timeline of 250 years, or 100 in 10000?), or not worth worrying about at all (on a geological timescale that doesn't care 2 cents about things like species extinctions). Does that make sense?

Finally, "negative effect on the planet and humanity" is something that I totally agree with. And that negative effect will be real and significant. But I don't think that the walking disaster that is Trump will make things inescapably, horrifically worse. Not enough worse that it makes a persuasive argument to me that I should have voted for Clinton (again, I didn't vote for Trump, but I didn't vote for Clinton either).

I dunno. Maybe I'm a cockeyed optimist.

newtboy said:

Consider the problems the world is having absorbing <5million Syrians....now multiply that refugee number by 100 to include those displaced by sea level rise, exceptional drought or flooding, and loss of historic water supplies like glaciers, and assume every country is having internal problems for the same reasons. How do you solve that issue, which is inescapable and already happening world wide? Consider that privately, climate scientists will tell you we are way past the tipping point already, we can't avoid worsening the serious climate issues we already have, because the atmosphere is quite slow to react, so even if we cut emissions to zero tomorrow, we've got 25-50 years of things getting hotter and more acidic before it could get better.
Now, with those two related issues already beyond a tipping point, you don't think raising our emission levels exponentially while advocating closed borders will have an irreversible negative effect on the planet and humanity? I agree, his administration alone won't doom us all, but they may make the pending doom far more inescapable in just 4 years, and exacerbate the associated problems horrifically.

How to fix a round cage.

Blower impeller design experiments

Drachen_Jager says...

Huge huge miscalculation on his part here.

Electric motors all have efficiency curves which show the efficiency (power output to power input) relative to the RPMs of the motor. Without addressing that, the rest of this experiment is meaningless. If he tested it on ten different motors he'd come up with ten completely different results.

What he SHOULD have done was to use a motor that he can fix the RPMs, adjust it to the peak efficiency RPMs for each setup and then measure windflow and power consumption. That would give him some numbers he can use.

Dog with custom wheelchair runs around dog park

AHCA: A Republican Response to The Affordable Care Act

TheFreak says...

Fixes to the ACA should have been happening all along. Annual tweaks and adjustments would have prevented most or all of the problems it's experiencing right now.

Of course, the conservatives in Congress only benefited from letting all those people suffer through the widening cracks in the system.

Even now, it would be easier and more cost effective to fix the system but once again, the conservatives would rather cut off their own nose to spite their face rather than look out for the best interest of the people who trust them to do the right thing.

This TrumpCare is going to explode in the Republican's faces. Hubris is a helluva drug. (And cheaper if you buy it in Canada.)

I grew up in the Westboro Baptist Church.

bcglorf says...

Or perhaps more appropriately taking American laws that have been changed/revoked like:
If any slave resists his master... correcting such a slave, and shall happen to be killed in such correction... the master shall be free of all punishment... as if such accident never happened.

A bit closer to the mark of your snippets, and the later teachings that counter and adjust in the Bible.

bcglorf said:

Again,

If you want to take a book of rules and ignore it take American law and only read a portion of it like:
Whoever, owing allegiance to the United States, levies war against them or adheres to their enemies, giving them aid and comfort within the United States or elsewhere, is guilty of treason and shall suffer death

I suppose that in isolation suggests that American law justifies citizen's pulling out a gun and shooting people providing comfort to Americas enemies. Of course, if you read the WHOLE of American law you find there are things about due process and courts and other checks and balances in place. In fact, that the naive original reading is completely the anti-thesis of what American law advocates.

The point of course being that is EXACTLY the same thing you've done with the bible by entirely ignoring the existence of other parts in that address alter, or provide context on the pieces you picked out. You know, like some guy named Jesus that came along later and some folks have made a big deal about following the teachings of.

Should we Build a Wall? Great Walls through History

MilkmanDan jokingly says...

I am attempting to play Devil's Advocate and argue that while none of those walls really did much to serve their design goal of keeping "others" out, they may have been "successful" in other ways. This is what I came up with:

Hadrian's Wall: Served as the inspiration for The Wall in A Song of Fire and Ice / Game of Thrones. GoT is awesome, so ... totally worth it.

The Great Wall of China: Did essentially nothing to keep out Mongols, and up to a million or so people died making it, but hey -- today it is one of the biggest draws for tourism into China. China made $618 billion in tourism in 2015 alone, so surely it has already covered the adjusted-for-inflation cost to build it of $380 billion!

The Atlantic Wall: Sure, the Allies broke through it in Normandy in one day. But it forced them to plan how and where to attack it for months, and did result in ~10,000 Allied deaths compared to ~6,000 Germans.

However, that is tiny compared to the really bloody battles of WW2 like Stalingrad (~1.5 million dead), basically the result of Russia using their people as an expendable "meat wall" against the far better-equipped Germans.

...Hmmm -- maybe instead of a literal wall, we should follow a similar approach and just throw lots of expendable bodies at our border with Mexico. I suggest starting with 435 utterly worthless people (US Congressmen) and 55,600 functionally worthless people (TSA employees). Everybody wins!

Donald and the Terrible, Horrible, No Good, Very Bad ...

Mordhaus says...

No, I didn't confuse anything. Almost every single country benefits from 'illegal' immigrants as well as regular ones. France, for example, has thousands of illegal immigrants from mostly Islamic countries that provide services to it's mostly aging native population. We benefit no more and no less than any other nation from illegal immigration, as @newtboy mentioned, if you import food products or grow them locally you probably are benefiting from illegal immigration.

As far as your evidence, I hope this will suffice as 'some':

Steven A. Camarota, PhD, Director of Research at the Center for Immigration Studies, in a Jan. 6, 2015 article, "Unskilled Workers Lose Out to Immigrants," available at nytimes.com, stated:

"There are an estimated 11 million illegal immigrants in the country and we also admit over a million permanent legal immigrants each year, leading to enormous implications for the U.S. labor market. Bureau of Labor Statistics data show that there are some 58 million working-age (16 to 65) native-born Americans not working — unemployed or out of the labor market entirely. This is roughly 16 million more than in 2000. Equally troubling, wages have stagnated or declined for most American workers. This is especially true for the least educated, who are most likely to compete with immigrants (legal and illegal).

Anyone who has any doubt about how bad things are can see for themselves at the bureau's website, which shows that, as of November, there were 1.5 million fewer native-born Americans working than in November 2007, while 2 million more immigrants (legal and illegal) were working. Thus, all net employment gains since November 2007 have gone to immigrants."

Jan. 6, 2015 - Steven A. Camarota, PhD

George J. Borjas, PhD, Robert W. Scrivner Professor of Economics and Social Policy at Harvard University, in a Sep./Oct. 2016 article, "Yes, Immigration Hurts American Workers," available at politico.com, stated:

"[A]nyone who tells you that immigration doesn't have any negative effects doesn't understand how it really works. When the supply of workers goes up, the price that firms have to pay to hire workers goes down. Wage trends over the past half-century suggest that a 10 percent increase in the number of workers with a particular set of skills probably lowers the wage of that group by at least 3 percent. Even after the economy has fully adjusted, those skill groups that received the most immigrants will still offer lower pay relative to those that received fewer immigrants.

Both low- and high-skilled natives are affected by the influx of immigrants. But because a disproportionate percentage of immigrants have few skills, it is low-skilled American workers, including many blacks and Hispanics, who have suffered most from this wage dip. The monetary loss is sizable...

We don't need to rely on complex statistical calculations to see the harm being done to some workers. Simply look at how employers have reacted. A decade ago, Crider Inc., a chicken processing plant in Georgia, was raided by immigration agents, and 75 percent of its workforce vanished over a single weekend. Shortly after, Crider placed an ad in the local newspaper announcing job openings at higher wages."

Sep./Oct. 2016 - George J. Borjas, PhD

Vernon M. Briggs, Jr., PhD, Emeritus Professor of Labor Economics at Cornell University, in an Oct. 14, 2010 briefing Report to the US Commission on Civil Rights, "The Impact of Illegal Immigration on the Wages and Employment Opportunities of Black Workers," available at usccr.gov, stated:

"Because most illegal immigrants overwhelmingly seek work in the low skilled labor market and because the black American labor force is so disproportionately concentrated in this same low wage sector, there is little doubt that there is significant overlap in competition for jobs in this sector of the labor market. Given the inordinately high unemployment rates for low skilled black workers (the highest for all racial and ethnic groups for whom data is collected), it is obvious that the major looser [sic] in this competition are low skilled black workers…

It is not just that the availability of massive numbers of illegal immigrants depress wages, it is the fact that their sheer numbers keep wages from rising over time, and that is the real harm experienced by citizen workers in the low skilled labor market."

Oct. 14, 2010 - Vernon M. Briggs Jr., PhD

There are more educated people than I that hold the same opinion, but let me give you an easier to understand, and absolutely true, example. How do I know it is true? When I was a much younger man, I worked for a roofing company. So I lived it.

The company I worked for was owned by a family friend, who had worked for most of his life in the field and had an excellent reputation. However, in the 90's around the time NAFTA was passed and (not related, I hope) illegal immigration spiked in Texas, he began to lose out to other companies. He did some snooping around and found out they were often charging hundreds of dollars less in their estimates than he could possibly offer, at least while still making a profit. He also found out that the two companies that were taking most of his business were staffed with illegal workers, being paid much lower wages than he could give to his legal employees.

Fast forward a year and he was close to declaring bankruptcy. Just like any type of labor where you pay your employees little to nothing comparatively to their compatriots in the same field, you cannot compete fairly. Net result, he was forced to let us go one by one, replacing us with illegals.

Obviously, I moved on, learned a different skill and began to make far more than I would have as a simple laborer. But the fact remains that an entire industry was undermined and radically changed by the inclusion of cheap illegal labor. This will not change if we simply ignore illegal immigration because it is the 'nice' thing to do. What it will accomplish is that young people will slowly find that certain jobs are out of their selection. It also will get worse the more accepted and commonplace illegal immigration becomes. I know for a fact that while I worked at Apple there were entry level support techs that were illegally here. Perhaps you will say that it is a benefit because it would prevent offshoring, but I disagree. What it does is make the working class poorer and doesn't solve the other issues brought about by illegal immigration, such as Emergency Rooms being flooded by people who can't afford insurance. Oh yeah, I forgot to mention that it is common to go to the ER and see people stacked like cordwood because they can't refuse patients unless they are a private hospital.

As far as The Jungle, and my statement about it and it's author, I was merely pointing out that as much as you try to put forth that illegal immigrants have a bad life here in the USA, the fact is that we used to treat legal immigrants far worse. Perhaps it was a reach on my part, but it seemed logical at the time.

I doubt we will agree on any of this, but I respect your opinion. I live in a state that has a very large proportion of illegal immigrants, and while you are correct that they are generally not a criminal negative to society, they do have severe effects which I think you are overlooking. I do think that legal immigration policy needs massive change and businesses that exploit the almost slave like labor of illegals to make more profit should be punished severely. In the meantime, when we do catch illegals, they should be deported, not protected by a sympathetic politically motivated law enforcement group.

Drachen_Jager said:

You conflate illegal immigrants with immigrants.

Learn the difference and your first paragraph is pure nonsense. Also, what support do you have for the conclusion that illegal immigration has more negatives than positives? Illegal immigrants in general have a lower crime rate, support businesses, they work hard and pay taxes (which is more than can be said for Trump). Give me some data, ANY data to support your claim.

They "could" have come legally, you say. Well, no, that's the thing, most of them couldn't have. So that's a straight-up lie on your part. Couple that with the incentives the US government gives them to come illegally and why wouldn't they come? Yes, incentives, if the govt doesn't want them they need to take away the jobs, instead they pass rules to protect businesses that hire illegal immigrants.

The rest of your "argument" is mostly nonsense, so I won't even bother with it. WTF does Upton Sinclair have to do with it?

17 Programs Trump will cut that cost you $22 yr - Nerdwriter

bobknight33 says...

To be fair some of those programs should be eliminated. In the big picture these table scrap spending issues.

Homeless need food and shelter more than I need PBS or GOV funded arts programs.

Americans need to work longer before opting for social security.

Our defense spending does need to be cut.

Our national debt does need to be lowered.

WE need not to be fighting if /when defenses cutting / social security adjustments issues come up.

Death panels and throwing grandma off the cliff scare tactics need to stop.

Trump explains how to know when America is great again

newtboy says...

Yes, it could be much better, but who is it that rails against living wages or even raising the minimum wage?
The dismal growth of the last 8 years, which was in fact the longest continuous period of job growth in our history, was way better than we saw under either Bush, exponentially better....more than that, since Bush2 lost jobs. Wages have outpaced inflation for hourly workers under Obama as well, yes they are still not a living wage, but they did have an improvement under him, even when adjusted for inflation. (Pay increased at a rate of 2.8% per year while inflation was 1.3% last year and only .1% in 2015)


Sorry, your facts are just wrong.

bobknight33 said:

Are they good jobs?

We can do a lot better.

Dismal growth of last eight years. 20 30 years in debt cause they cant get jobs or low pay jobs.. Living home.

Obamacare in Trump Country

newtboy says...

Um, deductibles are way up from 100%? The uninsured had a 100% deductible, the insured had a steadily rising deductible before the ACA. It's true, cost and deductible have gone up....just as they have since the insurance industry began.
The true fix is single payer, where you remove the useless insurance industry that does nothing but raise cost and get in the way of treatment (all the talk of death panels back in the day, what do you think insurance adjusters that deny treatment are?). Without the insurance industry we instantly save 10-20% on healthcare, remove numerous roadblocks to treatment, and offer everyone good healthcare, saving more by keeping people healthier. Yes, some people's taxes would rise, others not, but overall it would be a HUGE savings that only costs us red tape.

bobknight33 said:

Cheep for the poor and not that affordable for for what you get. Not to mention deductibles are way higher under the current plan.

I don't know the true fix but this current plan is not working.



Send this Article to a Friend



Separate multiple emails with a comma (,); limit 5 recipients






Your email has been sent successfully!

Manage this Video in Your Playlists

Beggar's Canyon