Thứ Tư, 4 tháng 7, 2012

SQL Server ~ view 的應用感想XD

這次接手人家的網站

雖然人家也是先包給某家廠商後來才找我們把後面功能弄好一"一

由於人家弄得資料表有問題

例如年的欄位用varchar..........月的欄位.....數量的欄位通通都用varchar........

暈倒XD

這樣我們怎麼做查詢XD

起初我的想法是改table

可惜不給改..........沒辦法就是降子

好在張睪提供了好方法.....

用View

就是新增一個View把該table查詢出來的欄位都轉型

這樣就大功告成.......真的是方法中的方法0rz.......

此為我們新增的view~~~欄位超多所以超長XD


SELECT SN, CONVERT(datetime, Year + '-' + Month + '-01') AS date, CAST(GG1 AS int) AS GG1, CAST(GG2 AS int)
AS GG2, CAST(GG3 AS int) AS GG3, CAST(GG4 AS int) AS GG4, CAST(GG5 AS int) AS GG5,
CAST(GG6 AS int) AS GG6, CAST(GG7 AS int) AS GG7, CAST(GG8 AS int) AS GG8, CAST(GG9 AS int)
AS GG9, CAST(GG10 AS int) AS GG10, CAST(GG11 AS int) AS GG11, CAST(GG12 AS int) AS GG12,
CAST(GG13 AS int) AS GG13, CAST(GG14 AS int) AS GG14, CAST(GG15 AS int) AS GG15,
CAST(GG16 AS int) AS GG16, CAST(GG17 AS int) AS GG17, CAST(GG18 AS int) AS GG18,
CAST(GG19 AS int) AS GG19, CAST(GG20 AS int) AS GG20, CAST(GG21 AS int) AS GG21,
CAST(GG22 AS int) AS GG22, CAST(GG23 AS int) AS GG23, CAST(GG24 AS int) AS GG24,
CAST(GG25 AS int) AS GG25, CAST(GG26 AS int) AS GG26, CAST(GG27 AS int) AS GG27,
CAST(GG28 AS int) AS GG28, CAST(GG29 AS int) AS GG29, CAST(GG30 AS int) AS GG30,
CAST(GG31 AS int) AS GG31, CAST(GG32 AS int) AS GG32, CAST(GG33 AS int) AS GG33,
CAST(GG34 AS int) AS GG34, CAST(GG35 AS int) AS GG35, CAST(GG36 AS int) AS GG36,
CAST(GG37 AS int) AS GG37, CAST(GG38 AS int) AS GG38, CAST(GG39 AS int) AS GG39,
CAST(GG40 AS int) AS GG40, CAST(GG41 AS int) AS GG41, CAST(GG42 AS int) AS GG42,
CAST(GG43 AS int) AS GG43, CAST(GG44 AS int) AS GG44, CAST(GG45 AS int) AS GG45,
CAST(GG46 AS int) AS GG46
FROM dbo.Quality

PDF Sharp ~ 亂碼問題

這問題是在對方server輸出pdf

出現亂碼的問題

但由於我們都跑得很正常

所以就推估應該是字型問題

嘗試改了幾個字型確實可以working~~

遇到這問題的就試試看囉

Style style = document.Styles[StyleNames.Normal];
style.Font.Name = "微軟正黑體";

一開始的設定是

style.Font.Name = "Arial Unicode MS";

而人家的Server 2008 R2跑不出來

我們是Win7才如此推估

好在確實是這問題XD


Thứ Ba, 3 tháng 7, 2012

Derek and the Dominoes: Nobby Clark triggers a major WTF?

The AMA's recent press release rescinding Derek 'Nobby' Clark's accession into the Motorcycle Hall of Fame triggered so much forehead slapping amongst motorcyclists that it could have been confused for applause for the AMA's mysterious decision.

On Facebook, the early consensus was that whatever the cause of the confusion had been, that had resulted in Clark first being listed as one of this year's inductees and then having that honor rescinded before it was even given, the confusion would have been better swept under the rug. Most people said the AMA should just have given Clark the honor.

As usual, RoadracingWorld.com has a more detailed and informed perspective on the issue. Reading Dean Adams' email to Roadracing World on the Clark kerffufle won't really clarify much for you, if you're hoping to understand how the AMA actually makes decisions. But Michael Gougis' story (complete with a link to a mug shot!) does make clear why Clarke was removed from this year's Hall of Fame inductees; he was charged and pleaded guilty to theft of motorcycle parts from Rob Iannucci/Team Obsolete.

I first met Rob Iannucci in the mid-'90s, when he wrote a foreword for my book Classic Motorcycles. We went for dinner at some little Italian joint in New York, and I spent the evening listening to him recite a litany of perceived slights, mostly at his treatment at the hands of AHRMA officials. I remember him telling me about his falling out with Clark (I think Rob had brought Clark to Team Obsolete to rebuild his priceless 250-6.) While I've long forgotten most of the details of our conversation, I do remember that, at the time, I thought, "There's probably two sides to that story."

Rob seems to have mellowed a bit in recent years, but as AHRMA learned, he could be famously obstreperous, really held a grudge, and took a bare-knuckled approach to legal action. I didn't doubt that he could have been vindictive enough to press theft charges just to make an enemy's life miserable.

I suppose Clark really did steal some of Rob's stuff; that's the view of the courts, anyway. In the black-or-white legal world, people are either guilty of theft, or innocent. But in the world where we live, it's all shades of grey, and things aren't so certain. Lots of people plead 'guilty' without being guilty, just to get out of a legal situation. It's a little hard for me to understand, if Clark was really guilty of what must have been 'grand theft', that a few years later he was granted U.S. citizenship.

I'm sure there are more egregious miscreants in the Hall. But in hindsight, the AMA committee should have paid more attention to Clark's criminal record, and quietly deep-sixed his nomination. While no one questioned Clark's Hall-of-Fame-worthiness, it's not as if he'd be conspicuous by his absence from the Hall -- or that he himself ever expected the honor.

Clark is in his mid-70s now. As far as I know, he's still working as a mechanic. Over the years, I've seen him at a couple of motorcycle events, where other old men want to get close to him because he had been close to Mike Hailwood. But like so many people who have devoted most of their lives to motorcycle racing, he left the sport with little more than memories and his reputation. Whatever happened between him and Iannucci certainly damaged his reputation and the AMA's public debacle has brought it all up again.

It's demoralizing, the way the AMA seems determined to undermine motorcyclists' faith in our institutions.


jQuery Flot ~ set Label example


var d1 = [];
d1.push([1, 1234]);
d1.push([2, 5678]);

var stack = 0, bars = true, lines = false, steps = false;
$.plot($("#statisticsGraph"), [d1], {
series: {
lines: { show: lines, fill: true },
bars: { show: bars, barWidth: 0.8 }
}, xaxis: {
ticks: [[1, 'out hospital'], [2, 'in hospital']]
}
});


reference
http://stackoverflow.com/questions/459947/how-do-i-control-the-tick-label-size-in-flot

Exagon Furtive eGT - Electric 2 + 2 Concept Car

Bonjour Monsieur Bond - your future looks electric

France has a long and rich history of innovative vehicles and although the name might not be familiar Exagon Motors have years of experience designing and racing electric vehicles in the Andros Trophy electric category - A slightly mad ice racing series held in the frozen alps!

Exagon Motors are based at the former French Grand Prix circuit Magny Cours, and this is what they say about the Furtive eGT:

"The Furtive-eGT is no run-of-the-mill GT car. It represents a new approach to grand touring, a new experience on the road, a new sports car driving concept with added comfort. Electric propulsion offers entirely new sensations, in part thanks to immediate torque availability. With a constant torque of 480 Nm from 0 to 5,000 rpm, the Furtive-eGT has a phenomenal capacity for acceleration – 0 to 100 km/h in 3.6 s – and can hit 287 km/h on the race track (maximum speed is otherwise limited electronically to 250 km/h). Such high performance is achieved in near-silence, with only the air flow to be heard, heightening the sensations experienced while driving. This is more than just impressive figures, it is a once-in-a-lifetime experience.

The Furtive-eGT is powered by two latest-generation motors created by Siemens Corporate Technology, each providing an output of 125 kW, i.e. total power equivalent to 340 hp at 5,000 to 10,000 rpm. These are currently the lightest and most compact engines available on the market. They have a liquid cooling system and their efficiency is outstanding.

The lithium-ion batteries manufactured by worldwide specialist Saft are the beating heart of the Furtive-eGT. These state-of-the-art VL 4 batteries provide 150 kWh. They have a life cycle of approximately ten years, can undergo 3,000 charging cycles and are recyclable. Their autonomy is astounding: 197 to 402 km in electric-only mode, depending on usage conditions. An optional range extender brings the autonomy up to 807 km."
Exagon are hoping to offer the Furtive e-GT as a pure electric 2 + 2 and also with a range-extending petrol engine (not for driving the wheels - purely as a battery charging system). 

No news as yet on when the Exagon Furtive e-GT will become available, but judging by looks and specification the sooner the better please!

Thứ Hai, 2 tháng 7, 2012

jQuery Flot ~ Invalid dimensions for plot

Invalid dimensions for plot, width = 893, height = 0

假如要用jQuery Flot 產生圖表

出現這問題是因為

沒有設定到指定畫圖表物件的高跟寬

加上css設定下就OK~

#statisticsResult{
height:300px;
width:300px;
}

Protoscar LAMPO3 GT - Prototype Electric Supercar

Presumably it will usually run on Tarmac?

Switzerland's Protoscar concern has designed and built it's third incarnation of Electric supercar - The Lampo (Swiss for Lightning) - is now ready to go into production, and Protoscar are actively looking for partners to help turn this striking prototype into a production reality.

Here's what Protoscar themselves have to say about the Lampo 3 GT:

"After its predecessors LAMPO  and LAMPO 2, LAMPO 3
– the third prototype of electric super sports car 
developed by Protoscar – will also be exposed at the Geneva Motor Show starting March 8
th
, 2012. During 
the past 3 years, the LAMPO's  have been fine-tuned together with the partner company EVTEC. The electric 
sports cars have been tested for more than 40.000km on circuits and streets  all over Europe. Since the 
results are more than promising, LAMPO 3 could now be further developed in a micro series. 

With 3 BRUSA-motors outputting 570 HP and 900 Nm of torque, LAMPO 3 is the most powerful full electric 
2+2-seater in the world. It also is the first electric vehicle equipped with two different DC fast charging inlets 
(CHAdeMO and the new German standard), allowing for “Coffee&Charge” breaks. Dual DC inlet allows to 
recharge enough energy for up to 100km additional range within just 10 minutes, with every type of  DCcharger 
you will find on the highways or at “petrol stations” in the close future. In fact, such DC-charger will 
be commercialized and installed on behalf of power utilities and petrol stations very soon in Switzerland and 
Europe by a recently established company focusing on charging infrastructure, with a strong connection to 
Protoscar: Alpiq E-Mobility AG.
Compared to the prototype LAMPO 3 , important further technical developments have been prepared in order 
to meet the needs of the micro series:

 lighter and stiffer chassis has been designed (optimized for production by ThyssenKrupp System 
Engineering)
 a new 42 kWh battery pack supplied by Akasol Engineering will be introduced and
 the interior has been designed and will be fully visualized by a virtual animation to be unveiled  at the  
Geneva Motor Show 2012".

The Lampo will be available in a variety of body styles including a 'soft-top' version. Here at The Efficient Car Guide opinions are divided on it's looks, but that's no bad thing - at least it aint bland!!