sql join join join and filter

寫 sql 唔同你寫 program 唔係入個阿媽某個 column 既 value 再隊入去 另一個 table 當 parameter

係乜都用左大 join 先 唔o岩用 ? 日期大過 effective date 既 cost ? join 左先啦

最後先 filter

唔理架 乜都 join 十幾萬 record 大溶爐先 最後想要咩 record 先慢慢 filter

A1 單要配 某個日子既 cost ?

A1(which is Date3)-Cost1 Date1 A1(which is Date3)-Cost2 Date2 A1(which is Date3)-Cost3 Date3

join 晒先 再啄走唔要個d 留翻一個 係我夠知 A1 – Date3 先o岩 你 join 左再用 on 去啄 如果唔係有乜法 je~

SUM() subquery in select clause

SUM 最重要還是 where clause select + where = filter select + sum() + where = satisfy 以前細個學又話叫 filter … 其實我覺得叫 satisfy 好d

又所以 我發覺 sum() subquery in select clause, group by 係唔需要:

select a, b, (select sum(xxx) where [CONDITION] 這裡放 group by 無用) as yyy, …

select …(select sum(xxx) where sth)只能回一個 single row , 唔係就會 error, 所以個 where clause 要俾夠 info 去砌到得翻一個 rowgroup by 本身 for multiple row 去教 table 點 group … 但 single row 其實就無必要

我開頭以為 sum() 既 logic 係 define 係 group by which is 錯既 … 但原來都係放係 where 到

ref: Capture

有時我蠢 要人地解點解要整新功能 去解決緊咩問題 之 map/reduce in js for play with json/data

https://rangle.io/blog/map-reducing-the-pain-of-dealing-with-arrays/

map: But it’s not really a way of dealing with arrays. It’s about mapping one value into a new value, and getting the same type back.

So the takeaway is that you don’t have to care if map loops or not, or how it loops, or in some languages how many threads it uses. If you are using a map method on an array, or on a library Promise or Observable, or anything else, it will do what it has to do to transform the value(s), and give you back the same type, so that you can keep calling map on the result.

XML Pretty Print CDATA new one line … not good

Capture

Nani ?

點 pretty print CDATA 都自己跌落一行?

你話無問題 你想 search by <field=”id”>xxx 你就知你d value 要一行過 咁點解決

個問題係錯左 xml tools engine, too long no read, 打死都用 QuickXML

但已經隔左行 7左咁點算

1) Use xmltools > option > Engine:SimpleXML > Linearize > 變翻無格仔一行先

2) Use QuickXML > Pretty Print

entrypoint is the command , CMD is for argument

https://www.ctl.io/developers/blog/post/dockerfile-entrypoint-vs-cmd/

but you want run run entrypoint.sh then start.sh, here is the tricks

ENTRYPOINT ["/entrypoint.sh"]
some code or not...
CMD ["/start.sh"]

entrypoint.sh:

some code for entrypoint ...
exec "$@"

using exec, the start.sh (as parameter) will run

Free account for ios deploy real device to test

https://learnappmaking.com/how-to-create-a-free-apple-developer-account/

  • Requires free Apple Developer account, at a minimum. Free account provisioning expires every 7 days, requiring reloading/rebuilding, but you will not lose any data.

    Paid Apple Developer provisioning may only require re-signing once a year.

SKView please presentScene(nil) or the scene will still here and eat the memory

me design LevelViewController (TableView) -> present -> GameViewController . SKView . Scene

When I dismiss the GameViewController, the scene “update” (onEnterFrame) still running, to prove that the scene has not been killed

And after several time present the GameViewController, the app will lag becoz too many SKScene is running.

So please (self.view as! SKView).presentScene(nil) when GameViewController self.dismissViewControllerAnimated(true, completion: nil)

Must call a designated initializer of the superclass

  • 即係講到尾, subclass 想 call super.init 唔可以 call 佢個d convenience 只能 call 基本 init
  • 基本 init 又可以有好多個 , 你要 superclass 佢, 就要 required 晒佢~

    class NoteMessage: Message { let content: String
    
        init(content: String, theUser: String)
        {
            self.content = content
            super.init(sender: theUser)
            //Error!:  Must call a designated initializer of the superclass 'Message'
        }
    }
    

enter image description here

the virtualbox system ubuntu bit maybe wrong

I know at least 2 ways. Open a terminal and type:

uname -a

Result for 32-bit Ubuntu:

Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

whereas the 64-bit Ubuntu will show:

Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

or

file /sbin/init

Result for 32-bit Ubuntu:

/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

whereas for the 64-bit version it would look like:

/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

mac freeze login steam

You should now be able to see the Steam folder, and the registry.vdf file inside that. Simply rename the file, or delete the full stop so that Steam doesn’t recognise the file (you can delete the file, but best to rename first as if this fails, you might want to be able to revert back).

Once the file has been renamed, you should be able to start up Steam and get back online. Note: if the above fails, try following all of the steps again but rather than starting up Steam, re-install it instead.

Worked for me – I’m now back online.

http://steamcommunity.com/discussions/forum/2/828934724089990063/

duplicate MC……自己 load 自己

http://asgrocery.blogspot.com/2010/02/actionscript-3-duplicate-stage-instace.html#more

很有趣的構思

[actionscript3]
package {
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.utils.ByteArray;

/**
* …
* @author Focus1921
*
* 複製無綁定類別movie clip場景實體(stage instance)實作demo(fla文件類別)
*/
public class DocTest extends MovieClip {
//stage instance
public var test_box_mc:MovieClip; //場景上僅有的movie clip, 實體名稱test_box_mc

private var ba:ByteArray; //儲存自己這個swf的byte array
private var ldr:Loader; //建一個loader來load ba
private var tmpX:Number;
private var tmpY:Number;

/**
* 建構式
*/
public function DocTest() {
if (stage) {
init();
}else {
addEventListener(Event.ADDED_TO_STAGE, init);
}
}

private function init(e:Event = null):void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

//確保主場景load只load自己一次,避免溢位
if (parent is Stage) {
trace("parent is Stage");
//建構url loader(binary)去load自己的byte array
var _urlLoader:URLLoader = new URLLoader();
_urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
//trace(root.loaderInfo.url);
_urlLoader.load(new URLRequest(root.loaderInfo.url));
_urlLoader.addEventListener(Event.COMPLETE, onURLLdrComplete);
}

//建構loader, 註冊complete完成偵聽
ldr = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onLdrComplete);

//stage註冊click偵聽
stage.addEventListener(MouseEvent.CLICK, onStageClick);
}

//—Event Handler—————————————————————————–

private function onURLLdrComplete(e:Event):void {
e.currentTarget.removeEventListener(Event.COMPLETE, onURLLdrComplete);
//把load到的byte array存起來
ba = e.currentTarget.data;
}

private function onLdrComplete(e:Event):void {
//用實體名稱去抓到要複製的movie clip,每次load完都會傳不同的引用
var _mc:MovieClip = <div style="display: inline; height: auto; position: absolute; visibility: hidden; width: auto; ">MovieClip</div>MovieClip(ldr.content).getChildByName("test_box_mc") as MovieClip;
//屬性設定不同的值,證明的確不是同一個引用
_mc.x = tmpX;
_mc.y = tmpY;
_mc.alpha = Math.random();
//加入顯示清單
addChild(_mc);
}

private function onStageClick(e:MouseEvent):void {
//把點擊座標記起來,當作複製後的mc的座標
tmpX = e.stageX;
tmpY = e.stageY;
//loader去load(loadBytes)存起來的byte array(ba)
ldr.loadBytes(ba);
}

}

}
[/actionscript3]

Flash compile exe -> Flash player 可選!

最新既 flash player 10 多左個 digital cert 功能,可惜的是 IE 去開既時候會鬧你無正確既 digital cert,咁點解決呢

1. 用 zip -> sfx 既方法,IE 就唔當 flash player 開

2. compile 既時候,換個 flash player,用 無cert 既 9 或者用 10 既 debug version (但希望你個 program 無 bug,唔係出 error)

how?

program files -> flash -> player

換左類面個 player 佢

export 出黎既 exe 就係包呢款 player,

(projector 原理: 包個 flash player,叫佢開個 swf 之嘛)

無 cert 既 projector 就過關了!