This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
/* | |
* Copyright 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.drawable.Drawable; | |
import android.support.v4.content.ContextCompat; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
public class DividerItemDecoration extends RecyclerView.ItemDecoration { |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
from __future__ import print_function | |
from heapq import * | |
heapC=[4,5,1,3] | |
print("our candidate random array who volunteered to be a heap array:\n") | |
print(heapC,"\n") | |
heapify(heapC) | |
print("after sorting our candidate as heap: \n") | |
print(heapC,"\n") |
#include<stdio.h> | |
#include<Windows.h> | |
#include<stdlib.h> //required for malloc | |
#include<malloc.h> //required for malloc | |
//thread needs a function to execute, a parameter to this function if it has any, and a thread id | |
DWORD WINAPI threadwork(LPVOID param); | |
//DWORD is a data type for OS like int, WINAPI for OS to understand that it is a thread function | |
//Thread function only takes one parameter. |
#include <stdio.h> | |
#include <Windows.h> | |
define NO_OF_PROCESS=1; | |
int main(int argc, char* argv[]) | |
{ | |
STARTUPINFO si[NO_OF_PROCESS]; | |
PROCESS_INFORMATION pi[NO_OF_PROCESS]; | |
HANDLE handles[NO_OF_PROCESS]; |
#include<stdio.h> | |
#include<Windows.h> | |
#define NO_OF_PROCESS 4 | |
int main(int argc, char* argv[]) | |
{ | |
STARTUPINFO si[NO_OF_PROCESS]; //needed info to create process, cb(size needed for info), new window, title... | |
PROCESS_INFORMATION pi[NO_OF_PROCESS]; //to store info of newly created process, ids, handles of process and thread... | |
int i=0; |
#include<stdio.h> | |
#include<Windows.h> | |
int main(int argc, char* argv[]) | |
{ | |
//we'll execute this child process with one argument from parent process, | |
//so we are checking if the number of arguments is right. | |
//If you wanna give more arguments, check according to this. | |
//argc is the number of arguments + 1(process that is executed) | |
// ex: child.exe 1 => argc=2 , calculator.exe "what's up?" "hey" "yov" 4 => argc=5 |
#include<stdio.h> //for printf | |
#include<stdlib.h> //for system("pause") | |
int main(int argc, char* argv[]) | |
{ | |
int ages[] = {30, 28, 31, 35}; | |
char *names[] = {"Dexter", "Debra", "Hannah", "Masuka"}; | |
int count = sizeof(ages)/sizeof(int); | |
//setup pointers |