Posts

Showing posts from June, 2011

php - Blanks space between images in slider -

i making dynamic slider laravel. need slide content , image in database. have gap(white space) between slides. first image slides content, second blank , after sometime third image slides , after third image there blank page slide. i have 2 images in database , in folder. image should slides 1 after not happening. may have mistake in if else statement. my html code slider this,it works well <section> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> </ol> <!-- wrapper slides --> <div class="carousel-inner" role="listbox"> <div c...

angularjs - Apache storing cache of js file -

i updated web applications front end built in angularjs on remote server hosted on rackspace , server has previous version of same web app uploaded me 1 day before update . uploading done local ( git push ) -> bitbucket -> remote server ( git pull ) . after uploading reloaded web page in firefox still loading previous version , tried same in private window of firefox , new chrome window still loading previous version . tried these things : 1) upload used , git add --all git commit -m "my commit" git push origin master here origin bitbucket repository url of web app . on server did git fetch git reset --hard origin/master this works me every time , , php files updated after uploading files angularjs or js file's old version served . 2) checked if managerservice.js file updated on bitbucket ensure git push worked , there new version of file on bitbucket . 3) checked file on server using vim , managerservice.js file has new updated code on ser...

sql - 'Compact' SELECT results in mySQL -

is there anyway 'compact' results of sql query? the results like: +----+-----------+----------+-----------+-------------+--------+ | id | firstname | lastname | hobby | job | age | +----+-----------+----------+-----------+-------------+--------+ | 1 | john | doe | (null) | (null) | 30 | | 1 | john | doe | chess | (null) | (null) | | 2 | adam | jackson | (null) | accountant | (null) | | 2 | adam | jackson | (null) | (null) | 55 | | 3 | michael | smith | knitting | (null) | (null) | | 3 | michael | smith | (null) | banker | (null) | +----+-----------+----------+-----------+-------------+--------+ but this: +----+-----------+----------+-----------+-------------+--------+ | id | firstname | lastname | hobby | job | age | +----+-----------+----------+-----------+-------------+--------+ | 1 | john | doe | chess | (null) | 30 ...

Best practice for android to send a text string to server -

i making real-time location tracker android app. yes there lot of duplicate questions here scenario. device's latitudes , longitude changing continuously, have send data @ server every 2 seconds. http://myserver.com/tracker.php?lat=10&long=5&guid=123456 on other side device fetching location continuously every 2 second http://myserver.com/getlocation.php?guid=123456 i new in android development googled gcm, bacground services , asynctask. battery drain not issue now. , concerned background services too. best approach send , fetch data every 2 seconds ? using asynctask or else ? it depends, if server knows devices should fetch data, can best use google cloud messaging , though there might small delay not like. if want poll data in devices use separate thread (or asynctask thread wrapper code). additionally can use long polling see this question insight that. on server side, , still requires thread in app. inside separate thread can use runonuithr...

jsf - Creating master-detail pages for entities, how to link them and which bean scope to choose -

i have started learning jsf, sadly tutorials out there present log in or register section. can point me more in depth examples? 1 thing i'm interested in page presenting list of products . i'm on page home , press on page products can see latest products added. , every time visit page, product list created latest entries in database. how can handle this? one way solve create session scoped managed bean in place different entities updated through other managed beans. found kind of approach in tutorials, seems quite difficult , clumsy. which best approach solve thing this? correct usage of session scope in two-page master-detail user interface? what correct usage of session scope use session scoped data only, nothing else. example, logged-in user, settings, chosen language, etcetera. see also: how choose right bean scope? and every time visit page, product list created latest entries in database. how can handle this? typically use reque...

objective c - Wrong UITableViewCell height for some cells at first loading -

Image
i using uitableviewautomaticdimension calculate height table view cell. works fine me. cells, height returned 44 rather dynamically calculating height. on scrolling looking same cell, height recalculated perfectly. guess not have faulty constraints because, after scroll , correct cell heights manually, no constraint breaking warning shown afterwards. edit the below given screenshot of image(got messed when cropped, can see issue profile image.). first cell height calculated correctly. rest faulty. i have added following , worked fine. (cgfloat)tableview:(uitableview *)tableview estimatedheightforrowatindexpath:(nsindexpath *)indexpath { return uitableviewautomaticdimension; }

unicode - WordPress posts in a different language -

i have website in wordpress , want type posts directly in "gujarati" language. know cannot type directly, first type in ms word , copy , paste content in website...but when paste it, doesn't show correct language (it shows symbolic fonts)... got know somewhere posts typed in unicode fonts only so unicode fonts.. google translate/google tool kit can used.. able copy , paste in post. when hit publish/update post, content not shown in website. i have attached links... please view first link shows dashboard have pasted content(in unicode).. , second 1 place can read post in website can me this? please correct me if wrong somewhere or please give me suggestions or may alternate method this?... https://drive.google.com/file/d/0b7uzpxmcus7jehrya014dgzuqzg/view?usp=sharing https://drive.google.com/file/d/0b7uzpxmcus7jcegyowfmwnduthm/view?usp=sharing from can see, looks if permalinks have been screwed in process post names unicode characters. safest go chan...

ruby on rails - How to build several objects while adding association? -

rails 4.2.1, ruby 2.2.1 relations are: class region < activerecord::base has_many :translations, dependent: :destroy has_many :custom_properties, dependent: :destroy has_many :languages, through: :translations has_many :options, through: :custom_properties accepts_nested_attributes_for :custom_properties, reject_if: :all_blank, allow_destroy: true accepts_nested_attributes_for :translations, reject_if: :all_blank, allow_destroy: true end class customproperty < activerecord::base belongs_to :region has_many :options, dependent: :destroy has_many :custom_property_translations, dependent: :destroy accepts_nested_attributes_for :options, reject_if: :all_blank, allow_destroy: true accepts_nested_attributes_for :custom_property_translations, reject_if: :all_blank, allow_destroy: true end class custompropertytranslation < activerecord::base belongs_to :custom_property belongs_to :language end class option < activere...

Set visibility of dropbox files/folders as public or private using api php -

i trying implement dropbox apis using php in website sharing. using shares() able share link folder/file visibility "public". there method/api set visibility? thanks no, dropbox api doesn't expose way set visibility of shared links. we're tracking feature request though.

apache - Rewrite URL with .htaccess does not direct to the new URL -

i use .htaccess rewrite url options +followsymlinks rewriteengine on rewriterule ^book/([^/]*)$ /book.php?book=$1 [nc,l] this works great, , if type http://www.domain.org/book/title1 in browser's address bar takes me there. when click link on index page takes me old address http://www.domain.org/book.php?book=title1 it because don't have rules redirect. have way: options +followsymlinks rewriteengine on rewritecond %{the_request} \s/+book\.php\?book=([^\s&]+) [nc] rewriterule ^ /book/%1? [r=302,l,ne] rewriterule ^book/([^/]+)/?$ book.php?book=$1 [nc,l,qsa]

unable to write data in SDcard (lollipop) without user interaction android -

i working on sdcard dignostics functionality.i need perform sdcard read , write functionality in kitkat , lollipop device.there no direct way perform read , write in kitkat , lollipop. but able in kitkat following way: -->adb shell mkdir stoare/extsdcard/android/data/com.sample.demo(your package name) then can perfrom read write operations in com.sample.demo folder. for lollipop using documentfile class can perfrom read , operations need user interaction. now problem out user interaction need perform read , write,can please infrom alternate way above kitkat procedure. thanks in advance that design of lollipop. there no way workaround that. user interaction giving permission through saf anyway needed once. more info : how use new sd card access api presented android 5.0 (lollipop)?

javascript - Vimeo video not working on mobile site -

hello have embedded vimeo video in website. showing accurately when view website on desktop not showing on mobile. here link of website http://bit.ly/1ktfbbq please 1 has idea whats wrong here.? you have pro member vimeo generate mobile versions automatically

gulp sass watch task @import issue -

i wanted try gulp sass , run problems. have following sass directory: main.scss //all custom styling mixins.scss //custom mixins variables.scss //custom variables style.scss //file imports above bootstrap , fontawesome when run gulp, compiles , there no errors, correct sytle.min.css styling included. change 1 of watched files (main.scss || mixins.scss || variables.scss) 1 of following errors: "undefined variable", "no mixin named ..." accordingly. also if change , save main.scss no errors none of custom scss files included css, bootstrap fontawesome compiled. what wrong setup? gulpfile.js var gulp = require('gulp'), sass = require('gulp-sass'), notify = require("gulp-notify"), concat = require('gulp-concat'), minifycss = require('gulp-minify-css'), uglify = require('gulp-uglify'), rename = require('gulp-rename') bower = require('gulp-bower') merge = req...

spring - Filter specific packages in @ComponentScan -

i want switch xml based java based configuration in spring. have in our application context: <context:component-scan base-package="foo.bar"> <context:exclude-filter type="annotation" expression="o.s.s.service"/> </context:component-scan> <context:component-scan base-package="foo.baz" /> but if write this... @componentscan( basepackages = {"foo.bar", "foo.baz"}, excludefilters = @componentscan.filter( value= service.class, type = filtertype.annotation ) ) ... exclude services both packages. have strong feeling i'm overlooking embarrassingly trivial, couldn't find solution limit scope of filter foo.bar . you need create 2 config classes, 2 @componentscan annotations require. so example have 1 config class foo.bar package: @configuration @componentscan(basepackages = {"foo.bar"}, excludefilters = @componentscan.filter(val...

kartik checkbox X is not working inside kartik Tabs X -

i'm facing issue using checkbox inside tabx (another widget kartik). check box not rendered fully, instead showing loading symbol. anyone faced kind of issue? solution pls?

java - Retrieve multiple checkbox values from jsp in the spring controller class -

in table, i've row checkbox tells controller whether particular row of table has included or no. check box not have relation other rows. tried adding in following way : <form:form id="fee" method="post" modelattribute="clientform" commandname = "clientform" action="<%= request.getcontextpath().tostring()%>/addfee.do"> <table> <tr> <c:foreach var="type" items="${clientinfo}" varstatus="status"> <td><form:checkbox class="editable${ifeecount}" path="includefeevalue" value="false"/> </td> <td>feetype<c:out value = "${status.index}"/></td> <td>source fee<c:out value = "${status.index}"/></td> <td><form:input class="editable${ifeecoun...

.net - Export big amount of data from XLSX - OutOfMemoryException -

i approaching export big amount of data (115.000 rows x 30 columnd) in excel openxml format (xlsx). using libraries documentformat.openxml, closedxml, npoi. with each of this, outofmemoryexception thrown because representation of sheet in memory causes exponential memory increase. also closing document file every 1000rows (and releasing memory), next loading causes memory increase. is there more performant way export data in xlsx without occupy lot of memory? the openxml sdk right tool job need careful use sax (simple api xml) approach rather dom approach. linked wikipedia article sax: where dom operates on document whole, sax parsers operate on each piece of xml document sequentially this vastly reduces amount of memory consumed when handling large excel files. there's article on here - http://polymathprogrammer.com/2012/08/06/how-to-properly-use-openxmlwriter-to-write-large-excel-files/ adapted article, here's example outputs 115k rows 30 col...

javascript - Extjs refer to parent window from new window -

using extjs 5.0.1 have ext.toolbar.toolbar button. when click in button new window opened form inside. inside form need refer toolbar, using form.up('toolbar') don't work , return undefined . seems becouse new window not bind toolbar. don't want use getcmp becouse not using id property. have idea? you can use ext.componentquery.query find toolbar. using xtype toolbar ,it return array of objects. ext.componentquery.query('toolbar')[0]; if have more on toolbars,you can give unique itemid toolbar in config itemid:'buttontoolbar' . ext.componentquery.query('#buttontoolbar')[0]; similarly give unique name toolbar in config name:'buttontoolbar' . ext.componentquery.query('toolbar[name=buttontoolbar]')[0];

hibernate - How to handle DataIntegrityVilolationException while saving a list in Spring Data JPA? -

i using spring data jpa in spring boot application, mysql. there saving list of entities unique constraint on field. out of list of entities, there 1 entity throw dataintegrityviolationexception due unique constraint. noticed none of entities persisted in case, not violate unique constraint. should ideal approach in case entities not violate unique persisted ? of course can iterate list , save them 1 one. in fact simplejparepository doing underneath. @transactional public <s extends t> list<s> save(iterable<s> entities) { list<s> result = new arraylist<s>(); if (entities == null) { return result; } (s entity : entities) { result.add(save(entity)); } return result; } my code - entity : @entity @table(uniqueconstraints = @uniqueconstraint(columnnames={"name"},name="uq_name")) public class samplecontent { @id @generatedvalue private long id; private string name; //getter setters } ...

spring - Springboot sending logs to fluentd not working -

i need following problem. i have spring boot application , configure fluentd appender using logback . i've created file called logback.xml in src/main/resources following content: <?xml version="1.0" encoding="utf-8"?> <configuration debug="true"> <appender name="stdout" class="ch.qos.logback.core.consoleappender"> <encoder> <pattern>%date - %level - [%thread] - %logger - [%file:%line] - %msg%n</pattern> </encoder> </appender> <appender name="fluent_text" class="ch.qos.logback.more.appenders.datafluentappender"> <tag>dab</tag> <label>normal</label> <remotehost>localhost</remotehost> <port>24224</port> <maxqueuesize>20</maxqueuesize> </appender> <logger name="org.com" level=...

javascript - RegEx last space issue -

my regex = /\s+/ i want accomplish digits separated spaces. works, catches last space (since i'm splitting it, last space goes "" array element). "123 123 213" - works fine. "21 12 21 421 " - catches last space. how can fix this? trim string before run regex , done.

actionscript 3 - Error #0 when trying to save file on iOS device -

i finished creating ios , android application air ( sdk 18 ) error #0 ( - inconsistable ) when trying save preferences file. code quite straightforward: private static var _file:file=file.applicationstoragedirectory.resolvepath(configfile); private static function savefile():void{ var filestream:filestream = new filestream(); if(file.applicationstoragedirectory.spaceavailable>1024){ filestream.open(_file, filemode.write); filestream.writeutfbytes(base64.encrypt(json.stringify(ob),strings.hashsalt)); filestream.close(); }else{ showlowspacealert() } } on android eveything works fine , on ios there no issues 50% of time ... know bug? thanks! do not try create file object static variable, static objects created during app init time , timing issues appear. problem due code logic. the correct way is: private static var _file:file; then: private static function savefile():void { if(!_file) { _...

Accordion jQuery, when in line it pushes the 2nd item down with it -

i have added jquery accordion, issue when click on picture drop down see list, pulls picture down next it. pictures stay inline, i'm not sure how this? http://www.vestedutility.com.au/test2.php#accordion-1 add float:left .location class has been assigned li li.location{ float:left } the above disturb structure , change padding below in usual position when without float:left li.location { max-width: 100%; width: 450px; display: inline-block; padding: 50px 100px; //change padding float: left; //keep float left } ps - habit add code question instead of link site link might broken someday. assist question piece of code

javascript - Angular JS - Express Routing -

i running mean framework express routing requests. have 2 main routes public/ , app . with app being api , public being set of web pages reads data api. // setting app router , static folder app.use(express.static(path.resolve('./public'))); i have 2 controllers in public folder, home , header. in home controller using angular js call api , return results. the api allows filtering through use of query strings: $http.get('http://search?sumboth=1&customer=' + customer) i build route specific controller along lines of http://url/customers/customername where customername set customer variable question a) best done in angular or express? b) , how implement such routing? i hope question received, please comment , if need more information. i understand response of $http.get('http://host/path?sumboth=1&customer=' + customer) list of search results. in case path should collection path, it's not best practice have sear...

c - Acessing a 2D array inside a function -

i have function accepts int* pinput[] argument. void process(int* pinput[], unsigned int num); i have call function via 2 methods as main() { int *pin[2]; int input[2][100] = {0}; pin[0] = ( int* )malloc( 100 * sizeof( int) ); pin[1] = ( int* )malloc( 100 * sizeof( int) ); process( pin, 2 ); process( ( int** )input, 2 ); } then how can access each value of pinput inside function 'process'?i cannot access directly pin[0][0]. how can access each value of pinput inside function 'process'?i cannot access directly pin[0][0]. no! can access way: pinput[0][0] if input pass pin . because pin array of int* s i.e. it's of type int *[n] each of element pointing array of int s. decay int** . however, if want pass input , 2d array of int s, you've more since 2d array doesn't decay double pointer, t** pointer array, t (*) [n] . because array decay not recursive, happens first level. alternatively, can ( live example ) pin[0] = input...

c++ - Set timeout for boost socket.connect -

i using boost::asio::connect on tcp::socket . when goes fine, connect returns on poor network, connect times out after log wait of 15 seconds. cannot afford wait long , want reduce timeout. unfortunately have not come across solution far. i see solutions async_wait been used deadline_timer examples receive / send operations , not connect. can me sample code boost::asio::connect(socket, endpoints); . requirement should timeout in 5 seconds instead of 15. have take following example? contains sample code async_connect timeout. http://www.boost.org/doc/libs/1_52_0/doc/html/boost_asio/example/timeouts/blocking_tcp_client.cpp the connect timeout method implemented using following code: void connect(const std::string& host, const std::string& service, boost::posix_time::time_duration timeout) { // resolve host name , service list of endpoints. tcp::resolver::query query(host, service); tcp::resolver::iterator iter = tcp::resolver(io_service_).resolv...

view - Android: getting width available within layout -

i'm wondering whether there way find out space available views within layout. to little more precise: in activity 2 textviews displayed side side. second 1 contains pretty text, i'd check, whether text can displayed on screen or whether it's large. if that's case i'll display smaller version of text instead (as android doesn't display text on multiple lines default). i'm using code this: windowmanager windowmanager = (windowmanager) getsystemservice(window_service); display display = windowmanager.getdefaultdisplay(); point screensize = new point(); display.getsize(screensize); int screenwidth = screensize.x; if (tvtitle.getwidth() + tvdescription.getwidth() > screenwidth) { tvdescrition.settext(getstring(r.string.descritption_short)); } but doesn't work: widths smaller screen, long version used. but: text isn't displayed completely, last words missing. i guess problem is, layout using padding , therefore reducing space available....

c++ - Create additional file descriptor that writes to terminal -

is possible create (from shell/bash or within c++ program) additional file descriptor stdout/stderr ? i.e. default should write output terminal , mix both outputs, if wanted redirect them selectively? my use case mpi-parallel c++ program running in multiple-program-multiple-data (mpmd) mode, i.e. several unrelated functional entities running simultaneously using different data sets. achieve default, output gets send terminal, able redirect 1 or more of output streams e.g. file. standard output , standard error have file descriptors of 1 , 2, respectively. when start program, file descriptors default inherited child process. thus, if open file descriptor (e.g. 3) before starting program, able use if special fd stdout or stderr. can open fd writing in bash: exec 3>/some/file note, however, while shells propagate open file descriptors children, programs spawn other programs may have policies. example, nohup redirects standard fds not touch others. other programs, wh...

javascript - how to set input focus on kendo-ui grid input inside bootstrap modal -

before moving kendo-ui grid inside bootstrap modal click on add row , first of 3 inputs selected. tab 2nd, 3rd , tab checkbox button press enter , row added. focus go add row button press enter start process on again. inside modal lost except tabbing. have found solutions use jquery apply focus have inside grid controller. kendo-ui grid controller $scope.maingridoptions = { datasource: datasource, pageable: false, toolbar: [{ name: "create", text: "add product", }], columns: [ { field: "product", title: "product", width: "95px", editor: producteditor }, { field: "price", title: "price", width: "95px", format: "{0:c2}", editor: priceeditor }, { field: "sqft", title: "square feet", width: "95px", editor: sqfteditor }, { command: [{ name: 'edit...

Tableau - Conditions on LOD Expression -

i have purchase_log table has following fields: uid, date, category, amount and know first , second purchases dates each user of each category. for example: +-----+------+----------+--------+ | uid | date | category | amount | +-----+------+----------+--------+ | | d1 | c1 | 100 | | | d2 | c2 | 200 | | | d3 | c1 | 120 | | | d4 | c2 | 300 | +-----+------+----------+--------+ for above user records, first purchase category c1 made on date d1, , second purchase category c1 made on date d3. i created 3 calculated fields: 1st purchase: { fixed [uid] : min([date])} repeat purchase: iif([date]>[1st purchase],[date],null) 2nd purchase: { fixed [uid] : min([repeat purchase])} but since there no distinction between categories, i'm not able see dates respect categories. how should solve problem? thanks. you can loding on both uid , category. 1st purchase: { fixed [uid],[category] : min([...

php - codeigniter dynamic field added on migration time -

i have 2 database called "migrate_new" , "migrate_old" , both have 1 table called "cms_pages". i want compare "migrate_old" db "cms_pages" "migrate_new" "cms_pages" table structure if "migrate_new" database "cms_pages" not have "field" alter table automatically. below code compare "migrate_old" "cms_pages" fields not in "migrate_new" "cms_pages" want add fields on table. want continue process in place of exit. **> 1 can have idea add fields automatically no need stop migration task? i not able field details type , key , etc. how know alter table use modify or add fields. short want set structure out loss of data automatically. in advance.. ** $this->load->database(); $admin_db = $this->load->database('admindb', true); $query = $this->db->get('cms_page'); ...

javascript - reverse a js condition -

i'm sure there many questions this, specific. i know how use ! operator in js, not expert, , have function written else, , can't figure out how reverse condition oposite of designed for. originally, function checks if ua mobile or not, , redirects if is - need redirect if ua not mobile. any appreciated! (function(a,b){if(/(android|bb\d+|meego).+mobile|android|ipad|playbook|silk|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|dev...

Android Material Design Theme picker color -

Image
i have material design theme in android. want change picker label , button color because appear in white color (colorprimary) can't it. this theme: <resources> <style name="theme.cuponisimo" parent="@style/theme.appcompat"> <item name="colorprimary">@color/azulcuponisimo</item> <item name="colorcontrolactivated">@color/azuloscuro</item> <item name="coloraccent">@color/azulcuponisimo</item> <item name="colorcontrolnormal">#ffffff</item> <item name="colorcontrolhighlight">@color/azulclaro</item> <item name="android:statusbarcolor">@color/azulcuponisimo</item> <item name="android:navigationbarcolor">@color/azulcuponisimo</item> <item name="android:textcolorprimary">#ffffff</item> </style> ...

swift2 - Utitableview extension block function not called in swift 2 -

i have made extension of uitableview. extension uitableview{ override public func awakefromnib() { super.awakefromnib() } func reloaddata(completion: ()->()) { uiview.animatewithduration(0, animations: { self.reloaddata() }) { _ in completion() } } } in swift < 2.0 work call: self.detailtableview.reloaddata{ //my code } in swift 2.0 function not enter inside block. try call function syntax: but have experience same issue. self.detailtableview.reloaddata({ () -> () in //my code })

Can we create module in prestashop 1.6 using modular approach? -

is possible create module follow modular approach? can create custom hook in prestashop 1.6? in prestashop version 1.6 able create own custom hooks. in module.php install() function can register new custom hook this: $this->registerhook('nameofhook'); to assign hook e.g. in template file. need add following code: {hook h='nameofhook' mod='yourmodulename'} note: in version 1.6 not neccessary anymore insert hook hooks table. presta automatically if registered hook doesn't exists now. for modular approach please have @ following links: http://doc.prestashop.com/display/ps16/creating+a+first+module http://doc.prestashop.com/display/ps16/coding+standards some other usefull links might be: http://doc.prestashop.com/display/ps16/managing+hooks

c# - Class with generic list of the inherited class type - multiinheritence -

i have asked question in link class generic list of inherited class type now, in following solution. in situation, how can list (descendents) of tvguid ? #region parentitem public class baseheaderfooteritem<t> t:class { public string title { get; set; } public string entitle { get; set; } public hyperlink link { get; set; } public int level { get; set; } public list<t> descendants { get; set; } } #endregion #region headerfooter public class headerfooter : baseheaderfooteritem<category> { } #endregion #region headerfooter public class category : baseheaderfooteritem<show> { } #endregion #region header public class show : headerfooter { public string imagepath { get; set; } public string mobilelink { get; set; } public string mobilelinktarget { get; set; } } #endregion #region tvguid public class tvguid : show { public string date { get; set; } public string time { get; set; } public int isactive { get; ...

java - Catch and logging for irrelevant operations -

i've method save timing information of each operation: public void queuetimerinfo(long start, long end, string msg) { try { timer.queue(start, end, msg); } catch (interruptedexception e) { logger.info(e.getmessage()); } } i call above method after each operation. matters operation itself, whereas timing secondary task. that's why decided not when method fails, except logging it. but told logging without managing exception bad practice. how should rewrite above code? if know consequences, i.e. timer.queue() call might interrupted , not queue data, , can live that, ok ignore exception. rules, need know when break them. however, document decision comment in catch block, whoever maintains code later knows not handling exception not oversight, deliberate decision.

c# - PowerShell Commands Adding EF Migration by Code -

wondering if can me solve this. i able use package manager console enable-migrations, add-migrations etc etc. want able using c# code via powershell object what have far is: var ps = powershell.create(); ps.addcommand("set-executionpolicy"); ps.addargument("unrestricted"); ps.addcommand("import-module"); ps.addparameter("name"); ps.addargument(@"'.\packages\entityframework.6.1.3\tools\entityframework.psm1'"; ps.addcommand("add-migration"); ps.addparameter("name"); ps.addargument("migration21sept"); ps.addparameter("projectname"); ps.addargument("context1"); ps.invoke(); but when execute code error stating: "the term 'add-migration' not recognized name of cmdlet, function, script file, or operable program" browse entity directory, shift + right click select "open powershell window here" dotnet ef migrations add "migrationname...

css - ImageResizer, azure cdn, cache busting and url rewrting -

i planning on using imageresizer dynamically resize images. images stored on azure blobs , accessed via cdn. at moment files paths inline , in css: <img src="/images/someimage.jpg" /> .backgroundimage { url('/images/somebgimage.jpg') 1) recommended way redirect image paths use cdn? i've seen people use html helpers (in asp.mvc @html.cdnimage('/images/something.jpg')) doesn't work images in css. 2) there url-rewriting in web.config given imageresizer uses querystring manipulate images, how go cache busting images after update , how point images use cdn? client-side redirects massively increase latency, , should avoided. can't use url-rewriting between different hosts. most css pre-processors support helper methods. if can't use helpers everywhere, manually insert cdn addresses. cache-busting cdn-specific. changing url works everywhere (unless disable querystring-specific caching on cdn). cdns offer invalidatio...

xml - Get node based on siblings value xpath query -

i want format nodes text in sibling node popularity less 8 <collection shelf="classics"> <movie title="the enemy" shelf="a"> <type>war, thriller</type> <format>dvd</format> <year>2001</year> <rating>pg</rating> <popularity>10</popularity> <description>talk war</description> </movie> <movie title="transformers" shelf="b"> <type>science fiction</type> <format>dvd</format> <year>1980</year> <rating>r</rating> <popularity>7</popularity> <description>science fiction</description> </movie> <movie title="trigun" shelf="b"> <type>action</type> <format>dvd</format> <episodes>4</episodes> <rating>pg</rating> <popularity>10</popularity...

sublimetext2 - How to encrease font-size of Command Palette in Sublime Text 2 -

Image
does know, how can make larger font in sublime text 2 "floating" window / command palette? solved upgrade sublime text 3. i'll recommend solution.

html5 - Set the min value of input type number to value of other input type number -

i have html code <form method="post" action="cashier.php" enctype="form-data/multipart"> <input required id="amount" type="number" min="0" class="form-control" name="txtamount" placeholder="enter payment here..." /> <input required id="cash" type="number" min="document.getelementbyid('amount').value" class="form-control" name="txtcash" placeholder="enter cash here..." /> <input type="submit" class="btn btn-primary pull-right" name="btnenroll" value="done" /> </form> if type 1000 on id="amount", id="cash" min 1000. but doesn't work. the straightforward way add onchange handler payment input, such as: <form method="post" action="cashier.php" enctype="form-data/multipart"...

jquery - How to identify if any script failure in a MVC web page -

we have web site open public customers. complaining button not working (on ie reported far). cannot regenerate in dev environment or live site. button calling jquery method seems doesn't hit method when issue occur. below method button should fire nothing reported in our logs coded. function getaddress() { if ($('#postcode').val() == "") { $('#postcode').addclass("txt_required"); return false; } else { $.post(serverpath + "issessionalive", { policyrefno: refno }, function (data) { if (data.session == 1) { $.ajax({ type: 'post', url: serverpath + "getpostcoderelatedaddress", datatype: 'json', data: { code: $("#postcode").val() } }) .done(function (data) { try { //console.log(data); $(...

TDD with reactjs, reactify, babelify, browserify, gulp -

i looking running test on project use : browserify with these transform : babelify reactify i did try combo jsdom + mocha testing component has not been builded yet fail on require call component : > mocha --compilers js:babel/register --recursive module.js:338 throw err; ^ error: cannot find module 'system/services/authservice' i think need run mocha test during gulp build watchify , build tasks. not sure if handling test during build process option. normaly, after successful build have file in client/build/js/bundle.js in es5. i want able test component using es6 file require browserify being readble testing lib. does provide me option, npm modules or me achieve tdd in environment ? maybe mochify fit use case. here's react example: https://github.com/mantoni/mochify.js/wiki/testing-a-reactjs-component-with-mochify

amazon web services - CloudWatch agent on windows stops sending IIS logs -

at work running couple of ec2 instances in amazon windows server 2012 , iis. setting iis logs , eventlogs etc sent cloudwatch works perfectly. the problem comes when add own things iis log want have on each line of accesslog, iis renames logfile "date_x.log" , when has "_x" in end of filename, ec2config service not roll on next logfile, stops @ 23:59 pm every day. if restart ec2config windows service picks new one, set scheduled task , had running on weekend when came work on monday morning, had stopped sunday night @ 23:59 pm. can no longer restart service pick new logfile. if change having no custom items in iis log works fine, not work us, need custom items. adding filter in json config file has no effect. any idea on going on , how can solve it? update: after leaving running issue going, appears agent not stop sending logs completely, instead skips every second day or so.

php - Creating object from parent class and call class from child class -

i have 1 class created huge , has many methodes. want slice separate child classes. i attempt this: class parentclass{ } class childclass1 extends parentclass{ public function childfunction1(){ } } class childclass2 extends parentclass{ public function childfunction2(){ } } $myobject = new parentclass(); $myobject->childfunction1(); $myobject->childfunction2(); not working. it's possible? there alternative solution? no, not work way. you're doing instantiating empty class , trying call methods on it. you should use composition instead. basic idea compose multiple objects main object. break off objects functionality. remember follow single responsibility principle , rest of solid.

javascript - AjaxComplete called to often -

i have code: $( document ).ajaxcomplete(function( event, xhr, settings ) { console.log('test'); }); i opened chrome network tab , can see 1 entry (status 200). but console displays: (28) test why executed often? the ajaxcomplete triggers when ajax request completed, if it's successfull or not. 200 status code means request has gone right, but, can read in jquery docs callback fire every time ajax request has finished. so, check url request redirecting , handle ones need. anyway ( side note ) use built-in ajax callback function complete , this: $.ajax({ url: url, data: { data }, complete:function(){ console.log('test'); } });

libusb crash when run as non root user -

backtrace : program received signal sigsegv, segmentation fault. 0x00007ffff7bca558 in add_to_flying_list (transfer=0x6527b0) @ io.c:1364 1364 struct libusb_context *ctx = itransfer_ctx(transfer); (gdb) bt 0 0x00007ffff7bca558 in add_to_flying_list (transfer=0x6527b0) @ io.c:1364 1 libusb_submit_transfer (transfer=transfer@entry=0x652848) @ io.c:1483 2 0x00007ffff7bcc779 in do_sync_bulk_transfer (dev_handle=0x0, endpoint=, buffer=0x613728 "\f", length=8, transferred=0x7fffffffe7c0, timeout=1000, type=type@entry=2 '\002') @ sync.c:174 3 0x00007ffff7bccb14 in libusb_bulk_transfer (dev_handle=, endpoint=, data=, length=, transferred=, timeout=<optimized out>) @ sync.c:257 4 0x0000000000402cfa in dm_usb_send (context=0x652010, msg_ptr=0x613728 ) @ rel/1.0/src/dm-usb-context.c:136 does 1 see kind of crash when run non root user ? (works fine when run root) i got crash because of permission issues.i have added myself plu...

jQuery adding dynamically autosize textarea -

i'm trying implement : https://github.com/jackmoore/autosize/tree/v1 it works expected when add textarea on html page, doesn't work expected if create textarea dynamically. can click "new comment" , test it. here's fiddle. http://jsfiddle.net/hcxgqhae/6/ html <!-- regular textarea, works --> <textarea></textarea> <br> <button type="button" class="btn btn-success new-comment">new comment</button> <div class="detailbox"> <div class="actionbox"> <ul class="commentlist"> <li> <div class="commenterimage"> <img src="http://lorempixel.com/50/50/people/6" /> </div> <div class="commenttext"> <p class="">hello test comment.</p> <span class="date sub-text"...

Linking Freetype library to Xcode project -

i'm having trouble using freetype library in xcode project , have include @ top of code #include <ft2build.h> ; when build code, error 'ft2build.h' no such file or directory. had linked library 'libfreetype.dylib' , included following in 'other link flags' in build tab: '-l/usr/local/include/freetype2/'. i'm quite new xcode, , appreciate here highlight i've missed. many thanks, alex the issue putting (the necessary) -i/usr/local/include/freetype2 flags in other linker flags , linker doesn't care include files. instead modify header search path in build settings . you need modify library search path well, in order pickup library. avoid using other linker flags if can it.

osx - How do I zoom out in Internet Explorer via Parallels? -

Image
i using parallels test ie (ie11 starters). my ie browser @ huge resolution. how can 'zoom out'? if try , use command +/- magnifier application. not want. if change screen resolution thw indow , background change. not ie11 window. there no right-click zoom out when on ie11 (in windows 8.1) if shrink down parallels ie window text similar firefox window have shrink down (ie11 box on top right): the trick use ie's 'zoom' feature available within ie under settings small icon cog shown here on right:

How to access to an object data php cakephp 3.1 -

this cakephp 3.1 query result, whant access directly $data->items error saying key item not found , don't whant use funtcion toarray() because if return 'items' => ... , lost 'query' => ... informations. can me right syntaxe $data->items or $data->{'items'} ... . $data = object(cake\orm\resultset) { 'query' => object(cake\orm\query) { '(help)' => 'this query object, results execute or iterate it.', 'sql' => 'select posts_types.id `posts_types__id`, posts_types.name `posts_types__name` posts_types posts_types order id asc', 'params' => [], 'defaulttypes' => [ 'posts_types.id' => 'integer', 'id' => 'integer', 'posts_types.name' => 'string', 'name' => 'string' ], 'decorators' => (int) ...