Hacker Newsnew | past | comments | ask | show | jobs | submit | el_programmador's commentslogin

Another benefit is re-usability. If you want your program to be callable as module or script from elsewhere without going through the tedious shell functions, "def main()" is the only way to go.


Would that be different than checking the __name__?

  if __name__ = "__main__":
      mainMethod()


The difference is that you've encapsulated your coding logic in mainMethod() instead of writing under that if condition itself. If latter was the case, you can't call that code from another module without resorting to os shell level features.


The code encapsulated into "__main__" assumed to be module-specific, this is the purpose of that pattern. If you want to make some code available for another module, you just refactor it into separate function.


But the downside is that I like to use ipython and %run the file and if it's not in a function, I can then inspect all the intermediate variables and not just the result. Every time I do put it in a function, I regret it for this reason.

Of course I could just use a real debugger...


As a plebeian, the only thing I'm worried about is my internet bill. Why should I worry who Ambani has political ties with as long as I'm getting cheap bandwidth?


The usual reasons monopolies are bad. Jio in particular is known for being highhanded in blocking websites. A couple weeks ago duckduckgo was unavailable on their network across India. [0] Last week, the government of India proposed some changes to the Environmental Impact Assessment (EIA) process which would make it easier for corporations to cause ecological damage without repercussions. A couple organizations published articles condemning these changes and explained the procedure to oppose this process, their websites were promptly blocked. [1]

[0] https://twitter.com/DuckDuckGo/status/1278288303532302336

[1] https://thenextweb.com/in/2020/07/14/india-reportedly-blocks...


Firstly, DDG was blocked by ALL Indian ISPs during that instance, not just Jio. People using Airtel, Vodafone, etc. were as much complaining in forums as the Jio users. From what I recall, BSNL was the only one who didn't block (due to their inefficiency perhaps!)

Secondly, with the kind of minuscule market share DDG has, they or their users can hardly get impacted by a couple hours' block. If anything, Indian govt. made them a favor by making them more famous! I for one don't recall #DDG ever trend on Twitter in recent history.


> Secondly, with the kind of minuscule market share DDG has, they or their users can hardly get impacted by a couple hours' block

I would like to know the exact market share of DDG in India.

Also people who use DDG use it as their search engine. It would impact that "minuscule" percent of people the same way the majority of people would get impacted if google.com was banned for a couple of hours.

> If anything, Indian govt. made them a favor by making them more famous

Really?

> I for one don't recall #DDG ever trend on Twitter in recent history

So it's not that minuscule market share?


> I would like to know the exact market share of DDG in India.

Its very little as I've yet to come across someone who knows it outside techie circles. Even many techies still use google because they seem to think it gives better results.

Really? So it's not that minuscule market share?

Consider the amount of time and energy the PR departments of various companies spend to get themselves trending on twitter each day? Whatever the size of their market share, it certainly increased that day because of the trending. People who've never heard about DDG started asking what it is and thus got to know about it.


Europe couldn't even manage to implement Linux in Berlin! The capitalist pressure is what really works there in the farce of socialism. Even with GDPR, those who got penalized where small websites, IT Shops, bloggers, etc. for not knowing their intricate rules while the big fish went unscathed.


Perhaps the only way to fix it would be get into fastboot mode and enable USB debugging, then look for that arcane settings file on the file-system which your OEM decided to use for configuring wall-papers and fix that file. I see no other way.


Wouldn't that settings file be on the user data partition, which is encrypted and thus not normally accessible in recovery mode?


God forbid if Google lifted their hands some day, can you even imagine how many million people will be impacted due to how many services ranging from emails to map apps to cloud services to web services, etc? Is it wise to give one entity power over so many things or its better to encourage a decentralized structure where multiple organizations control only bits of the pie?


At least with takeout I know I have regular backups.

That's more than most places offer.


Have you looked through the takeout outputs though? They are completely worthless to most users. It's funny to me that a bunch of Google devs built the functionality and thought "ya this will do".


What's wrong with the data?

I mainly care about Google Docs and Sheets, they're exported as Word and Excel (and there are other options if you don't like this formats), and the random sample of docs I tried in the output worked fine in Word and Excel.


How are the takeout outputs useless? Mail for example comes as a nice standard mbox


I doubt the devs have much influence over the scope of the data output. The goal there is minimum for legal, compliance, or pr reasons.



Takeout is useless without Google. Also: gsuite doesn't really have a backup feature. You're locked in for all that it's worth.


Why is it useless?


Try restoring it. A backup is only good if you can make it work again, and an export function is only good if there is something else that you can import it back into.


I guess I'm missing how that relates to the comparison I made.

Google at least lets me back things up.

Most services do not allow it at all.

So there's no restoring anywhere else at all, no chance.

Having the data I could at least have a chance that some service might offer a rebuilt import option to pick up those google users ... or I could build it myself / at least have the information.

To me that's still leaps and bounds better than any other options that I know of.


The GDPR obliges all companies to provide an option for users to receive all data held on them; takeout and FB'd equivalent were implemented in response to that.

For all other companies, at least if you are in the EU, you should he able to request the data by eg email and they are obliged to send it. You just don't know what format you'll get.


I believe takeout predates the GDPR ... by a wide margin.

As for all other companies they might be obliged to send it, but I don't see many ways to do so.

That still make's google's method way better IMO.


Yeah, a lot of exported data is basically unidirectional.

Google Voice exports your texts into a clumsy pile of HTML files. That's why I wrote a parser to convert all of your Google Voice messages into structured data.

https://github.com/unqueued/googlevoiceparse


Takeout doesn't work for users with substantial data.


What does it do?

Does it not provide the data?


From when I last tried (and retried several times), it fails to export everything so you only get a partial snapshot with random pieces missing.


Sure, it is a genuine concern. But I find the context for the comment here bit funny considering how much the world runs on top of gdocs etc, the risk of losing the source of personal blog is drop in a ocean.

And while there of course are no guarantees, I at least would expect fair warning before stuff like docs is killed.


The ocean is made of drops.


I don't think the cost of losing things is as high as you imagine. You can use X until it fails and then you can use Y.

I also don't think your doomsday scenario makes much sense either. What do you mean "lifted their hands" and why would it happen out of the blue with zero warning? Though I'll repeat: so what?

I don't think a decentralized system is much better in this regard. It just means things rot at a more staggered pace. Service A shuts down on year 0, service B shuts down on year 10, etc. It's just a different trade-off, not the panacea we like to pretend it is.


Absolutely agree. Unfortunately I don’t think nations like the US will ever have the balls to break up their wonder children.


You mean like the US did with AT&T? I'm not sure if they 'have the balls' currently, but they have in the past and it's not inconceivable they would do so again. Microsoft came close to it as well.


I do point out that US vs AT&T did first major anti-trust settlement in 1913, and the breakup ultimately happened in 1984, or about 70 years later. So maybe we'll see Google breakup too in 2084 or around that time..


AT&T reformed as regional monopolies in far less time than it took the government to break up the national monopoly.


Nations are ultimately made up of people and they are subject to peoples' pressure. Its the people who we must convince and wake them from their deep slumber.


Well, I don't need to trust Google's employees, I trust its shareholders wanting to make money, which will never stop.

Since Google's popular products all contribute to making money in the end, they're not going to stop. Shareholders just wouldn't let it happen. There's a chain of accountability here that goes employees > C suite > board > shareholders.

So I don't quite see what situation you're worried about here.


Google's shareholders don't hold substantial voting power. Accountability practically ends at CEO.


That's just so factually untrue it's hard to know what to tell you.

Do you understand how corporate boards work? How large shareholders get their own board seats? How boards hire and fire members of the management team?

The idea of a toothless board is a complete fiction. I don't know where you got the idea, but it couldn't be more wrong.

(Perhaps you're confusing it with boards where a single shareholder has more than 50% of shares, thus making the board largely irrelevant because the shareholder controls it. But even in that case, the CEO effectively reports to that shareholder, and there have been many, many, many cases of underperforming CEO's being fired. It happens all the time.)


Point here is that in Alphabet the voting power is for the largest part within the founders. Other shareholders can't do much against them.


if by some magical event Alphabet/Google is able to shut down their free versions of their Office apps and rely solely on G Suite/YouTube/Waymo/etc without losing money, I don't doubt they would do it. If that event will ever happen is still a mystery and is probably unlikely to happen within my/our lifetimes.


One alternative I could think of are chunks or clusters of centralized systems which are then inter-connected among themselves to form a decentralized whole (kinda how the internet works!).


The trick is to go and sit at your desk regularly until writing comes on its own. Its all right if you don't write, but you're not supposed to do anything else. And write anything you feel like ignoring grammar, content quality or even subject. Given enough time, practice will ensure that you'll become a good writer.

Link to article (shameless plug)[1]: Write, Write and Write should be your Mantra - Procrastination is the Writer's only enemy in 90% of cases

[1] https://freelancemag.blogspot.com/2019/11/write-write-and-wr...


Thank you :)


There are two kinds of dangers now and there are proponents on both sides of the aisle. One is to give a pause to all labor laws in a bid to bring more economic reforms and kickstart the economy. And other danger is this - bring so many regulations and policing in the economy that the few remaining investors will be scared out of the market. We need a balanced approach here.


If they’re scared to make money because it’s slightly harder or there’s a fraction less money to be made then the market will correct for this.


This is what happens when you go public! The pressure to earn more (by hook or crook) also increases in times like these. As the author states, this started happening more only after Upwork got listed on NASDAQ, not earlier when they were still a solid private company.


Static IP isn't necessary for hosting from home but a "Non-NAT" connection is. If you don't have a static IP, you can use a service such as dynaDNS or something which runs on your server and keeps informing your subdomain to use the ever changing dynamic address. But if your device sits behind a NAT, then its not accessible from outside at all (unless the device initiates the connection), thus its impossible to host if your ISP has placed you behind a NAT. But the plus point, on the other hand, is increased security which is probably good for the majority of people.


Or you use Amazon|DigitalOcean|anyproviderwithanapi with low TTL and set up your own dynamic DNS.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: