How to recover the network adapters on windows

These days I was learning Android, you know, in which Genymotion Emulator is essential for Android development. But I prefer to say that you all know that Genymotion is based on Oracle Open-Source Virtual Machine “Virtual Box” which is barely “not useless”. In other words, I had been using Virtual Box until I turned to Vmware WorkStation from which I was quite enough and sick of the instability of VirtualBox.

分解質因數

题目描述
求出区间[a,b]中所有整数的质因数分解。
输入
输入两个整数a,b。
输出
每行输出一个数的分解,形如k=a1a2a3…(a1<=a2<=a3…,k也是从小到大的)(具体可看样例)
样例输入
3 10
样例输出
3=3
4=22
5=5
6=2
3
7=7
8=222
9=33
10=2
5
提示
提示

先筛出所有素数,然后再分解。

数据规模和约定

2<=a<=b<=10000

矩陣乘法

題目描述
給定一個N階矩陣A,輸出A的M次冪(M是非負整數)
例如:
A =
1 2
3 4
A的2次冪
7 10
15 22
輸入
  第一行是一個正整數N、M(1<=N<=30, 0<=M<=5),表示矩陣A的階數和要求的冪數
接下來N行,每行N個絕對值不超過10的非負整數,描述矩陣A的值
輸出
  輸出共N行,每行N個整數,表示A的M次冪所對應的矩陣。相鄰的數之間用一個空格隔開
樣例輸入
2 2
1 2
3 4
樣例輸出
7 10
15 22

How to debrick Netgear WNDR3400 V1 with USB-TTL cable

Last month I bought a router Netgear WNDR3400 V1 and surprisingly found that it can be flashed with OpenWrt(It was only known that this kind of router can only be flashed DD-Wrt before that time). And then I download the file and use the default web management interface “Upgrade” to flash the file:
openwrt-brcm47xx-mips74k-netgear-wndr3400-v1-squashfs.chk. And the UI interface(Luci) was not installed by default, so I use network cable to connect to the router and set up my network to ip address: 192.168.1.106 and subnetmask 255.255.255.0 and ping the router 192.168.1.1 and happly, it was pingable. After that, I used xShell through SSH to connect the router, enter username “root” and entered.

One hundred lights problem

Q:
有100盏灯泡,第一轮点亮所有电灯,第二轮每两盏灯熄灭一盏,即熄灭>第2盏,第4盏,以此类推,
第三轮改变编号为3的倍数的电灯,第3盏,第6盏,如果原来那盏灯是亮>的,就熄灭它,如果原来是灭的,
就点亮它,以此类推,直到第100轮。问第100结束后,还有多少盏灯泡>是亮的?

藍橋杯_字母圖形

题目描述
利用字母可以组成一些美丽的图形,下面给出了一个例子:

ABCDEFG

BABCDEF

CBABCDE

DCBABCD

EDCBABC

这是一个5行7列的图形,请找出这个图形的规律,并输出一个n行m列的图形。
输入
输入一行,包含两个整数n和m,分别表示你要输出的图形的行数的列数。
输出
输出n行,每个m个字符,为你的图形。
样例输入
5 7
样例输出
ABCDEFG
BABCDEF
CBABCDE
DCBABCD
EDCBABC
提示
数据规模与约定

1 <= n, m <= 26。

来源
蓝桥杯

藍橋_特殊迴文數

题目描述
123321是一个非常特殊的数,它从左边读和从右边读是一样的。
输入一个正整数n, 编程求所有这样的五位和六位十进制数,满足各位数字之和等于n 。
输入
输入一行,包含一个正整数n。
输出
按从小到大的顺序输出满足条件的整数,每个整数占一行。
样例输入
52
样例输出
899998
989989
998899
提示
数据规模和约定
1<=n<=54。
来源
蓝桥杯

Double press 'back' to exit the application

Now I will show you how to apply a “double press and exit” feature on Android.

Assume that you have already had a new project and runing without any errors.

Open the MainActivity.class, navigate to “onCreate” function and below it to override a function which names onKeyDown.

This case uses java class “Timer” to set a time schedule to set a variable to false and the second time you press back it will judge if the variable is true, if it is, then finish(); Or it will do nothing. And the length of the time schedule you set means how long it takes user to double press back to exit.

AsyncTask Demo

This page is to show a live case of Android Asynctask. I will show how to use the inner class “AsyncTask” to load an online image and show it in the imageview, along with a progress bar showing the progress.

The final result looks like this:

enter image description here

In simple, an AsyncTask class aims to help do some tasks that takes long time to be done in the backstage and update the UI progress.

Quote:

AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.

AsyncTask is designed to be a helper class around Thread and Handler and does not constitute a generic threading framework. AsyncTasks should ideally be used for short operations (a few seconds at the most.) If you need to keep threads running for long periods of time, it is highly recommended you use the various APIs provided by the java.util.concurrent package such as Executor, ThreadPoolExecutor and FutureTask.

An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called onPreExecute, doInBackground, onProgressUpdate and onPostExecute.
from Google Android Dev

And all the snippets was coded under the instruction of online course(at bottom here was a link), just refer to it if you are interested in it.

加载失败,请尝试使用下方导航