/* * File: main.cpp * Author: Bangonkali ...
C++ Numerical Methods: Gauss Se...
#include <stdio.h> #include <stdlib.h> #include <string.h> ...
C Linux Shell
This is for a class. I have...
/* * File: main.cpp * Author: Bangonkali ...
C++ Numerical Methods: Secant M...
Numerical Methods using Sec...
#encoding: utf-8 class Calculator ...
Ruby Calculation Class
Calculator class for our Ca...
import java.awt.*; import java.awt.event.*; import javax.swing.*; ...
Java remove duplicated arrays
Use a one-dimensional array...
/* * File: main.cpp * Author: Bangonkali (bangonkali@gmail.com) ...
C++ Runge-Kutta (2nd Order): He...
This example solves the fol...
/* * File: main.cpp * Author: Bangonkali ...
C++ Numerical Methods: Gauss Jo...
Numerical methods applicati...
/* * File: main.cpp * Author: Bangonkali ...
C++ Numerical Methods: Gaussian...
Numerical Methods applicati...
import javax.swing.*; import java.awt.event.*; import java.awt.*; ...
Java GUI for one dimensional array
i would like to add a user ...
if current_user.requested_friends.exists?(params[:friend_id]) or current_user.pending_friends.exists?(params[:friend_id]) or current_user.friends.exists?(params[:friend_id])
Ruby If statement with many OR o...
I would like to refactor th...
def fetch(subjects = current_subjects, queue = QUEUES)
subjects.each do |s|
...
Ruby three into one
I want to turn these three ...
------- #shplaying.php file ...
PHP Parsing of XML data has hig...
This script simply retrieve...
const int MAX_PARTICLES = 16; const int MAX_PARTICLE_SPEED = 3; const int PARTICLE_FRAMES = 120; ...
C Simple Particle Engine for ...
This took several hours ove...
@all_brands = Brand.find(:all).map(&:name).sort_by{|x| (-1)*x.id.length}
@line_items = LineItem.find(:all) # I cannot use database filter by brand here (NOSQL DB)
@all_brands.each_with_index do |brand, ind|
...
Ruby Please improve
In this piece of code I ass...
layouts = Dir.glob("_layouts/*")
layouts.each do |layout|
layout.gsub!(/^_layouts\/(.*)\..*$/, '\1')
...
Ruby List the files in a directo...
The title says it all, I'm ...
$target.hasClass('widgettitle') ||
$target.hasClass('ui-icon-minus') ||
$target.hasClass('ui-icon-plus') ? actionOptions['toggleWidgetContent']() :
...
JavaScript Can this be improved?
I'm wondering if this compa...
def test_condition(condition, item, test_item) case condition.query ...
Ruby One or two methods?
Help me improve this, it wo...
var MyNamespace = MyNamespace || {};
MyNamespace.BingMap = {
BingMapCredentials: 'xxxxxxxxx', // should be a default setting (null)
...
JavaScript Convert simple Javascript t...
I've been working on a simp...
class Company has_many :stores end ...
Ruby Active Record getting uniqu...
I still think I could make ...
import sys,functools def multi_triggered(contat,lamb): ...
Python multi triggered decorator
Implements a parametric dec...
from itertools import product def breadth_first_product(*args): """Works like itertools.product but iterates "breadth first". ...
Python Breadth first cartesian pro...
There must be an easier way...
<?php $location = htmlspecialchars($_SERVER['HTTP_REFERER']); $email = strtolower(mysql_real_escape_string($_REQUEST['email'])); ...
PHP php refactoring
Just completed this a week ...
public void setPageOption(String key, String value){
if (key==null) return;
Boolean boolValue = value==null? null: "true".equals(value);
...
Java Too many if statements
Too many if statements. Wan...
package BST; import exceptions.DuplicateItemException; ...
Java first BST
hi,
so i'm still a new p...
This solves systems of equa...