Posts

Showing posts from August, 2011

emacs - yasnippet does not load automatically when .html file is loaded -

yasnipped has been installed on emacs using elpa/melpa package system. i can confirm it's in ~/.emacs.d/elpa/yasnippet-20160104.129 when load .html file there's no yasnippet menu, expected, please advise. did not add .emacs i think solution might cause problems when comes updating elpa yasnippet package. not idea rename package directories. there couple of things should try first. when have opened html file, try running m-x yas-minor-mode if works, need add call yas-minor-mode in startup hook html-mode. alternatively, can try executing m-x yas-global-mode if works, need put call (yas-global-mode) in init.el file if not work, check value of variables yas-snippets-dirs , yas-installed-snippets-dirs . former normal yas variable lists directories search snippets. latter variable should contain path top level snippets directory in elpa package. former contain "~/.emacs.d/snippets" yas-installed-snippets-dires if yas-installed

python - Flask SQLAlchemy Many to Many Delete Element -

my flask site has suggestions , users. class suggestion(db.model): id = db.column(db.integer, primary_key=true) user_nickname = db.column(db.integer, db.foreignkey('user.nickname')) voters = db.relationship('user', secondary=votes, lazy='dynamic') class user(db.model): id = db.column(db.integer, primary_key = true) suggestions = db.relationship('suggestion', backref='user', lazy='dynamic') votes = db.relationship('suggestion', secondary=votes, lazy='dynamic') i have set many many relationship between 2 such. votes = db.table('votes', db.column('user_id', db.integer, db.foreignkey('user.id')), db.column('suggestion_id', db.integer, db.foreignkey('suggestion.id')) ) when try delete suggestion inside views.py error. the view: @app.route('/_delete_suggestion', methods=['get', 'post']) def delete_suggestion():

elasticsearch - Pod stuck in "Terminating" state -

i had cause restart fluentd-elasticsearch pod nodes. out of 7 nodes pods deleted 1 of them deleted , came "running". there way purge pod in k8s? fluentd-elasticsearch pods static pods created via placing pod manifest files ( fluentd-es.yaml ) in directory watched kubelet. corresponding pod (a.k.a. mirror pod ) same name , namespace in api server created automatically purpose of introspection -- reflects status of static pod. kubernetes treats static pod (the pod manifest file) in directory source of truth; operations (deletion/update, etc) on mirror pod not have effect on static pod. you encouraged move away static pods , use daemonset , except few particular use cases (e.g., standalone kubelets). system add-on pods such fluentd-elasticsearch converted daemonset eventually.

swift - Closing iAD Banner causes the current scene to change -

i implemented iad , shows banner on bottom of screen. call function, showsad() in menu class , gamescene class show banner. gamescene gameplay happens. if click on iad banner in gamescene , automatically switches scene menu reason. online resources, code used show iad banner , in gameviewcontorller : class gameviewcontroller: uiviewcontroller, adbannerviewdelegate { var sh = uiscreen.mainscreen().bounds.height let transition = sktransition.fadewithduration(1) var uiiad: adbannerview = adbannerview() override func viewwilllayoutsubviews() { super.viewwilllayoutsubviews() nsnotificationcenter.defaultcenter().addobserver(self, selector: "hidebannerad", name: "hideadsid", object: nil) nsnotificationcenter.defaultcenter().addobserver(self, selector: "showbannerad", name: "showadsid", object: nil) self.uiiad.hidden = true self.uiiad.alpha = 0 } override func viewwillappear(animated: bool) { let bv

php - How to connect (route) Angular with Slim Framework API? -

i cannot populate json data in controller service. i bit stuck how connect them. service works fine when called generating json. controller works when used repository. omitted code in order save space. the problem lies in controller, don't know what. appreciate enlightenment. angular controller (root/app/user.controller.js) (function() { angular .module('app') .controller('usercontroller', usercontroller); function usercontroller($http) { var = this; $http({ method: 'get', url: '/api/users' }).success(function(data) { that.users = data; }); } })(); php service (root/api/index.php) <?php require 'vendor/autoload.php'; $app = new \slim\app; $app->get('/users', 'getusers'); $app->run(); function getusers() { $sql = "select * users order id"; try { $db = getconnection();

jquery - form not flagging errors on eachstep & running php code when submitted -

when fields correctit gives msg doesn't run thephp code associated isset how flag errors when next btn clicked before displaying next step/form <div class="idealsteps-container"> <nav class="idealsteps-nav"></nav> <form class="idealforms" novalidate autocomplete="off" action="/" method="post"> <div class="idealsteps-wrap"> <!-- step 1 --> <section class="idealsteps-step"> <div class="field"> <label class="main">book name:</label> <input name="bookname" type="text" > <span class="error"></span> </div> <div class="field buttons"> <label class="main">&nbsp;</label> <button type="button" class="next">next &raquo;</button> </div> </section> <!-- step 2--> <section c

python - Unirest for Java -

i have python script, post data server url below. want achieve using unirest java. how add parameter/header values unirest post request in java python script: url = 'http://??????????????????/savetimeseriesdata' params = {'clientid': 'admin', 'tenantid': '075841cb-d7fa-4890-84ea-fdd7d7c65b65', 'destinationid': 'timeseries','content-type': 'application/json','content':json.dumps(htlt_data.__dict__)} try: response= requests.post(url, params=params, proxies=proxies) print response except exception x: print x the server endpoint code : @requestmapping(value = "/savetimeseriesdata", method = requestmethod.post) public @responsebody string savemachinedata( @requestheader(value = "authorization", required = false) string authorization, @requestparam("clientid") string clientid, @requestparam(&

javascript - formatting a json object -

im trying use json store values page , access these values/variables later in php file. thing i'm new json , javascript in general , im struggling hours find solution problem might stupidly simple guys have experience in this: have this: var invoice_data = { "client":[ { "client-name" : "", "client-address" : "", "client-address-2" : "", "client-city-state" : "", "client-country" : "" } ], "shoppingcart":[ { "1" : {"item-name":"", "qty":"", "price":"", "discount":"", "subtotal":""} } ], }; so inheritance thing im not getting. i've created "client" object im creating "shoppingcart", thing when user orders more item there should created sub-object store it's details too.so im assumi

ios - How do I change build settings of an Xcode project that is a git submodule -

i have xcode project ios app uses project, rest kit, git submodule. i want effect change in build settings of restkit, reason, when build debug build @ no other time. don't want modify build settings because may 1 app need make change for. , change made appear changed file in git.

php - htaccess RewriteRule doesn't work properly if no trailing slash -

i trying redirect 1 subdirectory using rewriterule in main directory's .htaccess file. for example: http://website.com/subdir should rewrite http://website.com/another_dir/destination_dir user should still see http://website.com/subdir in address bar. this works if user ends url trailing slash. example: http://website.com/subdir/ (generates 200 however, if slash omitted, 301 redirect generated , see undesired destination directory. example, http://website/subdir redirects user http://website/another_dir/destination_dir here pertinent parts of .htaccess: # url rewriting: rewriteengine on rewritebase / ... # redirect subdirectories: rewriterule ^subdir(.*)$ another_dir/destination_dir$1 [pt,nc,qsa,l] any assistance appreciated! you can adjust regex in rewrite rule optionally match slash. rewriterule ^subdir(/?.*)$ another_dir/destination_dir$1 [pt,nc,qsa,l] note /? after subdir . says there may or may not slash after subdir, regex match either w

How to take for loop output to separate array in Java? -

i need take following code output separate array use calculation. in example output is, z count is= 1 y count is= 3 x count is= 2. i need take 1, 3, 2 separate array. how it? new java. import java.util.arraylist; import java.util.hashmap; import java.util.map; public class forarrays { public static void main(string[] args) { arraylist<string> name = new arraylist<string>(); hashmap<string, integer> termfreqmap = new hashmap<string, integer>(); arraylist<string> words = new arraylist<string>(); hashmap<string, integer> wordfreqmap = new hashmap<string, integer>(); name.add("x"); name.add("y x"); name.add("y z y"); // count words (int j = 0; j < name.siz

ios - Subclassing PFUser does not effect the data stored -

i using swift. this question talks parse service. i've read ways using both @nsmanaged , dynamic key-words, decided example implement them both. issue here in user object of data manager, i'm noticing additional information not being stored in database. application store additional information in user table, such first , last name. here's example: import parse public class user : pfuser { @nsmanaged public var firstname: string! dynamic public var lastname: string! override public class func initialize() { struct static { static var oncetoken : dispatch_once_t = 0 } dispatch_once(&static.oncetoken) { self.registersubclass() } } init(email: string, password: string) { super.init(); self.username = email; self.email = email; self.password = password; self.firstname = "myfirstname"; self.lastname = "mylastname";

php - pull from session user info -

ok have user login uses email address , password when login want pull there session data like username , else there record i use <?php if(isset($_session['email'])) { echo $_session['email']; } ?> it works , pulls there email address how there username? tried changing email username , nothing shows my login setup /* login functions */ function login_user($email, $password, $remember) { $sql = "select user_pwd, uid users user_email = '" . escape($email) . "' , active = 1"; $result = query($sql); if (row_count($result) == 1) { $row = fetch_array($result); $db_password = $row['user_pwd']; if (password_verify($password, $db_password)) { if ($remember == "on") { setcookie("email", $email, time() + 86400,&

Android set image from URI on ImageView -

updated more code i trying grab picture taken , set imageview programmatically. the picture button pressed, picture_button.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { takephoto(mtextureview); } }); it runs takephoto method: public void takephoto(view view) { try { mimagefile = createimagefile(); final imageview latest_picture = (imageview) findviewbyid(r.id.latest_picture); final relativelayout latest_picture_container = (relativelayout) findviewbyid(r.id.latest_picture_container); final string mimagefilelocationnew = mimagefilelocation.replacefirst("^/", ""); toast.maketext(getapplicationcontext(), "" + mimagefile, toast.length_short).show(); uri uri = uri.fromfile(mimagefile); toast.maketext(getapplicationcontext(), ""+uri, toast.length_long).show(); latest_picture.setimageuri(uri); latest_picture_containe

c# - How can I put these points (x,y) in order? -

i have a* algorithm implemented, find way between 2 coordinates, , works (pretty much). after that, need show circle, going step step through path problem is, order coordinates added list, (then) show them, based on x, y; and, sometimes, has change directions, like: left, left, left, up, up, up, left, left, down, down, left, up, up, up. i have tried order them x, y, ascending , descending , vice versa, but, because of direction changes, not work circle go step step. so, had idea, not sure, on how it: first: create list, , set ids each point. second: make initial point path made, id 0 third: add other coords: private async void showanimation(int size) { int idofmap = 0; int xplus = 1; int yplus = 1; mapa = new mapa(); list<mapa> resultmap = new list<mapa>(); foreach (mapa camino in mapa.mapacamino) { if (camino.x == initialstore_x && camino.y == initialstore_y) {

How to make JsonArray cache in android -

i need store jsonarray retrived server store in cache.i tried several method;but not creating cache file.my code given below public class makecache { public void vehiclecache(){ string json_url = "http://domainname.com/api/vehicle"; jsonarrayrequest jsonobjectrequest=new jsonarrayrequest(json_url,new response.listener<jsonarray>(){ @override public void onresponse(jsonarray response) { log.d("vehicles", response.tostring()); try { objectoutput out = new objectoutputstream(new fileoutputstream(new file(g.context.getcachedir(), "") + "lpavehicle.srl")); out.writeobject(response); out.close(); }catch (ioexception ex){ log.d("file",ex.getmessage()); } } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { volleylog

c++ - A function that returns a pointer to a class -

suppose have class called myclass, i'm writing function should return object of type myclass. object exists before calling function. do: myclass function() { return myclassinstance; } but remembered pointers , references , think doing create new copy of myclassinstance , return it, waste of memory. thought, why not this: myclass * function() { return &myclassinstance; } so result accessed as, myclass * object; object = function(); object->"class member"... is correct? you surely can that. run ok. has no problems aspect of syntax. need take care there more 1 pointers pointing object. may bring hidden problems.

javascript - What is difference between these two statements? -

this question has answer here: javascript closure inside loops – simple practical example 31 answers var tr = document.getelementsbytagname('tr'); tr[0].onmouseover = function(){ tr[0].style.backgroundcolor = '#ccc'; } tr[1].onmouseover = function(){ tr[1].style.backgroundcolor = '#ccc'; } tr[2].onmouseover = function(){ tr[2].style.backgroundcolor = '#ccc'; } the first right, when use for loop in following code snippet, " uncaught typeerror: cannot read property 'style' of undefined ". var tr = document.getelementsbytagname('tr'); for(var i=0;i<tr.length;i++){ tr[i].onmouseover = function(){ tr[i].style.backgroundcolor = '#ccc'; } } yo

android - Creating Pie chart / progressbar like arc in andorid -

Image
i working on project want show pie chart image added. have searched google , other posts in stackoverflow, not find solution. solution appreciated. note: suggestions of third-party library welcome. please not suggest mpandroidchart think query can implemented using simpler method. you can use library https://github.com/philjay/mpandroidchart achieve this. add below in xml: <com.github.mikephil.charting.charts.piechart android:id="@+id/chart" android:layout_width="match_parent" android:layout_height="match_parent" /> in java code: piechart chart = (piechart) findviewbyid(r.id.chart); example code: https://github.com/philjay/mpandroidchart/blob/master/mpchartexample/src/com/xxmassdeveloper/mpchartexample/piechartactivity.java there lot of variances available. another library consider is: https://github.com/lecho/hellocharts-android

java - junit.framework.AssertionFailedError: Import failed: File accessed outside allowed roots -

a junit test runs fine on local os x, there error "allowed roots" in jenkins. i've tried chmod -r 777 *, did not help. question: there flag can pass junit explicitly specify allowed roots? 1) testexcludes1(com.twitter.intellij.pants.integration.osspantsscalaexamplesintegrationtest) junit.framework.assertionfailederror: import failed: file accessed outside allowed roots: file:///export/hdb3/jenkins/workspace/intellij_plugin_ci_trigger@2/.cache/pants/pants; allowed roots: [/export/hdb3/jenkins/workspace/intellij_plugin_ci_trigger@2/.pants.d/intellij/plugins-sandbox/test, /tmp/unittest_excludes1_569/testexcludes10, /var/lib/jenkins, /export/hdb3/jenkins/workspace/intellij_plugin_ci_trigger@2/.pants.d/resources/services, /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64/jre, /tmp] turns out virtualfile system access issue intellij. answer found @ https://youtrack.jetbrains.com/issue/idea-129297#

javascript - Using jQuery noty within CodeIgniter view for flashdata (page reload) -

i have been searching ages no avail. trying use jquery noty in order give failure notifications (instead of standard bootstrap notifications have been using). cannot life of me how supposed work. want notification appear based on there being error in flashdata... i still in learning stages of javascript / jquery dumb newbie mistake, appreciate assistance can rendered! controller: elseif ($usr_result['status'] == false) { $this->session->set_flashdata('flasherror', 'user not active, please contact administrator'); redirect('account/login'); } view: <?if($this->session->flashdata('flasherror')):?> <script type="text/javascript"> $.noty.defaults.killer = true; noty({ text: '<?=$this->session->flashdata('flasherror')?>', layout: 'top', type: 'error', closebutton: ['true']});

asp.net - un able to get the value of template field text box in a custom method in update event in grid view -

i trying value of txtcustomername textbox (template field) in code behind, when run code,i getting null reference exception aspx code <asp:templatefield headertext="customer name" > <itemtemplate> <asp:label id="lblcusomername" runat="server" text='<%#databinder.eval(container.dataitem, "customername") %>'></asp:label> </itemtemplate> <edititemtemplate> <asp:textbox id="txtcustomername" runat="server" text='<%#eval("customername")%>'></asp:textbox> </edititemtemplate> </asp:templatefield> protected voi

delphi - Convolve function: Apply different radius in Gaussian filter -

there convolve function in swissdelphicenter.ch , set kernel , resulting image blurred, there no parameter apply more blur unless call function multiple times (not desired coz of performance issue). how apply more blur image radius parameter in photoshop gaussian filter? i using kernel apply gaussian filter: 1    2    1 2    4    2 1    2    1 you can make larger gaussian kernel - 5x5, 7x7 etc. performance decrease proportional size^2. kernel size faster use approach fft-based convolution. edit fft-based convolution: have data array a, array kernel values k (same length, zero-padded). conv(a, k) = backfft (fft(a) * fft(k)) to make convolution, 1 can find fourier transform of data find fourier transform of kernel multiply them element-by-element (note numbers complex) make inverse fourier transform of product real part of look @ fast convolution algorithms section in wiki , part 13.1 of numerical recipes (almost practical manual) if interesting in f

Drupal 7 Search API, Elasticsearch Connector, Aggregation/Facets -

Image
i using search api , elasticsearch connector in drupal 7 site. have hosted elasticsearch in aws. searching works without issues. add facetapi filters in drupal.org search result page. it seems facetapi removed elasticsearch , added support aggregation. https://www.elastic.co/guide/en/elasticsearch/reference/2.1/breaking_20_removed_features.html#_facets_have_been_removed https://www.elastic.co/guide/en/elasticsearch/reference/1.3/search-aggregations.html but aggregation not supported. https://www.drupal.org/node/2643822 https://www.drupal.org/node/2503343 any suggestion or idea how can achieve this? there other way or missing here? yeah. use https://www.drupal.org/project/elasticsearch_connector and use elasticsearch version 1.x. elasticsearch 2.x in dev.

ios - How to switch custom in-app keyboards -

Image
recently i learned make custom in-app keyboards . want able swap between multiple custom keyboards. however, resetting textfield.inputview property not seem work. i recreated simplified version of problem in following project. uiview s represent actual custom keyboards. import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var textfield: uitextfield! override func viewdidload() { super.viewdidload() let blueinputview = uiview(frame: cgrect(x: 0, y: 0, width: 0, height: 300)) blueinputview.backgroundcolor = uicolor.bluecolor() textfield.inputview = blueinputview textfield.becomefirstresponder() } @ibaction func changeinputviewbuttontapped(sender: uibutton) { let yellowinputview = uiview(frame: cgrect(x: 0, y: 0, width: 0, height: 300)) yellowinputview.backgroundcolor = uicolor.yellowcolor() // doesn't cause view switch textfield.inputview = yellowinputview }

c# - How to stream reads in Couchbase -

i want stream set of documents query in couchbase using single query. problem return a couple of million of documents , want them gradually couchbase, light processing , write result file stream, saving me loading whole result set memory. know if possible in couchbase? edit: sorry, forgot i'm trying in c# currently, way directly use paging on query retrieve results in chunks. comes obvious downside of result set (potentially) changing between page retrievals, if have other process continues change data in background. in c# (typing memory, apologies if doesn't compile straightaway): var pagesize = 100; var pageindex = 0 iqueryresult<dynamic> result = null; { var query = string.format("select mybucket.* mybucket limit {0} offset {1}", pagesize, pageindex); result = await bucket.queryasync<dynamic>(query); pageindex += result.rows != null ? result.rows.count : 0; } while(result.success && result.rows.count > 0); you

jquery - How to hide and toggle content -

how can hide content without disturbing rest of content in jquery? need toggle also? .css{visibility:hidden} doesn't me toggle. you can toggle element p or particular class or id. <script> $(document).ready(function(){ $("button").click(function(){ $("your_element_neme").toggle(); }); }); </script>

android - Apache httpClient.execute() NoSuchMethodError - project builds ok, but this happens at runtime? -

Image
a few days ago moved eclipse project 1 folder , set dependencies again. the project builds , app runs until gets piece of code: httpresponse httpresponse = httpclient.execute(httppost); where error: caused by: java.lang.nosuchmethoderror: org.apache.http.impl.client.defaulthttpclient.execute in libs folder have these jars: httpclient-4.3.5.jar httpcore-4.3.2.jar httpmime-4.3.5.jar and here how order , export looks like: and libraries tab edit: thing tried downloading lastest httpcore, httpclient , httpmime , replacing jars in libs folder and added them add external jars in libraries tab of configure build path i resolved problem downgrading versions 4.1 or httpcore, httpclient , httpmime.

Powershell / PowerCLI - Need more efficient method of inserting dynamic information into SQL -

i've used stackoverflow years, today first time i've felt need ask question. know if following code made more efficient, because i'm writing multiple copies of script, entering different sql tables. what does: querys vmware, outputs $data truncates sql table inserts $data dbo.t_vm_guest_details inserts dbo.t_vm_guest_details dbo.t_vm_guest_details_history ideas efficiency: just above foreach ($line in $data), possible include "foreach column in $data" dynamically build 'standard' sql insert query, based on count of columns, names & values. or there easier way insert $data sql table elsewhere , i'm making difficult myself? keeping sql table column names same powershell output should help? the following block fills $data list of vms (powercli): $data = @() $allvms = get-vm | select * $entry = @() foreach ($vm in $allvms) {

elasticsearch - Logstash with RabbitMQ - Small Message rates (deliver / get | ack) -

Image
i using rabbitmq in system. (two node , ha queue) have 2 ls-forwarder, 2 ls-indexer (8gbram, 8core) , 3 node in es (32gb, 16core) i check queue in rabbitmq , isssue : imcoming 5k events/document per second , deliver / 600 ~ 2000 events/doc per second only. and after 30min, have 2m document queued in rabbitmq. i increae thread 400 / ls-indexer rabitmq. (consumers =800). but message rates (deliver / get) ~2500 docs/events maximum. ack ~1500 so how increase message rates (deliver / get) ??

algorithm - Missing corner cases -

below link problem https://www.hackerrank.com/challenges/and-xor-or/copy-from/16519519 have implemented o(n) solution seems ok (no tle , 29 testcaes passed out of 32). solution failing testcaes , not able find error, surely missing corner cases. hint great help. have posted code below have ran , submitted. #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <stack> #define ul unsigned long using namespace std; ul comp(ul a, ul b){ ul result = ((a&b)^(a|b))&(a^b); return result; } int main() { /* enter code here. read input stdin. print output stdout */ int n; cin>>n; vector<ul>ip(n); for(int i=0;i<n;i++) cin>>ip[i]; stack<ul>st; ul result=0; for(int i=0;i<n;i++){ if(st.empty()) st.push(ip[i]); else{ result=max(result,comp(st.top(),ip[i])); while(!st.empty() && st.top()

vba - How could I have set the database application name in the title bar? -

in access 2016 database "mediaman.accdb" has application name set ("mediaman - dev copy") in title bar differently filename, there nothing set vba , options setting under current database application title "mediaman". personal database use @ home, have development copy , live copy. of course set @ point in dev copy, before cloning live copy , forgot remove appendage in live copy. life of me dont remember how set it, although have expected in main form onload(). other means have been set? (there backend db , linked "interface-only" instance running @ 1 time) do global search in vba code apptitle , perhaps setwindowtext if used api function. maybe have autoexec macro calls startup code. from online help: sub changetitle() dim obj object const conpropnotfounderror = 3270 on error goto errorhandler set dbs = currentdb ' change title bar. dbs.properties!apptitle = "contacts database" 

javascript - How to get HTML5 Range (2 slides) Slider's value in PHP? -

i have code: html : <div class="unit"> <div class="slider-group"> budget: <label id="2-h"></label> </div> <div id="slider-2-h"></div> <input type="hidden" name="sliderbudget" id="slidervalue" value=""> </div> javascript : $(function() { $( '#slider-2-h' ).slider({ range: true, min: 0, max: 500, values: [ 75, 300 ], slide: function( event, ui ) { $( '#2-h' ).html( '€' + ui.values[ 0 ] + ' - €' + ui.values[ 1 ] ); }, change: function(event, ui) { $('#slidervalue').attr('value', ui.value); } }); $( '#2-h' ).html('€' + $('#slider-2-h' ).slider( 'values', 0 ) + ' - €' + $( '#slider-2-h' ).slider( 'va

scala - Java 8 is installed, but java -version shows 1.4 -

Image
os - windows 7 64 bit i getting "exception in thread main", when type scala in command prompt in stackoverflow (already asked question) suggested use same jre , jdk version. uninstalled java (jre , jdk) , installed jre , jdk 8. but when check java -version says "1.4" , still exception(exception in thread) in path, there no java 1.4: c:\users\appdata\roaming\cabal\bin;c:\users\appdata\local\atom\bin;c:\program files\java\jdk1.8.0_66\bin;c:\program files\java\jre1.8.0_66\bin;c:\program files\java\jdk1.8.0_65\bin;c:\program files (x86)\scala\bin;c:\program files (x86)\java\jre1.8.0_66\bin\client in control panel -> java -> java tab -> view still says 1.8 how can make scala work? "open new console" try java -version . worked me . scala issue resolved :) thanks... @engineer

java - Hibernate nested queries -

we trying create hibernate specific query below lsession.createquery(lquerystring.tostring()); ............ insert employee_history (emp_status, createdby, releasedate, year) select case n.emp_status when 0 'draft' else 'final' end, m.createdby, m.releasedate, m.year employee m, (select count (1) employee_history b,employee a.emplid=b.emplid , a.year=b.year , b.year=2012 , a.doc_id='xyz') n a.doc_id='xyz' getting following exception,i guess because of below statement in query (select count (1) employee_history b,employee a.emplid=b.emplid , a.year=b.year , b.year=2012 , a.doc_id='xyz') n org.hibernate.hql.ast.querysyntaxexception: unexpected token: ( near line 1, column 374 insert employee_history (emp_status, createdby, releasedate,

Is there a .Equals function in C# that takes into account nulls? -

i have code: var upd = newobj.where(n => oldobj.any(o => (o.subtopicid == n.subtopicid) && (o.number != n.number || !o.name.equals(n.name) || !o.notes.equals(n.notes)))) .tolist(); what noticed when notes null .equals fails. .","exceptionmessage":"object reference not set instance of object.","exceptiontype":"system.nullreferenceexception","stacktrace":" @ webrole.controllers.topiccontroller.<>c__displayclass8_1.b__1(subtopic o) in c:\h\server\webrole\controllers\web api - data\topiccontroller.cs:line 118\r\n @ system is there way .equals take account either o.notes or n.notes null? ideally wondering if have function kind of check in quite few places in code. you use static object.equals(object obja, object objb) method. given derives object , can omit object , call equals , e.g: oldobj.any(o => !equals(o.name, n.name) ... this handles case eithe

How to specify border attribute to a knob object in jquery? -

i have code snippet extending knob properties... thickness : this.$.data('thickness') || 0.29, width : this.$.data('width') || 70, height : this.$.data('height') || 70, how include border property , border= 1px solid #000; .... here

html - How to remove this unwanted right margin? -

Image
before marking duplicate or downvoting, want tell have tried available solutions on stack overflow. have set body,html , other elements margin 0 still don't know come from. infact knew white spaces buit has different color altogether. check image more details. did not add code because don't know part of code should add unwanted space created header footer. if tell me more happy add code. let me tell again have tried margin:0 property body. kindly me. you can css. overflow-x:hidden; for example: body{ overflow-x:hidden; }

linux - TomEE says started but it isn't -

when try start apache tomee plus 1.7.2 on ubuntu 14.04.3 x64 via bin/startup.sh output: :~/apache-tomee-plus-1.7.2/bin# ./startup.sh using catalina_base: /root/apache-tomee-plus-1.7.2 using catalina_home: /root/apache-tomee-plus-1.7.2 using catalina_tmpdir: /root/apache-tomee-plus-1.7.2/temp using jre_home: /usr/lib/jvm/java-1.7.0-openjdk-amd64/ using classpath: /root/apache-tomee-plus-1.7.2/bin/bootstrap.jar:/root/apache-tomee-plus-1.7.2/bin/tomcat-juli.jar tomcat started. but seems not start. not available via ip:8080 remote netstat -a | grep 8080 returns nothing ps -ef | grep tomcat returns root 1176 1 5 07:48 pts/0 00:00:10 /usr/lib/jvm/java-1.7.0-openjdk-amd64//bin/java -djava.util.logging.config.file=/root/apache-tomee-plus-1.7.2/conf/logging.properties -djava.util.logging.manager=org.apache.juli.classloaderlogmanager -javaagent:/root/apache-tomee-plus-1.7.2/lib/openejb-javaagent.jar -djava.endorsed.dirs=/root/apache-tomee-plus-1.7.

ruby on rails - Why should I have to precompile assets everytime? -

whenever add type of asset (javascript, image or css file, whaterver), gives me error precompile first adding rails.application.config.assets.precompile += %w( ) config/initializers/assets.rb . should solve issue? the error caused when explicitly reference assets aren't in asset pipeline. specifically: #app/views/layouts/application.html.erb <%= stylesheet_link_tag :application, "file" %> the issue you're calling file has compiled outside normal scope of asset pipeline (concatenating files application.js / application.css : #app/assets/javascripts/application.js //= require jquery the above creates single application.js file referenced files (eg jquery ) placed. this works well, however, if have file.js you're referencing individually, you'll end massive issues if rails cannot find it. thus, prompted add file assets.rb : #config/initializers/assets.rb rails.application.config.assets.precompile += %w(file) you only nee

arraylist - how to change listview data on spinner selection? -

i have spinner , listview in view. data coming in both sqlite . spinner data coming category table(cid, cname) cname show in spinner , listview data items table(iid, iname, cid) iname show in listview. cid foreign key in items table .when spinner selection change want change listview data.this have done far.. below spinner cname populated sqlite spinner1.setonitemselectedlistener(new adapterview.onitemselectedlistener() { @override public void onitemselected(adapterview<?> parent, view view, final int position, long id) { dbrepo = new dbrepo(getapplicationcontext()); string pos = (string) parent.getselecteditemposition(); string cid = dbrepo.getid(pos); toast.maketext(getapplicationcontext(), cid, toast.length_long).show(); final arraylist<support> list = dbrepo.getitems(cid); adapter = new custom