Posts

Showing posts from May, 2012

java - javax.faces.el.EvaluationException: org.hibernate.LazyInitializationException: could not initialize proxy - no Session -

i'm working on project using jsf,spring , hibernate. exception in 1 case, don't understand reason why i'm getting problem. can give me idea did wrong javax.el.elexception: /views/emissionsa.xhtml @102,171 actionlistener="#{emission1bean.payer()}": org.hibernate.lazyinitializationexception: not initialize proxy - no session @ com.sun.faces.facelets.el.tagmethodexpression.invoke(tagmethodexpression.java:111) @ javax.faces.event.methodexpressionactionlistener.processaction(methodexpressionactionlistener.java:147) eeeeeeeeeeeee @ javax.faces.event.actionevent.processlistener(actionevent.java:88) @ javax.faces.component.uicomponentbase.broadcast(uicomponentbase.java:813) @ javax.faces.component.uicommand.broadcast(uicommand.java:300) @ javax.faces.component.uiviewroot.broadcastevents(uiviewroot.java:790) @ javax.faces.component.uiviewroot.processapplication(uiviewroot.java:1282) @ com.sun.faces.lifecycle.invokeapplicationphase.exe

java - Scaling bitmaps on SurfaceView = no antialiasing? -

i trying scale down high resolution .png bitmap on surfaceview canvas so: bitmap player = bitmapfactory.decoderesource(getresources(), r.drawable.player); paint paint; paint.setantialias(true); paint.setdither(true); paint.setfilterbitmap(true); paint.setflags(paint.anti_alias_flag); //then in ondraw: canvas.drawbitmap(player, null, frame, paint); the problem antialiasing works when use view, fails work when use surfaceview, , quality looks horrible. i've tried everything. guy posted question 3 years ago on various sites (even here) , there no resolution. have ideas? here original question guy posted: drawing scaled bitmaps on surfaceview -- no antialiasing

mysql - refering a calculated value in another column -

i'm trying make calculated value show in column in table. can please explain why doesn't work create table #medition (id int,avg decimal(18,4)) insert #medition (id, avg) select id, sum(125hz + 250hz + 500hz + 750hz + 1000hz + 1500hz + 2000hz + 3000hz + 4000hz + 6000hz + 8000hz)/11 avg tonvarden update matningar set matningar.tonmedelvarde = #medition.avg matningar inner join #medition on matningar.id =#medition.id drop table #medition i getting error #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'insert #medition (id, avg) select id, sum(125hz + 250hz + 500hz + 750hz + ' @ line 2 no need create temporary table this. update matningar join tonvarden b on a.id = b.id set a.tonmedelvarde = (`125hz` + `250hz` + `500hz` + `750hz` + `1000hz` + `1500hz` + `2000hz` + `3000hz` + `4000hz` + `6000hz` + `8000hz`)/11; if update matningar whenever n

vb.net - Is it possible to convert DataRow to arraylist? -

i have datarow. there way convert arraylist? need convert arraylist because want pass function compares 2 arrays , returns false if not same. foo(datarow, arraylist) public function foo(byval arr1 arraylist, byval arr2 arraylist) boolean compare , return false if not same end function so, how convert datarow arraylist can pass function. i agree should convert arraylist if necessary, can. dim al new arraylist dim dt new datatable dt.columns.add("f") dt.columns.add("n") dim dr datarow dr = dt.newrow dr.item(0) = "first" dr.item(1) = "name" dt.rows.add(dr) each row datarow in dt.rows each column datacolumn in dt.columns al.add(row.item(column.columnname)) next messagebox.show(al.item(0).tostring & " " & al.item(1).tostring) next

Printing Unicode or Supplementary Character in Java -

Image
i trying print reverse bullet unicode character txt file. keep looking information , nothing works. prints question mark character file. error going attach way have seen symbol produced in java. sure can written text file , have heard stuff maybe needs converted? if knows how reverse bullet print out text file appreciate it! here picture of code , error gave me... thank knows answer in advance. have been searching around online day , cannot find anything. to store string bytes in file, java has encode string. by default, java uses system encoding, on windows useless windows-1252 or so. use new printwriter("tab.txt", "utf-8") .

c# - How to use process.StartInfo.Arguments in command prompt? -

i wanted use c# visual studio open command prompt using process.startinfo.filename , process.startinfo.arguments give commands automatically not work out. knows how this? ( using cmd call python script ) try using following. hope helps. replace notepad.exe else like. process p = new process(); p.startinfo = new processstartinfo("cmd.exe", "/c notepad.exe"); p.start(); please refer http://ss64.com/nt/cmd.html more details.

responsive design - Bootstrap 3 - Is it possible not to load assets when on mobile? -

im looking guidance on responsive site design written using bootstrap 3. basically want mobile version lightweight possible , load js , html necessary mobile view, , not load assets required desktop view. ignore loading specific js files when page loaded via mobile device. is there simple method bootstrap? my guess need javscript function detect device , use trigger, wondering if bootstrap had capability use? appreciate thoughts. it seems there answer detect mobile browser javascript. detecting mobile browser otherwise can detect mobile device using http_user_agent decide not load assets when page loading. here answer detect mobile device php. check if php-page accessed ios device

javascript - Rendering updated data in wrapped elements -

i'm new d3, , struggling understand data binding. here fiddle code below. let's have data updated later. note 6 becomes 1 . data1 = [ { key: 'orig7', val: 7 }, { key: 'orig3', val: 3 }, { key: 'orig6', val: 6 } ]; data2 = [ { key: 'orig7', val: 7 }, { key: 'orig3', val: 3 }, { key: 'orig6', val: 1 }, { key: 'new5', val: 5 } ]; then render them. code requires data embedded deeper the elememt. here 2 render functions; differ in first 1 simple, without such wrapping, , second 1 creates inner div around text. function render1(data) { var result = d3.select('#list1').selectall('.item') .data(data, function(d, i) { return d.key }); result.enter() .append('div') .classed('item', true) // set div result // set text in div .text(function(d, i) {

compiler errors - I don't know more what to do! (java.lang.NoClassDefFoundError:) -

my application give me error , don't know how solve! i'm using netbeans 8.0. the error: exception in thread "main" java.lang.noclassdeffounderror: autenticacao/logon @ bolaofuleco.bolaofuleco.main(bolaofuleco.java:23) caused by: java.lang.classnotfoundexception: autenticacao.logon @ java.net.urlclassloader$1.run(urlclassloader.java:366) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) @ java.lang.classloader.loadclass(classloader.java:425) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308) @ java.lang.classloader.loadclass(classloader.java:358) ... 1 more java result: 1 classes: principal: package bolaofuleco; import autenticacao.logon; import javax.swing.jframe; public class bolaofuleco { public static void main(string[] args) { logon login; login = new logon(new jframe(), true); } } an

javascript - Make Social Media Buttons Horizontal on Bootstrap mobile dropdown -

how go getting social media buttons align next each other -- is, horizontally rather vertically -- in mobile mode on drop down menu? the icons within standard bootstrap nav bar, aligned right side of bar. whenever clicks on mobile drop down menu lists these icons vertically. want them horizontal. here code menu div. <div class="container"> <div class="header"> <ul class="nav nav-pills pull-right"> <li class="active"></li> <li></li> <li></li> </ul> <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">toggle navigatio

amazon cloudfront - Is it possible to add logic to CDN -

is possible serve 2 different pages based on user agent. want serve pagename-iphone.html if user agent matches iphone , pagename-other.html other user agents. want pages on site follow pattern. possible @ cdn level (cloud front, akamai etc). thanks help! i think after user agent based caching, vary: user-agent . in theory, server provide cache service can so, however, far can tell cloudfront , of other major cdn providers don' support so. the basic reason straightforward there many user-agent header, , it's unique on every single browser, not mention different versions of same browser. if purely things based on whole user-agent, lost benefit of cdn cache of time. some of more advanced servers allow add condition based on headers, example, in varnish, can add if,else logic returning different values. not available majority of cdns. in other hand, should not rely on cdn return different html pages. cdn more commonly used accelerate artifacts (js/css/imgs) ins

python - How to join 3 tables and perform func.sum -

how join 3 tables, clients, orders , deposits , perform func.sum on orders.total , deposits.total each client.id exists in database ? query result should include columns clients.email, func.sum(orders.total) , func.sum(deposits.total). so far, i've tried different queries along lines of : listeclients = db.session.query(clients,func.sum(clients.orders.total).\ label("ctotal"),func.sum((clients.deposits.total).\ label("dtotal"))).group_by(client.id).all() giving me different errors such as: attributeerror: neither 'instrumentedattribute' object nor 'comparator' object associated clients.orders has attribute 'total' i see how 1 in sqlalchemy, i'd settle hints behind logic of such query ... are mappings correct? syntax of such join? should use eagerload somewhere? i've had success simpler queries, 1 on head ! welcome, logic of in raw sql. i'm stuck w/ ... class clients(db.model): __tablename__ = '

node.js - Error: failed to connect to [undefined:27017] -

i error when trying connect db setup on mongolab error: failed connect [undefined:27017] however, connection uri is: 'user' : 'mongodb://dbusernamestring:dbpasswordstring@ds027789.mongolab.com:27789/db1' so undefined come from? as can see in the tutorial mentioned, have use url instead of user , change should be: 'url' : 'mongodb://dbusernamestring:dbpasswordstring@ds027789.mongolab.com:27789/db1'

Change some part in URL as per Id using C# -

i using url rewriting making url better using c#. retrieving data base on id , display title in url. i.e. lets take url of stackoverflow only. http://stackoverflow.com/questions/24422364/flattened-out-a-mixed-type-of-list it fetch data using id 24422364 . now, if change id manually in url , enter fetch data, automatically change title (in url title means - flattened-out-a-mixed-type-of-list). if change id '24422315' example redirect url http://stackoverflow.com/questions/24422315/passing-java-script-function-result-to-angular-ng-table means has change title also. in case, if user change id fetchs new data sure not changing title. so, how ? please me this. page url : www.example.com/projects/5/this-is-something.html , page project.aspx, 5 & this-is-something querystring .

android - can we share image and text both on gmail -

how share image , text both on gmail? here code can,t work. intent shareintent = new intent(); shareintent.setaction(intent.action_send); shareintent.settype("image/png"); uri uri = uri.parse("android.resource://pakage name/"+r.drawable.image13); shareintent.putextra(intent.extra_stream, uri); shareintent.putextra(intent.extra_text, data ); startactivity(intent.createchooser(shareintent, "send image")); try using " */*" mime, can send generic data type. therefore send image , text,use below code intent shareintent = new intent(android.content.intent.action_send); shareintent.putextra(android.content.intent.extra_email, emailaddress); // if want add email address also. shareintent.putextra(android.content.intent.extra_text, data); shareintent.settype("*/*"); arraylist<uri> uris = new arraylist<uri>(); uris.add(uri.parse("android.resource://" + getpackagename() + "/&quo

html - CSS not showing on Bootstrap Navbar -

i tried using code on main bootstrap page using bootstrap generator. html works css not. i'm not sure problem is. seems classes right me. appreciate advice. here code: <header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner"> <div class="container"> <div class="navbar-header"> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="./">bootstrap 3 menu generator</a> </div> <nav class="collapse navbar-collapse bs-navbar-collapse&

IE8 issues with Yammer embed and API -

facing multiple issues ie 8 (detailed version 8.0.7601.17514). please note works fine in other browsers. yammer embed feed control not working. shows result , not. rest api call not working , giving error below. used new js sdk , new yam.platform.request. error : yam.request null or not object. source : platform_js_sdk.js thanks in advance help! i found out div embed yammer feed has above yammer request script eg. <div id="embedded-feed" style="height:400px;width:500px;"></div> <script> yam.connect.embedfeed( { container: '#embedded-feed', network: 'fourleaf.com' // network permalink (see below) }); </script> otherwise, ie not able find div show feed (but chrome works fine..)

regex - Java Pattern.compile expression - "/login?(\\?.+)?" -

i trying understand regular expression given below: "/login?(\\?.+)?" i have gone through java docs , not able understand purpose of expression. i understand looks string starts /login , after characters ?(\\?.+)? represent? please me in understanding this. /login matches literal characters /login the ? makes n optional the (parentheses) capture match inside group 1 /login \\? matches literal ? . in normal regex \? , in java string backslash has escaped backslash the .+ matches 1 or more characters, can include spaces , dog! sample matches /logi /login /login?a /logi?an /logi?and dog general answers "what regex mean? you can use tool such see regex101 play regex. right pane explains token token. there several explaining tools based on same original perl library, such this one , on 1 of answers based. the ultimate answer can found in mastering regular expressions, 3rd ed. , several excellent online tutorials, including regex f

what means this javascript code function -

this question has answer here: what (function() { } )() construct in javascript? 19 answers (function () { // somethig })(); what means function in parentheses? ()(); developers creates functions in js files directly. what means function in parentheses? ()(); that means self-invoking function in javascript. notice the: (); - calling . your function, anonymous btw, invoked automatically without caller intervention, itself, once it's declared. in addition, @thilo suggested, isolated scope local variables.

reporting services - sharepoint keywords not supported 'cube' -

was creating report data source in sharepoint powerpivot site. below connection string , error when try test connection data source = sp13; initial catalog = multidimensionalproject1; cube = 'internet sales' i try data source = sp13; initial catalog = multidimensionalproject1**-ee**; cube = 'internet sales' and error keyword not supported: 'cube' make sure set data source type microsoft sql server analysis services .

c# - Make RAM size free for .NET application -

i have created grid images booklet pages on wpf form. when run application system ram memory size 1.02 gb (includes other running applications). when turn each page ram size increases kb. when turn more 150 pages out of memory exception. understand exception caused because there no space in ram open new pages on application , tried following: 1. bitmapimage image = new bitmapimage(); image.dispose(); image = null; 2. gc.collect(); 3.[dllimport("psapi.dll")] public static extern bool emptyworkingset(intptr hprocess); public freemem(string programname){ emptyworkingset(process.getcurrentprocess().handle); foreach(process process in process.getprocesses(programname)) { try { emptyworkingset(process.handle); } catch (exception) { ... } } } but couldn't solve problem. can make me clear , solve this?

Generate spool in based on condition in Oracle sql -

i need write oracle sql script based on condition. like user has type 'y' or 'n' if types 'y' need accept gen prompt 'enter y if want generate spool' default 'n' spool c:\a.spl select cust_id no acc_master account_no='&crn' , branch_no='&brn'; select * lid=no; select * b lid=no; select * c lid=no; spool off; if user types 'n' nothing needs selected. please advise if use bash statement ("if-fi") if use linux, or statement "if" windows work around it.

email - Do spam bots can see microdata tag? -

for example need hide email spam bots, if use <meta itemprop="email" content="myemail@domain.com"/> in html code. safe spam bots? you’ll find bots parse it, you’ll find bots don’t parse it, you’ll find bots parse whole source code looking anything@anything . bots stupid ignore microdata/rdfa.

android - Delete file function calling in intent does not work -

i developing android application importing csv file sqlite. work flow of application follows: delete old csv files in device using deleterecursive function download csv files through ftp server import csv files database. when trying add main menu "import button" call original activity. deleterecursive function not work anymore. here code of deleterecursive: void deleterecursive(file fileordirectory) { if (fileordirectory.isdirectory()) (file child : fileordirectory.listfiles()) deleterecursive(child); fileordirectory.delete(); } can tell me why? there special setting intent in order write permission? do have permission in manifest? (assuming files in external storage) uses-permission android:name="android.permission.write_external_storage" the deleterecursive function not work anymore i guessing problem not logic of deleterecursive() ; else. print things using logcat , see going on. try removing

angularjs - How can I tell what is calling one of my scope functions in angular? -

i have directive has template such as: <div ng-show="isvisible()"> ... </div> i've changed isvisible returns true , console.log. this directive included single time on page, yet log occurs 50+ times. want know code calling isvisible many times. there way trace calling function? actual stack trace useless, because angular appears hide everything. there tool figure out non-angular code triggered function call. in other cases have data changing , can't find it's changing [it's not code] , because original code in angular, can't use stack traces, or use watches or normal type of debugging. here directive: require('app').directive('kmformlanguages', ["$q", function ($q) { return { restrict: 'eac', template: '<span ng-show="isvisible()"><span km-select multiple ng-model="binding" binding-type="string" placeholder="available languages" ite

node.js - Need help to loop through and extract variable from a object within an array -

first of all, i´m noobie @ least in programming, , first project. seem stuck , need help. :) mission: im trying grab lat , lon variables mqtt stream, , return this [{"lat":54.9619349,"lng":-1.6003813},{"lat":54.9656694,"lng":-1.5239833},{"lat":54.9696456,"lng":-1.5069755},{"lat":54.9378907,"lng":-1.5273729}] this how far got: var msg.payload = {"id":10,"created":"2014-05-24t07:31:05","location":{"disposition":"mobile","waypoints":[ {"at":"friday","lat":43.64,"lon":10.73,"ele":"15"},{"at":"saturday","lat":43.68,"lon":10.78,"ele":"26"},{"at":"monday","lat":43.72,"lon":10.83,"ele":"43"},{"at":"tuesday","lat":43.41,"

python - Pip unable to install pylibmc -

centos release 6.5 (final). python 2.7.5 using virtualenv. > rpm -qa '*memcache*' libmemcached-devel-0.31-1.1.el6.x86_64 libmemcached-0.31-1.1.el6.x86_64 libmemcache-devel-1.4.0-0.1.rc2.el6.rf.x86_64 libmemcache-1.4.0-0.1.rc2.el6.rf.x86_64 @development-tools installed. this output trying install pylibmc : > pip install pylibmc downloading/unpacking pylibmc running setup.py egg_info package pylibmc warning: no files found matching 'license' warning: no files found matching 'runtests.py' warning: no files found matching '*.py' under directory 'pylibmc' installing collected packages: pylibmc running setup.py install pylibmc building '_pylibmc' extension gcc -pthread -fno-strict-aliasing -g -o2 -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -fpic -duse_zlib -i/usr/local/include/python2.7 -c src/_pylibmcmodule.c -o build/temp. in file included src/_pylibmcmodule.c:34: src/_pylibmcmodule.h

r - Selecting multiple odd or even columns/rows for dataframe -

is there way in r select many non-consecutive i.e. odd or rows/columns? i'm plotting loadings principal components analysis. have 84 rows of data ordered this: x_1 y_1 x_2 ..... x_42 y_42 and @ moment creating dataframes x , y loadings figures this: data.pc = princomp(as.matrix(data)) x.loadings <- data.frame(x=data.pc$loadings[c(1, 3, 5, 7, 9, 11, 13 ,15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41), 1]) yloadings <- data.frame(y=data.pc$loadings[c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42), 1]) surely there's easier way this? you can generate sequences seq: even_indexes<-seq(2,42,2) odd_indexes<-seq(1,41,2) then, x.loadings <- data.frame(x=data.pc$loadings[odd_indexes,1])

How to setup Postfix for Ruby On Rails to send email -

i want have postfix send email in ror project. safer , hax more functionality. but i'm quite lost. installed postfix , got ror working. next should do? (i need send email, not receive @ moment) should configure postfix , make able send email in comment line first, integrate ror? if so, how should set configure file in postfix , , how settings in rails ? or need every setting in rails ? if so, should detailed setting? i'm quite confused. lots of tutorials either not working or not suit situation. example action mailer configuration an example adding following appropriate config/environments/$rails_env.rb file: config.action_mailer.delivery_method = :sendmail # defaults to: # config.action_mailer.sendmail_settings = { # location: '/usr/sbin/sendmail', # arguments: '-i -t' # } config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true config.action_mailer.default_options = {from: 'no-repl

xcode - Why is "xcodebuild: command not found" in this build script? -

hi have following in root of xcode project: #!/bin/bash xcodebuild -scheme target1 clean; xcodebuild -scheme target1 archive; xcodebuild -scheme target2 clean; xcodebuild -scheme target2 archive; however, executes first line xcodebuild -scheme target1 clean; , yields ... ** clean succeeded ** xcodebuild: command not found xcodebuild: command not found xcodebuild: command not found disclaimer: i'm absolute mac os x / unix greenhorn. edit : following kranteg's suggestion added pwd script: #!/bin/bash pwd; xcodebuild -scheme target1 clean; pwd; xcodebuild -scheme target1 archive; pwd; xcodebuild -scheme target2 clean; pwd; xcodebuild -scheme target2 archive; pwd; the output: /users/cku/programme/uraclient === clean target uraclient of project uraclient configuration debug === check dependencies <... lots of compiler messages clean ...> ** clean succeeded ** /users/cku/programme/uraclient xcodebuild: command not found /users/cku/programme/uraclient x

How to change between text and icon using jQuery -

i have piece of code dropdown selection. want change text contained inside span icon. i have more complex code in background, allows me dynamically change values of number of divs specified user, post here part of code think useful me this. $("select.heating-type-select").on("change", function () { $("." + target + " span.heating-type-room").html($(this).val()); }); so, explain code, have undefined number of divs created every time, , every div create row options, example 1 in code. are there way add @ bottom of code if statement says (is not code logic) i have value ($(this).val()) , before replace text value want check if(previousvalue == something) { replace previousvalue html tag) , add html } else add value have since thanks lot

.net - Parse Ajax Posted JSON data in DelegatingHandler -

without going details of why want this, here want do. json data posted using jquery so: jq.ajax({ url: 'api/values', type: 'post', datatype: 'json', data: { a: 'hello', b: 'world' } }); in webapi delegatinghandler, i'd parse content json: protected async override task<httpresponsemessage> sendasync(httprequestmessage request, cancellationtoken cancellationtoken) { var data = request.content.readasstringasync().result; //data url encoded, want json... //??? //...i'm going json string here var response = await base.sendasync(request, cancellationtoken); return response; } json.net time gets webapi method that's going handle it, it's doable, i'm not sure how. note don't need typed or - plain json string do.

Where do I put the share buttons code? (share42) -

i generated buttons , downloaded folder has .png image .js file. put code , image? i'm familiar html , css. our website built on modx platform. can edit html , css on pages. modx revolution (the latest version of modx) tries not tell put things images , css. traditionally, javascript, css, images, , other front-end static resources go in "assets" directory. edit: noticed script share42 , have modified answer accordingly: let's unzipped directory , uploaded assets directory. file structure in traditional install follows: assets components (used modx extras store js, css, etc...) share42 icons.png share42.js connectors core manager then, paste following code in appropriate place in modx template or chunk: <div class="share42init"></div> <script type="text/javascript" src="[[++site_url]]assets/share42/share42.js"></script> this should work in properly-set-up modx installation, be

r - How to force Knitr to evaluate \Sexpr after all other code chunks -

i trying write abstract dynamic document, \sexpr{} calls not working. essentially trying start document off abstract has p-values generated \sexpr{value} value determined "downstream" in document. example this works: \begin{document} <<foo>>= value = 10 @ today bought \sexpr{value} salamanders \end{document} this not work (and trying accomplish) \begin{document} today bought \sexpr{value} salamanders <<foo>>= value = 10 @ i don't see straightforward solution postpone evaluation of \sexpr after evaluation of code chunks, still easy use \sexp values defined later in, example, abstract: use separate file ( myabstract.rnw ) abstract, add \input{myabstract} abstract supposed included , knit myabstract.rnw @ end of main document: document.rnw : \documentclass{article} \begin{document} \begin{abstract} \input{myabstract} \end{abstract} main text. <<>>= answer <- 42 @ \end{document} <<

bash - awk merge lines based on multiple field matching/unmatching -

we have csv: targetid , cpd_number , assay_id , alt_assay_id , type_desc , operator , result_value, unit_value , experiment_date , discipline, activity_flag 51, cpd-7788990 ,9999,0, ic50 ,,10, um , 2006-07-01 00:00:00 , biochemical , 51, cpd-7788990 ,4444,5555, ki , > ,5, um , 2006-08-01 00:00:00 , enzyme , 51, cpd-7788990 ,1212,2323, ic50 ,,100, um , 2006-09-01 00:00:00 , cell , our final goal : if “cpd_number” ($2) same “discipline” ($10) not “cell”, merge lines “discipline” ($10) “cell” , not “cell” together. (the “discipline” has 3 options: biochemical, cell, enzyme.) following ideal output. (note) new “result_value” ($7) = “result_value” ($7) of line “discipline” ($10) “cell” divide “result_value” ($7) of line “discipline” ($10) “biochemical” or "enzyme". targetid , cpd_number , cell_assay_id , cell_alt_assay_id , type_desc , assay_id , alt_assay_id , type_desc ,operator, result_value, unit_value ,cell_experiment_date,experiment_date, cell_di

javascript - Show or hide element -

i messing around react.js first time , cannot find way show or hide on page via click event. not loading other library page, looking native way using react library. have far. show results div when click event fires. var search= react.createclass({ handleclick: function (event) { console.log(this.prop); }, render: function () { return ( <div classname="date-range"> <input type="submit" value="search" onclick={this.handleclick} /> </div> ); } }); var results = react.createclass({ render: function () { return ( <div id="results" classname="search-results"> results </div> ); } }); react.rendercomponent(<search /> , document.body); the key update state of component in click handler using setstate . when state changes applied, render method g

mysql - Hosting web app on xampp -

*i hav made small demo web app(using html5, , jquery mobile) *i have installed , set xampp *set passwords local server * confused in next, store .html files , other resources *i need test app on network *i want set database using xampp ,(i have no idea how to) *edit: since mobile web app, want test mobile, possible hosting on pc ? if yes, how? if have apache server running on xampp, have put files in /htdocs map. located in c:/xampp/htdocs. go localhost in browsers, localhost , /example.html. example localhost/example.html, redirect example.html file in htdocs folder. if want set mysql database should take around @ localhost/phpmyadmin

python - mock __init__(self, ...): TypeError: super(type, obj): obj must be an instance or subtype of type -

i try mock constructor of class https://stackoverflow.com/a/17950141/633961 class mockedhttpresponse(django.http.response.httpresponsebase): def check(self, *args, **kwargs): status=kwargs.get('status') if status none , self.status_code==200: return # default if not status==self.status_code: raise self.assertionerrorstatuscode('%s!=%s' % (self.status_code, status)) def __init__(self, *args, **kwargs): self.check(*args, **kwargs) django.http.response.httpresponsebase.__init__(self, *args, **kwargs) class assertionerrorstatuscode(assertionerror): pass usage in test: def test_assert_http_response_status__with_self_mocking(self): django.http import httpresponse mock.patch('django.http.response.httpresponse', testutils.mockedhttpresponse): httpresponse(status=200) but exception: traceback (most recent call last): file "/home/foo_eins_di514/src/d

Deploying git archives with FTP -

i'd deploy git archive through ftp connection webspace. it's sharehoster don't have root nor console access , no git software. set this: git remote add deploy ftp://user:password@host ... , try deploy this: git push deploy master but get: "server denied change given directory". tried create git's directories manually, didn't change anything. has better advice changing hoster? you cannot send git data through ftp server. however, if want deploy worktree, repo files is, can try phploy . disclaimer: i've created phploy.

parseing xml response through php -

this question has answer here: basic simplexml working example? 5 answers simplexmlelement object ( [flightoption] => array ( [0] => simplexmlelement object ( [flight] => simplexmlelement object ( [@attributes] => array ( [arrivaldatetime] => 2014-07-05t15:00:00.000 [departuredatetime] => 2014-07-05t13:00:00.000 [equipmentcode] => 321 [flightnumber] => 677 ) [airline] => simplexmlelement object ( [@attributes] => array ( [airlinecode] => ai [iatacode] => ai [icaocode] => aic [name] => air india