Posts

Showing posts from August, 2011

hadoop - Downloading list of files in parallel in Apache Pig -

i have simple text file contains list of folders on ftp servers. each line separate folder. each folder contains couple of thousand images. want connect each folder, store files inside foder in sequencefile , remove folder ftp server. have written simple pig udf this. here is: dirs = load '/var/location.txt' using pigstorage(); results = foreach dirs generate download_whole_folder_into_single_sequence_file($0); /* don't need results bag. dummy bag */ the problem i'm not sure if each line of input processed in separate mapper. input file not huge file couple of hundred lines. if pure map/reduce use nlineinputformat , process each line in separate mapper . how can achieve same thing in pig? pig lets write own load functions , let specify inputformat you'll using. write own. that said, job described sounds involve single map-reduce step. since using pig wouldn't reduce complexity in case, , you'd have write custom code use pig, i'd sug...

Java - Find maximum number of duplicates within an array -

i utilizing hashset finding maximum number of duplicates of value in sorted integer array. algorithm doesn't seem work, not returning desired results. set variables storing number of duplicates found (0), , maximum number of duplicates (0). set hashset stores unique values of array. sort array ready comparison. loop through each value of array if hashset of unique values contains current value: increment duplicate count if currentvalue not equal previous value: if duplicatecount greater maximum count: maximumcount becomes duplicatecount reset duplicatecount 0 java code : hashset<integer> uniquevalues = new hashset<integer>(valuesequencelist); int duplicatecount = 0; int maxcount = 0; arrays.sort(valuesequence); (int = 0; < valuesequence.length; i++) { if (uniquevalues.contains(valuesequence[i])) { duplicatecount++; } if (i > 0 && valuesequence[i] != valuesequence[i-1]...

sql server - T-SQL error handling with try catch rollback, error rows were deleted -

i have following construct. noticed erroneous rows error number > 0 being deleted @ end of while loop. don't understand have gone wrong error catching. need second commit in catch section commit update of error number? while @@fetch_status = 0 begin try begin transaction [...insert table here...] set @countrec = @countrec + @@rowcount update alarmtable set success = 0 recno = @recno commit transaction end try begin catch if @@trancount > 0 rollback transaction select @error = error_number() , @errormsg = error_message() update alarmtable set success = @error recno = @recno if @@trancount > 0 commit transaction end catch fetch next listofrecords @recno, @alarmcontent end /* while */ close listofrecords deallocate listofrecords delete alarmtable success = 0 removed commit transaction , error entries don't removed anymore. @kevchadders. ...

cakephp - Cake php multidimensional array -

i have array coming join query when debug found output. here code in controller $agetfeaturegigs = $this->gigs->getfeaturegigs(); $this->set('agetfeaturegigs', $agetfeaturegigs); $yourvalue='7'; foreach($agetfeaturegigs $key => $val) { $agetfeaturegigs[$key]['gigs']['manual'] = $yourvalue; } output array( (int) 0 => array( 'usersjoin' => array( 'action' => 'yes' ), 'gigs' => array( 'id' => '2', 'username' => 'nmodi', 'category' => 'creativity & designing', 'subcategory' => 'logo design', 'picture' => 'banner_logo1.jpg', 'video' => '', 'title' => 'i design 2 awesome logo design in 48 hours', 'delivery' =>...

call - getting the group name to the accoding pri port in asterisk -

i using sagoma 8 port card chan_dahdi.conf configure ports are ;autogenerated /usr/sbin/wancfg_dahdi not hand edit ;autogenrated on 2015-06-12 ;dahdi channels configurations ;for detailed dahdi options, view /etc/asterisk/chan_dahdi.conf.bak [trunkgroups] [channels] context=default usecallerid=yes hidecallerid=no callwaiting=yes usecallingpres=yes callwaitingcallerid=yes threewaycalling=yes transfer=yes canpark=yes cancallforward=yes callreturn=yes echocancel=yes echocancelwhenbridged=yes relaxdtmf=yes rxgain=0.0 txgain=0.0 group=1 callgroup=1 pickupgroup=1 immediate=no ;sangoma a108 port 1 [slot:4 bus:2 span:1] <wanpipe1> switchtype=euroisdn context=from-pstn group=1 echocancel=yes signalling=pri_cpe channel =>1-15,17-31 ;sangoma a108 port 2 [slot:4 bus:2 span:2] <wanpipe2> switchtype=euroisdn context=from-pstn group=2 echocancel=yes signalling=pri_cpe channel =>32-46,48-62 ;sangoma a108 port 3 [slot:4 bus:2 span:3] <wanpipe3> switchtype=euroisdn c...

php - Column value's string length reduced by one when the value has a Quote -

hi have table "comments" , here has field called "comment_text" , insert comment table $query="insert `comments` (`id`, `comment_text`, `date`) values ('', '".sprintf("%-70s",mysql_real_escape_string(ucwords(trim($strtitle63_5))))."', '$date')"; as can see setting comment length fix 70 characters (always original comment less 70 characters.) everything works fine unless insert value quote , if insert comment quote , in database table can see 69 characters . example : i insert these 2 comments comment 1 : "flat rate overlaps flat rate code" comment 2 : "claim details don't match bsi/bri guidelines" later when try check string length . comment 1 70 , comment 2 69. there reason ? every comment has quote gives me issue . :( . thanks in advance . update my code model function get_coc5_comment_details() { $this->db...

dictionary - Leaflet polyline not moving on drag/zoom -

Image
i'm using leaflet custom crs.simple projection. if draw polyline @ page load more or less drawn ok (although more accurate in firefox in chrome) if drag map polyline remains in same place of browser window, appears shifted respect of background map. example: initial load after drag map, map moves polyline remains in same place to add polyline i'm converting coordinates crs.simple projection. don't think there problem here every other map marker or text appears correctly ..... //initialize leaflet map map = l.map('map', { maxzoom: mapmaxzoom, minzoom: mapminzoom, zoomcontrol: false, crs: l.crs.simple //simple coordinates system }).setview([0, 0], mapmaxzoom); //set bounds of map current dimension var mapbounds = new l.latlngbounds( map.unproject([0, mapheight], mapmaxzoom), map.unproject([mapwidth, 0], mapmaxzoom) ); //load tiles map.fitbounds(mapbounds); l.tilelayer(mapdata.info.tiles+'/{z}/{x}/{y}.png', { ...

windows - why net use delete command returns question mark -

a filemaker script calls 'net use delete x:' command, return value '?'. knows mean? i suppose, using "send event" run "net use delete". more cmd usage filemaker. command should disconnect shared resource on network. '?' mean error filemaker not recognise. if should, ignore it. if not have check if connected resource , if network resource called correct name when disconnect. check permissions. best way debug make sure can run same commands in cmd.

debugging - Access global variables from Require.js in the Chrome Developer Console -

i creating asp.net single-page application, , have require.js config file runs on application start, referencing jquery, sammy.js, , knockout.js. have created shims 3 third-party libraries allow me access them on global level: require.config({ paths: { "jquery": "/scripts/jquery-2.1.4.min", "sammy": "/scripts/sammy-0.7.5.min", "knockout": "/scripts/knockout-3.3.0", "text": "/scripts/text", "appvm": "/scripts/app/appviewmodel" }, shim: { "jquery": { exports: "$" }, "sammy": { deps: ["jquery"], exports: "sammy" }, "knockout": { deps: ["jquery"], exports: "ko" } }, priority: ["text", "app"], }); define(["knockout...

ssas - MDX Query for T-SQL -

i new mdx, can please me mdx query below t-sql select count(distinct rf.patientid), (d.fiscalyearlong) fiscalyear [dbo].[referralfact] rf join [dim].[date] d on rf.referraldateid = d.dateid group d.fiscalyearlong order fiscalyear desc without example of available within cube pure guesswork, might following: select [measures].[numpatientid] on columns, [date].[calendar].[calendar year].members on rows [yourcube]; a date dimension have ordering built in no need explicit use of mdx function order . also better if used measures calculated within cube, have assumed bi developer has created measure equivalent count(distinct rf.patientid) referenced using [measures].[numpatientid]

javascript - How to know if a certain Node is the Head of an HTML document? -

this question has answer here: is possible run script in context of webpage, before of webpage's scripts run, using chrome extension? 1 answer i'm working on chrome extension add features existing page. that, need add script page as possible !! (no, cannot run content script starts before everything, need particular script inserted into dom ) (why? because page loads everythin using ajax calls, , need able perform operations before calls) so intent add script sooner can after head of document appears. i'm looking @ mutationsobserver , , seems job. how can check if node addednodes collection head??? since looks maybe provided answer actual problem, i'll post answer. you can use chrome plug-in api directly intercept ajax requests using this: https://developer.chrome.com/extensions/webrequest

javascript - What is wrong with this particular AngularJS code? -

so learning angularjs via several online websites after having familiarized myself with, , learned, basic js, html, , css. found 3 simple learn having bit of issue angularjs. @ beginning have question why code inputting not returning desired result. have 2 windows (or files... not sure correct vocab here) open. js 1 titled main.js , index file titled index.html. in main.js have: var app= angular.module('myapp'),[]) app.controller('mycontroller', function($scope) { $scope.person = { name: "papa bear" }; }); in index file have: <!doctype html> <html ng-app='myapp'> <head> <script src='js/main.js'></script> </head> <body> <h2> hi there </h2> <div ng-controller='mycontroller'> {{ person.name }} </div> </body> <html> the "hi there" displays fine. {{ person.name }} (i certain) should return...

Mysql and PHP leaderboard acting strange -

i trying make leaderboard , sort data kills, when try make grabs name, kill, death doesnt grab when have grab works. know why? code below please assist. <?php $query = $koneksi->prepare("select * `player`"); $query->execute(); if($query->rowcount() == 0) i grabbing mysql data here, if change * data need no data displayed. echo "<tr><td colspan='6'><small>there's no player on ban list</small></td></tr>"; } while($data = $query->fetch()) { echo "<tr><td>".$data['name']."</td>"; echo "<td>".$data['kill']."</td>"; echo "<td>".$data['death']."</td>"; ...

How to change the value of each elmement in vector using iterator in C++ -

i wrote following program initialize vector of person . id of person objects not change. confuses me. can give me explanation? #include <iostream> #include <vector> #include <string> #include "person.h" using namespace std; int main() { vector<person>* pv = new vector<person>(5,person(0)); int = 0; for(person person : *pv) { person.id = i++; } for(person person : *pv) { cout<< person.id << endl; } return 0; } with person.h this #include <string> class person { public: int id; std::string name; person(int d); }; in loop need iterate reference or assigning id of copy of person in vector, not actual person in vector. for(person& person : *pv) { person.id = i++; }

linux - Infinite loop when simplifying fractions in binary in C -

i'm trying simplify fractions in binary code checks if value even: int is_even(floatlet value){ if(value & 1) return 0; return 1; } and while loop keeps bit shifting until value odd. while(is_even(numerator) && is_even(denomexp)){ numerator >>= 1; denomexp <<= 1; } the while loop goes on infinite loop. i'm wondering why? we've done test , is_even function works fine. thanks! your loop incorrect: should shifting demonexp right too. runs indefinitely numerator=0 , denomexp . if numerator , denomexp integer types, , number fraction numerator/denomexp , can fix code way: while (numerator && is_even(numerator) && is_even(denomexp)) { numerator >>= 1; denomexp >>= 1; } conversely, if denomexp power of 2 divide numerator, should increment instead, , maybe test overflow: while (numerator && is_even(numerator)) { numerator >>= 1; denomexp += 1; } you must pos...

c - int produces near correct answer, but float just gives -18.000 -

i wrote simple program convert degrees fahrenheit degrees celsius using functions (been working w/ python 2 weeks, wanted refresh myself): #include <stdio.h> #include <math.h> int temp_change(fahrenheit); int main() { while(1) { int fahrenheit; printf("please input temperature in fahrenheit.\n"); scanf("%d", &fahrenheit); //obtains degrees f value printf("%d\n", temp_change(fahrenheit)); } } //function change temperature int temp_change(fahrenheit) { int centigrade; centigrade = 5*(fahrenheit - 32)/9; //changing temperature return centigrade; } and gave me correct answers (to nearest degree). however, wanted exact answers, changed int s float s (except int main() . thing program give me -18.000000 , no matter input give it. best way summarize tried: tried different combinations of int s , float s no luck. suspect had printf("%d\n", temp_change(fahrenheit)); gave...

java - Access Variable of Activity from BaseAdapter -

i want access variable activity in baseadapter class whom set listview of activity. error: java.lang.nullpointerexception: attempt invoke virtual method 'java.lang.string java.lang.integer.tostring()' on null object reference these relevant parts of code: public class getallentryslistviewadapter extends baseadapter { integer markerid; pinboardactivity pinboard = new pinboardactivity(); public getallentryslistviewadapter(jsonarray jsonarray, context context) { this.dataarray = jsonarray; this.context= context; //i want markerid variable pinboardactivity: markerid = pinboard.markerid; inflater = (layoutinflater)context.getsystemservice(context.layout_inflater_service); } //... public cursor getlikes(dbhelper dbh) { //the following line 1 error occurs string args[] = {markerid.tostring(), pos}; //... } that because markerid null . check following line //i want markerid variable pinboardactivity: markerid = pinboard.ma...

c# - EDMX database mapping two procedures to the same ComplexType -

i creating .edmx mvc project. have mapped 2 procedures returns movies information database. the first procedure, getmoviesbyname, returns id , name. second procedure, getallmovies, returns id, name , createddate. i both procedures returns data complextype called movie. i instantiating mydbentities , trying use both procedures according condition in example below fails when variable islookingbyname true following message: a member of type, 'createddate', not have corresponding column in data reader same name. example: var db = new mydbentities(); if(islookingbyname) { return db.getmoviesbyname(name).tolist(); } return db.getallmovies().tolist(); so whenever condition true throws exception. thing cant change first procedure add createddate . just let guys know in view display 3 information id, name , createddate. when createddate null not displayed , fine that. someone knows how should proceed? thank much! the workaround use ado.net usin...

Detect if client is downloading using socket in java -

can use socket detecting if client downloading? want information file downloading. information ff: file name file size file type i tried researching on jnetpcap used packet , don't understand packets. as far know, can't detect if client downloading something, unless maybe intercept network traffic (you might need promiscuous mode). that'd difficult though.

jquery - Looping through unique json formatted data in Handlebars JS -

i ran problem attempting loop through json object. attempted made plenty sense , know why not working. here last attempt made make work. <script type="text/x-handlebars-template" id="partnertemplate"> {{#each partners}} <div>{{this.name}}</div> {{/each}} </script> here object i'm trying pull data from. partners = renderer({ cerner: { name: 'cerner', selected: false }, walmart: { name: 'walmart', selected: false } }); pretty want select name of current object #each iterating through. think this.name return 2 values (cerner, walmart). i figured out problem based on how data structured. i'm still not sure why "this.name" didn't work figured out way around it. instead of using base objects changed data array of objects. data = renderer({ partners: [ { name: 'cerner', ...

How can I add the override keyword to a large C++ codebase? -

i have large c++ codebase thousands of source files. want add override keyword wherever it's appropriate. of apparently-overridden functions not override function base class, , i'd catch these or @ least make them stand out. i tried doing manually, codebase large. tried using clang-modernize, doesn't come useful instructions. i'm concerned won't able comprehend codebase written visual studio. how can add override keyword codebase without spending man-weeks or more on task?

javascript - Oauth2 token response "invalid_grant" with JWT from GoogleAPI -

i have enabled service account google api console perform two-legged oauth making calls google analytics api. using javascript , have followed pure javascript implementation of jwt , jws generate signed jwt , make http/rest call token described in guide . once make post encodedurl 400 "error": "invalid_grant". "error_description": "bad request" i read posts sure include email , not client_id in request. made sure case , since google has updated documentation. any ideas? post code if necessary followed rothrock 's post @ link . i tried signed jwt on http://jwt.io/ , says it's invalid signature. payload , header decode correctly. there way test signature after encoding private key provided google api console? here code: var pheader = {"alg":"rs256", "typ":"jwt"}; var sheader = json.stringify(pheader); var pclaim ={}; pclaim.iss = "(serviceaccount_email_address).apps....

java - Android&SOAP I can't send and response the data -

i'm trying connect android soap use ksoap2 project. earlier compiled few project , work correct. wsdl file: http://pastebin.com/ajx08efe i checked using soapui - it's working. my fragment java code: http://pastebin.com/dqzu9vpm of course, ksoap2 library .jar added project. when run app, message: 07-01 23:57:29.193: e/myapp(7214): soapfault - faultcode: 'soap-env:server' faultstring: 'procedure 'getnamewithage' not present' faultactor: 'null' detail: null 07-01 23:57:29.193: e/myapp(7214): @ org.ksoap2.serialization.soapserializationenvelope.parsebody(soapserializationenvelope.java:137) 07-01 23:57:29.193: e/myapp(7214): @ org.ksoap2.soapenvelope.parse(soapenvelope.java:140) 07-01 23:57:29.193: e/myapp(7214): @ org.ksoap2.transport.transport.parseresponse(transport.java:129) 07-01 23:57:29.193: e/myapp(7214): @ org.ksoap2.transport.httptransportse.parseresponse(httptransportse.java:301) 07-01 23:57:29.193: e/myapp(7214): @ org....

python - skipping empty facets in seaborn facetgrid for annotations -

Image
i'm working on putting seaborn facetgrid data leaves grids empty. furthermore, i'm annotating each facet statistics, i'm not sure how "skip" empty facets annotations fall on proper facet. g.axes.flat of length 9 (9 facets have data); when place annotation on each element in g.axes.flat , isn't being placed expect. g = sns.facetgrid(mapping, col=options.facetcol, row=options.facetrow, col_order=sorted(cols), hue=options.group, sharex=false) g = g.map(sns.distplot, options.axis) # label each facet stats grouped = mapping.groupby([options.facetrow, options.facetcol]) ax, (name, df) in zip(g.axes.flat, grouped): df2 = df.groupby(options.group) # group each thing has own color , run stats on i, (group, data) in enumerate(df2): x = data[options.axis] # calculate stats , create label n = len(x) mean = np.mean(x) std = np.std(x) label = r"%s: n=%s, $\mu$=%.2f $\sigma$=%.2f" %(group, n, mea...

c# - Printing multiple files using process.start -

here have code opens adobe , causes print pdf file using process.start() . trying print multiple files (two different pdfs) using same command. how go this? have far: process profileprintprocess = new process(); profileprintprocess.enableraisingevents = true; profileprintprocess.startinfo = new processstartinfo() { createnowindow = true, verb = "printto", filename = "[" + proffilename + " " + contractfilename + "]", windowstyle = processwindowstyle.hidden, }; profileprintprocess.start(); i've been using link guide per question referenced similar issue. to print single file trough acrobat reader try , let me know if worked: system.diagnostics.process process = new system.diagnostics.process(); system.diagnostics.processstartinfo startinfo = new system.diagnostics.p...

Powershell variable is assigned the result of a function AND the parameter I passed to the function -

i'm running on , on in script. have line of code: $errors = get-deploymenterrors $uniqueid when runs, $errors assigned result of get-deploymenterrors , value of $uniqueid. want $errors assigned result of get-deploymenterrors. here get-deploymenterrors function: function get-deploymenterrors($uniqueid) { $errors = @() $conn = new-object -typename system.data.sqlclient.sqlconnection $conn.connectionstring = 'removed connection string' $cmd = new-object -typename system.data.sqlclient.sqlcommand $cmd.connection = $conn $cmd.commandtext = "removed sql statement" $cmd.parameters.addwithvalue("@uniqueid", $uniqueid) $conn.open() $reader = $cmd.executereader() if($reader.hasrows) { while ($reader.read()) { $error = new-object -typename psobject $error | add-member -membertype noteproperty -name stepid -value $reader["stepid"] $error | add-member -membertype noteproperty -name deploymentid -value $reader...

model - Native SQL in StrongLoop Loopback Server -

i have situation model in database not match model in api. specifically, products' api contains contract price, in separate table, , table has price specific each customer/product combination. outside of strongloop , typically solve custom/native sql, read in documentation such ill advised in strongloop. have other situations database model not efficiently represent api model, typically due legacy data definitions in databases. should go down path of custom/native sql anyway? if so, there examples and/or best practices should follow? if not, other ways should solve problem? it possible run native sql query in case, work issue. however, not warning on documentation page native sql docs here this feature has not been tested , not officially supported: api may change in future releases. in general, better perform database actions through connected models. directly executing sql may lead unexpected results, corrupted data, , other issues. you can f...

asp.net web api - Secure JSON Web Token in Web API / MVC 6 -

the security concerns: according https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ lot of jwt libraries use token in order determine algorithm signature. this our use case: want create login mechanism validates user hard credentials (username/password) , return jwt token e.g. 3 days lifetime. token should contain username , signature should guarantee token cannot "faked". what library can use in web api / mvc 6? important signature algorithm can specified on decoding avoid vulnerability. if possible avoid integrating complex oauth components. i using system.identitymodel.tokens.jwt library, , checked issue. generated token , validated in 1 of tests, removed signingcredentials changes alg none. jwt generated "alg":"none" failed validation . here how generating token: public string generatetoken(ssocontext context, signaturesettings settings) { var token = new jwtsecuritytoken( issu...

php - Moving CakePhp installation from internal dev server to local web server -

i have setup cakephp inside 1 of application , able run application's scaffolding code on internal development server @ port 8765. now want make use of local web apache web server. i checked documentation of cakephp. mentioned below you should able move cakephp install (including hidden files) inside webserver’s document root. should able point web-browser @ directory moved files , see application in action. i using apache server document root htdocs , can configured through httpd.conf. now according above statement have below queries (a) cakephp install files. have project created cakephp files. (b) project under htdocs contains cakephp files. point document root ? (c) how detach application code cake php install files ? regards, saurav

ruby on rails - activerecord_postgis_adapter: undefined method `point' for nil:NilClass -

problem 90% sure it's setup error on end, can't self.factory , trying access lonlat gives me exception "undefined method `point' nil:nilclass" i can set lonlat using: mfactory = rgeo::activerecord::spatialfactorystore.instance.factory(:geo_type => 'point') self.lonlat = mfactory.point(long, lat) self.save this gives me values 0101000020e610000061c3d32b65965dc03657cd7344f64040 in db. i can't use: self.lonlat = "point(#{long},#{lat})" self.save questions do need setup specific in model? i created github issue less consise more detailed explaination. rgeos depends on geos. error result of rgeos not being able load geos. to check if issue: $ rails c > rgeo::geos.supported? => false to check if have geos installed: geos-config --version if geos isn't installed: brew install geos if geos installed, fix installed rgeo: $ geos-config --prefix /usr/local/cellar/geos/3.5.0 $ gem install rge...

c - How to make ARM Eclipse for DS-5 aware of compiler predefined macros? -

i using arm eclispe ds-5 environment maintain , build command-line (makefile based) project. using eclipse's indexer analyze code intelligent browsing , editing, looks not recognize underlying arm c compiler 5 predefined macros. example, if have in code: #warning "xxxxxxxx im here 1 xxxxxxx" #ifdef __arm__ #warning "xxxxxxxx im here 2 xxxxxxx" #endif then when compiling module see first , second warnings ( the compiler aware of own __arm__ macro, of-course ). however, in editor, code in #ifdef block grayed out. consequently, have hundreds of false error indications in problems view. how can make environment aware of compiler built-in settings? * using arm ds-5 version 5.20, , armcc version 5.05 you can set eclipse c/c++ project properties: preprocessor include paths, macros. adding macros or preprocessor file helps understand compiler predefines/macros eclipse. note entries set on individual resource, such file or folder. open file or f...

r - Rotate stargazer table in knitr -

i using knitr write .rnw file , stargazer packages build tables regression outputs. part working quite rotate table 90 degrees able in latex using \usepackage{sidewaystable} outside of .rnw \documentclass{article} \begin{document} <<table1, echo=false, message=f, warning=f, results="asis">>= library(stargazer) lm1 <- lm(mpg ~ wt, data = mtcars) lm2 <- lm(mpg ~ hp, data = mtcars) lm3 <- lm(mpg ~ cyl, data = mtcars) lm4 <- lm(mpg ~ disp, data = mtcars) stargazer(lm1, lm2, lm3, lm4, title = "basic ols models", omit.stat = c("f", "ser")) @ \end{document} you can option float.env = "sidewaystable" in stargazer() \documentclass{article} \usepackage{rotating, graphicx} \begin{document} <<table1, echo=false, message=f, warning=f, results="asis">>= library(stargazer) lm1 <- lm(mpg ~ wt, data = mtcars) lm2 <- lm(mpg ~ hp, data = mtcars) lm3 <- lm(mpg ~ cyl, data = mt...

.net - Microsoft.ReportViewer.Common Version=12.0.0.0 -

i'm getting following exception in windows service application: system.io.filenotfoundexception: not load file or assembly 'microsoft.reportviewer.common, version=12.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91' or 1 of dependencies. system cannot find file specified. i cannot find download url version 12 , setting files "include" , "prequisite (auto)" not solve problem in windows service application, although works fine in winforms application , results in appropriate files being included , referenced along other requisite .dlls. can either me windows service application include files, or lead me download link install version 12 in gac? version 12 of reportviewer bits referred microsoft report viewer 2015 runtime , can downloaded installation following link: https://www.microsoft.com/en-us/download/details.aspx?id=45496 update: the reportviewer bits available nuget package: https://www.nuget.org/packages/mi...

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? -

what undefined reference/unresolved external symbol errors? common causes , how fix/prevent them? feel free edit/add own. compiling c++ program takes place in several steps, specified 2.2 (credits keith thompson reference) : the precedence among syntax rules of translation specified following phases [see footnote] . physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. [snip] each instance of backslash character (\) followed new-line character deleted, splicing physical source lines form logical source lines. [snip] the source file decomposed preprocessing tokens (2.5) , sequences of white-space characters (including comments). [snip] preprocessing directives executed, macro invocations expanded, , _pragma unary operator expressions executed. [snip] each source character set member in character literal or string literal, e...

java - How can I combine two methods that do the same thing but differ in type? -

i new java programming , although know basics feel though code long , unnecessary. i'm wondering if there way combine elkstarter() , foxstarter() methods 1 starter() method can reduce code. //opening question, askes user pick either elk or fox public void systemstart(){ for(int =0;i<=100;i++){ system.out.println("- - - - - - - - - - - - - - - - - -\n"); } system.out.println("***starting new movement model***\n"+"-----------------------------------\n"); iteration = 0; string animaltype = joptionpane.showinputdialog ("would elk or fox?"); switch (animaltype.tolowercase()){ case "elk": elkstarter("elk_1"); break; case "fox": foxtarter("fox_1"); break; default: joptionpane.showmessagedialog (null, "you didn't enter elk or fox..please try again."); runanothermodel(); ...

Groovy and Maven: CompileStatic with generics -

simple generic class in groovy @compilestatic class foo<t> { t member } and specific subclass works on lists of doubles. easy enough, right? @compilestatic class doublelistfoo extends foo<list<double>> { void bar() { println member.size() } } won't compile in maven: [error] doublelistfoo.groovy:[12,9] 3. error in doublelistfoo.groovy (at line 12) [error] println member.size() [error] ^^^^^^^^^^^^^ [error] groovy:[static type checking] - cannot find matching method java.lang.object#size(). please check if declared type right , if method exists. compiles fine within intellij. what's going on? maven version: mvn -version apache maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11t13:58:10-07:00) maven home: /usr/local/apache-maven-3.2.3 java version: 1.7.0_71, vendor: oracle corporation java home: /library/java/javavirtualmachines/jdk1.7.0_71.jdk/contents/home/jre default locale: en_us, platform encoding: utf...

regex - Rewriting URLs within the webpage with a subdirectory -

i've setup reverse proxy , using mod_rewrite rewrite urls. issue i'm facing urls in webpage go http://domainname.com/pagename however, want go http://domainname.com/dir/pagename i've tried bunch of rewrites none seem work. <virtualhost *:80> # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly. #servername www.example.com serveradmin webmaster@localhost documentroot /var/www/html # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customlog ${apache_log...

java - Rounded QuickContactBadge with text -

Image
i have listview quickcontactbadge , contact's name. problem badge square, , if contact not have image, blank. want circular picture or first initial of contacts in android lollipop: i tried solution this question, couldn't work. maybe implemented wrong? have: contactstab.java: public class contactstab extends listfragment implements loadercallbacks<cursor> { private customadapter madapter; private cursor mcursor; private string currentquery; private int midcolumn; private int mlookupkeycolumn; private uri mcontacturi; private quickcontactbadge mbadge; private static final string[] projection = { contacts._id, contacts.display_name_primary, contacts.lookup_key, contacts.photo_thumbnail_uri, contacts.has_phone_number, }; private static final string[] = { contacts.photo_thumbnail_uri, contacts.display_name_primary }; private static final int[] = { r.id.badg...

java - Null pointer exception: invoking virtual method -

i trying design basic chat app. app build without errors click button on emulator app crashes , log shows following error: 07-01 22:50:39.367 30016-30032/com.example.ibm_admin.chat e/buffer error﹕ error converting result java.lang.nullpointerexception: lock == null 07-01 22:50:39.367 30016-30032/com.example.ibm_admin.chat e/json parser﹕ error parsing data org.json.jsonexception: end of input @ character 0 of 07-01 22:50:39.370 30016-30016/com.example.ibm_admin.chat d/androidruntime﹕ shutting down vm 07-01 22:50:39.370 30016-30016/com.example.ibm_admin.chat e/androidruntime﹕ fatal exception: main process: com.example.ibm_admin.chat, pid: 30016 java.lang.nullpointerexception: attempt invoke virtual method 'int org.json.jsonarray.length()' on null object reference @ com.example.ibm_admin.chat.userfragment$load.onpostexecute(userfragment.java:84) @ com.example.ibm_admin.chat.userfragment$load.onpostexecute(userfragment.java:71) ...