Posts

Showing posts from July, 2015

Plot A Confusion Matrix with Color and Frequency in R -

Image
i want plot confusion matrix, but, don't want use heatmap, because think give poor numerical resolution. instead, want plot frequency in middle of square. instance, output of this: library(mlearning); data("glass", package = "mlbench") glass$type <- as.factor(paste("glass", glass$type)) summary(glasslvq <- mllvq(type ~ ., data = glass)); (glassconf <- confusion(predict(glasslvq, glass, type = "class"), glass$type)) plot(glassconf) # image default however, 1.) don't understand "01, 02, etc" means along each axis. how can rid of that? 2.) 'predicted' label of 'y' dimension, , 'actual' label 'x' dimension 3.) replace absolute counts frequency / probability. alternatively, there package this? in essence, want in r: http://www.mathworks.com/help/releases/r2013b/nnet/gs/gettingstarted_nprtool_07.gif or: http://c431376.r76.cf2.rackcdn.com/8805/fnhum-05-0018

java - AutowireCapableBeanFactory.autowireBeanProperties() seems not to work for xml configured contexts -

i trying manually inject beans autowired dependency using autowirecapablebeanfactory.autowirebeanproperties(). seems work if bean should injected configured in java class. if configured in xml context file not work. test cases: public class injectortest { @test public void testannotationinjector() { annotationconfigapplicationcontext context = null; try { testbean testbean = new testbean(); context = new annotationconfigapplicationcontext(someserviceconfig.class);; autowirecapablebeanfactory beanfactory = context.getautowirecapablebeanfactory(); beanfactory.autowirebeanproperties(testbean, autowirecapablebeanfactory.autowire_by_type, false); asserttrue(testbean.getsomeservice() != null); } { if (context != null) { context.close(); } } } @test public void testxmlinjector() { classpathxmlapplicationcontext context = null; try { testbean testbean = new testbean(); context

text - Writing to txt in python -

i'm writing lines of numbers text file text file. numbers print while running good, when open output file nothing has been written it. can't figure out why. min1=open(output1,"w") oh_reader = open(filename, 'r') countmin = 0 while countmin <=300000: line in oh_reader: #min1 if countmin <=60000: hrvalue= int(line) ibihr = line print(line) print(countmin) min1.write(ibihr) min1.write("\n") countmin = countmin + hrvalue min1.close() you should use python's with statement open files. handles closing , safer: with open(filename, 'r') oh_reader: if way program indented min1=open(output1,"w") oh_reader = open(filename, 'r') countmin = 0 while countmin <=300000: line in oh_reader: # same having pass here #min1 if countmin <=60000:

lua - How do I add a config list am I doing it wrongly? -

the issue recieving making txt files contents readable in listed format such as: word1 word2 word3 if user have said of words/or phrases response otherwise program wait valid reply blacklisted word file. local valid; repeat local reply = io.read() file = io.open('blacklist.txt', "r+") file:read() file:close() -- list equal contents within blacklist.txt if reply == list valid = reply print("kicking user game") --game.kick.saiduser else --do nothing , wait valid response end until valid; file:read() reads 1 line file , discards it. i think want read whole contents of file list with list = file:read("*a") then want check whether reply in list with if list:match("\n"..reply.."\n") you may want read list outside loop , prepend \n list make pattern matching simpler.

Boost Xcode C++ command line Undefined symbols for architecture x86_64 -

Image
i have gotten boost work in test application following instructions here . need create command-line application generate licenses. i've inherited code , uses boost. think i've set correctly when try build receive undefined symbols architecture x86_64 error using boost. i created command-line application: i added path boost: i tried change c++ standard library compiler: here code referencing boost library: #include <boost/date_time/posix_time/posix_time_io.hpp> namespace bg = boost::gregorian; namespace bp = boost::posix_time; here errors: undefined symbols architecture x86_64: "boost::program_options::to_internal(std::string const&)", referenced from: std::vector<std::string, std::allocator<std::string> > boost::program_options::to_internal<std::string>(std::vector<std::string, std::allocator<std::string> > const&) in main.o "boost::program_options::variables_map::variables_map()&q

oracle - Java persistence - getSingleResult() did not retrieve any entities -

i testing jpa project follows: try { emfactory = persistence.createentitymanagerfactory(persistence_unit_name); entitymanager em = emfactory.createentitymanager(); query qry = em.createquery("select t testcon t"); system.out.println(qry); testcon tcon = (testcon) qry.getsingleresult(); //qry.getsingleresult(); rslt = tcon.getb(); if (rslt == null || rslt.equals("")) rslt = "could not result"; system.out.println(rslt); //new showmsg(rslt); } catch (exception ex) { system.out.println(ex); //new showmsg("exception occured"); } the output is: javax.persistence.noresultexception: getsingleresult() did not retrieve entities. the qry string is: ejbqueryimpl(readallquery(referenceclass=testcon sql="select a, b c##test.testcon")) when test directly in sqlplus: select a, b c##test.testcon

html - Does it matter which ASP.NET Project type I use for a super-simple site? -

i'm going create super-simple, one-page, site. have text , images , links on it, that's all. no code, either c# or jquery or else - html (and minimal css). i created mockups of site (page) using vs 2013 selecting new > project > web site > asp.net , each of following, in turn: empty page spa web forms for first two, added html page , copied html , css , ran it. works fine. for last option (web forms), difference there page (default.aspx). replaced existing html in there mine (and css). works fine. i plan on publishing to/with/as azure web site. assume can of these project types. the web forms adds bunch of stuff don't need or use, imagine 1 of other 2 best bet. there reason why select 1 project type on others simple page this? if it's static site , know html/css want use, best bet visual studio use empty page template.

sql - Store dataset count as a variable in a report to use in other tables - SSRS -

we have 2 queries on ssrs report . one query returns single number total record count. other query returns single column we'd divide total returned in first query. so query 1 dataset (this return single value) total 100 query 2 dataset (this return list of values we'd divide q1 answer) col 1 20 3 49 what want show on report ratio (a/total) 1/100 20/100 3/100 49/100 not show how marry these 2 datasets in single ssrs tablix. 100 not aggregate of value in table set 2, totally different number don't know of way write query bring out these values ins single dataset. ideas? thanks,. mc if don't want combine datasets, can following achieve end result. for dataset returns single value, create report parameter (@myparam) hidden , populated dataset query1. dataset query2 can remain was. can use following expression populate textbox in report =cstring(fields!cola.value) &"/"& cstring(parameters!myparam.value) if put

java - How to retrieve servletRequest.attributes on client side -

i trying test servlet sets attributes on servletrequest. using jbehave resttemplate , apache httpclient send request servlet. possible verify attributes set on servletrequest? here trying in servlet: public void doget(httpservletrequest request, httpservletresponse response) throws oexception, servletexception{ request.setattribute("attributename","simple_name"); ... } and client: httpentity entity = httpentity.empty; map<string, string> map = new hashmap<string, string>(); resttemplate.setrequestfactory(new httpcomponentsclienthttprequestfactory()); httpentity<string> response = resttemplate.exchange(uri, httpmethod.get, entity, string.class, map); so in case verify attributename set value simple_name no, not possible. httpservletrequest attributes server side implementation detail has nothing http protocol. such, http client has no knowledge of (and shouldn't). if want check attribute added server side, can im

css - bootstrap: form-control size doesnt change based on parent div col size -

i trying use increase size of text box changing col-md-* value doesn't seem affect child input form-control textbox. example: <form id="myform"> <div class="row"> <div class="col-md-2"> name: </div> <div class="col-md-8"> <input name="name" type="text" placeholder="enter name ..." class="form-control" required="required" /> </div> </div> </form> in above code text input size doesn't increase think should larger if used col-md-8. text box size same whether use col-md-4 or col-md-6 also. because form-control class in bootstrap defines size? if how can fixed? try work me <div class="row"> <form id="myform"> <div class="col-md-2"> name: </div> &

tcl - Working with pattern of list with values surrounded by {} -

i have data {} {abc} , {abc} {} ,or {abc} {def} , , want capture in 2 variables. tried: foreach {fname} <program values> { set dfrom [lindex $fname 1] set rname [lindex $fname 2] print "fname- $fname" print "dfrom- $dfrom" print "rname- $rname" } however, {} not getting index. from manual lindex , emphasis mine: when presented single index, lindex command treats list tcl list , returns index'th element ( 0 refers first element of list ) so have use more this: foreach {fname} <program values> { set dfrom [lindex $fname 0] set rname [lindex $fname 1] print "fname- $fname" print "dfrom- $dfrom" print "rname- $rname" } and if you're on tcl 8.5 or newer versions, can use lassign : foreach {fname} <program values> { lassign $fname dfrom rname print "fname- $fname" print "dfrom- $dfrom" print "rn

c# - Exit code 100. Too many semaphores -

i'm writing c# program in visual studio 2012 , have problem. here's code fragment: process proc = new process(); proc.startinfo.verb = "runas"; proc.startinfo.filename = "c:\\windows\\microsoft.net\\framework\\v4.0.30319\\regasm.exe"; proc.startinfo.arguments = "absolute\\path\\to\\file.dll /codebase /tlb"; proc.start(); proc.waitforexit(); messagebox.show("exit code: "+proc.exitcode); proc.close(); the problem is, when build debug binary , run it, works great. launches regasm.exe, registers dll, generates .tlb file , it's dandy. but when run release binary, nothing works , messagebox shows me "exit code: 100". looked haven't found useful @ all. found solution here: http://objectmix.com/dotnet/320921-regasm-tlb-complaints-element-not-found.html regasm.exe error this: regasm : error ra0000 : type library exporter encountered error while processing 'ruby2net.iruby2net, ruby2net'. error: element

sqlalchemy - Define a relationship() that is only true sometimes -

i'm working database schema has relationship isn't true, , i'm not sure how describe sqlalchemy's orm. all primary keys in database stored blob type, , 16 byte binary strings. i have table called attribute , , table has column called data_type . there number of built in data_type s, not defined explicitly in database. so, maybe data_type of 00 means string, , 01 means float, etc (those hex values). highest value built in data types 12 (18 in decimal). however, rows in attribute , value of attribute stored in row must exist in pre-defined list of values. in case, data_type referrs lookup.lookup_id . actual data type attribute can retrieved lookup.data_type . i'd able call attribue.data_type , 'string' or 'number'. i'd need define {0x00: 'string', 0x01: 'number'} mapping somewhere, how can tell sqlalchemy want lookup.data_type if value of attribute.data_type greater 18? there couple of ways this.

entity framework - EF6 migrations (LocalDb) update-database login failed -

vs 2013 mvc5 code first project. i’m working through asp.net getting started ef6 using mvc5 tutorial speed on latest changes , i’m having problem migrations. in first module database created using database initializer: <contexts> <context type="contosouniversity.dal.schoolcontext, contosouniversity"> <databaseinitializer type="contosouniversity.dal.schoolinitializer, contosouniversity" /> </context> </contexts> and connection string: <connectionstrings> <add name="schoolcontext" connectionstring="data source=(localdb)\v11.0;initial catalog=contosouniversity1;integrated security=sspi;" providername="system.data.sqlclient"/> </connectionstrings> this works fine. in code first migrations , deployment module migrations setup. initializer commented out , name of db changed contosouniversity2: <connectionstrings> <add name="schoolconte

objective c - iOS UI query on background thread -

i doing processing on background thread. processing needs access ui element information (like position of uiview). research, appears background thread should allowed "query" attributes of uiview -- long not "change" attributes. i feel better if substantiate claim. small code snippet below. // on background thread uiview *view = [self.view viewwithtag:tag]; cgfloat xposition = view.frame.origin.x;

assembly - ARM ASM + array -

i need write arm assembly language routines initialize array x of size n constant value v, using 2 different approaches: indices, pointers i have no idea how in asm. thanks jj the simplest (not fastest) way implement function in arm assembly language: .global foo @ @ call c void foo(uint32 *array, uint32 size, uint32 value); @ @ standard calling convention: @ values passed in register r0=*array, r1=size, r2=value @ foo: str r2,[r0],#4 @ store value , increment pointer subs r1,r1,#1 @ decrement count bne foo @ branch until count 0 bx lr @ return caller

ios - Choose current annotation -

i receive list of coordinates , insert on map. got new coordinates , want move pins code: [uiview animatewithduration:4.0 delay:0.0 options:uiviewanimationcurveeasein animations:^{ [oldcoordinate setcoordinate:newcoordinate.coordinate]; }completion:^(bool finished) { }]; i loop code every new coordinate can not move because can not control it. if use array got, example [myarray objectatindex:[indexpath row]]; and recieve array work. how can take find current annotation on map ? (annotation on map, , new coordinates have) to current annotations on map loop this: mkmapview * map = [[mkmapview alloc]initwithframe:self.view.frame]; (mkpointannotation * annotation in [map annotations]) { //change annotation coordinate new coordinate }

asp.net mvc 4 - Entity Framework Issue, Inserting into many different Tables -

hi need insert purchase order header, , details. inserting data purchaseorder table succesful when tried inserting data purchaseorderdetails inserted data many different tables. tried debugging didn't find problem. checked sql profiler found out ef inserting data ff tables" newproposal,institution,product,etc. please me, how can prevent ef inserting data other tables, need ef insert data po , podetails table. here's purchase order model: public class purchaseorder { [key] public int purchaseorderid {get; set;} [required] public string purchaseorderno { get; set; } [required] public datetime purchaseorderdate { get; set; } public datetime datecreated { get; set; } public datetime datemodified { get; set; } public bool isdraft { get; set; } public int? institutionid { get; set; } public virtual institution institution { get; set; } [required] public datetime receiveddate { get; set; } public string r

Android audio capture -

i'm following this article capture audio on android. thought easy, there's problem. here's code: file dir = activity.getdir("recordings", context.mode_private); file file = new file(dir, "testaudio.mpeg4"); fileutil fileutil = new fileutil(); file parent = file.getparentfile(); if(!parent.exists()){ log.i(tag, "creating non-existent path:" + parent.getabsolutepath()); parent.mkdirs(); } recorder = new mediarecorder(); recorder.setaudiosource(mediarecorder.audiosource.mic); recorder.setoutputformat(mediarecorder.outputformat.mpeg_4); recorder.setaudioencoder(mediarecorder.audioencoder.default); try{ recorder.setoutputfile(file.getabsolutepath()); recorder.prepare(); recorder.start(); }catch(ioexception e){ //more code } so, create testaudio.mpeg4 file under /data/data/com.myapp/app_recordings/ folder. but, aft

How can a circle touch a line in Qbasic and end the program? -

i trying make maze in qbasic when pointer touches maze lines program not ending. want when circle (which pointer ) touches ends of maze program should go end.the program this:- cls screen 12 dim p string dim a1 string 15 print"what want do?" print"a:draw image"," b:play maze game"; print print"type 'a' or 'b'in capital form" goto 102 99 print "rules play maze game:" print print "1 use 'w' move ball foward" print "2 use 's' move ball backward" print "3 use 'a' move ball leftward" print "4 use 'd' move ball rightward" input a1 cls goto 10 102 input p if p="a"then cls goto 20 elseif p="b" cls goto 99 elseif p<>"a" , p<>"b" print "choose between , b" goto 70 end if 10 pset(120,120) draw "r100" pset (120,140) draw"r80" pset (200,140) draw "d100" pset (2

sharepoint 2010 - Fetch details from one list to another on comparing user email address. -

i looking guidance regarding sharepoint 2010 lists. scenario: let's list-a having details of user profile. let's list-b has other data , have 1 column having user email address, in list on form load event when user login fetch user email address. in list have introduce 1 column wil bring details user profile list on basis of email address. if email address doesn't exist in list-a column remain blank otherwise show user required text in same column. i hope have given enough details required. any idea great. furthermore, don't have visual studio installed that's why cannot programing therefore other workaround idea great. thanks in advance. use spservices library based on jquery. can on client side editing form in sharepoint designer. look @ function spcascadedropdowns() http://spservices.codeplex.com/wikipage?title=%24().spservices.spcascadedropdowns

sql - PHPEXCEL : php excel only show 1 letter -

Image
please me on phpexcel. shows 1 letter. php code: $sql_question = "select * tna_question title_id = '$tid' order section_id"; $result_question = mysql_query($sql_question, $db); $category = array(); while ($row = mysql_fetch_assoc($result_question)) { $arr1 = $row['question']; $arr = array_push($category ,$arr1); $category_count++; } $arr3[] = $category; the result sql query array: array ( [0] => gfhgfh [1] => gfhfg [2] => fggfdg [3] => fds [4] => asd [5] => fghgfh [6] => policy wordings / coverage [7] => risk assessment / survey & underwriting [8] => policy wordings / coverage [9] => risk assessment / survey & underwriting ) when use line: $objphpexcel->setactivesheetindex()->fromarray($category, null, 'c7'); it gives me first letter each row but if make one: $objphpexcel->setactivesheetindex()->fromarray($arr3, null, 'c7'); it

json - Connection issues in android, stream returning null -

i trying data database listview . have used json parsing that. when run servlet correct parsed value. m trying make connection not coming off dbmapping public class mysearch extends activity { class event_location{ string place; string area; int cost2; int cost2wa; int uid; @override public string tostring() { return "venue details [place=" + place +", area=" + area + ", cost2=" + cost2 + ", cost2wa = "+ cost2wa +"]"; } } class fetchcollegedetailstask extends asynctask<void, void, inputstream> { @override protected inputstream doinbackground(void... arg0) { log.e("testing @@@@@@" ,"test connnection" + "" ); //192.168.1.102:8080/first/myservlet //string stringurl="http://www.google.com"; string stringurl="h

iphone - How to show multiple route IOS Mapview -

Image
i creating ios application map based application in app show route/path between source , destination , have done show 1 route/path. show possible path between source , destination google map. illustrate idea have added screenshot show path this. there sample this? thanks in advance follow these simple steps : get 2 input locations. use method -geocodeaddressstring: completionhandler: of geo coder class (from core location framework) getting coordinates given location string. use mkpointannotation object creating annotation on locations in map. send request google api getting direction between 2 locations . as of google api response (available in both json & xml) have overview_polyline object, has array of location coordinates. encoded, have use correct decoding module latitude , longitude. decoded location coordinates can create poly lines using mkpolyline instance method. mkpolyline *polyline = [mkpolyline polylinewithcoordinates:coordinates count:[ove

Mysql - IMPALA query help needed -

i have 1 table in hive table1 . using impala fetch data table table1 ------ name, amount where values of table are test1, 10 test1, 15 test1, 30 test2, 30 test2, 40 test2, 50 test3, 30 test3, 40 test3, 50 now have fetch data table1 such that, fetch data name (test1, test2, test3) but gives top 2 records based on amount each name . can possible in impala or in mysql? thanks in advance if you're using impala 2.0 or greater, can use analytic functions accomplish task: select name, amount (select name, amount, row_number() on (partition name order amount desc) pos table1) t pos < 3; if must use mysql, appears can fake window functions using user-defined variables , demonstrated in another question on stackoverflow .

clojure - Why prefer seq over non-empty as a predicate? -

the docstring empty? says "please use idiom (seq x) rather (not (empty? x))". mistermetaphor points out using seq predicate can make sense when used in if-let : (if-let [s (seq might-be-empty)] (fn-for-non-empty-seq s) (fn-for-empty-seq)) should use seq test non-emptiness in general, though? seq may convert argument different form. example: user=> (class (lazy-seq '(1 2 3))) clojure.lang.lazyseq user=> (class (seq (lazy-seq '(1 2 3)))) clojure.lang.persistentlist user=> (class (map inc [1 2 3])) clojure.lang.lazyseq user=> (class (seq (map inc [1 2 3]))) clojure.lang.chunkedcons that seems waste of cycles if want test non-emptiness, , don't need new binding, or if don't need conversion before binding. wouldn't not-empty better choice in such cases? returns nil if argument empty, , argument unchanged if non-empty. (if (not-empty []) "more do" "all done") first, check out definition

android - Why is the Google Maps InfoWindowClick method executing twice on one click? -

i using xamarin , coding google maps application. have code executes when user clicks on map infowindow. here code: void handleinfowindowclick (object sender, googlemap.infowindowclickeventargs e) { toast.maketext (this, "handleinfowindowclick", toastlength.short).show (); } i set handler following code: _map.markerclick += handlemarkerclick; whenever click on infowindow, method executes twice , toast displayed twice well. why this? how can fix code such handleinfowindowclick method executes once on click? thanks in advance you talking handleinfowindowclick , here have shown event binding of markerclick . you can try this: _map.infowindowclick -= handleinfowindowclick; // first detach handler if attached _map.infowindowclick += handleinfowindowclick;

c++ - import error in embedding python with boost python -

i have following code #include <boost/python.hpp> int main() { py_initialize(); namespace python = boost::python; try { python::object main = python::import("sample"); } catch(...) { pyerr_print(); pyerr_clear(); } } i following error: importerror: no module named sample i put sample.py @ same directory program. it's because python::import not looking inside current directory. know 2 ways solve it: set pythonpath inside current directory (linux): export pythonpath=`pwd`:$pythonpath or... set python search module path inside code (also provides better explanation issue you've found out): how import work boost.python inside python files

web services - Is it possible to connect to microsoft outlook scheduling assistant from an android app? -

i trying build application requires information microsoft outlook scheduling assistant. okay, huge question! simple answer, no, there no easy way plug in, doesn't mean isn't possible. let's assume you're using exchange server, can create request returns availability info of list of contacts on period. returns array of integers detailing status of person during each hour/half hour of period sent. you can make table layout views depicting availability different colors. not easy task. had company's email client , took 3 days of pretty hardwork looking ui information need. for information on protocols send availability info, check out documentation here . if need doing this, please feel free comment here. unfortunately, can't share code wrote, since wrote while working ibm

java - Filtering whole words with delimiter -

i have delimiter in place filters out symbols , numbers. program reading in file , exclude words not words. might sound confusing example. if first line in file has word light , second line has word lightning , possible somehow filter out light keep lightning ? this code , delimiters have put in place. string delimiters = " ,*.-?|\t\r\n^;{}()[]+=<>/1234567890_"; asciidatafile file = new asciidatafile(); are using split or replace operation delimiter ? can use : regex - "\blight\b" on split/replace operation , match "light" , not "lightning". you can verify/test out @ javascript regexp example hope helps.

connection string - Invalid value for key 'attachdbfilename'. error -

i have uploaded website on web server cyberhost.com. send me information after purchasing web hosting. in nameserver 1: ns4.clientns.net .and got following error invalid value key 'attachdbfilename'. and connection string is- connection string="data source=.\sqlexpress;integrated security=true;attachdbfilename=|datadirectory|himtravels.mdf;user id=maantravels_db;password=v*f357ghtff;user instance=true" what solution of it?? thank in advance. don't have enough knowledge connection string. i think missing \ attachdbfilename=|datadirectory|\himtravels.mdf; , missing initial catalog connection string="data source=.\sqlexpress;initial catalog=dbname;integrated security=true; attachdbfilename=|datadirectory|\himtravels.mdf;user id=maantravels_db;password=v*f357ghtff;user instance=true"

External Ids in Salesforce -

how create external id on objects profile (for iscreatable false). have create external id on profile upsert operation, not able create it. is there work around this? or can ask salesforce allow create external ids. any links or references useful!! follow of create new profile object in salesforce ? you can't create external ids on metadata components (profiles, classes, visualforce pages, custom fields). of time they're guarded having name or developername unique. (with addition of namespace let's ignore managed packages now) profile object doesn't support create doesn't support upsert ;) compare http://www.salesforce.com/us/developer/docs/api/content/sforce_api_objects_account.htm , http://www.salesforce.com/us/developer/docs/api/content/sforce_api_objects_profile.htm i don't understand trying achieve?

javascript - How to Validate the timepicker as from time to time -

i need validate time picker time , time example http://jqueryui.com/resources/demos/datepicker/date-range.html in page can validate date , date date-picker need time-picker , need give at-least 1 hour different between , time. code not working please 1 me friends. . $('#stime').timepicker({ controltype: 'select', stepminute: 15, timeformat: 'hh:mm', onclose: function (time) { $("#etime").timepicker("option", "maxtime", time); } }); this might solution check out : http://jonthornton.github.io/jquery-timepicker/

Listing peer (desktop) directory structure on android device on same wifi Network -

i working on concept of sharing file between peer peer. have 1 desktop , android connected same wifi network . using many application can show file structure of android on desktop (i.e airdriod without running scripting on desktop). issue create opposite. want show file structure of desktop @ android side user can copy element directly one's android phone. finally met smb file sharing system , able browse directory of peer computer through android application. in creating peer peer communication. goes tutorial sambha file sharing

linux - Need to filter out valid IP addresses using regex -

i have radius client configuration file in /etc/raddb/server in want valid ip address without commented line,so i'm using grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' /etc/raddb/server 127.0.0.1 192.168.0.147 but want ignore 127.0.0.1 commented # how stuff?? /etc/raddb/server file follow cat /etc/raddb/server # pam_radius_auth configuration file. copy to: /etc/raddb/server # # proper security, file should have permissions 0600, # readable root, , no 1 else. if other # root can read file, can spoof responses server! # # there 3 fields per line in file. there may multiple # lines. blank lines or lines beginning '#' treated # comments, , ignored. fields are: # # server[:port] secret [timeout] # # port name or number optional. default port name # "radius", , looked /etc/services timeout field # optional. default timeout 3 seconds. # # if multiple radius server lines exist, tried in order. # first server re

android - How to open new activity every time i click the notification -

say, have got 5 notification app. application in closed state. if click on 1 notification, application opening needed activity. how make notification open new activity every time click notification app open. the app has splash screen , needed activity third child of splash screen. i have implemented follows : on clicking notification launch splash screen boolean set if comes notification. opening need activity splash screen according boolean. if click notification when app open, again starts splash screen. how implement opening activity notification happens in whats app.

javascript - How to get the inner object value dynamically -

this question has answer here: accessing nested javascript objects string key 25 answers i have 2 objects this var row = { destination: { id: 1, name: 'test' }, name: 'test2', source: 'source2' }; var obj = [{'index': 'name'}, {'index': 'source'}, {'index': 'destination.name'}]; now looping on obj can values of row not destination.name for(var i=0;i<obj.length;i++){ console.log(row[obj.index]); } output test2 source2 undefined solution question var row = { destination: { id: 1, name: 'test' }, name: 'test2', source: 'source2' }; var obj = [ {'index': 'name'}, {'index': 'source'}, {'index': {'destination':'name'}} ]; for(var i=0;i<obj.

.net - Copy/paste issue in CKEditor on IE 11 browser (update DLL)? -

we have issue of copy/paste ( ctrl + c , ctrl + v ) in ckeditor on ie 11 browser. issue paste function don't work on ie 11 browser, can find upgraded ckeditor.net.dll ie 11 fixes? if there no upgraded dll when upgraded dll available? the official downloads found @ http://ckeditor.com/download . latest version looking 3.6.4 asp.net. however, not contain latest changes possible (such latest ie version support fixes) - pure js version @ 4.2.3. i recommend moving away dll version , switching pure js version.

caching - Neo4j GC overhead limit exceeded -

i running test , got "gc overhead limit exceeded" error. understood because loaded many primitives in cache. wrong? my question then, how can prevent ourselves this? example, can evaluate size of needed memory based on number of primitives? there tip approximatively know it? my boss want know how many primitives can manage @ same time. assume related jvm settings can't manage find settings. sorry if dumb questions, i'm not used jvm settings , peformance , have pretty huge lack of knowledge atm. trying , willing understand though! jimmy. understanding details of java garbage collections far not trivial thing. since you're question rather unspecific, can provide rather unspecific answer well. there's section in neo4j reference manual on jvm settings, http://docs.neo4j.org/chunked/stable/configuration-jvm.html . another idea depending on graph , heap size change implementation type object cache. there soft (default in community edition), w

php - Codeigniter project showing 404 error or blank page -

my project in codeigniter not running. not able problem facing. have set database correctly. in routes, have set path controller. controller - groups_controller <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class groups_controller extends ci_controller { function index() { $this->load->view('groups'); } public function group() { $this->load->model('groups_model'); if(isset($_post['addgroup'])) { $userid= '2'; $groupname= $this->input->post('group'); $data=array( 'userid'=>$userid, 'groupname'=>$groupname ); $this->groups_model->insert_groups($data); //var_dump($this->db->last_query()); } } } ?> model - groups_model.php function insert_groups($dbdata) { $this

php - How to create mutiple thumbnails for multiple image in code igniter -

i try create multiple thumbnail multiple image. create 1 image , try increase original image width , height , not increasing please correct code here code.... uploading multiple image <?php if(!$this->input->post('upload')){ $this->create(); } else{ $data['banner_img1'] =$_files['files']['name'][0]; $data['banner_img2'] =$_files['files']['name'][1]; $data['banner_img3'] =$_files['files']['name'][2]; $update_id=$this->uri->segment(3); /* create config upload library */ $config=array( 'allowed_types' => 'jpg|jpeg|png|gif', 'upload_path' => $this->gallery_path, 'max_size' => '2000' ); /* load upload library */ $this->load->library('upload'); $this->upload->initialize($config); if($this->upload->do_multi_upload('files

sql - select department name query pre-requiste -

i have 3 tables shown below : courses( number: integer, deptname: string, coursename: string, classroom: string, enrollment: integer) departments( name: string, chairmanpid: string) prereq( number: integer, deptname: string, prereqnumber: integer, prereqdeptname: string) and have find which departments have courses have pre-requisites in other departments? try this select d.name,c.coursename, p.deptname department d inner join courses c on c.deptname=d.deptname inner join prereq p on p.prereqdeptname=d.deptname , p.deptname <> d.deptname

java - PDF acroforms not being copied properly in itext -

so have pdf form , set fields it: pdfreader reader = new pdfreader(src); pdfstamper stamper = new pdfstamper(reader, new fileoutputstream(dest + + ".pdf")); acrofields form = stamper.getacrofields(); form.setfield("name", "bruno lowagie"); form.setfield("adress", "address"); form.setfield("dates", "january 1, 2010"); form.setfield("titles", "blah blah blah"); stamper.close(); reader.close(); however when try copy files file, fields appear on focus of fields, pelase help document document = new document(); pdfcopy pcf = new pdfcopy(document, new fileoutputstream(all_customer_file)); pcf.setmergefields(); document.open(); int documentnumber = 0; (string input : inputs) { pdfreader reader = new pdfreader(input);

ios - How to produce AVFoundation Camera Images as bright as those taken with the native camera? -

i've played autofocus, , autoexposure, autowhitebalance, , lowlightboost, still can camera images display bright viewed/captured using native iphone 5 camera. not sure i'm doing wrong. below main function sets auto camera features when screen pressed. autofocus works. not sure if auto exposure, white balance, , lowlightboost working supposed because dark items viewed don't brighten native camera. of code below taken avcam example posted on iosdev center site. thanks in advance! - (ibaction)focusandexposetap:(uigesturerecognizer *)gesturerecognizer { cgpoint devicepoint = [(avcapturevideopreviewlayer *)[[self previewview] layer] capturedevicepointofinterestforpoint:[gesturerecognizer locationinview:[gesturerecognizer view]]]; [self focuswithmode:avcapturefocusmodeautofocus exposewithmode:avcaptureexposuremodeautoexpose whitebalancewithmode:avcapturewhitebalancemodecontinuousautowhitebalance atdevicepoint:devicepoint monitorsubjectareachange:yes]; } - (voi

javascript - How is it possible to run a jQuery function with an variable instead of an id? -

how possible run jquery function this: $('#do here variable').trigger('click'); with variable contains id string like: var demoid = "idx"; so how should correct syntax been written? a try of me this: function doitlikeaclick(){ var demoid = "idx"; $(demoid).trigger('click');} but not work. javascript stopp. yes $('#' + demoid).trigger('click');

android - Scroll in chrome for mobile not working -

link page not work hello community, on page scrolling safari on iphone 5 works charm. on htc chrome 31.0.1700.99 , android 4.1.1 can scroll if touch screen 2 fingers. scrolling still slowly. tried analyse problem using adb , remote debugging new mobile. it seems if there no touchstart , touchend event dunno if not fired or if need handle events manually , ain't handled. just telling me big help. lot efforts.

Read and write REG_DWORD from batch file -

my requirement read reg_dword registry , write location. have succeeded in reading registry location, don't know how write. my code: @echo off reg query hkey_local_machine\software\microsoft\windows\currentversion\netcache /v "offlinedirrenamedelete" set previous=offlinedirrenamedelete reg add hkey_local_machine\software\microsoft\windows\currentversion\mysoftware /v "cachedelete" /t reg_dword /d previous /f this code fails, "reg add" doesn't understand "previous" variable i able hard-code value , set registry. example, works: reg add hkey_local_machine\software\microsoft\windows\currentversion\mysoftware /v "cachedelete" /t reg_dword /d 5454 /f but don't know how dynamic reg_dword value registry. use %previous% content of variable. reg add hkey_local_machine\software\microsoft\windows\currentversion\mysoftware /v "cachedelete" /t reg_dword /d %previous% /f here quick reference on usin

javascript - Duplicate Key in Repeater error when there is no item -

how solve error in angularjs? imagine i'm doing todolist app, app crashes when there no item in ng-repeat. <li ng-repeat="item in myitems"></li> i think it's because of myitems, ajax returned object. when database doesn't have value, ng-repeat seem doesn't work , break whole app try, <li ng-repeat="item in myitems"></li> :) may be, missed "

ios - Domain=NSPOSIXErrorDomain Code=61 -

i'm trying connect between client(ios app) , server(node.js) using socketrocket , ws below. ios(socketrocket): nsurl *url = [nsurl urlwithstring:@"ws://localhost:8080"]; srwebsocket *_socket = [srwebsocket alloc] initwithurlrequest:[nsurlrequest requestwithurl:url]; _socket.delegate = self; [_socket open]; /* srwebsocketdelegate */ -(void)websocketdidopen:(srwebsocket*)websocket{ [websocket send:@"something"]; } -(void)websocket:(srwebsocket*)websocket didreceivemessage:(id)message{ nslog(@"didreceivemessage: %@",[message description]); } -(void)websocket:(srwebsocket*)websocket didfailwitherror:(nserror*)error{ nslog(@"the error: %@",error); } node.js(ws): var websocketserver = require('ws').server var wss = new websocketserver({ host:'localhost', port:8080 }); wss.on('connection',function(ws){ ws.on('message',function(message){ console.log('received: %s', m

ruby - How can I parallize the execution of my plugins with Celluloid? -

Image
my question should me on right way. i'm developing ruby application concurrent framework celluloid . here how looks like: i have plugins. want run them concurrently , wait until last 1 has finished. i've abstract class, called pluginframe , inherited plugin , provides run method. my idea make supervisiongroup , right idea? how can run supervisiongroup , wait until group members have finished? it's idea make separate pluginpool class, manage pool of plugins? it's interesting me limit pool size, 2 or 3 plugins run @ same time.how can achieve this? you need supervisor if plugins might crash , want celluloid restart them. what want simple using pools , futures. to have shared pool plugins need new actor that. class pluginrunner include celluloid def run(plugin) plugin.run end end plugin_runner = pluginrunner.pool(size: 4) plugins = [lastfmplugin, twitterplugin] results = plugins.map {|p| plugin_runner.future.run(p) }.map(&