Posts

Showing posts from May, 2011

javascript - Adjust height of owl-carousel -

currently owl-carousel have employed in website far tall, takes more full screen. demo on owl-carousel 1 image per slide appears possible adjust height. using latest version of owl carousel 2. tried wrapping carousel in div , adjusting height of outer div. have noticed can adjust width, has effect of adjusting height. however, adjust height without adjusting width. have attached javascript , html. thanks. <body> <div id="navigation"> <ul> <li> <%= link_to "about", pages_about_path, id: "about-link"; %> </li> <li> <%= link_to "contact us", pages_contact_us_path; %> </li> </ul> </div> <div class="wrapper"> <h1><img src="http://cdn-0.famouslogos.us/images/computer-logos/ab-computer-repair-logo.jpg"> </h1> <div id="carousel" class="owl-carousel owl-theme">

Matrix manipulation code performing unknown operations -

i having trouble understanding of following code. think middle section of code point out performing multiplication, not sure, can please explain me middle part of code trying accomplish? i understand input , output parts of array elements, not actual manipulations. i understand this: #include "stdafx.h" #include<iostream> using namespace std; int main() { int i,j,k,n; float a[100][200],t; cout<<"enter order of matrix-"; cin>>n; cout<<"enter elements of matrix"<<endl; for(i=0;i<n;i++) for(j=0;j<n;j++) cin>>a[i][j]; but following lines confusing: for(i=0;i<n;i++) { for(j=n;j<2*n;j++) { if(i==j-n) a[i][j]=1; else a[i][j]=0; } } for(i=0;i<n;i++) { t=a[i][i]; for(j=i;j<

API with SLIM PHP in LAMP Server with MSSQL database -

i have lamp server in ubuntu. worked on api's using slim framework , mysql database , working fine. problem cant connect api mssql. install freetds in ubuntu include in freetds.conf [myserver] host = myhost port = myport here's connection: function getconnection() { $dbhost="myserver.database.windows.net"; $dbuser="user"; $dbpass="mypass"; $dbname="mydb"; $dbh = new pdo("dblib:host=$dbhost;dbname=$dbname", $dbuser, $dbpass); $dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception); return $dbh; } here's api in slim: $app = new slim\app(); $app->get('/clients', 'getclients'); $app->run(); function getclients() { $sql = "select * mytable"; try { $db = getconnection(); $stmt = $db->query($sql); $clients = $stmt->fetchall(pdo::fetch_obj); $db = null; echo '{"client": ' . json_encode($clients)

phpexcel save file to server ubuntu -

i'm problem share see if can provide help. php excel use ubuntu , want guaradar file generated in specific folder of project directory. understand looking information made follows, not working properly. code follows: header('content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); //header('content-disposition: attachment;filename="reportesuscriptores.xlsx"'); header('cache-control: max-age=0'); $objwriter = phpexcel_iofactory::createwriter($objphpexcel, 'excel2007'); //$objwriter->save('nameoffile.xls'); $filename = (__dir__); $objwriter->save($filename . '/report.xlsx'); try other alternatives without success next block $objwriter->save('nameoffile.xls'); and can not save file generated excel in specific directory

.net - Impossible to get mouse input from a window in my own process -

i've been trying add video support image viewer application made in .net 4. after long research , many tests i've decided libvlc , free , supports large number of file formats (more windows media player, instance). there's wrapper library .net called meta.vlc seems work alright. simplicity, keep within 32 bit realm. problem comes when want process mouse events on video frame, drawn 1 of controls (i give library hwnd , apparently uses direct3d rendering). the library doesn't expose mouse events, said "hey! no problem! know enough win32 api sort out". first, i've thought intercept mouse messages form overriding wndproc . nope. thought implement imessagefilter.prefiltermessage . nope again. wm_lmousedown , other related mouse events do not reach form . somehow they're "eaten up" child window. i've used spy++ , established video window indeed within process , descendant of form: my control hwnd contains caption: "vlc (direc

c++ - MFC SDI read from an INI and update view string while changing attributes -

first time post, forgive improper etiquette may bring. my title briefly describes problem have. have school project start mfc application single document view , need display simple text onto view text comes simple ini file. lpctstr path = _t("c:\\users\\steve\\documents\\wheredatais.ini"); tchar inivalue[256]; getprivateprofilestring(_t("setup"), _t("introduction"), _t("file not found"), inivalue, 256, path); okay ini file contains this... [setup] introduction = here data up point, going well. next step grab 'static text box' created in resource editor , change data ini 'here data'. setdlgitemtext(stringtochange, inivalue); and works perfect. managed change wanted desired comes hard part. need bold entire string before using setdlgitemtext(stringtochange, inivalue); i have run many problems in last 5 days. have tried have run across on google , stack overflow. ran trying use rtf control? trying convert html

Wordpress theme only shows some custom classes -

Image
i have theme modified in test version of site. in test site theme looks , functions should, css, html, php run , displays no issue @ all. able export modified theme , moved live version of site, in there css , html not display should. weirdest thing me elements have custom css class added , others not. on test site: custom classes being mocomrow, mocompfullwidthrow, mocomparticlethreecolumn. on production: last 2 elements missing custom class first 3 not. are using cache plugin? if not, perhaps didn't transfer template file renders post markup.

vba - Excel Adding Worksheets -

i need create sub create worksheets based off of list of names in worksheet named allcities. list of city names starts in cell a2. worksheets need named after cell value in list, , should not create duplicate sheets. have far: sub addsheets() dim mycell range dim cities range sheets("allcities") set cities = sheets("allcities").range("a2") set cities = range(cities, cities.end(xldown)) end each mycell in cities if not mycell.value = vbnullstring sheets.add after:=sheets(sheets.count) sheets(sheets.count).name = mycell.value end if next mycell end sub it looks question around ensuring duplicates not created. think of 2 ways , have chosen believe efficient situation. remember names (chosen) - remember names of sheets in string can checked, not best solution if had large (25+ in length) city names across thousands of tabs, @ point suspect have different issues consider. create error handling proc check - call out second proced

jquery - Why does my text in html not move? -

i'm coding website, , i'm trying put text under banner along other elements nothing seems going down. https://gyazo.com/379cfa01780dddc112d06bd53a38e04b https://gyazo.com/c67ba5499d4ce188946094978f346c6a this code <!doctype html> <html> <head> <script type='text/javascript' src="jquery.min.js"></script> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> <link rel='stylesheet' href='bootstrap.min.css'> <style> #topbanner { position: relative; } #topbanner { display: block; margin-left:auto; margin-right:auto; } #topbanner:after { -moz-box-shadow: inset 0 0 180px #defeec; -webkit-box-shadow: inset 0 0 360px #defeec; /* paragraph cont

templates - Why can't enable_if be used on specialized parameter? -

i trying create partial specialization integral types. idea similar to: #include <type_traits> template <typename t> struct class { }; template <typename t> struct class<typename std::enable_if<std::is_integral<t>::value, t>::type> { }; this leads following error: error: template parameters not deducible in partial specialization: struct class<typename std::enable_if<std::is_integral<t>::value, t>::type> { ^ note: 't' it work if use template parameter: #include <type_traits> template <typename t, typename enable = void> struct class { }; template <typename t> struct class<t, typename std::enable_if<std::is_integral<t>::value>::type> { }; why need template parameter? in first case not specializing class. when write: template <typename t> struct class<typename std::enable_if<std::is_integral<t>::value, t>::type> { }; that t stil

frontend - Into @include Breakpoint not can insert @extend or other @include in Sass -

Image
i had take project had begun in project using sass , extension of breakpoints ( breakpoint-sass.com ), found following code compile gave me error: .main-menu { @include breakpoint(930px) { @extend %layout-adaptive; // error gulp } } the extend exists, tried in different ways, error happens include breakpoint inserting breakpoint. any idea if there alternative solution?

ruby on rails - resque-status and resque-scheduler for delayed jobs -

i used resque-scheduler delay jobs in previous code: resque.enqueue_in(options[:delay].seconds, self, context) now want include resque-status job have no idea how can work together. latest resque-status source code supports scheduler, in source code: https://github.com/quirkey/resque-status/blob/master/lib/resque/plugins/status.rb # wrapper api forward resque::job creation api call resque::plugins::status call. # needed used resque scheduler # http://github.com/bvandenbos/resque-scheduler def scheduled(queue, klass, *args) self.enqueue_to(queue, self, *args) end end but i'm not sure how use it. shall call samplejob.scheduled(queue, myclass, :delay => delay) instead of samplejob.create(options)? ====================================================================== also, there support resque-status (and other custom jobs): https://github.com/bvandenbos/resque-scheduler some resque extensions resque-status use custom job classes different api signature. r

jquery - Ajax get column table value to become a variable in javascript -

i want column table value become variable in javascript complete formula: 10 * vhasil_m * 32.03* 1000 / 5 . i have query this: select round(avg(cast(t_dtl.hasil_m decimal(6,4))),4) hasil_m t_hdr join t_dtl on t_hdr.headerid = t_dtl.headerid id_solvent ='naoh' , status='ok' , concentrate='0.0100' , date_start <='2016-05-01' , date_finish >='2016-05-01' the query result like: | hasil_m | | ----------- | | 0.0100 | i want above column value become variable formula, vhasil_m . to run query, i've created model: function getdata_naoh($datetest){ $result = $this->db1->query("select round(avg(cast(t_dtl.hasil_m decimal(6,4))),4) hasil_m t_hdr join t_dtl on t_hdr.headerid = t_dtl.headerid id_solvent ='naoh' , status='ok' , concentrate='0.0100' , date_start <='$datetest' , date_finish >='$datetest'"); if($result->num_rows()>0){ return

Python: search for a file in current directory and all it's parents -

is there inbuilt module search file in current directory, super-directories? without module, i'll have list files in current directory, search file in question, , recursively move if file isn't present. there easier way this? well not implemented, work use listdir list of files/folders in current directory , in list search file. if exists loop breaks if doesn't goes parent directory using os.path.dirname , listdir . if cur_dir == '/' parent dir "/" returned "/" if cur_dir == parent_dir breaks loop import os file_name = "test.txt" #file searched cur_dir = os.getcwd() # dir search starts can replaced path while true: file_list = os.listdir(cur_dir) parent_dir = os.path.dirname(cur_dir) if file_name in file_list: print "file exists in: ", cur_dir break else: if cur_dir == parent_dir: #if dir root dir print "file not found" bre

git - BitBucket cannot push, "fatal: The remote end hung up unexpectedly" -

when trying push new bitbucket repository, keep getting error: counting objects: 28, done. delta compression using 4 threads. compressing objects: 100% (28/28), done. writing objects: 100% (28/28), 10.82 mib | 7.29 mib/s, done. total 28 (delta 1), reused 0 (delta 0) error: rpc failed; curl 56 ssl read: error:140943fc:ssl routines:ssl3_read_bytes:sslv3 alert bad record mac, errno 0 fatal: remote end hung unexpectedly fatal: remote end hung unexpectedly up-to-date i same error in sourcetree well. tried messing config file increase buffer size shown below: git config --global http.postbuffer 524288000 i don't want use ssh on windows 10 without server use ssh from. rather push command prompt. should note folders able push repository others not. wondering do. noticed there post issue here , wanted state case have tried of these no avail. looking here. i'm pushing simple bootstrap website. i don't want use ssh on windows 10 without server use ssh

git - What are special files like CHANGELOG/LICENSE/VERSION/CONTRIBUTING/new_issue called? -

popular repository-hosting platforms github.com , gitlab enable use of special files (readme-files) readme / changelog / license / version / contributing (or similar eg ending in .md ) , offer direct links them or include them in project website according meaning. if want search available files in general (not 1 project/repo) should search for? what these files called? at least changelog counts readme according wikipedia . 1 call them readme-files . there additional files issue/pull request templates (eg issue_template github) or similar (depending on platform). if there no prevalent convention can start discussion ( https://github.com/kmindi/special-files-in-repository-root/issues/1 ) this question not listing available special files or respective file naming convention. naming conventions of changelog see example keepachangelog.com . not restricted git repositories, highly related because thats expect popular uses. what special files changelog/license/versi

javascript - $rootScope Event not working Angularjs -

i have declared $rootscope.$on function under myapp.run check token value in every authenticated page.but not working.i not understand why not working.please me. app.js myapp.run(['$rootscope','$state', '$location', 'loginservice', function ($rootscope,$state, $location, loginservice) { console.log(" under run => "); $rootscope.$on('routechangestart', function (event, next, current) { /*if route authenticated check if user has access token, else return login screen*/ console.log(event); if (next.$$route.authenticated) { var userauth = loginservice.getusertoken(); console.log(" usertoken => " +userauth); if (!userauth) { $location.path("/"); } } }); }]); code print on console "under run =>" not printing event object , not check if condition. be care of $ : $roots

c# - Conversion of word file to HTML and after some edit in HTML convert it back to docx -

i working on utility users come , upload word document application , assign specific persons, after assignment specific users come application , suggest changes formatting own , save it. , can download updated file reference. what doing achieving - step 1- while user uploading word file (docx/doc), code converting html file using below code - object filename; object missingtype = type.missing; object readonly = false; object isvisible = false; object documentformat = 8; //original file location application uploaded document future reference filename = configurationmanager.appsettings["wordfilepath"].tostring() + item.guid + item.documentextention; //html file location application save file html object htmldirectorypath = configurationmanager.appsettings["htmlfilepath"].tostring() + item.guid + ".htm"; //conversion process applicationclass applicationclass = new applicationclass(); applicationclass.documents.open(ref filename, ref readon

Use Panel.Click (of Dynamic Panels) event on Button.Click C# Windows Forms -

i have dynamically generated panels on form, every panel has multiple controls including textboxes, comboboxes , buttons. want catch values on "save" button not dynamically generated (its in form). i'm getting values code: private void getpanelcontrols(object sender, eventargs e) { panel allpanels = sender panel; panelname = itemsidselected[panelnamecounter] + "p"; //"p" identifies panel , there counter list if (allpanels.name == panelname) { foreach (control item in allpanels.controls) { if (item.name == (itemsidselected[panelcontrolcounter] + "t")) //"t" identifies textbox { itemsnamelistforinsert.add(item.text); panelcontrolcounter++; //panel has multiple controls } panelnamecounter++;

c++ - Why I cannot link this library? -

i'm trying compile flann_example.cpp flann library: #include <flann/flann.hpp> #include <flann/io/hdf5.h> #include <stdio.h> using namespace flann; int main(int argc, char** argv) { int nn = 3; matrix<float> dataset; matrix<float> query; load_from_file(dataset, "dataset.hdf5","dataset"); load_from_file(query, "dataset.hdf5","query"); matrix<int> indices(new int[query.rows*nn], query.rows, nn); matrix<float> dists(new float[query.rows*nn], query.rows, nn); // construct randomized kd-tree index using 4 kd-trees index<l2<float> > index(dataset, flann::kdtreeindexparams(4)); index.buildindex(); // knn search, using 128 checks index.knnsearch(query, indices, dists, nn, flann::searchparams(128)); flann::save_to_file(indices,"result

java - Generate Unique Object ID -

i'm trying generate new unique identifier each object in class, without using static nextid field increment. using create complications when unloading , unloading program. i came solution loop through objects in static method checking them unknown reason me, won't exit while-loop. i have been testing in ideone.com here trying create 5 objects begin with, though won't create one. without having go link view whole testing code, below method i'm using. public static int newrandomid() { int randomid = 0; boolean notunique = true; while (notunique) { randomid = (int) (math.random() * 999999 + 1); (example e : examples) { if (e.id == randomid) { notunique = true; break; } notunique = false; } } return randomid; } have made stupid mistake i'm blind see, or there reason isn't working? if need unique identifier (that need not sequentia

html - Font-awesome silly error: downloadable font: rejected by sanitizer -

downloadable font: rejected sanitizer (font-family: "fontawesome" style:normal weight:normal stretch:normal src index:1) source: http://192.168.1.254/theme/font-awesome/fonts/fontawesome-webfont.woff2?v=4.6.3 http://192.168.1.254/theme/font-awesome/css/font-awesome.min.css line 4 i keep getting above error. , tried lots of stuff found on internet. (hosting fonts on own server) cors issue mime type header config in web server other combinations of http headers , mime types can resolve issue nothing solved it. solution: remove "?v=4.6.3" , remaining tail block (font-awesome.css / font-awesome.min.css). @font-face { font-family: 'fontawesome'; src: url('../fonts/fontawesome-webfont.eot?v=4.6.3'); src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('../fonts/fo

html - angular - access the element from ng-disabled -

i want pass this (the element) - button controller ng-disable . here html : <button type ="button" class = "btn btn-default" ng-click= "open()" ng-disabled = "checkrowid(this)"> </button> and controller : $scope.checkrowid = function(btn){ console.log(btn); //undefined } the log shoes undefined , there way pass element button via ng-disabled ? there no direct way pass element via ng-disabled. can create 1 directive "disabled-ele" , put element disabling logic there. example code: .directive('disabledele', function() { return { restrict: 'ea', link: function(scope, element, attrs) { if(attrs.disabledele.tolowercase() === 'true') { element.attr('disabled', 'disabled'); } else {

php - Problems with buttons after Wordpress update/ Plugin update -

i don't have experience. can't use anymore these 3 buttons (the problem appeared after plugins update / wordpress update) initially click 3 buttons , open first button left , image change. none of these happens now. could me fix ? edit: www.daisytech.ro sorry forgot mention website edit 2: have backup on computer , can see how should work (i use back-up i've translated website , lose part of work image the slider using master-slider plugin. the master.js file in theme using jquery.tools.tabs, jquery.tools undefined . $.tools returns object guess problem scope of $ the fix wrapping entire contents of file in (function(jquery){ // contents of file })($);

How can I send/receive data to/from my samsung s3 to a (medical) device via an arduino board (wifi + usb)? -

i new using arduino board. connect samsung s3 medical device via ardunio board. the first idea send/recieve data to/from phone medica device via usb on arduino board , medical device recieve/send data from/to phone via usb on arduino board. the second idea send/recieve data to/from phone medica device via wifi on arduino board via usb , medical device recieve/send data from/to phone via usb on ardunio board. thanks proposed solutions. all problems, including 1 best approached in increments. in particular case, assume have arduino wifi shield , samsung s3. you don't mention medical device or how programmed. first, concentrate on how samsung talk pc via wireless. in doing learn lot how write code samsung , how write code pc/wireless connection. there sample applications this. next, identify how arduino board connected medical device , make same connection arduino pc. connection work. know there many examples of how this. next, samsung talk arduino boa

MySQL not returning null column joined value -

Image
i have these 4 tables: my expected result: this current query (helped here ) select a.no_registrasi, a.nama_ctki, b.nama_negara, concat('ra-', max(substring(c.id_rad, 4) + 0)) id_rad, concat('lab-',max(substring(d.id_lab, 5) + 0)) id_lab tb_registrasi join tb_negara_tujuan b on a.id_negara = b.id_negara join tb_radiologi c on a.no_registrasi = c.no_registrasi join tb_laboratorium d on a.no_registrasi = d.no_registrasi group a.no_registrasi, a.nama_ctki, b.nama_negara this result query: how result im expecting for? i'm unexperienced in advanced query this, apreciated. thank you. hope helps. select a.no_registrasi, a.nama_ctki, b.nama_negara, concat('ra-', max(substring(c.id_rad, 4) + 0)) id_rad, concat('lab-',max(substring(d.id_lab, 5) + 0)) id_lab tb_registrasi left join tb_negara_tujuan b on a.id_negara = b.id_negara left join tb_radiologi c on a.no_registrasi = c.no_registrasi left join tb_laboratorium

html - Floating divs not floating left -

okay, supposed in 1 139px height header , renders such in dreamweaver, view in browser menu div splits down onto second row. here's html: <div id="header"> <div id="header2"> <div id="title"> <a href="index.html"><img src="titleimg.png" border="0" /></a> </div> <div id="menu"> <div id="one"></div> <div id="two"></div> <div id="three"></div> <div id="four"></div> <div id="five"></div> </div> </div> </div> and here css: #header { top: 0; left: 0; position: fixed; height: 139px; width: 100%; background-image: url('headerbg.png'); border-bottom: solid 1px #797978; text-align: center;

multithreading - firebase - android - RunLoop in 9.0.0 -

firebase 9.0.0 calls listeners on main thread on android. i'd change , use custom executors. (i've read in previous firebase versions (2.5.2) there runloop class. i have not tried seemed entry point configure custom executors/threads.) is possible configure callback executors in 9.0.0 somehow? adding own executors not yet supported in 9.0.0. we're looking (re-)add support in upcoming release. keep in mind firebase database surfaces callback on main thread. network interaction , internals run on separate thread already. if want significant work in callback, moment you'll have use usual methods ( asynctask or 1 of brethren).

How to implement AutoSave functionality in Web Application(Spring MVC, Hibernate, Angularjs) using ThreadLocal Storage concept -

i have web application developed using spring / hibernate / angularjs. have requirement of autosaving data data cannot lost. client suggested implement threadlocal this. whatever user input on form saved in threadlocal storage after intervals, once user done entire form, user click on save button data saved thread local storage. if user closes browser data should retained somewhere , when user login again same data automatically populate form(jsp).

r - Extracting the outer-boundary of a set of grid points with some missing grids (holes) -

Image
this question generalization of this question. mentioned question working point set no hole. in present question want perimeter (outer boundary) of subset of near-regular grid of points of grid point in polygon missing (i.e., polygon hole). the sample data set on grids available here . i used r-code suggested answer in above mentioned question (with no holes). the following output of using codes: now want ignore holes in inside point set , want consider outer boundary of point set required polygon. any suggestion!! thanks. this slight variant on previous code works if there's holes finding loops , taking 1 largest x coordinate, must outside loop. unless loops touch... strictly perhaps should take loop largest area... note need use x , y in 1 of functions because of bug (i've reported) in igraph package. perimetergrid <- function(pts, maxdist=6000, mindist=1){ g = edgep(makegrid(pts, maxdist=maxdist, mindist=mindist)) ## there might holes.

python - Pandas: How to resample dataframe such that each combination is present? -

assume have following data frame: # data t = pd.to_datetime(pd.series(['2015-01-01', '2015-02-01', '2015-03-01', '2015-04-01', '2015-01-01', '2015-02-01'])) g = pd.series(['a', 'a', 'a', 'a', 'b', 'b']) v = pd.series([12.1, 14.2, 15.3, 16.2, 12.2, 13.7]) df = pd.dataframe({'time': t, 'group': g, 'value': v}) # show data >>> df time group value 0 2015-01-01 12.1 1 2015-02-01 14.2 2 2015-03-01 15.3 3 2015-04-01 16.2 4 2015-01-01 b 12.2 5 2015-02-01 b 13.7 what have in end following data frame: >>> df time group value 0 2015-01-01 12.1 1 2015-02-01 14.2 2 2015-03-01 15.3 3 2015-04-01 16.2 4 2015-01-01 b 12.2 5 2015-02-01 b 13.7 6 2015-03-01 b 13.7 7 2015-04-01 b 13.7 the missing observations in group b should added , missing values s

javascript - How can I write integration tests for chrome extension? -

i have written chrome extension loads in developer window. communicates loaded webpage , stores desired data in database. i want write automated unit test extension in node using selenium, phantomjs/chromedriver, mocha , chai. have written simple test using selenium, chromedriver, mocha , chai. failing right now. have attached error below. this how looks: client.js exports.client = require('/usr/local/lib/node_modules/webdriverjs').remote({ // settings // use webdriverjs create selenium client desiredcapabilities: { browsername: 'chrome', chromeoptions: { binary: '/applications/google chrome.app/contents/macos/google chrome', args: [], extensions: ['/users/divyanshu/downloads/stm_updated_20160308051700.crx'] } }, loglevel: 'silent' }); test.js var client = require('./client').client; var expect = require('chai').expect; describe('tes

How to show two or more label at centre of the container in codenameone -

Image
i new codenameone there option align label depends on label align bottom, top, right , left option? how align many labels @ centre of parent layout? here have attached code tried for: container center = new container(new borderlayout()); label des = new label((string) data.get("title")); des.setuiid("multiline2"); center.addcomponent(borderlayout.north,des); label author = new label((string) data.get("author")); author.setuiid("multiline2"); center.addcomponent(borderlayout.south,author); cnt.addcomponent(borderlayout.center, center); i getting outpul below image here have attached need project can please me how should requirement? this place labels in absolute center of container: form hi = new form("hi world"); hi.setlayout(new borderlayout(borderlayout.center_behavior_center_absolute)); container center = new container(new boxlayout(boxlayout.y_axis)); label line1 = new label(

email - PHP Mail freeze -

each time sent mail php site freezes 120 seconds before spitting out fatal error timeout exceeded. tried isolate issue creating site code: $to = 'my mail here'; $subject = 'invite'; $from = 'from our mail'; $message = 'asdf'; if(mail($to, $subject, $message)) { echo 'sent ' . $to; } else { echo 'error'; } but not work either. mail gets sent buggs me. how can debugg this? using apache on windows. try debug making php show error logs. can use below code placing @ top of php code as: <?php error_reporting(-1); ?> another thing noticed in email sending code not contain headers. headers necessary email functionality work properly. <?php $to = "testing@example.com"; $subject = "test mail"; $message = "this test email message."; $from =

jquery - Bind two selectors, one for addClass and the other on to removeClass -

as title says, how bind 2 selectors open/close (add , remove class) on div? simple html: <div> <a href="#" class="open">open</a> <div> <span class="close">x</span> </div> </div> some jquery: $(function() { var $open = $("a.open"); var $close = $("span.close"); $open.on("click", function() { var $this = $(this); if ($this.hasclass("active")) { $this.removeclass("active"); $this.parent("div").removeclass("is-open"); } else { $this.addclass("active"); $this.parent("div").addclass("is-open"); } }); $close.on("click", function() { // , close should remove active class div , remove active class "a". }); }); once again; if click on "a" open div , press "span" close div. best approach? you can use,

xml - CRM Chart filter -

i'm trying set filter chart , used base guideline crm chartguy's blog. i want show certifications of employee year , last years, set first filter in advanced find looks 'educations achieved on year' the chart importing no errors, still shows wrong information. expecting 1 of bars reduce total number of 1, since set filter achieved on year' the actual chart .xml of chart thank further help. best wishes florian

javascript - jQuery fullCalendar - calendar not showing on load in tabs -

Image
i'm working jquery fullcalendar show calendar. i'm working jquery tabs have multiple tabs. i want show callendar in first tab. have in jquery code: $(document).ready(function(){ $("#reservatiestabs").tabs(); if($('#calendar').length) { var dbevents = <?php echo $events; ?>; var calevents = getevents(dbevents); var calendar = $('#calendar').fullcalendar({ left: 'title', center: '', right: 'prev,next', weekends: false, defaultview: 'month', defaultdate: moment(), events: calevents, eventclick: function(calevent, jsevent, view) { displayevent(calevent, calendar); } }); } }); the problem calendar isn't loaded when page loaded. buttons loaded not calendar. how can fix this? update: i've tried following: $(document).ready(func

spring - controller not visible in swagger API page -

i migrated app java 8. controller wrote not visible in swagger api page. other controllers appear on page , cause no problems. a warning appears in logs: warn reflections.reflections: not scan file /path/mycontroller.class scanner typeannotationsscanner org.reflections.reflectionsexception: not create class file mycontroller.class caused by: org.reflections.reflectionsexception: not create class file mycontroller.class caused by: java.io.ioexception: invalid constant type: 18 swagger4spring-web version 0.3.2 this version of swagger uses org.reflections:0.9.8 inspect classes, not support java 8 operations, in particular stream operations might have used in new controller. when replace stream() operations standard-pre-8-java operations controller loaded.

c# - How to know image is used in which prefab -

Image
how know image used in prefabs? in project (modified project on ray wenderlich) below, have image named cat.png . use in myprefab.prefab . suppose i'm not project creator, how can find out prefab each image came from? this has been answered before . can find using code. put code below in start() function , click play stop. show prefab gameobject/cat picture belongs to. void start() { gameobject prefab = gameobject.find("cat"); object gameobject2 = unityeditor.prefabutility.getprefabparent(prefab); string prefabpath = unityeditor.assetdatabase.getassetpath(gameobject2); debug.log("path: " + prefabpath); } or without code: select object/cat hierarchy on inspector on right, click select , prefab name displayed , selected in project tab.

bash - Exec tag in Ant file -

i work bash script ant ant. want execute bash script inline build.xml file. bash script here for f in `cat lg-media-file-list` subdir=`dirname $f` mkdir -p ${destination}$subdir cp $f ${destination}${subdir} done can me? ant matrix dependency language while shell scripts procedural languages. purpose of matrix dependency language allow build description determine order of execution. procedural languages allow define order. you can embed scripting ant build scripts (usually using javascript), define customized tasks. i've been working ant since version 1.5 came out, , have done less 1/2 dozen times. last time defined filter task lowercase file names copied on war. (don't ask why files weren't cased correctly in first place). what trying accomplish? part of build process? if is, why not use defined ant tasks can this? attempting use ant procedural scripting tool? if so, you're asking whole lot of hurt. ant isn't made that. please

c# - Should I avoid hitting the database on tests as a shortcut to fill object with valid data? -

i have test suite works against dedicated copy of real database. application creates complex object filling database , lot of work create 1 "manually" or mocking 1 bring valid state. ran database query tests in order have valid object (not verify integrate database correctly). working blazing fast. after first call mssql caching , query ran in less 1 ms. are there arguments why should avoid doing this? if it's because speed when database on same network it's working fast? seems literature out there wouldn't recommend doing - why? edit - answer own question: "unit tests" means each test autonomous, if touch database 1 test modify , affect test. though transactions can solve it, it's still not quite in "spirit" of "unit tests" , make them bit cumbersome. should avoided not under circumstances, if have no choice i'll access database in transaction make sure won't affect other tests. this seems principle peo

java - Android text on image -

i working on android app , trying achive same functionality seen here place text ontop of picture , on 0:43 - 0:50 more text added smaller gets, has idea or guidance? in video example of functionality trying achieve btw thought placing textview on imageview programatically "print screen" view - possible? tnx in advance i need know if possible take "print screen" of layout programatically export image file ... if want image of view try using getdrawingcache bitmap of view can manipulate please. ... question how resize text in case it's going out of imageview bounds for can extend imageview , override onlayout adjust size of textview depending on size.

python - expand within notebook does not work as expected -

here attempts widget stay in center of screen window re-sizes. mean normal behavior of grid sticky='ew' frame packed expand , fill='x' . here demo code show mean: from tkinter import frame,button,label ttk import notebook root = frame() root.pack(expand=true,fill='both') nb = notebook(root) btn_f = frame(nb) button(btn_f, text="button packed").pack(pady=100,padx=100) # btn_f.pack(expand=true,fill='both') #makes no difference if removed lbl_f = frame(nb) label(lbl_f, text="this label in grid").grid(pady=100,sticky='ew') # lbl_f.grid() #makes no difference if removed nb.add(btn_f, text="button") nb.add(lbl_f, text="label") nb.pack(expand=true,fill='x') root.mainloop() my suspicion has discovered commenting out pack , expand. add method in notebook run it's own layout manager handle how frame placed in it? i'm asking how achieve affect of centering grid, demonstrated in first

c# - NullReferenceException when calling async method of mocked object -

i'm trying unit test loginexecute method of following viewmodel using moq public class loginviewmodel : viewmodelbase, iloginviewmodel { inavigationservice navigationservice; idialogservice dialogservice; iadminservice adminservice; public relaycommand logincommand { get; set; } private string _productid; public string productid { { return _productid; } set { _productid = value; raisepropertychanged("productid"); } } public loginviewmodel(inavigationservice navigationservice, idialogservice dialogservice, iadminservice adminservice) { this.navigationservice = navigationservice; this.dialogservice = dialogservice; this.adminservice = adminservice; initializecommands(); } private void initializecommands() { logincommand = new relaycommand(() => loginexecute()); } public async task loginexecute() {

Do we need backing fields in C# properties? -

note: not question auto-implemented properties. auto-implemented properties properties without logic in getters , setters while stated in code there logic. not duplicate since question different, , answer. however, insert specific logic code clearer. i see lot of this: private int _age; public object age { { if(user.isauthorized) { return _age; } } set { if(value > 0 && value < 120) { _backingfield = value; } else { console.write("non-valid age"); } } } but why need backing field? why no returning property shown below? public object age { { if(user.isauthorized) { return age; } } set { if(value > 0 && value < 120) { age = value; } else { console.write("non-valid age");