This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .. code-block:: bash | |
| git checkout gh-pages | |
| git merge -s ours master | |
| git checkout master | |
| git merge gh-pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cdef class CArray: | |
| """Class for representing c-array. Due to lack of void ptr arithmetic support there is no void casting magic, therefore per type casting is needed.""" | |
| cdef public list PyList | |
| cdef public unsigned int PyListSize | |
| def __init__(self, arr=None): | |
| dprint("Initialize CArray in __init__") | |
| if arr is not None: | |
| self.PyList = self.fix_args(arr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Async class for communication with I/O for saving taken photo | |
| * @param jpeg byte representation of given photo for saving to filesystem | |
| */ | |
| class SavePhotoTask extends AsyncTask<byte[], String, String> { | |
| @Override | |
| protected String doInBackground(byte[]... jpeg) { | |
| UUID image_name = UUID.randomUUID(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * mcwm, a small window manager for the X Window System using the X | |
| * protocol C Binding libraries. | |
| * | |
| * For 'user' configurable stuff, see config.h. | |
| * | |
| * MC, mc at the domain hack.org | |
| * http://hack.org/mc/ | |
| * | |
| * Copyright (c) 2010, 2011, 2012 Michael Cardell Widerkrantz, mc at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun rename-file-and-buffer (new-name) | |
| "Renames both current buffer and file it's visiting to NEW-NAME." | |
| (interactive "sNew name: ") | |
| (let ((name (buffer-name)) | |
| (filename (buffer-file-name))) | |
| (if (not filename) | |
| (message "Buffer '%s' is not visiting a file!" name) | |
| (if (get-buffer new-name) | |
| (message "A buffer named '%s' already exists!" new-name) | |
| (progn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void quickSort(zaposlenici arr*, int left, int right) | |
| { | |
| int i = left, j = right; | |
| zaposlenici tmp; | |
| zaposlenici *pivot = arr[(left + right) / 2]; | |
| /* partition */ | |
| while (i <= j) { | |
| while (arr[i]->oib < pivot->oib) | |
| i++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Neka je zadana baza znanja: | |
| zaposlenik::osoba. | |
| kupac::osoba. | |
| menadzer::zaposlenik. | |
| direktor::menadzer. | |
| stefica:kupac. | |
| ivek:zaposlenik. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random, subprocess | |
| def start_game(): | |
| operations = ['+', '-', '*', '/'] | |
| for i in range(10): | |
| n1 = random.randint(0, 100) | |
| n2 = random.randint(0, 100) | |
| operation = operations[random.randint(0, 3)] | |
| sol = raw_input("{} {} {} = ".format(n1, operation, n2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse, time, os, uuid | |
| from pwd import getpwnam | |
| from multiprocessing import Process, Queue | |
| def sender(q, message): | |
| _id = uuid.uuid4() | |
| print("[S] sending {}".format(message)) | |
| for i, part in enumerate(message): | |
| q.put({ 'data': part, 'sequence_number': i, 'sender_id': str(_id) }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Copyright 2013 Matt Martz | |
| # All Rights Reserved. | |
| # | |
| # 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 |