Posts

Showing posts from July, 2010

javascript - return null document.getElementsByTagName -

ihave simple ul element in webpage : <div id="jqueryftd_demo" class="demo"><ul class="jqueryfiletree" style=""> <li class="directory collapsed"><a href="#" rel="/samplefolder/a/">a</a></li> <li class="directory collapsed"><a href="#" rel="/samplefolder/b/">b</a></li> <li class="directory collapsed"><a href="#" rel="/samplefolder/c/">c</a></li> <li class="directory collapsed"><a href="#" rel="/samplefolder/d/">d</a></li> <li class="file ext_accdb"><a href="#" rel="/samplefolder/sampledbfile.accdb">sampledbfile.accdb</a></li> <li class="file ext_txt"><a href="#" rel="/samplefolder/sometext.txt">somete

javascript - Parse Cloud Code returns pointer instead of object after save -

problem: i'm trying return full object, instead keep getting pointer back. think might because modify object, save, return in response. how able modify, save, , return full object , not pointer? code: relevant code shown: getpicture(username, { success: function (pictureobject) { response.success(pictureobject); //always getting pointer }, error: function (error) { response.error(error); } }); ... function getpicture(username, callback) { var pictures = parse.object.extend("pictures"); var pictures = new parse.query(pictures); pictures.equalto("username", username); pictures.find({ success: function (results) { var object = results[0]; object.increment("views", 1); object.save(); //i think issue here callback.success(object); }, error: function (error) { callback.error(error); } }); } thank you

node.js - index.js to share mysql details - with page.js? -

index.js has mysql connection details page.js able use these details not have provide mysql details page.js again. also.. page.js 's output needs made available index.js index.js can see the mysql query results. index.js: var http = require('http'); var url = require('url'); var mysql = require('mysql'); var connection = mysql.createconnection({ host : '-------------', user : '-----', password : '-------', database : '-----', }); var server=http.createserver(function(req,res){ res.writehead(200,{'content-type': 'text/html; charset=utf-8'}); require('page.js); res.end('test'); }).listen(80); page.js: connection.connect(); var querystring = 'select * t1 order id desc limit 5'; connection.query(querystring, function(err,res,fields){ bb = json.stringify(res); }); connection.end(); in page.js : exports.makequery = function(con

java - Composite recording creates empty video -

here code create composite video recording using java.but creates blank video .not playing stream.why? mp = kurento.createmediapipeline(); webrtcendpoint webrtcepred = new webrtcendpoint.builder(mp).build(); webrtcendpoint webrtcepgreen = new webrtcendpoint.builder(mp).build(); composite composite = new composite.builder(mp).build(); hubport hubport1 = new hubport.builder(composite).build(); hubport hubport2 = new hubport.builder(composite).build(); hubport hubport3 = new hubport.builder(composite).build(); recorderendpoint recorderep = new recorderendpoint.builder(mp, recording_path + "twoside" + recording_ext).build(); webrtcepred.connect(hubport1); webrtcepgreen.connect(hubport2); hubport3.connect(recorderep); recorderep.record(); i change code follows,now working fine // media pipeline pipeline = kurento.createmediapipeline(); composite composite = new composite.builder(pipeline).build(); hubport hubport1 = new hubport.bu

ios - Equivalent of loginViewShowingLoggedInUser -

i trying migrate app facebook sdk 3.4 4.x. used following import #import <fbsdkcorekit/fbsdkcorekit.h> #import <fbsdkloginkit/fbsdkloginkit.h> #import <fbsdkloginkit/fbsdkloginbutton.h> i used have 2 methods - (void)loginviewshowingloggedinuser:(fbloginview *)loginview - (void)loginviewfetcheduserinfo:(fbloginview *)loginview user:(id<fbgraphuser>)user i can't find these methods in 4.x sdk. i can see fbloginview changed fbsdkloginbuttondelegate. equivalent of above 2 methods. tried looking @ facebook ios samples not figure out. there's method called loginbutton:didcompletewithresult:error: defined in fbsdkloginbuttondelegate : - (void) loginbutton:(fbsdkloginbutton *)loginbutton didcompletewithresult: (fbsdkloginmanagerloginresult *)result error: (nserror *)error; source : facebook sdk docs note : above delegate login button, i.e. delegate called when user performs login using login button. dele

c# - Switch with methods without constants -

i want accomplish task there method in c# . give me syntax please. switch(methods) { case method1: //do method2 case method3: // method4 case method5: // method6 } you can if know class name , method name actually. see below type magictype = type.gettype("magicclass"); methodinfo magicmethod = magictype.getmethod("itsmagic"); object magicvalue = magicmethod.invoke(); check below url https://msdn.microsoft.com/en-us/library/a89hcwhh(v=vs.110).aspx

Displaying dynamic data using jQuery chart -

here assignment: create page displays values using jquery chart, can switch between day-wise view , month-wise view using ajax x-axis: days/ months y-axis: a,b,c,d i've got variable values ready , drop down list change variables. don't know how feed these values jquery chart. i'm using jqxchart. how achieve this? please explain code. how feed date , month in jqxchart? here html code : <div id="chartcontainer" style="width:800px; height: 400px"></div> <div id="valueaxisdiv" class="form-group"> <h3>value axis : </h3> <select id="valueaxis"> <option>total number of feedback entries category</option> <option>average score category</option> <option>total number of feedback entries</option> <option>average score</option&g

Nginx 500 internal error -

http { server { listen 443 ssl; server_name node.ramblr.io; server_tokens off; root /home/john/public_html/node.ramblr.io; index index.php index.html index.htm; ssl on; ssl_certificate /etc/pki/tls/certs/node.ramblr.io.crt; ssl_certificate_key /etc/pki/tls/private/node.ramblr.io.key; ssl_session_timeout 5m; ssl_protocols sslv3 tlsv1; ssl_ciphers all:!adh:!export56:rc4+rsa:+high:+medium:+exp; ssl_prefer_server_ciphers on; location / { try_files $uri $uri/ /index.html; } location ~ /\.ht { deny all; } } } its in nginx.conf that nginx config, have 2 other sites reversed proxied , work index.php reason. want know why getting 500 internal error off this. here of error logs nginx 2016/01/16 00:32:36 [crit] 6458#0: *5

ios - How To Get A Perfect Position Of Rotating View? -

Image
i have 1 view , rotating view using cabasicanimation . problem how perfect position of view while rotating. have tried many type of codes can't got perfect position during rotation of view. cabasicanimation *rotationanimation = [cabasicanimation animationwithkeypath:@"transform.rotation.z"]; nsnumber *currentangle = [circleview.layer.presentationlayer valueforkeypath:@"transform.rotation"]; rotationanimation.fromvalue = currentangle; rotationanimation.tovalue = @(50*m_pi); rotationanimation.duration = 50.0f; // might fast rotationanimation.repeatcount = huge_valf; // huge_valf defined in math.h import [circleview.layer addanimation:rotationanimation forkey:@"rotationanimationleft"]; i using code rotating view. i have attached 1 photo of view. thank in advance please if know. to view's parameters during animation should use view.layer.presentationlayer added: in order coordinate of top left corner of view,

java - Learning basics about objects -

public class vector { private final double deltax,deltay; public vector(double deltax, double deltay) { this.deltax = deltax; this.deltay = deltay; public vector plus(vector(a, b)){ return new vector(this.deltax+a,this.deltay+b); } why not work when trying create method add new vector existing one? defining deltax horizontal component , deltay vertical. you aren't using correct syntax. method should be: public vector plus(vector other) { return new vector(this.deltax + other.deltax, this.deltay + other.deltay); } that way, can pass vector instances method.

php - Inserting data into SQL database not working but said it has -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 23 answers so website have @ minute isn't inserting data correctly. have id , sub_date (date got submitted) these automatic of thought don't need create variables , stuff? correct me if im wrong? php code: <?php if (isset($_post['addbtn'])) { $m_titleadd = $_post['m_titleadd']; $authoradd = $_post['authoradd']; $statusadd = $_post['statusadd']; $tutorialadd = $_post['tutorialadd']; if (empty($errors)) { $sqlinsert = $odb -> prepare("insert `methods` values(null, :id, :m_title, :sub_date, :status, :author, :tutorial)"); $sqlinsert -> execute(array(':id' => null, ':m_title' => $m_titleadd, ':sub_date' => nul

Find what time (in second) spend to play note in musicxml file -

i have note <note default-x="106.96" default-y="-25.00"> <pitch> <step>a</step> <octave>3</octave> </pitch> <duration>2</duration> <voice>1</voice> <type>eighth</type> <stem>up</stem> <staff>1</staff> <beam number="1">begin</beam> </note> how can find time spend play (in second) if tempo = 120bpm ? create table this: durationhashtable = { { "whole", 4.0 }, { "half", 2.0 }, { "quarter", 1.0 }, { "eighth", 0.5 }, { "16th", 0.25 } } then, formula is: notedurationseconds = ( 60.0 / beatsperminute ) * durationhashtable["eighth"]; this special, simple case where notes not dotted the time signature has <beat-type>4</beat-type> you not required support tuplets. things can become more complex, recom

sql - Display grid on basis of Enquiry No -

the below query displays me result want show in grid. select bb.project_id, bb.building_id, bb.flat_id flat_id, cc.cust_enq_no enquiry_no, cc.name enquiry_name, to_char (cc.f_followup_date, 'dd/mm/yyyy') last_followup_date, cc.f_remarks last_followup_comments xxacl_pn_flat_det_v bb inner join xxcus.xxacl_pn_customer_enquiry_v cc on bb.project_id = cc.mkey but there change in requirement. now each f_flat_id there multiple cust_enq_no say select * xxcus.xxacl_pn_customer_enquiry_v f_flat_id = '18158' it has 3 records. so first query, how multiple cust_enq_no update i want filter , display in grid protected void displaygridenquiry() { oraclecommand cmd1 = new oraclecommand("select bb.project_id, bb.building_id, bb.flat_id flat_id, cc.cust_enq_no enquiry_no, " + "cc.name enquiry_name, to_char (cc.f_followup_date,'dd/mm/yyyy') last_followup_date, cc.f_remarks last

c# - How to typecasting the object class from the dictionary value (object) -

how can fix typecast error... want create new object using json.. i attached example code.. public class person { public int age; public person(int _age) { this.age = _age; } } dictionary<string, object> dic = new dictionary<string, object>(); dic.add("type", "person"); dic.add("data", new person(25)); string json = jsonconvert.serializeobject(dic); dic = jsonconvert.deserializeobject<dictionary<string, object>>(json); person p2 = (person)dic["data"]; console.writeline(p2); you getting dictionary of string,person , casting person, thats why throwing exception. try var person = jsonconvert.deserializeobject<person>((dic["data"].tostring())); instead of person p2 = (person)dic["data"]; and person.age 25 . edit: public mainwindow() { initializecomponent(); dictionary<string, object> dic =

datagridview - How to display the selected rows of the grid view in another form using C# Form application? -

i want display data datagridview in second form text boxes in first form, when selected row double click event . private void button1_click(object sender, eventargs e) { frm_drivers_list frm = new frm_drivers_list(); frm.showdialog(); id = convert.toint32(frm.dgv_driver.selectedrows[0].cells[0].value); this.txt_code.text = frm.dgv_driver.selectedrows[0].cells[1].value.tostring(); this.txt_driver_name.text = frm.dgv_driver.selectedrows[0].cells[2].value.tostring(); this.txt_tel1.text = frm.dgv_driver.selectedrows[0].cells[3].value.tostring(); this.txt_tel2.text = frm.dgv_driver.selectedrows[0].cells[4].value.tostring(); this.txt_address.text = frm.dgv_driver.selectedrows[0].cells[5].value.tostring(); this.dtp_s_work.text = frm.dgv_driver.selectedrows[0].cells[6].value.tostring(); this.cb_workplace.text = frm.dgv_driver.selectedrows[0].cells[7].value.tost

ios - Realm: get notified on new insertion / update of object -

i trying out realm.io on swift project. insertion , update of objects pretty straightforward, here comes problem: not able catch new object insertion/update notification. what want achieve simple, save list of objects in realm. , upon app start/refresh, app request new list of objects remote server , perform realm.add(objects, update:true) (i've set id object's primary key same objects not duplicated), ui end of app should notified whenever there's new object, or existing objects have been updated. i've tried using realm.addnotificationblock(_:) it's called every time rlmrealmdidchangenotification event, though there no new object/update. how achieve this? edit: code sample public class datastoragemanager { var token : notificationtoken? static let sharedinstance = datastoragemanager () public func savelista(list: [a]?, realm:realm) { self.token = realm.addnotificationblock({ (notification, realm) -> void in print("database cha

Selenium-IDE, how to "Please do not include core selenium in your add-on, instead just extend from the original one." for Mozilla Addons Signing -

Image
i have forked & extended selenium project github make small changes few selenium ide files. dont know of project. i use go command building it, know nothing of it. go.exe ide when asked review mozilla addons signing process, got rejected suggestion. please not include core selenium in add-on, instead extend original one. most asking replace libraries source-code of selenium core selenium core libraries: selenium core source: is mozilla wants? if yes, how build.

angularjs - angular CORS to gist -

hi guys im building angular app , have problem reaching json on gist, json when im trying $http.get on url im getting: request header field authorization not allowed access-control-allow-headers in preflight response. now see option request being sent good. im using satellizer auth service. things tried: $http.get(url, { headers: { 'authorization': function(conf){ return undefined; } }}).then(function(data){ $scope.countries = data; }); and tried change url https http , got: response preflight invalid (redirect) now know server need include in response header things can make request server not mine :\ there no way modifiy it.. anyone? problem was sending authorization header default because of satellizer satellizer supports skipauthorization parameter.. $http({ url: url, method: 'get', skipauthorization: true}) this fix problem

spring - How to use HibernateTemplate? -

i performing retrieval operation list of students database. getting 'empty' data database. used hibernatetemplate in spring hibernate integration, domain class:- @entity @table(name="student") public class stdbo { @id private int sno; private string sname,sadd; //setters , getters } how can use hibernatecallback() interface search operation? first time integrating spring hibernate, below way correct? tried many ways perform search operations using hibernatetemplate failing details dao @repository public class stddao { private hibernatetemplate ht; public void setht(hibernatetemplate ht) { this.ht = ht; } public list<stdbo> select(){ list<stdbo> list = ht.executefind(new hibernatecallback() { public object doinhibernate(session ses) throws hibernateexception, sqlexception { criteria criteria=ses.createcriteria(stdbo.class); system.out.println("before printing sutdents");

java - how to sort columns in ireport crosstab in a specific scheme -

Image
the following image shows crosstab in ireport: i want sort columns in specific order, knowing in crosstab data, put list of objects list<champetatateliers> following attributes : public class champetatateliers { private string numero; private string denominationfr; private string etatentreesortie; public champetatateliers(string numero, string denominationfr, string etatentreesortie) { this.numero = numero; this.denominationfr = denominationfr; this.etatentreesortie = etatentreesortie; } } the etatentreesortie shown in columns, denominationfr shown in rows, , numero used count in crosstab string rapportlien = "/situationequipement.jasper"; map parametres = new hashmap(); jrbeancollectiondatasource data = new jrbeancollectiondatasource(atelierses); in java i'm putting these objects in list atelierses list<champetatateliers> , there way sort columns in list or in crosstab ireport, xml code on ir

linux - Alsalib mmap direct write -

i messing around alsa library , can't figure out how playback direct write. using access type mmap interleave. trying write square wave. i created buffer of shorts hold square wave. have tested snd_pcm_writei , works. i call snd_pcm_begin , use pointers given area write device: while(1){ int msg; frames_available = snd_pcm_avail_update(handle); snd_pcm_mmap_begin(handle,&areas,&offset,&limit_frames); frames_to_write = frames;//frames size of buffer in frames if(frames_to_write > limit_frames) frames_to_write = 0; int offset_frames = (areas[0].first + offset*areas[0].step)/16; short* write_ptr = (short*)areas[0].addr + offset_frames; //fill buffer stuff for(int =0; < frames_to_write;i++){ write_ptr[i] = buffer[i]; } msg = snd_pcm_mmap_commit(handle,offset,frames_to_write); } the sound produced choppy , gets cut off after. gets cut off because limit_frame reaches 0. notice limit_frames stays @ 0 if there frames_available. edit: used

Convert Delphi BufferToHex function to Python -

i learning python. apologies in advance. i have delphi function creates string hash. first converts string elf hash(??) changes hex number. i have first part working in python def elfhash(key): hash = 0 x = 0 in range(len(key)): hash = (hash << 4) + ord(key[i]) x = hash & 0xf0000000 if x != 0: hash ^= (x >> 24) hash &= ~x return hash in delphi additional step done converts hex value function buffertohex(const buf; bufsize : cardinal) : string; var : longint; begin result := ''; := 0 bufsize - 1 result := result + inttohex(tbytearray(buf)[i], 2); end; buf here elf hash got, stored in delphi longint , bufsize delphi sizeof() of longint, far seems return 4. how make python function similar buffertohex 1 return equivalent output? far can tell python types different , not returning same byte size (it seems return 16 not 4), , when messed ctypes stuff still getting different numbe

node.js - CANNOT GET with mongodb and nodejs -

hello i'm trying book name db when execute script localhost shuts down , have restart. error : referenceerror: text not defined here server.js var express = require('express'); mongoclient = require('mongodb').mongoclient, app = express(), mongourl = 'mongodb://localhost:27017/firstapp'; var bodyparser = require('body-parser'); var morgan = require('morgan'); var mongoose = require('mongoose'); var passport = require('passport'); var redisclient = require('redis').createclient; var redis = redisclient(6379, 'localhost'); var config = require('./config/database'); // db config file var user = require('./app/models/user'); // mongoose model var products = require('./app/models/products'); //get mongoose model var makeissue = require('./app/models/makeissue'); //get mongoose model var port = process.env.port

python - pandas: Problems with merging multiple data frames to get desired MultiIndex -

Image
i have defined 3 simple data frames follows: dates = [dt.datetime(2015,1,1),dt.datetime(2015,1,2)] column_names = ['a','b'] data_open = pd.dataframe([[1,2],[3,4]], index=dates, columns=column_names) data_close = pd.dataframe([[5,6],[7,8]], index=dates, columns=column_names) data_volume = pd.dataframe([[9,10],[11,12]], index=dates, columns=column_names) when printed follows: print data_open b 2015-01-01 1 2 2015-01-02 3 4 print data_close b 2015-01-01 5 6 2015-01-02 7 8 print data_volume b 2015-01-01 9 10 2015-01-02 11 12 what looking way merge 3 of them , single dataframe multiindex this: i new pandas , looked in documentation , not find looking for. you can use concat specify keys , swaplevel , sort_index : df = pd.concat([data_open, data_close, data_volume], keys=['open', 'close', 'volume']) df = df.swaplevel(0,1).sort_index() print df

elasticsearch - Elastic Search Aggregation on Array Items -

given below elastic document on want fire aggregation query. { "id": 1, "attributes":[ { "fieldid": 1, "value": "male" }, { "fieldid": 2, "value": "12/11/2015" } } { "id": 2, "attributes":[ { "fieldid": 1, "value": "male" }, { "fieldid": 2, "value": "11/11/2015" } } the result has follows. [ { "key" : "male", "doc_count" : 1 } ] [ { "key" : "12/11/2015", "doc_count" : 1 }, { "key" : "11/11/2015", "doc_count" : 1 } ] is there way can achieved in elastic search. that's possible. see example: we have map attributes nested type able a

c# - Not able to print a document -

one of methods used : printdocument doc = new printdocument(); doc.printersettings.printername = "printername"; string[] files = directory.getfiles("d:\\invoice"); foreach (string file in files) { string fname = path.getfilename(file); doc.documentname = fname; doc.print(); console.writeline(file); } this gives exception on doc.print() line. "settings access printer 'printername' not valid." the other method used : process printjob = new process(); printjob.startinfo.filename = @"c:\program files (x86)\adobe\reader 10.0\reader\acrord32.exe"; printjob.startinfo.useshellexecute = false; printjob.startinfo.verb = "print"; printjob.startinfo.createnowindow = t

html - same iframe load with other page from iframe jquery event -

<iframe id="iframe" style=" width:100%; height:500px" src="other.jsp" frameborder="0" name="myone"> <html> <head> <script> $(function() { $("#adduser1").click(function() { alert("hiiii"); $('#iframe').attr('src', 'adduser.jsp'); }); }); </script> </head> <body> <input type="button" name="adduser" id="adduser1" value="adduser"/> </body> </html> </iframe> here want load same iframe (its loaded other.jsp ) other jsp adduser.jsp on triggering of inside event of same iframe alerting 'hiiii' not loading jsp page you trying load iframe button inside iframe, never work way. should use window.location this $(function

Grails Spring Security max concurrent session -

i have grails 2.5.1 app spring security plugin(2.0-rc5). block number of current session per user. have read blog , doesn't work.( http://www.block-consult.com/blog/2012/01/20/restricting-concurrent-user-sessions-in-grails-2-using-spring-security-core-plugin/ ) resources.groovy beans = { sessionregistry(sessionregistryimpl) concurrencyfilter(concurrentsessionfilter,sessionregistry,'/main/index'){ logouthandlers = [ref("remembermeservices"), ref("securitycontextlogouthandler")] } concurrentsessioncontrolstrategy(concurrentsessioncontrolauthenticationstrategy, sessionregistry) { exceptionifmaximumexceeded = true maximumsessions = 1 } } in boostrap.groovy def init = { servletcontext -> springsecurityutils.clientregisterfilter('concurrencyfilter', securityfilterposition.concurrent_session_filter) } and config.groovy have added this: grails.plugin.springsecurity.usehttpsessioneventpub

python - How to run code that needs too much RAM on OpenShift? -

i have problem openshift. trying add django_geoip django app. however, when try initialize database, openshift kills it. think needing memory. if run update code ./manage.py geoip_update (i tried running nohup), output: downloading zipfile ipgeobase.ru... info:import:downloading zipfile ipgeobase.ru... extracting files... info:import:extracting files... updating locations... info:import:updating locations... updating cidr... info:import:updating cidr... 61% after 61% of cidr update crashes. if following log or logged in through ssh, disconects me: /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/ruby_compat.rb:30:in `select': closed stream (ioerror) /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/ruby_compat.rb:30:in `io_select' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/packet_stream.rb:75:in `available_for_read?' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/packet_stream.rb:87:in `next_packet' /var/lib/gems/1.9.1/gems

freepbx - Cant install PIAF, issue with 'stopping ntp services' -

im having failure install piaf 3 or piaf 3.1.6. hangs @ 'stopping ntp services'. both times tried clean install scratch. after 5 mins ctrl-c picks up, fails later when again hangs 'stopping ntp services'. ideas anyone? centos 6.7 64bit minimal green 3.1.6 033015 running on dell desktop t20. open new terminal. service ntpd stop you see installation continue stuck. repeat until when ever script hang while 'stopping ntp services' it works file me, hope solve problem well. keep me posted.

android - How to make phonegap app, 'don't use' full screen -

Image
i'm creating phonegap app in order learn. this code far: <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="msapplication-tap-highlight" content="no" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> <link rel="stylesheet" type="text/css" href="css/index.css" /> <title>el especialista</title> </head> <body> <div class="branca"> <header> <img src="img/logo.png" /> </header> </div> <script type="text/javascript" src="co

java - How to avoid show parameters in the browser address bar after RequestDispatcher.forward? -

i have following code : requestdispatcher dispatcher = request.getrequestdispatcher(viewname); // while viewname servlet name; dispatcher.forward(request, response); it's successful forwording except parameters shown in browser address bar. this: http://localhost:8080/testweb/action/loginaction/login?username=apcpros%40163.com&password=12234 i not want show parameters (e.g. username , password ) in browser address bar after forwording. should do? forward post , not get? that's , if contains parameters need forwarded, or remove.

java - cannot be cast to [Ljava.lang.Comparable -

so need dynamic ordered list. public class dynarraylistord<t extends comparable<t>> { private t[] tab ; public dynarraylistord() { tab = (t[])new object[startsize]; } .... main { dynarraylistord tab = new dynarraylistord(); tab.add("john"); tab.add("steve"); } and when run code error: exception in thread "main" java.lang.classcastexception: [ljava.lang.object; cannot cast [ljava.lang.comparable; @ structures.dynarraylistord.<init>(dynarraylistord.java:14) @ structures.dynamicarrayappp.main(dynarraylistord.java:119) the erased type of t[] tab comparable[] . thus, need use type in constructor: public dynarraylistord() { tab = (t[]) new comparable[startsize]; } you should enable unchecked warnings avoid these kinds of problems in first place.

ios - Making sure I'm explaining nested GCD correctly -

so i'm putting 10 tasks on concurrent queue using dispatch_async . not block next task, , gets processed in order. ui responsive. for (int = 0; < 10; i++) { dispatch_async(concurrencyqueue, ^() { nslog(@"..calling insertion method insert record %d", i); dispatch_sync(serialqueue, ^() { //this simulate writing database nslog(@"----------start %d---------", i); [nsthread sleepfortimeinterval:1.0f]; nslog(@"--------finished %d--------", i); }); }); } within each task, simulate write database "1 sec sleep" on serial queue via dispatch_sync . i thought dispatch_sync blocks everyone, , syncs tasks because that's how behaves when use individually. however, in situation, not block main thread. instead, runs beautifully in background want it. is because whatever thread associated queue being affected? for example, main thread executing concu

android - Cannot find module 'umask' -

i new ionic framework. today tried create new project using ionic. when tried adding android platform app using command ionic platform add android getting below error: updated hooks directory have execute permissions module.js:327 throw err; ^ error: cannot find module 'umask' @ function.module._resolvefilename (module.js:325:15) @ object.<anonymous> (c:\users\jeffrey\appdata\roaming\npm\node_modules\cor dova\node_modules\npm\lib\utils\umask.js:1:75) nodejs version: 5.4.1 please resolve error possible. you can try uninstalling , reinstalling cordova using npm: npm uninstall -g cordova npm install -g cordova@latest

Javascript logging setup for unit testing and running browser based web app -

i working on client side javascript web app. using log4javascript logging application functionality while running on local server , becuase couldn't log4javascript work during unit testing (in either jasmine+karma or mocha), using log4js logging while running unit tests on node using mocha. to log during normal webb app running create log4javascript logger html page (as cant figure out way create glogal logger javascript.js file) using: <script src="{{ url_for('static', filename='js/log4javascript.js') }}" type="text/javascript"></script> <script type="text/javascript"> var logger = log4javascript.getdefaultlogger(); </script> beacause want log console during unit testing need set-up log4js in same javascript.js files logging during normal web app running from. ie: var log4js = require('log4js'); log4js.configure({ appenders: [ { "type": "loglevelfi