Posts

Showing posts from July, 2014

ios8 - clang: error: unknown argument: '-stdc++' -

Image
i getting error as clang: error: unknown argument: '-stdc++' what causes error?.how solve this?any appreciated.thanks in advance that option language specifier. missing = sign , language specifier comes after depend on version of language compiling for. example, targeting c++11 -std=c++11 the man page tool chain should document available supported languages.

windows - Script which displays a message if the subfolders aren't updated -

i need script displays message if subfolders aren't updated within 10 minutes. something like: /f %%i in ('dir /b/ad/od') set last=%%i echo %last% if %last% ten minutes without updating echo warning!!! %last% folder needs updating!

iron router - Meteor.user() login issue -

i testing restrict login function router code below var requirelogin = function() { if (! meteor.user()) { console.log("user not logged"); this.next() } else { console.log("user logged"); this.next() } } router.onbeforeaction(requirelogin, {except: ['home','login','about']}); when try enter restricted area userprofile ask me log in , print "user not logged" , after log in , try access area again. printing both code starts "user not logged" , "user logged" i want know how avoid happen? since page become glitched when happened. i want print "user logged" if enter restricted area page. any appreciated. you need integrate meteor.loggingin() somewhere in requirelogin function. because, what's happening meteor still loading user system , every route change, re-authenticates user based on current session, if exists. var requirelogin = function() { if(!m...

c# - View and Entity Framework data not right? -

i have view table when select view in sql server management studio works fine, when use entity framework data view it's different. returndbfortesentities1 db = new returndbfortesentities1(); list<vjobs2> list = new list<vjobs2>(); list = db.vjobs2.tolist(); same number of records last 2 rows different. i have table job applicant applicant can apply 2 jobs or more applicantid applicantname jobid jobname 1 mohamed 1 developer 1 mohamed 2 supporter but in list applicantid applicantname jobid jobname 1 mohamed 1 developer 1 mohamed 1 developer there subtle problem views when used entity framework. if have table, use ef, need have primary key uniquely identify each row. typically, that's single column, e.g. id or that. with view, don't have concept of "primary key" - view contains columns tables. so when ef maps v...

javascript - Heavy Images Not Uploading Ajax/Jquery, FormData is empty -

i running code working fine small size of images upto 2.5mb each image , form have take maximum of 8 imgaes when used images more 4mb more 1 in form sends blank $_post and $_files while if select 1 file of 6mb uploading fine, when upload multiple files sends me blank data @ server side. the form contains 8 input fields of file type [not multiple ones] $('#'+id+'_form').submit(function(e){ var formobj = $(this); var formurl = formobj.attr("action"); var formdata = new formdata(this); $.ajax({ url: formurl, type: 'post', data: formdata, mimetype:"multipart/form-data", contenttype: false, cache: false, processdata:false, success: function(data, textstatus, jqxhr) { if(data){ data = jquery.parsejson( data ); (var key in data) { ...

python - Merging Pandas DataFrames on categorical series -

i'm trying understand if pandas supports merging dataframes on columns of categorical data (i.e. dtype="category"). i of data work in r, trying more work in python/pandas. in r, merging on factors (analogous categorical dtype) induces type coercion, typically character. allows 1 data frame have by-variable (join column) specified factor (categorical) , other have by-variable string. pandas perform similar coercion of categorical data string prior merging/joining? should expect merging on categoricals robust? can find documentation on (automatic) type coercion in pandas? simple example: +++ error test categorical vector equality against non-categorical/non-scalar vector: in [52]: import pandas pd = pd.series(['a','b','c'],dtype="category") b = pd.series(['a','b','c'],dtype="object") c = pd.series(['a','b','cc'],dtype="object") in [54]: a==b ----------------...

openstack - How to Check whether dhcp-server exists for that subnet before creating a subnet -

i stuck neutron issue. i have 2 nodes namely controller , compute neutron component installed in controller node. restarted dhcp, l3 agent services. we using namespaces dhcp agent. created private network specifying provider network type flat. after before creating subnet want check if dhcp-server exists subnet. our subnet 10.88.210.0/24 try dhcp-discover sends dhcpinform request host on udp port 67 obtain local configuration parameters without allocating new address. dhcpinform dhcp request returns useful information dhcp server, without allocating ip address. request sends list of fields wants know (a handful default, every field if verbosity turned on), , server responds fields requested. should noted server doesn't have return every field, nor have return them in same order, or honour request @ all. linksys wrt54g, example, ignores list of requested fields , returns few standard ones. script displays every field receives. example usage nmap -su -p ...

ios - Retrieve Random String from Core Data in Swift -

i've searched answer have come empty handed. reason i'm drawing blank on how retrieve random entry core data string attribute. have else working - create, update, delete... can't seem handle on getting random entry stack. feeling confused on this. here code table view controller manages core data. import uikit import coredata class taskmanagerviewcontroller: uitableviewcontroller, nsfetchedresultscontrollerdelegate { let managedobjectcontext = (uiapplication.sharedapplication().delegate appdelegate).managedobjectcontext var fetchedresultcontroller: nsfetchedresultscontroller = nsfetchedresultscontroller() override func viewdidload() { super.viewdidload() fetchedresultcontroller = getfetchedresultcontroller() fetchedresultcontroller.delegate = self fetchedresultcontroller.performfetch(nil) } override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject!) { if segue.identifier == "edit...

javascript - How to pass a prototype function name to another prototype function -

this question has answer here: dynamically access object property using variable 10 answers function car() { } car.prototype = { update1: function(s) { console.log("updated "+s+" update1") }, update2: function(s) { console.log("updated "+s+" update2") }, update3: function(s) { console.log("updated "+s+" update3") }, update: function(s, updatefn) { this.updatefn.call(this, s) } } var c = new car() c.update("tyres", 'update1') i want pass function name (update1 or update2 or update3) update function output should : updated tyres update1; http://jsfiddle.net/x8jwavje/ function car() { } car.prototype = { update1: function(s) { console.log("updated "+s+" update1") }, update2: function(s) { console.log("updated ...

android - How to use findPreference outside of PreferenceActivity? -

i'm trying gain access (custom) list preference , change selected value (i.e. if index 3 selected, change selection index 1). however, findpreference() can used inside preferenceactivity. need access preference , change selection inside regular activity. there way can done? don't see in sharedpreferences can use change selection, list preferences value. this how it, sharedpreferences prefs = preferencemanager.getdefaultsharedpreference(this); prefs.getstring(pref_key, "default");

c# - Can Someone explain meaning of this exception? Connection String, Table Name, query syntax are correct -

sqlcecommand cmd = new sqlcecommand("insert tbl_astatus (asset status,remarks) values (@a, @b)", login.sqlconn); cmd.parameters.addwithvalue("@a", txtassetstatus.text); cmd.parameters.addwithvalue("@b", txtremarks.text); int = cmd.executenonquery(); messagebox.show(a.tostring()); exception shown: there error parsing query. [ token line number = 1,token line offset = 32,token in error = status ] if table name or column names includes white space, need use them square brackets [asset status] . not recommended. better changing column name else if can. read: database, table , column naming conventions? also use using statement dispose database connections , objects. using(sqlcecommand cmd = login.sqlconn.createcommand()) { cmd.commandtext = "insert tbl_astatus ([asset status],remarks) values (@a, @b)"; cmd.parameters.add("@a", sqldbtype.nvarchar).value = txtassetstatus.text; cmd.parameters.add("@...

linker - CMake keeps linking to libraries under /usr/lib64 even full paths to another libraries are given -

i building package cmake (3.0.2). package relies on boost_python , others. there older version in /usr/lib64 , have newer version in own directory /home/x/opt/boost-1.56/lib. there symbol link /home/x/opt/boost-1.56/lib64 deal multi-arch gcc. however, if set boost_root=/home/x/opt/boost-1.56/lib , , in cmakecache.txt there //boost python library (release) boost_python_library_release:filepath=/home/x/opt/boost-1.56/lib/libboost_python.a the generated link.txt contains such line, instead of full path: -wl,-bstatic -lboost_python and when make , links 1 under /usr/lib64/, wrong. question: how make cmake use full path? documented, when libraries under system default folders dealt -bstatic, should not case. why -wl,-bstatic -lboost_python not work have "/home/x/opt/boost-1.56/lib" in ld_library_path , library_path ? limited knowledge should override system default. information: gcc --print-search-dir gives: /home/x/opt/boost-1.56/lib/x86_64-unknown-l...

Laravel and pivot table to relate different model -

i'm wondering how, it's bit confusing. i have fine belongs many relation between users , groups tables appropriate models of that. but have table students, not users student students table maintain user_id field. my question be: can use pivot table "group_user" relations between student , group model, in students table have "user_id" field? , how? i tried public function students() { return $this->belongstomany('student','group_user','group_id','user_id'); { but don't see way how tell eloquent not take students.id take students.user_id??? assuming these relations: subject belongsto group group belongstomany user user hasone student you can this: $subject = subject::find($someid); // of course multiple subject use eager loading: // $subjects = subject::with('group.users.student')->get(); $users = $subject->group->users; // related users foreach ($users $user) { $user-...

java - Displaying List elements in JSTL <c:/forEach> with counter variable -

Image
i have scriptlet for-loop displays movie schedules list<schedule> . <% @suppresswarnings("unchecked") list<schedule> schedulelist = (arraylist<schedule>) session.getattribute("schedulelist"); (int ctr = 0; ctr < schedulelist.size(); ctr++) { %> <tr> <td class="center"> <input type="radio" name="selection" value="<%=ctr%>" required title="please select schedule." /> </td> <td><%=schedulelist.get(ctr).getmallid()%></td> <td class="center"><%=schedulelist.get(ctr).getschedulecinema()%></td> <td>php <%=schedulelist.get(ctr).getscheduleprice()%></td> <td><%=schedulelist.get(ctr).getscheduledate()%></td> <td><%=schedulelist.get(ctr).getscheduletime()%></td> <td class="center"><%=sch...

playframework 2.0 - Why does "sbt run" fail with OutOfMemoryError while "activator run" works fine? -

i can start application activator run simple sbt run ends either outofmemoryerror or sudden termination of application. exception: java.lang.outofmemoryerror thrown uncaughtexceptionhandler in thread "play-akka.actor.default-dispatcher-2" if understanding right activator should delegate commands beside custom one's sbt. apparently, seems activator more. how can find difference? there mandatory jvm settings should set before running app sbt? my environment java 7, windows 7 , sbt 0.13.7 fundamentally, there's no difference. activator invokes sbt. little bit more though, includes sbt plugins provide ui , ability create new project templates. invokes sbt more sensible default jvm settings vanilla sbt invoker scripts, including more memory. how set better defaults depends on sbt invoker script you're using, , may depend on how installed sbt. scripts support sbt_opts environment variable, put -xmx1024m in example give sbt gig of heap space. m...

Input from variable and excel to oledb destination in ssis 2012 -

i have situation need data excel sheet , sql table store single sql server table. below steps have completed already, 1.in control flow, using execute sql task, fetched data sql , assigned variable. 2.then added data flow task in control flow. 3.in data flow added excel source , oledb destination. when trying edit oledb destination can able see excel sheet columns, how variables in oledb destination? or there other best approach ? you need add merge join control inside of data flow task. probably easier change execute sql task second data source within data flow task , join on key within merge join control. be warned merge join requires data sorted. if data sorted on input, can tell ssis setting input / output properties of advanced editor. otherwise, can add sort task after each data source.

apache - wamp server: set up virtual host -

i setting virtual host wamp server following tutorial http://www.kristengrote.com/blog/articles/how-to-set-up-virtual-hosts-using-wamp hosts file 127.0.0.1 localhost 127.0.0.1 dev.gamenomad.com httpd-vhosts.conf <virtualhost *:80> serveradmin webmaster@dummy-host.example.com documentroot "c:\wamp\www\dev.gamenomad.com\public" servername dev.gamenomad.com serveralias dev.gamenomad.com errorlog "logs/dev.gamenomad.com-error.log" customlog "logs/dev.gamenomad.com-access.log" common </virtualhost> <directory c:\wamp\www> order deny,allow allow </directory> httpd.conf # virtual hosts include conf/extra/httpd-vhosts.conf i unable access dev.gamenomad.com . got error i18n-values: missing value "primaryparagraph" http://dev.gamenomad.com/ net::err_connection_refused http://dev.gamenomad.com/:1 fyi, apache server listen port 8080 instead of default 80. aff...

Android button becomes small in Nexus 5 -

Image
i creating button dynamically particular screen. visible in emulator looking small in device (nexus 5). in emulator: in device: i using below code button creation in code: layoutparams updt_btn_params = new layoutparams(); update_data = new button(this); update_data.settext("update"); update_data.settextsize(9); updt_btn_params.width=80; updt_btn_params.height=45; updt_btn_params.gravity=gravity.center_horizontal; update_data.setonclicklistener(update_listnr); update_data.setlayoutparams(updt_btn_params); what else have getting buttons in device. tia the problem using these: updt_btn_params.width=80; updt_btn_params.height=45; with setting width , height in pixels, should never do. different devices have different pixel densities means size of pixels varies device device. nexus 5 has quite high pixel density makes buttons small. there 2 ways around this: 1. define values in dimen.xml in resources in resources there folder "values...

Make .csv files from arrays in Scala -

i have 2 tuples in scala of following form: val array1 = (bucket1, seq((datea, amount11), (dateb, amount12), (datec, amount13))) val array2 = (bucket2, seq((datea, amount21), (dateb, amount22), (datec, amount23))) what quickest way make .csv file in scala such that: date* pivot. bucket* column name. amount* fill table. it needs this: dates______________bucket1__________bucket2 datea______________amount11________amount21 dateb______________amount12________amount22 datec______________amount13________amount23 you can make shorter chaining operations, : scala> val array1 = ("bucket1", seq(("datea", "amount11"), ("dateb", "amount12"), ("datec", "amount13"))) array1: (string, seq[(string, string)]) = (bucket1,list((datea,amount11), (dateb,amount12), (datec,amount13))) scala> val array2 = ("bucket2", seq(("datea", "amount21"), ("dat...

c# - MVCSiteMapProvider with Webforms -

i have inherited hybrid mvc / webforms project, mvc portion uses mvcsitemapprovider create menus , webform portion uses custom built menu creation tool. i have created custom mvcsitemapprovider nodes , port whole mvcsitemapprovider used in webform portion of project. possible @ all? can suggest strategies wedging/hacking in webform code? thanks andy although in theory should have working interoperability webforms, knowledge hasn't been tried or tested. then, if there no issues setting up, wouldn't have heard it. to set up: add single xml file shared between asp.net , mvcsitemapprovider , configure of nodes there. make sure use namespace declaration mvc.sitemap file installed nuget package. note can safely add mvcsitemapprovider attributes , treated custom attributes xmlsitemapprovider (and ignored). make possible navigate between webforms , mvc, should use url attribute instead of configuring controller , action , etc. webforms use xmlsitemapprovider , ...

ios - CoreBluetooth: scanForPeripheralsWithServices not working with service array -

i'm developing ble application ios (swift) , i've found strange behaviour.. test has 2 controllers, 1 centralmanager role , other peripheralmanager role.. here's code (summary): parameters.swift: ... // custome uuid created in console let transfer_service_uuid = cbuuid(string: "fb694b90-f49e-....-....-171bba78f846") ... peripheral.swift ... var pmanager = cbperipheralmanager() var transferservice = cbmutableservice() override func viewdidload() { super.viewdidload() pmanager = cbperipheralmanager(delegate: self, queue: nil) } func peripheralmanagerdidupdatestate(peripheral: cbperipheralmanager!) { if(peripheral.state == cbperipheralmanagerstate.poweredon) { transferservice = cbmutableservice(type: transfer_service_uuid, primary: true) // add characteristic pmanager.addservice(transferservice) pmanager.startadvertising(nil) } } ... central.swift ... var cmanager = cbcentralmanager() override func ...

c# - XmlSerializer - object to string returning "p2:nill" instead of xsi:nill -

after serialzation, object string i getting current xml <obj> ... <field p2:nil="true" xmlns:p2="http://www.w3.org/2001/xmlschema-instance"/> ... </obj> the field nullable waiting xsi:nill , instead getting p2:nill why? when building xmlserializer can control namespaces, if don't random(ish) names applied. try seeing if helps var ns = new xmlserializernamespaces(); ns.add("xsi", "http://www.w3.org/2001/xmlschema-instance"); var ser = new xmlserializer(typeof(anentity)); ser.serialize(console.out, new anentity(), ns);

c++ - Output a C array through ostream -

i'm trying output c array using iostream. for array of ints, wrote code this template <size_t n> ostream& operator<< (ostream& os, const int (&x)[n]) { for(int i=0; i<n; i++) os<<x[i]<<","; return os; } int main() { int arr[]={1,2,3}; cout<<arr<<endl; return 0; } and works pretty fine. then, i'd generalize more types (like chars, floats etc), update original version follows template <class t, size_t n> ostream& operator<< (ostream& os, const t (&x)[n]) { for(int i=0; i<n; i++) os<<x[i]<<","; return os; } the main function didn't change, however, time, when compile it, error occured. in function `std::ostream& operator<<(std::ostream&, const t (&)[n]) [with t = int, long unsigned int n = 3ul]': a.cpp:15: instantiated here a.cpp:9: error: ambiguous overload `operator<<' in ...

c# - Rotated an model in Unity? -

i bulid project when if : user swipe left model model should rotated left. user swipe right model model should rotated rifgt. user swipe down model model should rotated down. user swipe model model should rotated up. what did till : add 3d model in front of camera. made c# file. now need basic code can make rotated on swipe. how run project in phone. here basic code come after build first c# file of model : void start() } void update(){} } you can use rotate achieve rotation of model (see rotate documentation ) then use this example detect swipe in each direction. you can try this: var speed = 0.1; function update () { if (input.touchcount > 0 && input.gettouch(0).phase == touchphase.moved) { // movement of finger since last frame var touchdeltaposition = input.gettouch(0).deltaposition; // move object across xy plane var rotationvector = new vector3(touchdeltaposition.x, touchdeltaposition.y, 0); ...

html - HTML5 : make canvas height width in % work -

hi see below link http://liveweave.com/i6jyft when assign canvas width 100% takes 100px width why , become what make canvas match width of parent width , not find how solve , think bit tricky css issue html code <table><tr valign="top"><td> </td><td> <table align="center"> <tr valign="top"> <td> left </td><td> <div id="content"> <table border="1" width="100%"> <tr width="100%"><td style="border:1px solid red"> <canvas id="canvas" width="100%" height="100%" style="width: 100%; height: 100%; position: relative"> </canvas> <div id="canvas-drop-area"></div> </td></tr> <tr><td style="borde...

c# - Extremely large XML tree manipulation -

i know question might asked somewhere around sof. having search sof, find no matched solution. i have mission create & maintain/populate extremely large xml tree (approx 2gb on disk). according requirements, have to: apply lots of transformation logic xml tree's nodes create new tree, add transformed nodes it, save new tree file. the first thing in mind when started work on is: don't have enough memory hold file & if have enough memory, performance serious problem if whole tree loaded memory. with in mind, i'd used stream xml fragments technique read data original file w/o loading memory. create new tree, stuck. msdn seems not have doc deal problem. idea? thanks in advance.

mysql - Composite key with auto generated column in Fluent NHibernate -

i have table in mysql database this: certificateyear char(4) (pk) certificatenumber int autoincrement (pk) ... other fields the key composite one. i've used configuration have field (certificatenumber) resets every year. whenever certificateyear changes, certificatenumber resets , starts 1. problem on mapping in fluent nhibernate. far, i've done in classmap: compositeid() .keyproperty(x => x.certificateyear, "certificateyear") .keyproperty(x => x.certificatenumber, "certificatenumber"); when saving entity set value certificateyear , leave certificatenumber unset, don't know how nhibernate certificatenumber auto-generated. assigns value of 0 it, , complains duplicate key... question is: there way tell nhibernate certificatenumber, part of composite key, autogenerated?

Escaping Contents of HTML with jQuery -

i'm running function cycle through elements on email newsletter , escape html. function escapechars() { iframe.contents().find('[data-mailbuilder="article-content"]') .children() .each(function() { $(this).text(escapehtml($(this).text())); }); } function escapehtml(unsafe) { return unsafe .replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;") .replace(/"/g, "&quot;") .replace(/'/g, "&#039;"); } however jquery seems replace '&' '&amp;' without escaping character. any ideas? to render html use .html() instead of .text() . so, change to: $(this).html(escapehtml($(this).text()));

javascript - No XMLDocument from OpenLayers.Request.Post -

i use asynchronous openlayers post request , via responsetext string: <?xml version="1.0" encoding="utf-8"?> <gml:timeperiod xmlns:gml="http://www.opengis.net/gml"> <gml:beginposition>2011-10-18t15:15:00.000+02:00</gml:beginposition> <gml:endposition>2014-11-23t14:45:00.000+01:00</gml:endposition> </gml:timeperiod> for reason not response in xml document object, respectively got empty xmldocument. my code far: var request = openlayers.request.post({ url: "http://139.17.3.305:8080/database/sos", async: true, //is default data: xmlstring, callback: handler //name of triggered callback function }); //xml callback handler function handler(request) { var xmltext = request.responsetext; console.log(xmltext); //returns string above ...

Rspec assigns equivalent in unit test/minitest -

is there rspec assigns equivalent in minitest::test ? if not how can check instant controller instant variable in tests. using sinatra the assigns method comes rails, not rspec or minitest. works same. the following example rails testing guide : class postscontrollertest < actioncontroller::testcase test "should index" :index assert_response :success assert_not_nil assigns(:posts) end end

javascript - Button to download a file useing .click(), faulty in IE and firefox -

the following contained in function compiles 'url' request , downloads file when button clicked (with angular ng-click="function" tag). angular.element(link) .attr('href', url); link.click(); it works desired in chrome, in both ie(9 & 10) , firefox nothing. 'link' object given correct 'href' property. can think .click method not doing supposed in ie , firefox. advice? much appreciated!

html - How to add rows and columns dynamically in a listbox in javascript -

i trying create 1500 rows each having 4 column/cells in list box. wanted dynamically. have added listbox using html html <body onload="load()"> <div id="myform"> <select id ="listid" name="mytable" size="5" style="width: 100px;" > </select> <input type="button" id="create" value="click here" onclick="javascript:addtable()"> <!-- create table , add srows , column javascript --> </div> </body> javascript note: able create row dont know how create column. function addtable() { var nofrow = 1500; (var = 0; < nofrow; i++) { var opt = document.createelement("option"); document.getelementbyid("listid").options.add(opt); // (var j = 0; j < noofcell; j++) { // not able figure out add //} } function addrow(tableid) { var table = document.getelementbyid(tableid); var ro...

How to call a php variable in jQuery? -

i want value of $jrowa['rate_score'] in php part num3 in jquery part. output nan alert in num3. here php code. $jsqla = mysql_query("select id,name,rate_score,rate_number,video_image products genre='$genre' limit 0,5"); $arate_num = $jrowa['rate_number']; if($jrowa['rate_number'] > 0){ $ratea = $jrowa['rate_score'] / $jrowa['rate_number']; $ratea2 = $jrowa['rate_score']; $rateid = $jrowa['id']; $ratenum = $jrowa['rate_number']; }else{ $ratea = $jrowa['rate_score']; $ratea2 = $jrowa['rate_score']; $rateid = $jrowa['id']; $ratenum = $jrowa['rate_number']; } here html code. <div class="col-sm-2 portfolio-item" style="width: 20%;"> <input class="rating form-control input-star-rate" id="<?php echo $rateid; ?>" name="rat...

json - Datastax cassandra QueryBuilder insertion error (java) -

environment : java 7 cassandra 2.1.2 running on local dev workstation in 1 simple node on windows 8.1 driver cassandra-driver-core-2.1.2 running environment : apache karaf 2.3.8 i try insert row giving json in column defined simple type (coordinates x , y). i build java statement : statement statement = querybuilder .insertinto("mykeyspace", "mytable") .value("mykeycolumn", "mykeyvalue") .value("coordinates", "{\"x\":10.4,\"y\":20.3}"); and when executing : mysession.execute(statement); i've got following error (full stack trace @ end of message) : com.datastax.driver.core.exceptions.invalidqueryexception: not enough bytes read 0th field java.nio.heapbytebuffer[pos=0 lim=1 cap=1] [in following cql statements, have anonymized column names, possible quotes wrong, problem in java statement above] my cassandra table , type : create table if not exists "mytable" ( ...

shell - Remove a character from second occurence -

how can remove , after first column of every line $ cat tmp.txt name, charles, james, criss age, 21, 25, 23 there may n number of columns in file. and need output like $ cat tmp.txt name, charles james criss age, 21 25 23 the , should not deleted first column. you can tell sed g lobally 2 nd match: $ sed 's/,//g2' file name, charles james criss age, 21 25 23

html5 - HTML don't change text to email -

it's bit complicated explain problem try can. so i'm writting programm in perl generates email send this: system("mutt -e 'set content_type=text/html' -s \"".$subject."\" ".$addresses." < ".$mailname); in mail receive text looks "abc2@example.yn.swx" outlook changes mail adress. possible write in code shouldn^t change ? know can change options in outlook mail goes out many people , dont want change options. thank guys outlook magic, , it'll automatically things turn 'email addresses' , 'web addresses' clickable links. doesn't matter if send plain text or not - it's happening client side have no control on it. however, if quote 'email address-like' content, so: echo "'myemail@mydomain.com'" | mail ... then outlook show (quoted) email address without automatically linkifying it. more though - can suggest rather inlining 'system...

scala - Why shapeless `everywhere` combinator works inside a method but not in a `val`? -

given code: import shapeless._ import poly._ object everywherevalanddef { sealed trait tree[t] case class leaf[t](t: t) extends tree[t] case class node[t](left: tree[t], right: tree[t]) extends tree[t] val tree: tree[int] = node( node( node( leaf(1), node( leaf(2), leaf(3))), leaf(4)), node( leaf(5), leaf(6))) object inc extends ->((i: int) => + 1) def afterincdef = everywhere(inc)(tree) // works val afterincval = everywhere(inc)(tree) // fails val expected: tree[int] = node( node( node( leaf(2), node( leaf(3), leaf(4))), leaf(5)), node( leaf(6), leaf(7))) def eqdef = expected == afterincdef def eqval = expected == afterincval } in repl session results: welcome scala version 2.11.4 (java hotspot(tm) 64-bit server vm, java 1.8.0_25). type in expressions have th...

android - Creating headers in custom ArrayAdapter from values passed to constructor -

i have list of items database ordered rooms: list<item> items = database.getallitemsorderedbyroom(); every item has roomid, , few other properties. and have customitemsarrayadapter works items doesn't create headers. what want create list not items, room headers based on values passed inside items. work like: long actualroom = null; for(item item : items){ long itemroom = item.getroom; if(itemroom != actualroom){ actualroom = itemroom; list.putroomheader(actualroom); list.putitem(item); } else { list.putitem(item); } } i have working inside customitemsarrayadapter after using constructor: adapter = new customitemsarrayadapter(context, items); stumbled upon explanation how headers: android listview headers , makes me prepare values list before creating adapter , unconvenient if use few similar lists in app. is there way of processing values inside constructor of costomitemsarrayadapter? use expand...

java - Copying values of array at specific indices to another array -

i came situation have array , need copy specific attributes (i.e. values @ specific indinces) not whole array array. for example if initial array is: double[] initarray = {1.0, 2.0, 1.5, 5.0, 4.5}; then if wanted copy 2nd, 4th , 5th attribute (i.e. values @ these indices) desired output array be: double[] reducedarray = {2.0, 5.0, 4.5}; i know if indices appear in sequential form, e.g. 1-3 can use system.arraycopy() indices not have aspect. so, there official way this, besides trivial loop through each value , copy ones needed: double[] includedattributes = {1, 4, 5}; double[] reducedarray = new double[includedattributes.length]; for(int j = 0; j < includedattributes.length; j++) { reducedarray[j] = initarray[includedattributes[j]]; } using streams, it's one-liner. given: int[] indices; double[] source; then: double[] result = arrays.stream(indices).maptodouble(i -> source[i]).toarray();

Maven tomcat-plugin cannot find custom realm -

i beginner custom realm. trying create demo using maven , customrealm. when run maven project, got classnotfoundexception custom relam class. below code snippet. pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.example.realm</groupid> <artifactid>realmdemo</artifactid> <packaging>war</packaging> <version>0.0.1-snapshot</version> <name>realmdemo maven webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupid>org.apache.tomcat</groupid> <artifactid>tomcat-catalina</artifactid> <version>7.0.47</versio...

javascript - how to remove images and span dynamcially? -

i uploading images span text dynamically inside div.after trying remove specific uploaded images span text using below code, var images = document.getelementsbyclassname('imgclass'); (var j = 0, leng = images.length; j < leng; j++) { images[j].onclick = removeimage; } function removeimage() { alert("here"); // var imagename = $(this).attr("src"); // alert(imagename); $(this).remove(); $(this).find('span').remove(); //$(this).siblings().remove(); var factor = 2; } my problem is, image removing fine span under image not removing. here problem : http://jsfiddle.net/manivasagam/72cr4bvk/39/ tell me how solve fix? as adding img , span new created div , can delete whole div: $(this).closest('div').remove(); jsfiddle demo .

rest - FitNesse RestFixture test fails to get access token -

i have rest application spring oauth2 authorization. test fitnesse restfixture test (i added token curl response , last get operation works successfully): | table:smartrics.rest.fitnesse.fixture.restfixture | http://10.76.243.103:8080 | | | /<root>/version | | | 2.2.1 | | setbody |grant_type=password&username=test&password=test123&scope=data+compute| | setheader |authorization : basic dgvzddo4yme5mjrjzs0wnthhltq3y2ytogq4mi02zwy1n2y4nzdinmq=| | setheader |content-type : application/x-www-form-urlencoded| | post | /<oauth-provider>/oauth/token | | | | | setheader |authorization : bearer fd947659-cf17-4ded-b2e8-698395c201df| | | /<root>/schemas | | | | and failed access token on post operation issue {"error":"unauthorized","error_description":"full authentication required access resource"} : | post | /<oauth-provider>/oauth/token | 401 | <responce> | {"error":"unauthorized",...

java - Add new line into Eclipse's Text control field -

how can add new line eclipse's text control field? i need open file , read it. and works except part of content in 1 single line. tried with: string scurrentline; br = new bufferedreader(new filereader(file)); while ((scurrentline = br.readline()) != null) { system.out.println(scurrentline); text.settext( text.gettext() + scurrentline + "\r\n"); } ... still in 1 single line...... pls help! assuming talking swt text control must create swt.multi style support multiple lines. text = new text(parentcomposite, swt.multi);

raphael - Change image color in RaphaelJS -

good afternoon. have following question: use rafael js render multiple shapes , pictures. can change color of figures without problems. there way change color of picture? not important image format, main thing able change color. example draw white car. car = r.image ('car-white.png', car_pos.x, car_pos.y, car_w, car_h); on page following code: <image x = "168.36" y = "54.14" width = "59.10" height = "49.10231526692708" preserveaspectratio = "none" xmlns: xlink = "http://www.w3.org/1999/xlink" xlink: href = "car-white.png" transform = "matrix (1,0,0,1,0,0)" style = "- webkit-tap-highlight-color: rgba (0, 0, 0, 0); "></ image> i looked on internet problem, , everywhere advised use canvas. raphaeljs not canvas, , find way around problem. if format of image not important, make them svgs (if possible). can import them raphaeljs , manipulate these (just use c...

java - JavaFX LineChart showing right result in one computer and wrong in other -

Image
so, we're doing home assignment in java , ui used javafx. program works, draws linechart charm , no problem. when classmate did same thing, didn't. dude sent me code, ran , in computer fine. cause - linechart showing wrong in 1 computer , right in other? the data added chart in same way, in computer data shown in way it's entered chart in computer it's in wrong order (the elements sorted reason). public linechart createchart(arraylist elements) throws polevalituderind{ //elements entered or chosen, in right order! arraylist fixedlst = new arraylist(); int s = 0; (int = 0; i<elements.size();i++){ s = (int) elements.get(i); fixedlst.add(s); } string strstart = tf2.gettext(); int intstart = 0; try { intstart = integer.parseint(strstart); } catch (numberformatexception j){ ...

c# - ParseBigInteger FormatException in RavenDB source code -

in our wpf app have input validation. 1 of input values decimal , allows max of 28 digits (like 999999999999999999999999999 ). 1 more 9 , gives validation error feedback, 28 9's work intended. however, when try save ravendb gives bigintegerparse formatexception , can't figure out why. thought size of biginteger infinite (if i'm not mistaken has byte-max equal integer.max_value , although i'm not sure). still, assume biginteger parse have no trouble converting string 28 9's biginteger. here part of stacktrace: system.formatexception: value not parsed. @ system.numerics.bignumber.parsebiginteger(string value, numberstyles style, numberformatinfo info) @ raven.imports.newtonsoft.json.jsontextreader.parsenumber() in c:\builds\ravendb-stable-3.0\imports\newtonsoft.json\src\newtonsoft.json\jsontextreader.cs:line 1288 @ raven.imports.newtonsoft.json.jsontextreader.parsevalue() in c:\builds\ravendb-stable-3.0\imports\newtonsoft.json\src\newtonsoft.json\j...