Skip to content

Instantly share code, notes, and snippets.

View MBehtemam's full-sized avatar
🦄
Full Of Energey

Mohammad Bagher Ehtemam MBehtemam

🦄
Full Of Energey
View GitHub Profile
@MBehtemam
MBehtemam / Default2
Last active December 19, 2015 03:39
Reading Book publishers with OpenLibray API
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
using System.Net;
using System.IO;
using System.Runtime.Serialization.Json;
@MBehtemam
MBehtemam / gist:6402857
Created September 1, 2013 07:20
C# Image Uploader
string filename = Path.GetFileName(FileUpload1.FileName);
string path = Server.MapPath("~/Images/personel/") + filename;
FileUpload1.SaveAs(path);
Change to :
string filename = Path.GetFileName(FileUpload1.FileName);
string path = "Images/personel/" + filename;
FileUpload1.SaveAs(Server.MapPath(path));
{
"cubeName": "Channel Sales",
"axes": [
{
"positions": [
{
"[Date].[Calendar]": {
"index": 0,
"hierarchy": "[Date].[Calendar]",
"UName": "[Date].[Calendar].[Calendar Year].&[2005]",
@MBehtemam
MBehtemam / channel-sales xml
Created December 28, 2013 04:34
channel sales xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ExecuteResponse xmlns="urn:schemas-microsoft-com:xml-analysis">
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:mddataset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msxmla="http://schemas.microsoft.com/analysisservices/2003/xmla">
<xs:schema targetNamespace="urn:schemas-microsoft-com:xml-analysis:mddataset" elementFormDefault="qualified" xmlns="urn:schemas-microsoft-com:xml-analysis:mddataset" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msxmla="http://schemas.microsoft.com/analysisservices/2003/xmla">
<!-- The schema is defined in the publicly available documentation for MSXLA (Microsoft Extension to XMLA Schema)-->
<xs:import namespace="http://schemas.microsoft.com/analysisservices/2003/xmla" />
<xs:complexType name
@MBehtemam
MBehtemam / channel-sales-json
Created December 28, 2013 04:36
channel sales json
{
"cubeName": "Channel Sales",
"axes": [
{
"positions": [
{
"[Date].[Calendar]": {
"index": 0,
"hierarchy": "[Date].[Calendar]",
"UName": "[Date].[Calendar].[Calendar Year].&amp;[2005]",
@MBehtemam
MBehtemam / olap-xmla4js
Created February 4, 2014 04:50
Olap Xmla4JS Result
{"cubeName":"Mined Customers","axes":[{"positions":[{"[Customer].[City]":{"index":0,"hierarchy":"[Customer].[City]","UName":"[Customer].[City].&amp;[Abingdon]&amp;[ENG]","Caption":"Abingdon","LName":"[Customer].[City].[City]","LNum":1,"DisplayInfo":0}},{"[Customer].[City]":{"index":0,"hierarchy":"[Customer].[City]","UName":"[Customer].[City].&amp;[Albany]&amp;[OR]","Caption":"Albany","LName":"[Customer].[City].[City]","LNum":1,"DisplayInfo":131072}},{"[Customer].[City]":{"index":0,"hierarchy":"[Customer].[City]","UName":"[Customer].[City].&amp;[Alexandria]&amp;[NSW]","Caption":"Alexandria","LName":"[Customer].[City].[City]","LNum":1,"DisplayInfo":131072}},{"[Customer].[City]":{"index":0,"hierarchy":"[Customer].[City]","UName":"[Customer].[City].&amp;[Alhambra]&amp;[CA]","Caption":"Alhambra","LName":"[Customer].[City].[City]","LNum":1,"DisplayInfo":131072}},{"[Customer].[City]":{"index":0,"hierarchy":"[Customer].[City]","UName":"[Customer].[City].&amp;[Alpine]&amp;[CA]","Caption":"Alpine","LName":"[Customer].[
@MBehtemam
MBehtemam / xmlarespons
Created February 6, 2014 05:48
Xmla Response from xmla4js in ajax success callback
{ _root:
{ offset: 153,
parentNode:
{ offset: 145,
parentNode: [Object],
nodeType: 1,
nodeName: 'return',
prefix: '',
namespaceURI: 'urn:schemas-microsoft-com:xml-analysis',
childNodes: [Object] },
var al = this._members[aj],
^
TypeError: Cannot read property '0' of null
at Object.p.Dataset.Axis._member (D:\Projects\OlapSchemaProviderNew2\OlapSchemaProvider\OlapSchemaProvider\node_modu
les\xmla4js\src\Xmla.js:2073:35)
at Object.p.Dataset.Axis.member (D:\Projects\OlapSchemaProviderNew2\OlapSchemaProvider\OlapSchemaProvider\node_modul
es\xmla4js\src\Xmla.js:2070:25)
at ExecuteMultiDimensionalQuery.xmlaRequest.success (D:\Projects\OlapSchemaProviderNew2\OlapSchemaProvider\OlapSchem
aProvider\OLAPSchemaProvider.js:132:36)
at Object.p._requestSuccess (D:\Projects\OlapSchemaProviderNew2\OlapSchemaProvider\OlapSchemaProvider\node_modules\x
@MBehtemam
MBehtemam / Koa-local-strategy-auth
Created February 24, 2014 08:58
Koa Local Strategy Auth
var koa = require('koa'),
AuthenticationApp = koa(),
session = require('koa-session'),
passport = require('koa-passport'),
route = require('koa-route'),
Router = require('koa-router'),
hbs = require('koa-hbs'),
render = require('koa-render'),
bodyParser = require('koa-body-parser'),
formidable = require('koa-formidable'),
@MBehtemam
MBehtemam / node-harmony-powershell-alias
Created February 24, 2014 09:15
Using Node with Harmony argument as powershell alias
First RUN :
function New-BashStyleAlias([string]$name, [string]$command)
{
$sb = [scriptblock]::Create($command)
New-Item "Function:\global:$name" -Value $sb | Out-Null
}
Then :