This file contains 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
def selected_vertex(): | |
for vert in bpy.context.selected_objects[0].data.vertices: | |
if vert.select: | |
return vert; | |
return None | |
This file contains 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
/** | |
* @author Alexander Shabanov | |
*/ | |
public class InvokeInterfaceCost { | |
public interface Modify { | |
int apply(int value); | |
} | |
public static final class DecOne implements Modify { |
This file contains 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
class Liskov { | |
public static int calculateArea(Rectangle x) { | |
return x.getHeight() * x.getWidth(); | |
} | |
public static int calculateArea(Square x) { | |
return x.getHeight() * x.getHeight(); | |
} | |
} |
This file contains 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
-- I haven't tested these, they probably don't work | |
local object = { | |
type = function(self) return getmetatable(self).__index end, | |
} | |
local hash = { | |
data = function(self) return getmetatable(self).data end, | |
set = function(self, key, value) rawset(self.data, key, value) end, |
This file contains 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
sum=0 | |
for i in range(1,1000): | |
if i%3==0 or i%5==0: | |
sum += i | |
print sum |
This file contains 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
using System; | |
using System.Diagnostics; | |
using System.Security.Cryptography; | |
using System.Text; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string iv, key; |
This file contains 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
# config/initializers/web_console.rb | |
WebConsoleBeforeAction = ->(controller) do | |
controller.console if controller.params[:web_console] | |
end | |
ApplicationController.before_action(WebConsoleBeforeAction) if defined?(WebConsole) && Rails.env.development? | |
# NOTE: | |
# For security reasons only do this in development. |
This file contains 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
#!/bin/sh | |
# | |
# colors v1.03 | |
# | |
# A simple shell script to output an ANSI terminal color chart. | |
# It may be useful when trying to customize your ANSI terminal | |
# color scheme! | |
# | |
# Written and placed in the public domain by Ian Abbott <ian@abbott.org> | |
# |
This file contains 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
/* | |
Amazing algorithm:- | |
inorder traversal without using stacks and recursion just by manipulating threads between them. | |
http://www.geeksforgeeks.org/inorder-tree-traversal-without-recursion-and-without-stack/ | |
*/ | |
void inorder_morris(node *root){ | |
if(root == NULL) return ; | |
node *cur, *pre; | |
cur = root; |
This file contains 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
boolean wifiReady = 0; | |
boolean wifiConnected = 0; | |
void setup() { | |
pinMode(10,OUTPUT); | |
pinMode(13,OUTPUT); | |
digitalWrite(10,LOW); | |
digitalWrite(13,LOW); | |
Serial.begin(115200); |
NewerOlder