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
| public class o2i { | |
| private static Object getIntArray() | |
| { | |
| int[] array = new int[] { 1, 2, 3, 4, 5}; | |
| Object obj = array; | |
| return obj; | |
| } | |
| public static void main(String[] args) { | |
| Object obj = getIntArray(); |
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 socket | |
| if len(sys.argv) < 2: | |
| print("Need at least 1 parameters.") | |
| print("Usage: {0} host".format(sys.argv[0])) | |
| sys.exit(-1) | |
| r = False | |
| try: |
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 java.net.InetAddress; | |
| import java.net.UnknownHostException; | |
| import java.io.IOException; | |
| class Ping { | |
| public static void main(String[] args) { | |
| InetAddress in; | |
| try { | |
| in = InetAddress.getByName(args[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
| ## {{{ http://code.activestate.com/recipes/576646/ (r4) | |
| # -*- coding: utf-8 -*- | |
| ''' | |
| rename_to_exiftime.py | |
| Rename JPEG files according to EXIF-date using PIL | |
| If global variable CREATE_HARDLINK is set, script creates Windows (XP) batch file | |
| for creating hardlink version of source files |
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 | |
| # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai | |
| from __future__ import (unicode_literals, division, absolute_import, | |
| print_function) | |
| __license__ = 'GPL v3' | |
| __copyright__ = '2011, Kovid Goyal <[email protected]>' | |
| __docformat__ = 'restructuredtext en' | |
| import os |
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
| using System; | |
| using System.Linq; | |
| public class Guess | |
| { | |
| public static void Main(string[] args) | |
| { | |
| int scoreCount = 0, score = 100; | |
| string answer = "test", user_input, out_put = string.Empty; | |
| Console.WriteLine("Enter a length {0} word start with {1}:", answer.Length.ToString(), answer.Substring(0, 1)); | |
| do |
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
| def main(): | |
| answer = "test" | |
| user_input = "" | |
| score = 100 | |
| count = 0 | |
| while user_input!=answer: | |
| user_input = raw_input("Enter a length 4 word start with t:") | |
| if len(user_input)<len(answer): | |
| print("Wrong input, input again.") |
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
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
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
| public class Book extends SugarRecord<Book> { | |
| String name; | |
| String ISBN; | |
| int bookshelf; // key to get bookshelf | |
| } | |
| public class BookShelf extends SugarRecord<BookShelf> { | |
| String location; | |
| public List<Book> getBooks() { |
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
| #! /bin/bash | |
| # | |
| # backup_redmine.sh | |
| # modified by [email protected] | |
| # Inspiration: https://gist.github.com/gabrielkfr/6432185 | |
| # | |
| # Distributed under terms of the MIT license. | |
| # -- VARS | |
| DAY=`date +"%Y%m%d"` |