Sunday 15 September 2013

apache - XAMPP not interpreting PHP code + Errors -



apache - XAMPP not interpreting PHP code + Errors -

first things first, when open , run xampp shows up

the issue is, when seek , open .php file doesn't work shows code within php file, php not work.

i have downloaded , uninstalled xampp 3 times today.

any ideas?

this rookie mistake, create sure url says localhost/index.php , not file:///c:/...

php apache xampp

android - How to implement time-weighting in SPL Meter? -



android - How to implement time-weighting in SPL Meter? -

i develop android app meassure sound pressure level level not sure how implement time weighting. moment algorithm works follows:

record 20ms of sound (160 samples @ 8000hz) compute rms calculate spl update displayed value , start again

here can see main part of algorithm:

// google asr input requirements state sound input sensitivity // should set such 90 db spl @ 1000 hz yields rms of 2500 // 16-bit samples, i.e. 20 * log_10(2500 / mgain) = 90. double gain = 2500.0 / math.pow(10.0, 90.0 / 20.0); // method called every 20ms: @override public void processaudioframe(short[] audioframe) { // compute rms value. double rms = 0; (int = 0; < audioframe.length; i++) { rms += audioframe[i]*audioframe[i]; } rms = math.sqrt(rms/audioframe.length); final double rmsdb = 20.0 * math.log10(rms / gain) + refspl; // refspl obtained calibration professional spl meter }

i know grade of sound level meter can fast, slow, or impulse time weighted. not sure how , implement time weighting in algorithm.

q: time weighting means after time update meassured db value?

q: should alter update interval 125ms fast weighted result or completly wrong?

thanks support

android decibel weighting

javascript - Angular orderBy not re-running after ng-click changes order string -



javascript - Angular orderBy not re-running after ng-click changes order string -

i have a collection of panels each simple list of items needs either sorted 'computedload' or 'name'. have next objects , methods accomplish generically on of panels (only showing 1 panel among many).

scope.orderby = { name: { displayname: "name", sort: "name", reverse: false }, load: { displayname: "load", sort: "-computedload", reverse:false } }; scope.selectorder = function (panel, order) { timeout(function () { panel.activeorder = order; }); }; scope.panels = { methods: { activeorder: scope.orderby.name } };

i have next html:

<div> <ul class="nav nav-pills"> <li class="list-label"><a>order by:</a></li> <li ng-repeat="order in orderby"><a href="#" ng-click="selectorder(panels.methods, order)">{{order.displayname}}</a></li> </ul> <ul class="nav nav-pills nav-stacked"> <li ng-repeat="item in suite.methods | orderby:panel.methods.activeorder.sort"><a href="#"><span class="text">{{item.name}}</span></a></li> </ul> </div>

the selectorder method doesn't seem work. ideas? missing something?

here example: http://jsbin.com/puxoxi/1/

setting panel.activeorder happens asynchronously, outside of angulars called "digest cycle". create angular re-evaluate scope, utilize $apply function:

it this:

scope.$apply(function() { panel.activeorder = order; });

javascript angularjs

Loading a html page inside a div with it's jQuery and CSS -



Loading a html page inside a div with it's jQuery and CSS -

i want load page image slider, within div using .load() method. it's working slider jquery script within html page doesn't work , it's css too.

how can prepare this?

without seeing code, hard tell going on or you're looking do. explanation, here jquery page i'm working on:

$('input[type="image"].thumbnail').click(function() { var pagename = this.id; $('#lookbookwindow').load(pagename + '.html', function() { $('#lookbookslider').cycle( { fx: 'scrollhorz', timeout: 0, pause: false, next: '#next', prev: '#prev', }); }); }).first().click();

".thumbnail", "#lookbookwindow" , "#lookbookslider" specific project. construction help figure out problem.

jquery html load

vbscript - I need to change the cell color in excel with a timer -



vbscript - I need to change the cell color in excel with a timer -

i have script monitors folders , putting results in excel file. there method when cell has been changed after 30 minuts gets greenish color gets? , if cell has not been changed after 30 minutes reddish color?

i forgot mention want check multiple cells.

here picture. under f

i hope clear since english language not good. laatste import(last import) needs checked

my code:

'===== const advarchar = 200 const addate = 7 const adbigint = 20 '============================================================================== 'set objecten set wshshell = wscript.createobject("wscript.shell") set fso = createobject("scripting.filesystemobject") set objpadimport = fso.getfolder("\\netko-sbs\data\imports\") set subfolderimport = objpadimport.subfolders excelbestand = "\\netko-sbs\data\imports\output.xlsx" set objfile = fso.opentextfile("c:\users\karim\desktop\vbscripttest\importv3\lokaties.txt", forreading) 'waarden const forreading = 1 dim arrfilelines() = 0 until objfile.atendofstream redim preserve arrfilelines(i) arrfilelines(i) = objfile.readline = + 1 loop objfile.close '============================================================================== 'wscript.sleep 10000 'sleeps 10 seconds '============================================================================== 'create custom disconnected recordset 'with fields filename , lastly modified date. '============================================================================== 'record set maken '============================================================================== set rs = createobject("ador.recordset") rs.fields.append "foldername",advarchar,255 rs.fields.append "moddate",addate rs.fields.append "naam",advarchar,255 rs.fields.append "tijd", advarchar,20 '============================================================================== 'excel set objexcel = createobject("excel.application") objexcel.displayalerts = false 'foutmeldingen uitschakelen set objworkbook = objexcel.workbooks.add() 'bestand openen.. 'objworkbook.saveas(excelbestand) objexcel.visible = true 'toon excel objexcel.cells(1, 1).value = "foldernaam" 'header instellen objexcel.cells(1, 2).value = "laatste import" 'header instellen objexcel.cells(1, 3).value = "controle tijd" 'header instellen x = 2 'set de juiste rij in excel. '============================================================================== rs.open '===== 'load file name, date, etc. (mapen controleren) '============================================================================== '============================================================================== each strline in arrfilelines s = split( strline, "," ) set folder = fso.getfolder( s(0) ) 'set test = (folder.datelastmodified - s(2)) rs.addnew array("foldername","moddate", "naam", "tijd"), _ array(folder.name,folder.datelastmodified, s(1), s(2)) ',test) rs.update next s = "sortering van oud naar nieuw:" & vbcrlf _ & "=============================" & vbcrlf if not (rs.bof , rs.eof) rs.sort = "moddate asc" rs.movefirst until rs.eof objexcel.cells(x, 1).value = _ rs.fields("naam").value objexcel.cells(x, 2).value = _ rs.fields("moddate").value objexcel.cells(x, 3).value = _ rs.fields("tijd").value x = x + 1 rs.movenext loop end if 'excel set objrange = objexcel.range("a1") 'selecteer actieve cell objrange.activate 'activeer cell set objrange = objexcel.activecell.entirecolumn objrange.autofit() 'set grootte van kolom set objrange = objexcel.range("b1") 'selecteer actieve cell objrange.activate 'activeer cell set objrange = objexcel.activecell.entirecolumn objrange.autofit() 'set grootte van kolom set objrange = objexcel.range("c1") 'selecteer actieve cell objrange.activate 'activeer cell set objrange = objexcel.activecell.entirecolumn objrange.autofit() 'set grootte van kolom '============================================================================== vartype moddate = objexcel.cells(1, 1).value = "laatste import" if datediff("n",moddate,date) < 30 objexcel.cells(y,y).interior.colorindex = 3 else objexcel.cells(1,1).interior.colorindex = 4 end if '============================================================================== objworkbook.saveas(excelbestand) 'excel bestand opslaan 'objexcel.quit 'excel afsluiten als nodig is. '============================================================================== '============================================================================== 'objfile.writeline s 'schrijf waarden naar excel set rs = nil 'gooi rs leeg set folder = nil 'object leegmaken set fso = nil 'object leegmaken set objpadimport = nil set objpadfrigo = nil set subfolderfrigo = nil set objexcel = nil '==============================================================================

getlastmodified time of cell store in 1 of cell or in variable.

for illustration : if store time in 1 of cell then,

var lastmodifitime = objexcel.cells(x,1).value

'if cell value modified in lastly 30 minutes set red, else if not modified in lastly 30 minutes or more set background color greenish

if datediff("n",lastmodifitime,date) < 30 objexcel.cells(y,y).interior.colorindex = 3 else objexcel.cells(z,z).interior.colorindex = 4 end if

' link help lastly modified time : http://www.online-tech-tips.com/ms-office-tips/track-changes-in-excel/

excel-vba vbscript

java - Getting NullPointerException while setting SharedPreferences -



java - Getting NullPointerException while setting SharedPreferences -

i'm trying set sharedprefencesin onpostexecute method nullpointerexception in error log. i've tried set doinbackground() blocks result returned. code

my task class

public class logintask extends asynctask<void, void, string> { private final string memail; private final string mpassword; private sharedpreferences sharedpreferences; private final string mypreferences = "session" ; string url = **** logintask(string email, string password) { memail = email; mpassword = password; } @targetapi(build.version_codes.honeycomb) @override public string doinbackground(void... params) { // todo: effort authentication against network service. seek { // simulate network access. thread.sleep(2000); } grab (interruptedexception e) { homecoming "false"; } arraylist<basicnamevaluepair> namevaluepairs = new arraylist<basicnamevaluepair>(); namevaluepairs.add(new basicnamevaluepair("email", memail)); namevaluepairs.add(new basicnamevaluepair("password", mpassword)); //prepare post query seek { httpclient clienthttp = new defaulthttpclient(); httppost httppost = new httppost(url); httppost.setentity(new urlencodedformentity(namevaluepairs)); httpresponse response = clienthttp.execute(httppost); httpentity entity = response.getentity(); inputstream = entity.getcontent(); bufferedreader reader = new bufferedreader(new inputstreamreader(is,"iso-8859-1"),8); stringbuilder sb = new stringbuilder(); string line = reader.readline(); sb.append(line + "\n"); is.close(); string result = sb.tostring(); system.out.println(result); homecoming result; }catch (exception e){ homecoming null; } } @override protected void onpostexecute(final string res) { seek { jobj = new jsonobject(res); } grab (jsonexception e) { e.printstacktrace(); } seek { if (jobj.getstring("code").equals("1")) { sharedpreferences.editor e = sharedpreferences.edit(); e.putstring(mypreferences,"active"); e.commit(); intent myintent = new intent(getactivity(), homesactivity.class); //lançer l'activité startactivityforresult(myintent, 0); } else { //password.seterror(getstring(r.string.error_incorrect_password)); //password.requestfocus(); alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.settitle("error !"); builder.setmessage("the info entered incorrect.\nplease seek again!") .setcancelable(false) .setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { dialog.cancel(); } }); alertdialog alert = builder.create(); alert.show(); } } grab (jsonexception e) { e.printstacktrace(); } } @override protected void oncancelled() { logintask = null; //showprogress(false); } }

my error log :

10-09 12:58:50.088 2878-2878/com.example.user.unchained e/androidruntime﹕ fatal exception: main process: com.example.user.unchained, pid: 2878 java.lang.nullpointerexception @ com.example.user.unchained.emailloginactivity$logintask.onpostexecute(emailloginactivity.java:328) @ com.example.user.unchained.emailloginactivity$logintask.onpostexecute(emailloginactivity.java:255) @ android.os.asynctask.finish(asynctask.java:632) @ android.os.asynctask.access$600(asynctask.java:177) @ android.os.asynctask$internalhandler.handlemessage(asynctask.java:645) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5017) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) @ dalvik.system.nativestart.main(native method)

sharedpreferences null. declare here

private sharedpreferences sharedpreferences;

but never initialize (give value) before trying utilize here

sharedpreferences.editor e = sharedpreferences.edit();

before line, need

sharedpreferences = getsharedpreferences("mypref", 0);

but need context. so, if separate class need pass context of activity asynctask constructor.

so, need create class variable context mcontext; alter constructor to

logintask(string email, string password, context c) { memail = email; mpassword = password; mcontext = c; }

then when calling task, pass activity context along email , password this or activityname.this, or else depending on how/where called.

now, when initialize sharedpreference object be

sharedpreferences = mcontext.getsharedpreferences("mypref", 0);

java android sharedpreferences

assembly - Is x87 FP stack still relevant? -



assembly - Is x87 FP stack still relevant? -

i notice compilers generate code targets simd registers every time double arithmetic used. applies non-optimized optimized code. mean x87 fp unit can considered obsolete , nowadays backward compatibility?

i notice other "popular" platforms rely on respective simd implementations rather fp designed stack.

also simd implementations tend @ to the lowest degree 128bit wide, wonder mean (internal) precision of operations higher x87 fp unit?

i wonder performance, throughput , latency, considering simd has been conceived vector execution in mind, wonder how scalars.

also simd implementations tend @ to the lowest degree 128bit wide, wonder mean (internal) precision of operations higher x87 fp unit?

the width of simd register not width of 1 individual component of vector represents. available simd instruction sets offer @ ieee 754 binary64 format (64-bit wide). not historical 80-bit extended format precision or range.

many c compilers create 80-bit format available long double type. utilize often. utilize intermediate computations: using contributes create end result more accurate if end result destined returned binary64 double. 1 illustration function in this question, mathematically intuitive property holds of final result if intermediate computations done long double, not if intermediate computations done same double type inputs , output.

similarly, among many constraints had balanced in selection of parameters extended 80-bit format, 1 consideration is perfect compute binary64 function pow() composing 80-bit expl() , logl(). precision necessary in order obtain accuracy end-result.

i should note, however, when “intermediate” computations single basic operation, improve not go through extended precision. in other words, when x , y of type double, accuracy of (double)(x * (long double)y) worse accuracy of x * y. 2 expressions produce same results, , in rare cases differ, x * y more accurate. phenomenon called double-rounding.

assembly floating-point stack obsolete x87

css - Font family and font weight - very thick bold -



css - Font family and font weight - very thick bold -

i have collection of fonts. let's font-a-normal, font-a-italic, font-a-bold , on b, c...

if in css file have:

font-family: 'font-a-bold';

in file, have

font-weight: bold;

the result double bold font, 2 times thicker need on html pages. because project specifications changed lot on time , because have big number of static pages have alter manually if want remove font-weight i'm searching solution.

is there rule or way specify 'font-a-bold' shouldn't become thicker. , if have

font-family: 'font-a-normal'; font-weight: bold

it should become:

font-family:'font-a-bold'

is there pure css solution?

update

or fast , perchance clean way of removing double bold.

if pulling in fonts @font-face declarations, this:

@font-face { font-family: 'myfont-bold'; font-weight: normal; font-style: normal; src: ... } @font-face { font-family: 'myfont-bold'; font-weight: bold; font-style: normal; src: ... // same above: same bold } @font-face { font-family: 'myfont'; font-weight: normal; font-style: normal; src: ... // regular weight new style } @font-face { font-family: 'myfont'; font-weight: normal; font-style: normal; src: ... // boldweight new style }

i think browser doesn't care if tell bold weight not bolder regular.

fiddle

css fonts typography

MySQL, Avoid DOUBLE value is out of range in POW(2, 1024) -



MySQL, Avoid DOUBLE value is out of range in POW(2, 1024) -

i've noted mysql returns error pow(2, 1024), error 1690 (22003): double value out of range in pow(2, 1024). how avoid error?

i thinking in ugly solution:

if (@expoent > 1023) @expoent = 1023; pow(2, @expoent);

this relates mysql convert hex double.

you can simplify using least() function:

pow(2, least(@expoent, 1023))

mysql

java - Polymorphism and Inheritance in C++ -



java - Polymorphism and Inheritance in C++ -

so in java had next implementation:

public abstract class pfigure implements comparable

and java implementation inheritance , polymorphism:

public class pfigurelist { private final int max_vehicles = 9; private pfigure list[] = new pfigure[max_vehicles]; private int count = 0; /** adds pfigure list if list not total , increments count. @param myfig "vehicle" pfigure going added list */ public void add(pfigure myfig) { if(count <= 9) list[count++] = myfig; } /** every figure in list, calls hide() function, polymorphic move() function, , draw() function show now. */ public void move() { for(int = 1; < count; i++) { list[i].hide(); list[i].move(); list[i].draw(); } }

now want accomplish except similar in c++. here code:

void vbotlist::add(vbot * add) { vbot[count++] = add; } void vbotlist::move() { /*for(int = 0; < list.getcount(); i++) list.getvalue(i)->move();*/ for(int = 0; < count; i++) vbot[i]->move(); } class vbotlist { private: int count; vbot * vbot[50]; public: vbotlist() : count(0){ } void add(vbot * vbot); void move(); void show(); }; public ref class myform : public system::windows::forms::form { public: myform(void) { initializecomponent(); // //todo: add together constructor code here // } static vbotlist * list = new vbotlist();

and effort implement it:

private: system::void speedtimer_tick(system::object^ sender, system::eventargs^ e) { list->move(); invalidate(); speedtimer->interval = speedtrackbar->value; } private: system::void vbotaddbutton_click(system::object^ sender, system::eventargs^ e) { if(combobox1->selectedindex == 1) { vbot * x = new billybot(system::convert::toint32(textbox1->text), system::convert::toint32(textbox2->text), panel1); list->add(x); } } private: system::void panel1_paint(system::object^ sender, system::windows::forms::painteventargs^ e) { list->show(); }

my goal here take vbot object stored in vbotlist, pfigurelist of pfigure objects in java. have no clue why, cannot display object on panel. had create initialization of vbotlist static in order not give me error messages. missing obvious or doing wrong displaying object? hints, advice, or slap on hand code great.

show() displays image. i'll post code if needed.

you work in c++/cli, you're class must managed too, illustration :

ref class bot { public: bot() { } }; ref class vbotlist { private: int m_count; array<bot ^> ^vbot; public: vbotlist() : m_count(0), vbot(gcnew array<bot ^>(50)) { } void add(bot ^newbot) { vbot[m_count++] = newbot; } int getcount() { homecoming m_count; } };

and next :

private: vbotlist ^list; public: form1(void) { initializecomponent(); list = gcnew vbotlist(); label1->text = system::convert::tostring(list->getcount()); } // ... private: system::void button1_click(system::object^ sender, system::eventargs^ e) { bot ^bot = gcnew bot(); list->add(bot); label1->text = system::convert::tostring(list->getcount()); }

^ declare handle managed pointer.

java object c++-cli

ios - Multiple swift animations in parallel not working -



ios - Multiple swift animations in parallel not working -

i have code animating elements (total of 3) in view.

element in elements{ if element.value != radians { uiview.animatewithduration(0.99, animations: { element.transform = cgaffinetransformmakerotation(cgfloat(radians)) }, completion: { finished in element.value = radians }) } }

when 2 or more elements should animated (uiview.animatewithduration called 2 or more times 1 after another), 1 animating , animation quite choppy. know should write in animation block, can't figure out how it. please help me.

just set loop within animation block.

uiview.animatewithduration(0.99, animations: { element in elements { if element.value != radians { element.transform = cgaffinetransformmakerotation(cgfloat(radians)) } } }, completion: { _ in element.value = radians })

ios animation swift

ruby on rails - Heroku add-ons 'Logentries' & 'FlyData' query -



ruby on rails - Heroku add-ons 'Logentries' & 'FlyData' query -

i have ruby on rails web app hosted on heroku , i've setup logentries add-on sets alarms 'high response time'.

lately, have started getting emails 'alert high response time', mention high response time triggered

heroku router - - at=info method=get path="/robots.txt"

now, know search engines google, microsoft utilize robots.txt ignore pages should not indexed. there other reason, why file accessed?

please right me if missing here.

oh, , using free version of heroku i.e. 1 worker website-content , have 1 worker runs periodic jobs using scheduler.

query #2-

what's wrong application, when next email logentries, subject - 'alert exit timeout'

exit timeout: heroku/my-app 2014-10-13 18:53:56.351 188 <45>1 2014-10-13t18:53:56.053533+00:00 heroku web.1 - - error r12 (exit timeout) -> @ to the lowest degree 1 process failed exit within 10 seconds of sigterm

query #3-

i installed flydata add-on trial see how works. emails subject - '[flydata-alert] (myapp) application error notification'. email says- we noticed next error logs on application (myapp) : 2014-10-08t23:59:53.042662+00:00 app[scheduler.3266]: ** [newrelic][10/08/14 23:59:53 +0000 21fd815f-5e08-42ab-80d8-4771ea1593c7 (2)] info : installing rails3 error instrumentation

i think email triggered because of info message new relic, says - installing rails3 error instrumentation. flydata add-on looks @ keyword 'error' , triggers email alert.

for query #2: heroku - exit timeout: heroku/my-app

according heroku's documentation, "a process failed exit within 10 seconds of beingness sent sigterm indicating should stop. process sent sigkill forcefulness exit."

there finish list of heroku errors codes, including one, can found here: https://devcenter.heroku.com/articles/error-codes#r12-exit-timeout

if you're using webrick run application on heroku, should seek switch using 'thin' see if helps: see https://devcenter.heroku.com/articles/rails3#webserver. or see previous reply on stackoverflow here: rails app hosted on heroku: error r12 (exit timeout)

hope helps.

michael

ruby-on-rails heroku robots.txt logentries

ruby on rails - can't create my @current_user -



ruby on rails - can't create my @current_user -

i'm new in ruby on rails, help me? i can't see @current_user.username

*this session_controller

class sessioncontroller < applicationcontroller def new end def create user = user.find_by_username(params[:session][:username]) if user login user redirect_to user else render 'new' end end def sucess end def error end end

*sessionhelper

module sessionhelper def login(user) session[:user_id] = user.id end def current_user @current_user ||= user.find(session[:user_id]) end end

*controller

class applicationcontroller < actioncontroller::base protect_from_forgery with: :exception include sessionhelper end

*my model user

class user < activerecord::base attr_accessible :pass, :username validates :username, :pass, :presence => true validates :username, :pass, :length => { :minimum => 4 } validates :username, :uniqueness => true

*application layout

<title>sessions</title> <%= stylesheet_link_tag "application", :media => "all" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> </head> <body> <% if @current_user %> hello <%= @current_user.username %> <% end %> <%= yield %> </body>

*and login view

<%= form_for(:session, url: login_path) |f| %> <%= f.label :username %> <%= f.text_field :username %> <%= f.label :pass %> <%= f.password_field :pass %> <%= f.submit "log in" %> <% end %>

please help me :)

you have method in helper:

def current_user @current_user ||= user.find(session[:user_id]) end

so in templates should utilize current_user rather @current_user

so, should be:

<body> <% if current_user %> hello <%= current_user.username %> <% end %> <%= yield %> </body>

update:

but it's improve create method in applicationcontroller:

def current_user @current_user ||= user.find(session[:user_id]) if session[:user_id] end helper_method :current_user

because in case current_user can called controllers , templates well.

ruby-on-rails ruby

C++ armadillo sparse matrix batch insertion -



C++ armadillo sparse matrix batch insertion -

i looking @ batch insertion sparse matrices in armadillo in docs "http://arma.sourceforge.net/docs.html#batch_constructors_sp_mat".

it defines form1 as:

form 1: sp_mat(rowind, colptr, values, n_rows, n_cols)

what colptr hold? if understand correctly, should have actual address whatever columns want insert @ ?

seems unusual me rowind not pointers colptr pointers. reason this?

armadillo uses standard compressed sparse column (csc) format storing sparse matrix data. format known compressed column storage (ccs) , harwell-boeing. row indices , column pointers explained on several sites:

wikipedia: http://en.wikipedia.org/wiki/sparse_matrix#compressed_sparse_column_.28csc_or_ccs.29 netlib: http://netlib.org/linalg/html_templates/node92.html http://www.cs.colostate.edu/~mroberts/toolbox/c++/sparsematrix/sparse_matrix_compression.html

the csc format used compatibility existing sparse solvers, etc.

c++ matrix sparse-matrix armadillo

Backbone.js view uses instance of self to render children. Is that okay? -



Backbone.js view uses instance of self to render children. Is that okay? -

i'm building node tree of nodes can have kid nodes , kid nodes can have grandchildren , on , forth ...

i can away using single view in turn render children listed in it's model. have looks this:

define(["backbone", "text!templates/node-tree/node.html"], function(backbone, nodetmpl) { var nodeview; homecoming nodeview = backbone.view.extend({ classname: "node", template: _.template(nodetmpl), initialize: function() { this.render(); }, render: function() { this.$el.html(this.template(this.model.tojson())); if (this.model.get("children")) { this.renderchildren(); } }, renderchildren: function() { var container = this.el.queryselector(".child-nodes"); (var = 0; < this.model.get("children").length; i++) { var kid = this.model.get("children")[i]; var view = new nodeview({model: child}); container.appendchild(view.el); } homecoming this; } }); });

now, ok? mean see working, setting self nasty surprises downwards road? other alternative have 2 identical view classes (nodea, nodeb) , have them utilize each other rendering children respectively. however, not dry , if don't need go route rather not.

it's fine that. similar marionette's compositeview. marionette's composite's default behavior (if itemview/childview property isn't defined) utilize composite view children view.

https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.compositeview.md

i have used construction myself. had hierarchical info object , needed rendered children view same container view (with css tweaks).

backbone.js view architecture

file upload - utf-8 filename are ruined when uploading through IIS -



file upload - utf-8 filename are ruined when uploading through IIS -

when upload files uft-8 file name through iis on windows server file names ruined. (they changed if encoded in ascii , hence no more accessible). wonder if there work around problem. should mention windows server doesn't have issue utf-8 file names , can create them through rdp or ftp. problem occurs when uploading through iis.

configuration: os: windows server 2008 sp1 web server: iis 7.5 uploading php script executed through fastcgi

file-upload utf-8 character-encoding iis-7.5 windows-server-2008

I'm looking for the logic behind combining multiple join operations in MySQL to select data from more than 2 tables -



I'm looking for the logic behind combining multiple join operations in MySQL to select data from more than 2 tables -

i'm trying wrap head around different bring together operations in mysql , found useful info on website when explained venn diagrams. i'm confused, however, on how combine select join statements when want select info 3 or more tables.

does have beginners reference logic behind this? or giving me crash course?

thank you

in way, joining 3 tables no more hard grasp joining 2 tables.

the bring together operator binary operator in same way add-on or multiplication binary operators. can "chain" them.

so can utilize add-on sum 3 or more terms:

2 + 4 + 3

you can utilize bring together join 3 or more tables:

select ... books bring together authors on books.author_id = authors.author_id bring together publishers on books.publisher_id = publishers.publisher_id

you can visualize means:

+---------+ +-------+ +------------+ | authors | | books | | publishers | +---------+ +-------+ +------------+ | |<-------| b |--- | | | | | | | | | | | | | --->| p | +---------+ +-------+ +------------+

the purpose match row books related rows in authors , publishers, respectively.

re questions:

it seems weird me statement occurs once

does seem weird when see arithmetic look following:

sqrt( 2 + 4 + 1 )

why sqrt appear once? because it's function beingness applied result of internal expression.

think of from clause way:

"i selecting columns from next set of joined tables. first bring together them, i'll select columns want."

does order of bring together statements impact outcome?

no, bring together operation commutative. is, 2+4 = 4+2 in addition, joins give same result in either direction. in fact, internally sql databases may take access table in either order according makes more efficient.

the exception left outer join or right outer join, not commutative. order matters.

mysql join

cordova - Improving phonegap app performance by defining my own WebView -



cordova - Improving phonegap app performance by defining my own WebView -

i developing app in phonegap. have performance issues want create own webview class , utilize instead of default one.

i found can improve performance doing that, doing way:

https://github.com/ajoslin/angular-mobile-nav/wiki/phonegap,-improving-performance

the problem don't know in class have override init method of "activity" have tried doing in cordovaactivity class method init method different link says. way:

public void init() { this.init(appview, null, null); }

can help me should set thie code utilize mywebview class:

cordovawebview webview = new mywebview(myactivity.this); super.init(webview, new cordovawebviewclient(this, webview), new cordovachromeclient(this,webview));

thank you

yes - seek cordovaactivity. if not - check manifest file - main activity class name. need import mywebview class main activity.

public void init() { cordovawebview webview = new mywebview(myactivity.this); super.init(webview, new cordovawebviewclient(this, webview), new cordovachromeclient(this,webview)); }

performance cordova webview

python - Attempting to assign a variable to an value causes "Cannot assign to operator" error -



python - Attempting to assign a variable to an value causes "Cannot assign to operator" error -

def main(): bonus() def bonus(): #dollars sales input, time worked, #then salary , possible bonus added #to calculated commission based on earned commission rate monthlysales=int(input('how much money did employee create in sales?',)) if monthlysales<10000: commrate=0 elif monthlysales>=10000 , monthlysales<100000: commrate=0.02 elif monthlysales>=100001 , monthlysales<500000: commrate=0.15 , monthlybonus=1000 elif monthlysales>=500001 , monthlysales<1000000: commrate=0.28 , monthlybonus=5000 elif monthlysales>1000000: commrate=0.35 , monthlybonus=100000 yearsworked=int(input('how many years has employee worked here? round downwards nearest year.',)) if yearsworked>=5 , monthlysales>=100000: extrabonus+1000 elif yearsworked<1: monthsworked=int(input('how many total months has employee worked here?',)) if monthsworked<3: print('your employee has not worked here long plenty qualify bonus.') main()

what i'm trying create programme on predetermined commission rates based on how much in sales employee made input program.

i'm getting "cannot assign operator" error on

commrate=0.35 , monthlybonus=100000

, tells me i'll same error on rest of variables have been straight assigned numerical values amongst if nesting.

what doing wrong, here?

elif monthlysales>=100001 , monthlysales<500000: commrate=0.35 ; monthlybonus=100000

or

elif monthlysales>=100001 , monthlysales<500000: commrate=0.35 monthlybonus=100000

python operator-keyword

javascript - pushing to array element appended with single quote -



javascript - pushing to array element appended with single quote -

the next varibale evaluated , adding array element, getting single quote when array printed, how avoid this,here code

var t1 = "date.utc("+vardate[0]+','+vardate[1]+','+vardate[2]+")" console.log(t1)

the output

date.utc(2001,1,23)

then added t1 array

diffarray.push(t1) console.log(t1)

it appended single quote why ? how avoid ?

[ 'date.utc(2001,1,23)']

this console.log() showing item in array string. t1 variable has been string there no difference in internal representation, how console.log() chooses display it.

if console.log(diffarray[0]), see original representation without quotes because that's console.log() when give plain string. when give console.log() array, puts quotes around elements strings indicate difference between string , other type array might hold.

look in console jsfiddle: http://jsfiddle.net/jfriend00/yrannpm2/

console.log(t1); // date.utc(2001,1,23) console.log(diffarray[0]); // date.utc(2001,1,23) console.log(diffarray); // ["date.utc(2001,1,23)"]

javascript arrays node.js

ios - Post multiple images using SLComposeViewController on Facebook/ Twitter? -



ios - Post multiple images using SLComposeViewController on Facebook/ Twitter? -

i ios developer , using slcomposeviewcontroller share post on facebook/twitter. issue have post multiple images in single post.

i have done follows:

slcomposeviewcontroller* myslcomposersheet = [slcomposeviewcontroller composeviewcontrollerforservicetype:slservicetypetwitter]; [myslcomposersheet setinitialtext:texttobeshared]; myslcomposersheet addurl:[nsurl urlwithstring:@"http://click-labs.com/"]]; for(int count=0;count<imagearray.count;count++) if([myslcomposersheet addimage:[uiimage imagewithdata:[imagearray objectatindex:count]]])

in above code, imagearray array of images want post.

when doing on facebook, images posted separate post.

while in case of twitter, addimage method returns true first images while in case of other images returns false. 1 image posted.

so want know how accomplish goal , possible post multiple images in single tweet.

i think need create album first.

here's link facebook album api documentation.

- (void)sharetofacebook { if (fbsession.activesession.isopen) { nslog(@"session open"); [self createfacebookalbum]; } else { nslog(@"session not open"); nsarray* permissions = [nsarray arraywithobject:@"email"]; [fbsession openactivesessionwithreadpermissions:permissions allowloginui:yes completionhandler:^(fbsession *session, fbsessionstate state, nserror *error) { [self sessionstatechanged:session state:state error:error]; if (error) { /* handle failure */ nslog(@"error:%@, %@", error, [error localizeddescription]); uialertview* alert = [[uialertview alloc] initwithtitle:@"error" message:@"there problem facebook permissions." delegate:nil cancelbuttontitle:@"ok" otherbuttontitles: nil]; [alert show]; } else if (state == fbsessionstateclosed || state == fbsessionstateclosedloginfailed ) { [fbsession.activesession closeandcleartokeninformation]; } else if (state == fbsessionstateopentokenextended || state == fbsessionstateopen) { if(!self.presentedfacebooksheet) { [self performselector:@selector(reauthorizeandcontinueposttofacebook) withobject:nil afterdelay:0.5]; self.presentedfacebooksheet = yes; } } }]; } } - (void)reauthorizeandcontinueposttofacebook { nsarray *permissions = [nsarray arraywithobjects:@"publish_actions", nil]; [[fbsession activesession] requestnewpublishpermissions:permissions defaultaudience:fbsessiondefaultaudiencefriends completionhandler:^(fbsession *session, nserror *error) { [self sharetofacebook]; }]; } - (void)createfacebookalbum { nsmutabledictionary* parameters = [nsmutabledictionary dictionary]; [parameters setobject:@"test name" forkey:@"name"]; [parameters setobject:@"test message" forkey:@"message"]; fbrequest* request = [fbrequest requestwithgraphpath:@"me/albums" parameters:parameters httpmethod:@"post"]; nslog(@"creating facebook album"); fbrequestconnection *connection = [[fbrequestconnection alloc] init]; [connection addrequest:request completionhandler:^(fbrequestconnection *connection, id result, nserror *error) { if (!error) { nsstring* albumid = [result objectforkey:@"id"]; nslog(@"ok %@", albumid); } else { nslog(@"error: %@",error.userinfo); } }]; [connection start]; } - (void)sessionstatechanged:(fbsession *)session state:(fbsessionstate) state error:(nserror *)error { switch (state) { case fbsessionstateopen: { [[fbrequest requestforme] startwithcompletionhandler: ^(fbrequestconnection *connection, nsdictionary<fbgraphuser> *user, nserror *error) { if (error) { //error } else { nslog(@"user session found"); } }]; } break; case fbsessionstateclosed: case fbsessionstateclosedloginfailed: [fbsession.activesession closeandcleartokeninformation]; break; default: break; } }

ios objective-c iphone ios7 ios5

javascript - How to detect (programmatic) changes to textarea? -



javascript - How to detect (programmatic) changes to textarea? -

i have read how observe alter textarea? , textarea onchange detection, these not reply question. utilize function load contents of few input fields, , textarea via ajax call. know can attach function phone call end of func phone call , modifies contents, still doesn't solve problem, because clicking on "reset" form button not trigger "oninput", or "oncut", or "onpaste", or "oncopy". there event triggered when programmatic changes textarea or input occur? or have manually hack in?

the thing can suggest add together info attribute textarea. in programmatic updates maintain both in sync. then, can check input updates.

<textarea data-p-value="" value=""></textarea>

javascript html

printing - Can't print text file using Java 8 in Windows 7 -



printing - Can't print text file using Java 8 in Windows 7 -

i've created study , exported text file, print in matrix printer, however, result of job blank page. did same in ubuntu , printing correctly. java bug?

this illustration code did show problem:

public class printerror extends application { public static void main(string args[]) { launch(args); } public void start(stage stage) throws printexception { printerjob printerjob = printerjob.createprinterjob(); printerjob.showprintdialog(stage); printrequestattributeset printrequestattributeset = new hashprintrequestattributeset(); printrequestattributeset.add(new copies(printerjob.getjobsettings().getcopies())); printrequestattributeset.add(new jobname("test", locale.getdefault())); docflavor flavor = docflavor.input_stream.autosense; doc mydoc = new simpledoc(classloader.class.getresourceasstream("/should-be-printed.txt"), flavor, null); docprintjob job = getprintservice(printerjob.getprinter().getname()).createprintjob(); job.print(mydoc, printrequestattributeset); } private printservice getprintservice(string name) { (printservice printservice : java.awt.print.printerjob.lookupprintservices()) { if (name.equalsignorecase(printservice.getname())) { homecoming printservice; } } homecoming null; } }

this illustration created in javafx 8 , running in java build 1.8.0-b132 in windows 7. i've created simple project @ github

from documentation:

recommended docflavors

the java print service api not define mandatorily supported docflavors. …

when have printservice instance, can utilize method getsupporteddocflavors() find out flavors supports.

when find out none of docflavor. input_stream. text_plain_… flavors in list, doesn’t help utilize autosense means “best guess” , it’s unlikely printservice guess type doesn’t support, instead, it’s more info misinterpreted 1 of formats supports.

on windows machine, none of provided printservices supports printing plaintext…

java printing javafx java-8

c++ - Class unable to make friends with a function that's not in its namespace -



c++ - Class unable to make friends with a function that's not in its namespace -

i'm having difficulty understanding why next mwe not compile:

#include <iostream> namespace n { class foo { friend void bar( foo& f ); void print(){ std::cout << "..." << std::endl; } // private default }; } void bar( n::foo& f ) { f.print(); } int main() { }

g++ 4.8.2 error

test.cpp: in function ‘void bar(n::foo&)’: test.cpp:8:8: error: ‘void n::foo::print()’ private void print(){ std::cout << "..." << std::endl; } // private default ^ test.cpp:14:10: error: within context

i'm missing here certainly friend function bar() can access private fellow member of class n::foo.

note that:

moving bar() namespace n resolves error. the code compiles if ::bar() not phone call n::foo::print()

why doesn't code compile is?

edit

on sec thoughts title of question not exactly describe problem. i'll edit in due course.

an unqualified friend declaration refers function in namespace containing class, introducing function namespace if hasn't been declared.

i'd move function namespace. can found argument-dependent lookup, can phone call unqualified bar(foo) without need n::.

if want in global namespace reason, you'll need declare in global namespace before can declare friend. bit messy:

// need class definition declare function namespace n {class foo;} // need function definition declare friend void bar( n::foo& ); // need class definition define function namespace n { class foo { friend void ::bar( foo& f ); void print(){ std::cout << "..." << std::endl; } // private default }; } // , function void bar( n::foo& f ) { f.print(); }

c++ namespaces argument-dependent-lookup

operating system - What is the relative and absolute deadline? -



operating system - What is the relative and absolute deadline? -

i'm reading paper edf scheduling algorithm , i'm going implement after it. couldn't find acceptable reply asked question. know question's answer?

there no mystery in these terms

relative deadline deadline relative start of job (start of thread, ...), absolute deadline specific point in time.

so periodic job - illustration task executed every sec - can have constant relative deadline - illustration 100ms - on each run absolute deadline different (11:10:00.100, 11:10:01.100, 11:10:02.100, ...).

see page 335 - http://books.google.pl/books?id=iilij3jxnrac&printsec=frontcover&hl=pl&source=gbs_ge_summary_r&cad=0#v=onepage&q&f=false (really source of info operating systems)

operating-system

mysql - How to get form input array into PHP array but not empty field -



mysql - How to get form input array into PHP array but not empty field -

i have form 1 below posted same page, , user can dynamically add together more textbox jquery.

<h1> add together order </h1> <form method="post" action=""> <p id="add_field"><a href="#"><span> click add together </span></a></p> <div id="container"> <input type="text" class="pid" id="' + counter + '" name="product[]" /> <input type="text" class="qid" id="' + counter + '" name="quantity[]" /><br /> </div><br /> <input type= "submit" name="submit_order" value="submit"> </form>

everything work fine if add together more textbox , leave textbox empty going submit. problem don't want submit empty textboxes in table , want server side solution this.

here total code php

<body> <?php if ( isset($_post['submit_order']) ) { if ( !empty($_post['product']) && !empty($_post['quantity']) ) { $product = ($_post['product']); $quantity = ($_post['quantity']); foreach ($product $id => $value) { $products = ($product[$id]); $quantitys = ($quantity[$id]); $query = mysql_query("insert myorders (product,quantity) values ('$products','$quantitys')", $connection); } } echo "<i><h2><stront>" . count($_post['product']) . "</strong> entry added </h2></i>"; mysql_close(); } ?> <?php if (!isset($_post['submit_order'])) { ?> <h1> add together order </h1> <form method="post" action=""> <p id="add_field"><a href="#"><span> click add together </span></a></p> <div id="container"> <input type="text" class="pid" id="' + counter + '" name="product[]" /> <input type="text" class="qid" id="' + counter + '" name="quantity[]" /><br /> </div><br /> <input type= "submit" name="submit_order" value="submit"> </form> <?php } ?> </body>

something should work:

foreach ($_post[product] $key => $value): if (empty($value)): unset($_post[product][$key]); endif; endforeach; foreach ($_post[quantity] $key => $value): if (empty($value)): unset($_post[quantity][$key]); endif; endforeach;

php mysql

android - Using a button to link a website -



android - Using a button to link a website -

i want users click on button, displays website on app, not on browser, on new xml. also, website have files, want them able view on app , don't have download them? how can this, please help!

if have activity webview, can start calling startactivity:

intent activitywithwebview = new intent(this, webviewactivity.class); bundle b = new bundle(); b.putstring("url", "http://www.stackoverflow.com"); intent.putextras(b); startactivity(intent); finish();

then, in next activity, can url , feed webview:

bundle b = getintent().getextras(); string url = b.getstring("url");

android file button hyperlink download

ios - CSS output on iphone different from PC -



ios - CSS output on iphone different from PC -

so, allow me tell problem straight point. i'm developing website right now. , seek visit website i'm developing on iphone. problem is, got different output when visit site pc , when visit iphone. this image when visit pc's chrome , output same other browser in pc while this when visit iphone's safari , output same when visit iphone's chrome . see difference betwwem visit iphone , pc? yep. got "space" above navigation bar while visiting iphone. can help me solve problem? lot in advance.

btw css

class="snippet-code-css lang-css prettyprint-override">body { background: rgb(25, 181, 254); margin: 0px; font-family: "trebuchet ms", helvetica, sans-serif; } #header { width: 100%; min-width: 1050px; height: 150px; margin-bottom: 20px; text-align: center; } #logobox { display: inline-block; width: 300px; height: 150px; overflow: hidden; } #logobox:active { height: 140px; margin: 5px auto; } .logo { background: url('img/icon/logo.png') no-repeat; width: 300px; height: 100%; } #navbox { width: 150px; height: 150px; overflow: hidden; display: inline-block; } .transition { transition: height 0.15s, margin 0.15s, background 0.7s; -webkit-transition: height 0.15s, margin 0.15s, background 0.7s; -o-transition: height 0.15s, margin 0.15s, background 0.7s; -ms-transition: height 0.15s, margin 0.15s, background 0.7s; -moz-transition: height 0.15s, margin 0.15s, background 0.7s; } #navbox:active { height: 140px; margin-bottom: 5px; } #navbox.green { background: rgb(80, 190, 106); } #navbox.orange { background: rgb(250, 170, 30); } #navbox.green:hover { background: rgb(4, 160, 114); } #navbox.orange:hover { background: rgb(240, 130, 20); } #iconbox { height: 53.4%; width: 100%; margin-top: 13.4%; text-align: center; } #iconborder { width: 70px; height: 70px; border-radius: 40px; border: 5px solid rgb(255, 255, 255); } img.icon { width: 50px; height: 50px; margin-top: 10px; } a.nav { display: inline-block; text-decoration: none; } #navprop { width: 100%; height: 33.3%; color: rgb(255, 255, 255); text-align: center; font-weight: bold; font-size: 25px; margin-top: 6.7%; } .center{ margin-left:auto; margin-right:auto; }

and html class="snippet-code-html lang-html prettyprint-override"><html> <head> <title>welcome sirius</title> <?php require_once "theme.php"; ?> </head> <body> <div id="header"> <a href="index.php" class="nav"> <div id="logobox" class="transition"> <img src="img/icon/logo.png" class="logo"> </div> </a> <!-- --> <a href="index.php" class="nav"> <div id="navbox" class="green transition"> <div id="iconbox"> <div id="iconborder" class="center nav"> <img src="img/x.gif" class="icon home"> </div> </div> <div id="navprop">home</div> </div> </a> <!-- --> <a href="aboutus.php" class="nav"> <div id="navbox" class="orange transition"> <div id="iconbox"> <div id="iconborder" class="center nav"> <img src="img/x.gif" class="icon aboutus"> </div> </div> <div id="navprop">about us</div> </div> </a> <!-- --> <a href="register.php" class="nav"> <div id="navbox" class="green transition"> <div id="iconbox"> <div id="iconborder" class="center nav"> <img src="img/x.gif" class="icon register"> </div> </div> <div id="navprop">register</div> </div> </a> <!-- --> <a href="login.php" class="nav"> <div id="navbox" class="orange transition"> <div id="iconbox"> <div id="iconborder" class="center nav"> <img src="img/x.gif" class="icon login"> </div> </div> <div id="navprop">login</div> </div> </a> <!-- --> <a href="admin.php" class="nav"> <div id="navbox" class="green transition"> <div id="iconbox"> <div id="iconborder" class="center nav"> <img src="img/x.gif" class="icon admin"> </div> </div> <div id="navprop">admin</div> </div> </a> </div> </body> </html>

apologies cant see images work blocking content :p

im guessing here beingness specified browser, have not margins etc. seek using reset.css file or maybe using debugging (f12) on desktop , pretend phone debug. (i'm pretty sure in chrome can specify phone browser type be, im assuming modern browsers have emulation mobile)

or min-width: 1050px; if designing responsive design might want create @media queries.

[edit] notice have nil specifying html. perhaps browser adding css against html tag? html {margin:0; padding:0;}

ios css iphone browser

Facebook not showing full url -



Facebook not showing full url -

i'm trying facebook work. kind of works gives wrong title. while messing around facebook button, noticed didn't finish url give me

www.mysite.com/product#

instead of

www.mysite.com/product#item1

if go

https://developers.facebook.com/tools/debug/og/object/

and come in right url shows in debugger, doesn't seem work on site.

here facebook code

<iframe src="https://www.facebook.com/plugins/like.php?href=http://mysite/product#item1"></iframe>

that´s anchor on page, facebook not read one. meaning, not separate url facebook. if want different metatags same link, have utilize parameters instead.

facebook

ember.js - EmberJS - Change property except for index route -



ember.js - EmberJS - Change property except for index route -

i have next routes, controllers , views:

products products.index products.product products.category products.new

i view list of products on products. other routes, except products.index, want alter property blurred on products controller (which blurs list), can view template on top of it.

where , how should this? should set in view or controller? need able determine route kid of products.

update

i need list on products stays in tact, way scrollposition remembered , importantly, can 'blur' product list , show templates on top of it.

the index route created purpose. i'd recommend moving list products products/index template. it'll show when you're on /products , won't show time on route/resource deeper.

if don't want that, set in controller, , follow pattern shown in answer: state of nested routes in emberjs

ember.js

angularjs - Manipulating meta tags with data from controller in different scope -



angularjs - Manipulating meta tags with data from controller in different scope -

i have angularjs application need update few meta tags (for fb sharing) based on info controller gets service.

right doing in itemcontroller when controller gets info service:

angular.element('head').find('#metafbimage').attr('content', $scope.item.imageurl);

this bad , want in directive. cannot figure out nice way it. far have 2 alternatives:

1) directive on head tag. when itemcontroller gets info service want phone call function in directive changes meta tags. how can controller phone call function different scope ( outside itemcontroller)?

2) service injected itemcontroller, , service changes meta tags. improve (and workable) solution. ok manupulate dom elements in service in cases these?

edit: chose refactor using $rootscope in controller, , watching $rootscope in directive on head. sense somewhere between acceptable , bad practice. ideas?

use approach.

create service (factory) parameters such `

angular.module("myapp").factory("ogfactory", function(){ var ogfactory = { title : "", description : "", ... }; homecoming ogfactory; });

set ng-app on <html> element <html ng-app="your_app_name"> <head> block can access items within ng-app.

inject ogfactory controller. inject $run block , set on $rootscope $rootscope.ogfactory = ogfactory.

after controller has done whatever needs (if async), set ogfactory.title , ogfactory.description.

in <head> section, include meta tags such as: <meta name="og:title" content="{{ogfactory.title}}">

the controller set ogfactory properties , rootscope reflect them.

note, however, facebook not wait javascript done processing in order fetch page results, {{title}} (literally) "{{title}}" unless utilize service prerender.io. method works great prerender.

angularjs dom service controller directive

javascript - How to close modal box after successful submit and open second modal conditionally on form submit -



javascript - How to close modal box after successful submit and open second modal conditionally on form submit -

i want close form modal after submit form , show modal box after error clear

when form submitted , value of html select list on form has changed, conditional js confirmation pop display. user must click ok button on js confirmation pop form submission proceed.

or else if html select list has not changed js confirmation pop not display , form submit.

these codes:

class="snippet-code-js lang-js prettyprint-override"> $('#infoform').bootstrapvalidator({ // live: 'disabled', message: 'this value not valid', fields: { sname: { validators: { notempty: { message: 'the name required , cannot empty' }, stringlength: { min: 6, max: 30, message: 'the username must more 6 , less 30 characters long' }, regexp: { regexp: /^[a-za-z0-9_\.]+$/, message: 'the username can consist of alphabetical, number, dot , underscore' } } }, sfname: { validators: { notempty: { message: 'the father name required , cannot empty' }, stringlength: { min: 6, max: 30, message: 'the father name must more 6 , less 30 characters long' }, regexp: { regexp: /^[a-za-z0-9_\.]+$/, message: 'the father name can consist of alphabetical, number, dot , underscore' } } } } }); class="snippet-code-html lang-html prettyprint-override"><!--first modal box--> <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mysmallmodallabel" aria-hidden="true"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">close</span></button> <h4 class="modal-title" id="mysmallmodallabel">modal box</h4> </div> <div class="modal-body"> <form role="form" name="infoform" id="infoform" method="post" action=""> <div class="form-group"> <input type="name" class="form-control" placeholder="your name" name="sname" id="sname" /> </div> <div class="form-group"> <input type="name" class="form-control" placeholder="father name" name="sfname" /></div> <div class="form-group"> <button type="submit" name="submit1" value="submit" class="btn btn-default" data-toggle="modal" data-target="#basicmodal" >submit</button></div> </form> </div> <div class="modal-footer"></div> </div> </div> </div><!--end first modal box--> <!-- sec modal box --> <div class="modal fade" id="basicmodal" tabindex="-1" role="dialog" aria-labelledby="basicmodal" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title" id="mymodallabel">second modal box</h4> </div> <div class="modal-body"> <p>your info submit</p> </div> <div class="modal-footer"> </div> </div> </div> </div> <!-- end sec modal box-->

use closing event of modal box check if succesful , open new modal

javascript jquery html css twitter-bootstrap

maven - mh_make and resolving pom dependencies -



maven - mh_make and resolving pom dependencies -

let's consider case mh_make showing lot of dependencies. seek mvn install installs plugins ~/.m2/repository . not picked , 1 time again see mh_make searching jars in /usr/share/maven-repo , throwing error

in link maven-repo-helper - "all dependencies must available debian packages , not acceptable download artifacts during build process central maven repository."

are supposed search deb bundle each dependency in pom.xml? if yes utilize of .m2 repository , jars in it? why mh_make /usr/share/maven-repo or export variable points it. changing $repo not making ~/.m2/repository why need deb bundle pom jar dependency if @ need it.

an reply posted on debian-java list: https://lists.debian.org/debian-java/2014/11/msg00011.html

maven debian pom.xml packaging

jquery - Primefaces extension timepiker break when minutes reach 0 -



jquery - Primefaces extension timepiker break when minutes reach 0 -

i using primefaces extension 3.0.0 timepicker component, when spinning time break when minutes reaches 0 below jquery exception. showcase works not sure why breaking me. not jquery help appreciated.

<pe:timepicker value="#{bean.schedule.endtime}" widgetvar="endtimewidget" shownowbutton="true" showperiod="true"/>

exception

uncaught typeerror: cannot read property '0' of undefined timepicker.js.xhtml?ln=primefaces-extensions&v=3.0.0:55primefacesext.widget.timepicker.primefaces.widget.basewidget.extend.isam timepicker.js.xhtml?ln=primefaces-extensions&v=3.0.0:55primefacesext.widget.timepicker.primefaces.widget.basewidget.extend.spin timepicker.js.xhtml?ln=primefaces-extensions&v=3.0.0:52$.children.removeclass.off.on.mousedown timepicker.js.xhtml?ln=primefaces-extensions&v=3.0.0:50bi.event.dispatch jquery.js.xhtml?ln=primefaces&v=5.1:25ce.handle

i thing has library. seek clearing external library application server. (i mean priemfaces extensions jar in fact every edition 3.0.0 or less) remove library application too. if u added jar remove jar , not library. if u created library adding primefaces extensions jar remove 1 development environment. dont mention envrinment cant help more that. after clear references jar of primefaces extensions re-add jar again. think problem indicates misplacement of jar file of kind of blocking version maybe...? though says property has wrong value cant find in library. has happened me 1 time , have solved it. luck

jquery jsf primefaces primefaces-extensions

powershell - Compare Dates in loop -



powershell - Compare Dates in loop -

i have requirement need read date csv file , compare date variable within script. however, code doesn't work when of date entries in csv file blank. thought how can store blank date in [datetime] variable?

here's part of code:

#this date variable in script $inactivitydate = (get-date).adddays(-62).date import-csv $mycsv | foreach { #this date variable i'm reading csv file $whencreated = $_.whencreated #this converts value in string variable $whencreated [datetime] format $convertwhencreated = ([datetime]::parseexact($whencreated,"dd/mm/yyyy",$null)) #comparing dates if($convertwhencreated -le $inactivitydate) { "account dormant" }

above code works fine when $whencreated contains value, when it's blank powershell cannot compare date variable blank value :( solution can see check if $whencreated blank , save old date happens in excel, e.g.:

if($whencreated -eq "") { $whencreated = "01/01/1900 00:00:00" }

should ok or there logical solution?

your problem isn't comparison, conversion of blank value date via parseexact(). if want accounts no date treated dormant this:

$whencreated = $_.whencreated if ($whencreated) { $whencreated = [datetime]::parseexact($whencreated, 'dd/mm/yyyy', $null) } if ($whencreated -le $inactivitydate) { 'account dormant' }

checking if empty string (or $null) lesser or equal $inactivitydate homecoming $true long $inactivitydate contains date.

date powershell

import - Python module function not defined -



import - Python module function not defined -

i trying import module in python script , can't create work. have python script: /home/user/pythonscript/onedir/onescript.py , utilize script directory higher in hierarchy: /home/user/pythonscript/common.py did next @ top of onescript.py:

import sys sys.path.insert(1,'/home/user/pythonscript') import mutual

in common.py file, have function onecconnect, , when seek run onescript.py, uses onecconnect function, next error: nameerror: name 'onecconnect' not defined

anyone can see wrong or forgot do? thanks

make sure there __init__.py in directories, go /home/user/pythonscript , run python code there. so:

python onedir/onescript.py

in onescript.py can do:

from mutual import onecconnect

the rules are:

always run python script highest possible directory (not deepest project). always have total import lines, no relative imports.

this keeps problems away.

import module python-3.4

ios - AppDelegate type var is not member unless in func (see pictures) -



ios - AppDelegate type var is not member unless in func (see pictures) -

i'm starting swift, have objective-c background... anyways, why when do:

i error, when set in func like:

there isn't error?

also, can please right terms? appdel reference or variable? in advanced - please edit or tell me what's wrong question :)

you can't access self when setting default value.

mark lazy attribute can trick:

lazy var context: nsmanagedobjectcontext = self.appdel.managedobjectcontext

ios xcode swift member appdelegate

How can I add a context menu to a browser action with a Chrome extension? -



How can I add a context menu to a browser action with a Chrome extension? -

so i'm trying sort of "search google" context menu alternative there. view result of in browser extension. possible in way?

you asking whether it's possible add together own entry menu "search google" appears.

yes, possible.

the docs here: https://developer.chrome.com/extensions/contextmenus

there samples available.

i suggest putting logic in background page, since popup not persist , can't have listener event. then, popup should request info background page needed.

google-chrome-extension

java - How to reference a class in an external JAR in Eclipse? -



java - How to reference a class in an external JAR in Eclipse? -

i reference class bag in jar file, eclipse telling me bag cannot resolved type. have added jar in bag defined classpath project, error still there. doing wrong?

i think can't that, because handbag class in algs4.jar within default package. before j2se 1.4, still can import classes default bundle using syntax this:

import unfinished;

but j2se 1.5, that's no longer allowed. if want access default bundle class within packaged class requires moving default bundle class bundle of own. read here more detail explanation :

how access java-classes in default-package?

some options can take :

access class via reflection or other indirect method. little bit hard, :

class fooclass = class.forname("foobar"); method foomethod = fooclass.getmethod("foomethod", new class[] { string.class });

string fooreturned = foomethod.invoke(fooclass.newinstance(), new string("i did it"));

if own source code of jar library, need set in bundle , wrap 1 time again new jar library.

java eclipse

Using EHCache in JSF Web Application -



Using EHCache in JSF Web Application -

i working on jsf application. want cache database table on periodic basis. heard ehcache it, see utilize in hibernate. possible utilize ehcache in jsf application or there alternative in jsf?

if want utilize ehcache in front end end part should write cache handler

net.sf.ehcache.cachemanager or primefaces back upwards ehcache, if application big, prefer have cache handler service put/get/check objects cache.

jsf ehcache

Seat Locator - 3D Arrays (Java) -



Seat Locator - 3D Arrays (Java) -

i got 3 dimensional array display, having problem getting user input correspond programme , find seat (replacing specific 0 1). please give me hint of suppose do? here code.

import java.util.scanner; public class ticketseller { //name public static void main(string[] args) { scanner keyboard = new scanner(system.in); int seating[][][] = new int[3][10][10]; int g,r,c; system.out.print("enter ticket section: "); g = keyboard.nextint(); system.out.print("enter ticket row: "); r = keyboard.nextint(); system.out.print("enter ticket number: "); c = keyboard.nextint(); for( g = 0; g<3; g++) for(r=0; r<10; r++){ for(c=0; c<10; c++) seating[g][r][c]= g*r*c; { for( g = 0; g<3; g++) for(r=0; r<10; r++){ for(c=0; c<10; c++) { system.out.print(seating[g][r][c]); } system.out.println(); } system.out.println(); } } }}

and output:

enter ticket section: 1 come in ticket row: 1 come in ticket number: 1 0000000000 0000000000 0000000000

first, should utilize ide , format code properly. proper indentation of import understanding of problems in code.

problem 1

you using same variable names 1 time again , again. utilize variables g,r , c loop variables, erase previous values, user entered. should utilize different variables loops.

problem 2

you have 2 nested loops (for g , for r). within for r have loop fills seatings values - c cells current g , r. since 0 @ first round, fills 0 in seatings.

then, after seatings filled, have 1 time again loops same loop variables. loops need - print seatings. seatings @ stage zero. , that's output get.

but because used the same loop variables, variables c,r , g have reached maximum values (3,10,10). means outer loop not performed again.

never utilize loops within loops same variables.

problem 3

this problem related previous problem. , proper indentation , formatting have helped you. part:

for( g = 0; g<3; g++) for(r=0; r<10; r++){ for(c=0; c<10; c++) seating[g][r][c]= g*r*c; {

both { here should not here. first one, right after for r causes sec set of loops included in first. sec 1 not creating loop block. thought closing block, opening new block.

these loops proper formatting:

(g = 0; g < 3; g++) (r = 0; r < 10; r++) { ┆ (c = 0; c < 10; c++) ┆ seating[g][r][c] = g * r * c; ┆ { ┆ ╻ (g = 0; g < 3; g++) ┆ ╻ (r = 0; r < 10; r++) { ┆ ╻ (c = 0; c < 10; c++) { ┆ ╻ system.out.print(seating[g][r][c]); ┆ ╻ } ┆ ╻ system.out.println(); ┆ ╻ } ┆ ╻ system.out.println(); ┆ } }

the part marked ┈┈┈ within for r loop. part marked ╺╺╺╺ independent block , it's under for r, not for c loop, because it's not connected () of for.

the solution always set { after for(). if set { after for, while, if , else, if there 1 line, you'll avoid lot of troubles because compiler tell if have missing brace, , if decide add together 1 of loops, won't commands thought within loop or if , outside it.

problem 4

there no reason set g*r*c within seats. wanted set 1 in appropriate seat, that.

in conclusion:

don't utilize same variable names user inputs , loop variables. phone call user variables usersection, userrow, usernumber , loop variables section, row , number example. take care have { after each for() , set } in proper place. you didn't set 1 in there anywhere.

java arrays

How to return unique elements in an array using Go's text/template package? -



How to return unique elements in an array using Go's text/template package? -

i new go , struggling trying figure out way homecoming unique variables array in go templating language. configure software , not have access source alter actual programme template.

i have knocked illustration in go playground:

https://play.golang.org/

package main import "os" import "text/template" func main() { var arr [10]string arr[0]="mice" arr[1]="mice" arr[2]="mice" arr[3]="mice" arr[4]="mice" arr[5]="mice" arr[6]="mice" arr[7]="toad" arr[8]="toad" arr[9]="mice" tmpl, err := template.new("test").parse("{{range $index, $thing := $}}the thing is: {{$thing}}\n{{end}}") if err != nil { panic(err) } err = tmpl.execute(os.stdout, arr) if err != nil { panic(err) } }

right returns:

the thing is: mice thing is: mice thing is: mice thing is: mice thing is: mice thing is: mice thing is: mice thing is: toad thing is: toad thing is: mice

what trying craft template input array filters duplicates , returns:

the thing is: mice thing is: toad

i stuck know virtually no go , struggle find array manipulation methods in docs. 1 have tips?

addenium

sorry not beingness clear wrote question on bus on way work.

i don't have access go code outside template. have template can edit , within template have array may or may not have multiple values , need print them once.

i appreciate not how templates meant work if there dirty way save me several days work.

you can create own functions template via template.funcmap:

arr := []string{ "mice", "mice", "mice", "mice", "mice", "mice", "mice", "toad", "toad", "mice", } customfunctions := template.funcmap{"unique" : unique} tmpl, err := template.new("test").funcs(customfunctions).parse("{{range $index, $thing := unique $}}the thing is: {{$thing}}\n{{end}}")

where unique defined as:

func unique(e []string) []string { r := []string{} _, s := range e { if !contains(r[:], s) { r = append(r, s) } } homecoming r } func contains(e []string, c string) bool { _, s := range e { if s == c { homecoming true } } homecoming false }

output:

the thing is: mice thing is: toad

(it might improve utilize map .. gives basic idea)

that said - have considered filtering outside of template? create things nicer you.. can iterate on actual piece within template.

working sample: https://play.golang.org/p/l_8t10cphw

go

osx - How to impose a cpu use of 100% for all my MATLAB session working in parallel? -



osx - How to impose a cpu use of 100% for all my MATLAB session working in parallel? -

i have 9 matlab jobs want run matlab terminal of mac (mac os x 10.8.5 2*2.4ghz 6-core intel xeon).

so open 9 tabs in terminal , in each of open matlab session using command:

//applications/matlab_r2014b.app/bin/matlab -nodesktop

then in each of these matlab session launch programme (which not -and can not- utilize parfor). jobs runs.

but when top in terminal window find out matlab sessions utilize between 1% , 45% of cpu (and suppose have 12 cores!).

any thought of problem might be? can impose percentage of cpu use?

i tried impose priority using

sudo renice -19 -p <pid number>

but not seem work (even changing -19 0 or +19).

thanks lot help,

best,

adrien

as written @olivier, see 100% load if programme cpu-bound. if reads info disk, and/or handles big matrices, io-bound.

for instance simple loop

>> = 1:1000000000000; i=i+1;end

should max out cpu usage

15627 user 20 0 7161m 618m 110m s 102.0 0.4 2:44.14 matlab

so can utilize , see whether or not cpu usage reaches 100% 1 instance. if does, means code not cpu-bound, , might want seek , run more instances of matlab @ same time, memory permitting. if not, should review configuration , find cause of behavior.

osx matlab cpu cpu-usage multiple-instances

linux - Is there a utility for estimating a file's size after compression? -



linux - Is there a utility for estimating a file's size after compression? -

i estimate final size of file, files, or directory of files after has been compressed. i'm looking programme or script can estimate/calculate this.

any ideas?

such tool must accessible on command line (for linux/mac). useful if work or of commonly-used lossless compression algorithms (gz, bzip2, zip, etc.). bonus points if listed compression ratios (or of equivalent use, resulting file size) variety of methods. expect such tool scan file prior producing output, want avoid actual compression, if possible.

if matters, i'd prefer general-purpose:

it should work kind of file(s), including easily-compressed ascii text files, binary data, , in between. (of course, depends wildly on compression algorithm/tool.) it should work variety of compression algorithms/tools

the next bash script want one kind of compression algorithm, doesn't count (i'd estimation):

class="lang-bash prettyprint-override">#!/bin/bash files_to_compress=`ls ./*txt` temp_file=mydata.tgz tar -zcvf $temp_file $files_to_compress du -h $temp_file | awk '{print $1}' rm -f $temp_file

i utilize larger files (larger gigabyte), why want estimate, , not actual compression.

you might compress pipe | wc (you utilize pipe(7)-s or fifo(7)-s, perhaps bash coprocesses) still need compress.

(unless tight on disk space, believe not worth pain)

notice not every file genuinely compressible.

linux compression decompression data-compression lossless-compression

azure - Deploy a Cloud Service using Powershell and Teamcity fails -



azure - Deploy a Cloud Service using Powershell and Teamcity fails -

i seek deploy cloud service using powershell , teamcity. worked fine in past, cannot create work on new machine.

this powershell script:

write-output "$(get-date -f g) - running azure imports" import-azurepublishsettingsfile -publishsettingsfile "%publishsettingsfilename%" set-azuresubscription -currentstorageaccountname "%blobaccountname%" -subscriptionname "%subscriptionname%" select-azuresubscription -subscriptionname "%subscriptionname%" function publish(){ $deployment = get-azuredeployment -servicename "%cloudservicename%" -slot "%cloudserviceslot%" -errorvariable -erroraction silentlycontinue if ($a[0] -ne $null) { write-output "$(get-date -f g) - no deployment detected. creating new deployment. " } if ($deployment.name -ne $null) { #update deployment inplace (usually faster, cheaper, won't destroy vip) write-output "$(get-date -f g) - deployment exists in %cloudservicename%. upgrading deployment." upgradedeployment } else { createnewdeployment } } function createnewdeployment() { write-progress -id 3 -activity "creating new deployment" -status "in progress" write-output "$(get-date -f g) - creating new deployment: in progress" $opstat = new-azuredeployment -slot "%cloudserviceslot%" -package "%packageurl%" -configuration "%cscfgfilename%" -label "%deploymentlabel%" -servicename "%cloudservicename%" $completedeployment = get-azuredeployment -servicename "%cloudservicename%" -slot "%cloudserviceslot%" $completedeploymentid = $completedeployment.deploymentid write-progress -id 3 -activity "creating new deployment" -completed -status "complete" write-output "$(get-date -f g) - creating new deployment: complete, deployment id: $completedeploymentid" } function upgradedeployment() { write-progress -id 3 -activity "upgrading deployment" -status "in progress" write-output "$(get-date -f g) - upgrading deployment: in progress" $opstat = set-azuredeployment -upgrade -slot "%cloudserviceslot%" -package "%packageurl%" -configuration "%cscfgfilename%" -label "%deploymentlabel%" -servicename "%cloudservicename%" -force $completedeployment = get-azuredeployment -servicename "%cloudservicename%" -slot "%cloudserviceslot%" $completedeploymentid = $completedeployment.deploymentid write-progress -id 3 -activity "upgrading deployment" -completed -status "complete" write-output "$(get-date -f g) - upgrading deployment: complete, deployment id: $completedeploymentid" } write-output "$(get-date -f g) - create azure deployment" publish

the values in %% replaced teamcity parameter values, fine. when run commands computer using same settings , same publishsettings-file, works. teamcity build agent, not. not work powershell console on teamcity build agent machine.

log says (replaced id, name etc. ***):

[22:45:47] : [step 2/2] ##teamcity[buildstatisticvalue key='buildstageduration:buildsteprunner_193' value='0.0'] [22:45:47] : [step 2/2] starting: c:\windows\syswow64\windowspowershell\v1.0\powershell.exe -noprofile -noninteractive -executionpolicy bypass -command - < e:\buildagent1\temp\buildtmp\powershell2886801367807761703.ps1 [22:45:47] : [step 2/2] in directory: e:\buildagent1\work\a355cf3c0001cfa2 [22:45:49] : [step 2/2] 13.11.2014 22:45 - running azure imports [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] id : *** [22:45:50] : [step 2/2] name : *** [22:45:50] : [step 2/2] environment : azurecloud [22:45:50] : [step 2/2] business relationship : *** [22:45:50] : [step 2/2] properties : {[supportedmodes, azureservicemanagement]} [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] id : *** [22:45:50] : [step 2/2] name : *** [22:45:50] : [step 2/2] environment : azurecloud [22:45:50] : [step 2/2] business relationship : *** [22:45:50] : [step 2/2] properties : {[supportedmodes, azureservicemanagement], [default, true], [22:45:50] : [step 2/2] [storageaccount, ***]} [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] [22:45:50] : [step 2/2] 13.11.2014 22:45 - create azure deployment [22:45:52]w: [step 2/2] get-azuredeployment : error occurred while sending request. [22:45:52]w: [step 2/2] in zeile:2 zeichen:16 [22:45:52]w: [step 2/2] + $deployment = get-azuredeployment -servicename "***" -slot [22:45:52]w: [step 2/2] "production" ... [22:45:52]w: [step 2/2] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [22:45:52]w: [step 2/2] ~~~ [22:45:52]w: [step 2/2] + categoryinfo : notspecified: (:) [get-azuredeployment], httpreq [22:45:52]w: [step 2/2] uestexception [22:45:52]w: [step 2/2] + fullyqualifiederrorid : system.net.http.httprequestexception,microsoft.w [22:45:52]w: [step 2/2] indowsazure.commands.servicemanagement.hostedservices.getazuredeploymentco [22:45:52]w: [step 2/2] mmand [22:45:52]w: [step 2/2] [22:45:52] : [step 2/2] 13.11.2014 22:45 - no deployment detected. creating new deployment. [22:45:52] : [step 2/2] 13.11.2014 22:45 - creating new deployment: in progress [22:45:53]w: [step 2/2] new-azuredeployment : error occurred while sending request. [22:45:53]w: [step 2/2] in zeile:5 zeichen:15 [22:45:53]w: [step 2/2] + $opstat = new-azuredeployment -slot "production" -package [22:45:53]w: [step 2/2] "http://*** ... [22:45:53]w: [step 2/2] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [22:45:53]w: [step 2/2] ~~~ [22:45:53]w: [step 2/2] + categoryinfo : notspecified: (:) [new-azuredeployment], httpreq [22:45:53]w: [step 2/2] uestexception [22:45:53]w: [step 2/2] + fullyqualifiederrorid : system.net.http.httprequestexception,microsoft.w [22:45:53]w: [step 2/2] indowsazure.commands.servicemanagement.hostedservices.newazuredeploymentco [22:45:53]w: [step 2/2] mmand [22:45:53]w: [step 2/2] [22:45:54]w: [step 2/2] get-azuredeployment : error occurred while sending request. [22:45:54]w: [step 2/2] in zeile:6 zeichen:27 [22:45:54]w: [step 2/2] + $completedeployment = get-azuredeployment -servicename "***" [22:45:54]w: [step 2/2] -slot " ... [22:45:54]w: [step 2/2] + [22:45:54]w: [step 2/2] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [22:45:54]w: [step 2/2] + categoryinfo : notspecified: (:) [get-azuredeployment], httpreq [22:45:54]w: [step 2/2] uestexception [22:45:54]w: [step 2/2] + fullyqualifiederrorid : system.net.http.httprequestexception,microsoft.w [22:45:54]w: [step 2/2] indowsazure.commands.servicemanagement.hostedservices.getazuredeploymentco [22:45:54]w: [step 2/2] mmand [22:45:54]w: [step 2/2] [22:45:54] : [step 2/2] 13.11.2014 22:45 - creating new deployment: complete, deployment id: [22:45:54] : [step 2/2] process exited code 0 [22:45:54] : [step 2/2] ##teamcity[buildstatisticvalue key='buildstageduration:buildsteprunner_193' value='7118.0']

i wondering exception. publishsettings file valid, certificate valid , works fine using visual studio or cerebrata azure management studio. powershell deployment fails.

any ideas?

solved downgrading azure powershell previous version. looks oct 2014 release has bug here.

powershell azure teamcity

ruby on rails - Retrieving contact details from contact id using collection select -



ruby on rails - Retrieving contact details from contact id using collection select -

i utilize next collection select allow users pick contact name.

<div class="form-group"> <%= f.label :contact %> <%= f.collection_select(:contact, current_user.contacts.all, :id, :name, prompt: true, class: "form-control") %> </div>

but, instead of name, it's id that's displayed when utilize email.contact in show page. have tried using email.contact.name , returns nomethoderror. associations, email has_many contacts , contacts belongs_to email. tried using inverse_of these association, still unable retrieve contact name. there workaround solve this?

if @ collection_select

collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})

if @ docs says

the :value_method , :text_method parameters methods called on each fellow member of collection. homecoming values used value attribute , contents of each tag, respectively.

so need pass value_method method want save in db, right using id. save name can this:

<%= f.collection_select(:contact, current_user.contacts.all, :name, :name, prompt: true, class: "form-control") %>

ruby-on-rails

xcode - iOs today extension do not launch - lost connection to device -



xcode - iOs today extension do not launch - lost connection to device -

i created today extension app , works fine on mobile, if seek launch widget target on other device error

i run xcode 6.0.1

couple of things check:

code signing / provisioning profiles correct the supported architecture standard arch had issue this. docs: containing app links embedded framework must include arm64

https://developer.apple.com/library/ios/documentation/general/conceptual/extensibilitypg/extensionscenarios.html

ios xcode ios8-today-widget

android - Amcharts is possible to use panEvents on mobile device (Hybrid)? -



android - Amcharts is possible to use panEvents on mobile device (Hybrid)? -

i utilize zooming , panning functionality in amcharts on mobile device. found configuration directive: paneventsenabled in http://docs.amcharts.com/javascriptcharts/amserialchart

i tried combination of chartscrollbar without luck.

what i'm doing wrong , how can utilize right on mobile devices?

many help

android charts amcharts

java - configuring hyperjaxb to create hibernate mappings and a mysql database -



java - configuring hyperjaxb to create hibernate mappings and a mysql database -

i using hyperjaxb generate java classes xsd file. how can configure generate hibernate annotations, , trigger hbm2ddl create mysql database tables generated classes?

i downloaded purchase order sample hibernate from link, navigated target directory in cmd.exe , ran mvn clean install, resulting folders did not contain java classes, , did not contain hibernate/mysql. working illustration creates downloaded xsd file can plug own xsd file code , have java/hibernate/mysql autogenerated. way can spend time tweaking xsd file resulting java/hibernate/mysql need be.

a code illustration or step step instructions helpful. using eclipse.

**edit: **

the reply question came after posting few other questions. find finish reply question, need review answers other questions, in particular, the 1 @ link.

update

finally appeared op looking generated classes in root directory of project insteadof target\generated-source\xjc, despite tutorial states look:

if browse target/generated-sources/xjc directory, you'll find few generated java files, instance purchaseordertype.java.

i don't understand when nil generated. i've rechecked it, works fine.

my steps are:

download hyperjaxb3-ejb-samples-po-initial-0.5.6-maven-src.zip unzip go hyperjaxb3-ejb-samples-po-initial-0.5.6 mvn clean install

here's get:

[info] ------------------------------------------------------------------------ [info] building hyperjaxb3 samples [po-initial:maven] 0.5.6 [info] ------------------------------------------------------------------------ [info] [info] --- maven-clean-plugin:2.5:clean (default-clean) @ hyperjaxb3-ejb-samples-po-initial-maven --- [info] deleting c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\target [info] [info] --- maven-hyperjaxb3-plugin:0.6.0:generate (default) @ hyperjaxb3-ejb-samples-po-initial-maven --- [info] sources not up-to-date; xjc execution executed. [warning] according java persistence api specification, section 2.1, entities must top-level classes: "the entity class must top-level class." jaxb model not customized top-level local scoping, please utilize <jaxb:globalbinding localscoping="toplevel"/> global bindings customization. org.jvnet.hyperjaxb3.ejb.plugin.ejbplugin [warning] according java persistence api specification, section 2.1, entities must implement serializable interface: "if entity instance passed value detached object (e.g., through remote interface), entity class must implement serializable interface." jaxb model not customized serializable, please utilize <jaxb:serializable/> global bindings customization element create model serializable. org.jvnet.hyperjaxb3.ejb.plugin.ejbplugin [info] [info] --- maven-resources-plugin:2.6:resources (default-resources) @ hyperjaxb3-ejb-samples-po-initial-maven --- [warning] using platform encoding (cp1252 actually) re-create filtered resources, i.e. build platform dependent! [info] copying 1 resource [info] copying 0 resource [info] copying 1 resource [info] [info] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hyperjaxb3-ejb-samples-po-initial-maven --- [warning] file encoding has not been set, using platform encoding cp1252, i.e. build platform dependent! [info] compiling 5 source files c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\target\classes [info] [info] --- maven-resources-plugin:2.6:testresources (default-testresources) @ hyperjaxb3-ejb-samples-po-initial-maven --- [warning] using platform encoding (cp1252 actually) re-create filtered resources, i.e. build platform dependent! [info] copying 2 resources [info] [info] --- maven-compiler-plugin:2.5.1:testcompile (default-testcompile) @ hyperjaxb3-ejb-samples-po-initial-maven --- [warning] file encoding has not been set, using platform encoding cp1252, i.e. build platform dependent! [info] compiling 5 source files c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\target\test-classes [info] [info] --- maven-surefire-plugin:2.12.4:test (default-test) @ hyperjaxb3-ejb-samples-po-initial-maven --- [info] surefire study directory: c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\target\surefire-reports ------------------------------------------------------- t e s t s ------------------------------------------------------- running roundtriptest detected [file:/c:/projects/workspaces/hj3/dist/hyperjaxb3-ejb-samples-po-initial-0.5.6/target/classes/meta-inf/persistence.xml]. roundtriptest loading entity manager mill properties. roundtriptest loading entity manager mill properties [file:/c:/projects/workspaces/hj3/dist/hyperjaxb3-ejb-samples-po-initial-0.5.6/target/test-classes/persistence.properties]. roundtriptest testing samples. roundtriptest sample directory [c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\src\test\samples]. roundtriptest testing sample [po.xml]. roundtriptest unmarshalling. roundtriptest opening session. roundtriptest saving object. roundtriptest opening session. roundtriptest loading object. roundtriptest closing session. roundtriptest initial object: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <purchaseorder orderdate="1999-10-20"> <shipto country="us"> <name>alice smith</name> <street>123 maple street</street> <city>mill valley</city> <state>ca</state> <zip>90952</zip> </shipto> <billto country="us"> <name>robert smith</name> <street>8 oak avenue</street> <city>old town</city> <state>pa</state> <zip>95819</zip> </billto> <comment>hurry, lawn going wild!</comment> <items> <item partnum="872-aa"> <productname>lawnmower</productname> <quantity>1</quantity> <usprice>148.95</usprice> <comment>confirm electric</comment> </item> <item partnum="926-aa"> <productname>baby monitor</productname> <quantity>1</quantity> <usprice>39.98</usprice> <shipdate>1999-05-21</shipdate> </item> </items> </purchaseorder> roundtriptest source object: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <purchaseorder orderdate="1999-10-20" hjid="1"> <shipto country="us" hjid="2"> <name>alice smith</name> <street>123 maple street</street> <city>mill valley</city> <state>ca</state> <zip>90952</zip> </shipto> <billto country="us" hjid="1"> <name>robert smith</name> <street>8 oak avenue</street> <city>old town</city> <state>pa</state> <zip>95819</zip> </billto> <comment>hurry, lawn going wild!</comment> <items hjid="1"> <item partnum="872-aa" hjid="1"> <productname>lawnmower</productname> <quantity>1</quantity> <usprice>148.95</usprice> <comment>confirm electric</comment> </item> <item partnum="926-aa" hjid="2"> <productname>baby monitor</productname> <quantity>1</quantity> <usprice>39.98</usprice> <shipdate>1999-05-21</shipdate> </item> </items> </purchaseorder> roundtriptest result object: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <purchaseorder orderdate="1999-10-20" hjid="1"> <shipto country="us" hjid="2"> <name>alice smith</name> <street>123 maple street</street> <city>mill valley</city> <state>ca</state> <zip>90952</zip> </shipto> <billto country="us" hjid="1"> <name>robert smith</name> <street>8 oak avenue</street> <city>old town</city> <state>pa</state> <zip>95819</zip> </billto> <comment>hurry, lawn going wild!</comment> <items hjid="1"> <item partnum="872-aa" hjid="1"> <productname>lawnmower</productname> <quantity>1</quantity> <usprice>148.95</usprice> <comment>confirm electric</comment> </item> <item partnum="926-aa" hjid="2"> <productname>baby monitor</productname> <quantity>1</quantity> <usprice>39.98</usprice> <shipdate>1999-05-21</shipdate> </item> </items> </purchaseorder> roundtriptest checking document identity. roundtriptest finished testing sample [po.xml]. roundtriptest finished testing samples. roundtriptest tests run: 1, failures: 0, errors: 0, skipped: 0, time elapsed: 2.552 sec results : tests run: 1, failures: 0, errors: 0, skipped: 0 [info] [info] --- maven-jar-plugin:2.4:jar (default-jar) @ hyperjaxb3-ejb-samples-po-initial-maven --- [info] building jar: c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\target\hyperjaxb3-ejb-samples-po-initial-maven-0.5.6.jar [info] [info] --- maven-install-plugin:2.4:install (default-install) @ hyperjaxb3-ejb-samples-po-initial-maven --- [info] installing c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\target\hyperjaxb3-ejb-samples-po-initial-maven-0.5.6.jar c:\repository\org\jvnet\hyperjaxb3\hyperjaxb3-ejb-samples-po-initial-maven\0.5.6\hyperjaxb3-ejb-samples-po-initial-maven-0.5.6.jar [info] installing c:\projects\workspaces\hj3\dist\hyperjaxb3-ejb-samples-po-initial-0.5.6\pom.xml c:\repository\org\jvnet\hyperjaxb3\hyperjaxb3-ejb-samples-po-initial-maven\0.5.6\hyperjaxb3-ejb-samples-po-initial-maven-0.5.6.pom [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 12.100 s [info] finished at: 2014-10-09t00:42:10+01:00 [info] final memory: 22m/96m [info] ------------------------------------------------------------------------

full mvn clean install -x log here.

so hope see, works perfectly. please post mvn clean install -x, maybe wrong.

now, concerning question, here's mysql example:

https://github.com/highsource/hyperjaxb3/tree/master/ejb/tests/po-mysql

this project includes snippet of hbm2ddl generation:

https://github.com/highsource/hyperjaxb3/tree/master/ejb/tests/issues

the hbm2ddl commented out reason, not sure if works, should give direction.

java hibernate jaxb hbm2ddl hyperjaxb