Posts

Showing posts from 2013

Exporting Skype Chat/Skype Contacts to csv file using the shell script and sqlite3 (usually already installed on mac)

Edit: a very first draft version of Skype Exporter have been made and released. https://github.com/renesto/SkypeExportSwift/releases check it, and report any issues to renesto-at-gmail.com I heard there are not so many nice ways to get the chat history from skype, so I came across a page of one guy who shows a way to open the sql chat history database and delete all conversations. I thought to make something more from that idea (as delete chat history is now one of the options in skype) Create a file exportFromSkype.sh place either this text: sqlite3 -batch "$HOME/Library/Application Support/Skype/$1/main.db" < <EOF .mode csv .output $2.csv select * from Messages where dialog_partner = '$2'; .output stdout .exit EOF now make the script executable by running chmod +x exportFromSkype.sh now, when you want to export some chat history from certain person, you can do it by: sh exportFromSkype.sh your_skype_name your_friends_skype_name and i

Printing out all fields of an object

Often when debugging the printed Object has just the hash number (like Object@h43a356). The following static method uses reflections to print out all fields: org.apache.commons.lang. builder.ToStringBuilder. reflectionToString(object, ToStringStyle.MULTI_LINE_ STYLE);

How to do replaceAll,replaceFirst,... without regular expression

I do love regular expressions, but sometimes you simply want to replace one string with another. And to make things worse, sometimes your search string is unknown during development time, so it would be great somehow to tell Java not to try parsing search string as a regular expression. For that, I found the best way is the following: String newString = oldString . replaceAll( Pattern . quote(searchString),replacementString); Additionally, this way you ensure no bugs in case your pure text-based searchString not to become compilable regular expression, which can surprisingly often be the main source of bugs :)

Licenses

Image
I really like this post. Very clearly and quickly explainedthe differences between different type of licenses. The great thing about open source code is the large amount of high quality code that is available and many embedded projects use FOSS code as it really speeds up development time. What is not often taken into account are the licenses for the code. Many companies often simply ignore licenses issues and some even go one step further by obfuscating the code to work around dual license issues or to hide the use of a particular open source library. Even though history shows that few companies get sued due to open source license infringements and release of open source code modified in commercial projects often requires the community involvement, open source licenses should still be taken into consideration as the risk still exists. I’ll give an overview of open source licenses in this blog post, as well as recommendation on how to keep your proprietary code closed

Javascript highlighter, markup editor, WYSIWYG editor plugins

Depends on what you need, but the following plugins are available in terms of markup presenting/editing plugins I would divide into three main types, Syntax Highlighter plugins - it highlights a code so that it is easier to read Markup editor plugins - turns textareas into rich and powerful markup editors WYSIWYG editor plugins - high level editors for end-users Syntax Highlighter plugins  So far, I have seen several of them: SyntaxHighlighter plugin [demo] [github] or [demo] [github] Snippet [link] Google Prettify [link]   Hightlight.js [link]   SHJS [link]   Chilli JS [link]   beautyOfCode [link] Lighter.js [link] DlHighlight [link] JUSH [link] Markup editor plugins CodeMirror [link] along with CodeMirror UI [link]   MarkItUp! [link] SmartMarkUP [link]   WYSIWYG editor plugins  I personally really like those inline-smooth editors, so in that regard I have places a little star on those that cought my attention. redactor [link]   * cked

Customizing the JAXB marshalling/unmarshalling

The following example is used for customizing the way how the dates are being parsed, but it could be used for any other specific customizing import java . text . SimpleDateFormat ; import java . util . Date ; import javax . xml . bind . annotation . adapters . XmlAdapter ; public class DateAdapter extends XmlAdapter < String , Date > { private SimpleDateFormat dateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ); @Override public String marshal ( Date v ) throws Exception { return dateFormat . format ( v ); } @Override public Date unmarshal ( String v ) throws Exception { return dateFormat . parse ( v ); } } which then as adapter can be used to customize marshalling/unmarshalling... import java . util . Date ; import javax . xml . bind . annotation . XmlAccessorType ; import javax . xml . bind . annotation . XmlAccessType ; import javax . xml . bind . annot

Seven habits of highly effective programmers

Very interesting article http://drupal.technicat.com/writing/programming.html