Skip to content

Instantly share code, notes, and snippets.

View newtonmwai's full-sized avatar

Mwai Newton newtonmwai

  • Chalmers University of Technology
  • Gothenburg, Sweden
  • X @mwai_newton
View GitHub Profile
@mombrea
mombrea / volley-POST-example.java
Last active May 24, 2023 10:58
Example of performing a POST request using Google Volley for Android
public static void postNewComment(Context context,final UserAccount userAccount,final String comment,final int blogId,final int postId){
mPostCommentResponse.requestStarted();
RequestQueue queue = Volley.newRequestQueue(context);
StringRequest sr = new StringRequest(Request.Method.POST,"http://api.someservice.com/post/comment", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
mPostCommentResponse.requestCompleted();
}
}, new Response.ErrorListener() {
@Override
@powerlim2
powerlim2 / SKhelper.py
Last active January 11, 2021 18:35
This module is to ease your analysis with Scikit_Learn in Python. It gives a few functionalities that the current Scikit_Learn library does not offer. Please free to download and use it.
# coding=UTF8
#########################################################################
# This class is to help sklearn to handle statistical process #
# Author: Joon Lim from Master of Science in Analytics at Northwestern #
# Date: 04.23.2013 #
#########################################################################
''' this Module is built on top of numpy and sklearn. '''
@amermchaudhary
amermchaudhary / PrintReceipt.java
Created February 6, 2013 06:20
Receipt Printer Example for printing receipt to default printer
package com.fibertechcws.pos.client.print;
import java.awt.*;
import java.awt.geom.*;
import java.awt.print.*;
import java.util.*;
public class PrintReceipt implements Printable {
int lines;
ArrayList<String> text1;