ETL

ETL is sort for extract, transform, load, three db functions that are combined into one tool to pull data out of one db and place it into another db.

• Extract is the process of reading data from a db

• Transform is the process of converting the extracted data from its previous form into the form it needs to be in so that it can be placed into another db. Transformation occurs by using rules or lookup tables or by combining the data with another data. 

• Load is the process of writing data into the target db.

ETL is used to migrate data from one db to another, and also to convert db from one format or type to another.

Refresh Launchpad contents in MacOS

The fastest way to get there is by using Command+Shift+G in the Finder to access the “Go To Folder” function, then just paste

~/Library/Application Support/Dock/

 You will see a folder like this:

OS X Lion's Launchpad database files

 

 

 

 

 

If you want to back these up you can, otherwise just delete them by dragging the .db files to the Trash, and then kill the Dock again from the Terminal to force the databases to regenerate.

killall Dock (In Terminal)

Device frameworks ( 4.0 )

Name First available Prefixes Description
Accelerate.framework 4.0 cblas,vDSP Contains accelerated math and DSP functions. See Accelerate Framework Reference.
AddressBook.framework 2.0 AB Contains functions for accessing the user’s contacts database directly. See Address Book Framework Reference for iOS.
AddressBookUI.framework 2.0 AB Contains classes for displaying the system-defined people picker and editor interfaces. See Address Book UI Framework Reference for iOS.
AssetsLibrary.framework 4.0 AL Contains classes for accessing the user’s photos and videos. See Assets Library Framework Reference.
AudioToolbox.framework 2.0 AU,Audio Contains the interfaces for handling audio stream data and for playing and recording audio. See Audio Toolbox Framework Reference.
AudioUnit.framework 2.0 AU,Audio Contains the interfaces for loading and using audio units. See Audio Unit Framework Reference.
AVFoundation.framework 2.2 AV Contains Objective-C interfaces for playing and recording audio and video. See AV Foundation Framework Reference.
CFNetwork.framework 2.0 CF Contains interfaces for accessing the network via Wi-Fi and cellular radios. SeeCFNetwork Framework Reference.
CoreAudio.framework 2.0 Audio Provides the data types used throughout Core Audio. See Core Audio Framework Reference.
CoreData.framework 3.0 NS Contains interfaces for managing your application’s data model. See Core Data Framework Reference.
CoreFoundation.framework 2.0 CF Provides fundamental software services, including abstractions for common data types, string utilities, collection utilities, resource management, and preferences. See Core Foundation Framework Reference.
CoreGraphics.framework 2.0 CG Contains the interfaces for Quartz 2D. See Core Graphics Framework Reference.
CoreLocation.framework 2.0 CL Contains the interfaces for determining the user’s location. See Core Location Framework Reference.
CoreMedia.framework 4.0 CM Contains low-level routines for manipulating audio and video. See Core Media Framework Reference.
CoreMIDI.framework 4.2 MIDI Contains low-level routines for handling MIDI data. See Core MIDI Framework Reference.
CoreMotion.framework 4.0 CM Contains interfaces for accessing accelerometer and gyro data. See Core Motion Framework Reference.
CoreTelephony.framework 4.0 CT Contains routines for accessing telephony-related information. See Core Telephony Framework Reference.
CoreText.framework 3.2 CT Contains a text layout and rendering engine. See Core Text Reference Collection.
CoreVideo.framework 4.0 CV Contains low-level routines for manipulating audio and video. Do not use this framework directly.
EventKit.framework 4.0 EK Contains interfaces for accessing a user’s calendar event data. See Event Kit Framework Reference.
EventKitUI.framework 4.0 EK Contains classes for displaying the standard system calendar interfaces. See Event Kit UI Framework Reference.
ExternalAccessory.framework 3.0 EA Contains interfaces for communicating with attached hardware accessories. SeeExternal Accessory Framework Reference.
Foundation.framework 2.0 NS Contains interfaces for managing strings, collections, and other low-level data types. See Foundation Framework Reference.
GameKit.framework 3.0 GK Contains the interfaces for managing peer-to-peer connectivity. See Game Kit Framework Reference.
iAd.framework 4.0 AD Contains classes for displaying advertisements in your application. See iAd Framework Reference.
ImageIO.framework 4.0 CG Contains classes for reading and writing image data. See Image I/O Reference Collection.
IOKit.framework 2.0 N/A Contains interfaces used by the device. Do not include this framework directly.
MapKit.framework 3.0 MK Contains classes for embedding a map interface into your application and for reverse-geocoding coordinates. See Map Kit Framework Reference.
MediaPlayer.framework 2.0 MP Contains interfaces for playing full-screen video. See Media Player Framework Reference.
MessageUI.framework 3.0 MF Contains interfaces for composing and queuing email messages. See Message UI Framework Reference.
MobileCoreServices.framework 3.0 UT Defines the uniform type identifiers (UTIs) supported by the system.
OpenAL.framework 2.0 AL Contains the interfaces for OpenAL, a cross-platform positional audio library. For more information, go to http://www.openal.org.
OpenGLES.framework 2.0 EAGL,GL Contains the interfaces for OpenGL ES, which is an embedded version of the OpenGL cross-platform 2D and 3D graphics rendering library. See OpenGL ES Framework Reference.
QuartzCore.framework 2.0 CA Contains the Core Animation interfaces. See Quartz Core Framework Reference.
QuickLook.framework 4.0 QL Contains interfaces for previewing files. See Quick Look Framework Reference.
Security.framework 2.0 CSSM,Sec Contains interfaces for managing certificates, public and private keys, and trust policies. See Security Framework Reference.
StoreKit.framework 3.0 SK Contains interfaces for handling the financial transactions associated with in-app purchases. See Store Kit Framework Reference.
SystemConfiguration.framework 2.0 SC Contains interfaces for determining the network configuration of a device. SeeSystem Configuration Framework Reference.
UIKit.framework 2.0 UI Contains classes and methods for the iOS application user interface layer. See UIKit Framework Reference.

 

Variable arguments in Objective-C methods

Q: How can I write a method that takes a variable number of arguments, like NSString’s +stringWithFormat:?

A: Methods that take variable arguments are known as variadic methods.

Keep in mind that the implementation of an Objective-C method is just a block of code, like a C function. The variadic argument macros described in the stdarg(3) manual page work the same way in a method as they do in an ordinary function.

Here’s an example of an Objective-C category, containing a variadic method that appends all the objects in a nil-terminated list of arguments to an NSMutableArray instance:

Listing 1: A typical variadic method.

#import <Cocoa/Cocoa.h>

@interface NSMutableArray (variadicMethodExample)

- (void) appendObjects:(id) firstObject, ...;  // This method takes a nil-terminated list of objects.

@end

@implementation NSMutableArray (variadicMethodExample)

- (void) appendObjects:(id) firstObject, ...
{
id eachObject;
va_list argumentList;
if (firstObject)                      // The first argument isn't part of the varargs list,
  {                                   // so we'll handle it separately.
  [self addObject: firstObject];
  va_start(argumentList, firstObject);          // Start scanning for arguments after firstObject.
  while (eachObject = va_arg(argumentList, id)) // As many times as we can get an argument of type "id"
    [self addObject: eachObject];               // that isn't nil, add it to self's contents.
  va_end(argumentList);
  }
}

@end

 

Working with Hex Colors

When you have to design an iphone app the client often give you hex code colors to match the graphics or his graphics guidelines.

But in the iPhone all you can set is a level of red, green, and blue between 0 and 1. And transformation those Hex value can be a painfull. You can always open an image editing software like photoshop and find the color picker the RGB values on 255. All you have to do is divide this value by 255 to bring it to a scale beetween 0 and 1.

editorPicker

This process is too long and you can’t afford loosing time in this kind of stuff! So here are the solutions to do it faster.

  • Programmaticaly

You have to add this simple macro

#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

And here is how you use it for the #FF3245 color, simply replace the # by a 0x

UIColor *myHexColor =  UIColorFromRGB(0xFF3245);
  • With Color Pickers

Wafflesoftware created a custom color picker that understand HEX color codes. To install it you juste have to put it in this folder userHome/Library/ColorPickers if it doesn’t exist create it.

Now the color is selected but you can’t use it in your code, you stil don’t know the RGB values that’s where a second color picker comes in.Panic created another color picker that generates this code for you. To install it, put it in the same folder.

With this two pickers you can now easily transform an HEX color code in a UIColor object.

WafflesoftwarePicker PanicPicker

Just clic on copy with declaration and here is what you have

UIColor *aColor = [UIColor colorWithRed:1.000 green:0.196 blue:0.271 alpha:1.000];

Standard iPhone Element Sizes (Width x Height)

Core Elements:

Carrier Status bar – 320×20
UIView – 320×460
UINavigationBar – 320×44
UITabBar – 320×49
UISearchBar – 320×44
UIToolBar – 320×44

Data Input:

UIPickerView – 320×216
UIDatePicker – 320×216
UIKeyboard – 320×216

Buttons:

UISegmentedControl – 320×44
UIButton xx37

Fields:

UITextField – xx37
UISwitch 94×27
UISlider – xx23

Indicators:

UIProgressView -xx9
UIActivityIndicatorView – 37×37
UIPageControl – 38×36

When is the best time to initialize?

You now have some experience with the application lifecycle. Now that we are working with the navigation-based app style, and a data source, it’s time to ask about the best time to initialize your objects.

The “Events” example apps helped us understand the lifecycle of a different kinds of iOS apps. They also provide us with valuable information to help us code our methods wisely.

When is the best time to initialize?

There’s no simple answer. However, there are three or four methods that you could use, in the app delegate, and in the first/root view controller. Selecting one to use will depend on your data source, your goals, and so on.
.

Typical startup sequence

As you have learned from studying the “Events” example apps, the typical app launch will cause these view controller methods to be called, in the following sequence:

  1. awakeFromNib
  2. viewDidLoad
  3. viewWillAppear:
  4. viewDidAppear

What about the app delegate methods? A couple of them fire after awakeFromNib. Typically, we don’t use those much, because we don’t want to use the app delegate as a data source. That’s not good practice for iOS apps.

Which method do we use? As noted above, it will depend. Below, I have taken excerpts from the class reference documentation for each of these methods. Read them to help you decide what’s best for your app.

.

awakeFromNib

Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.

The nib-loading infrastructure sends an awakeFromNib message to each object recreated from a nib archive, but only after all the objects in the archive have been loaded and initialized.

When an object receives an awakeFromNib message, it is guaranteed to have all its outlet and action connections already established.

Typically, you implement awakeFromNib for objects that require additional set up that cannot be done at design time.

For example, you might use this method to customize the default configuration of any controls to match user preferences or the values in other controls.

You might also use it to restore individual controls to some previous state of your application.

.

viewDidLoad

This method is called after the view controller has loaded its associated views into memory.

This method is most commonly used to perform additional initialization steps on views that are loaded from nib files.

.

viewWillAppear:

This method is called before the receiver’s view is about to be displayed onscreen and before any animations are configured for showing the view.

.

viewDidAppear

This method is called after the receiver’s view was added to a window.

2 từ giống nhau

1. the time/when: hai từ này cùng nghĩa về thời gian.

Ví dụ:

  • It is the time/when I got home. (Đó là lúc tôi về nhà).

Không viết: It is the time when I got home.

2. the place/where: cặp từ này cũng nghĩa về nơi chốn.

Ví dụ:

  • It is the place/where I was born. (Đó là nơi tôi sinh ra).

Không viết: It is the place where I was born.

3. two và twins: Bản thân từ twins = two brothers or sisters chính vì vậy không bao giờ dùng two đi với twins.

Ví dụ:

  • My sister has twin sons. (Chị gái tôi có hai cậu con trai song sinh).

Không viết: My sister has two twin sons.

4. same/identical: như nhau, giống nhau. Dùng một trong hai từ.

Ví dụ:

  • I’ve got three identical/same blue suits. (Tôi có ba bộ vét màu xanh giống nhau).

Không viết: I’ve got three identical same blue suits.

5. new và innovation: innovation có nghĩa là ” a new idea” nên ta cũng không dùng song song hai cặp từ này.

Ví dụ:

  • You’ll agree with me that all these are as a result of advanced innovation in computer technology. (Bạn sẽ đồng ý với tôi rằng để có được những thứ này đều là nhờ sự đổi mới trong lĩnh vực công nghệ thông tin).

Không viết: You’ll agree with me that all these are as a result of advanced new innovation in computer technology

6. repeat và again: repeat có nghĩa là “to say again”

Ví dụ:

  • Would you mind repeating what you just said? (Xin nhắc lại những gì anh vừa nói được không ạ?).

Không viết: Would you mind repeating again what you just said?

7. join và together: join có nghĩa ” to bring together, to put together, to become a part or member of …” nên các bạn cũng tránh viết là: join together.

Ví dụ:

  • Would you like to join us for supper? (Cậu có muốn dùng bữa tối với chúng mình không?).

Không viết: Would you like to join together with us for supper?

8. compete và together: compete = đua tranh, cạnh tranh với nhau “to take part in a contest against others”

Ví dụ:

  • The two athletes are competing for the gold medal. (Hai vận động viên đang tranh đua để giành tấm huy chương vàng).

Không viết: The two athletes are competing together for the gold medal.

9. sufficient và enough: hai từ này đều có nghĩa là “đủ”.

Ví dụ:

  • This recipe should be sufficient/enough for five people. (Món ăn này sẽ đủ cho 5 người).

Không viết: This recipe should be sufficient enough for five people.

10. return và back, revert và back: cả hai từ returnrevert đều có nghĩa là “to go back, to send back” vì vậy back là thừa.

Ví dụ:

  • She left South Africa at the age of 15 and has never returned. (Cô ta rời Nam Phi lúc 15 tuổi và không bao giờ trở lại).

Không viết: She left South Africa at the age of 15 and has never returned back.

11. advance forward, proceed forward, progress forward: Cả 3 từ advance, proceed , progress đều có nghĩa là tiến lên (to move in a forward direction). Vì vậy bạn cũng không được dùng forward song song với advance, proceed hay progress.

Ví dụ:

  • The troops advanced on the city. (Các đoàn quân đã tiến vào thành phố).

Không viết: The troops advanced forward on the city.

  • I’m not making much progress with my Spanish. (Tôi không đạt được nhiều tiến bộ với môn tiếng Tây Ban Nha).

Không viết: I’m not making much progress forward with my Spanish.

  • His lawyers have decided not to proceed with the case. (Các luật sư của anh ta đã quyết định không tiến hành vụ kiện này).

Không viết: His lawyers have decided not to proceed forward with the case.

Thủ thuật khởi động xe máy

Một số chuyên gia về động cơ xe máy có gợi ý vài thủ thuật trước khi nổ máy xe vào mỗi sáng để chắc chắn việc khởi động luôn thành công. Đối với xe tay ga, do có khá nhiều loại xe không có cần khởi động và dây kéo le hỗ trợ nạp khí nên trước khi ấn nút khởi động, bạn hãy bật khóa điện và vặn tay ga một vài lần rồi hãy đề nổ. Tác dụng chính của việc làm này là làm tăng độ đậm đặc của hỗ hợp khí khi nhiên liệu được hút lên một cách cưỡng bức. Có thể, sẽ phải thực hiện động tác này một vài lần sau mỗi lần đề nổ không thành công. Nhưng kinh nghiệm cho thấy, hầu như xe tay ga nào cũng có thể nổ được máy nhanh chóng nhờ cách hỗ trợ nạp hỗn hợp khí theo kiểu thủ công này.

Ngược lại với xe tay ga, đối với các loại xe số, do có dây kéo le và cần khởi động nên cách tốt nhất là kéo dây le ra trước khi nổ máy vào mỗi buổi sáng. Để chắc chắn hơn thì có thể nhấn cần đạp một vài lần rồi mới mở khóa điện để nổ máy. Một điểm khác biệt đối với xe số là không nên vặn tay ga trước khi nổ máy vì khi đó sẽ làm tăng lượng gió vào chế hòa khí và vô tình làm giảm độ đậm đặc của hỗn hợp hòa trộn.

Trong trường hợp khởi động bằng nút đề mà máy không nổ thì nên chờ khoảng 10 giây rồi mới khởi động lại. Việc này sẽ giữ cho tuổi thọ ắc quy trong chiếc xe của bạn được lâu dài hơn. Khi động cơ đã nổ, từ từ đóng cần gạt le cho đến khi máy nóng và tiếng nổ ổn định. Thực hiện đúng quy trình như trên là cách sử dụng đúng đắn không những tạo hiệu năng cao và tăng độ bền cho động cơ mà còn giúp bạn không mất nhiều thời gian và tránh sự khó chịu vào mỗi buổi sáng.

Truyện vui cười về lập trình viên, tin học 2

Dịch nghĩa ngộ nghĩnh từ tên các hãng IT
Oracle: Online Romance And Chatting with Lady Employees (Lả lơi trên mạng và trò chuyện với nhân viên nữ).
Dell: Deplorable Equipment and Lacklusters (Thiết bị lờ đờ).
IBM: Implicitly Boring Machines (Những cỗ máy hoàn toàn chán ngắt).
NIIT: Not Interested in IT (Không hứng thú gì với công nghệ thông tin).>> I’m learning…=))

Cần anh
Thấy người vợ lúc nào về nhà cũng ngồi ngay vào chiếc máy tính và ít quan tâm đến mình, ông chồng nổi cáu:
“Rốt cuộc, em cần anh hay cần nó?”
Vợ : “Em cần anh nhiều lắm chứ”.
Chồng quát: “Cần lúc nào? Có thấy đoái hoài gì đâu?”
Vợ: “Những lúc nó hỏng, em cần anh… sửa nó”.
Chồng : ???

Trộm vào nhà kỹ sư vi tính

Tên trộm lừng danh ở thành phố nọ lẻn vào một căn nhà. Đột nhiên, có một giọng nói dịu dàng cất lên: “Em nhìn thấy anh rồi nhé”.
Gã giật mình nhìn quanh phòng. Không có ai cả, gã lại tiếp tục lục lọi.
“Trông anh thật hấp dẫn, bờ vai rất rộng, ngực rất nở…”
Tên trộm lại giật mình và đập tay vào công tắc đèn ngủ. Một luồng ánh sáng mờ mờ rọi chiếu. Trước mặt hắn là một cô gái không mặc gì cả.
“Ôi…”, hắn thốt lên và quên mất mục đích cùa mình.
“Lại đây nào, anh yêu”.
Gã vừa cầm lấy tay cô gái thì “bụp” – hai chiếc còng tự động chụp lấy hắn.
“Trời đất, cô chỉ là búp bê thôi hả?”
“Không, em là người tình của anh. Đừng sợ, sẽ rất nhẹ thôi…”
Sau đó, tên trộm lừng danh bị giải đến đồn cảnh sát. Chủ nhân ngôi nhà, một kỹ sư lập trình nổi tiếng, tiết lộ: “Câu chuyện xảy ra thật tình cờ. Tôi chế tạo cô gái này vốn là để huấn luyện cho các quý ông mắc bệnh sợ đàn bà thôi”.

Tìm tình
Có một anh lập trình viên muốn bỏ việc để đi tìm người yêu.
Hôm nay bỏ việc lập trình
Làm thi sĩ (dỏm) kiếm mảnh tình vắt vai.
Lập trình mãi cổ thêm dài
Lưng còng ngắn lại, xấu ai thèm nhìn.
Trước ra đường thấy gái xinh
Cúi đầu, chép miệng, làm thinh, hận mình…
Quanh năm chỉ một người tình
Mặt nàng vuông đét vừa tròn 17 inch
Mặc cho nàng rất chiều mình
Vui cho nghe nhạc, buồn tình xem phim.
Kệ! Giờ ta quyết chí đi tìm
Nàng thơ để kiếm mảnh tình cho sương (sướng).

Công nghệ tiêu biểu trong năm
Hội Sợ Vợ tổ chức cuộc bình chọn sản phẩm công nghệ tiêu biểu. Kết quả thu được như sau:
– Công nghệ nguy hiểm nhất: Định vị toàn cầu (Global Positioning System – GPS) vì các ông sẽ bị vợ mình phát hiện ra dù là đang ở đâu.
– Công nghệ lý tưởng nhất : Không dây (Wireless), vì online ở đâu cũng được, ngay cả lúc đang ở bên một… bóng hồng nào đó và có thể nói với vợ là đang ở trong phòng họp hay đang đi trên xe.