Posts

Showing posts from June, 2013

algorithm - Compress an ordered sequence of uint32 -

given array of unique uint32 ordered fixed-width'ed sequence , size can vary thousand million, what's options there compress minimal size? start replacing note of first value , array of differences between successive values. easiest thing run general purpose compression algorithm zip on array of differences. if wanted scratch might try encoding differences http://en.wikipedia.org/wiki/elias_omega_coding , using http://en.wikipedia.org/wiki/huffman_coding on result, treated byte stream or perhaps stream of 16-bit values.

sql - How can you expand a "condensed" PostgreSQL row into separate columns? -

i have function returns table. if run select * some_function(12345) result is: object_id | name ---------------- 12345 | "b" if run select some_function(12345) result is: some_function ------------- (12345,"b") the problem want original form (so can access individual column values), have argument some_function() come column in table. can execute select some_function(thing_id) things returns: some_function ------------- (12345,"b") (12346,"c") (12347,"d") whereas want returned is: object_id | name ---------------- 12345 | "b" 12346 | "c" 12347 | "d" so how can 1 "unnest" or "expand" such condensed row? in postgresql 9.3 or newer use implicit lateral query: select f.* things t, some_function(t.thing_id) f; prior versions, causes multiple-evaluation of some_function : select (some_function(thing_id)).* things;

Perforce: Deleting Multiple Workspaces Through Command LIne -

is there command line option, in perforce, delete multiple workspaces @ once? i have many workspaces not in use anymore. run command can delete workspaces - workspace name can input string txt file. possible? being new p4, have tried (and failed) far is: p4 -x client -d -f c.txt "c.txt" text file contains list of workspaces deleted. thanks. the -x flag says read perforce commands file line line. in case you're asking read commands file named "client". i think intended change c.txt list of clients deleted bunch of lines saying: client -d -f client1 client -d -f client2 ... that allow use command p4 -x c.txt

ios - Azure Notification Hub Registered Device list -

Image
i following this post work azure notification hub. trying creating web api registers devices azure notification hub. when send request registering device shown in article hits azure notification hub. below screen shot of azure portal. shows there request registration. but when try details of registered devices using following code 0. var registrationscount = await hub.getallregistrationsasync(int32.maxvalue); return registrationscount.count().tostring(); now have few questions : 1 ) how can explore registered device details ? 2 ) how can send test notification ios devices end. below code using send test notifications. var payload = string.format(toasttemplate, message); hub.sendapplenativenotificationasync(payload, "worldnews"); 3 ) if using web api end necessary configure ios app details in azure notification hub ? i.e uploading certificate , other details on azure portal ? your first problem how calling getallregistrationsasync . parame

javascript - How to find the name of variable where object is created? -

i have object called 2 different variables. there way find out - inside object function - variable calling it? sp = new selectedplaylists("tableselectedplaylists"); sa = new selectedplaylists("tableselectedalbums"); these 2 variables i think create variable inside selectedplaylists class determine type of playlists , pass trhough constructor: sp = new selectedplaylists("tableselectedplaylists", "p"); sa = new selectedplaylists("tableselectedalbums", "a"); in consctructor: function selectedplaylists(id, type) { // ... code ... var managetype=type; var buttonlabel=''; switch(type) { case 'p': // playlist mode this.buttonlabel='remove playlist'; case 'a': // album mode this.buttonlabel='remove album'; } } store second param in variable (for example managetype ) , use when needed (tak

javascript - Revert getElementsByClassName to original browser version -

i'm working on existing web page has sorts of javascript i'm not able edit. have access part of page stuff. problem using jquery. previous developer had modified getelementsbyclassname method custom version, i'm assuming kind of polyfill ie. breaks jquery uses getelementsbyclassname on supported browsers. now how may revert getelementsbyclassname original version before code executed. can't find original method anywhere online. not using jquery not option i'm trying integrate big piece of code written jquery. thanks. since prototype chain of document wasn't altered, restore deleting current implementation, mentioned in comments: delete document.getelementsbyclassname; demo that make implementation available again via prototype chain. old answer you try restore hack: document.getelementsbyclassname = document.documentelement.getelementsbyclassname .bind(document.documentelement); i'm not whether has downsides, though.

javascript - typeahead.js : How to remove value when value not in suggestion -

i use typeahead.js autocomplete textbox. at first, when input , select value suggestions, textbox sets value correctly. then, input value not in suggestions , press tab , value of textbox doesn't clear. how clear value of textbox when input value not in suggestions. i ran same situation , way solved using events of typeahead.js . record selection on typeahead:select , check on typeahead:change if selection made. if no selection made, reset input original value. // initialize typeahead ususal var $mytypeahead = $("#my-typeahead"); $mytypeahead.typeahead(/* set-up typeahead here */); // set variables store selection , original // value. var selected = null; var originalval = null; // when typeahead becomes active reset these values. $mytypeahead.on("typeahead:active", function(aevent) { selected = null; originalval = $mytypeahead.typeahead("val"); }) // when suggestion gets selected save $mytypeahead.on(&qu

jquery - How to add new row in jsp with incremented value from server -

this code add row in div. on click on #add fetch new row , append .panel-body code working not able set incremented values in newly added row. $(document).ready(function() { $(document).on('click', '#add', function(event) { event.preventdefault(); $.ajax({ type: "post", url: "getnewrow", data: 1, datatype: "html", success: function(data) { $(".panel-body").append(data); } }); }); in struts.xml <action name="getnewrow" class="iland.expense.expenxeaction" method="getnewrow"> <result name="success">/pages/expense/newrow.jsp</result> <result name="input">/pages/expense/newrow.jsp</result> <re

php - Want to order by cast but after value -

i'm using ajax fetch more photos gallery based on views. gallery has set of 10 photos showing. want next 10 photos in order based on view count high low. $last_image_view_count = 232; "select * `gallery` order cast(`views`<'$last_image_view_count' signed) desc limit 10"; the code above works...but not in order (230 - 216 - 205 etc). scattered under 232. need figuring out how in order high low. "select * `gallery` `views` < '$last_image_view_count' order `views` desc limit 10"; use where-statement select desired set of data (from understand want those, view-count that's less $last_image_view_count ). you can order views column. there's no need cast in order by-statement. code ordering 1 or 0 (1 if views less variable, otherwise 0).

How to add session in android application? -

i'm making android application in there different activities connected home (mainactivty) activity , vice-verse. want close application whenever press key home activity. takes me previous activity came from. how can this. please me in this, i'm new android. thanks............. here code: btn_daily.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { intent = new intent(getapplicationcontext(), activitya.class); startactivity(i); } }); btn_health.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { intent = new intent(getapplicationcontext(), activityb.class); startactivity(i); } }); btn_diet.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { intent = new intent(getapplicationcontext(), activityc.class);

c# - Grid View or ListView Binding or Rendering of Collection of Collection -

a complete new bee in xaml , wpf shifted mvc 1 week back requirement: display customer name , corresponding brands 1 customer can have many brands issue unable display corresponding brands reference similar thread code public partial class mainwindow : window { public mainwindow() { datacontext = new mydevicelist(); initializecomponent(); } } public class mydevicelist { entities ent = new entities(); public observablecollection<mycustomers> customers { get; set; } public void getcustomersbrand() { var custall = (from c in ent.customers select new mycustomers{ name = c.name, brands = c.brands.tolist() }).tolist(); customers = new observablecollection<mycustomers>(custall); } public mydevicelist() { getcustomersbrand(); } } //just dummy class public class brand { public string name { get; set; } public int customerid { get; set; } } p

java unwanted symbols after reading from file -

this question has answer here: reading inputstream utf-8 2 answers i'm trying data text file, generated arcgis, clean using regex. when launch application using run project, works, when launch .jar file, adds "Ā" symbol data. using netbeans, jdk7, project encoding set utf-8. here's original string: 0,rix_p_1,area,2,lgs,wgs84,tree,32.3, , , ,25,0.61,m,90%,0.01, ,0.15,90%,0.1,egm96,essential,08.11.2013,m, , ,nil,nil,metrum,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0,0,0,0,0,0,1,0,0, , , , , , , , , , , ,tree,**"23° 57' 51,805"" e","56° 53' 30,142"" n" the program reads (i replaced middle part of string (===), unchanged): 0,rix_p_1,area,2,(===),"23Ā° 57' 51,805"" e","5

html - remove php comment code from inspection -

this question has answer here: why php appear commented out when view in browser? <!--?php include(“header.php”); ?--> 5 answers my php code inside html , when open html file file not run code.so used inspect element of chrome browser , shows php code comment.how ca uncomment because in code uncommented. code: <form id="data" class="form-geofence" role="form" method="post" action="geofencedata.php"> <h2 class="form-geofence-heading">update geofence</h2> <?php include_once'./import.php';?> <?php include_once'./connectionusers.php'; /*** query database ***/ $sql=pg_query("select name geofence"); echo "<select name='category_id'>";

node.js - MEAN Stack: How to handle internationalization in front end error messages? -

i using mean stack (mongodb, express, angular, nodejs) develop application. render html in different languages using i18n-2 node module. but, have front end error messages (like validation errors - eg. invalid email). these messages appear based on user actions. how can these messages internationalized? one approach can think of use hidden elements in jade / html , pull out same in angular / javascript. alternatively, can pass ng-init variables in jade file , pull out appropriate message @ runtime in angular controller. is above approach ok? or there other best practice this? take @ angular translate module: http://angular-translate.github.io/

utf 8 - View Japanese Characters in MySQL Workbench -

Image
i tried this solution says alter table title character set utf8 collate utf8_unicode_ci; ok here screen shots might you. update here's happens when insert japanese characters. update 2 show create table gives this create table `productinfo` ( `pid` int(11) not null auto_increment, `poperation` varchar(40) character set latin1 default null, `year` year(4) default null, `season` varchar(10) character set latin1 default null, `pname` varchar(40) character set latin1 default null, `category` varchar(40) character set latin1 default null, `margin1` text character set latin1, `margin2` text character set latin1, primary key (`pid`) ) engine=innodb auto_increment=12 default charset=utf8 collate=utf8_unicode_ci just see default charset=utf8 collate=utf8_unicode_ci but see query select character_set_name, collation_name information_schema.columns table_schema = 'trac_data' , table_name = 'productinfo' , column_name = 'po

java - h:commandButton not invoked when nested into own component extending UIData -

i have seen answer balusc , solution changing scope, tried , think there yet problem seems not solvable using jsf2. i have created custom component extends uidata. custom component displays table rows of data, called pagingdatatable. cotains pagingdatacolumns can clicked , sort ordering changed etc... this works fine, add h:commandbutton inside pagingdatacolum, action of button not invoked. let me explain this: it works when using nested f:ajax element but not work when defining action in h:commandbutton without nesting in special case don't want use ajax it. debugged , found out mismatch in mojarra implementation of buttonrenderer class (method wasclicked). inside method, checked whether button clicked, , check done according id (actually name, id). uidata components have 2 different ids: id rowindex when rowindex exists, e.g. while rendering id without rowindex when rowindex not exist, e.g. when user clicks button so wasclicked() tries find id without rowind

.net - http.sys & response time logging -

we've .net based self hosting web api service. we're self hosted don't have requests logging/response time logging sinse iis feature. so, question how requests logging/response time when using pure self hosting scenario (http.sys). cannot implement logging on .net level because response time not include gc time. have real response time number has logged out of .net process, i'm wondering if etw can used. thanks regards! answering myself. seems way possible log http.sys activities using event tracing windows (etw), here 3 related articles: https://blogs.msdn.microsoft.com/wndp/2007/01/18/event-tracing-in-http-sys-part-1-capturing-a-trace/ https://blogs.msdn.microsoft.com/wndp/2007/01/25/event-tracing-in-http-sys-part-2-anatomy-of-an-event/ https://blogs.msdn.microsoft.com/wndp/2007/02/01/event-tracing-in-http-sys-part-3-typical-request/ https://msdn.microsoft.com/en-us/library/windows/desktop/cc307237(v=vs.85).aspx

Matlab plot ksdensity without first storing its arguments -

in matlab, if want plot density of variable v have do [x, y] = ksdensity(v); plot (y, x); if plot(ksdensity(v)) , plots x , not x vs y . is there easier alternative give ksdensity() argument plot() , same job plot(y, x) ? you can refactor function takes in v , plots y vs x : function h = plot_ksdensity(v, varargin) [x, y] = ksdensity(v); h = plot (y, x, varargin{:}); end using varargin means still have access plot options colours. hold on still work because calls regular plot function.

java - Cache entry is not removed from cache store (SingleFileCacheStore) -

i using singlefilecachestore . have set maxentries 0 passivation disabled <persistence passivation="false" > <singlefile fetchpersistentstate="true" preload="true" ignoremodifications="false" purgeonstartup="false" maxentries="0" > </singlefile> </persistence> in application firing cache.remove(key) , still see entries in underlying file. any clue, whats wrong? need call api. the space entry marked , reused new or updated entries. see old data, until new written. when purge processed file truncated / shrinked. singlefilecachestore implementation simple, happens if there free space @ end of file. there no compaction if have free space somewhere in middle of file. not perfect, quite enough, since there fluctuation in entries within cache. means, if force purge file may not truncated, when there free space. se

html - Using Polymer attributes within brackets -

hello trying use polymer attributes in css. this code: background: url( {{ image }} ); but doesn't seem work , outputs url('%7b%7b%20image%20%7d%7d'); i don't think polymer supports template binding within <style> tag. instead use inline style attribute on element, or add imagechanged handler , use cssom edit stylesheet.

dynamics crm 2011 - CRM2011 Unable to retrieve Lookup Filter selected Values in Javascript -

Image
here scenario: i have added ribbon button on contact form. on clicking, loads modal dialog shown below: when click on custom lookup icon button on modal dialog, launch lookup filter window using code below: function openlookup() { var objectcode = "2"; var url = serverurl+"/_controls/lookup/lookupinfo.aspx? allowfilteroff=1&defaulttype=1&defaultviewid={a9af0ab8-861d-4cfa-92a5- c6281fed7fab}&disablequickfind=0&disableviewpicker=0&lookupstyle=single&shownewbutton=1&show propbutton=1&browse=false&currentobjecttype=2&currentid={7d2d14ae-7ee1-e311-b136- 00155d02101e}&objecttypes=1%2c2"; var lookup = window.open(url, null, "width=500,resizable=1,height=400,menubar=0,status=1,location=0,toolbar=0,scrollbars=1", null); if (lookup != null) { var selectedval = lookup.items[0].name; } } when parse resultant object lookup , not have variable items . unable retrieve selected

c# - Template'd Interfaces Conflicting -

i wondering if there clever trick achieve below code without iusecase<in tinput> , iusecase<out touput> conflicting or simulate these cases. public interface iusecase<in tinput, out toutput> { toutput execute(tinput input); } public interface iusecase<in tinput> { void execute(tinput input); } public interface iusecase<out toutput> { toutput execute(); } seems cannot declare 2 generic interfaces same name different template constraints, although cannot find proof in msdn , c# language specification. compiler emit 'already contains definition' error if 2 types differ covariance modifier, or type constraint. example, following sample not compile well, although generic type have different constraints: public interface ifoo<t> t : class { t bar(); } public interface ifoo<t> t : struct { void bar(t x); } but types considered different if number of generic parameters different. so answer question - no

javascript - JQuery Monthpicker - Displaying the previous two months as options -

i saw jquery monthpicker helped me. jquery ui datepicker show month year only but need monthpicker display last 2 months in options, apart current month. eg. since current month june 2014, monthpicker should display may , april 2014, apart june. can me out here? set mindate , maxdate properties on object being passed argument datepicker function: $("#picker").datepicker({ mindate: "-2m", maxdate: 0, changemonth: true, changeyear: true, showbuttonpanel: true, dateformat: 'mm yy', onclose: function(datetext, inst) { var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); $(this).datepicker('setdate', new date(year, month, 1)); } }); js fiddle: http://jsfiddle.net/arftr/1/

c - How to print star pattern using only 2 for loops -

i want print pattern [half diamond shape] * * * * * * by using 2 loops easy print pattern using 3 loops #include<conio.h> #include<stdio.h> void main() { clrscr(); int i,j,k; for(i=0;i<3;i++) //loop number of lines { for(j=3;j>i;j--) // loop printing _ { printf(" "); } for(k=0;k<=i;k++) // loop printing *_ { printf("* "); } printf("\n"); } getch(); } so plz me...... int i,j; for(i=0;i<n;++i){ printf("%*s", n-i-1, "");//field width specification for(j=0;j<=i;++j){ printf("*"); if(j<i) printf(" "); } printf("\n"); } #define n 3 ... char line[(n-1)+1+2*(n-1)]={0};//pre , *, "* "*(n-1) int i,j,k; for(k=0, i=n-1;k<n;i+=2,++k){ line[i] = '*'; for(j=k;j<=i;++j){ putchar(line[j] ? line[j] : ' ');

jquery - How to hide & disable Expand/Collapse button of JqGrid GroupingView -

i new jqgrid, using groupingview functionality of jqgrid. shows collapse/expand button each group & on click of it hides/shows grouped items inside it. want hide & disable collapse/expand button. please find jsfiddle link http://jsfiddle.net/564rp/25/ please me. in advance... enter code here you can hide collapse / expand button adding below script @ bottom of document.ready function : $(document).ready(function() { ... code .. ............... $('.tree-wrap-ltr').hide(); }); demo

Custom XmlSerializer for some types not working in ASP.NET Web API 2.1 -

asp.net web api not invoke xmlserializer registered mytype below - when place breakpoints in either of myserializer method not heat. globalconfiguration.configuration.formatters.xmlformatter.usexmlserializer = true; globalconfiguration.configuration.formatters.xmlformatter.removeserializer(typeof(mytype)); globalconfiguration.configuration.formatters.xmlformatter.setserializer<mytype>(new myserializer()); myserializer implemented below - public class myserializer : system.xml.serialization.xmlserializer { public override bool candeserialize(system.xml.xmlreader xmlreader) { return base.candeserialize(xmlreader); } protected override system.xml.serialization.xmlserializationreader createreader() { return base.createreader(); } protected override system.xml.serialization.xmlserializationwriter createwriter() { re

angularjs - Passport google authentication with javascript fullstack -

i'm trying add google authentication passport in application, has been generated using yeoman fullstack-generator. inside login controller have request: $scope.googleauth = function(){ $http.get('/auth/google'); }; but when call function have error: xmlhttprequest cannot load https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=h…d=<my-client-id-here>. no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:9000' therefore not allowed access. i tried fix problem adding middleware layer in express.js file: app.use(function (req, res, next) { // website wish allow connect res.setheader('access-control-allow-origin', 'http://localhost:9000'); // request methods wish allow res.setheader('access-control-allow-methods', 'get, post, options, put, patch, delete'); // request headers wish allow res.setheader('access-control-allow

How to add facebook login to Python Django Project? -

i want build django application have simple button "login using facebook" , redirects facebook page allowing log in facebook username , password . when user clicks "login" . should redirect me defined url can display user's public information profile. how can achieved ?? 4shared.com allows login facebook . want want display public information of user. you should take @ of existing oauth libraries django. i'm using allauth , , can recommend it, though documentation bit lacking. here's tutorial helped me lot when starting out: http://www.sarahhagstrom.com/2013/09/the-missing-django-allauth-tutorial/ as how display facebook user's public information, should consult facebook graph api

Load Silverlight combo-box with data from a Entity Model in Host ASP.NET MVC application -

i have particular scenario has defied attempts made @ handling it. have silverlight application hosted in asp.net mvc application. asp.net application has ado.net entity model connects database. a combo box on silverlight page has combo box should loaded data when asp.net page hosts silverlight application loads. data should contain should come data in asp.net application hosts silverlight app. i thought of putting data in session within asp.net app's controller action returns view hosts silverlight app, hoping load in load method of silverlight app sessions not exist in silverlight. i have equally tried wcf, data services, wcf ria library, domain service class , kept getting error "an error occured while trying download service info". please best way achieve this? thank you. here found material through these links: http://social.msdn.microsoft.com/forums/silverlight/en-us/cc195a53-f596-43de-9d99-8d6a6ed1ced0/how-to-serialize-a-object-to-xml-in-silver

java - save JTable column data -

i'm passing values selected values 1 table selected row of other. int tablerow = table.getselectedrow(); int tablecolumn = table.getselectedcolumn(); int table_1row = table_1.getselectedrow(); int table_1column = table_1.getselectedcolumn(); int table_2row = table_2.getselectedrow(); int table_2column = table_2.getselectedcolumn(); if(tablerow > -1 && tablecolumn > -1){ object obj = table.getvalueat(tablerow, tablecolumn); jtable.setvalueat(obj, post, 4); } else if (table_1row > -1 && table_1column > -1){ object obj1 = table_1.getvalueat(table_1row, table_1column); jtable.setvalueat(obj1, post, 4); } else if (table_2row > -1 && table_2column > -1){ object obj2 = table_2.getvalueat(table_2row, table_2column); jtable.setvalueat(obj2, post, 4); what want save values @ column 4 of second table. int tablerow = table.getselectedrow(); object obj = panel.gettable().getmo

ios - How do I solve this Automatic Reference Counting (ARC) conflict? -

i have uiviewcontroller requires facebook login button present in screen. now, facebook ios button requires arc off. on other hand, in same uiviewcontroller using nstimer show few photos slideshow @ background - feature requires arc setting. so, have single file requires arc 1 of components, while not other. the exact problem in code: -(void)handletimer { [uiview transitionwithview:imageview duration:3 options:(uiviewanimationoptiontransitioncrossdissolve | uiviewanimationoptioncurveeaseinout) animations:^{ imageview.image = [uiimage imagenamed:[myimages objectatindex:imageptr]]; } completion:nil]; if(imageptr == (myimages.count) - 1) imageptr = 0; else imageptr = imageptr + 1; } if disable arc file has code, throws error @ line: imageview.image = [uiimage imagenamed:[myimages objectatindex:imageptr]]; the error reads: thread 1 : exc_bad_access (code=exc_i386_gpflt) actually, have time see above, continuously update ima

javascript - How to make default focus on the search bar on a web page, as Google does -

i trying make website. completed, few details done. i have small problem , wasn't able find solution on internet. when index page on site loaded want focus on search bar automatically, person can load page , start typing in order search. the site has jquery library included. you can accomplish using autofocus attribute: <input type="text" name="searchbar" autofocus />

python - Import function from module without losing module identifier -

this question has answer here: difference between various import statements in python 1 answer i'm looking way import single function module, without losing module name function name. example, from os import remove leaves me function called 'remove'; it's not clear, elsewhere in code, comes os module. however, throws syntax error: from os import remove os.remove this satisfactory (and possible): from os import remove os_remove but again it's not clear comes os module; lovely keep dot in if possible why want this? well, here premises led me investigate - if can tell me of these flawed excellent thing learn in itself: if you're going use 1 function module, it's more efficient import import whole module. if using, say, os.remove in code, it's clearer labelled such, it's transparent else function , how behave. of co

Multiple array to PHP Object -

i'm struggeling few ours fugure out how this. have array this: array (size=2) 0 => array (size=14) 'nr comanda' => string '251729' (length=6) 'descriere' => string 'so_dk35' (length=7) 'cod articol' => string '77a.02.03' (length=9) 'pack sscc' => string '012345000168970576' (length=18) 'pack greutate' => string '12.04' (length=5) 'pack tare' => string '0.49' (length=4) 'pack gross' => string '12.53' (length=5) 'pack nominal' => string '12.04' (length=5) 'lot' => string '4150' (length=4) 'data expirare' => string '8/30/2014' (length=9) 'data productie' => string '5/30/2014' (length=9) 'palet sscc' => string '212345000011125386' (length=18) 'palet tare' =>

clang - How to fix missing libs while compiling with llvm-config? -

i'm trying compile code uses llvm/clang api compile 'hello_world' llvm ir: #include <iostream> #include <clang/driver/compilation.h> #include <clang/driver/driver.h> #include <clang/frontend/textdiagnosticprinter.h> #include <llvm/support/host.h> #include <llvm/support/program.h> #include <llvm/support/raw_ostream.h> using namespace std; using namespace clang; using namespace clang::driver; int main(int argc, char** argv) { std::cout << "starting ----" << std::endl; // [clang -s -emit-llvm ./test/hello_world.cpp] // arguments pass clang driver: // clang getinmemory.c -lcurl -v // path c file string clangpath = "clang"; string inputpath = "./test/hello_world.cpp"; string outputpath = "hello_world.ll"; vector<const char *> args; args.push_back(clangpath.c_str()); args.push_back("-s"); args.push_back("

doctrine2 - Caching configuration in ZF2 & Doctrine 2 -

Image
i try build simple application using zend framework 2 , doctrine 2 . decided use yaml config files doctrine.yml file follow: driver: application_entities: class: 'doctrine\orm\mapping\driver\annotationdriver' cache: 'array' paths: - '__dir__/../src/__namespace__/entity' orm_default: drivers: 'application\entity': application_entities authentication: orm_default: object_manager: 'doctrine\orm\entitymanager' identity_class: 'application\entity\user' identity_property: 'login' credential_property: 'password' configuration: orm_default: metadata_cache: 'array' query_cache: 'array' now, question is: cache config proper? , how can verify it's working? of course know should use better driver simple array moment it's enough me. doctrine provide

java - How to click on the first record if the search records are more than one? -

how can check using selenium web driver either search result exists or not. e.g while searching record in amzon.de you don't have deal result_count if interested in first element. need select it, using right xpath. first result has id="result_0" this should work: //div[@id="result_0"]/h3/a/span

scala - sbt - independent build definitions -

introduction problem : i have project uses akka , spray logically consists of 2 parts a , b . in final version both of them work together, exchange messages etc. @ moment have implemented functionality of part b , whole part a . if run sbt compile not strangely errors refer part b only. question : is possible define rule sbt compile modules build part a exclusively ? $ cd /path/to/project $ sbt > projects [info] in file:/path/to/project [info] * root [info] [info] b > project [info] set current project (in build file:/path/to/project/) > projects [info] in file:/path/to/project [info] root [info] * [info] b > compile

gruntjs - How do i run different sass sub tasks depending on what watched files have changed? -

is there way watch different sets of files , run different tasks based on set have changed? the reason ask because working several separate sites different countries (uk,us, french, german). core sass in uk folder, there separate french, german , folders sass overrides core css in. my grunt file looks so: module.exports = function(grunt) { grunt.initconfig({ pkg: grunt.file.readjson('package.json'), watch: { files: ['../style/v4/sass/**/*.scss', '../../us/style/v4/sass/**/*.scss', '../../france/style/v4/sass/**/*.scss', '../../germany/style/v4/sass/**/*.scss'], tasks: ['sass:uk'], options: { spawn: false }, }, sass: { uk: { options: { style: 'compressed', sourcemap: true, compass: true }, files: {'..

ios - GHUnit sumbols for arm64 missing -

i try run ghunit on device , receive following compile error. ld: warning: directory not found option '-l/users/gtaskos/documents/projects/my/sdks/my ios sdk/my-ios/pods/build/debug-iphoneos' ld: warning: ignoring file /users/gtaskos/documents/projects/my/sdks/my ios sdk/my-ios/frameworks/ghunitios.framework/ghunitios, missing required architecture arm64 in file /users/gtaskos/documents/projects/my/sdks/my ios sdk/my-ios/frameworks/ghunitios.framework/ghunitios (4 slices) undefined symbols architecture arm64: "_objc_metaclass_$_ghasynctestcase", referenced from: _objc_metaclass_$_myminttests in myminttests.o "_objc_class_$_ghasynctestcase", referenced from: _objc_class_$_myminttests in myminttests.o "_objc_class_$_ghtesting", referenced from: objc-class-ref in myminttests.o "_ghcomposestring", referenced from: ___38-[myminttests testgetdetailsasync]_block_invoke in myminttests.o ___38-[myminttes

Native application crashes on Android L -

i have native application worked on android kitkat both dalivik , art runtimes, crashes on android l following trace: e/art(12810): dlopen("/data/app-lib/com.mylib.example", rtld_lazy) failed: dlopen failed: cannot locate symbol "issetugid" referenced "mylib.so"... d/androidruntime(12810): shutting down vm e/androidruntime(12810): fatal exception: main e/androidruntime(12810): process: com.mylib.example, pid: 12810 e/androidruntime(12810): java.lang.unsatisfiedlinkerror: dlopen failed: cannot locate symbol "issetugid" referenced "mylib.so"... e/androidruntime(12810): @ java.lang.runtime.loadlibrary(runtime.java:364) e/androidruntime(12810): @ java.lang.system.loadlibrary(system.java:610) is art runtime in android l different kitkat? there no new ndk available yet, therefore, how avoid crash, because seems function issetugid no longer supported. the issue has been fixed in final android 5.0 release. there no ne

MySQL queries, selecting field from one of many databases -

i have remarks table can linked number of other items in system, in case of example we'll use bookings , enquiries , referrals . thus in remarks table have columns remark_id | datetime | text | booking_id | enquiry_id | referral_id 1 | 2014-06-28 | abc | 0 | 8 | 0 2 | 2014-06-27 | def | 3 | 0 | 0 2 | 2014-05-31 | ghi | 0 | 0 | 10 etc... each of item tables have field called name . when want select remark likelihood i'll need name. i'd achieve single query, getting 2d array follows: ['remark_id'=>1, 'datetime'=>'2014-06-28', 'text'=>'abc', 'name'=>'harold'] however query i'd expect use be select r.remark_id,r.datetime,r.text ,b.name book,rr.name referral,e.name enquiry remarks r left join bookings b on b.book_id=r.book_id left join referrals rr on rr.referral_id=r.referral_id left join enq

Send email using the GMail SMTP server from a Unix weberver website using php -

This summary is not available. Please click here to view the post.

php - Fetching Data from DB using PDO with Class -

why first sets of data displayed , not entire data? here code..(sorry, still new oop) include 'crud.php'; $db_host = "localhost"; $db_name = "crud"; $db_username = "root"; $db_password = ""; $conn = new pdo("mysql:host=$db_host;dbname=$db_name", $db_username, $db_password); $select = new crud($conn); $select->crud_select(); crud.php class crud { private $conn; public function __construct($conn){ $this->conn = $conn; } public function crud_insert($lname, $fname, $address, $age){ } public function crud_select(){ $result = $this->conn->prepare("select * personal_info"); $result->execute(); $count = $result->rowcount(); if($count == 0){ $no_files = "no file(s) found!"; echo $no_files; } else{ $row = $result->fetch(); echo $row['last_name'] .

sql server - Combine tables into one table -

i have 2 tables, each 1 has 'date','time' , 'id' columns , 100 columns that's represents counters, have master table contains 'date','time' , 'id' columns plus has counters exited in other 2 tables. i need way update master tables 4 tables, below: table 1 date,time,id,counter_a,counter_b 01012014,00:00:00,1,10,20 01012014,00:00:00,2,7,8 21012014,00:00:00,1,3,1 table 2 date,time,id,counter_c,counter_d 01012014,00:00:00,1,30,40 01012014,00:00:00,2,5,9 21012014,00:00:00,1,4,2` master table date,time,id,counter_a,counter_b,counter_c,counter_d 01012014,00:00:00,1,10,20,30,40 01012014,00:00:00,2,7,8,5,9 21012014,00:00:00,1,3,1,4,2 i tried dynamic sql insert it's takes long have 100,000 row in each of table 1 , table 2 , times it's timeout expiry error. by way daily updates (tables 1 , table 2) csv files, there way update master table out taking time. more detail: hi, thank answer, let me explain more:

javascript - Icons in HTML and CSS as a code (eg: &#xe348;) -

i participate on project displayed icons this: <span class="streamline" aria-hidden="true" data-icon="&#xe006;">some label</span> the project in ruby on rails, thought icons saved in /assets folder, they're not there. in css files, see this: .streamline[data-icon]:after, .filtericons[data-icon]:before, .slicons { font-family: 'streamline'; content: attr(data-icon); speak: none; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; margin: 0 5% 0 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } how icons works? need add new icon, not sure @ how system of displaying icons working - it's thing of css? thank you the data-icon referencing character within icon font streamline . @ top of stylesheet: @font-face { font-family: streamline; src: url( /* url .eot file */ ) format("embedded-opentype"), url

file upload - Is there a possibility to call native dialog from Phonegap / Cordova? -

i'm using phonegap / cordova media capture plugin send photo php server, , works perfectly. nevertheless, had create 2 buttons: upload photoalbum, take new picture. said works, have 1 button open native dialog 2 options (same works in mobile safari, white - blue styled dialog in ios7). possible? i know there phonegap / cordova plugin show native dialog, see confirmation dialog , require more buttons inside. have looked @ navigator.notification.prompt? https://github.com/apache/cordova-plugin-dialogs/blob/master/doc/index.md the prompt dialog lets specify buttons/button labels want , callback deal user's input.

CSS Flexbox: filling blank space between vertical elements -

Image
i have problem flexbox: have html: <div class="panel-body"> <div class="project"> </div> <div class="project"> </div> <div class="project"> </div> <div class="project"> </div> <div class="project"> </div> </div> you idea... now, want this: |project| |project| |project| |project| |project| |project| |project| |project| |project| etc.. but, projects taller others. year ago managed put them nicely isotope.js plugin, this: as can see, item "5555" right after "nexus 5", , same "44444" , "nexus 7". the question is, how can flexbox? possible? my current css code: .panel-body{ display: flex; flex-wrap: wrap; align-items: flex-start; } .panel-body .project { flex-grow: 1; flex-shrink: 1; flex-basis: 300px; margin: 1px 10px; } and how lo

php - How to add DKIM signature to email header in zend framework -

i using zend framework develop website. in development process, getting issue add dkim signature in receiving email headers. have tried many ways solution still struggling them. so please provide me solution this. many in advance. regards, sachin if project uses zf 2, there module https://github.com/fastnloud/zf2-dkim

java - How to convert String timestamp to milliseconds -

i running 1 query on oracle sql returns me timestamp part of of sysdate in string "16:30:0.0" want know how convert milliseconds. please help? this using standard java date api. dateformat df = new simpledateformat("hh:mm:ss.sss"); df.settimezone(timezone.gettimezone("utc")); df.parse("16:06:43.233").gettime(); if you're using java 8, see new java.time api. if not, , you're going lot of date-time-related work, see jodatime

javascript - Jquery check for existence of textbox and validate -

i have 1 textbox date, 1 dropdown list, 3 text box input values. depends on condition either 2 or 3 text boxes displayed, text box date , dropdownlist common both conditions. of them including date textbox , dropdownlist mandatory fields. if user clicks button need check whether entered required fields or not, need check results. if missed enter of required fields should display missed field red border-color. my code: $("#btncheck").click(function(){ //this "validate" function check , if required field missing change border-color of element validate(date, firsttextbox, secondtextbox, thirdtextbox, dropdownvalue); if (date.length > 0 && firsttextbox.length > 0 && secondtextbox.length > 0 && dropdownvalue != "") { //it call ajax function } }); function validate(date, firsttextbox, secondtextbox, thirdtextbox, dropdownvalue) { $("#txtdate, #txt1, #txt2, #ddlvalue").css("border-color", "

sql - Regular expression Oracle -

i learning use regular expressions , i'm using them limit results of search query using regexp_like in oracle 11. placing example of data available, have following: plan navegación 200 mb plan navegación 1 gb plan navegación 1 gb plan de navegacion 3g plan de navegacion 4g plan de navegacion 3g empresarial plan de navegacion 4g empresarial plan de servicios 3g plan de servicios 4g plan navegación datos i want result limited following (only 3g, 4g): plan de navegacion 3g plan de navegacion 4g plan de navegacion 3g empresarial plan de navegacion 4g empresarial i using following search pattern did not filtered results: upper(plan_gsm),'(navega){1}|(3g|4g|5g)' upper(plan_gsm),' ((navega)+) (3g|4g)+' i have done several tests , not find solution. give me hints? you use like, below: select * mytable plan_gsm 'plan de navegacion _g%'; or use regexp_like, below: select * mytable regexp_like(plan_gsm, '^plan de navegacion (3|4|5)