- 博客(34)
- 收藏
- 关注
原创 校招java编程模版
import java.util.*;public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ } }}
2016-08-02 13:21:53 338 1
原创 【入门】Shell常用命令总结
echo "Hello World" echo -n "Hello World" #不带换行echo -e '\e[0;33;1mHello[0m World' #带颜色 echo -e '\e[0;33;4mHello[0m World' #带颜色+下划线 echo -e '\e[0;33;5mHello[0m World' #带颜色+闪烁
2016-07-19 11:41:22 806
转载 LeetCode OJ - Merge Two Sorted Lists
public class Solution { public ListNode mergeTwoLists(ListNode l1, ListNode l2) { ListNode p1 = l1; ListNode p2 = l2; ListNode fakeHead = new ListNode(0); ListN
2016-03-25 17:21:51 277
转载 Leetcode OJ -Remove Nth Node From End of List
public static boolean isValid(String s) { HashMap map = new HashMap(); map.put('(', ')'); map.put('[', ']'); map.put('{', '}'); Stack stack = new Stack(); for (int i = 0; i < s.length(); i++
2016-03-25 16:57:53 258
转载 LeetCode OJ - Remove Nth Node From End of List
publicclass Solution { publicListNode removeNthFromEnd(ListNode head, intn) { // Note: The Solution object is instantiated only once and is reused by each test ca
2016-03-25 16:42:14 462
转载 Java反转单链表(code)
class Node { private int record; //变量 private Node nextNode; //指向下一个对象 public Node(int record) { super(); this.record = record; } publi
2016-03-25 16:14:58 276
转载 LeetCode OJ - Search in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array retur
2016-02-23 17:23:35 457
原创 LeetCode OJ - Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2016-02-22 15:49:46 272
原创 LeetCode OJ - Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found
2016-02-21 18:43:17 382
原创 LeetCode OJ - Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.
2016-02-19 22:57:04 335
原创 LeetCode OJ - Implement strStr()
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.public class Solution { public static int strStr(String ha
2016-02-19 22:07:38 277
转载 LeetCode OJ - Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()
2016-02-14 18:02:47 288
原创 LeetCode OJ - Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit st
2016-01-12 22:24:32 346
原创 LeetCode OJ - 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact
2016-01-11 18:40:31 441
原创 LeetCode OJ - 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.my answer:import java.util.*;publ
2016-01-11 15:04:29 288
原创 LeetCode OJ - Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.my answer:public class Solution { public static String longestCommonPrefix(String[] strs) { Str
2016-01-10 14:00:55 272
原创 LeetCode OJ - Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
2016-01-09 22:57:08 9041
原创 LeetCode OJ - Roman to Integer
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.my answer:public class Solution { public static int toNumber(char ch) {
2016-01-09 18:27:05 266
原创 LeetCode OJ - Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.my answer:public class Solution { public String intToRoman(int num) { Str
2016-01-09 18:25:12 333
原创 LeetCode OJ - Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.my answer:public class Solution_9 { public static boolean isPalindrome(int x) { boolean flag = true; Stri
2016-01-09 17:32:11 308
原创 LeetCode OJ - String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca
2016-01-09 10:26:36 336
原创 LeetCode OJ - Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before c
2016-01-08 18:13:57 328
原创 LeetCode OJ - ZigZag Conversation
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I
2016-01-08 17:00:42 323
原创 LeetCode OJ - Add two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link
2016-01-08 15:57:01 329
原创 LeetCode OJ - Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe
2016-01-08 10:52:04 330
转载 pythonwin的安装&解决方案
pythonwin对应下载地址:http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/no python installation found in the registry解决方案:import sys from _winreg import * # tweak
2015-07-28 14:36:45 518
转载 Properties类文件的的操作
public class PropertiesTester { public static void main (String[] args){ Properties p = new Properties(); BufferedReader in = null; BufferedWriter out = null; try{
2015-07-13 16:01:55 279
原创 几种常用的FPGA系数表产生方法
[size=medium][b]1 滤波器系数表[/b][/size][code="java"]%%========================================%%==FPGA滤波器核系数转换%%==把Matlab产生的滤波器系数文件".mat"格式%%==转换为FPGA滤波器核用的系数文件%%============================...
2015-03-19 11:11:13 234
通过Matlab生成.coe
如图所示设计fir滤波器[img]http://dl2.iteye.com/upload/attachment/0106/3715/b861ff2e-0953-336a-8371-6538309517cf.png[/img]然后在matla中输入[code="java"]>> fid=fopen('d:/fir.txt','wt');>> fprintf(fid...
2015-03-04 15:24:35 1414
原创 对于SIM卡的识别
主要用到:[code="java"]import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.location.LocationProvider; //在Resume阶段设定m...
2015-03-04 15:18:32 584
转载 Intent调用
main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"
2015-03-02 15:03:17 322
原创 GPS 定位经纬度
[code="java"]public class LocationActivity extends FragmentActivity { private TextView mLatLng; private TextView mAddress; private Button mFineProviderButton; private LocationMan...
2013-05-04 20:41:48 200
原创 Google Map API 申请步骤
首先,我们要获得MD5密纹 方法如下:打开命令行输入: cd .android 回车然后输入: %JAVA_HOME%/bin/keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android对!就是一字不落的输入!不要犹豫!会出现这个:...
2013-04-29 18:21:00 233
原创 Intent调用
main.xml:[code="java"][/code][code="java"]mylayout.xml[/code]然后是控制程序IntentDemo.java 及IntentDemo1.java 代码: IntentDemo.java:[code="java"]package com.android.t...
2013-04-09 21:17:21 109
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人