Posts

Showing posts from March, 2010

android - Implement navigation drawer -

Image
i able implement navigation drawer this.its navigate on mainactivity. but can navigate drawer app? 1) have @ this: slide actionbar or 2) consider using slidingmenu library github . it's powerfull flexible , can it. can slide actionbar calling: setslidingactionbarenabled(true);

cluster analysis - Modifying k-means package in R -

this question has answer here: cylindrical clustering in r - clustering timestamp other data 2 answers is possible modify notion of distance in kmeans package? i have cyclical data , want use alternative notion of distance such. k-means shouldn't used other distances. not distance based algorithm . k-means optimizing sum-of-squares. if want proper distance-based k-means variation, called pam. pam proper way of using k-means other distance functions . because the mean least-squares estimator , optimizes sum-of-squares. if put different distance function k-means, may stop converging. here counterexample: consider absolute correlation distance. 2 series +1 +2 +3 +4 +5 -1 -2 -3 -4 -5 are negatively correlated, have absolute correlation distance 0. taking mean of these 2 vectors yields 0 0 0 0 0 for correlation isn't defined anymo...

oracle11g - How to determine what the actual error is in an Oracle stored procedure, when "execution completed with warning"? -

i using following code create or replace procedure phys_last_year_sales_sp (amdm_phys_id number(6)) begin dbms_output.put_line('amdm_phys_id= '||amdm_phys_id); end; to create stored procedure every time execute above query shows following error java.sql.sqlwarning: warning: execution completed warning how find out actual error is?

javascript - How to logout of gmail account after logout from my app? -

i have integrated sign in google+ functionality application using javascript. after user logs out application, remains logged in gmail. creates serious security threat. facing same problem twitter. any solution acceptable. thank in advance...

Php array_push function in java -

i trying rewrite following php code in java foreach ($configvalues $data) { $temp['config_key'] = is_null($data->getconfigkey()) ? '' : $data->getconfigkey(); $temp['config_value'] = is_null($data->getconfigvalue()) ? '' : $data->getconfigvalue(); array_push($configarray, $temp); } foreach ($configpricing $data) { $temp1['config_key'] = is_null($data->gettype()) ? '' : $data->gettype(); $temp1['config_value'] = is_null($data->getprice()) ? '' : $data->getprice(); array_push($configarray, $temp1); } the above code push 1 associative array in how can in write in java tried in way : list<string> configlist=new arraylist(); list<config> config=configrepository.findall(); system.out.println("config size:"+config.size()); list<configpricing> configpricing=configpricingrepository.findall(); system....

xcode - create an attributed string out of plain (Android formated) text in swift for iOS -

i reading strings out of localizable.strings contains have in strings.xml of android app "testshort" = "a <b>short</b>\ntest another<b>bold text</b>"; the bold , and line feed 2 formatting attributes have in texts. trying develop method days without success: func converttext(inputtext: string) -> nsattributedstring { // here comes conversion representation helvetica 14pt , helvetica-bold 14pt including line feeds. } my final goal display text in uitextview's attributedtext. being kinda new swift , ios without knowing objective-c found difficult string manipulations quite different , complex , examples in objective-c. makes harder api methods not available or different in swift in objective-c... here tried far method body of lot of other posts here: var test = inputtext.datausingencoding(nsunicodestringencoding, allowlossyconversion: true)! attrstr = nsattributedstring( data: test, options: [nsdocum...

java - swing wait 3 second inside while loop -

this question exact duplicate of: swing retrieve data mysql db textfield 2 answers i have program data mysql db , show in textfield. i want show 1 record every 3 second. this code, connection conn = null; statement st = null; resultset rs = null; string dburl = "jdbc:mysql://localhost:3306/jointdb"; string dbusr = "root"; string dbpass = "a12345"; try{ string sql= "select * eridb "; class.forname("com.mysql.jdbc.driver"); conn = drivermanager.getconnection (dburl,dbusr,dbpass); st = conn.createstatement(); rs = st.executequery(sql); // textfield1.settext("enter text here"); while(rs.next()){ string value = rs.getstring("id"); textfield1.settext(value); } }catch(exception e){ e.printstacktrace(); }finally{ ...

Is there an '@' equivalent in php? like we have @"C:\Users\Documents" in C# -

every time specifying path, have add additional '\' characters. there way can have specify path $path=@"c:\users\documents";//need php instead of $path="c:\\users\\documents"; thanks in advance sharing inputs note: not looking dirname(). yes, using single quotes $path = 'c:\users\documents'; this may useful: what difference between single-quoted , double-quoted strings in php?

node.js - Post request method on server calling twice. Why so? -

1st time, doing expected thing. don't know why calling again , though have undefined checks over, still printing. router.post('/:id?', function (req, res) { var id = req.params.id; console.log(id); if (id!== 'undefined') { debugger; console.log(req.method); console.log('body: ' + json.stringify(req.body)); console.log(req.body.query.tostring()); } if(req.body != 'undefined') res.render('index', { title: 'shisodia mimanshu', query: 'random query', text: 'success 111' + req.body.query }); }); output @ console: 1 post body: {"query":"hahahhahahha"} hahahhahahha post /1 200 55.494 ms - 1015 undefined post body: {} post / 500 13.445 ms - 1408 the response post method not sent reason getting 2 outputs.the server call ends once response sent client. , checking id null should changes 'undefined', 'undefined' st...

Run logstash forwarder and web as a daemon on ubuntu -

i using logstash-1.4.2. in don't standard monolithic or flat jar used case earlier. now, want start logstash forwarder service. bin/logstash -f logforwareder.conf above command runs in foreground. gets killed everytime close/exit terminal. similarly, logstash indexer how achieve same. bin/logstash -f indexer.conf web this command kills indexer once terminal closed. on ubuntu, don't forget have own configuration file @ /etc/logstash-forwarder (without .conf). { "network": { "servers": [ "logstash.server.ip:5000" ], "ssl ca": "/etc/ssl/certs/logstash-forwarder.crt", "timeout": 15 }, "files": [ { "paths": [ "/var/log/apache2/access_web1.log", "/var/log/apache2/access_web2.log" ], "fields": { "type": "apache", "environment...

ruby on rails - Display flash notices in various locations -

i have temp;late menu down lhs has search function restrict menu options. some times user may search option returns no results. when search returns no results display flash notice above search box communicate this. in addition menu flash use flash communicate normal messages associated form operations in main part of view such record save, user logged in etc. is possible display multiple flash messages on 1 view or there better way achieve this? i had resolved same scenario using flash ajax can use id or class selector update html in place in app. show flash using ajax add in application_helper def flash_display response = "" flash.each |name, msg| msg=msg response = response + content_tag(:div, msg, :id => "flash_#{name}",:class=>"alert alert-danger") "#{msg}".html_safe end end flash.discard response end create js file show flash messages using id/class selector such .....

c++ - POD implications for a struct which holds an standard library container -

i came across this question recently. goal understand how c++ compiler views struct definitions hold standard library containers such std::vector. ben voigt's answer linked question cites following c++0x standard: .... a trivial class class has trivial default constructor (12.1) , trivially copyable. [ note: in particular, trivially copyable or trivial class not have virtual functions or virtual base classes. — end note ] a standard-layout class class that: has no non-static data members of type non-standard-layout class (or array of such types) or reference , .... i'm bolded text implies following undefined behavior struct { std::vector< sometype > myvec; int myc; a( int c ) : myc : (c) {} }; int main( void ) { one( 1 ); two( 2 ); sometype k, z; one.myvec.push_back( k ); two.myvec.push_back( z ); memcpy( &two, &one, sizeof( ) ); // bad juju } and same case any...

android activity - The getDecorView method return view include navigation bar view on lollipop? -

Image
i use slidingmenu implement slide-in menus. the code private void initslidingmenu() { // configure slidingmenu menu = new slidingmenu(this); menu.setmode(slidingmenu.left); menu.settouchmodeabove(slidingmenu.touchmode_fullscreen); menu.setshadowwidthres(r.dimen.shadow_width); // menu.setshadowdrawable(r.drawable.shadoew); menu.setbehindoffsetres(r.dimen.slidingmenu_offset); // menu.setfadedegree(0.35f); menu.attachtoactivity(this, slidingmenu.sliding_window); menu.setmenu(r.layout.menu_main_sliding); } then got problem layout behind of navigation bar. and change slidingmenu.sliding_window slidingmenu.sliding_content. it's works,but actionbar on top. look @ source code of slidingmenu,i find code add slidingmenu. switch (slidestyle) { case sliding_window: mactionbaroverlay = false; viewgroup decor = (viewgroup) activity.getwindow().getdecorview(); viewgroup decorchild = (viewgroup...

sql server - Do SQL synonyms work ok in multi user environment -

using mssql 2008 - have regular , archive table, same structure. depending on date range create synonym 1 or other table inside stored proc, use synonym further data processing. when 2 (or more) users concurently use stored procedure uses synonym different table, second user overwrite global synonym pointing fist user or synonym first user unchanged during execution of stored procedure? if second version true, synonyms not seem suited multi user , dynamic synonym creation environment or missing something? a synonym merely way have 1 name point @ another. don't know you're expecting, user accesses synonym name accessing underlying object synonym points to. which, in interpretation of "working in multi-user environment", means works.

android - Sequentially show multiple dialogs -

depending on different parameters (gps off, internet not available, etc.) it's quite possible app shows multiple dialogs on application start. doesn't nice if multiple dialogs pop , can see dialogs underneath it. that's why wondering if possible queue dialogs (by system) , open 1 after when current 1 has been closed. i looking solution can open next dialog in onclicklistener not option. prefer global solution (not app start , selected amount of dialogs). you might opt use cumulative dialog. it's normal dialog in put string like: string info = "gps: connected\nwifi: not connected\n\nbattery: 45%"; (just make example). this way you'll concatenate messages in single string, using \n (new line) connector (make double, separate inconsistent info - such battery status, in example). what you'll single information panel . (in example): gps: connected wifi: not connected battery: 45%

php - Codeigniter Can not send email there are some error when hosting -

my project work fine in localhost of pc, hosted on server there errors. this function in codeigniter: function sendmail_confirm_register(){ $config = array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'myemail@gmail.com', 'smtp_pass' => 'mypassword', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => true ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); $this->email->from('myemail@gmail.com','mydomain.com'); $this->email->to('someone@gmail.com'); $this->email->subject('complete registration!'); $this->email->message('test message'); if($this->email->send()) { echo ...

delphi - Indy UDP Read Contents of Adata -

i using indy udp server read string of data. however, not know how work adata parameter. can around converting binary using bytetobin function below , convert hex using bintohex1 . feel stupid , works slow. know how can directly results without 2 conversions? thanks!! here codes: procedure tform1.idudpserver1udpread(athread: tidudplistenerthread; const adata: tidbytes; abinding: tidsockethandle); var buf: tidbytes; buffer: string; data_received: string; begin if bytestostring(adata) <> 'hello' begin buffer := hextostring('00'); setlength(buf, length(buffer)); copytidstring(buffer, buf, 0); abinding.sendto(abinding.peerip, abinding.peerport, buf); data_received := bintohex1(bytetobin(adata[1]) + bytetobin(adata[2]) + bytetobin(adata[3]) + bytetobin(adata[4]) + bytetobin(adata[5]) + bytetobin(adata[6]) + bytetobin(adata[7]) + bytetobin(adata[8]) + bytetobin(adata[9]) + bytetobin(adata[10]) + bytetobin(adata[11...

c++ - How to ensure std::call_once really is only called once -

some code i'm working uses std::call_once initialization occurs once. however, there global objects constructors can end calling initialization code. in following sample, call_once gets called twice. guess it's because once_flag constructor hasn't ran before gets used. there way around initialization code gets called once without having prohibit globals? #include <mutex> #include <iostream> using namespace std; void init(); class global { public: global() { init(); } }; global global; once_flag flag; void init() { call_once(flag, []{ cout << "hello" << endl; }); } int main(int argc, char* argv[]) { init(); return 0; } output is: hello hello according specs, once_flag should have trivial constexpr constructor (for example see here - http://en.cppreference.com/w/cpp/thread/once_flag ). in place, if global/static, not "constructed" (no actual function executed), more ...

javascript - How to add Overlaying rectangular SVG blinking border to a particular marker(center) on Google Maps -

i have different names , latitude , logitude , want highlight particular marker blinking rectangular border, can add svg code particular marker. don't know svg code can 1 suggest how add. how add overlaying svg blinking rectangular border blinking particular marker, <html> <head> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="width: 1330px; height: 850px;"></div> <script type="text/javascript"> var locations = [ sthowbga01_atif_rnid_l015,24.31026,93.56268, swkhmrid01_bilf_rnid_l039,25.65182,91.62737, smokzunb01_gtlf_rnid_l006,26.019,94.53, sdimsgrn01_atcf_rnid_l023,25.8271,93.6853, skohkrma01_bilf_rnid_l010,25.5815,94.21959, ...

string - Make a C program that performs only three valid commands -

the commands case sensitive. following commands: add x,y; x , y literal integer values , add capital letters. add command not display result merely performs addition on whatever values there x , y. result of operation saved on special variable called ax. prt ax - display value of ax. exit – exits program. your program should continue asking valid commands user until user typed exit. example of valid inputs user: add 3,5 add 4, 3 prt ax exit example of invalid inputs user: add 3,4 add x,4 add x,y display ax prt ax prt y prt 4 exit i tried making unfortunately made add command. can't seem prt ax command. me please :( here code #include <stdio.h> #include <stdlib.h> #include <string.h> char str[20]; char cmd[10], x[10], y[10], zip[32], set[32]; int ax, i, j; int main (void) { while (str != 'exit') { scanf ("%[^\n]%*c", str); if (str != 'prt') { calc(); ...

jquery - Error when trying to get JSON data from a web service -

my customer provided me webservice link return json data. browsed , result. when created simple html page , using jquery ajax var mycallback = function (data) { alert("data:" + data); }; var url = "http://xxx/gettoken"; var params = { username: "abc", password: "123" } $.ajax({ type: "get", url: url, data: params, contenttype: "text/plain", datatype: 'jsonp', crossdomain: true, cache: false, success: mycallback, error: function (xmlhttprequest, textstatus, errorthrown) { alert(errorthrown); alert(xmlhttprequest.responsetext); }, async: false }); it return error "networkerror" tracked result fiddle, result shown browser ??? and when change url example to: var url = "http...

java - Cannot take view size using view tree observer -

i tying width , height of view in adapter, while view not yet inflated, using viewtreeobserver, end 0 values. width , height going used in method resizes bitmap of imageview in listview in adapter. here code: public view getview(int position, view convertview, viewgroup parent) { newview = convertview; viewholder holder; if (null == convertview) { holder = new viewholder(); newview = inflater.inflate(r.layout.selfie_list_view, null); holder.selfieview = (imageview) newview.findviewbyid(r.id.selfie_bitmap); holder.selfiename = (textview) newview.findviewbyid(r.id.selfie_name); newview.settag(holder); } else { holder = (viewholder) newview.gettag(); } selfierecord curr = list.get(position); string selfiename = curr.getbitmapname(); string selfiepath = curr.getbitmappath(); bitmap selfie = setpic(newview, selfiepath); holder.selfieview.setimagebitmap(selfie); holder.selfiename.settext(selfiename); return newview; } ...

perl - Using XML::Twig failure due to Expat module -

i using perl source compile , use dll of in tool. in trying embed xml::twig module in perl statically. xml::twig dependent on xml::parse need xml::parse::expat. using twig module function in scripts below: $filename = "c:\\log.xml"; $twig= new xml::twig; $twig->parsefile( $filename); # build twig $root= $twig->root; # root of twig (stats) @players= $root->children; # player list this usage internally calls parser module call expat throws error undefined subroutine &xml::parser::expat::parsercreate called @ expat.pm line 77. i have dynamically linked perl dll tool , linked expat.lib can please tell if problem getting because of way export parsercreate function resides in expat.lib ?

How to limit the characters in input field in crystal report -

i using crystal report 2008, have report , has input field called "departure_no". in input field can type maximum of 4 departure_no (eg: 2345,234,2345,23456), if exceeds limit(more 4 numbers-can count 3 commas(,)), input field should not allow type further. is there way achieve formula or else crystal report?? thanks in advance!! priya try below use alerts show message: showing on database field go report--> alert --> create or modify alert when window opened provide following: required name required message condtion when alert need displayed you can give condition if length(databasefield)> 4 //you need 4 chars hence condition true else false click ok. now message let me know of looking different

python - Invalid syntax. I save my text file on my desktop calling it file. -

create graph:- def loadgraphfile(file): graph = [] line in file: contents = line.split() moviename = contents[0] actornames = [contents[i]+ " " + contents[i+1] in range(1, len(contents), 2)] movienode = findnode(graph, moviename) if movienode == none: movienode = mknode(moviename) graph.append(movienode) actorname in actornames: actornode = findnode(graph,actorname) if actornode == none: actornode = mknode(actorname) graph.append(actornode) actornode.neighbor.append(movienode) movienode.neighbor.append(actornode) return graph def loadgraphfilename('file.text'): return loadgraphfile(open('file.text')) you declared function wrong: def loadgraphfilename('file.text'): # change return loadgraphfile(open('file.text')) to this: def loadgraphfilename(): # do...

css - how calculate top property for fixed element -

:) when dont set top/left properties element fixed acccured?? please see sample code: #fixed-menu{ background-color:#ba4444; border-top: 5px solid #0892cd; height: 60px; position: fixed; width: 100%; z-index:9999; box-shadow:rgb(128, 128, 128) 0px 5px 15px 0px; } #wrapper{ height:900px; width:960px; margin:0 auto; background-color:yellow; margin-top:100px; } <body> <div id="fixed-menu"></div> <div id="wrapper"></div> <body> above code,fixed-menu have 100px margin-top!!!!why????? ................... how calculated top property??? once element has been fixed position: fixed , 3 properties left , width , right determine horizontal position , size, relative window. (css uses more general word viewport; window example of viewport.) you need @ 2 of 3 properties, i.e., left & width , right & width , or left & right . sett...

MongoDB Connection for Spring Boot Application on Heroku -

what best way configure spring boot application connect mongodb on heroku? got working specifying spring.data.mongodb.uri in application.properties file, set connection up, can keep application pointing local mongodb during development, while being able push heroku without reconfiguring connection uri each time. thanks, jerry you use profile-specific configuration specify uris use during development , when deploying heroku. file named application-{profile}.properties loaded when matching profile active, i.e. use file named application-heroku.properties , enable heroku profile when deploying heroku. profile-specific configuration override default configuration in application.properties . can enable profile using spring.profiles.active , example: java -jar your-app.jar --spring.profiles.active=heroku

analytics - Integrate wurlf in web services java -

i search framework detecting device. have web services in jersey (java) , discover wurfl is possible integrate framework web services? or exists framework? well, of course is. has implemented java api, use that: http://wurfl.sourceforge.net/njava_index.php wurfl big xml file properties different devices, api helps work file.

xml - Getting an element that has specific attribute -

my xml looks this <data> <a messages="1"> <b messages="2" labelvisibility="yes"> <c messages="3"> </data> i want select element has attribute named labelvisibility. there 1 such element @ time. my attempt was: (assuming "a" xml file above) var b = a.selectsinglenode("//messages[@labelvisibility]"); according w3schools, expression: //title[@lang] selects title elements have attribute named lang so trying element has attribute name labelvisibility following example, code returns null. doing wrong? if there esier/smarter way 1 w3schools, please share. thanks -------------------------------update-------------------------------------..... i see wasn't clear , precise in question. want return is: `messages="another" in case want return attribute value`. if this: a.selectsinglemode("//@messages") it print messages="1" how can print at...

javascript - Sequencing two action on a button click -

problem: have asp.net button , on click of displaying window using window.open() @ client side using <script></script> "i actually, need popup(alert message) displayed on parent page button located once user closes child window." couple of things tried follows: i tried using settimeout() have time out milliseconds. not work control not waiting untill time out complete. proceeds execute next set of code. i tried using setinterval() reason not working me. below code snippet of that. . $(document).ready(function () { $('#<%=btnclick.clientid%>').bind('click', function () { var newwindow = window.open("http://www.google.com/", "google", 'resizable=1,width=900,height=800,scrollbars=1', '_blank'); newwindow.moveto(0, 0); var test = setinterval(function (e) { if (newwindow.closed) { alert(...

asp.net mvc - SaveChanges not setting value, selecting existing value instead -

when trying commit modified entry database, entity framework selecting values 2 properties opposed setting them. the code commit entity database follows: [httppost] [validateantiforgerytoken] public actionresult edit(till till) { if (modelstate.isvalid) { string username = user.identity.name.substring(user.identity.name.lastindexof('\\') + 1); till.modifieddate = datetime.now; till.modifiedbyuid_fk = db.users.where(m => m.name.tolower() == username.tolower()).first().useruid_pk; db.entry(till).state = entitystate.modified; db.savechanges(); return redirecttoaction("index/" + (int)session["siteid"]); } viewbag.siteuid_fk = new selectlist(db.sites, "siteuid_pk", "name", till.siteuid_fk); viewbag.modifiedbyuid_fk = new selectlist(db.users, "useruid_pk", "ehlogin", till.modifiedbyuid_fk); viewbag.createdbyuid_fk = new selectlist(db.users,...

opencv - Emgu Cv matchtemplate for millions of images in c#? -

image<gray, float> result = source.matchtemplate(template, emgu.cv.cvenum.tm_type.cv_tm_ccoeff_normed) i have millions of pictures source . taking lot of time. there solutions make quick? there 2 easy steps can take speed execution. parallelization using .net scale down target , model images. must done don't lose details in model.

stop / start windows service using findstr -

i need stop , start service when parameters met in .txt file. when app can't connect database in our test environment (regular occurence) generates following file type in server folder (file date changes each occurence) selftest-20141126181000-red.txt within file phrase red: server failed start: unable open database: unable connect database every time generated, along phrase need stop , start specific service. i have never used findstr command think useful here. textfile needs wildcarding obviously, , results file generating data , time service stopped , started. following work? findstr "red: server failed start: unable open database: unable connect database” *red.txt if %errorlevel%==0 ( sc stop "my service" sc start "my service" echo %date% %time% database >> results.txt ) plan have running through scheduled tasks every 30mins or so well, once have 1 such file, script continue find , restart service every 30 minutes. yo...

mongodb - How to get user information from a given ID and display it using Node.js and EJS -

i have home page uses ejs template, want display user's name (not user has logged in now) using user's id url the page called this: /home?id=235325325235 here part of home.ejs: <!-- want username or other info of user --> <p> hello <%= get.otheruser.name(id) %> </p> here part of routes.js // load user model var user = require('../app/models/user'); app.get('/home', function(req, res) { res.render('home.ejs', { id : req.query.id, otheruser : user.findbyid( req.query.id ), //error doesn't info need currentuser : req.user //ignore this, information of current logged in user }); }); but, happens if logged in user want view home page of user? he call home page id of other user, /home?id=43565476535 i need function gets information using id url how done node.js? to answer question, found way. app.get('/home', function(req, re...

symfony - Laravel Composer Update Error -

i having error when using composer update in cmd, stopping me installing new plugins website. {"error":{"type":"symfony\\component\\debug\\exception\\fatalerrorexception","me ssage":"class 'illuminate\\validation\\validationextensionserviceprovider' not f ound","file":"c:\\users\\noriel.mercado\\desktop\\xampp\\htdocs\\ofw\\vendor\\la ravel\\framework\\src\\illuminate\\foundation\\providerrepository.php","line":15 7}}script php artisan clear-compiled handling post-update-cmd event returned error and when run program or view it, laravel returns error. class 'illuminate\validation\validationextensionserviceprovider' not found i need help, there there knows how fix it?

javascript - Loop the recordset returned using mssql in node.js -

i working on application in node.js using mssql package connecting ms sql database. using var ps = new sql.preparedstatement(conn); when call execute method on prepared statement recordset. ps.execute({[optional_input_params]}, function(err, recordset) now want iterate through recordset returned in callback. please suggest how can able iterate through result.

javascript - How to run same test file twice in protractor? -

i have situation want run same test file twice. let's have test1.js , login.js , define suite in such way in configuration: specs: [ 'test1.js', 'login.js', 'test1.js' ] so can see want run test1.js twice, protractor runs test1.js, login.js , finishes. have idea how can achieve this? regards adam protractor globbing of specs file patterns list of tests should run, there's no way make work via list of specs. instead use node's require organize tests: // in configuration file specs: [ 'thetest.js' ] // thetest.js require('test1.js')(); require('login.js')(); require('test1.js')(); // test1.js module.exports = function() { describe(...) };

odata - DataServiceContext don't read related entities into the entity object -

i'm making call odata v3 webapi, expanding related entities follow: var cenarioinvestimentoescolhido = container.cenariodeinvestimentoescolha.expand("cenariodeinvestimentocenario,cenariodeinvestimentocenario/cenario,cenariodeinvestimentocenario/aeronave").where(c => c.cenariodeinvestimentocenario.cenariodeinvestimento.aerodromo.codigoicao.equals(idaerodromo)).singleordefault(); this absolute uri generated expression: https://localhost/sac/webapi/odatawebapi/cenariodeinvestimentoescolha()?$filter=cenariodeinvestimentocenario/cenariodeinvestimento/aerodromo/codigoicao%20eq%20'snbr'&$top=2&$expand=cenariodeinvestimentocenario,cenariodeinvestimentocenario/cenario,cenariodeinvestimentocenario/aeronave and result set responded api: { "odata.metadata":"https://localhost/sac/webapi/odatawebapi/$metadata#cenariodeinvestimentoescolha","value":[ { "cenariodeinvestimentocenario":{ ...

php - In Fabrik forcing csv to export only whats on screen -

i'm using "fabrik" fabrikar(dot)com display table list. data has join statement , i'm using filters toggle columns. toggle function hides columns in list. when i'm exporting list hidden columns exported too. question "is there way export see on screen?".

python - django print loop value only once -

i have view getting list of appointments limit.. def hospitalappointmentview(request, pk, username, hdpk): todays_appointments = doctorappointment.objects.filter(hospital__id=pk, doctor__id=hdpk, appointment_date=today).order_by("-appointment_date")[:5] return render_to_response('doctor_appointment_list.html', {"todays_appointments": todays_appointments}, context_instance=requestcontext(request)) in template: {% appointment in todays_appointments %} <h3>{{appointment.doctor.username}}<h3> <tr> <td>{{appointment.appointment_date}}</td> <td>{{appointment.first_name}} &nbsp;{{appointment.middle_name}} &nbsp; {{appointment.last_name}}</td> <td>{{appointment.user}}</td></tr> <a href="{% url "all_appointments" appointment.hospital.id appointment.doctor.id%}"> see all</a> {% endfor %} its showing 5 appointments correctly exce...

ios - pasting content to a file - NSFileManager -

i want add contents file2(file2 contains content , should not replaced) file1. copyitematpath throws error file2 exists.is there way add contents file instead of replacing existing contents. if(![[nsfilemanager defaultmanager] fileexistsatpath:logpath2]) [[nsfilemanager defaultmanager] createfileatpath:logpath2 contents:[nsdata data] attributes:nil]; if ([filemgr copyitematpath: logpath1 topath: logpath2 error: &err]) nslog (@"temp move successful"); else nslog (@"temp move failed %@",err); this not possible nsfilemanager , can use -[nsoutputstream outputstreamtofileatpath:append:] ( documentation ) achieve this.

c++ - Invalid initialization of non-const reference of type -

in following code, i'm not able pass temporary object argument printage function: struct person { int age; person(int _age): age(_age) {} }; void printage(person &person) { cout << "age: " << person.age << endl; } int main () { person p(50); printage(person(50)); // fails! printage(p); return 0; } the error is: error: invalid initialization of non-const reference of type ‘person&’ rvalue of type ‘person’ i realize passing lvalue function expecting rvalue... there way convert lvalue rvalue using std::move or something? tried taking constant parameter, not seem work. simply make print function take argument const& . logically right doesn't modify argument. void printage(const person &person) { cout << "age: " << person.age << endl; } the actual problem other way around. passing temporary(rvalue) function expects lvalue.

Facebook api: how to obtain current app namespace? -

i want create open graph request need current app namespace. how can obtain current app namespace using javascript? have several apps (with different namespaces) , want avoid setting constant in code. you can use namespace field of app object: get /{app_id}?fields=namespace where {app_id} current app's id , or js sdk fb.api('/{app_id}', {fields: 'namespace'}, function(response) { console.log(response); });

html - height auto after div position -

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-9" /> <title>başlıksız belge</title> <style> #a01 { position:relative; left: 0px; top: 0px; width:720px; background-color:gray; height:100vh; } #a02 { position:relative; left: 0px; top: 0px; width: 720px; height: auto !important; display:block; background-color:orange; } #a03 { position:relative; left: 0px; top: 5px; width: 710px; height: 70px; margin: 0px 5px 5px 5px; background-color:brown; } #a04 { position:absolute; left: 5px; top: 80px; width: 710px; height: auto !important; background-color:blue; } #a04a { max-width:100%; } #a05 { position: absolute; left: 5; ...

hadoop - Oozie coordinator start date set to actual date -

is there way set start date of coordinator actual date? everytime want run coordinator have manually set start date of coordinator job: <coordinator-app name="my_app" frequency="60" start="2014-11-27t05:00z" end="2015-01-01t06:00z" timezone="utc" xmlns="uri:oozie:coordinator:0.1"> i want use kind of varaible set date date run coordinator: <coordinator-app name="my_app" frequency="60" start="${actualtime}" end="2015-01-01t06:00z" timezone="utc" xmlns="uri:oozie:coordinator:0.1"> how can set actualtime sysdate? tried use el function timestamp() not works or maybe use wrong. maybe there way set in .properties file variable? one idea pass sysdate shell script coordinator job thru command line. see if answer similar question works : oozie coordinator sysdate start time

java - Item in getView() method returns always the last one -

i created json parse simple adapter shows result. works fine need retrieve url convert in bitmap. it's listview, url isn't 1 one,two,three or more. each url need create bitmap can show image each element of list.. actually, before getview() method part can display in log urls correctly. enter in getview() url can show last 1 parse json. onpostexecute() part use this: @override protected void onpostexecute(jsonobject json) { pdialog.dismiss(); try { // getting json array url rating = json.getjsonarray(tag_item); for(int = 0; < rating.length(); i++) { jsonobject c = rating.getjsonobject(i); // storing json item in variable string name = c.getstring(tag_nome); string commento = c.getstring(tag_commento); string valore = c.getstring(tag_valore); urlimage = c.getstring(tag_urlimage); ...

excel - Subtracting 2 hours from a cell using VBA -

i need search column in such way if value in column "soccer", time should adjusted in column 5 2 hours (subtract 2 hours current time in column 5). format in column 5 dd/mm/yyyy hh:mm. i struggling subtract 2 hours , replace new time vba. any ideas? kp check formula, available on google. =if(upper(a1)="soccer",e1-(2/24),"no change") where, a1 column contains "soccer" e1 column contains "time"

Grails - Data Binding One to One Association Not Working -

i'm trying straight forward data bind involved 2 domain classes in 1 one association. here's 2 classes: class request { static hasone = [form: form] form form } class form { static belongsto = [request: request] string string } i following data binding (this demonstrate problem ... real data bind comes form): request request = new request() request.properties = ['form.string': 'string value'] however, end request object has null form property instead of request object has form object form property along string value. try this class request { form form } class form { static belongsto = [request: request] string string }

css - Retain HTML font color when printing - IE settings, NOT printer issue -

this has been driving me mad day. @ first went down print settings route before realising it's "print background colors , images" option in ie that's been tripping me up. the last test case code used: <html> <style type="text/css">body{font-family:courier;}pre{display:inline;}</style> <body> <b><font color="#ffff00">this test</font></b><br/> </body> </html> when viewed in ie "this test" displayed in bright yellow. when printing or print previewing it's rendered in i'd describe muddy yellow. same true if export pdf via virtual pdf printer. if enable "print background colors , images" correct yellow used, understand i've read option can't set programmatically. it's not yellow, many similar colors end same each other in print preview, , need shade things according error margin can't use ones different. so how round this??? don...

Git: Add commits from same branch to master -

Image
i have situation shown in picture: how move master head point top commit (added preferences) because cannot push remote repository says date (expected, since master not pointing recent commit) what about: $ git checkout master $ git merge --ff-only <hash of topmost commit>

vb.net - value of type integer cannot be converted to 1-dimensional array of integer -

im looking @ vb project. defines integer array: dim batchids integer() then tries populate array using method batchids = m_obatman.getbatchids(batchclassname) the method return array public readonly property getbatchids() integer() but line populating batchids giving me error: value of type integer cannot converted 1-dimensional array of integer. im not vb programmer im assigning array using method returns array. dont see problem. if change batchids integer , not array okay. getbatchids returns array dont understand going on. me here? the reason property returns array has no parameter. think using argument accessing 1 index of array (if batchclassname integer ). so write in way: batchids = m_obatman.getbatchids but seems not real/complete code since not compile. public readonly property getbatchids() integer() gives an: "'readonly' property must provide 'get'" but if add getter: m_obatman.getbatchids(batchclassname) ...

android - Child View items are not refreshing -

here's code expandable listview in each grouo has checkbox , textview. there's select checkbox, on click should change states of child view's checkboxes not happening. can explain why?? mainactivity.java public class mainactivity extends actionbaractivity implements onclicklistener { expandablelistadapter listadapter; expandablelistview explistview; list<string> listdataheader; static checkbox selectall; hashmap<string, list<string>> listdatachild; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // listview explistview = (expandablelistview) findviewbyid(r.id.expandablelistview1); selectall=(checkbox)findviewbyid(r.id.checkbox1); // preparing list data preparelistdata(); listadapter = new expandablelistadapte...