Thứ Ba, 13 tháng 12, 2016

GCI 2016 - Sugar Labs

GCI 2016 - Sugar Labs


Google Code-in is an annual programming competition hosted by Google Inc. that allows pre-university students to complete tasks specified by various, partnering open source organizations. The contest was originally the Google Highly Open Participation Contest, but in 2010, the format was modified into its current state. Students that complete tasks win certificates and T-shirts. Each organization also selects two grand prize award winners who will earn a trip to Google's Headquarters located in MountainView, California.

Students must be between 13 and 17 years old (inclusive) to participate. In addition, students must upload parental consent forms as well as some documentation proving enrollment in a pre-university program.

I joined GCI from November 30, 2016. I joined it because of knowledges and prizes . Students who complete one task earn a certificate. Students who complete three tasks earn a T-shirt in addition to the certificate. There is a maximum of one T-shirt and one certificate per student. At the end of the competition, each organization will choose two students as the grand prize award winners and they will visit Google's MountainView, California, USA headquarters for a four-day trip with an awards ceremony, an opportunity to meet with Google engineers, and a day of sightseeing in San Francisco.

After this program I hope to have more knowledge about different markings on GCI such as GitHub, skill design, PHP code,...and have more beautiful T- shirts from GCI. Sugar Labs is a software-development and learning community, which makes a collection oftools that learners use to explore, discover, create, and reflect. It distributes these tools freely and encourages its users to appropriate them, taking ownership and responsibility for their learning.. Helping learners all around the globe to "learn how to learn".

Sugar Labs have Hundreds of tools for discovery through exploring, expressing, and sharing: browsing, writing, etc. Code style for Sugar HTML development is so good.


General

·        Avoid lines longer than 80 characters.

·        Don't use any form of minification (neither in JS, HTML or CSS). All our source should be readable using the Sugar "View Source" feature.

Javascript

·                  Make your code conform to JSHint. 
·                  Use four spaces for indentation.

HTML

Use two spaces for indentation. The rationale is that HTML tends to be very nested, and avoiding lines longer than 80 characters becomes difficult.

The js-beautify tool can be handy for indenting HTML as well.

CSS

·                    Use two spaces for indentation.
·      Make it compliant with RECESS. 

Tools

JSHint

Use JSHint http://jshint.com/ to check for errors and make the source compatible with our coding conventions. The jshint command is provided by sugar-build.

js-beautify

Use js-beautify https://github.com/einars/js-beautify to make the sources compatible with our indentation conventions. The js-beautify command is provided by sugar-build.

RECESS

RECESS https://github.com/twitter/recess keeps the order of CSS rules following a convention, and protects us from different mistakes. The recess command is provided by sugar-build.



Thứ Năm, 8 tháng 12, 2016

Google Code-in 2016


Google Code-in is an annual programming competition hosted by Google Inc. that allows pre-university students to complete tasks specified by various, partnering open source organizations. The contest was originally the Google Highly Open Participation Contest, but in 2010, the format was modified into its current state. Students that complete tasks win certificates and T-shirts. Each organization also selects two grand prize award winners who will earn a trip to Google's Headquarters located in MountainView, California.

Students must be between 13 and 17 years old (inclusive) to participate. In addition, students must upload parental consent forms as well as some documentation proving enrollment in a pre-university program.

I joined GCI from November 30, 2016. I joined it because of knowledges and prizes . Students who complete one task earn a certificate. Students who complete three tasks earn a T-shirt in addition to the certificate. There is a maximum of one T-shirt and one certificate per student. At the end of the competition, each organization will choose two students as the grand prize award winners and they will visit Google's MountainView, California, USA headquarters for a four-day trip with an awards ceremony, an opportunity to meet with Google engineers, and a day of sightseeing in San Francisco.

After this program I hope to have more knowledge about different markings on GCI such as GitHub, skill design, PHP code,...and have more beautiful T- shirts from GCD. The FOSSASIA community help me so much. The mentors are very cute and helped me so much and detailed instructions for the task that I have been approved claims. Luckily, Ms Hong Phuc Dang, one of whom mentor  from FOSSASIA,  have visited Ly Tu Trong High School for the Gifted to introduce about GCI and not only show contest open  but also show prizes. (http://fossasia.org/)


Thank you GCI and mentors..!!!
Name       :      Cong Tinh Dao
Gmail       :     dcongtinh@gmail.com
Facebook  :    dcongtinh
Twitter      :    TinhDao3

Thứ Bảy, 7 tháng 5, 2016

"Hạp là 1 tính từ thay đổi theo thời gian, nay hạp, mai hết. Hết hạp thì cãi nhau." -TnBS-
  • Lúc hạp thì hùn làm ăn với nhau những công trình xuyên thế kỉ mang tầm cỡ quốc gia quốc tế còn không hạp thì mọi chuyện rồi cũng đỗ vỡ, đường về La Mã cả thôi
  • Lúc hạp thì "Anh yêu em như bà nội của anh vì em và bà ngoại của anh rất hạp nhau" còn không hạp thì "Em không phải con trai nên chúng ta không hạp nhau không thể đến với nhau được"
  • Lúc hạp thì cứ như là bạn bè tri kỉ đã hơn ba chục năm trời còn hết hạp thì "Ơ bạn là ai?" hay là dành cho nhau những cái liếc muốn rớt con mắt luôn

Cho nên "Hạp" nhau là một phần quan trọng trong cuộc sống. Nó ảnh hưởng đến việc hợp tác trong làm ăn, tình yêu và tình bạn. Vì thế việc tiên quyết để tạo nên một mối quan hệ nào đó đều bắt đầu bằng "hạp nhau".

Chủ Nhật, 17 tháng 1, 2016

Link/Cut Tree
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Programmer Rostislav got seriously interested in the Link/Cut Tree data structure, which is based on Splay trees. Specifically, he is now studying the expose procedure.
Unfortunately, Rostislav is unable to understand the definition of this procedure, so he decided to ask programmer Serezha to help him. Serezha agreed to help if Rostislav solves a simple task (and if he doesn't, then why would he need Splay trees anyway?)
Given integers lr and k, you need to print all powers of number k within range from l to r inclusive. However, Rostislav doesn't want to spent time doing this, as he got interested in playing a network game called Agar with Gleb. Help him!
Input
The first line of the input contains three space-separated integers lr and k (1 ≤ l ≤ r ≤ 10182 ≤ k ≤ 109).
Output
Print all powers of number k, that lie within range from l to r in the increasing order. If there are no such numbers, print "-1" (without the quotes).
Gena's Code
time limit per test
0.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
It's the year 4527 and the tanks game that we all know and love still exists. There also exists Great Gena's code, written in 2016. The problem this code solves is: given the number of tanks that go into the battle from each country, find their product. If it is turns to be too large, then the servers might have not enough time to assign tanks into teams and the whole game will collapse!
There are exactly n distinct countries in the world and the i-th country added ai tanks to the game. As the developers of the game are perfectionists, the number of tanks from each country is beautiful. A beautiful number, according to the developers, is such number that its decimal representation consists only of digits '1' and '0', moreover it contains at most one digit '1'. However, due to complaints from players, some number of tanks of one country was removed from the game, hence the number of tanks of this country may not remain beautiful.
Your task is to write the program that solves exactly the same problem in order to verify Gena's code correctness. Just in case.
Input
The first line of the input contains the number of countries n (1 ≤ n ≤ 100 000). The second line contains n non-negative integers aiwithout leading zeroes — the number of tanks of the i-th country.
It is guaranteed that the second line contains at least n - 1 beautiful numbers and the total length of all these number's representations doesn't exceed 100 000.
Output
Print a single number without leading zeroes — the product of the number of tanks presented by each country.