Posts

objective c - Perform Action while Button is pressed down? -

how can call method (in case same message on , on again), long user presses , holds down button, , stop performing action releases button again. nsbutton type momentarychangedbutton? im starter, if knew button type use carry on getting more informations. thanks. way make uibutton continuously fire during press-and-hold situation?

regex - Find text between string -

how extract text using perl string this: get text 1 ... --------------------------------------------------------------------------------------------- text 2 ... --------------------------------------------------------------------------------------------- text 3 --------------------------------------------------------------------------------------------- the result should this: %texts = ( 'text1' => 'get text 1 ...', 'text2' => 'get text 2 ...', 'text3' => 'get text 3 ...' ) something php preg_match_all . many thanks if preg_macth_all looks preg_match_all('/(foo)/', $text, $matches) , perl equivalent @matches = $text=~/(foo)/g .

c# - Nlog Callsite is wrong when wrapper is used -

i'm using nlog logging, use wrapper call log methods, problem is: if try print information call site ( ${callsite} ), prints wrapper method , not original method caused logger log. is there way original method called wrapper method instead? see answer question: problem matching specific nlog logger name i have copied example code (for abbreviated nlog wrapper) answer here save trouble: class nloglogger : ilogger { private nlog.logger logger; //the type passed in type of current object //ninject creating. in case of example, class1 , class1 //dependent on ilogger. public nloglogger(type t) { logger = nlog.logmanager.getlogger(t.fullname); } //trace, warn, error, fatal eliminated brevity public bool isinfoenabled { { return logger.isinfoenabled; } } public bool isdebugenabled { { return logger.isdebugenabled; } } public void info(string format, params object [] args) { ...

php - How to create a ticket with attachment in RT using REST -

does know how create ticket attachment in rt (request tracker) using rest service php script? remove "attachment_1: /tmp/img2.png" add post variable using addpostfile() name "attachment_1" contains raw attachment.

Drupal , developing custom module, it is correct way am doing -

below drupal custom modules, can u please confirm it, is correct way of developing custom module, else please advise, <?php /** * implementation of hook_form_alter(). */ function register_form_alter(&$form, $form_state, $form_id) { switch($form_id) { case 'user_register': // value stole rendered form // customizations go here // drupal_set_message('hey, we\'ve tapped form!'); $form['account']['bharani'] = array( '#title' => 'bharani', '#type' => 'textfield', '#description' => t(' bharanikumar custom field '), ); $form['#submit'][] = 'register_submit_handler'; // add break; } } function register_submit_handler($form, &$form_state) { $value = $form_state['values']['bharani']; $mail = $_post['mail']; $query = "update users se...

javascript - Why aren't framework-like functions built in natively? -

i wondering why trivial functions string.contains() aren't part of javascript core itself. mean, although javascript core contains of functions necessary create new functions based on core ones, obvious functions aren't available default. there are great frameworks out there extend javascript core, don't why aren't built in natively. also, instance, jquery ajax() function more developer-friendly native xmlhttprequest object. essential use frameworks things this. so why functions these not available in javascript core itself? there great frameworks out there extend javascript core, don't why aren't built in natively. i don't think had foresight think 10-15 years in advance , see how implementations of technologies play out, in terms of browsers support parts of specifications standardized @ time create these utility functions find useful in 2011. javascript created in 1995 eich , landscape far different. "ajax" ...

spring - Hibernate annotations-Question on one to many relationship with composite primary key -

first of all, kindly @ design, i have 2 tables t1(a,b,c,d)- primary key t2(a,e) (a,e) composite primary key foreign key referencing t1(a) t1 - t2 relationship 1 many. so created 3 classes c1 t1 has 5 fields - a,b,c,d, c2set setters & getters c2 t2 has 2 fields- c1,c3 of type c1, c3 respectively- setters & getters c3 defining c3 represent composite primary key of t2 has 2 fields (a,e) setters & getters i using following annotations define hibernate mappings in classes c1,c2,c3 respectively 1. @entity @table(name = "t1", schema = "dbo", uniqueconstraints = { @uniqueconstraint(columnnames = "a") }) @id @column(name = "a", unique = true, nullable = false) @transient private set<c2> c2set = new hashset<c2>(); @onetomany(fetch = fetchtype.eager, mappedby = "c1") public set<c2> getc2set() { return c2set; } 2. @entity @table(name="t2", schema...