Skip to content

Instantly share code, notes, and snippets.

@CapitanLiteral
CapitanLiteral / Fact
Last active December 24, 2015 15:39
Ejercicio practico en el que un proceso crea dos procesos hijo que hacen el factorial, uno de los pares de 1 a 25 y el otro de los impares de 1 a 25.
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
double factorial(int);
int main(void)
{
@CapitanLiteral
CapitanLiteral / Crea hilos
Created October 4, 2013 06:28
Crea X hijos donde X es un parametro que le entramos por consola, la usamos para aprender a usar el exit, wait, y wexitstatus.
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
pid_t pid;
int nProc = 0;
int i;
using UnityEditor;
// this will set player defines when building from command line
public static class PlaceholderBuild
{
// -------------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------------
[MenuItem("Build/Switch FULL version")]
public static void buildVersion_PlaceholderFull()
{
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
Assets/AssetStoreTools*
# Visual Studio cache directory
.vs/
foreach(Foos foo in Enum.GetValues(typeof(Foos)))
[ReadOnly] field;
using System.Collections.Generic;
using System.Linq;
public class EnumUtils<T>
{
public static IEnumerable<T> GetAllValues()
{
return System.Enum.GetValues(typeof(T)).Cast<T>();
}
public event PropertyChangedEventHandler PropertyChanged;
protected void SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return;
field = value;
OnPropertyChanged(propertyName);
}
protected virtual void OnPropertyChanged([CallerMemberName]string propertyName = null) =>
Vector3 diff = lookAt3dPosition - transform.position;
diff.Normalize();
float rot_z = Mathf.Atan2(diff.y, diff.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(0f, 0f, rot_z - 90);
using System;
using System.Reflection;
using UnityEditor;
namespace Plugins.Gists.Editor
{
public static class InspectorLockToggle
{
[MenuItem("Tools/Toggle Lock &q")]
static void ToggleWindowLock() // Inspector must be inspecting something to be locked