Posts

Showing posts from June, 2011

spring - ClassFormatError while using TomcatInstrumentableClassLoader : illegal modifiers: 0x18 -

i using tomcatinstrumentableclassloader implement aspectj load time weaving. during initial setup of application use classutils.getclass() load classes. at stage getting java.lang.classformaterror : method test_aroundbody0 in class com/abc/foo has illegal modifiers: 0x18 foo.java interface , test() default method in interface. i not error when use default classloader. i using, spring-instrument-tomcat-4.1.6 jdk-1.8.0_20 tomcat-7.0.47 aspectjweaver-1.8.5.jar any suggestions or answers appreciated.

cucumber - does if else concept available in feature file (gherkin language)? -

is there anyway can use if/else concept in feature file? example: scenario: user should able check login page given on login page when click on signin button should in home page if yes create new profile else logout page not aware of. gherkin (and cucumber) best used when specify discreet business cases though, , should repeatable, else hard follow , test. looks have 2 stories here @ least: scenario: new user should asked sign in given new user , navigate login page when click on signin button should not able home page scenario: existing user should able log in given existing user , navigate login page , submit valid credentials when click on signin button should taken home page

javascript - mvc partial view js file not working debug -

hello if use inside js file view javascript debug not working person.js function loadpersons() { $.ajax({ url: '/person/getpersons/', type: 'post', datatype: 'json', contenttype: 'application/json; charset=utf-8', async: false, success: function (result) { }, error: function (jqxhr, textstatus, errorthrown) { dynamicalertifyfunction('error', 'getcrew'); } }); } person.cshtml <script src="~/scripts/person.js"></script> <script> $(document).ready(function () { loadpersons(); }); </script but if use inside js file _layout debug working why ? person.cshtml @* <script src="~/scripts/person.js"></script>*@ _layout.cshtml <script src="~/scripts/person.js"></script> thank you just check, referencing jquery...

android - How to fade out activity when we finish it? -

i have activity button. if user clicks button , start service , finish activity . want fade out it. how it? tried ways seems not work. mainactivity.this.overridependingtransition(r.anim.slide2, r.anim.slide); use above code. here fade out animation code. fade_out.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:fillafter="true" > <alpha android:duration="1000" android:fromalpha="1.0" android:interpolator="@android:anim/accelerate_interpolator" android:toalpha="0.0" /> </set>

Ruby Error `require': cannot load such file -- bcrypt_ext (LoadError) -

i can't seem ruby project running everytime run error pops c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/bcrypt-3.1.7-x86-mingw32/li b/bcrypt.rb:16:in `require': cannot load such file -- bcrypt_ext (loaderror) c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/bcrypt-3.1.7-x 86-mingw32/lib/bcrypt.rb:16:in `rescue in <top (required)>' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/bcrypt-3.1.7-x 86-mingw32/lib/bcrypt.rb:12:in `<top (required)>' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:76:in `require' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:76:in `block (2 levels) in require' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:72:in `each' c:/railsinstaller/ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.7.7/ lib/bundler/runtime.rb:72:in `block i...

php - str_replace() removes numeric value with / in a string? -

my code: <?php $string="img\1\evs\good habits.mp41.png"; echo str_replace('\\','/',$string); ?> output: img/evs/good habits.mp41.png my original string : img\1\evs\good habits.mp41.png , in output removed 1 . please tell me reason if know ? it's not fault str_replace() . if do: echo $string; you see lost number there: img\evs\good habits.mp41.png because backslash escapes 1. solution? you have escape backslashes in original string or change double quotes single quotes, escape sequence doesn't interpreted php anymore.

sql server - sql custom bulk insert -

i have big files (aprox. 50.000 rows) lot of columns (450 columns) want bulk insert , thing want 220 of them inserted. there way can sql without using backend processing ? the file 123434|s2231|1|||0|inet|20150511123344|...........1233123|12|0 and star_date field in db datetime , in .csv date comes 20150511123344 (yyyymmmddhhmmss format) best way insert without preprocessing (2015-05-11 12:33:44) ? thank much you can use openrowset bulk rowset provider . here sample link: use adventureworks2012; delete mytestformatfiles; go insert mytestformatfiles select * openrowset(bulk 'c:\mytestformatfiles-c.dat', formatfile='c:\mytestformatfiles.xml' ) t1 ; go select * mytestformatfiles; go in case, replace "select *" column list. may or may not need format file, try without first. given table has 400+ columns, can generate format file using bcp.exe, assuming have access server , table bcp file generated from. sample com...

osx - Installing SASS on Yosemite -

i'm struggling error in command line while trying install sass. i'm following sass website recommend type in command line: sudo gem install sass and here error got: my-macbook-pro:~ username$ gem install sass error: not find valid gem 'sass' (>= 0), here why: unable download data https://rubygems.org/ - errno::etimedout: operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz) error: possible alternatives: sass then when try test if installed command line: sass -v i got: -bash: sass: command not found i have 2015 macbook pro latest osx yosemite. alternatively, how install sass manually? see trying download https://rubygems.org/latest_specs.4.8.gz . thanks in advance help! that's because servers serving gems blocked in china (for whatever reason is). easier way solve be: open terminal gem sources -r https://rubygems.org/ gem sources -a https://ruby.taobao.org/ (this mirror of rubygems.org...

php - Full text search to match multiple words in a string mysql -

Image
i using fulltext search search query. when search 2 words want exact 2 words match results. here problem getting 1 word match results also. data contains polish language characters. code is $qry="select * tbl_jobs match(job_title) against('+młodszy +konsultant' in boolean mode)"; i getting results as 1. [job_title] => młodszy konsultant ds. sprzedaży 2. [job_title] => młodszy konsultant 3. [job_title] => konsultant ds. sprzedaży młodszy 4. [job_title] => telefoniczny konsultant i have following indexes here first 3 results correct 4th result wrong. job_title contains 1 matching word results. want 2 search words mandatory results set. query correct using utf8_general. exact problem please me if have 2 words abc , xyz match , want match both can use wildcard % match regular expression matching select * mytable job_title '%abc%xyz%' or job_title '%abc%xyz%' it give records job title contains both word...

Rails Routes issue on heroku -

my app working fine on localhost when push app on heroku, show error on heroku. heroku log below actioncontroller::routingerror (no route matches [post] "/forgot_password"): and below rake routes result app working fine on localhost when push app on heroku, show error on heroku log below actioncontroller::routingerror (no route matches [post] "/forgot_password"): your routes suggest path "/api/v1/forgot_password". , getting path error "/forgot_password". check form routing path.

php - Insert hidden text inside selectbox option -

i have selectbox displays name , surname list of people. want add id each of them , make invisible. ex. if have john smith id 001 want write john smith:001 , should seen john smith . important id not unseen doesn't take space. this code: $result = pg_query(connect(), "select id, name, surname person order name asc, surname asc"); $person = pg_fetch_all($result); echo '<select value="person" name="person">'; for($i=0; $i<sizeof($person); $i++) { $person = $person[$i]['name'].' '.$person[$i]['surname']; echo "<option>".$person."<span hidden>:".$person[$i]['name']."</option>"; } echo '</select>'; however, isn't working because id remains visible try setting value combined name , id (further comment): <?php $result = pg_query(connect(), "select id, n...

css - Symfony 2 SonataAdminBundle broken styles -

Image
after have installed sonataadminbundle 2.4.*@dev style of buttons sonata_type_model_list has been broken (there no borders , hover link blanks out). style choice field has been broken. sonata_type_model_list choice field how can fix this?

How to link lapack with php -

i need solve linear equation installed lapack svn co https://icl.cs.utk.edu/svn/lapack-dev/lapack/trunk lapack cd lapack mkdir build cd build cmake -d build_shared_libs=on -d lapacke=on ../ make sudo make install i followed steps , tried <?php $a = array( array( 1.44, -7.84, -4.39, 4.53), array(-9.96, -0.28, -3.24, 3.83), array(-7.55, 3.24, 6.27, -6.64), array( 8.34, 8.09, 5.28, 2.06), array( 7.08, 2.52, 0.74, -2.47), array(-5.45, -5.70, -1.19, 4.70), ); $b = array( array( 8.58, 9.35), array( 8.26, -4.43), array( 8.48, -0.70), array(-5.28, -0.26), array( 5.72, -7.36), array( 8.93, -2.52), ); $result = lapack::leastsquaresbyfactorisation($a, $b); var_dump($result); ?> this code test , saying lapack class not defined please help

android - Safest approach for holding an instance of Activity -

what best , safer approach holding instance of activity private activity mactivity; first approach: @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mactivity = getactivity(); } second approach: @override public view oncreateview(layoutinflater inflater, @nullable viewgroup container, @nullable bundle savedinstancestate) { view view = inflater.from(getactivity()).inflate(r.layout.fragment_main, container, false); mactivity = (activity) view.getcontext(); return view; } well, depends. advice use getactivity() . you can use after onattach(activity activity) . if @ fragmentmanager source code, can see there, mactivity field of fragment set before calling onattach . but have careful, activity not initialized (views,..) before onactivitycreated gets called.

wcf - ASP.NET MVC5 Identity account lockout without Entity Framework -

i have created asp.net mvc5 application allows users access financial data including invoices, services , products have acquired our company. the application gets data set of wcf services including list of registered users have access system. i'm using asp.net identity object , claims authorize users application, works fine have use credentials (email , password) invoke wcf service returns object containing details user or null value if there's no match. however, there's new requirement implement account lockout after 5 failed login attempts (the account locked 20 minutes before allowing users try again) feature included in asp.net identity 2.0. have been "googling" couple of days, couldn't find example (or similar approach) of how implement requirement without storing users in entity framework , local db. is there way of adding account lockout feature (with 20 minutes lockout) using wcf service datasource asp.net mvc5 application? ideas? this firs...

php - SMTP Mail not displaying Date in Mail Header -

i using smtp mailing purpose. here code $from = "koh<projects@bzinfo.in>"; $to = $sendmail['email']; $subject = $row["title"]; $body = $row["message"]; $headers = array('from' => $from, 'to' => $to, 'subject' => $subject); $smtp = mail::factory('smtp', array ('host' => $host,'auth' => true,'username' => $username,'password' => $password)); $mail = $smtp->send($to, $headers, $body); it displaying the sent time none what can display time in header of email. regards carol you need include date parameter in header array of email i.e., 'date'=> date('r', time()) so header array should $headers = array('from' => $from, 'to' => $to, 'subject' => $subject, 'date'=> date('r', time()); here wikipedia page gives smtp transport example here

javascript - How to get the value of these created textboxes? -

whenever clicking on "add textbox" button create new +1("multiple") html textbox jquery's append method not logic value in php. $(w).append('<div><input type="text" name=/><a href="#" id="removes">remove</a><br/></div>'); suppose if create 5 new textboxes how assign them name not create problem when value php & store in database. try way: $(w).append('<div><input type="text" name="textboxname[]"/><a href="#" id="removes">remove</a><br/></div>'); ^^^ add name and have value in php this: suppose using post method: $fisrt = $_post['textboxname'][0]; $second = $_post['textboxname'][1]; or can use foreach loop this: foreach($_post['textboxname'] $values){ //you logic }

php - Apache solr schema field not displaying in json result -

i using apache solr-5.1.0 searching pdf documents indexed documents using bin/post method. i added custom field curl curl -x post -h 'content-type:application/json' --data-binary '{ "add-field":{ "name":"zoneid", "type":"strings", "indexed" : true, "docvalues":true, "stored":true } }' http://localhost:8983/solr/taxsutra/schema now when invoke search query , zoneid not displaying in json results. code update index: curl http://localhost:8983/solr/taxsutra/update/json -h 'content-type:application/json' -d ' [ {"id" : "home/niyuj/projects/php/solr-5.1.0/../itat_src/upload/kolkata/kolkata/24-11-2014/307176844630250930713$5^1refnoita_no._1873.2012.pdf", "zoneid" : "4"}, {"id" : "/home/niyuj/projects/php/solr-5.1.0/../itat_src/upload/kolkata/kolkata/24-11-2014/-421302573392022465313$5^1r...

oracle adf - How make form visible after clicking search button in adf Query? -

Image
hello developing web applicaiton using oracle adf , jdeveloper11.1.2.4. have page fllowing query , form. searching , fine when page loaded first time empty. not looking good. idea form should invisible , should visible after user hits search button in search from(af:query). please me. how can achieve this. thanks in advance. the following .jsf code <?xml version='1.0' encoding='utf-8'?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <af:document title="search/modfiy kpi" id="d1"> <af:messages id="m1"/> <af:form id="f1"> <af:pagetemplate viewid="/adminpagetemplate.jsf" id="pt1"> <f:facet name=...

Copy between variable length arrays c# -

so have string array called page , string array called notessplit created using notes.split(). notessplit have variable number of newlines never on 10 lines. i'd overwrite contents of "page" index 20 - 30 leaving blank lines if index not exist in notessplit. any ideas? var page = new string[44]; <-- text file string notes = "blah \n blah \n"; string[] notessplit = notes.split(new string[] { environment.newline }, stringsplitoptions.none); what have come is: for (var = 0; < 9; i++) { if (notessplit[i] != null) { page[i + 20] = notessplit[i]; } else { page[i + 20] = system.environment.newline; } } i'm pretty sure you're looking for. public string[] replace(string[] page, string[] notes, int start, int length) { for(var = 0; + start < page.length && < length; i++) { if(notes != null && notes.length > (i)) page[i+start] = notes[i]; else page[i+start]...

c++ - Deep Copy an XML via TinyXML -

i using tinyxml. how duplicate or create copy of existing xmldocument? http://www.grinninglizard.com/tinyxmldocs/classtixmldocument.html#a4e8c1498a76dcde7191c683e1220882 i went through link says using clone replicate node. protected , not want go deriving class out of , like. i not want save existing xmldocument file , making xmldocument object read file have copy of it. i not able perform deep copy using memcpy because unaware of size of entire xml. i not want having 2 objects being used 1 after other like: xmldocumentobj1 = add_some_data xmldocumentobj2 = add_the_same_data, , on the primary reason want second copy that, first might modified different sections of code, while same copy being 'read' @ multiple places. need ensure there occur no errors when xmldocument read, because there chances might have been modified in background running thread, , no program crashes. here wrote deep copy. takes source node , copies under destination node, chil...

javascript - Pass file across route in Meteor -

one 1 page, have file selector input. when user selects file, user directed separate route contains interactive image cropper used prepare image before upload server. since able use button escape cropper, makes sense in separate route. using iron-router this. template.mytemplate.events({ 'change input[type="file"]': function(e, t) { router.go('crop'); } }); this takes me crop page. @ point though not sure how file reference mytemplate crop. code below using draw uploaded image canvas when in same template. var reader = new filereader(); reader.onload = function(e) { img = new image(); img.onload = function() { //draw image canvas element }; img.src = e.target.result; }; reader.readasdataurl(e.target.files[0]); i need find way transfer file reference when change routes. you not gonna able file reference mytemplate crop template. call crop template, template unload , not available anymore. on change...

php - Why I'm the loop is breaking and getting error even after not satisfying the condition? -

i've following code snippet: $asupportedimages = array('jpg', 'gif', 'png'); foreach($vshare $file) { if(!in_array(pathinfo($file, pathinfo_extension), $asupportedimages)) $errarr = 'file extension of image wrong'; echo $errarr; break; } the array $vshare follows(output of print_r($vshare); ): array ( [img_0004.jpg] => array ( [0] => https://www.filepicker.io/api/file/uyukzvhergufb0enrbjo ) ) i'm not understanding why loop getting broken , getting error "file extension of image wrong" after file having extension present in array $asupportedimages ? please me. thanks. you should use below code, image name key of array, , using value in extension check edit : other users said, missing {} brackets in if condition note : when want execute 1 statemen...

python - How to print shapes made of * in horizontal? -

i've made function prints out shapes using *. my code def print_saw(tooth_size, number_of_teeth): """print saw drawing""" counter_2 = 0 while counter_2 != number_of_teeth: counter = 1 while counter != tooth_size+1: print("*" * counter) counter = counter + 1 counter_2 = counter_2 + 1 there more code that. that's function prints saw. printed in python so. >>> print_saw(4, 3) * ** *** **** * ** *** **** * ** *** **** but want print horizontal. so. >>> print_saw(4, 3) * * * ** ** ** *** *** *** ************ a simple way without using formatting: def print_saw(size, number): s in range(size): print(('*' * (s + 1) + ' ' * (size - s - 1)) * number) gives: print_saw(5, 3) * * * ** ** ** *** *** *** **** **** **** ***************

asp.net - Use mapped network drive with FileUpload control -

my asp.net 3.5 application installed on server 1. in server have mapped network drive q: when try use saveas of file upload control, hard coding path as: fileupload1.saveas("q:\myfiles\") & fileupload1.filename) it gives error: path not found. how put network drive path saveas? drive mappings per user, user site runs on has no idea of mappings. best way fix use unc paths instead, there no need drive mappings. so if map server x 's share share q, instead save \\x\share\ +whatever fileupload1.saveas("\\x\share\myfiles\") & fileupload1.filename)

Adding headers to columns of admin app page in Django -

Image
i'm customizing admin panel django app , saw pre-1.8 using list_display = ['join', 'email', 'timestamp', 'updated'] add header columns of django app page , separated sections based on model. i've tried list_display in django 1.8 , failing see header names being posted. there new command this? fixed: from django.contrib import admin .models import join class joinadmin(admin.modeladmin): list_display = ('emails', 'timestamp') class meta: model = join admin.site.register(join, joinadmin) issue needed throw in second parameter in admin.site.register of joinadmin

javascript - Is it possible to know the methodology of built in functions? -

i want understand logic behind parsefloat() in js. possible dissect library functions know how they've been written? each implementation can vary bit, can see source code of v8, open: https://github.com/v8/v8-git-mirror

process - Trouble Understanding Fork Logic -

can me understand happening in segment of code? having trouble understanding why output how is. output is: 0 1 2 3 4 3 2 1 0 int main() { int i; (i = 0; < 5 && !fork(); i++) { fflush(stdout); printf("%d ", i); } wait(null); printf("\n"); return 0; } two things here: first, fork() return 0 in child process while returns non 0 pid parent process. second, short circuit of && . so in beginning of first process (p0), runs i < 5 && !fork() . i = 0 , process created (p1). p0, test !fork() fails, ends loop , waiting child end. p1, test succeeds, , print out 0 , increment i 1, create process p2 , goes out loop p0 did. because of short circuiting, when i equals 5, no more fork called.

What is this extra tuple from Popen in python? -

i'm little confused on what's happening. want count how many lines returning see if process running or not. i'm using subprocess.popen run command can output. however, while testing script, i'm seeing additional output didn't count on , i'm curious why , how suppress it. here's snippet script. please excuse typos me sanitizing it. ssh = subprocess.popen("ssh " + host + " ps -ef | grep jetty | wc -l", stdin=subprocess.pipe, shell=true) output = ssh.communicate() print output the output of script is: 1 (none, none) the docs communicate returns tuple (stdoutdata, stderrdata). why returning 1 , (none, none)? how suppress (none, none) line/message? in order references command's standard output and/or standard error, have pass subprocess.pipe value of stdout , stderr (respectively) keyword arguments. otherwise, value of none returned in tuple. since didn't specify value stdout , output of command goes p...

html - How to set different widths for date-select? -

i have variations of line in different places: <%= f.date_select :deadline, :order => [:month, :day, :year], class: 'date-pick', id: 'goal' %> i tried change width making different id's select or date-select or date-pick no avail. here examples stylesheet: select.goal { width: 29.6%; color: green; } #goal.date-select { width: 29.6%; color: green; } .select { #goal { width: 29.6%; color: green; } } only setting width via .select { width: 29.6%; } works affects date-selects. doing wrong?! with line: <%= f.date_select :deadline, :order => [:month, :day, :year], class: 'date-pick', id: 'goal' %> yo can do: #goal { width: 29.6%; color: green; } you can use #gloa.date-pick or .date-pick#goal assuming ids unique it'll overdoing it. just remember order matter . if this: .class1.class2 { background-color: green; } .class1 { background-color: blue; } all .class1 el...

php - Laravel mail function - scope issue? -

i'm using laravel's mail function send user's confirmation email. problem is, i'm getting error "undefined variable: email" this code: $email="someemail@gmail.com"; $name="thename"; \mail::send('emails.verify', ['confirmation_code' => $user->confirmation_code], function($message) { $message->from('myemail@myserver.com', 'confirmation')->to($email, $name)->subject('please verify email address'); }); apparently declared variables $email , $name not on same scope $message->from.. being called.. any ideas on how solve this? you should use use statement in closure "include" $email , $name variable: \mail::send('emails.verify', ['confirmation_code' => $user->confirmation_code], function($message) use ($email, $name) { $message->from('myemail@myserver.com', 'confirmation')...

Google Spreadsheet comparison using TIME function for 10:40:00 fails -

Image
i'm having problem when comparing cells value 10:40:00 result of spreadsheet function time(10,40,0) a series of comparisons shows values 8:40 10:39:59 , 10:40:01 13:40:00 compare correctly 10:40:00 incorrectly returns false the comparison . am missing or bug? i've played around spreadsheet , think i've found reason. has got bug (or @ least inconsistency in reading time literals). take @ following chart, shows time entered literal, value parsed this, , value parsed =time() : value literal time(...) 08:40:00 0.3611111111111110000000 0.3611111111111110000000 09:40:00 0.4027777777777780000000 0.4027777777777780000000 10:30:00 0.4375000000000000000000 0.4375000000000000000000 10:39:00 0.4437500000000000000000 0.4437500000000000000000 10:39:59 0.4444328703703700000000 0.4444328703703700000000 10:40:00 0.4444444444444440000000 0.4444444444444450000000 10:40:01 0.4444560185185190000000 0.44445...

javascript - insert a row into table jquery -

Image
i have table row @ first , users can input info in row , after click add button, row has info store new row , show in table like: here code write: var insert_html='<tr><td>'+attr.title + '</td><td>' + attr.attribute + '</td><td>' + attr.value + '</td> <td>literal_eval</td> <td class="delete_button"> <button class="delete_attr">delete</button> </td></tr>'; $(insert_html).insertbefore($(this).closest('tr')); but if want add row continually, fail here detail: https://jsfiddle.net/m8a0v9y8/ it works @ jsfiddle, when use on big project, everytime click add, page refresh automatically. so go through step step in chrome developer tools, after first shows normal same in jsfiddle, can add new row insert before input row page refresh automatically it looks insert_html variable missing opening table row tag. should be: ...

How to assign object in factory - angularjs -

if assign object in factory this: $http.get('/api/whatever').success(function(data) { result = data.obj }); it gives result new address , therefore reference controller result broken. how assign then? value value works, seems not right way. how watch object properly? basically factory has , set methods getting , setting value in factory object. here example . time may have use events after updating factory object others instance have updated value

git branch - how to compile and run two git branches -

i have 2 separated branches in git, , 1 of them generating correct output, while other 1 way of doing same procedure not. keep jumping between branches, , modify , things on 1 branch , compare stuff on other branch. there way compile , run them in parallel without moving , forth between them (using git checkout, etc)? one way clone repository directory, , check out different branch in each directory.

c# - NHibernate 3.2 - Pre and Post Delete event listeners not invoked -

i working against implementation of nhibernate 3.2 several custom entity state change listeners: predelete, delete, , postdelete. deleteeventlistener defined inheriting custom type defaultdeleteeventlistener, others implementing ieventlistener interfaces. the body of customdeleteeventlistener follows: protected override void deleteentity(ieventsource session, object entity, entityentry entityentry, bool iscascadedeleteenabled, ientitypersister persister, iset transiententities) { if (entity baseentity) handleentityassociations(session, (baseentity)entity); if (entity isoftdeletable) { var e = (isoftdeletable)entity; utility.settrackinginfo(e basemodel); e.deleted = true; cascadebeforedelete(session, persister, entity, entityentry, transiententities); cascadeafterdelete(session, persister, entity, transiententities); } else { base.deleteentity(session, entity, entityentry, iscascadedelete...

javascript - Show result into input text -

i have code calculate results ( multipliers * 5 ) , shows me results <div id="total"></div> <script type="text/javascript"> function calculate(multiplier) { var product = multiplier*5; document.getelementbyid('total').innerhtml = product; } </script> <form> <select name="multipliers" onchange="calculate(this.value)"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> <div id="total"></div> <!-- result displayed here --> <input type="text" id="total" readonly="readonly"> </form> is possible show results input text not div ? <input type="text" id="total" rea...

apache spark - Why is my executor memory usage stuck at 0? -

Image
i have pretty simple spark job looks this: javapairrdd<key,value> rawdata = newaccumulordd(...); javapairrdd<key,value> indexsrc = rawdata.filter(new indexfilter()).cache(); javapairrdd<key,value> indexentries = indexsrc.mappartitionstopair(new indexbuilder(numpartitions)); javapairrdd<key,value> reverseindexentries = indexsrc.mappartitionstopair(new reverseindexbuilder(numpartitions)); javapairrdd<key,value> dataentries = rawdata.mappartitionstopair(new databuilder(numpartitions)).cache(); dataentries.union(indexentries) .union(reverseindexentries) .repartitionandsortwithinpartitions(new partitionedindexrddpartitioner(num_bins)) .saveasnewapihadoopfile(pidxbulk.tostring(), key.class, value.class, accumulofileoutputformat.class, conf); where key , value apache accumulo's key , value classes (using kryoserializer). i'm not sure put calls cache(), or if they're needed @ all. i'm concerned executors don...

javascript - How to not repeat folders with JStree? -

Image
i have json file data this: datatree.json = [ { "datap": "816816816816816818", "name": "image1.jpg", "url": "/files/folder1/test/d2e9c54ceedc9/image1.jpg", "path": "/files/folder1/test/image1.jpg", "size": 35969 }, { "datap": "857022de4fccdcb54623ff6185daae706a47140c", "name": "image2.jpg", "url": "/files/folder1/pruebas/85623ff6185d7140c/image2.jpg", "path": "/files/folder1/pruebas/image2.jpg", "size": 17689282 }, { "datap": "b260ec3250420c953a9db41897c34e3551620ec325035516256b2/image3.jpg", "path": "/files/folder1/test/image3.jpg", "size": 710632 } ] in part make operation , format jstree $.getjson('/datatree.json...

CRM 2015 Server Installation Error :- GrantAspNetServiceAccountAccessAction failed -

Image
has come across error before? microsoft.crm.setup.server.grantaspnetserviceaccountaccessaction failed "the parameter incorrect" i can't find information error. attempting clean installation of crm 2015 on new server. installer system administrator wouldn't think permission based. found answer on in microsoft server forums. unable install crm 2013 on server 2012 in active directory organization unit (ou) used microsoft dynamics crm install, had few "account unknown" entries. deleting these fixed our issue! note delete these, can run domain administrator (or user rights organizational unit) active directory users , computers program (dsa.msc) , navigate ou , select invalid entries listed "account unknown" delete them.

json - Javascript extract data from Wikipedia API -

Image
how extract title (list of metropolitan areas population) wikipedia api( http://en.wikipedia.org/w/api.php?format=json&action=query&titles=list_of_metropolitan_areas_by_population&prop=revisions&rvprop=content&callback= ?) i able data wikipedia having trouble extract data it. function getjsonp(url, success) { var ud = '_' + +new date, script = document.createelement('script'), head = document.getelementsbytagname('head')[0] || document.documentelement; window[ud] = function(data) { head.removechild(script); success && success(data); }; script.src = url.replace('callback=?', 'callback=' + ud); head.appendchild(script); } getjsonp('http://en.wikipedia.org/w/api.php?format=json&action=query&titles=list_of_metropolitan_areas_by_population&prop=revisions&rvprop=content&callback=?', function(data){ console.log(da...

db2 - Using @ on Variable Names -

googling i've found db2 function declaration: create function qgpl.split ( @data varchar(32000), @delimiter varchar(5) ) whats means @ symbol before variable name? regards, pedro the @ character first character of sql identifier [variable name] naming parameter defined arguments of user defined function (udf); reformatted [because @ first glance thought revision might make at-symbols appear more conspicuously part of name, though think not]: create function qgpl.split ( @data varchar(32000) , @delimiter varchar(5) ) returns ... put simply, use of @ character in identifier highly discouraged; use of such variant characters, although supported in standard object naming, can cause great pains , difficulties, including insurmountable: http://www.ibm.com/support/knowledgecenter/api/content/ssw_ibm_i_71/db2/rbafzch2iden.htm identifiers identifier token used form name. identifier in sql statement sql identifier, system identifier, or ...

r - Get maximum from xts object using merge function -

hi i'm using r quantmod library , find , return maximum of 2 values (volume today, vs volume yesterday). require(quantmod) getsymbols("hele") # ok when not return single column highest # volume head( merge( hele, max (hele$hele.volume,lag(hele$hele.volume, k=1 ) ) ) ) this works because example want subtract today's high yesterday close can this. head( merge(hele, abs(hele$hele.high - lag(hele$hele.close, k=1) ) ) ) i tried apply function did not work well, head( merge(hele, as.xts(apply( c(lag(hele$hele.volume, k=1 ), hele$hele.volume ), 1, max) ) ) ) thanks in advance. ahdee try this: head(merge(hele, pmax (hele$hele.volume,lag(hele$hele.volume, k=1), na.rm=true))) pmax vectorised version of max i.e. finds pairwise max between 2 vectors. need include na.rm=true otherwise end nas have missing values. using max find global max between 2 vectors , create column filled value only. output: > head(mer...

javascript - Extract "N" Values from an Array -

objective "chunky monkey" problem: create new, multi-dimensional array given array ('arr') , number ('size'). new, multi-dimensional array should create array lengths equal 'size' variable. example #1 chunk(['a', 'b', 'c', 'd'], 2); var answer = []; function chunk(arr,size){ //do }; return answer expected answer #1 answer = [['a','b'],['c','d']]; example #2 below example when there odd number of elements/sizes - in situation this, expected result have "remainder" group. chunk(['a', 'b', 'c', 'd'], 3); var answer = []; function chunk(arr,size){ //do }; return answer expected answer #2 answer = [['a','b','c'],['d']]; my pseudo-code / approach var final = []; function chunk(arr, size) { //extract number of elements 'arr' = 'size' var extract = ...

c# - In string.Format escape user entered characters such as {0), {1} -

while sending smtp email getting following error: index (zero based) must greater or equal 0 , less size of argument list. this error happening because entry.rundescription has following user entered text characters confusing string.format method in email body. pipettor ({0}) test ({1}) assay ({2}) pack ({3}) wedge ({4}) location ({5}) final position ({6}) maximum ({7}) since user entred text, there way make work besides adding logic user not enter these characters or how escape these characters , still retain text? message.body = string.format(string.format("<html><body>- service request<br/> new service request in queue <br/> please use following link access details of service request <a href=\"{0}{1}\">{0}{1}</a> <br/>" + entry.rundescription + "thank <br/> administrator <br/></body></html>", servicerequesturl, entry.serviceentryid)); don't "add...

json - Registration on django -

i writing api , have problem registration: valueerror : given username should set . here code: def create_account(request): if request.method == 'post': username = request.post.get('username', '') email = request.post.get('email', '') check_username = user.objects.filter(username__exact=username) check_email = user.objects.filter(email__exact=email) if check_email.count() != 0: if check_username.count() != 0: check = json.dumps('user such name or email registered. please, rewrite name or email.') return httpresponse(check, content_type='application/json') password = request.post.get('password', '') password2 = request.post.get('password2', '') if password != password2: wrong_password_message = json.dumps('the passwords not match. please, rewrite!') ret...

close javafx login window after successfull login -

i have create javafx login window after log in main window login window closed. i use platform.exit(); exit entire application instead of login window. i can't access stage controller class. using closelogin() method below doesn't work me. logincontroller class: public class logincontroller implements initializable { @fxml private textfield txt_username; @fxml private passwordfield txt_password; @fxml private button btn_login; @fxml private button btn_cancel; stage stage1 = null; /** * initializes controller class. */ @fxml private void btn_login(actionevent event) throws ioexception, exception { parent root = fxmlloader.load(getclass().getresource("library.fxml")); stage page1stage = new stage(); page1stage.setresizable(false); page1stage.settitle("main form "); scene scene = new scene(root); page1stage.setscene(scene); /* ...

python - How to rearrange sympy expressions containing a relational operator -

i have expressions containing relational operator, symbols, , constants. i'd rearrange expressions (to extent possible) constant terms on 1 side of relational operator, , remaining terms on other side. example, i'd rearrange: x - 5 > y - z to: x - y + z > 5 is there existing sympy method doing this? if not, should start in extending sympy? somewhat surprisingly, couldn't find way "out of box". can use method in this question make 1 variable sole subject of left hand side (lhs) of inequality can't seem make constant term subject. so, wrote own version , reproduce below. i've tested on example given , couple of other examples. tries make right hand side (rhs) consist of either 0 or constant terms based on optional parameter. there may corner cases fails - use / modify caution. code: import sympy sympy.core.relational import relational mult_by_minus_one_map = { none: '==', '==': '==', ...