Posts

Showing posts from April, 2014

Does the integration of Intel® Parallel Studio XE 2013 for Linux* and R lead to significant performance improvements? -

i running resource intensive computations in r. use for-loops, bootstrap simulations , on. have integrated intel® math kernel library linux* r , seems has lead significant improvement in computation times. thinking integrating intel® parallel studio xe 2013 linux* , r. means passing different compilers ship r: (1) integration of intel® parallel studio xe 2013 linux* , r lead significant performance improvements? (2) give examples in situations have benefit? thank you! very rough order of magnitude: parallel / multi-core blas such mkl scale sublinearly in number of cores but parts of operations blas calls ie not basic "for-loops, bootstrap simulation , on" byte-compiling r code may give factor of two, maybe three after may need heavier weapons such example rcpp can give 50, 70, 90-fold speedups on code involving "for-loops, bootstrap simulation , on" why eg popular mcmc crowd similarly, intel tbb , other parallel tricks require rewrites of

html - unneccessary space between parent div and image thats inside of it -

html code <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link href="css/style.css" rel="stylesheet" type="text/css" media="screen"/> <title>abc</title> </head> <body> <div class="wrapper"> <div class="box"><img src="images/roundlogo.jpg" alt=""></div> </div> </body> </html> css code img{ border:0px; border-image-width:0px; border-image-slice:0px; } .box { width:250px; //border:1px solid; height:auto; border-image-slice:0px; border-image-width:0px; border-image-outset:0px; } .box img { width:100%; //border:1px solid green; margin-top:0px; } i write code shown upper when checking browser there 4px space between image , parent div() called box here

java - text area table format -

im trying make table format using test area java, , not work correctly wont in line... need in correct format. have textarea.settext("name\t\tage\tde-sexed\tfee\n"); textarea.append("text"); textarea.append("\t\t25"); textarea.append("\tyes"); textarea.append("\t\t$00.00\n"); textarea.append("sfessfesf"); textarea.append("\t\t12"); textarea.append("\tfalse"); textarea.append("\t\t$00.00\n"); so output isnt third line of output any idea? you need use monospaced font jtextarea. like: textarea.setfont( new font("monospaced", font.plain, 12) );

Why is copying a file in C so much faster than C++? -

i've been working on large c++ project few weeks now. original goal use project learn c++11 , use pure c++ code , avoid manual allocation , c constructs. however, think problem going force me use c small function , i'd know why. basically have save function copy large binary file separate location before make changes data in it. files cd images max size of around 700mb. here original c++ code used: std::ios::sync_with_stdio(false); std::ifstream in(infile, std::ios::binary); std::ofstream out(outfile, std::ios::binary); std::copy(std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>(), std::ostreambuf_iterator<char>(out)); out.close(); in.close(); this code when used 690mb file takes barely under 4 minutes complete. have ran multiple files , it's same result; nothing under 3 minutes. however, found following way ran little bit faster, still fast c: std::ios::sync_with_stdio(false); std::ifstream in(infile, std::ios::binary); st

c# - Exception when a path to a file is null (when you cancel OpenFiledDalog) -

this code: openfiledialog openfiledialog1 = new openfiledialog(); dialogresult result = openfiledialog1.showdialog(); // show dialog. if (result == dialogresult.ok) // test result. { string file = openfiledialog1.filename; } else { messagebox.show("error."); } //later on.. datatable lertableec0 = new datatable(); lertableec0.readxml(openfiledialog1.filename); and right here in end comes error, works fine, xml import, etc if cancel in open dialog exception, hint? (there ir similar question answer still confusing me return null; didnt work me if (result == dialogresult.ok) // test result. { string file = openfiledialog1.filename; datatable lertableec0 = new datatable(); lertableec0.readxml(openfiledialog1.filename); } else { messagebox.show("error."); } since filename not set if cancel button clicked , empty string pass

Custom user control doesn't catch any mouse events in c# -

i create custom user control , use in form. but not capture mouse event! problem? thanks define event in custom control private delegate void myclickevent(object sender, eventargs e); public event myclickevent myclick; public void onmyclickevent(object sender, eventargs e) { if (myclick != null) myclick(sender, e);//execute event } now in mainform public partial class form1 { public form1() { mycustombutton.myclick += firethisonclick; } private void firethisonclick(object sender, eventargs e) { //this executed on click } }

java - How to map out parameter in jdbcTemplete.query with BeanPropertyRowMapper -

i using spring's jdbctemplate.query() call stored procedure , beanpropertyrowmapper map result set bean. stored proc has 2 in parameter , 2 out parameters multi row rs. able send stored procedure's in parameters , map rs bean in following way: final string stored_proc_name= "{call mystoredproc(?,?)}"; list<mybean> mybeanlist= jdbctemplate.query( stored_proc_name, new object[] { 12, 100 }, //in parameters new beanpropertyrowmapper<mybean>(mybean.class)); // rs bean mapper how map out parameter. want take advantage beanpropertyrowmapper

Best maven practices for modifying built war-file with generated resources -

currently i'm working on integrating grunt build process our maven build process. here 2 options can think of: pointing folder in resources target build dir grunt project. building grunt project wherever , enlisting this non-standard folders included resources in pom.xml. it looks there yet space enhancement. basically, since grunt subproject not depend on external resources, nice learn how not rebuild war-file had been compiled, modify after rebuilding grunt-project. so, question is: best practices adding generated resources existing war file. the approach of adding resources war file amounts modifying maven-built artifact after maven builds it. runs counter maven philosophy of tightly controlling entire build of every artifact. have 3 choices: include grunt generated source in war's source , build single artifact maven. in case rebuild war every time grunt resources change, or put grunt generated sources in second maven artifact , make artifact

php - Cannot get user id from session in tank auth codeigniter -

i have controller <?php if (!defined('basepath')) exit('no direct script access allowed'); error_reporting(e_all); ini_set('display_errors', 1); class response extends ci_controller { function __construct() { parent::__construct(); $this->load->library('tank_auth'); } function index() { $status = $this->input->post('status'); $data['amount'] = $this->input->post('amount'); $data['orderid'] = $this->input->post('orderid'); $data['mobileno'] = $this->input->post('mobileno'); $data['email'] = $this->input->post('email'); echo "userid is".$this->tank_auth->get_user_id(); } } im posting values controller after done,im trying user id session im not able using tank auth.this working in other controllers im having please help

Calculations on the values of columns which numbers are given by variables in Gnuplot -

i'm using loop plotting, number of column determined variable. when want calculate difference between 2 columns values doesn't work. want looks approximately in way: plot [i=2:n-1] fn u 1:($i-$1) w lp is not possible in principle use variable column number calculation? you must use column(i) : $1 shortcut column(1) . plot [i=2:n-1] fn u 1:(column(i)-$1) w lp

how to use Zend 2 Oauth package -

thanx reading, first time try use zend 2 oauth, following answer in link did said using composer don't know how check if it's installed. how can check if it's installed? , how use it? tried in index controller call examples in zend page $config = array( 'callbackurl' => 'http://example.com/callback.php', 'siteurl' => 'http://twitter.com/oauth', 'consumerkey' => 'gg3dsftw9ou9ewpnbupzq', 'consumersecret' => 'tfb0fywlsmf74lkeu9ftyohxcazowpbrajtcck48a' ); $consumer = new zendoauth\consumer($config); but returns: fatal error: class 'application\controller\zendoauth\consumer' not found and tried include @ top using use command can't find package named oauth. can 1 me this? idea or appreciated. you're within application\controller namespace, when new zendoauth\consumer , php assumes mean new application\controller\zendoauth\consumer unless tell other

c# - Line type of series in MS Chart control -

when ms chart control has multiple series, different color assigned each series automatically , default. if select charttype fastline , add 2 series, blue , orange plots seen. instead of colors, possible each series automatically represented different line type, dashed, dot dashed, plus sign, etc.? first i'm pretty sure plus signs markers , not charttypes. i know sure stars , diamonds are. you list , save in line charttype (ex spline, line, etc) , looping while binding data sqldataadapter adapter = new sqldataadapter(query2, connection); dataset ds = new dataset(); adapter.fill(ds); int = 0; foreach (datarow dr in ds.tables[0].rows) { series series = new series(); series.points.addxy(dr["date"], dr["shipments"]); series.charttype = yourcharttypelist[i]; i++;

java - Nullpointer Exception when assigning value to Integer array -

this seems bit strange me. created static integer array , trying assign value it. null pointer exception @ degree[i] = 0 line. since not reading value before assigning it, not understand why nullpointer exception. private static integer[] degree; public static void initdegree(int num_of_vertices) throws exception{ (int = 0; < num_of_vertices; i++) { degree[i] = 0; } } you need initialize array. ex degree = new integer[5]; otherwise, array null.

ios - Flurry log event updation is quite late as compared its session in iPhone SDK -

i integrated flurry iphone app, working fine log event section update quite late compared session updating. show me 3 days previous log event history in session showing me today session history also. reched code fine. don't know why happen. kindly me on if 1 face this. in advance. it takes sometime update custom events. if taking lot of time regularly. must reach out support@flurry.com . respond in 24hours , provide support.

sts springsourcetoolsuite - JSONstring to Java Object without using any external library -

i m using gwt , want convert jsonstring java pojo object without using kind of external library. can 1 me .. appreciated.. thank you.. http://eclipsesource.com/blogs/2013/04/18/minimal-json-parser-for-java/ way can iterate value , set pojo object...

Looping through the content of a file in RobotFramework -

how can loop through contents of file within robot framework? my file contents this: 1001 1002 1003 1004 i want read contents 1 one, assign variable , operations it. robotframework has several built-in libraries add lot of functionality. 2 can use task operatingsystem library , string library. you can use keyword get file operatingsystem library read file, , can use split lines keyword string library convert file contents list of lines. it's matter of looping on lines using for loop . for example: *** settings *** | library | operatingsystem | library | string *** test cases *** | example of looping on lines in file | | ${contents}= | file | data.txt | | @{lines}= | split lines | ${contents} | | :for | ${line} | in | @{lines} | | | log | ${line} | warn

c++ - std::map<> or std::vector<> when dealing with large sets of flags? -

i working on compiler , have large set of flags. in cases, nodes receive small number of flags (about 12 largest), total number of flags rather large (over 50.) flags integers defined in enum: enum flags_t { flag_one, flag_two, flag_three, [...] max_flag }; i thinking using std::map<flags_t, bool> makes more sense because of nodes use 0, 1, or 2 flags , number of nodes large (it can become tenth of thousands.) // map have check existing on avoid creating // useless entries in map bool node::get_flag(flags_t const f) { flag_iterator it(f_flags.find(f)); return == f_flags.end() ? false : *it; } void node::set_flag(flags_t const f, bool const value) { f_flags[f] = value; } but i'm wondering whether std::vector<bool> not end being more effective? although @ first sight looks good: bool node::get_flag(flags_t const f) { return f_flags[f]; } void node::set_flag(flags_t const f, bool const value) { f_flags[f] = value; }

Eclipse Deployment assembly for Maven build overlay option -

i have enterprise project contains 2 wars. there common resources in wars, in project structure have base project web project. , base project contains common resources 2 wars. 2 wars in project structure have 2 separate web project. when build through maven use overlay option of maven build 2 wars merged base project war. common resources base project war merged in both wars ear. i have created eclipse project following command, eclipse:eclipse -dwtpversion=2.0 eclipse:configure-workspace now want configure these project in eclipse(kepler) can run eclipse configuring application server on eclipse. above commnad add base war file directly in deployment assembly of wars ear, instead of merging happening in overlay option of maven build. i tried fix manual configuration of deployment assembly there no option adding folders different project. i have google lot solution no luck. thanks in advance. after lot f google 1 thought came mind, how been handled in myeclip

java - Empty List View (list fragment) -

when app running see empty layout "no data". can do? trying asynctask, doesent work. dont know do. im android newbie. may used wrong way? , trying inflate view not idea? public class myemployefragment extends listfragment { mytask task; static string employer_id; static string employer_name; static string employer_last_name; string str = null; arraylist<spr_item> ret_data = null; // ŠøŠ¼ŠµŠ½Š° Š°Ń‚Ń€ŠøŠ±ŃƒŃ‚Š¾Š² Š“Š»Ń map final string attribute_id = "p_id"; final string attribute_name = "p_name"; final string attribute_last_name = "p_last_name"; view v; listview listview; simpleadapter sadapter; listview lvsimple; @override public void onattach(activity activity) { super.onattach(activity); task = new mytask(); task.execute(); } @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedin

.net - On WP8, which assembly should I reference for MultiBinding class -

according msdn , multibinding class supported on wp8. quote: assembly: presentationframework (in presentationframework.dll) ... platforms: windows phone 8.1, windows phone 8, windows 8.1, windows server 2012 r2, windows 8, windows server 2012, windows 7, windows vista sp2, windows server 2008 (server core role not supported), windows server 2008 r2 (server core role supported sp1 or later; itanium not supported) however, unable find phone version of presentationframework.dll . blog posts suggest there no multibinding on wp8. msdn wrong? this appears documentation error. multibinding not available windows phone 8.0 or 8.1.

uitableview - Replica of expandable list view in iOS -

i want load several questions , once question tapped shows drop down respective options. how can implement in ios. please suggest you can use gcretractablesectioncontroller expandingcollapsing-tableview-sections hope helps.

unity3d - unity C# run method from another class -

i want run metod in class class , both of them atached different obj two classes. first is: public class newscore: monobehaviour { public void updatescoreby( int intr) { debug.log("intr+4"+intr+4); } } and second is: public class newplus: monobehaviour { public newscore newscore; public void ontriggerenter2d(collider2d obj) { newscore.updatescoreby(+1); } } when run code recive arror "nullreferenceexception: object reference not set instance of object" , points on newscore.updatescoreby(+1); how can fix it? depending on want make function static like: public static void updatescoreby(int intr) { debug.log("intr+4"+intr+4); } and call with: newscore.updatescoreby(1);

osx mavericks - Install "perf" on Mac -

i need "perf" utility monitor program on mac. know linux comes it, available on mac? i working on osx 10.9 mavericks , tried "port search" perf or linux-tools, couldn't results. as @sami laine said in comment, linux perf tool dependent on linux specific code. relies on perf_event_open system call not standardized. note: maybe search how macosx users using recent hardware performance counters.

rest - What is the best RESTful uri for a resource's tags -

say have resource of recipes , recipe can have tags. want list of tags used across recipes, uri be? /recipes/tags seems might work breaks convention of not pointing specific id such as: /recipes/1/tags you use: /tags but want tags recipes not other resource. use query params, such as: /tags?type-recipes and ftr, tags used recipes not other resource, seems misleading use query param since never recipes filters tricky -- when filter resource. you correct /recipes/tags problematic. go path variable of /resouce/{resouceid} /resource/{filter} can open whole word of pain. so first example go /recipes?tags={tags filter on} returns list of recipes based on tag the problem don't have lookup method acceptable tags are. expect /tags return list of tags , consume this /tags returns list of tags /tags/{tagid} returns meta data specific tag (what tag used for, superfluous in case if have recipe tags, more flexible) /tags/{tagid}/recipes returns

ios - Custom UIView resizing while recognizing pan gesture -

Image
i'm trying achieve following effect. have view can in 2 different states - collapsed , expanded). see screenshots have in mind: transition between these states should triggered panning gesture - user panned down view gets expanded, user panned - view gets collapsed. i can achieve implementing custom gesture recognizer in init section of view subclass: uipangesturerecognizer* recognizer = [[uipangesturerecognizer alloc] initwithtarget: self action: @selector(panned:)]; recognizer.delegate = self; [self addgesturerecognizer: recognizer]; and detecting proper vertical pan gesture: - (void)panned:(uipangesturerecognizer*)gesturerecognizer { static cgpoint lastpoint; if (gesturerecognizer.state == uigesturerecognizerstatebegan) { lastpoint = [gesturerecognizer locationinview: self]; return; } if (gesturerecognizer.state == uigesturerecognizerstateended) { if (p.y > lastpoint.y && self.expanded == no) { [

testing - Maven plugin for junit/testng generation -

are there maven plugins generating test stubs given java project? not looking test case generation - looking junitdoclet. context: have lot of legacy code without test cases. attempting generate base stubs these classes. if successful - can used code coverage tools add new test cases project lesser effort. not maven plugin - tool worked best: https://code.google.com/p/randoop/

jquery - Prevent Ajax load from loading src more than once -

i loading bunch of lis html page via ajax load (code below call), works fine, after html page of lis has been loaded in, seems calls same html source 4 times @ once , messes up... doing wrong??? $.ajax({ cache: false, url: 'slides.html', success: function(data) { jwloadinitialslider(); $(this).show(); $(".sliderloader").fadeout(3000); settimeout(function(){ $(".carouselcontentwrapper").css("height","auto"); }, 2000); } }); is there way kill function once has loaded , performed success functions? outside ajax call define variable var slideloaded = "no"; then inside ajax success function this: if(slideloaded=="no"){ slideloaded = "yes"; jwloadinitialslider(); } so way, if ajax call called more times won't call slider thing again.

python - error message : InterfaceError: <unprintable InterfaceError object> -

linking 2 tables , trying create form foreign key in it. sqlalchemy.exc.interfaceerror interfaceerror: unprintable interfaceerror object datbase link done : class client(db.model): __tablename__ = 'client' .. stand_id = db.column(db.string(10), index = true, unique = true) stands = db.relationship('stand', backref= 'stand', lazy='select') def __init__(self,client_name,contact_number,contact_name,contact_email,stand_id): self.client_name = client_name self.contact_number = contact_number self.contact_email = contact_email self.contact_name = contact_name self.stand_id = stand_id class stand(db.model): __tablename__ = 'stand' .. stand_number = db.column(db.string(10), db.foreignkey('client.stand_id' )) def __repr__(self): return '<stand %r>' % (self.stand_id) def __init__(self, stand_name,items, quantity,install_date, derig_date,comments,last_update, stand_number): self.stand_name

What does return with nothing mean in python? -

i'm viewing source code of project now. in saw function this. def func(x): if condition_a: return if condition_b: return process_something what return nothing here? the " return nothing" exits function @ line , returns none . python's docs say: if expression list present, evaluated, else none substituted. return leaves current function call expression list (or none ) return value. in flow control, i've seen commonly used when sort of condition encountered makes impossible execute rest of function; example, def getdatafromserver(): if servernotresponding(): return # important stuff here requires server running

java - Copy objects into arraylist instead of pointing -

i trying create arraylist of nodes used come 1 place(node) another. nick name of place , node's pi previous node in path. arraylist<node> bestway = new arraylist<node>(); while(chosen.nick != from){ bestway.add(chosen); chosen = chosen.pi; } the problem elements in bestway becomes same. when print bestway place1, place1, place1, place1 , , not place1, place2, place3, place4 . is possible copy elements array, , not add pointers chosen-element changes on line after. lot! here example trying mimic explained. works me hence, error should somewhere else guess: public class example { public static void main(string[] args) { list<node> bestway = new arraylist<node>(); node chosen = new node("place1"); string = chosen .add("place2") .add("place3") .add("place4") .add("place5") .

java - Spring security between web apps- NOT SSO -

i'm using spring security 3.1.4 , have following question: have 2 web apps 1 "admin" , other "users". admin calls other using controllers. communication use spring security, thought of option create special "login" controller in user app admin , create special "admin user" authentication information (login name, password , role..) , every time want communicate admin app use controller. valid , common solution?

Protractor + AngularJS + Jasmine get output results on xml file -

i'm trying export protractor results xml files, found great link on web: https://github.com/angular/protractor/issues/60 after running : npm install jasmine-reporters i added following lines protracotr config file: require('jasmine-reporters'); jasmine.getenv().addreporter(new jasmine.junitxmlreporter( 'c:\temp\test', true, true)); and following error: jasmine.console_reporter.js:2 if (! jasmine) { ^ referenceerror: jasmine not defined i attached here config file, please advise doing wrong, , how can fix this: require('jasmine-reporters'); jasmine.getenv().addreporter(new jasmine.junitxmlreporter( 'c:\temp\test', true, true)); // example configuration file. exports.config = { seleniumaddress: 'http://localhost:4444/wd/hub', chromeonly: true, capabilities: { 'browsername': 'chrome' }, specs: ['../test/protractor/publisher_list_e2e.js&

jQuery on binding when loading partial -

i'm loading partial shown here: <div id="catering-dialog" title="catering new booking"> <div id="itemstable"> @{html.renderaction("addcateringitem", new { model.booking.bookingid });} </div> </div> and have jquery .on() $('a.editrow').on("click", function () { alert("clicked"); }); basically, partial table , each row has cell "edit" in , when clicked should display alert "clicked" nothing @ happens. any ideas? to update: <div id="cateringtable"> <table border="2" bgcolor="#ffffff" id="cateringlisttable"> <thead> <tr> <th>time:</th> <th>description:</th> <th>quantity:</th> <th>cost £:</th> </tr> </thead> <tbody> @foreach (var item in model) { html.

ruby - Using constraints in Rails to change the default root_path for some users -

i looking way change default routing (root_path specifically) of app using other simple if/then check different types of users. found this code example online, can't make work app , main problem don't understand underlying code does, therefore cannot adapt code app. first create rule in router: root 'admin#index', constraints: roleconstraint.new(:admin) then create new file called role_constrait.rb in lib directory , user code: class roleconstraint def initialize(*roles) @roles = roles end def matches?(request) @roles.include? request.env['warden'].user.try(:role) end end i see guy using warden here, using cancan, , since piece of code makes no sense me, can't make changes it, have tried, keep getting undefined local variable or method `root_path' error. would highly appreciate help! i don't think router should in charge of doing that. it's hard implement , hard test. more than, it's extremely inco

uniqueness with nested_form_for rails is not working -

i have models vehicle, tag, vehicletag class vehicletag < activerecord::base attr_accessible :vehicle_id, :tag_id, :capacity belongs_to :vehicle belongs_to :tag validates_uniqueness_of :tag_id, :scope => [:vehicle_id] end and have used 'nested_form_for' enter value in vehicle_tags tables validates_uniqueness_of not working when user select same tags multiple times , saving data in tables. but when have single record in vehicle_tag tag_id=2, vehicle_id=24 , when user select same tag again time thronging uniqueness validation. getting first time don't have value in db , second time have. but want through uniqueness when user select multiple same tag. edit: vehicle_tag table structure: +-----+------------+--------+----------+---------------------+---------------------+ | id | vehicle_id | tag_id | capacity | created_at | updated_at | +-----+------------+--------+----------+---------------------+---------------------+ | 241 |

validate and expire the link using gwt - java -

my requirement sent mail concerned users when record created. mail contains link our system lets user interacting system without login. link expires after time. mailing done using javax.mail . how can expire link? i generate key/id add link , store database. filters (web.xml) can check if url (id) still valid , pass on desired page. if provide more details, can give more detailed answer.

vb.net - Reading Only Words in Text File in Visual Basic -

i'm working on project visual basic class in i'm supposed read in file , display information (employee names , salaries) in list box. i have total of 4 forms. first form doesn't display anything, has menu items open file, select of other 3 forms, , exit form. in second form (names), employee names read in file displayed in list box. in third form (salaries), employee salaries read in file displayed in list box. fourth form second , displays employee names read in file. the problem is, don't know how parts of file displayed in list boxes (names , salaries). also, in fourth form have ask user enter amount of months calculate salary selected employee , multiply salary number of months entered user. know how this, except how go getting salary. example, i'm thinking this: lbltotal.text = dblsalary * intmonths but don't know how store salary of selected employee in dblsalary variable? here's code have written far, it's opening open file dialog b

Neo4j: Create multiple relationships with cypher and parameters -

i try create lot of relationships (16k) 1 cypher statement , parameters in py2neo writebatch. if try create 10 (or so) relationships, works without problems. 16k relationships, neo4j server hung @ 100% cpu , py2neo gives error (after while). i use following code create relationships: graph_db_batch = neo4j.writebatch(graph_db) graph_db_batch.append_cypher\ (\ "\ foreach (par in {params} |\ merge (s:users {userid1:par.sval})-[r:member_of]->(e:groups {groupid:par.eval})\ set r = par.cprops\ );\ ",\ object_props\ ) graph_db_batch.run() object_props looks this: {'params': [{'sval': 'usera', 'cprops': {'marked': 1, 'datedeleted': 0}, 'eval': 'groupx'}, {'sval': 'userb', 'cprops': {'marked': 1, 'datedeleted': 0}, 'eval': "groupy"}]}

c# - Insert image to crystal reports -

Image
insert image crystal report have ado.net data connection i'm using <xs:element name="drawing" type="xs:byte" minoccurs="0" /> for image field, how can use image byte data display image in crystal reports 2013. i'm not using backend coding because there's possible many images in retrieved data, here's data structure of table "drawing" image field of data have stored byte i'm using image contained report sub report i not sure if understood question, let me share may lead useful. understand said there no "backending code", hope may contain useful tip case. when use image in crystal reports, it's type base64binary in xsd. in dataset, it's type byte[]. we save image serialized string in database. that: filestream stream = new filestream(filepath, filemode.open); binaryreader binreader = new binaryreader(stream); byte[] buffer = new byte[(int) stream.length]; buffer = binreader.r

Cocos2d-x opengl error in visual studio 2010 -

Image
my windows saying device driver date. in visual studio giving error opengl higher version required. i attached error screenshot. according specsheet graphics hardware supports opengl 1.4 not 1.5. need different graphics card or computer launch cocos2d-x apps under windows.

any way to track install_referrer for sideloaded android app? -

i know apps dl play store able pass referral data, there way pass data sideloaded app? let's if want promote app, , have 10 affiliates. want sideload app. correct way can track traffic doing 10 separate builds? or if there's way send data install_referrer ? from understanding, way trigger install_referrer through google play store. if that's case, there easy way builds? in case if have on hundreds of affiliates later.

python - How can I avoid "Object currently drawn" error? -

i want write python program shows letter in graphics window. if click right side of window, text needs turn red , if click left side needs turn green. needs work @ least 5 times. write down following change color 2 times , gives me "graphics.graphicserror: object drawn". idea how fix problem? from graphics import * def main(): win= graphwin("name",400,400) win.setcoords(0.0,0.0,4.0,4.0) win.setbackground("white") p=text(point(2.0,2.0),'b') p.setsize(36) in range(0,6): c=win.getmouse() s=c.getx() if s>=2 : p.settextcolor("red") else: p.settextcolor("green") p.draw(win) main() i new this. used zelle graphics module this the problem position of p.draw(win) call @korefn suggests. however, change makes 'b' visible before first click unlike original code. i've included commented out code in rework below make 

angularjs - Angular UI bootstrap modal, ng-click entry argument is undefined -

hello using angular ui bootsrap modal. , have multiple buttons on there, using 1 single method in ng-click, different input argument. problem in controller side, input argument undefined here part of code: modal controller: controller('mymodalcontroller', [ '$scope', '$modalinstance', function ($scope, $modalinstance) { $scope.keypressed = function (key) { console.log(key); }; $scope.close = function () { $modalinstance.dismiss('cancel'); }; } ]) and template using modal: <tr> <td ng-click="keypressed(1)"><span>1</span></td> <td ng-click="keypressed(2)"><span>2</span></td> <td ng-click="keypressed(3)"><span>3</span></td> <td ng-click="keypressed(4)"><span>4</span></td> <td ng-click="keypressed(5)"><span

java - Mapping of type: char**& in JNA -

my client gave me dll couple of functions. 1 of them is: int getversions(char* name, char** &pversions); it returns number of versions given name , array of strings versions. using jna, i'm trying write equivalent java method in interface: int getversions(string name, string ll, ??? pversions); the problem type should instead of ??? ? i trying put there pointerbyreference , after method invocation had: pointer ptr = ptrref.getvalue(); string ppp = ptr.getstringarray(0); but got here invalid memory access . pointer ptr = ptrref.getvalue(); string ppp = ptr.getstring(0, "utf-8"); returns garbage. any idea how solve it? thanks in advance! the char ** mapping pointerbyreference. example. c code. char **xs_directory(struct xs_handle *h, uint32_t t,const char *path, unsigned int *num); jna: pointerbyreference xs_directory(xenstorelibrary.xs_handle h, int t, string path, intbuffer num); this xenstore api contents of directory,th

Rewrite plex media server url on nginx? -

i have limited knowledge rewriting url in nginx. have plex media server running behind on nginx, can access dashboard http://domain.com/web/index.html these config found on github: upstream plex-upstream { server plex-server.example.com:32400; } server { listen 80; server_name domain.com location / { if ($http_x_plex_device_name = '') { rewrite ^/$ http://$http_host/web/index.html; } proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_redirect off; proxy_set_header host $http_host; proxy_pass http://plex-upstream; } } what want remove /web/index.html when go http://domain.com , pms dashboard load. tried 1 liner rewrite rules failed. thanks. i not nginx specialist, had similar problem. diference not trying alias domain.name/ domain.name/web/, goal alias domain.name/plex/ domain.name/web

Can't login into development copy of Typo3 -

i'd create local copy on windows 8 machine further develop existing extensions , test upcoming updates of typo3 6.1.7 installation. tared including mysql db dump, extracted fresh install of xampp , imported database. after adjusting db , openssl settings in localconfiguration.php tried login password, message stating credentials must wrong. the loginsecurity on configured rsa, , installtool states openssl config running correct. why can't login? did miss? searching wrong looked @ requirements typo3 6.1.x, , states supports mysql 5.5.x. sure enough, freshly installed xampp uses mysql 5.6. removed it, installed other current xampp package mysql 5.5 , works.

c# - Programatically start selenium test -

Image
using c#, possible start selenium test? the way found via ui right clicking on test , starting manually. as arran said, question how run tests written using visual studio unit testing framework , has nothing selenium. since can run test command line, need start calling command c# code. for example, here how start mstest.exe tests (see msdn documentation more test options please): process myprocess = new process(); processstartinfo myprocessstartinfo = new processstartinfo(path_to_mstest_exe, "/testcontainer:" + path_to_test_dll); myprocessstartinfo.windowstyle = processwindowstyle.hidden; myprocess.startinfo = myprocessstartinfo; myprocess.start();

wicket - Show correct model value even if error on field -

i have wicket textfield displays calculated value. value calculated in get-method in model object. have attached custom validator field. my problem occurs when validator fails. if change values in fields, calculated value should change in failed field. not happening. have verified get-metod called, , calculates correct value. however, not displayed in text-field. field still showing old one.. does know why happening? when validation fails on formcomponent , rawinput isn't cleared - user can fix value, rather having enter scratch. in case changing model behind formcomponent 's doesn't know there new value. should call modelchanged() method on after changing model value - among other things reset validation , rawinput , form work expected.

ios - How to make one label to set score on all view controllers? -

i have label , need show score, coins ect on every viewcontroller, means when score changes changes every throughout whole app... i've tried set label show score on whole app cant figure out how! please help this have far in view controller: -(void)viewdidload { { [super viewdidload]; nserror *error; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); //1 nsstring *documentsdirectory = [paths objectatindex:0]; //2 path = [documentsdirectory stringbyappendingpathcomponent:@"settingslist.plist"]; //3 nsfilemanager *filemanager = [nsfilemanager defaultmanager]; if (![filemanager fileexistsatpath: path]) //4 { nsstring *bundle = [[nsbundle mainbundle] pathforresource:@"settingslist"oftype:@"plist"]; //5 //5 [filemanager copyitematpath:bundle topath: path error:&error]; //6 } savedstock = [[nsmutabledictionary alloc] initwithcontentsoffil

xml - R cannot be resolved to a variable using Android Studio and Google Maps -

i aware there must problem somewhere in manifest or xml cannot find it. appreciated! i've spent while trying figure can't anywhere it. error:element type "activity" must followed either attribute specifications, ">" or "/>". (i cannot see anywhere tags problem) <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.clubnightsdeals" android:versioncode="1" android:versionname="1.0" > <permission android:name="info.androidhive.googlemapsv2.permission.maps_receive" android:protectionlevel="signature" /> <uses-sdk android:minsdkversion="12" android:targetsdkversion="18" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.internet" /> <

iis - Hosting IIS8 ASP.Net site -

i have asp.net website running on server 2012, iis 8. getting generic, not server provided 404 message. have ports forwarding through router, have site , ip setup in hosts file, , have site bindings configured proper address , port. site works fine on local machine browsing url (not localmachine), nothing outside server, other machines on network can site. any suggestions should next?

Doubts in development of a basic ontology using RDF/S: ontology reuse and "instance vs. inheritance" -

i trying develop simple "ontology" using rdf , rdf schema. for now, have written following classes , properties: <rdfs:class rdf:about="#model">...</rdfs:class> <rdfs:class rdf:about="#system">...</rdfs:class> <rdfs:class rdf:about="#concept">...</rdfs:class> <rdfs:property rdf:about="#represents"> <rdfs:domain rdf:resource="#model" /> <rdfs:range rdf:resource="#system" /> </rdfs:property> <rdfs:property rdf:about="#includes"> <rdfs:domain rdf:resource="#model" /> <rdfs:range rdf:resource="#concept" /> </rdfs:property> the idea i'd define "model" (i.e., model instance) set of "concept"s. thus, such "model" instance "represent" "system": "system" can described using "concept"s defined in "model" (

Cannot iterate the HashMap converted as JSON String in JSP -

in spring controller: returning map values json string map keyttlmap = getrediscachettlvalues(filterpattern); jsonobject jsonobject = new jsonobject(); jsonobject.put("cachettlmap", keyttlmap); return jsonobject.tostring(); in jsp ajax call: var json = xmlhttp.responsetext; ( var = 0; < json.cachettlmap.length; i++) { var obj = json.cachettlmap[i]; ( var key in obj) { name = key; value = obj[key].tostring(); alert("name "+name +" value "+value); } } json string value: { "cachettlmap": { "product1":81213, "product2":79936 }} when try run jsp, json string cannot iterated.is there simple way display hashmap in ajax, kindly me this. thanks! var json = '[{"userid" : "123123", "password": "fafafa", "age": "21"}, {"userid" : "321321", "password" : "nana123", &qu

php - Insert query not working even though it is right -

you have error in sql syntax; check manual corresponds mysql server version right syntax use near ','','','')' @ line 2 i above error when running php file. my insert query $updateusercanvas="insert user_canvas(cns_id,course_id,context_id,email_id,resource_id) values(".$canvasid.",".$courseid.",'".$contextid."','".$email."','".$resourseid."')"; cns_id,course_id integer datatype , context_id,email varchar , resource_id text datatype i searched problem , tried adding mysql_real_escape_string $updateusercanvas="insert user_canvas(cns_id,course_id,context_id,email_id,resource_id) values(".$canvasid.",".$courseid.",'".mysql_real_escape_string($contextid)."','".mysql_real_escape_string($email)."','".mysql_real_escape_string($resourseid)."')"; but still not working. dont know

ios - How to copy sqlite database when we clicked on a UIButton? -

i storing details coredata nsstring. nsentitydescription *entitydesc=[nsentitydescription entityforname:@"addnewvehicle" inmanagedobjectcontext:self.managedobjectcontext]; nsmanagedobject *newobject=[[nsmanagedobject alloc]initwithentity:entitydesc insertintomanagedobjectcontext:self.managedobjectcontext]; nserror *error; nsstring *instr = [nsstring stringwithformat: @"%d", (int)x]; [newobject setvalue:instr forkey:@"slno"]; [newobject setvalue:txt_platename.text forkey:@"platenumber"]; [newobject setvalue:txt_vehiclename.text forkey:@"vname"]; [self.managedobjectcontext save:&error]; also have 2 buttons named backup button , restore button.when cilck on backup button, current core data must duplicate coredatabackup.sqlite. tried following way:- - (ibaction)savedata:(id)sender { nsstring * databasename = @"coredata.sqlite"; nsstring * databasebackupname = @&qu

linux - finding file ib the directory and extract the file using Perl script -

another question experts here. have perl script here , intention find file , untar . when execute line nothings happen . my $bundle = "`awk -f \'=\' \'{print \$2}\' config.txt`"; $bundlename = `awk -f \'=\' \'{print \$2}\' config.txt | awk -f \'/\' \'{print \$11}\'`; print $output; system ("wget $bundle"); print "$bundlename\n"; $cd = `tar -xzvf $bundlename`; can me ? right script find file , after finding extract file tar.gz file for background of code. have config file have address download file , if file finished downloaded in machine $bundlename variable find print name of file , after $cd variable extract file after finding name of file.

Magento: sort products by attribute position -

in site have setted filter ordering products attribute, order alphabetical , order position attribute setted in backend. example attribute color: valuename | position green | 1 blue | 2 red | 3 the actual result in frontend product blue green red, result green blue red what classes can modify resolving problem? thanks in advance i thinking create custom option product , set short_order of value. if right use code. go app/code/core/mage/catalog/model/product/option.php there function getproductoptioncollection line no:- 373 . comment out code of ->setorder('title', 'asc'); , add " ; " after ->setorder('sort_order', 'asc') public function getproductoptioncollection(mage_catalog_model_product $product) { $collection = $this->getcollection() ->addfieldtofilter('product_id', $product->getid()) ->addtitletoresult($product->getstoreid()) ->addpricetoresult($

md5 - MessageDigest.Digest, cannot catch the exception android -

i have trouble code, heres method bothering me. public static byte[] createchecksum(byte[] b){ messagedigest md; try { md = messagedigest.getinstance("md5"); md.update(b); byte[] checksum = md.digest(); return checksum; } catch (nosuchalgorithmexception e) { e.printstacktrace(); } catch(exception e){ e.printstacktrace(); } return null; } what happens statement md.digest() executed steps directly return null. dunno goes wrong, problem inside android? edit: wanna note using java.security.messagedigest , not android.security.messagedigest as can see there not exceptions digest method, reacts if there error inside function, send 186 bytes in array method. i changed code bit, seems work, when use digest outside try catch, can't explain why, unless update change fixed it. public static byte[] createchecksum(byte[] b){ messagedigest md = null; try { md = messagedig