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
find ./ -name ".svn" | xargs rm -Rf |
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
System.NullReferenceException: Object reference not set to an instance of an object | |
at Mono.TextEditor.Utils.RtfWriter.GenerateRtf (Mono.TextEditor.TextDocument doc, ISyntaxMode mode, Mono.TextEditor.Highlighting.ColorScheme style, ITextEditorOptions options) [0x00061] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/57eb8135/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/RtfWriter.cs:71 | |
at Mono.TextEditor.ClipboardActions+CopyOperation.SetData (Gtk.SelectionData selection_data, UInt32 info) [0x00067] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/57eb8135/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs:97 | |
at Mono.TextEditor.ClipboardActions+CopyOperation.ClipboardGetFunc (Gtk.Clipboard clipboard, Gtk.SelectionData selection_data, UInt32 info) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-monodevelop-3.0.3-branch/57eb8135/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEd |
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
/// <summary> | |
/// Sending email using Amazon SES | |
/// </summary> | |
public class AmazonSES | |
{ | |
private static string accessKey = your access key in string; | |
private static string secretKey = your access secret key; | |
private static string _fromEmail = "[email protected]"; | |
private static int _maximumDeliveryAttempts = 3; |
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
/// <summary> | |
/// Functions for sending emails using SendGrid | |
/// </summary> | |
public class SendGrid | |
{ | |
#region Dependency and Initialization | |
private static SendingEmailSetting setting; | |
/// <summary> | |
/// This need to be set up when application starts |
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
Thanks to ErikEvenson https://github.com/ErikEvenson | |
I did three things to use Apple's current sample code in my ARC projects: | |
1) Set -fno-objc-arc as a compiler flag on KeychainItemWrapper.m under Build Phases, Compile Sources. | |
2) Use __bridge_transfer in the call to the wrapper: NSString *password = [wrapper objectForKey:(__bridge_transfer id)kSecValueData]; | |
3) Add an autorelease to line 196 of Apple's code to plug Apple's memory leak: self.keychainItemData = [[[NSMutableDictionary alloc] init] autorelease]; | |
Another solution which rewrites the code in ARC can be found here | |
https://gist.github.com/1170641 |
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
private Class<?> clazz = null; | |
public MonitorResinThread(Timer timer) { | |
super(timer, 1); | |
//Make sure the class is only load once | |
try { | |
String homePath = "/Home/folder/to/jar"; | |
File file = new File(homePath + "/lib/resin.jar"); | |
URL url = new URL("jar", "", "file:" + file.getAbsolutePath() + "!/"); | |
URL[] urls = new URL[] { url }; |
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
<style> | |
#outer | |
{ | |
background:red; | |
display:table; | |
width: 100%; | |
height:600px; | |
} | |
#inner | |
{ |
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
You can easily remove all the trailing whitespace within a single file by using | |
a regular expression with the Find/Replace dialog. Enter [ \t]+$ in the "Find:" box | |
and leave the "Replace with:" box empty. Check the "Regular expressions" option | |
then click "Replace All" |
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
(ns scratch.core) | |
(defn dividable? [number] | |
#(zero? (mod number %)) | |
) | |
(defn dividableByAny? [number divList] | |
(> (count (filter (dividable? number) divList)) 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
(defn convert [](with-open [rdr (reader "/Users/zhaowang/workspace/clojure/labrepl/data/words")] | |
(doseq [line (take 2000 (line-seq rdr))] | |
(writeToFile (str "\"" line "\"" ","))))) | |
(defn writeToFile [line] | |
(with-open [wrtr (writer "test.json" :append true)] | |
(.write wrtr line))) |
OlderNewer