Monday, October 19, 2020

Will Biden go down like Hillary?

Poll leading to the finish line! Play with electoral votes map... Democrate is going to win!

That was from 2016.

Last minute Hillary email scandal (remember?) may have brought her down. Waita minute she wasn't down. She got millions more popular votes and still lost. I am still not sure if this last minute scandal and that "Lock Her Up" chant has pulled her down. Why she still isn't locked up now? If she really done something wrong should have been locked by now?

Now 4 years later. Last minute scandal by Biden and his son Hunter's laptop... which is just abandoned at a computer shop with emails leading to their illegal dealings? Is this true or is it last minute political dirt again? A laptop loaded with important stuff just waiting to be discovered? Seems too easy to obtain. But the thing is major outlets not reporting it. Is it cover up?

And yes, Trump can still win. But look at what he say today. Trump calling Fauci an idiot and disaster and "He’s been there for about 350 years, I don’t want to hurt him," How do you elect a clown like this?

How does such being deserve to be president when you take the scientists words out of context in your ad and say such things. That virus handling has been true disaster. Trump is just LUCKY to be still alive.

So there are 2 types of people who will vote for Trump: (1) true idiots. and (2) those who are smart to know the evil of leftism which Biden and Harris are going to embrace.

This is not 2016. Many people already did early voting. So the explosive scandal come in too late even if it is true... and of course don't believe everything you read in New York Post or other single source.

Sure, Trump does not deserve to win.

But do leftists deserve to win? You decide. But if you live in a Blue state it doesn't matter. If you live in a Red State it doesn't matter either. Cause your puny vote is insignificant. Only those in swing states with lots of electoral votes matter, thanks to the brilliant electoral college system.

Tuesday, October 6, 2020

Trump vs Covid-19

This is the most interesting chapter in US History. Election is just a month away and what an October surprise. Trump got Covid-19. So did his wife and a few people "in his orbit" as some news article say it. Spread event right there in the white house. No mask. No social distance. Here is that consequence. And nope. as of this point this is not the end of Trump. Even his age and weight put him in high risk group. Oh there is the experimental drug he is having... which isn't the same one he pushed earlier. Seems to be working for him as this moment and he is back in action. Before he return to White House... he did this controversial SUV ride! Why is that even needed? You are putting that driver in danger! "Don't be afraid of Covid!" he tweeted.

Now I do NOT wish him death. That would cause the world to be in havac and send the Dow Jones to hell.

But look, how irreponsible is this to host that White House event without mask on.

But at this point Trump won. Trump also beat impeachment. Completely invincible.

Will the election able to get rid of him? I. am. afraid. not.

This election is all about Trump. It is Trump vs non Trump. Trump got fans. It seems Biden does not.

It does not matter if Biden leading by 100 points because only swing states count. Trump will be preceived as the invincible winner. He will definitely work together with UK PM who also got Covid-19 and beat the heck out of China in next term.

It is unfortunate that out of a sea of Democratic candidates not one stand out as charismatic and pragmatic and had the experience. Biden already the best choice among those.

So I predict... a Trump win because Dems are too pathetic.

And look at what they want to do... make Washington DC a state! https://www.cnbc.com/2020/06/26/house-passes-bill-to-make-washington-dc-the-51st-state.html. That's because they just want more senate votes. To win any thing later Dems, get rid of the electoral college! Good luck with that.

Wednesday, September 23, 2020

Computer Customer Manifesto

Here are my demands:
  • I need a computer that responds.
  • When I put it to sleep I move the mouse you wake up. (within a second)
  • When I open up it is ready to take my login/password. (within a few seconds)
  • When I hit login it takes me to the Desktop screen. (within a few seconds)
  • When I hit the Windows (Start) button the menu shows (within a few seconds)
  • When I hit the Chrome task bar icon it opens. (No I SSTTILL won't use your Edge browser)
  • When I mouse click a URL bar you blink and ready for my text
  • When I hit enter you go to the webpage I want and come back with stuff within a few seconds
THAT'S GODDAMN IT ALL I REQUIRE.

And my Dell (with good ratings) simply CANNOT EVEN DELIVER THAT. (It is just 3 years old)

I don't even require you to run any games or any dev tools.

It is still $400+ bucks. Do I need a thousand bucks computer to do even simple stuff.

There is no heavy stuff even installed on it. No background tasks that I make it do. Just what the hell are you spinning about. Why you suddenly starts to work sometimes after like 5 MINUTES of churning.

Why do you spin around and demand Windows updates, so often. It needs to beg its master (me)'s permission first!

Get a Chrome book you say? Well I need a good file system. Get Ubuntu you say? Rest of family don't know how to use it. Get a Mac you say? I hate its wacky interface. I need software that makes sense like Windows Explorer not Finder. I need a simply notepad and paintbrush and you macs don't even have that. One idea I heard is get a Mac but run Windows on it with a virtual machine. Interesting idea. But how much is the Mac? and I need a valid copy of Windows? It breaks my budget.

I have given Dell enough chances.

Why is that an insult

There is no escape. Everywhere you go (on the web). Your phone notifcations. Your TV. Everywhere. Anywhere. You see that Ruth Bader Ginsburg is gone and Trump get another chance to pick another judge. Presidents don't get chance to appoint a Supreme Court judge until one of them died or retired (with Senate approval). And media is all over it again. Now if you ask me, the constitution's check and balance is totally useless as it will be along party line. Trump gets to pick anybody he wants. And guess what, every anti Trump guy is pushing wait til election. What if Trump win? want to wait another election? There is absolutely nothing in the Constitution that says you got to wait til next election if it is close to one. So yes, I think it is perfectly fine to appoint a judge now.

Now this RBG is so big a deal that you can't escape coverage of her accomplishments. Sure she went to law school when not many other women go to law schools. (But did she remove a ban for women to go to law school?) All that sex discrimination is not just RBG one person's work right? and that is done already and no one is going to reverse it right?

And getting a conservative judge would be an "ultimate insult" https://www.nbcnews.com/think/opinion/trump-supreme-court-favorite-amy-coney-barrett-would-be-ultimate-ncna1240642? Why would that be an ultimate insult?

Is Barrett going to put women in cages? I don't think so. Is she reversing gender pay so women only make 50 cents for every dollar? I don't think so either.

Now about abortion. Why is there no more discussion allowed about such act of killing babies legalization? Ok you want a boy, ultrasound says it is a girl are you going to kill that girl? Ok you want a girl, ultrasound says it is a boy are you going to kill that boy? Dumb teenagers get pregnant and you kill the innocent babies within?

Let the constitution do its work. Let judges with different views come in, through the consitutional process.

Wednesday, June 24, 2020

Pandemic is not over yet

The COVID-19 pandemic is still here. As of this post more than 120,000 dead in US with over 2 million cases. This is my favorite statistics page: https://www.worldometers.info/coronavirus/. There is nice clickable arrows that let you sort the columns without refreshing the page.

Besides China, whose number simply cannot be trusted, many countries have seen decline but not in the US. That's because too many Americans think they are invincible and not wear masks. They can't wait to reopen can't wait to go to the beach and the bars. Look at that link above.. the death rate is 11% in the US if you get it. It will not only affect older folks, younger folks get it too! Such invincible thought (arrogance) is going to kill some of you and your family while the hospitals evil grin and collect all your money before your death and even after your death.

And Trump's speech say slow down the testing to avoid numbers going up?? https://www.cnn.com/2020/06/22/politics/donald-trump-testing-slow-down-response/index.html. Now that's just fooling yourself. Like trying to steal a valuable bell but covering your own ears and hacking it into pieces as told in a classic story. Just as bad as suggesting injecting Clorox on yourself. Really. You-are-fired. We need another guy as president.

Now it is still not very clear where is the virus coming from. Sure, it is bats, scientists say. In Wuhan. Is it the wet market? Still no one say for sure that there were actually bats in there. Or is it that virus lab? Everyone keep rejecting that possibility. One very good observation I heard was... waita minute, bats don't even live there in Wuhan how does it get to Wuhan in the first place? Of course there is the cover up and stuff and the world will seek answers from China after there is a real solution for this virus... Hope a vaccine can be produced soon and the world get back to normal.

Until then it still is dangerous out there. Use Masks. Or Risk Death. Is that clear America.

I support business re-open but with precaution required (but still no restaurants cause you can't eat with masks).

Work at home and work at work is not the same. Some business was like "ooh why didn't I think of that and try to save money and make everyone work from home". While yes, money and time saved in transportation and you can save rent by closing the office. But having people physically together can make you more productive and have better interactions. and not everyone have a awesome home office... and what about business that require your presence like the Starbucks near your office?

Friday, May 8, 2020

Math lesson in A Tour of Go

Revisiting the "Tour of Go" language after many years because I have some time in my hand... and it contains a delightful math lesson. Implementing the square root. It is Newton's Method in action!

Let's see if you can crack this: https://tour.golang.org/flowcontrol/8

Ok don't like Go? use your favorite language. But I feel empowered to able to do my own square root method and not rely on Math.sqrt().

Go's syntax is somewhat between C and Pascal so far... and has pointers.

My answer:

package main

import (
 "fmt"
 "math"
)

func Sqrt(x float64) float64 {
 z := 1.0
 e := 0.0001

 for math.Abs(z*z-x) > e {
  z -= (z*z - x) / (2 * z)

  //fmt.Println(z)
 }
 return z
}

func main() {
 fmt.Println(Sqrt(2))
}
Note: in Go, "while" loop is spelled "for". There is only ONE kind of loop. And many modern new languages like to do the types behind, like Pascal. My Tour of Go didn't go very far. But Go's power is in its concurrency ability... the go routines and "chan" or channels, which isn't exactly easy to master.

Monday, April 27, 2020

A Look at GraphQL

REST is rather straight forward, has been around for a while and not a new buzzword. It is basically using http "verb" to do "CRUD" on your resource in URL. (where the verbs are POST, GET, PUT, DELETE), and "CRUD" being create-read-update-delete.

Straight forward (and relatively easy) is not good enough for some. It is not fast enough... suppose you want to get a list of people... and their friends... you would have to make http calls and combine results. Enter GraphQL. Nice presentation.

So this is like a little SQL language. Maybe worth incorporating to your work. Let's look at implementing... Alas how complex do you want to get? See https://www.graphql-java.com/tutorials/getting-started-with-spring-boot/#graphql-java-overview.

However I found this awesome simple example that I can actually even run: https://dzone.com/articles/a-beginners-guide-to-graphql-with-spring-boot. Thanks to DZone. The example I downloaded from github is very helpful.

Look, add a ton of complexity with big learning curve may not worth it... internally somebody still has to do the queries and somebody will need to parse that JSON... Use it only if you think it is worth it.

Friday, April 17, 2020

Python and math

Way back in college I was studying vector calculus.. the calculus of several variables and deal with functions like z = f(x,y).

One could graph it... using that Mathematica in the computer lab and back then only the experts (graduate students) know how to use it. Math software such as Mathematica and Matlab are there for a long time only academic research folks ever need to use them. I don't ever need to get my hands on it. My statistic knowledge is minimal... (3 quarters of mostly forgotten probability and statistics in college)

I studied some computer graphics... learned linear algebra tricks of collapsing 3D to 2D. That stuff I wouldn't call exactly easy. See here for a taste of it.

Python readily have this available with its Matlab package... and in just a few lines, I am able to make a 3D graph. See https://towardsdatascience.com/an-easy-introduction-to-3d-plotting-with-matplotlib-801561999725. I can even drag window around to see the graph in every angle!

This. is. neat.

Wednesday, April 15, 2020

Python: the BASIC of today

I took a look a Python a decade plus ago. At that time I kinda dismissed it as a toy language as I can do whatever I want in Java without learning another language which almost look just like it without braces.

Year after year if you look at list of popular languages you see Python on very top. See here for example. If you can still go to a bookstore or a library you see many children's book on programming using Python! ..and a lot of them focus even on creating your own games. There are endless camps luring parents to have them teach their kids Python (and charge you a hefty fee).

What makes Python so successful? It is easy to learn. Its got a shell you can run right away, no need to compile and link. It doesn't even require semicolons (but it uses a lot of colons). It comes with a rudimentary IDE called IDLE too. It is cross platform you can make Tkinter windowed apps and many other things. You don't even need to define your variables before you use it. Feels just like BASIC of the 80s.. except you can go crazy with GOTO statements in BASIC. In the 80s there is also the LOGO programming language which is also a Read-Eval-Print-Loop which is kinda fun because you can program that turtle and Python provides that too! There is even a game engine!

Well that appeals to students but what about professionals. It has many math and statistic packages ready to use for some powerful data analyzing. It even has machine learning things that can make "Data Scientists" job much easier. Syntactically it is quite C like except you spell out "and" "or" "not" instead of && || and !. But there are no bottoms of your blocks, indention is needed instead. It can handle lists and sets easily and not as clumsy as java. Given a couple days any C/C++/java developer can pick up its syntax. You can learn right from python.org, and W3Schools is one of many tutorial sites you can read about.

Howevver, it is usually interpreted (not compiled), that means there can be a performance issue and it can be a memory hog. And I really don't like using variables on the fly without even declaring (you can accidentally change a variable already in use too). Ok it can do desktop things what about the web? You CAN do web related stuff and will require extra package such as Django. And oh my gosh, I don't know why Microsoft embrace it so much in Visual Studio. It seems totally abandon its Visual Basic and endorsing Python. I generated a working website with Django like right away with its wizard... it even came with a login page. It works much like ASP/JSP.

Happy coding.

Newer Java

Java versions come so quickly it is hard to keep up. These days any language must have some sort of shell for REPL (Read Eval Print Loop). "jshell" is there since Java 9. I doubt anyone find that too useful.

I now have Java 11 (not even latest). And you can run your code even without compiling. And that deep down in everyone's heart everyone misses Pascal. now there is "var" to define variable without specifying the type just like many languages. Other dynamic typed languages like Javascript and Visual Basic has this for ages.

class Foo {
   public static void main(String arg[]) {
    var yes = true;
    System.out.println("Do you miss Pascal?"+ yes);
   }
}
I can run this with just "java Foo.java". I don't even need "javac" to compile it.

It compile behind the scene and does not even produce a .class file. This is a great write up of what's from 8 to 11. https://codete.com/blog/java-8-java-11-quick-guide/... but version 8 really was the major jump. Lambda and Streams and Optional stuff are just some of them. See here for a good list.

Wednesday, January 15, 2020

Java dates old and new

Java developers put up with the arcane Gregorian Calendar, Date, SimpleDateFormat until Java 8 (which itself is a few years old now). There certainly are old code who still use the old way. Your favorite IDE can figure out your imports.
 // Before Java 8 (obsolete)
 Date date = new Date();
 System.out.println("java util date now is: "+date);
 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
   
 // date to string
 System.out.println("formatted: "+sdf.format(date));
   
 // string to date
  try {
  Date date911 = sdf.parse("2001-09-11");
         System.out.println("911 date: "+date911);
  } catch (ParseException e) {
         System.out.println("Can't parse that date");
  }
   
   
 // Java 8
 LocalDateTime now = LocalDateTime.now();
 System.out.println("LocalDateTime now is: "+now);
   
 // date to string
 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
 System.out.println("formatted: "+now.format(formatter));
   
 // string to date
 LocalDate date911 = LocalDate.of(2001, 9, 11);
 System.out.println("911 date: "+date911);
   
This is just part of the story... Java 8 can also do timezone a lot easier than previously.