假设字符都是等宽的。输入是字符串 string 以及行宽 width。
let len = string.length
left就容易了,在输入的字符串后面贴 width - len 个空白。若是len > width ? 那
么直接返回吧。
right就是在输入的字符串前面贴 width - len 个空白。
full justified有点麻烦了,算算有多少个word,然后平均的插入 width - len 个空
白。
我已经写了一个,请大家看一下还有什么可以改进的地方
package design_a_pizza_maker;
/*
* @ServiceNow onsite
*/
import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;
public class PizzaMaker extends Stopwatch{
public static void main(String[] args) {
PizzaMaker pizzamaker = new PizzaMaker();
Scanner sc = new Scanner(System.in);
System.out.println("Input a to add 30 seconds to current baking
schedule");
System.out.println("Input c to cancel current baking schedule");... 阅读全帖
you have an img data as an array, output the data for upsampling. For
example,
[1, 2, 3, 4, 5, 6] as width 3(2 rows) ==> upsample 2 times would be [1 1 2 2
3 3 1 1 2 2 3 3 4 4 5 5 6 6 4 4 5 5 6 6]
int[] UpSampling(int[] input, int width, int times)
{
//check the validation of input parameters
...
int numRows = input.Length / width;
int[] result = new int[input.Length * Math.Pow(times, 2)];
int index = 0;
for(int i = 0; i < numRows; i++)
{
for(int j = 0; j < time... 阅读全帖
http://www.westwindairservice.com/facts/index.php
Arizona is a right-to-work state. The law states no person shall be denied
the opportunity to obtain or retain employment because of non-membership in
a labor organization.
The Arizona trout is found only in Arizona.
The saguaro cactus blossom is the official state flower. The white flower
blooms on the tips of the saguaro cactus during May and June. The saguaro is
the largest American cactus.
Arizona leads the nation in copper production.
Petri... 阅读全帖
One of my partners this weekend was a 5.14 climber. He was basically flying
through 5.11 overhanging off-width on lead, very efficient and graceful. He
taught me some very interesting techniques, which make me cannot wait to go
back and try some more off-width again. I feel really lucky to take my
first off-width trip with him.
Off-width is a pain for most people. However, since many long routes has off
-width as the crux, it is very useful to practise it.
L/W RATIO翻译为长和宽比率(L/W Ratio)是长宽比率将决定您的钻石的外在的式样,长
宽比为1 到1.05的参数,长宽比率能决定钻石的外形,及决定从顶部观看的外在整体效
果。
Length-to-Width Ratio –The length-to-width ratio compares the length of a
diamond to its width to show how elongated a fancy-shaped diamond appears
when viewed from the top. Length/width ratio is a matter of personal
preference with some individuals preferring a more elongated shape and
others a more equal or square shape. The most popular length/width ratios
for fancy shapes are below.
1.01这个参数算相当不错
希望... 阅读全帖
一下试flicky里来的,那个是?
Taken on June 26, 2011 at 4.03pm EDT (edit)
Posted to Flickr June 27, 2011 at 1.33PM EDT (edit)
Exif data
Camera Canon EOS 60D
Exposure 0.004 sec (1/250)
Aperture f/2.8
Focal Length 50 mm
ISO Speed 100
Exposure Bias +1/3 EV
Flash Off, Did not fire
Orientation Rotate 270 CW
X-Resolution 72 dpi
Y-Resolution 72 dpi
Date and Time (Modified) 2011:06:26 16:03:16
YCbCr Positioning Co-sited
Exposure Program Aperture-priority A... 阅读全帖
PWM 1khz 只是专利的第一项: http://www.freepatentsonline.com/y2011/0164069.html
What is claimed is:
1. An electronic device, comprising: a display panel comprising a plurality
of pixels; a light source comprising a plurality of light emitting diode (
LED) strings adapted to generate light to illuminate the plurality of pixels
; and display control logic adapted to sequentially activate and deactivate
each LED string of the plurality of LED strings at a frequency of
approximately at least 1 kHz.
2. The el... 阅读全帖
PWM 1khz 只是专利的第一项: http://www.freepatentsonline.com/y2011/0164069.html
What is claimed is:
1. An electronic device, comprising: a display panel comprising a plurality
of pixels; a light source comprising a plurality of light emitting diode (
LED) strings adapted to generate light to illuminate the plurality of pixels
; and display control logic adapted to sequentially activate and deactivate
each LED string of the plurality of LED strings at a frequency of
approximately at least 1 kHz.
2. The el... 阅读全帖
Sorry, I have no Chinese software on this machine...
I am new to WPF and Infragistics Controls. I am trying to accomplish a
seemly simple task. use Xamdatagrid to display a collection of data records
retrieved from database.Besides the columns from the data records, I want an
additional unbounded column to contain a checkbox. I am having a really
hard time to get the databinding to work. I have spend 2 days to look up
examples and tutorials but none are complete or easy to understand(for me at
l... 阅读全帖
I used the following codes. Could you help me to take a look and see what is
wrong? Thanks
%let datestamp=%sysfunc(today(),yymmddn8.);
%let datestamp1=%sysfunc(datetime(),datetime20.);
%let datestamp2=%substr(%sysfunc(tranwrd(&datestamp1,:,_)),1,15);
%put &datestamp1 &datestamp2;
ODS listing close;
ODS tagsets.ExcelXP path = "/sassvr1/test_report" file="sassrv1_at_%bquote(
&work1pct.)._&datestamp2._CST.xls"
style=EGDefault options( autofilter='all' embedded_titles='yes' autofit
_height= 'y... 阅读全帖
This is similar deal to last week samsung deal, but it is LG this time! Hope
Amazon can price match it!!
Link: http://www.frys.com/product/6181499
General:
Depth: 12.2 in
Digital Television Certification: HDTV
Dimensions: With stand
Enclosure Color: Gloss black
HDCP Compatible: Yes
HDMI Ports Qty: 3 port(s)
Height: 30.8 in
PC Interface: VGA (HD-15)
Product Type: 50 plasma TV
Timer Functions: Sleep
USB Port: Yes , 1 port(s)
Video Interface: Component, composite... 阅读全帖
I checked and the last post regarding this was a B&M post a few days ago,
and the other online offers were a few weeks-a month or more ago. I don't
need this but saw it and thought it might be of help to some, so please be
kind.
Link: http://www.target.com/p/Toro-Power-Shovel/-/A-10750281#?lnk=sc_
#?lnk=sc_qi_detailbutton" rel="nofollow" target="_blank" onclick="_gaq.push(
['_trackEvent', 'thread', 'click', '4039320 - toro-power-shovel-on-target.
com-34.64-was90.99']);">http://www.target.com/p/... 阅读全帖
【 以下文字转载自 JobHunting 讨论区 】
发信人: eversprint (征程), 信区: JobHunting
标 题: Startup的要求是一个小时左右完成一个 project
发信站: BBS 未名空间站 (Mon Mar 19 12:26:31 2018, 美东)
不刷题也不容易的,下面是我经历的一个挑战,大家可以看看能否达到人家的要求。
这个Startup的要求是一个小时左右完成下面这个Project,下面是原文:
As I mentioned, the next step is a technical skills challenge. We expect the
exercise to take about an hour, though it is not timed.
Take-Home Challenge - Backend
* Using Java or Kotlin and framework(s) of your choice (though we like
Spring Boot), create an API that accep... 阅读全帖
sequoia
Width: 79.9 in.
Height: 77.0 in.
Length: 205.1 in.
QX56
Width: 79.9 in.
Height: 75.8 in.
Length: 208.3 in.
LX570
Width: 77.6 in.
Height: 75.6 in.
Length: 196.5 in.
GL450
Width: 76.4 in.
Height: 72.4 in.
Length: 200.6 in.
这个QX甚至还比sequoia大
就是那个cut rope的二维扩展。用DP来做。
int getPrice(int L, int W, vector > pieces) {
int vector > M(L+1, vector(W+1, 0));
/*
Use DP.
For , cut the pieces from the left top corner we c
an get three sub-problems:
(1). getPrice(L-l(k), W, prices) & getPrice(l(k), W-w(k), prices)
(2). getPrice(L, W-w(k), prices) & getPrice(L-l(k), w(k), prices)
*/
for(int i=0; i<=L; ++i) {
for(int j=0; j
... 阅读全帖