Skip to content

Instantly share code, notes, and snippets.

#include <OpenGL/OpenGL.h>
#include <GLUT/GLUT.h>
void renderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0f, 0.0f, 0.0f);
@skyfe79
skyfe79 / GLUT_tut01_01.cpp
Created June 24, 2012 10:22
GLUT Tutorial 01
#include <GLUT/GLUT.h>
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("3D Tech- GLUT Tutorial");
return 0;
- (CGImageRef)CGImageRotatedByAngle:(CGImageRef)imgRef angle:(CGFloat)angle
{
CGFloat angleInRadians = angle * (M_PI / 180);
CGFloat width = CGImageGetWidth(imgRef);
CGFloat height = CGImageGetHeight(imgRef);
CGRect imgRect = CGRectMake(0, 0, width, height);
CGAffineTransform transform = CGAffineTransformMakeRotation(angleInRadians);
CGRect rotatedRect = CGRectApplyAffineTransform(imgRect, transform);
@skyfe79
skyfe79 / recordVideo.m
Created August 27, 2013 02:46
record video on ios
- (IBAction)recordVideo:(id)sender {
[self startCameraControllerFromViewController:self usingDelegate:self];
}
- (BOOL)startCameraControllerFromViewController:(UIViewController *)controller usingDelegate:(id)delegate {
if(([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO)
|| (delegate == nil)
|| (controller == nil)) {
return NO;
}
@skyfe79
skyfe79 / playVideo.m
Created August 27, 2013 02:47
play video on ios
- (IBAction)playVideo:(id)sender {
[self startMediaBrowserFromViewController:self usingDelegate:self];
}
- (BOOL)startMediaBrowserFromViewController:(UIViewController *)controller usingDelegate:(id)delegate {
if(([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum] == NO)
|| (delegate == nil)
|| (controller == nil)) {
return NO;
}
@skyfe79
skyfe79 / accessAssetLibrary.m
Created August 29, 2013 06:17
access asset library and fetch a video at the first.
- (IBAction)onClickAccessAssetButton:(id)sender
{
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
[group setAssetsFilter:[ALAssetsFilter allVideos]];
[group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:0]
options:0
usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
if(result)
{
@skyfe79
skyfe79 / loadStillImageFromAsset.m
Created August 29, 2013 08:22
load still image from an asset
- (void)loadStillImage:(AVAsset *)asset
{
if([[asset tracksWithMediaType:AVMediaTypeVideo] count] > 0)
{
AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc] initWithAsset:asset];
imageGenerator.appliesPreferredTrackTransform = YES;
CMTime tumbTime = CMTimeMakeWithSeconds(1, 30);
CGSize maxSize = CGSizeMake(128, 128);
imageGenerator.maximumSize = maxSize;
#!/bin/bash
###########################################################################
# Choose your ffmpeg version and your currently-installed iOS SDK version:
#
VERSION="2.0.2"
SDKVERSION="7.0"
#
#
###########################################################################

Question

How to implement a UITableView with a separator line like this:

doubly separator line

Usually, you can only set the separatorLine property of a UITableView with to single line or single line etched. Sometimes, it is not enough. So, how to implement a separator line like this?

Answer

<?xml version="1.0" encoding="UTF-8"?>
<tt xmlns="http://www.w3.org/ns/ttml">
<head>
<metadata xmlns:ttm="http://www.w3.org/ns/ttml#metadata">
<ttm:title>Timed Text TTML Example</ttm:title>
<ttm:copyright>The Authors (c) 2006</ttm:copyright>
</metadata>
<styling xmlns:tts="http://www.w3.org/ns/ttml#styling">
<!-- s1 specifies default color, font, and text alignment -->
<style xml:id="s1"