Posts

Showing posts from 2014

Remove duplicate lists from a parent list using hashset in c# -

i have parent list contains several child lists . , these inner lists contain column objects. list<list<column>> listofallcolumns; public class column { public string sectionname; public string stirruptype; public int stirrupsize; public double stirrupspacing; } let's child lists contain different column objects this: list1 = {c1, c1, c2} list2 = {c1, c2, c1} list3 = {c2, c3} list4 = {c1,c1, c2} and parent list contains these lists : listofallcolumns = {list1, list2, list3, list4} now want method removes duplicate lists listofallcolumns list. example, list above , remove list4. list1: c1,c1,c2 list2: c1,c2,c1 list3: c2,c3 list4: c1,c1,c2 (it equal list1 duplicate) i know can done using linq , distinct method want using hashset . by way order important, example {c1, c2, c1} different {c2,c1,c1}. update 1: here tricky part. order important inside child lists not important in parent list. list1:{c1, c2} , list2: {c2,c1}

Oracle VM and Rails: OCIError: ORA-12537: TNS:connection closed -

i have rails app, using oracle database. i used run using oracle virtualbox , oracle developer day kit on old machine. pack provided oracle included oracle database 11g have new laptop, need reinstall everything, went well, oracle pack 'otn dev day' uses oracle database 12g. and after setting exact same way, run error while testing connection via oci8: 1.9.3-p327 :001 > require 'oci8' => false 1.9.3-p327 :002 > c= oci8.new('me', 'mypassword', '//localhost:1521/orcl') ocierror: ora-12537: tns:connection closed oci8.c:267:in oci8lib_191.bundle (irb):2:in `new' (irb):2 /users/stephanethomas/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.14/lib/rails/commands/console.rb:47:in `start' /users/stephanethomas/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.14/lib/rails/commands/console.rb:8:in `start' /users/stephanethomas/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.14/lib/rails/com

php - Integrating Sphider search engine in to website -

i have sphider search engine , running on site having 2 problems. i not clear on how set indexing results show up. i trying take search.php file , include ('sphider/search.php'); in dashboard.php file located in root dir of site. sphider @ root/sphider/search.php but when include nothing shows up. if has insight on issues having appreciate it. yes have found online documentation here , there nothing clears me. because sphider not installed in root directory might need update of path(s) within search.php eg. add '../sphider/' in path of can reference required php files etc. way can complicated , not worth it. for site created simple flash search box uses url request of 'search.php?query=' + keywordvar + '&start=1&search=1&results=10' works great. as3 example: var keywordvar = searchtextbox01.text; var urlpart1 = 'http://www.yourwebsite.com/search.php?query='; var urlpart2 = '&start=1&

c# - odata unknown function cast -

i have web api project host models, in .net application, when query : static void titlebyid(moviesservice.container container, short id) { try { moviesservice.title title = container.title.where(w => w.id == id).singleordefault(); if (title != null) { displaytitle(title); } } catch (exception e) { console.writeline(e.message); } } the problem not query, it's id variable. id variable of short type not int. here exception message : <?xml version="1.0" encoding="utf-8"?> <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <m:code /> <m:message xml:lang="en-us">an error has occurred.</m:message> <m:innererror> <m:message>unknown function 'cast'.</m:message&

c# - Object.ReferenceEquals returns true for matching strings -

i using mono , encountered interesting result when comparing references of 2 strings. code below demonstrates example: using system; class program { static void main() { string s1 = "asd"; string s2 = "asd"; console.writeline("reference equals: {0}", object.referenceequals(s1, s2)); console.readline(); } } yields true . it interesting, 2 strings have same value refer 2 different instances. going on? mono --version : mono jit compiler version 3.2.6 os x 10.9.2 http://msdn.microsoft.com/en-us/library/system.string.intern.aspx the common language runtime conserves string storage maintaining table, called intern pool, contains single reference each unique literal string declared or created programmatically in program. consequently, instance of literal string particular value exists once in system. the below shows behavior when strings not created string literal . static v

dataframe - R count column for each element, no matter redundancy -

sorry if i'm asking obvious, couldn't find similar. suppose have data: a<-c('blue','blue','green','red','black', 'white','blue','blue','blue','red', 'black','white','blue','green','red', 'black','white','white','black','white', 'blue','white','blue','green') and have in data frame, column summarizes number of times each element appears in whole vector, no matter if it's redundant. this: data.frame(a=c('blue','blue','green','red', 'black','white','blue','blue', 'blue','red','black','white', 'blue','green','red','black', 'white','white','black',

Yii – “Model.id” not defined for CArrayDataProvider and CSqlDataProvider - keyfield -

in controller want display users of application have used code: public function actionclientu($id) { $model=$this->loadmodel($id); $appusers= $model->users; $dataprovider=new carraydataprovider($appusers); $this->render('clientu',array( 'dataprovider'=>$dataprovider, )); } but have error: "undefined appuser.id" it refer line: $dataprovider=new cactivedataprovider('appuser', $appusers); any please ? i solved problem ! here cause of problem: model keyfield isn't named id , haven’t defined column should used. so have set keyfield this: new carraydataprovider($users, array('keyfield' => 'user_id')); new csqldataprovider($users, array('keyfield' => 'user_id'));

linux - How to read in csv file to array in bash script -

i have written following code read in csv file (which has fixed number of columns not fixed number of rows) script array. need shell script. usernames x1 x2 x3 x4 username1, 5 5 4 2 username2, 6 3 2 0 username3, 8 4 9 3 my code #!/bin/bash set oldifs = $ifs set ifs=, read -a line < something.csv another option have used #!/bin/bash while ifs=$'\t' reaad -r -a line echo $line done < something.csv for both tried test code see size of array line , seem getting size of 10 first 1 array outputs username. second one, seem getting size of 0 array outputs whole csv. help appreciated! you may consider using awk regular expression in fs variable this: awk 'begin { fs=",?[ \t]*"; } { print $1,"|",$2,"|",$3,"|",$4,"|",$5; }' or this awk 'begin { fs=",?[ \t]*"; ofs="|"; } { $1=$1; print $0; }' ( $1=$1 required rebuild $0 n

java - Array overwriting all other values when a new one is added -

i have been having issue when adding objects array. seems every single time add new woodfloor object array, overwrites of other values of array. here's code: package code; public class main { private static block[] blocks = new block[12]; public static void main(string[] args) { for(int = 0; < 12; i++) { blocks[i] = new woodfloor(i * 10, * 20); } } } package code; public class block { protected static int x, y; public block(int x, int y) { this.x = x; this.y = y; } public int getx() { return x; } public int gety() { return y; } } package code; public final class woodfloor extends block { public woodfloor(int x, int y) { super(x, y); } } don't use static modifier class fields need different each instance . static modifier makes field class field, 1 shared instances, , not want. so change this: protected static int x, y; to this: protected int x, y;

Networking with Java, how to check if a HTTP request is a directory? -

i'm making web server using java project , i'm having particular trouble task. i need check if requested resource directory. if is, needs check there file in directory called "index.html" i'm having trouble knowing when directory resource?

attributes - Python - Re-Implementing __setattr__ with super -

i know 1 has been covered before, , perhaps isn't pythonic way of constructing class, have lot of different maya node classes lot @properties retrieving/setting node data, , want see if procedurally building attributes cuts down on overhead/mantinence. i need re-implement __setattr__ standard behavior maintained, special attributes, value get/set outside object. i have seen examples of re-implementing __setattr__ on stack overflow, seem missing something. i don't think maintaining default functionality of setattr here example: externaldata = {'translatex':1.0,'translatey':1.0,'translatez':1.0} attrkeys = ['translatex','translatey','translatez'] class transform(object): def __getattribute__(self, name): print 'getting --->', name if name in attrkeys: return externaldata[name] else: raise attributeerror("no attribute named [%s]" %name) def

compiler construction - C operator precedence -

this question has answer here: undefined behavior , sequence points 4 answers for compiler class, gradually creating pseudo-pascal compiler. does, however, follow same precedence c. being said, in section create prefix , postfix operators, 0 for int = 1; int b = 2; ++a - b++ - --b + a-- when c returns 1. don't understand how can 1. doing straight prefix first, answer should 2. , doing postfix first, answer should -2. doing left right, zero. my question is, should precedence of operators return 1? operator precedence tells example whether ++a - b means (++a) - b or ++(a - b) . should former since latter isn't valid. in implementation it's former (or wouldn't getting result @ all), implemeneted operator precedence correctly. operator precedence has nothing order in subexpressions evaluated. in fact order in operator operands +

Export to Excel in php -

i have implemented 'export excel' in application , working fine. in module around 70 fields getting exported spread sheet. happening because have written query on view fields present. new requirement came thing exporting data different sheets. i,e first 10 fields should in sheet 1,next 20 fields in sheet 2,next 20 in sheet 3,next 20 in sheet 4. how can achieve functionality.

How to append to a nested list in a Clojure atom? -

i want append value list in clojure atom: (def thing (atom {:queue '()})) i know when it's not atom, can this: (concat '(1 2) '(3)) how can translate swap! command? note: asked similar question involving maps: using swap merge (append to) nested map in clojure atom? user=> (def thing (atom {:queue '()})) #'user/thing user=> (swap! thing update-in [:queue] concat (list 1)) {:queue (1)} user=> (swap! thing update-in [:queue] concat (list 2)) {:queue (1 2)} user=> (swap! thing update-in [:queue] concat (list 3)) {:queue (1 2 3)}

extjs - Replace this.grid.getColumnModel() function in 4.2 -

i using latest version extjs , want replace this.grid.getcolumnmodel() method used in plugin there achieve first approach you can override plugin's getcolumnmodel method. try this: ext.override('plugin.namespace', { getcolumnmodel: function(a, b, c) { // override here } }); placement of code crucial, either create overrides file or stick in app.js file. second approach the worst, still optional, approach manually modify plugin itself. said, can still it, it's not ideal solution.

Magento how to sort by new products first -

Image
i try use below code code give new product , need new product firs , other prodct. $todaydate = mage::app()->getlocale()->date()->tostring(varien_date::datetime_internal_format); $collection = mage::getmodel('catalog/product') ->getcollection() ->addattributetofilter('news_from_date', array('date' => true, 'to' => $todaydate)) ->addattributetofilter('news_to_date', array('or'=> array( 0 => array('date' => true, 'from' => $todaydate), 1 => array('is' => new zend_db_expr('null'))) ), 'left') ->addattributetosort('news_from_date', 'desc') ->addattributetosort('created_at', 'desc'); any 1 idea ?? thanks in advance!!! install extension sort date see

parsing - Java simple date formatter parse exception in remote machine -

in locale machine have code , executing fine.. dateformat stdf = new simpledateformat( "eee mmm dd yyyy hh:mm:ss zz (zzzz)"); string date = "sun mar 16 2014 10:30:00 gmt 0530 (india standard time)" calendar stcal = calendar.getinstance(); try { stcal.settime(stdf.parse(date.replace("gmt ", "utc+"))); } catch (parseexception e) { // todo auto-generated catch block e.printstacktrace(); } but have running same code in remote machine in amazon server gives following parsing error, java.text.parseexception: unparseable date: "sat march 15 2014 09:00:00 utc+1000<e. australia standard time>" update replace content below : stcal.settime(stdf.parse(date.replace("gmt ", "utc +")));

vb.net - Cannot update UI from other task in win forms? -

i have 4 complex tasks running parallel, want update rich textbox log file. approximate program structure follows: sub buttonclick () complextask1 'code goes here complextask2 'code goes here complextask3 'code goes here complextask4 'code goes here end sub the above 4 tasks updates log file, have display in richtextbox control. tried infinite while loop, , updating textbox , ui getting hanged. you must run heavy task in separate thread or background worker first read , study threading here sample coding task import these form class imports system.threading imports system.componentmodel create local variable in form private synccontext synchronizationcontext create method task private sub dotask() complextask1 'code goes here complextask2 'code goes here complextask3 'code goes here complextask4 'code goes here end sub on button click create new thread , execute heavy task sub buttonclick ()

c# - Active Directory access using HostingEnvironment.Impersonate() fails to find the user -

i have looked @ every posting regarding reasons following exception: an unhandled exception has occurred. @ system.directoryservices.directoryentry.bind(boolean throwiffail) @ system.directoryservices.directoryentry.bind() @ system.directoryservices.directoryentry.get_adsobject() @ system.directoryservices.directorysearcher.findall(boolean findmorethanone) @ system.directoryservices.directorysearcher.findone() it appears best solution issue use hostingenvironment.impersonate() when calling directorysearcher suggested in many links including ones below: active directory com exception - operations error occurred (0x80072020) , getting error querying active directory on server only encapsulated code accessing directorysearcher in using (hostingenvironment.impersonate()) suggested , stopped getting exception cannot find user. way have seen further make in web.config file not fetching correct user, supposed windows user. need change in iis configuration? should mention simila

Data structure insert,delete,mode -

here interview problem: designing data structure range of integers {1,...,m} (numbers can repeated) support insert(x), delete(x) , return mode return number. the interviewer said can in o(1) operation preprocessed in o(m). accepted can insert(x) , delete(x) in o(log(n)), return mode in o(1) preprocessed in o(m). but can give in o(n) insert(x) , delete(x) , return mode in o(1), how can give o(log (n)) or/and o(1) in insert(x) , delete(x), , return mode in o(1) preprocessed in o(m)? when hear o(log x) operations, first structures comes mind should binary search tree , heap . reference: (since i'm focussing on heap below) a heap specialized tree-based data structure satisfies heap property: if parent node of b key of node ordered respect key of node b same ordering applying across heap. ... keys of parent nodes greater or equal of children , highest key in root node (this kind of heap called max heap) .... a binary search tree doesn't allow construction

php - How do I change the name of CakePHP root directory -

i want change name of root directory of cakephp install. example root called 'cakephp_website' , want change 'my_website'. however when rename directory following error: missing controller error: mywebsitecontroller not found. error: create class mywebsitecontroller below in file: app\controller\mywebsitecontroller.php what process achieving this? in /app/webroot/index.php /app/my_website/index.php add these lines: define('www_root', '/full/path/to/my_website/'); define('webroot_dir', 'my_website');

php - Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING -

i trying retrieve data database , show data in table header in text mail function,but getting error: parse error: syntax error, unexpected ']', expecting t_string or t_variable or t_num_string can tell how fix error my code : $text_mail.= "<table style='margin:0px'> <tr> <th>country</th> <th>networkname </th> <th>mcc</th> <th>mnc</th> <th>oldprice </th> <th>newprice </th> <th>comments </th> <?php $dbhost = 'localhost'; // localhost $dbusername = 'xxxx'; $dbpassword = 'xxxxxxxxx'; $dbdatabase = 'xxxxxxxxxxxx'; $db = mysql_connect($dbhost, $dbusername, $dbpassword) or die ("unable connect database server."); mysql_select_db ($dbdatabase, $db) or die ("could not select database."); $columnnames = mysql_query('select clientid client_list

jquery ui - bing maps autocomplete get long and lat from address -

i want user search address , want show som examples , when user chooses 1 examples want find coordinates. can't autocomplete work @ , won't search addresses. $('[id$=placeofdeparture]:not(.ui-autocomplete-input)').live('focus', function () { $(this).autocomplete({ source: function (request, response) { $.ajax({ url: "http://dev.virtualearth.net/rest/v1/locations", datatype: "jsonp", data: { key: 'avmddltsmppoq9n21vldealhnr-h-w-a9hmjxiidn9chbvp5ylleldc_lmnuccrb', addressline: request.term, }, success: function (data) { var result = data; } }); }, minlength: 2, select: function (event, ui) { event.preventdefault(); $(this).val(ui.item.label); travel = $(this).closest('div').parent(); travel.find('[id$=placeofdeparturecoordinates]').va

How to detect actual packet loss by comparing pcap captured on both sides? -

actually i'm trying evaluate performance , efficiency of different protocols. i'm aware tcp implementation considers packet "lost" when either ack timeout or 3 duplicate acks received. cannot tell when packet lost among network. now i'm capturing packets on both sides of connection via tcpdump, , 2 pcap files. can exact packets lost comparing 2 pcap files? , worth trying? a direct attempting differing ip packets' ids unmatched ones, first try. problem network adapter splits , combines packets libpcap cannot capture actual ip packets through network. if don't turn off features such "generic receive offload" on nic, on default, captured on sender side , receiver side not match exactly, differing ids lead wrong conclusion; turning off features splitting/combining packets may affect transporting performance badly , conclusion in other way. i'm in middle of dilemma. a related post how "gro", "lro" features behave o

asp.net - Can i use jscript in vs2010 -

i looking around @ how make javascript run more efficiently compiled code. came across jscript.net in question jscript whilst not interested in using hide javascript logic interested in fact resulted in compiled code. i tried googling around seem was old idea microsoft dating around framework 1.1. also, got 2 camps of opinions saying hated because nightmare debug , other side saying improved performance. i have not found more info that. so, if not concerned debugging (for moment) should consider using jscript.net compiled faster execution of code? there more modern alternative framework using or should not consider @ all? finally, {sorry} there code samples/instruction how implement it? lately i'm using jscript.net lot (along 'old' jscript comes wsh). but never use visual studio (you found this ).but simple notepad++. and here's makes jscript great me: it's available on every windows system (even ancient xp machines have .net fram

node.js - Error in parsing json array accepting multiple values -

whenever giving single data element in json file code works fine,but give array of elements starts showing undefined on client side . server side code. var app = require('express')() , server = require('http').createserver(app) , io = require('socket.io').listen(server); var fs= require('fs'); server.listen(3000); app.get('/', function (req, res) { res.sendfile(__dirname + '/cli_index.html'); }); io.sockets.on('connection', function (socket) { var file = __dirname + '/data.json'; fs.readfile(file, 'utf8', function (err, data) { if (err) { console.log('error: ' + err); return; } data = json.parse(data); // can save values somewhere or log them console console.log(data); socket.emit('news', { hello: data}); }); }); this client side code. <script src="/socket.io/socket.io.js"></script> <script> var socket = io.conne

http referer - $_SERVER['HTTP_REFERER'] is used to check if links is clicked in browser ? how to check if link is cliked in email viewer? -

my purpose : send email user contains links, if user click, must go server check , forward. in browser can use $_server['http_referer'], in email don't know how ? sorry, can use same $_server['http_referer'] if user check mail on web interface, , can't mark click in desktop email client.

c# - AddWithValue contains # that needs to be " " -

i have sql update statement inside update_ckick event: dim tmp_date date dim yeardatetime new nullable(of date) if date.tryparse(txtstartdate.text, tmp_date) yeardatetime = tmp_date else yeardatetime = nothing end if update details set emp_dateappointedrank = @emp_dateappointedrank updateemp.parameters.addwithvalue("emp_dateappointedrank", string2date(yeardatetime)) that's snippet, happens when step line update details set emp_dateappointedrank = @emp_dateappointedrank value shows #10/03/2014# how can make value just: 10/03/2014 no #? c# welcome i suspect mistaking what's being displayed visual studio debugger means. #10/03/2014# date literal in vb.net . means it's type date ( datetime in c#) , it's value 10/03/2014 . apart that, have prepend @ in sql-parameter if use ms-sql-server , date variable instead of string : if yeardatetime.hasvalue updateemp.parameters.

javascript - angular js - missing : after property id -

i'm using angular js creating json, when tried make json shown below $scope.newcolumns =[{"file 1":"file1.png"},{"file 1":"file2.png"}] i'm getting missing : after property id my code given below $scope.newcolumns = []; angular.foreach( $scope.datas, function(data){ $scope.newcolumns.push({data.id : data.value}); }); can please tell me solution this i think need this, var obj={}; obj[data.id]= data.value; $scope.newcolumns.push(obj); {data.id : data.value} not valied syntax data.id should name property cannot variable. if need have variable field names need above.

jquery - Javascript Variable to Bootstrap Modal -

got simple one, google failing me @ moment hoping can bit of push in right direction i have html page bunch of checkboxes. these checkboxes simple self evaluation yes/no questionnaire weighted different values based on questions. at end of questionnaire, hit calculate results , used quick javascript function calculate score , alert popup give score i migrated page bootstrap 3 , cleaned bit want use modal popup instead of old style javascript alert is there simple way of passing javascript calculated variable main page bootstrap modal thanks edit right - worked out, calling jquery code $('#myresults').html(counter); from within model - moved snippet main javascript function , works. knew going simple one.. might time stop working think thanks yes . can pass variable bootstrap modal. script file <script> function testfun(variable){ document.getelementbyid('testh1').innerhtml=variable; } </script> html <butt

How to resolve this error in android - java.lang.RuntimeException: Only one Looper may be created per thread -

here code in background service public class backgroundservice extends service { private int interval1 = 60; // 60 seconds private int interval2 = 60; // 60 seconds //============================================================================================================================= private handler mtimer1 = new handler(); private runnable mtask1 = new runnable() { public void run() { looper.prepare(); log.w("gps tracker", "tracker going run "+new date()); locationmanager mlocmanager =(locationmanager)getsystemservice(context.location_service); locationlistener mloclistener = new mylocationlistener(); mlocmanager.requestlocationupdates( locationmanager.gps_provider, 0, 0, mloclistener);//, looper.getmainlooper()); mtimer1.postdelayed(this, interval1 * 1000l); looper.loop(); } }; //=============================================

ios - How to draw a dashed line using CGContext / CGContextRef? Why is my code producing a solid line? -

this xamarin.ios code presume native folks can spot problem too, tagged objc. i'm subclassing uiview , "abuse" draw dashed line view's x, y view's right, bottom bounds. the color set white . line style supposed dashed . black , solid line. doing wrong here? public override void draw (rectanglef rect) { using (cgcontext g = uigraphics.getcurrentcontext ()) { g.setlinewidth (1f); g.setlinedash (0, new float[] { 10f, 4f }); g.moveto (rect.x, rect.y); g.addlinetopoint (rect.right, rect.bottom); g.setstrokecolor (this.color.cgcolor); g.strokepath (); } } as answer becomes obvious once post question here :-) this line causing problem: g.setlinedash (0, new float[] { 10f, 4f }); it has be: g.setlinedash (0, new float[] { 10f, 4f }, 2); from apple's documentation : if lengths parameter specifies array, pass number of elements in array. otherwise, pass 0.

WebView.draw(android.graphics.Canvas) won't draw HTML5 canvas to android.graphics.Canvas -

hey i'm trying draw webview bitmap following way: customwebview webview = (customwebview) findviewbyid(r.id.chart_webview_renderer); string capturepathstring = environment.getexternalstoragedirectory().getpath() + "/temp/ms_" + system.currenttimemillis() + ".png"; bitmap bm = bitmap.createbitmap(webview.getmeasuredwidth(), webview.getmeasuredheight(), bitmap.config.argb_8888); canvas bigcanvas = new canvas(bm); paint paint = new paint(); int iheight = bm.getheight(); bigcanvas.drawbitmap(bm, 0, iheight, paint); webview.draw(bigcanvas); if (bm != null) { try { outputstream fout = null; file file = new file(capturepathstring); fout = new fileoutputstream(file); bm.compress(bitmap.compressformat.png, 50, fout); fout.close(); fout.flush(); bm.recycle(); } catch (exception e) { e.printstacktrace(); } } this works fine on tablets have available testing here (galaxy tab 2 , 3). res

ios - UITabBarController don't autosize UITabBarItem -

Image
i'm new ios learner, when follow tutorial, met problems. in tutorial, if have 2 tab bar item did, there 2 button on tab bar width equal 50% tab bar width. tab bar item 100% size. so can fix ? i found nice tutorial via link ( https://discussions.apple.com/thread/2099944?start=0&tstart=0 ). you should implement uitabbardelegate protocol documentation here:( https://developer.apple.com/library/ios/documentation/uikit/reference/uitabbardelegate_protocol/reference/reference.html ). once implementing protocol, use - (void)tabbar:(uitabbar *)tabbar didselectitem:(uitabbaritem *)item method know when user changes selected item of tab bar. in method's implementation, have check item selected, , manually change view's content based on that. hope in issue.

monetdb - trouble while making install monetdb5 -

i've following error when running make while installing monetdb5 make[9]: entering directory `/home/lfopa/opt/monetdb/monetdb5/extras/jaql/parser' /bin/bash ../../../../libtool --tag=cc --mode=compile gcc -dhave_config_h -i. - i../../../.. -i. -i../ -i./../ -i../../../mal -i./../../../mal -i../../../optimizer -i./../../../optimizer -i../../../../common/options -i./../../../../common/options -i../../../../common/stream -i./../../../../common/stream -i../../../../gdk -i./../../../../gdk -dlibjaqlp -g -o2 -c -o libjaqlp_la-jaql.tab.lo `test -f 'jaql.tab.c' || echo './'`jaql.tab.c libtool: compile: gcc -dhave_config_h -i. -i../../../.. -i. -i../ -i./../ -i../../../mal -i./../../../mal -i../../../optimizer -i./../../../optimizer -i../../../../common/options -i./../../../../common/options -i../../../../common/stream -i./../../../../common/stream -i../../../../gdk -i./../../../../gdk -dlibjaqlp -g -o2 -c jaql.tab.c -fpic -dpic -o .libs/libjaqlp_la-jaql

RGeo on Ruby under Windows: How to enable GEOS support? -

i'm trying spatial operations in ruby rgeo gem. unfortunately, lot of operations require geos library , can't find documentation showing how integrate in windows (i using windows 7 64bit). i tried downloading , installing windows binaries of geos http://trac.osgeo.org/osgeo4w/ , reinstalling rgeo gem via gem install rgeo -- --with-geos-dir="c:\osgeo4w64\bin (<< in directory there file geos_c.dll ). still, using rgeo::geos.supported? returns false . does know how solve this? for else looking - here tips how got working. install geos windows binaries following link http://trac.osgeo.org/geos/ (i have ruby 32 bit version, went 32 bit version) you should able find file geos_c.dll in c:\osgeo4w\bin set windows environment variable env['geos_library_path'] c:\osgeo4w\bin check @ point make sure env variable there - maybe restart pc! in gemfile, add gem 'ffi-geos' , gem 'rgeo' , bundle install in ruby file, remem

c# - Isn't possible to create an instance of Page Class? -

Image
simple webform.aspx class: namespace _webapplication { public partial class webform1 : system.web.ui.page { } public class testclass : system.web.ui.page { webform1 webform1 = new webform1(); } } inside testclass or other class, looks lets me create instance doesn't let me use it. code above doesn't give compile time error. but, if type webform1 , says field used type. asking question cos wondering. when merely derives page class, not meaningful & useful because page content , state is depends on client http request/post information sent server. page instance initialized in number of steps page life-cycle represents perfectly. if you'll take @ page class, able see contains properties , events related current client's request/page life-cycle, example: request gets httprequest object requested page. session gets current session object provided asp.net user gets information user making page req

How to change to a subdirectory and run an exe using a bat file in a Windows 7 system? -

using bat file, want change sub directory of folder bat file in, , run my_application.exe in directory, i try: cd /d %cd%\my subdirectory start %~dp0my_application.exe but doesn't work, says can't find my_application.exe just indicate start command program start , should starting folder it. without cd command, can written start "" /d "%~dp0my_subdirectory" "my_application.exe" if my_application.exe located in subdirectory, or start "" /d "%~dp0my_subdirectory" "%~dp0my_application.exe" if application located in same folder batch file. start command take first quoted parameter title new process. avoid problems, empty string ( "" ) included in command title.

Error message only when running the app on real smart TV -

i trying develop samsung smart tv app, far works quite on samsung sdk's emulator (i using version 3.5.2), when sync app on smart tv, result not same running @ emulator. for example, @ scene a, when press button left, suppose navigate scene b, works expected in emulator. however @ real smart tv, when press button left, nothing happens, , log has strange error message: cannot run current focused scene's key handler. i have searched official samsung development forum seems not many people face problem, can , tell me why error , how can solve ?? thanks! you need pass focus new scene want active. example scene2.focus() should update sdk, 3.5 quite old! try using samsung sdk 4.5

android - How can i hide the first item when click the second item in ListView using Expandanimation? -

i using develop listview acts expandablelistview works fine 1 problem wil there when click second item first item not close i using animation class like expandanimation.java public expandanimation(view view, int duration) { setduration(duration); manimatedview = view; mviewlayoutparams = (layoutparams) view.getlayoutparams(); // decide show or hide view misvisibleafter = (view.getvisibility() == view.visible); mmarginstart = mviewlayoutparams.bottommargin; mmarginend = (mmarginstart == 0 ? (0- view.getheight()) : 0); view.setvisibility(view.visible); } @override protected void applytransformation(float interpolatedtime, transformation t) { super.applytransformation(interpolatedtime, t); if (interpolatedtime < 1.0f) { // calculating new bottom margin, , setting mviewlayoutparams.bottommargin = mmarginstart + (int) ((mmarginend - mma

smtp - Local mail server not working prpoperly in centos 6.5 -

i want setup local mail server want work in local environment. used sendmail , dovecot. have development server , in uses mantis tools. after resolving issue each developer got mail not getting in local intranet. so need resolve problem installed sendmail server. yum install sendmail* -y yum install m4* -y changed in sendmail.mc dnl # daemon_options(`port=smtp, addr=192.168.1.91, name=mta')dnl then m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf then service sendmail restart for receiving mail installed dovecot yum install dovecot* -y in changed in dovecot.conf uncomment pop3 imap 10-auth.conf changed disable_plaintext_auth = no auth_mechanisms = plain login in 10-mailconf uncomment maildir. in 10-master.conf user , group left blank everything works said ok. sendmail ok. dovecot ok. no error mail dosen't receive. nothing happened not able receive mail. i need if have email user1@example.com , user2@example.com both using mant

iphone - Add more than 20 regions to geofencing ios -

i want add 100 of regions geofencing.(apple limit 20)any 1 have better idea it.please me. currently im using significant location change.when significant location change, - (void) locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation method call api current location , nearest region set , add geofencing.this method works.but heard web significant location change fire depend on cell towers.if there less cell towers problem.other thing when calling api in background effect battery. significant location changes indeed efficient way update geofences. instead of contacting api every time when significant location change occurs, keep larger list in database in phone , select list 20 closest. slc isn't based on cell tower changes, can triggered other location providers. therefore work on wifi. cell tower changes important source. we tested slc , geofencing rigorously development of our ios lib

objective c - Drawing pdf in Cocoa with antialias -

Image
i developing application requires converting pdf image. problem facing in pdfs there white lines. this code use converting pdf image. nspdfimagerep* pdfrep = [nspdfimagerep imagerepwithcontentsoffile:path]; [pdfrep setcurrentpage:page]; nsbitmapimagerep* bmrep; nsrect pdfbounds=[pdfrep bounds]; nsrect target=[nsbitmapimagerep scalingsizefittingin:pdfbounds.size targetsize:size]; bmrep = [[nsbitmapimagerep alloc] initwithbitmapdataplanes:null pixelswide:size.width pixelshigh:size.height bitspersample:8 samplesperpixel:4 hasalpha:yes isplanar:no colorspacename:nscalibratedrgbcolorspace bytesperrow:0

java - Convert RGB PNG to CMYK JPEG (using ICC Color Profiles) -

i need convert png-file cmyk jpeg. during research i've found multiple articles on decribing problem. i've copied this answer using bufferedimage , colorconvertop . i came little example: public static void main(final string[] args) throws ioexception { final string imagefile = "/tmp/page0.png"; final bufferedimage pngimage = imageio.read(new file(imagefile)); // convert png jpeg // http://www.mkyong.com/java/convert-png-to-jpeg-image-file-in-java/ final bufferedimage rgbimage = new bufferedimage(pngimage.getwidth(), pngimage.getheight(), bufferedimage.type_int_rgb); rgbimage.creategraphics().drawimage(pngimage, 0, 0, color.white, null); // rgb cmyk using colorconvertop // https://stackoverflow.com/questions/380678/how-to-set-icc-color-profile-in-java-and-change-colorspace/2804370#2804370 final icc_profile ip = icc_profile.getinstance("icc/isocoated_v2_300_eci.icc"); // final icc_profile ip = icc_profile

c# - Customizing selected ListboxItem -

i have listbox (actually, have telerik's radjumplist, afaik inherited listbox) custom itemcontainerstyle. each item contains rectangle (tile) , 2 strings. far, works okay default: when i'm selecting item, color of strings changing, , rectangle has const color. <datatemplate x:key="datatemplate1"> <grid margin="0,0,12,12"> <rectangle x:name="slottile" width="99" height="99" fill="gray"/> <stackpanel grid.row="0"> <textblock fontweight="black" fontsize="{staticresource phonefontsizesmall}" text="{binding title, converter={staticresource toupperconverter}}" /> <textblock fontfamily="{staticresource phonefontfamilysemibold}" fontsize=&qu