You telnet an ip, port but you cannot get out? Ctrl+C doesn’t work, Esc doesn’t work !
Duh, Ctrl+C, Esc are the commands sent directly to the ip, port you just telnet-ed, so telnet doesn’t see them at all !
For this you need to return back to telnet prompt, so hit
Ctrl+] (yes, Ctrl and right square bracket)
telnet> quit
Connection closed.
I tried modeling the logic to how databases combine sets in a cross join. All rows from left side are combined with all rows from right side.
The script is as below
function combine(a, b) {
var r= new Array();
for(var i= 0, k= 0; i < a.length; i++) {
for(var j= 0; j < b.length; j++) {
if(-1==a[i].indexOf(b[j])) r[k++]= a[i]+ b[j];
}
}
return(r);
}
You can call this as below
function permute() {
var a= "abcd";
var p= new Array();
for(var i= 0; i< a.length; i++) p[i]= a.charAt(i);
var r= p; // Input string as-is is first permutation
for(var i= 1; i< a.length; i++) r= combine(r, p); // Get the permutations// r.length - Get the combinations
// r contains all combinations as an array}
Some points worth noting
If any character is repeated, the combination does not happen successfully since the logic tries to remove same character matching elsewhere
The number of combinations increase by factorial of the number of characters, hence it will be a good idea to perform this on server side ideally otherwise javascript will hang for large strings
Logic could be optimized to generate combination in a different better way than using crossjoin strategy
Very often we are impressed with awe when we see a beautiful picture, photo, advert. The colors, their combination presents an alluring view just right for our eyes. If you notice more closer, you can seeing that more often the colors are complemented (red with white, green with blue…) to give a undistracted overall look. This is essentially because our eyes find this visually pleasant.
I have a tool which can offer such combinations, and you should design your color combinations using the suggested patterns
Hurray ! I received my bike license today in Japan ! In my first attempt itself ! Wish me congratulations !
Ok some background – I had a bike license from my country. I had not converted it to International License, so I had to opt only for conversion into Japanese license – 外国免許切り替え. I do have a car license obtained in Japan, so I was exempted from written test (which by the way is too difficult, trust me). Instead, I simply had to appear an actual driving test (which is again difficult, mind you). I was required to produce a translated copy of my original license from my country, which can be done in 30 mins in JAF offices. Rest are your passport (both old, new ones), an application form, few stamps which you can buy right there. I live in Tsukuba, so I had to goto Ibaragi License Center, which is situated in Mito. You can go during weekdays, from 09:00AM. Believe me, you better arrive early. There is plenty of crowd, for all sorts of licenses, and usually you have to spend almost whole day there, in case you pass the test and obtain the license. I spent close fo 6 hours today, but in the end I was a happy guy.
Once they receive your application, they ask you few questions about your original license – How did you obtain it? Where did you practice? What kind of test did you appear for this license? How many cc bike? Learner’s license? etc. Unless there are any problems, you are then handed over a course map, and timings when your test will start. Mind you, the course map is given so that you “memorize” it, period. You are required to drive the exact course map, observing lane rules, traffic signs, signal, right or left indication, speed or slow. The usual advice is that you have some 45 mins in hand before your test starts. Thus, you should actually take the course map in hand, and walk the entire course by foot atleast once. I did that, making a mental note of the lanes, the distance around which I should turn on the indicator, and so on – till I burnt the course map into my brain cells !
The most difficult are – Ipponbashi, and Slalom – for me. And I did literally walk on foot imagining I was on bike before my test started.
I believe I was the only one appearing a bike test today – why I was alone sitting in the waiting room till my turn came. The instructor was kind enough to walk me (verbally) through the course map once again. He also gave me a brief about the bike – Honda CB750 – and for my own safety, in case I should fall, had me wear elbow, knee, body protector before the test.
When the actual test started, the instructor actually sits in a watchtower, from which he had a complete view of the course. Once he gave a go, I just drove the same path I had walked on foot earlier. I was particularly careful about slow down sign, lane change, and making sure that I move my head from left to right wide enough to show that I am taking visual confirmations before proceeding. At one point when making a turn I did step down, but I guess that was OK, because if I’d had done the same on Ipponbashi or Slalom, or even S-letter, or Crank, I am out without any further discussion. Phew, I did feel once the bike will stop during Crank, but I was lucky enough to make it till the final stop.
In the end, the instructor appraised my driving skills, and gave me the golden word – “合格” !
Start by writing the two numbers to be multiplied at the head of two columns. Then they repeatedly divide the number in the left column by two (dropping any remainder) and double the number in the right column, writing the two new numbers immediately below their predecessors, until the number in the left column is one. Then they cross out all rows where the number in the left column is even, and add the remaining numbers in the right column, which is the desired product.
For instance, the product eighteen times twenty-three is found like this.
A hot, sunny day – what could you do best? Rest indoors, or have fun outside in the park, right? Right. 🙂
Our trip to Navel Park was definitely worth shot on this day! Don’t believe me? Well… look for yourself –