Skip to content

Instantly share code, notes, and snippets.

View mohamed-ali's full-sized avatar

Mohamed Ali Jamaoui mohamed-ali

View GitHub Profile
@mohamed-ali
mohamed-ali / odataFilter.js
Last active December 25, 2015 08:09
OData filter preparator: simple, compact and easy to extend created to resolve the issue of preparing the OData filter presented in these dicussions: - http://stackoverflow.com/questions/19251441/how-to-cast-with-eq-in-odata-filtering - http://stackoverflow.com/questions/19319170/how-to-escape-single-quote-in-odata-filter-uri - http://stackoverf…
/*
* OData filter preparator:
* simple, compact and easy to extend
* copyright (c) Mohamed Ali Jamaoui 2013
*
* can be used on the fly to prepare the OData filter
* can easly be extended to handle new Edm types
* > the list of Edm types can be found here:
* > http://www.odata.org/documentation/odata-v2-documentation/overview/#6_Primitive_Data_Types
* > check the detailed description here: http://intelligea.wordpress.com/2013/10/12/how-to-format-odata-filters-values-on-the-fly-using-their-edm-types/
@mohamed-ali
mohamed-ali / arrayList_vs_LinkedList.java
Last active December 27, 2015 07:49
LinkedList vs ArrayList: add to beginning of list benchmark
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class Benchmark {
public static void main(String[] args) {
ArrayList<Integer> arrayList = new ArrayList<Integer>();
LinkedList<Integer> linkedList = new LinkedList<Integer>();
@mohamed-ali
mohamed-ali / dataMiner.js
Last active July 25, 2018 18:34
dataMiner: simple, compact, reusable client side data mining
/*
* Copyright (c), Mohamed Ali Jamaoui, All rights reserved
* released under the MIT license
*/
var dm = {};
dm.dataMiner = function module(){
@mohamed-ali
mohamed-ali / lexer.py
Created January 4, 2014 13:34
a simple python lexer for HTML
import ply.lex as lex
#list of tokens
tokens = (
'LANGLE', #<
'LANGLESLASH', #</
'RANGLE', #>
'EQUAL', # =
'STRING', # "hello"
'WORD', # Welcome!
@mohamed-ali
mohamed-ali / getListOfMeasuresAndDimensions.sql
Created January 4, 2014 18:40
a SQLScript stored procedure to get the list of measures and dimension for a given OLAP cube (Analytic view) in SAP HANA
drop type measuresAndDimensionsType;
create type measuresAndDimensionsType as table("ATTRIBUTE_NAME" varchar(100),"DIMENSION_NAME" varchar(100), "ATTRIBUTE_DESCRIPTION" varchar(100), "ATTRIBUTE_TYPE" integer);
drop procedure getListOfMeasuresAndDimensions;
create procedure getListOfMeasuresAndDimensions(in currentCubeName varchar(100), in currentPackageName varchar(100), out outputResults measuresAndDimensionsType)
language sqlscript as
cursor listOfDimensions for select distinct "DIMENSION_NAME"
from "_SYS_BI"."BIMC_DIMENSIONS" where "CUBE_NAME"='KDD' and
@mohamed-ali
mohamed-ali / README.md
Last active November 12, 2021 21:58
Map of Tunisia with d3.js
@mohamed-ali
mohamed-ali / README.md
Last active September 30, 2015 02:16
d3.js and topoJson zoomable map of Tunisia
@mohamed-ali
mohamed-ali / index.html
Last active August 29, 2015 14:06
change projection on the fly, for map of Tunisia
<!DOCTYPE html>
<html>
<head>
<meta content="utf-8">
<style type="text/css">
svg {
border: 1px solid #ccc;
}
path {
@mohamed-ali
mohamed-ali / index.html
Last active August 29, 2015 14:06
D3.js HTML5 canvas Map of Tunisia.
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
height = 700;
@mohamed-ali
mohamed-ali / index.html
Last active August 29, 2015 14:07
Satellite projection of Tunisia.
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.graticule {
fill: none;
stroke: #777;
}
.boundary {