יום ראשון, 10 במרץ 2013

10-3-2013 wcf

 we need that the server should know which client has send the message to it.

 

Client Side

 
using (OperationContextScope scope = new OperationContextScope((IContextChannel)channel))
{
    MessageHeader<string> header = new MessageHeader<string>("secret message");
    var untyped = header.GetUntypedHeader("Identity", "http://www.my-website.com");
    OperationContext.Current.OutgoingMessageHeaders.Add(untyped);
 
    // now make the WCF call within this using block
}
 

server-side:

 
MessageHeaders headers = OperationContext.Current.IncomingMessageHeaders;
string identity = headers.GetHeader<string>("Identity", "http://www.my-website.com");

10-03-2013 python

Decorator simple sample 
def myDecorator4 (funcToDecorate):
def theReturnFunct (pVal):
funcToDecorate(pVal)
print ("And the next Call please ")
funcToDecorate(pVal + 6 )
print ("finished")
return theReturnFunct

@myDecorator4
def myFunct164 (pVal):
print ("This is my test: " + str( pVal))

myFunct164 (6)

10-03-2013 Camel

Creating routes in Java

RoutesBuilders Interface

void addRoutesToCamelContext(CamelContext context)
throws Exception



from returns RouteDefinitionObject


DSL – Domain Specific language


TypeConvertor

// add our own type converter manually that converts from String -> MyOrder using MyOrderTypeConverter
context.getTypeConverterRegistry().addTypeConverter(MyOrder.class, String.class, new MyOrderTypeConverter());

// add our own type converter manually that converts from String -> MyOrder using MyOrderTypeConverter
context.getTypeConverterRegistry().addTypeConverter(MyOrder.class, String.class, new MyOrderTypeConverter());
MyOrder order = context.getTypeConverter().convertTo(MyOrder.class, "123");

adding a processor


from(ftp://myftpsite.com/friends?username=MazalShadon&password=123456).
process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println("Comming from ftp: "
+ exchange.getIn().getHeader("CamelFileName"));
}
}).
to("jms:myFriends");

יום שבת, 9 במרץ 2013

LDD The release method

(int scull_release(struct inode *inode, struct file *filp
{
return 0;
}
flush method is called before the release is called 

Memory allocation in the device drive


use the kmalloc and the kfree


cp /dev/zero /dev/myDevice


starch myDevice


Capture


 


יום חמישי, 7 במרץ 2013

07-03-2013

MDX

image001http://www.sqlservercentral.com/articles/MDX/95065/

 

QT

QEventLoop,

QObject

StartTimer

QMetaObject

image001 (1)

PHP

$this->usedate = date ('y-m-d h:i:s)j
$t = strtotime ($this->usedate)
vardump

Regex


capturing groups and back references


/(text1) (text2) /$2 $ 1/ –> text2 text1


ActiveMQ


multicast


transport connector


network  connector


zerocons protocol alternative to multicast udp


Bash


set – o noclobber


מונע דריסה של קבצים על ידי כתיבה של הstdout  אליהם


 


 


 


יום רביעי, 6 במרץ 2013

06-03-2013

c++

tuple <int,int> getDimensions ()
{
return make_tuple (1,2);
}

int w , h ;

tee (w,h) = getDimensions()

forword_as_tuple

SQL_SERVER


check constraint violation 547


non repeatable read


set XACT_ABORT


האם להרוג את הטרנזקציה גם על שגיאה קלה

@@Error 
XACT_STATE commit המצב של הטרנזקציה האם היא ניתנת ל 
Save Transaction here 
Rollback Transaction here
https://www.simple-talk.com/sql/t-sql-programming/handling-constraint-violations-and-errors-in-sql-server/
 

Hadoop


Input format


abstract class FileInputFormat


expend it TextInputFormat

























InputFormat:Description:Key:Value:
TextInputFormatDefault format; reads lines of text filesThe byte offset of the lineThe line contents
KeyValueInputFormatParses lines into key, val pairsEverything up to the first tab characterThe remainder of the line
SequenceFileInputFormatA Hadoop-specific high-performance binary formatuser-defineduser-defined


InputFormats provided by MapReduce


input split –> break the data into task if 64 Bit 


JopConfig object


Camel


CamelContext context = new DefaultCamelContext ();


eip –> enterprise integration pattern


jms:queue:IncomingOrders


ActiveMqComponent based on jmsComponent


pool connection factory


Neo4j


GraphDatabaseFactory().NewEmbededDataBase ()


loadPropertiesFromFile (neo4j.properties )


Embedded Linux


Enable Disable BlockLayer


The kernel command line –> from configuration


slab cache



kmem_cache_create allocate free destroy


memory pools


mempool create


setup macro – deprecated


python


slicing


from collections import Sequence

class MyList(Sequence):
def __init__(self, *items):
self.data = list(items)

def __len__(self):
return len(self.data)

def __getitem__(self, slice):
return self.data[slice]

s = MyList(1,2,3)
# lots of free methods
print s[1:2], len(s), bool(s), s.count(3), s.index(2), iter(s)



Ruby


def thing.greet(greeting, *names)
names.each do |name|
puts "#{greeting}, #{name}!"
end
end

>> thing.greet("Hello", "Alice", "Bob", "Charlie")
Hello, Alice!
Hello, Bob!
Hello, Charlie!



Java Script


prototype


 


 


 


 


 

 

יום שלישי, 5 במרץ 2013

05-03-2013

DX

multi threaded rendering

Linux

pool method against select method

Thread groups

tgid – pid of the first lightweight process in a thread group

Linux process descriptor

process descriptor handling

thread_info structure

kernel mode process stack

Stack

     esp decrement along the stack growing

thread_info structure <- -> process descriptor

allocate_thread_info

contrianer_of (pointer ,container_type ,container_field ) used to get in open file method the container that points to the inode cdev member

gdk+

gdkBin thebase class for the gdk+ controls

GdkWidget 

Cxf

Service: Endpoint.Publish (address, theServiceObject )

Client

Service –> <wsdl:service>

myService.getPort () return the SEI proxy

NIO

Files.CreateSymbolicLink

readSymbolicLink

JMS

Implements MessageDrivenBean , MessageListener

JNDI

string Names

Composite Names

maven

mvn archetype : generator

plugin –> goals

Swing

paintComponent (Graphics g) {
super.paintComponent (g);
model.draw (g);

JFrame , keyListener 

graphicks2D 

Windows appstore apps


Windows.UI.Xaml


await async


  private void Button_Click_1(object sender, RoutedEventArgs e)
{
var theTask = AccessTheWebAsync();

Debug.WriteLine("print when the methods go into await ");

}

async Task<String> AccessTheWebAsync()
{

string urlContents = await Task.Run(() =>
{
Thread.Sleep(6500);
return "new Task<string>()";
});

myBtn.Content = "Change Content in UI thread";

// The return statement specifies an integer result.
// Any methods that are awaiting AccessTheWebAsync retrieve the length value.
return "this return the task";
}

SISS


foreach loop container


Data flow task


execute sql task


File system task