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
int a; | |
... | |
if(a > 0) | |
{ | |
//do something | |
} |
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
int a, b; | |
... | |
if(a || b) | |
{ | |
//do something | |
} |
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
/* discover context if required */ | |
if(need_token && (!have_token)) | |
{ | |
int ok = discover_context(...); | |
result = ok ? S_OK : E_FAIL; | |
goto exit; | |
} | |
/* If we don't need to discover the context, but need to do more work, hand to calling code */ | |
if((have_token || !need_token) && ! all_done) |
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
if(a) | |
{ | |
// do something... | |
} | |
if(!a && b) | |
{ | |
// do something else... | |
} |
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
if(a) | |
{ | |
// do something... | |
} | |
else if(b) | |
{ | |
// do something else... | |
} |
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
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
int a = -1; | |
unsigned int b = 1; | |
if (a < b) printf ("OK"); | |
else printf("Whoops!"); | |
return 0; |
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 sys | |
import System | |
from System.Diagnostics import * | |
from System.IO import * | |
#--------------------------------------------------- | |
def spawn(cmd, args, wait=True): | |
"""Spawn a process running executable 'cmd' with the rest of the command line given by | |
'args'. If wait is given as False, the rest of the script keeps on going while the sub-process |
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 sys | |
# begin added | |
sys.path.append(r"c:\python25\lib") | |
# end added | |
import clr |
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
# Reference the WPF assemblies | |
import clr | |
clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") | |
clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") | |
import System.Windows | |
# Initialization Constants | |
Window = System.Windows.Window | |
Application = System.Windows.Application | |
Button = System.Windows.Controls.Button |
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
from wpf import * | |
# Create window | |
my_window = Window() | |
my_window.Title = 'Welcome to IronPython' | |
# Create StackPanel to Layout UI elements | |
my_stack = StackPanel() | |
my_stack.Margin = Thickness(15) | |
my_window.Content = my_stack |