Posts

Showing posts from February, 2013

how to invoke python script in c++ code? -

in c++ application, want invoke python script processing works. have searched in google , found there 2 ways this: (1). use `system` command. this, `system('python myscript.py');` (2). use `pyrun_simplestring("execfile('myscript.py')");` i want ask that, way better , there better way work? thanks. i want ask that, way better , there better way work? you should notice python engine written in c , therefore provides native c-api . allows interact more directly python code, means of calling functions , using python objects. if want integrate c++ code without hassling c-api, there's excellent , easy use boost::python library.

version control - What happened after svn switch and how to commit local changes? -

i made changes in code , after decided code not trunk, should rather experiment bit (with code) , later if succeed should go trunk. so needed create branch -- created new directory in branches, copied svn copy trunk newly created branch, , went source code directory , executed svn switch . and @ point don't understand happened. svn traversed entire directory in similar fashion when apply svn status , putting file a letter directories c , in summary read: updated revision 1458. summary of conflicts: tree conflicts: 6 but when checked files saw files (luckily) not updated svn repository (once again, after last commit made changes code , then decided branch). when issue svn status can see many entries info directory: a + c testsuite > local edit, incoming delete upon switch the steps made read on so, , there not mentioned such problems. how can commit changes branch (of course don't want delete changes). update : found partial answer on so, ca...

java - Can anyone please correct my given statement if its wrong(about throw/throws) -

throw :-we have handle exception(we in sense user here). throws :we asking compiler handle exception raised. please correct if stated above wrong . if wrong please tell me correct statement. thanks in adv! i'd both not exact . throw statement causes throwing of exception. no-one has catch however. example runtime exception can thrown without requirement catch them in application code. throws keyword allows declare method may throw exception of specific type.

Android TableLayout in LinearLayout - Remove spaces in between columns and rows -

Image
i struggle more ui design in android making application, giving go: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <tablelayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <tablerow android:id="@+id/rowone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" > <button android:id="@+id/bone" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="button" /...

phpbb3 - Bridge between Core PHP site and PHPBB -

i want add bridge between php website , phpbb3 forum, when user login in website automatically logged-in phpbb forum or when sign-up in site automatically signed-up in forum. have seen many article not able find correct 1 can solve problem. you can use session phpbb forum uses integration. define('in_phpbb', true); $phpbb_root_path = (defined('phpbb_root_path')) ? phpbb_root_path : '/var/www/clients/client9/web8/web/forums/'; $phpex = substr(strrchr(__file__, '.'), 1); include_once($phpbb_root_path . 'common.' . $phpex); $user->session_begin(); from here, can use $user object integration. example, code below show if user logged in or not. if ($user->data['username'] == 'anonymous') { echo 'please login!'; } this uses anonymous user validation, phpbb adds first user account when installed.

R : Add CSS color coding in a HTML table -

Image
i need export data.frame html file , color backgroud of table cell based criteria. sample data.frame : name low high value1 value2 value3 ben 3 10 2 5 8 cat 3 10 3 9 4 dan 3 10 5 7 6 desire output : i used below codes generate html, thank help htmlheadertext ="sample report" htmlfile =htmlinitfile(outdir = getwd() , filename = "sample" , extension = "html" , title = "r output" , cssfile = paste(getwd(), "/html_tables.css", sep="") , htmlframe = false , usegrid = false , uselatex = false) html(htmlheadertext, file = htmlfile) html(dataset, row.names = false) htmlendfile() i found solution need though may not best way it. added span in each ce...

video - Scenecut detection and consistent GOP size - adaptive streaming -

sample command: -map 0:0 -f mp4 -vcodec libx264 -preset slow -profile:v main -vf scale="640:trunc(ow/a/2)*2" -vb 700k -minrate 650k -maxrate 750k -bufsize 10000k -an -g 48 -x264opts keyint=48:min-keyint=10:scenecut=40 -flags +cgop -sc_threshold 40 -pix_fmt yuv420p -threads 0 -y there such no error in encoding, wanted understand following points- 1) above command ensure range of gop size {10,48}, , if scene change value (frame1 fame2) >40%, keyframe introduced there? 2) means in 3 hours of source video, there no guarantee gop size remain same 3) no consider, creating 7 mp4 files each different bitrate , resolution. (these mp4s encoded smooth in later stage). hence targeting adaptive streaming. when did that, found if gop sizes not consistent across each bitrates. mean is, ex: if in bitrate1 - gop size 10, 20, 48 , on, in other bitrates wasnt in same sequence. hope question makes sense. so there way ensure gop size may vary across 1 single output. should c...

ruby - Rails url attribute's value cannot contain symbol '#' -

i've tried send request this. localhost:3000/ws/job_histories/index?agent_id=#1000 but on controller i've received agent_id='' or 1 localhost:3000/ws/job_histories/index?agent_id=10#00 i've received agent_id='10' . think problem has because rails understand comment. how can correctly received data. rails doesn't give me exception. the hash symbol fragment identifier , browser not send webserver ever. if want send need url encode ( %23 ), can achieve cgi.escape('#') .

Selected element rotation in Jquery -

i'm trying build own lightbox using jquery i'm stuck on getting next image show up. know current build not working because $("element").next() same . need somehow make selector variable rotates next element every time button pressed. how can in jquery? other tips on wrong code welcome too. this got far: (function( $ ) { $.fn.jlight = function(options) { var settings = $.extend({ // these defaults. shadowwidth: $(window).width(), shadowheight: $(document).height(), width: $(".jimage-container img").width(), height: $(".jimage-container img").height(), },options); var left = ($(window).width() - $(this).outerwidth()) / 6; var bot = $(window).height() /2 var bottom = bot/2; var img = $("#showbox").find("img").attr("src"); console.log(img); $(this).click(function(){ console.log('clicked showbox'); $(document).keyup(function(eve...

python - Get pip/setuptools version of package from within the package? -

i have package using setuptools it's deployment. want have function within package (cli tool) reports version of package. should report version field used in call setup . there way can access value on installed package? for example, setup.py calls setup version = '0.1.6' , installes command line tool tool . want call tool --version prints version 0.1.6 . it's common practice list in package's main __init__.py file. instance, if package called sample , , lived in sample directory, have sample/__init__.py file this: __version__ = '0.1.6' def version(): return __version__ and make use of want in cli interface. in setup.py , if wish can read value code in order not create redundancy, this: import os.path here = os.path.abspath(os.path.dirname(__file__)) # read version number source file. # why read it, , not import? # see https://groups.google.com/d/topic/pypa-dev/0pkjvpcxtzq/discussion def find_version(*file_paths): # ...

sed - Can I use awk to specify in which column to place string? -

i have tab separated text file called test.txt multiple columns i'm trying make identical file called output.txt. the test.txt looks follows t m sx sy sz rx ry rz 49.07 0 -1.00 0.00 -0.11 20.00 0.00 -2.18 49.47 0 -1.00 0.00 -0.11 22.00 0.00 -2.33 50.89 0 -1.00 0.00 -0.11 34.00 0.00 -3.21 . : 42.06 0 29.00 0.00 -2.86 12.00 0.00 -1.44 the problem that, no matter type of delimiter use, still not have same form desired output file called output.txt in output.txt, these columns have specific location, t m sx sy sz rx ry rz ln1,col1 ln1,col9 ln1,col17 ln1,col25 ln1,col33 ln1,col41 ln1,col49 ln1,col57 i'm bit new awk, sed , of other unix commands. suggestion? have tried this? awk -f 'begin{print "t\tm\tsx\tsy\tsz\trx\try\trz"}{print $1"\t"$9"\t"$17"\t"$25"\t"$33"\t"...

multithreading - Java ThreadPoolExecutor and BlockingQueue to be used -

in oracle site ( http://docs.oracle.com/javase/7/docs/api/?java/util/concurrent/threadpoolexecutor.html ) under queuing section, mentioned "if corepoolsize or more threads running, executor prefers queuing request rather adding new thread." lot of our code have corepoolsize 1 , maximumpoolsize 10 or 20. (1) bad practice? or rather not optimal way use threadpool's? (2) recommend have corepoolsize , maximumpoolsize value same when creating threadpoolexecutor? another question respect usage of blockingqueue while creating threadpoolexecutor - between linkedblockingqueue or concurrentlinkedqueue? looking more locking , performance point-of-view? though running test proves, inserting in concurrentlinkedqueue quite fast compared other. thoughts? edited: the first part has been answered in various questions. 1 liked how threadpoolexecutor increase threads max before queueing? please find bellow points . if new task submitted list of tasks executed, , les...

php - Variable Link in Mobile Site using PDO -

i'm building mobile version of site. in desktop version have variable links example.com/mybq-access-txt.php?id=200. how can implement in mobile site? this have tried: $db = new pdo('mysql:host=localhost;dbname=db;charset=utf8', 'user', 'pass'); foreach($db->query('select id,username,tag,message,timestamp,date mybq_post_txt_main `date` between date_sub(now() , interval 30 day) , now() order rand() limit 1') $row) { echo "<a href='#mybq-access-txt?id=$row[id]'>new text</a>"; } it not load page (just stays there). mybq-access-txt mobile equivalent of mybq-access-txt.php you in url expect? looks have error in syntax. echo "<a href='#mybq-access-txt?id=$row[id]'>new text</a>"; try: echo "<a href='#mybq-access-txt?id={$row['id']}'>new text</a>";

powershell - wmi accelerator and authentication -

it seems can not find written somewhere when using wmi accelerator in powershell script, can not pass on authentication. a little background ... i writing powershell scripts sccm 2012 , found, instance, following quite using : ps r:\> ([wmi]((gwmi -namespace root\sms\site_aaa -class sms_application -filter "localizeddisplayname '%winzip_tartempion%'") .__path)).sdmpackagexml when executed locally (on sccm primary server, works fine , swiftly. however, following ends in error when executed desktop computer running w7 : ps r:\> ([wmi]((gwmi -namespace root\sms\site_aaa -credential $cred -computername cemtech -class sms_application -filter "localizeddisplayname '%winzip_tartempion%'") .__path)).sdmpackagexml for time being, using pssession out of question. current infrastructure have deal with, using sccm commandlet out of question. my question here : can confirm can not pass authentication wmi accelerator ? @ point, searc...

jquery - copy Multiple values from multiple input fields into one input field using javascript? -

i trying find way copy value of multiple input fields 1 single input field. currently can copy 1 input field 1 using following code: addevent(document.getelementbyid('inputname'), 'keyup', function () { document.getelementbyid('inputurl').value = this.value.replace(' ', ' '); $(".sect2 input[@value='']").parents(".sectxt").hide(); }); function addevent(ele, evnt, funct) { if (ele.addeventlistener) // w3c return ele.addeventlistener(evnt,funct,false); else if (ele.attachevent) // ie return ele.attachevent("on"+evnt,funct); } is possible this: addevent(document.getelementbyid('inputname, inputname2, inputname3, inputname4'), 'keyup', function () { document.getelementbyid('inputurl').value = this.value.replace(' ', ' '); $(".sect2 input[@value='']").parents(".sectxt").hide(); }); function addevent(ele, evnt, ...

objective c - Handling magic constants during 64-bit migration -

i confess did dumb , bites me. used magic number constant defined nsuintegermax define special case index. value used index access selected item in nsarray . in special case, denoted magic number value elsewhere, instead of array. this index value serialized in user defaults nsnumber . with xcode 5.1 ios app gets compiled standard architecture includes arm64. changed value of nsuintegermax , after deserialization 32-bit value of nsuintegermax , no longer matches in comparisons magic number, value 64-bit nsuintegermax . , results in nsrangeexception reason: -[__nsarrayi objectatindex:]: index 4294967295 beyond bounds [0 .. 10] . it minor issue in code, given normal range of array small, may away redefining magic number 4294967295 . doesn't feel right. how should have handled issue properly? guess avoiding magic number altogether robust approach? note i think problem magic number equivalent happened nsnotfound constant. apple's 64-bit transition guide cocoa touc...

SVN is not commiting my selenium code even after clean up -

svn not committing selenium code after clean up. getting below error on committing; problem running log svn: failed run wc db work queue associated 'd:\users\vbehl\wspsc\seleniumrepositoryproject', work item 265 (file-remove browser_files/iedriverserver.exe) access denied. svn: can't remove file 'd:\users\vbehl\wspsc\seleniumrepositoryproject\browser_files\iedriverserver.exe': access denied. previous operation has not finished; run 'cleanup' if interrupted previous operation has not finished; run 'cleanup' if interrupted

javascript - How to print popup window contents -

i have tried following: <button onclick="window.print()" class="uk-button uk-float-left"><?php echo jtext::_('com_cstudomus_imprimir'); ?></button> also: self.print() window.focus();window.print() when click on print shows main window , popup window in page going printed. need contents of popup window. this example of print popup: <div class="contentsection"> <div class="contenttoprint"> <!-- content printed here --> </div> </div> <div class="contentsection"> <a href="#" id="printout">print this</a> </div> <div class="contentsection termstoprint"> <h4>terms & conditions</h4> <p>management reserves right withdraw, amend or suspend print job in event of unforeseen circumstances outside reasonable control, no liability third party.</p> </div...

python - How do I solve the error of the official canonical "Hello, world" example app of Tornado? -

my python version 2.7.2 python runing uwsgi nginx config is location /{ uwsgi_pass 127.0.0.1:8888; include uwsgi_params; } app.py import tornado.ioloop import tornado.web class mainhandler(tornado.web.requesthandler): def get(self): self.write("hello, world") if __name__ == "__main__": application = tornado.web.application([ (r"/", mainhandler), ]) application.listen(9090) tornado.ioloop.ioloop.instance().start() then run "i run "uwsgi -s :9090 -w app" but throw error [pid: 28719|app: 0|req: 21/21] 118.207.180.64 () {38 vars in 716 bytes} [sun mar 23 22:44:34 2014] / => generated 0 bytes in 0 msecs (http/1.1 500) 0 headers in 0 bytes (0 switches on core 0) attributeerror: application instance has no call method how solve it? import tornado.web import tornado.wsgi import wsgiref.simple_server class mainhandler(tornado.web.requesthandler): def get(self): ...

c# - How do I...Count the no of records inserted. -

i'm getting values form excel in datatable i'm updating/inserting record in database. every thing working fine need once finishing records should display message user ..no of records inserted. and while inserting time throwing error string not recognized valid datetime. eg: 20 records inserted. here code: private void import_to_grid(string filepath, string extension, string ishdr) { string strconnstring = configurationmanager.connectionstrings["cargonetconnectionstring"].connectionstring; //file upload path string folderpath = server.mappath(configurationmanager.appsettings["folderpath"]); //file name string filename = lblfilename.text; //create connection string excel work book string constr = ""; switch (extension) { case ".xls": //excel 97-03 constr = "provider=microsoft.jet.o...

Trying to compare values of a checkbox list with values of an array list c# with asp.net -

we programming student information system. have far checkboxlist contains modules course selected student enrolled on. these values both stored in database. trying have list item values within checkboxlist selected/ticked based upon modules studying, based on stored in database. here our c# code: string connectionstring = webconfigurationmanager.connectionstrings["connectionstring"].connectionstring; sqlconnection myconnection = new sqlconnection(connectionstring); myconnection.open(); string com5 = "select moduleid studentmodules studentid = @studentid"; sqlcommand mycommand5 = new sqlcommand(com5, myconnection); studentidlabel.text = searchtext.text; int studentidint = convert.toint32(studentidlabel.text); mycommand5.parameters.addwithvalue("@studentid", studentidint); string comparemodules = mycommand5.executescalar().tostring(); var listofstrings = new list<string>(); sqldatareader reader = ...

java - Disruptor how to use his ring buffer to read a file? -

i looking use dirsuptor ring buffer parse file. not see how set range of value ring buffer. in example below seem. loop each item assign buffer. me, assign directly x items. when fileinputstream.read( byte[] bytes ), put these bytes ring buffer. usually buffer twice bigger bytes read. read page while computing 1 ( eg bytes array length == buffer / 2 ): executorservice exec = executors.newcachedthreadpool(); // preallocate ringbuffer 1024 valueevents disruptor<valueevent> disruptor = new disruptor<valueevent>(valueevent.event_factory, 1024, exec); // build dependency graph ringbuffer<valueevent> ringbuffer = disruptor.start(); (long = 10; < 2000; i++) { string uuid = uuid.randomuuid().tostring(); // 2 phase commit. grab 1 of 1024 slots long seq = ringbuffer.next(); valueevent valueevent = ringbuffer.get(seq); valueevent.setvalue(uuid); ringbuffer.publish(seq); } thanks since version 3.0.0 of disruptor has supported b...

objective c - UIScrollView that scrolls only programmatically -

we need make scroll view scrolling when user swipe @ area on screen, not inside scroll view . so have created scroll view working great ,now struggling find way disable scrolling within scroller , somehow read user swiping in relevant area(some strip view), , send swipes scroller, scroll programmatically with: [scrollview setcontentoffset:cgpointmake(x, y) animated:yes]; is right way achieve , or there out of box way ? how disable scrolling option inside scroller ( without disabling touches inside him-because has tableview inside), , scroll programatically? edit :: i set the [self.scrollview setpagingenabled:yes]; [self.scrollview setscrollenabled:no]; than no scrolling enabled. when swipe in view trying move scroller with: **[self.scrollview scrollrecttovisible:cgrectmake(scrollxpo+10, y, width, height) animated:yes];** but, moving 10 pixels , not moving anymore, paging not working in constellation .. edit2 changed : self.scrollview.contentoffset.x+...

statistics - Estimating VAR using statistical softwares. -

assuming data stationary or integrated of same order, matter if estimate equations individually or estimate them var? p.s. using stata, econometrics package, allows me estimate @ same time. thanks! if interested in parameter estimates, not matter if estimate individual equations. sake of equation estimation, var framework not "system", juxtaposition of related models. the purpose of var framework analyze "ripple effects" shocks 1 or more endogenous variables can have. if estimate equations individually, difficult replicate var features impulse-response plots. i encourage try estimating simple set of equations both within var framework , individually. see parameter estimates identical.

java - Timezones and JSON reading with jersey -

on page user enters birthday. model saves date javascript date. in request date gets converted utc the timezone offset of date given . on server side jersey reads date , adds the current timezoneoffset . so of writing post happens (server in cet): user enters: 01/03/1967 client transfers: json.stringify(new date(1967,2,1)) "1967-02-28t23:00:00.000z" server adds 1 hour, , gets correctly 01/03/1967 . but if user enters 01/04/1967 client transfers: json.stringify(new date(1967,3,1)) "1967-03-31t22:00:00.000z" server adds 1 hour, , gets incorrectly 31/03/1967 . when dst gets involved in summer, server add 2 hours , date correct again. i transferring date string (not date object, user entered). does else have issue? how solve discrepancy? i not getting deterministic behaviour out of json.stringify, why uses 2 hours offset , why 1 hour. for example see following dates: json.stringify(new date(1981,5,1)) ""1981-05-31t22:00:00.0...

java - How does compareTo method of Comparable class work for objects -

say had movie class following instance variables: private string mytitle; // title of bond film private string mybondactor; // name of actor portrayed james bond private int myyear; // year film released private double myfilmrating;// all-reviews.com private int mylengthhours; // hours (truncated) portion of film length private int mylengthminutes;// minutes beyond truncated hours and had arraylist of movie objects, , used bubble sort algorithm sort arraylist : public void bubblesort(arraylist<movie> list) { (int outer = 0; outer < list.size() - 1; outer++) { (int inner = 0; inner < list.size() - outer - 1; inner++) { if (list.get(inner).compareto(list.get(inner + 1)) > 0) { movie temp = list.get(inner); list.set(inner, list.get(inner + 1)); list.set(inner + 1, temp); } } } how arraylist being sorted? see when int x= 5,y=10 , can compare them x<y, can compare 2 variables, how compare 2...

python - Pyplot: Shared axes and no space between subplots -

Image
this related (or rather follow-up) new pythonic style shared axes square subplots in matplotlib? . i want have subplots sharing 1 axis in question linked above. however, want no space between plots. relevant part of code: f, (ax1, ax2) = plt.subplots(1, 2, sharex=true, sharey=true) plt.setp(ax1, aspect=1.0, adjustable='box-forced') plt.setp(ax2, aspect=1.0, adjustable='box-forced') # plot 1 ax1.matshow(pixels1, interpolation="bicubic", cmap="jet") ax1.set_xlim((0,500)) ax1.set_ylim((0,500)) # plot 2 ax2.matshow(pixels2, interpolation="bicubic", cmap="jet") ax2.set_xlim((0,500)) ax2.set_ylim((0,500)) f.subplots_adjust(wspace=0) and result: if comment out 2 plt.setp() commands, added white borders: how can make figure first result, axes touching in second result? edit: fastest way result 1 described @benjamin bannier, use fig.subplots_adjust(wspace=0) the alternative make figure has width/height ratio e...

javascript - How to determine at runtime whether a tag is valid inside a DOM element? -

i working on js plugin ( just show me colors ) walks dom tree (which not under control) , replaces textnodes span . there contexts when result in invalid markup, inside svg:text node. however, code doesn't throw errors in chrome/ff: var text = document.createelementns("http://www.w3.org/2000/svg", "svg:text"); text.appendchild(document.craeteelement("span")); even though invalid markup. similarly, putting div inside p allowed works (tm). however, putting span inside script tag allowed not work . is there way can determine @ runtime whether markup generating valid or work or not? the simplest solution might keep list of elements can validly contain span. here's list : http://w3-video.com/web_technologies/html5/span/html5_span_tag_nested.php

android - How to create a list menu from the list Activity Class,,,what i'm doing wrong???help out -

// main activity java file: in java file create various classess below shown 1 class example(textplay) want create list activity in menu list,,when run code in emulator seen application forced clossly i'm doing wrongly // package com.example.eeeramsong; import android.app.listactivity; import android.content.intent; import android.database.datasetobserver; import android.os.bundle; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.listadapter; import android.widget.listview; public class menu extends listactivity{ string classes[]={"counter","textplay","example3","example4","example5"}; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setlistadapter(new arrayadapter<string> (menu.this,android.r.layout.simple_expandable_list_item_1, classes)); } @overr...

is it working payU payment gateway integration in mobile apps -

i developing on e-commerce app selling physical goods. need 1 payment gateway. company having payu payment gateway account only. question working mobile apps ? yes have implemented payu in android app. made example app can at. https://github.com/pjtfernandes/payutestapp

Accessing SQL Server Database using web service in android app -

how can access sql server data using web service ? need access sql server data in android app ? new web service dont know how create web service , consume in android app. if solution please suggest me need it....plz...and if source code there plz post. you can access using simple doing server side coding , json encoding access , use web services. simple tutorial here php , mysql connectivity.

php - Write XML to file using JQuery AJAX -

i have write xml file , since way know javascript using ajax that's way i'm trying achieve it's been while since last used , i'm not being able parse text html codes characters instead of characters themselves. what have: ajax $.ajax({ type: 'post', url: "writexml.php", datatype: 'xml', data: {filename: "test.xml", content: listxml}, error: function() { alert("unknown error. data not written file."); }, success: function() { window.open("test.xml"); } }); php file <?php $filename = htmlspecialchars($_post["filename"]); $content = htmlspecialchars($_post["content"]); $file = fopen($filename, "w"); fwrite($file, $content); fclose($file); ?> what trying achieve: <?xml version="1.0" encoding="utf-8"?> <serieslist> <series> <title>ookami koushinryou</title> <score...

machine learning - Custom Features using scikit-learn -

i working on project classify short text. 1 requirement have along vectorizing short text, add additional feature length of text, number of url's etc features each input. is supported in scikit-learn? link example notebook or video help. thanks, romit. you can combine features extracted different transfomers (e.g. 1 extracts bag of words (bow) features 1 extracts other statistics) using featureunion class. the normalization of features , there small number respect number of distinct bow features problematic. whether or not problem depends on assumptions made models trained downstream , on specific data , target task.

java - Unable to store information as attributes in LDAP using JNDI -

i'm trying bind java object set of attributes based on tutorial given here //in main() method of program hashtable env = new hashtable(); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "ldap://localhost:10389/o=csrepository"); env.put(context.object_factories, "sample.userfactory"); // create initial context dircontext ctx = new initialdircontext(env); user usr = new user("goro"); ctx.bind("cn=kill bill, ou=employees", null, usr.getattributes("")); i have user class follows, public class user implements dircontext { string employer; attributes myattrs; public user(string employer){ this.employer = employer; myattrs = new basicattributes(true); attribute oc = new basicattribute("objectclass"); oc.add("extensibleobject"); oc.add("top"); myattrs.pu...

r - break bar to see the difference between small and big values -

i have values want plot in geom_bar() chart. problem data is, values small (0:100) , values big (50000:30000000). is possible break bar of these large values, axis goes 0 100 , 50000 largest values visible gap in between?

php - ajax pagination if condition running both url when page is clicked -

i have dropdown different client each client has different page,so when select first client , press button go selected client page show data pagination ,my problem starts here select next client , press button go the selected client page show data pagination,when click first 1 2 3...last pagination button perform both url url first page , second page,can 1 know fix ,thanks code : <script type="text/javascript"> $(document).ready(function(){ $("#clientbutton").on("click", function() { var clientid=$("#client").val(); function loading_show(){ $('#loading').html("<img src='image/loading.png'/>").fadein('fast'); } function loading_hide(){ $('#loading').fadeout('fast'); } function loaddata(page){ ...

javascript - Dynamic Highcharts with maximum xaxis points -

i try create dynamic highcharts. use series.addpoint . works fine chart adds points , doesn't move here - jsfiddle . can 100 points on screen. how can make 10 points on screen , hide old points? http://api.highcharts.com/highcharts#series series.addpoint()'s third argument boolean enables shifting. if series not shifting, try setting third parameter true. as second part, sure want "hide" old data? old data should shifted off end in real time graph (which assume you're going for). if have many points, can make x-axis smaller via axis.setextremes(). http://api.highcharts.com/highcharts#axis

c++ - SoundCloud Public Stream 403 Forbidden -

using juce, i've gotten far getting redirect link, result link not work in code! oddly enough, copy/paste of link browser shows indeed works, in code, results windows giving me 403 forbidden. here's example link obtained worked in browser when given, not in code: http://soundcloud.vo.llnwd.net/ddkx2ubgyx41.128.mp3?awsaccesskeyid=akiaj4iaze5eoi7pa7vq&expires=1395669031&signature=v%2bw8zfd36gqnofmve5tnx9liujq%3d&e=1395669031&h=b7434c017179ca0393ef9656c16853ad any insight appreciated why be!

iis 7 - HTTP error 404: The request resource is not found -

i have 3 systems running on iis7 static ip address 192.168.66.5. have configured system run on same ip address different ports , subdmain like; 192.168.66.5:81 hostname ams.tpf.go.tz 192.168.66.5:82 hostname gmis.tpf.go.tz 192.168.66.5:83 hostname records.tpf.go.tz 192.168.66.5:84 hostname cmis.tpf.go.tz i configure these on iis7 , defined them in router. when client opens ams.tpf.go.tz without specifying port number, error 404 returned: requested resource not found. this occurred me - make sure iis website started - mine had been stopped. error receiving in visual studio: unable start debugging on web server. web server not find requested resource. right click on website ( i.e. default website ) in iis manager , click manage web site --> start . navigating applications in iis website showing error: http error 404. requested resource not found.

Animated splash screen in C# -

this question has answer here: how build splash screen in windows forms application? 9 answers how can have animated splash screen in c# but still make splash (fixed) private void splashscreen() { application.run(new splash()); } a few steps wpf: add new window project , call splash. in app.xaml remove startupwindow, , register event startup. in app.xaml.cs add following code. private void app_onstartup(object sender, startupeventargs e) { var splash = new splash(); var mainwindow = new mainwindow(); splash.showdialog(); mainwindow.show(); } now first window splash opened , in window can animations. after window closed (by user or using timer , calling close method.) mainwindow open. a few notes have set various properties in splash window. topmost = true startuplocation = centerscreen windows...

ios - Cocos2d: How to stop clicking buttons of lower z order layer from upper z order layer? -

i developing cocos2d game have cclayer named gameplaylayer , cclayer named shoplayer. shoplayer fullscreen layer. gameplaylayer touchenabled , has multiple buttons (ccmenuitemimage). shoplayer accessed shop button has following @selector. (void) onclickshop { shoplayer * shop = [[shoplayer alloc] init]; [self addchild:shop z:40]; } to stop touch propagation used cctouchonebyonedelegate , following methods in shoplayer. (void) onenter { [[[ccdirector shareddirector] touchdispatcher] addtargeteddelegate:self priority:0 swallowstouches:yes]; [super onenter]; } (void) onexit { [[[ccdirector shareddirector] touchdispatcher] removedelegate:self]; [super onexit]; } (bool) cctouchbegan:(uitouch *)touch withevent:(uievent *)event { return yes; } now stops cctouchesbegan of gameplaylayer called fine. cannot stop other buttons of gameplaylayer called. when touch @ positions button...

python - Debugging inside PyCharm IPython -

is possible hit graphical breakpoints when running codes in pycharm's ipython console? i.e.: you have script foo() in foo.py you place graphical breakpoint inside foo() editor (the red dot next line number) you import foo pycharm's ipython console , execute foo() (note: not running debug configuration!) yes, is. not automatic. (using 4.5.2, windows 8) i run ipython notebook, , let pycharm kick off notebook backend. i hit tools, attach process , attempt identify pid of notebook process. i'm yet find smooth way of doing this. use process explorer, find pycharm entry, , watch new sub-processes after notebook server starts. want leaf python.exe process, e.g: 6268 pycharm.exe 1235 python.exe (new when notebook launched) 7435 conhost.exe (new) 9237 python.exe (new - pick pid) i can run cell , hit graphical breakpoints. enjoy.

smalltalk - What exactly is Athens? -

Image
while have played athens (see pharoboids ) , liked it, still miss exact point is. i came these 2 diagrams (see below) myself. correct? , there corresponding canvas classes. role? athens vector graphics framework. has own api, going replace balloon/bitblt used today in morphic. replacement gradual , @ end want have morphic widgets use athens api. athens abstracts implementation backend through api. currently, there supported backend cairo graphics library. there's port of athens amber (a browser-based smalltalk implementation). in future want have more backends supported, opengl (via nvpath extension or without it), quartz on mac os, , gdi+ on windows. also, important note, athens standalone , low-level graphics api. there's no direct connection morphic except morphic using rendering (like else can imagine, instance: rendering pdf or svg content etc).

javascript - Factory unable to create objects defined within an IIFE object -

i'm creating gallery transitions slides based on various transition objects: window.mygallery = (function () { var instance = null; .... //base transition function transition(slide, settings){ this.slide = slide; this.el = slide.el; this.settings = settings; this.duration = (this.settings['transitionspeed'] / 1000) + 's'; this.endanimation = null; } //fade transition function fadetransition(slide, settings){ transition.call(this, slide, settings); } fadetransition.prototype = object.create(transition.prototype); fadetransition.prototype.constructor = fadetransition; //slide transition function slidetransition(slide, settings){ transition.call(this, slide, settings); } slidetransition.prototype = object.create(transition.prototype); slidetransition.prototype.constructor = slidetransition; to appropriate transition object, built factory: var transitionfactory = function () { return { createtransition: function ...

javascript - Changing margin on hover shifts all the things beneath it -

so have created simple animation using css when hover on image margin of image decreases give going effect problem coming when change margin, things beneath move. how can move image , not whole? css: .down_arrow { margin: 15px; -webkit-transition: margin 0.5s ease-out; -moz-transition: margin 0.5s ease-out; -o-transition: margin 0.5s ease-out; } .down_arrow:hover { margin-top: 2px; } html: <div class="row text-center" style="margin-top: 30px;"> <img src="img/down_arrow.png" class="down_arrow" onclick="gotobyscroll('ideas_section');" /> </div> here's what's happening: jsfiddle. give position , animate instead of margin: demo .down_arrow { margin: 15px; top:0; position:relative; -webkit-transition: top 0.5s ease-out; -moz-transition: top 0.5s ease-out; -o-transition: top 0.5s ease-out; } .d...

iphone - CreateARGBBitmapContext causing memory leak -

Image
i'm using below code create similar effect coreimage's cicircularwrap filter not available ios. here's code causing memory leak. i've released context image creates. life of me, can't spot leak. input appreciated. thanks. here's how method called: uiimage *circularwrapimage = [uiimage imagewithcgimage:circularwrap(image.cgimage, 0, 1000, 0, yes, yes)]; actual method: cgcontextref createargbbitmapcontext (size_t pixelswide, size_t pixelshigh){ cgcontextref context = null; cgcolorspaceref colorspace; void * bitmapdata; int bitmapbytecount; int bitmapbytesperrow; // declare number of bytes per row. each pixel in bitmap in // example represented 4 bytes; 8 bits each of red, green, blue, , // alpha. bitmapbytesperrow = (int)(pixelswide * 4); bitmapbytecount = (int)(bitmapbytesperrow * pixelshigh); // use generic rgb color space. colorspace = cgcolorspacecreatedevicergb(); if (colorspace == null) { fprintf(s...