Posts

Showing posts from February, 2012

javascript - How Jquery scope gets passed to ready() methods callback function? -

i got following code jquery.noconflict() docs <script type="text/javascript" src="other_lib.js"></script> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $.noconflict(); jquery(document).ready(function($) { // code uses jquery's $ can follow here. }); // code uses other library's $ can follow here. </script> as can see, ready methods callback function accepts parameter passing parameter ? "we" aren't passing function. jquery library passing it, jquery api (which jquery object), function callback. see also: avoiding conflicts other libraries

meteor: how to disable default mongodb? -

in meteor project, how can remove or disable default mongdodb? .meteor/local/db/... it's large 500mb! , want exclude project because use external db you can clear out meteor reset (or mrt reset if using meteorite). default should have .meteor/.gitignore file ignore entire .meteor/local directory git repository. of course, need little different if use version control system.

From Java Code to Class Diagram -

i have class diagram (from system coded in java), class diagram consists of business logic , has classes student, exam, topic, question, etc. the thing want know if should add getter , setter methods each class of diagram (because they're in code) constructors , tostring methods. ... or better add methods in classes coded me? i'm asking because homework college , maybe professor doesn't see these "auto generated methods" in diagram. what's recommendation? does matter if class stays "empty"? mean, without methods or no attributes in case class extends them superclass.

c++ - Stack runtime error -

#include <stack> #include <functional> int main() { std::stack<std::function<int()>> s; s.push(main); return s.top()(); } i following diagnostic: result: runtime error time: 0.04s memory: 39704 kb signal: 11 (sigsegv) what's going on here? first, aren't allowed call main yourself. secondly, appears doing "what you'd expect" , making call, you're causing infinite recursion uses stack space , overflows it.

php - Adjust image attribute so I can change src -

<img class="lazy" title="windows 8" alt="windows 8" src="http://b.a.org/sites/default/files/styles/thumbnail/public/category_pictures/windows%20media%20player%20alt.png?itok=nxy-3w5_" href="lazy" data-original="http://b.a.org/sites/default/files/styles/thumbnail/public/category_pictures/windows%20media%20player%20alt.png?itok=nxy-3w5_"> i adjust src can display "/sites/all/themes/s5/images/blank.jpg" rather image url. can me modify below code using in drupal 7's template.php make happen? function s5_preprocess_image(&$variables) { if ($variables['style_name'] == 'thumbnail') { $variables['attributes']['class'][] = 'lazy'; $variables['attributes']['data-original'][] = file_create_url($variables['path']); }} thanks much!! added line bottom of "if" block: function s5_preprocess_image(&$variables) {...

Add new methods to a resource controller in Laravel -

i want know if possible add new methods resource controller in laravel , how it. i know these methods default (index, create, store, edit, update, destroy). want add additional methods , routes same controller. is possible? just add route method separately, before register resource: route::get('foo/bar', 'foocontroller@bar'); route::resource('foo', 'foocontroller');

java - How to use My Sqlite Database in Android -

i using database in application, make database in sqlite browser , tried in application guide link , , when try in eclipse running project phone , application success call database in case try copy apk application folder bin in android , install it.. when install apk file application error cannot call database.. , never call database again.. please me.. here code : databasehelper.java public class databasehelper extends sqliteopenhelper{ //the android's default system path of application database. private static string db_path = "/data/data/com.apps.visitkuningan/databases/"; private static string db_name = "db_keterangan.sqlite3"; private sqlitedatabase mydatabase; private final context mycontext; /** * constructor * takes , keeps reference of passed context in order access application assets , resources. * @param context */ public databasehelper(context context) { super(context, db_name, n...

ios UILabel setFrame error -

#import <quartzcore/quartzcore.h> - (void)viewdidload { [self.forwardview setframe:cgrectmake(12.0, 40.0+height, 296.0, rootviewheight-15.0)]; self.forwardview.layer.bordercolor = [uicolor colorwithred:153.0/250.0 green:153.0/250.0 blue:153.0/250.0 alpha:100].cgcolor; self.forwardview.layer.borderwidth = 1; cgrect frame = cgrectmake(12.0f, 40.0f, 288.0f , height); [self.tvcontent setframe:frame]; } [self.tvcontent setframe:frame]; //crash? exception message: -[__nscfstring setframe:]: unrecognized selector sent instance 0x7894c00 2013-05-21 10:44:54.677 sohappy[22295:c07] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscfstring setframe:]: unrecognized selector sent instance 0x7894c00' *** first throw call stack: (0x1eb5012 0x19aae7e 0x1f404bd 0x1ea4bbc 0x1ea494e 0xfb407 0xfc20b 0x9d01c7 0x9d0232 0x9d04da 0x9e78e5 0x9e79cb 0x9e7c76 0x9e7d71 0x9e889b 0x9e8e93 0x8ef13f7 0x9e8a88 0x93b9 0x99df83 0...

dynamic - Conditionally replacing a C function at runtime -

is possible conditionally replace function @ runtime in c (in particular, function in dynamically loaded library)? i know can use ld_preload or make function of same name, such as: // silly example intercepting exit typedef void (*exit_func)(int code); void exit(int code) { exit_func orig_exit = (exit_func)dlsym(rtld_next, "exit"); nslog(@"exit called code %d!!!!", code); orig_exit(code); } however, possible conditionally replace function, @ runtime, after program has loaded , running? if(some_condition) { swap_impementations(exit, my_exit); } edit: similar is possible swap c functions? specifically, trying intercept call function different library loaded operating system. what means that, example, intercept exit() function stdlib, call exit() anywhere call implementation instead of original, example above, except controllable @ runtime. there have been suggestions of hooking call overwriting original jump instruction, hoping do...

c# - How to crop subsection of 2D array? -

i have 2d array declared new byte[w, h] . want crop out sub-section of array given coordinates (x1,y1) - (x2,y2) . what's quickest way this? there methods "slicing" 2d arrays? you use array.copy : int w2 = x2 - x1 + 1; int h2 = y2 - y1 + 1; byte[,] array2 = new byte[w2, h2]; (int = 0; < w2; i++) { array.copy(array1, (i+x1)*h + y1, array2, i*h2, h2); } this might faster large arrays. 2 nested loops more readable.

multithreading - console logging inside a thread is not accurate -

i'm using logback implementation , created asyncappender use logging inside thread. the thread monitor: consumes blockingqueue of objects added other threads , while queue not empty, , there no blocking signal logs content of queue. @ same time, queue filled few threads. when threads stopping signal coordinator, interrupt, don't add more content in queue. the monitor queue interrupts once there blocking signal (the producer threads interrupted) , blockingqueue empty. there 2 problems logging of monitor thread: after producers have interrupted, queue becomes empty monitor thread interrupts immediately, without showing of contents of queue, when removed queue. the order of shown messages (both in console appender , file appender) not same have been inserted in queue i tried 3 different approaches: creating static logger inside thread, creating non-static 1 , providing loader class monitor thread created. in case in while(true){} loop in monitor thread, sho...

Laravel 4 Eloquent 'hasMany': how to set the default lookup value rather than primay key -

i want retrieve comments under post_id(post1) in page: //localhost/posts/post1/ table comments id:int[primary], comment:varchar, post_id:varchar, comment_id:varchar 1 comment post_1 comment_1 table posts id:int[primary], post_title:varchar, post_id:varchar 1 post title post_1 model comment.php public function post() { return $this->belongsto('post'); } model post.php public function comments() { return $this->hasmany('comment'); } controller postscontroller.php public function show($id) { $comments = post::where('post_id','=',$id)->first() ->comments()->where('post_id','=',$id)->get(); } when visit //localhost/posts/post1/ , no related comment displayed. sql runs below: select * `posts` `post_id` = 'post1' limit 1 select * `comments` `comments`.`post_id` = '1' , `post_id`...

ios - Weird error while trying to play .mp3 sound effects in xcode? -

i trying code simplest 'press button hear sound' setup in xcode possible, , still managing cryptic errors. here code: in .h file: #import <avfoundation/avfoundation.h> in .m file: - (ibaction)beepbutton:(uibutton *)sender { nsurl* musicfile = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"buttonbeep" oftype:@"mp3"]]; avaudioplayer *click = [[avaudioplayer alloc] initwithcontentsofurl:musicfile error:nil]; [click play]; //[click release]; } when try compile app, errors: undefined symbols architecture armv7s: "_objc_class_$_avaudioplayer", referenced from: objc-class-ref in myfirstviewcontroller.o ld: symbol(s) not found architecture armv7s clang: error: linker command failed exit code 1 (use -v see invocation) am doing wrong? appreciated! this called linker error. d...

github - No security on TFS+Git Service? -

Image
(see update below) i'm evaluating team foundation service , observing strange behavior. since understand tfs+git repositories private - thought see how security managed. so changed visual studio 2012 git settings use "fake" user - wasn't asked password - see below: after that, added "fake.txt" file, committed changes , pushed them server repository. to surprise - server allowed me - , "fake user" commit appears in tfs repository: i wasn't asked password @ stage. doing wrong? or there's no security @ in tfs service? thank you, boris. update: here's found far: the user/email described in git settings has nothing user authenticates, nathan explained. vs2012 uses ie on background, in order authenticate tf service. result, if there's instance of ie running, authenticated (or if it's "remember me" auto-authenticated) - that's authentication used. imho, ugly, can live that. worse - need sign...

java - Error: "schemaLocation value *** must have even number of URI's." on namespaces in spring dispatcher -

i getting following error <ignored xml validation warning> org.xml.sax.saxparseexception; linenumber: 9; columnnumber: 55; schemalocation: schemalocation value = 'http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx' must have number of uri's. and dispatcher servlet having following namespaces <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/...

javascript - Uncaught Error: Unable to parse bindings -

uncaught error: unable parse bindings. message: referenceerror: value not defined; bindings value: text: value. here's code ko.applybindings(new appviewmodel(myobject.storerows),document.getelementbyid("addnewupdateform")); $("#abc").live('click',function() { $.ajax({ url: "request.json", //get method used type: "post", //pass data data: data, datatype: 'json', success : function(response) { function viewmodelsku() { self = this; this.skudata = skudata; } var skudata = response.rows; ko.applybindings(viewmodelsku(), document.getelementbyid("row")); } }); } the error in view. binding value whereas apparently property not exist in viewmodelsku. perhaps want bind skudata.value inside view (if property on skudata)

javascript - GoogleMaps api: How to place images in the content of Multiple InfoWindows? -

in brief, want combine these 2 topics: how add image infowindow of marker in google maps v3? google maps js api v3 - simple multiple marker example i have location data stored in database , retrieved array. want place marker , infowindow each of x amount of locations in database. 1 of fields contains image , want include in infowindow content. here far: php: // create connection $con=mysqli_connect("*******","*******","*******","tests"); // check connection if (mysqli_connect_errno($con)) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select name, latitude, longitude, image locate_coords"); while($row = mysqli_fetch_array($result)) { $users[]= $row; } javascript function initialize() : <?php $js_array = json_encode($users); echo "var locations = ". $js_array . ";\n"; ?> var styles = [ { stylers: [ { hue: "...

ajax - Unable to use dynamic JSON -

am using ajax request calling jersey restful url. function deregisterpersonorganization() { var dynamicjson = $('#jsonrequest').val(); alert("text area json : " +dynamicjson); var jsonobj = { "solutionproviderkey" : "e3fad159-ac18-462d-a20e-17763af3689b" }; $.ajax({ type: 'post', contenttype: 'application/json', url: rooturl + '/e3fad159-ac18-462d-a20e-17763af3689b/deregister', datatype: "json", data: json.stringify(dynamicjson), success: function(data, textstatus, jqxhr){ alert('deregister successfull'); }, error: function(jqxhr, textstatus, errorthrown){ alert('deregister error: ' + textstatus); } }); } the problem need give json request give through text area. in above code if use variable jsonobj in place of dynamicjson request successful. if use dynamicjson in ...

jquery - qtip2 reposition on target change -

i'm using qtip2 add qtip next selected radio button among set of grouped radio buttons. can display qtip correctly when page loads, when selected radio changes, i'd qtip follow along , point @ newly checked radio button. have jsfiddle here highlighting issue. how can qtip point newly checked radio button? <html> <head> <link href="http://craigsworks.com/projects/qtip_new/packages/nightly/jquery.qtip.css" rel="stylesheet" /> <link href="mycss2.css" rel="stylesheet" /> <style> #demo-simple{ margin:100px; } input[type="radio"]{ margin:20px; } </style> </head> <body> <div id="demo-simple" class="box"> <div id="primary"> <div> <input type="radio" name="blah" checked /> radio1 ...

javascript - Jquery file inclusion issue -

developing asp.net application visual studio 2010 i new jquery. i trying include jquery file online (from google) for have written as: <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> here highlighting src attribute green text showing tool tip that: //ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js not found. if write as: <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> it shows me error tooptip that: element 'script' missing required attribute 'type' but actual way in refered line on different sites. i have refered addess different sites. is address wrong? or i have written in wrong way? please me. protocol-less paths inherit protocol of current document when opened in browser, work when page opened through http / https protocols. therefore assume vs interprets protocol-le...

eclipse - How to use an existing ontology in a Java application? -

i've created ontology several instances. i'm going : using eclipse, create searching program. user can input string, , if instance has string 1 of datatype properties, name , other properties of instance shown user. i have no idea plug-ins of eclipse, grammar, or other tools should use. i'm extremely new semantic web , relevant tools, great. thank much! you @ owl-api starting point using ontologies in programmatic fashion. shouldn't problem integrate other eclipse tools.

asp.net - Insert values to database table using textbox in gridview -

i have grid view 2 columns. 1 named product , other named values (both columns in template field). the product column bound "product" table. , value field's item template contains textbox. i need insert values database table "brandproperties" through textbox in grid view, not sure how this. here code: if (!ispostback) { bindview(); } datatable dt = new datatable(); sqldataadapter da = new sqldataadapter("select id,typename producttypes",con); da.fill(dt); dropdownlist1.datasource = dt; dropdownlist1.datavaluefield = "id"; dropdownlist1.datatextfield = "typename"; dropdownlist1.databind(); } public void bindview() { datatable dt = new datatable(); string sql = "select * properties"; con.open(); sqldataadapter da = new sqldataadapter(sql, con); da.fill(dt); gridview1.datasource = dt; gridview1.databind(); con.close(); } asp...

jquery - Programmatically adding a site to the Allowed Sites of the IE Pop-up Blocker Javascript -

Image
by javascript button onclick , want add site(eg. 192.168.1.1) pop-up blocker allow site in internet explorer. given site should added exception list. is possible? idea please welcome. such thing not possible javascript since there no api pop blocker of ie. the user have manually add site best can show him/her how that. that said, better use jquery pop plugins have same effect not using real new windows not blocked.

Android listview with inflated checkboxes not checking all true at once -

i retrieving contacts , displayed in listview using simplecursoradapter. listview displayed in main.xml , textview , checkboxes in listview.xml. main.xml have 2 buttons, named selectall, clearall on click event should check checkboxes true , false respectively. button click listener event calls inflated view access checkbox still not checking true. pls help! thanks in advance! when inflate view, it's not access it, it's creating it, , can't access check boxes cause don't generate of them, you'll need hold data model holds data selected.

android - GridView isn't being displayed correctly -

Image
i took screenshot of it. displaying weird way: this code. the gridadapter: public class gridviewadapter extends baseadapter { private context mcontext; private arraylist<uri> murls; // references our images public gridviewadapter(context c, arraylist<uri> images) { mcontext = c; this.murls = images; } public int getcount() { return murls.size(); } public object getitem(int position) { return position; } public long getitemid(int position) { return position; } public view getview(int position, view convertview, viewgroup parent) { layoutinflater minflater = (layoutinflater) mcontext.getsystemservice(activity.layout_inflater_service); imageview inflatedimageview = (imageview) minflater.inflate(r.layout.imageview_amb_background, null); //imageview imageview = new imageview(mcontext); inflatedimageview.setimageuri(murls.get(position)); inflatedimageview.setscaletype(imageview.scaletype.center_inside); return infl...

Grails MongoDB doesn't save in afterUpdate -

i'm trying put of domain classes mongodb using mongodb grails plugin. of classes stays in mysql. works fine saving of domain class instances mongodb (for example in service on controller code). however, if try save instance afterupdate() of not-mongodb class doesn't work. doesn't throw exception or whatever... my not-mongodb domain class: class carstate extends abstractcarstate { ... def afterupdate() { def logiteminstance = new carstatelogitem(this.properties) logiteminstance.save(failonerror: true) } } mongodb domain class: class carstatelogitem extends abstractcarstate { objectid id static mapwith = "mongo" ... } the weird thing if run afterupdate() code controller saves mongodb. missing? or why cannot save instance? thanks advice, mateo i think need initiate new transaction in order save in mongodb. if notice, transaction carstate of mysql . in order transact mongodb afterupdate event there has new...

c++ - Qt+VS2010 - Unresolvable external symbol LNK2001 -

all have main.cpp : #include "myclass.h" #include <qapplication> #include <qtextedit> #include <qtgui> class notepad : public qwidget { q_object public: notepad(); private slots: void quit(); private: qtextedit *textedit; qpushbutton *quitbutton; }; notepad::notepad() { textedit = new qtextedit(); quitbutton = new qpushbutton(tr("quit")); connect(quitbutton, signal(clicked()), this, slot(quit())); qvboxlayout *layout = new qvboxlayout; layout->addwidget(textedit); layout->addwidget(quitbutton); setlayout(layout); setwindowtitle(tr("notepad")); } void notepad::quit() { qmessagebox messagebox; messagebox.setwindowtitle(tr("notepad")); messagebox.settext(tr("do want quit?")); messagebox.setstandardbuttons(qmessagebox::yes | qmessagebox::no); messagebox.setdefaultbutton(qmessagebox::no); if(m...

php - preg_match_all matches array -

i have this $matches = array(); preg_match_all('/(`.+`)(\s+as\s+`.+`)?/i', '`foo` `bar`', $matches); print_r($matches); the result is array ( [0] => array ( [0] => `foo` `bar` ) [1] => array ( [0] => `foo` `bar` ) [2] => array ( [0] => ) ) so, question why don't have ' `bar`' in $matches[2][0] ? (if remove '?' symbol regex, i'll it, need '?' :)) quantifiers + greedy default if first 1 can match so. making non-greedy should job: preg_match_all('/(`.+?`)(\s+as\s+`.+`)?/i', '`foo` `bar`', $matches); and way, $matches = array(); not necessary - variable written preg_match_all not need initialized/defined before. php > preg_match_all('/(`.+?`)(\s+as\s+`.+`)?/i', '`foo` `bar`', $matches); php > print_r($matches); array ( [0] => array ( [0] => `foo` `bar` ) [1] => ...

tex - How to hide whizzytex yellow cursor in Emacs -

how hide it? way yellow, , automatically switched on when activating whizzytex. looked @ emacs variables cannot find there. using ubuntu 13.04 , emacs 24. look customize-group ( m-x customize-group ret ). group called whizzytex. there find "whizzy point face". untick background-color box, set current session , save future sessions.

c++ - Does symbol visibility protect shared library from abuse/crack? -

the gcc visibility feature enables strip off apis in our shared library don't want customer see. indeed can't use ldopen call hidden functions, wonder if secure enough protect our sensitive apis. i want brief explanation of reliability/security of hidden apis in shared library, can balance effort , risk. asked question because can't find adequate description regarding concern in documentations of gcc. please reopen question. the genuine purpose visibility attribute library doesn't expose parts of aren't meant used directly. makes little difference trying crack it. still have disassemble code, , it's not terribly hard figure out entry points functions (have yourself!). yes, it's hard work work way through megabytes of code, experience know sort of things for, can skip on huge amount of code.

asp.net - Convert controls dynamically from strings -

i want disable controls on asp page controlcollection. this code. foreach (system.web.ui.control c in controlcollection) { if (c.gettype().fullname.equals("system.web.ui.webcontrols.table")) { tablerow t = (tablerow)c; t.enabled = false; } else if (c.gettype().fullname.equals("system.web.ui.webcontrols.textbox")) { textbox t = (textbox)c; t.enabled = false; } ....... ...... ///like controls } i need better approach @ this. searched on internet didn't find solution. do controls in list inherit system.web.ui.webcontrol? if so, code may help. (didn't test myself) type wc = new system.web.ui.webcontrols.webcontrol(htmltextwritertag.a).gettype(); foreach (system.web.ui.control c in controlcollection) { if (c.gettype().issubclassof(wc)) { ((system.web.ui.webcontrols.webcontrol)c).enabled = false; } } and more elegant (thanx shadow wizard ...

database - oracle internal fatal error ora-07445-->calling function:ksmpgd_scan_pga_heaps() -

error information: ora-07445: exception encountered: core dump [ksmpgd_scan_pga_heaps()+92][sigsegv][address not mapped object][0xffffffff7ffe617c][][] i have not metalink account of oracle,who me serach whether known bug of oracle software or not?

java - Dijkstra's shortest path algorithm Lars Vogel -

i'm trying implement dijkstra algorithm in java site of lars vogel : http://www.vogella.com/articles/javaalgorithmsdijkstra/article.html . there no main function , when create 1 public static void gives me errors non-static variables or classes cannot referenced static context. have make classes static or there solution? package de.vogella.algorithms.dijkstra.test; import java.util.arraylist; import java.util.linkedlist; import java.util.list; import org.junit.test; import de.vogella.algorithms.dijkstra.engine.dijkstraalgorithm; import de.vogella.algorithms.dijkstra.model.edge; import de.vogella.algorithms.dijkstra.model.graph; import de.vogella.algorithms.dijkstra.model.vertex; import static org.junit.assert.assertnotnull; import static org.junit.assert.asserttrue; public class testdijkstraalgorithm { private list<vertex> nodes; private list<edge> edges; @test public void testexcute() { nodes = new arraylist<>(); edges = new ...

php - What is special about 008 for type juggling to fail? -

what special string '008' , higher cause type juggling (for lack of better word) fail? numbered strings below 008 work fine, 008 or higher not appear ever equal number? to more precise, seems comparison 007, 008 , 009 issue lies, php not count 008 integer? $mystring='007'; //works fine. $mystring='008'; //fails. $mystring='009'; //fails. if($mystring==007) return 'abc'; if($mystring==008) return 'def'; if($mystring==009) return 'ghi'; starting number leading 0 indicates octal (base 8). digits 0-7 valid octal. http://php.net/manual/en/language.types.integer.php

javascript - detect upload window close jquery -

how fire event windows file uploading closed in of case - file selected, different file selected(from selected 1 ), window closed. this works in case if select file , different selected one. $(document).ready(function() { $('#file').change(function(){ alert("test"); }); }); <input type="file" id="file" /> thanks you need handle window's onunload or onbeforeunload events

PHP Markdown XSS Sanitizer -

i'm looking simple php library helps filter xss vulnerabilities in php markdown output. i.e. php markdown parse things such as: [xss vulnerability](javascript:alert('xss')) i've been doing reading around , best i've found on subject here this question. although html purifier looks best ( nearly only ) solution wondering if there out there more general? html purifier seems bit robust needs, pain configure, though looks it'd work excellent after doing so. is there else out there may little less robust , configurable still solid job? or should dig in , start trying configure html purifier needs? edit clarity: i'm not looking cut corners or of like. html purifier offers lot of fine grained control , simple small project control isn't needed, though using nothing isn't option either. coming when asking simpler or less robust . also final note, i'm not looking suggestions use htmlspecialchars() , strip_tags() or of like. disallow i...

api - Read dongle/mobile GSM messages using AT commands through Java -

i want read messages dongle i.e usb device. i have got information can read mobile messages using @ commands of java also. i got 1 of post post still uncleared. so connected dongle pc, , checked using @ commands in ms hyperterminal at , got response ' ok ' . means dongle connected gsm/gprs dongle. now how can read messages dongle. is there api use @ commands in java , didn't found api . so can tell me how can read messages using @ commands briefly. you need javax.comm . there example here. basically, opens serial port , lets send commands , replies.

c++ - Call TDataSet.Locate in one line -

in rad studio wiki can find documentation on using tdataset.locate method . following c++ snippet comes there: tlocateoptions opts; opts.clear(); opts << lopartialkey; variant locvalues[2]; locvalues[0] = variant("sight diver"); locvalues[1] = variant("p"); custtable->locate("company;contact", vararrayof(locvalues, 1), opts); i'd call locate all in 1 line , can in delphi. or simpler: custtable->locate("company;contact", vararrayof(new variant[2]{variant("sight diver"), variant("p")}, 1), tlocateoptions() << lopartialkey ); compiler says e2121 function call missing ) . is possible? according comments, problem second parameter, , open array vararrayof receives. according documentation, openarray macro helpful. you'd call vararrayof this: vararrayof(openarray(variant, ("sight diver", "p"))) so call locate become: custtable->locate("compa...

ios - Undefined symbols for architecture armv7 pjmedia pjsip -

i add library , framework of pjsip xcode project such simulator, device , third party when build project show error: undefined symbols architecture armv7: "_pjmedia_get_video_format_info", referenced from: _ios_factory_create_stream in libpjmedia-videodev-arm-apple-darwin9.a(ios_dev.o) "_pjmedia_format_get_video_format_detail", referenced from: _ios_factory_create_stream in libpjmedia-videodev-arm-apple-darwin9.a(ios_dev.o) "_pjmedia_format_init_video", referenced from: _ios_factory_init in libpjmedia-videodev-arm-apple-darwin9.a(ios_dev.o) ld: symbol(s) not found architecture armv7 clang: error: linker command failed exit code 1 (use -v see invocation) i try google solution seem not help. please share idea, think miss configuration or library. in advance. you should take in question asked on earlier trouble of compilation on xcode4.2 pjsip

google app engine - How to perform stemming/lemming on GAE-search application? -

i trying implement stemming in search app. have tried using ~ operator, didn't work. so, have 3 questions: 1) should index document in special way able search using ~ operator? have document contained "words", can't found query="~word". 2) operator ~ support other languages? 3) suggest use other stemmer/lemmer not built-in one? thanks lot! the stemming operator ~ work, @ least finding word "words" query ~word. are putting "~word" in quotes in query? disable stemming. also, forgot mention previously, stemming isn't implemented in development servers; works in real app engine environment hosted google.

java - Reading from serial port stops keyboard and mouse responding -

i have written java code read sensor data sent arduino mac using usb. i'm using rxtx library version 2.1.7. code is: commportidentifier portid = getportid(); logger.info(port_name + " has id " + portid); try { serialport = (serialport) portid.open(this.getclass().getname(), time_out); // set port parameters serialport.setserialportparams(data_rate, serialport.databits_8, serialport.stopbits_1, serialport.parity_none); input = new bufferedreader(new inputstreamreader(serialport.getinputstream())); // add event listeners serialport.addeventlistener(this); serialport.notifyondataavailable(true); } catch(exception ex) { ex.printstacktrace(); logger.error(ex.tostring()); } i have method reacts events on serial port: public void serialevent(serialportevent e) { string url = localhost; if (e.geteventtype() == serialportevent.data_available) { ...

c# - Invalid postback or callback argument error when button click - Beginner -

i getting following error; invalid postback or callback argument. event validation enabled using in configuration or <%@ page enableeventvalidation="true" %> in page. security purposes, feature verifies arguments postback or callback events originate server control rendered them. if data valid , expected, use clientscriptmanager.registerforeventvalidation method in order register postback or callback data validation. i added columm, , added button it, when button fired following c# code gets executed; asp.net code <columns> <%-- <asp:boundfield /> definitions here --%> <asp:templatefield> <itemtemplate> <asp:button id="addbutton" runat="server" commandname="addtocart" commandargument="<%# ((gridviewrow) container).rowindex %>" text="add cart" /> </itemtemplate> </asp:templatefield> ...

arrays - Creating graphics objects that never overlap java -

i'm making small balloon game in java , trying write code, when create new 'balloon' objects don't overlap on screen. the code have far is: public void newgame(){ ui.cleargraphics(); this.currentscore = 0; this.totalpopped = 0; (int = 0; < this.balloons.length-1; i++) { this.balloons[i] = new balloon(50 + math.random()*400, 50 + math.random()*400); (int j = + 1; j < this.balloons.length; j++) { if (this.balloons[i] !=null && this.balloons[j] != null && this.balloons[i].istouching(balloons[j])) { this.balloons[j] = new balloon(50 + math.random()*400, 50+ math.random()*400); } } this.balloons[i].draw(); } ui.printmessage("new game: click on balloon. high score = "+this.highscore); } using draw , istouching methods: public void draw(){ ui.setcolor(color); ui.filloval(centerx-radius, centery-radius, radius*2, radius*2); ...

email - How to send bulk mails avoiding spam? -

my problem is: have got lots of users , got 6-10k e-mails per day. e-mails reset passwords, or registration confirmation, etc. but our ip on ban list or that. can't send e-mail lots of users, can't confirm changes. i tried php mail smtp solutions, gmail or joomla ban in short time. how many mails or how should send them? it's big problem us. use third party provider, you'll avoid lot of headaches, , it's cheap. amazon ses , sendgrid or mailgun popular choices, there tons of them on market.

c# - SocketAsync, can't reconnect to server -

i have problem socketasync application, have server, , client (the code below), communication works great except when server application closed, client cant reconnect. if restart client, no problem @ all, connect again, has restarted. question how can modify code, reconnect without restarting application self. this connection code! public client() { try { this.ip = ini.getfromini("config", "ip"); this.port = ini.getfromini("config", "port"); data = new byte[60000]; receivebuffer = new byte[60000]; this.hostendpoint = new ipendpoint(ipaddress.parse(this.ip), convert.toint32(port)); this.clientsocket = new socket(this.hostendpoint.addressfamily, sockettype.stream, protocoltype.tcp); // instantiates endpoint , socket. starttimer = new system.timers.timer(); starttimer.elapsed += new elapsedeventhandler(starts...

java - Error on unmarshaling with generated code (moxy): "A descriptor with default root element ... was not found in the project" -

i generated code using moxy different xsd-files: http://www.forum-datenaustausch.ch/generalinvoiceresponse_400.xsd , http://www.forum-datenaustausch.ch/xmlstandards_generelle_rechnung_beispiele_antwort_4.3_20100901.zip i generated jaxb-classes both xsd (using moxy). tried unmarshal xml-files (genrated eclipse) code: public void temptest() throws jaxbexception{ jaxbcontext jc = jaxbcontext.newinstance(<package corresponding type>.responsetype.class); jc.createunmarshaller().unmarshal(responsetest.class.getresourceasstream("/responses/generalinvoiceresponse_400.xml")); } with xml-file of 4.3-type (2nd link) works fine xml of 400-type (1st link) error: caused by: javax.xml.bind.unmarshalexception - linked exception: [exception [eclipselink-25008] (eclipse persistence services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.xmlmarshalexception exception description: descriptor default root element {http://www.forum-datenaustausch.ch/de}re...

xml - What is the logic behind xs:date datatype in xsd schema? -

i want know how xs:date datatype defined in w3c xsd schema. there anyway find it? (not how use xs:date in xsd schema) how reading documentation? http://www.w3.org/tr/xmlschema11-2/#date