Posts

Showing posts from January, 2011

webpage - Stopping New page Auto Publish -

using kentico 9 when create new page , click save, automatically publishes page , makes live. possible create custom workflow that, while still saving page, puts draft/edit mode approval before moving on? you can use default workflow purpose. every kentico version/license has @ least basic workflow functionality. all need enable specifying scope. see https://docs.kentico.com/plugins/servlet/mobile#content/view/59637966 more information.

html - Outlook doesn't understand specific rules of my inline code -

my code ready, except thing. event if body have rule width:600px; outlook doesn't understand, same background-color: rgb(67, 153, 186); . can me please? <!doctype html> <head> <meta charset="utf-8" /> <title>newsletter</title> </head> <body style="flex-direction: column;rgb(67, 153, 186); max-width: 600px; background-color: rgb(67, 153, 186); font-family: "univers lt 45", sans-serif;"> <div style="background-color:rgb(67, 153, 186);"> <div> <h1 style="color: rgb(214, 196, 0);">news</h1> <p style="background-color: rgba(255, 255, 255, 0.2)">lorem ipsum dolor sit amet, consectetur adipiscing elit. vivamus dictum, urna nec vulputate molestie, neque leo ultricies mi, ut dignissim magna magna vitae ex. nunc eu massa purus. vivamus velit lacus, vulputate neque ut, faucibus tincidunt elit. sed volutpat,

python - Find number of breaks in a sequence -

i have program parsing allele sequences. trying write code determines if allele complete or not. so, need count number of breaks in reference sequence. break signified string of '-'. if there more 1 break want program "incomplete allele." how can figure out how count number of breaks in sequence? here example of "broken" sequence: >dqb1*04:02:01 ------------------------------------------------------------ ------------------------------------------------------------ ------------------------------------------------------------ --atgtcttggaagaaggctttgcggat-------ccctggaggccttcgggtagcaact gtgacctt----gatgctggcgatgctgagcaccccggtggctgagggcagagactctcc cgaggatttcgtgttccagtttaagggcatgtgctacttcaccaacgggaccgagcgcgt gcggggtgtgaccagatacatctataaccgagaggagtacgcgcgcttcgacagcgacgt gggggtgtatcgggcggtgacgccgctggggcggcttgacgccgagtactggaatagcca gaaggacatcctggaggaggaccgggcgtcggtggacaccgtatgcagacacaactacca gttggagctccgcacgaccttgcagcggcga----------------------------- -

How to create a mysql db with Laravel -

i'm using laravel 5.2. i've setup first migrations , want run them. video tutorial doesn't explain how create mysql db. know can manually in phpmyadmin there laravel way it? this install migrations table: php artisan migrate:install is there similar command create db? i'm thinking process should be: php artisan db:install (or similar command) install migrations table: php artisan migrate:install run migrations: php artisan migrate and rollback migrations: php artisan migrate:rollback nothing provided out of box make own command you: php artisan make:console createdatabase // note, in 5.3 make:command then in app/console/commands you'll find createdatabase.php . open sucker , let's make few changes: protected $name = "make:database"; then down below in file need new function: protected function getarguments() { return [ ['name', inputargument::required, 'the name of database']

java - Method Caller and Callee, circular class level method invocations -

what problems doing method caller , callee of 2 different classes doing circular class level different method calls. pass "this" reference, parameter other class instance method , callee doing further method invitation on caller passed parameter. one reason doing that, in factory class, different implementations needs different kinds of data, put data needed multiple contracts/interface methods , have caller implement them. if have 1 class easier implement encapsulation, different classes require different sets of data . following simple example of such, here studentservice calls mathclassscorer's topscorer method in turn calls studentservice's getstudentlist method. in complex scenario, might calling multiple methods of parent caller. public interface istudentdata { public list<student> getstudentlist(); } public class studentservice implements istudentdata { private list<student> studentlist; public string gettop() {

javascript - Dropdown inside Left Navigation menu doesn't open -

Image
i'm having issues drop-down menu put inside navigation menu. problems are: 1. menu doesn't open @ all 2. drop down menu's should open right not bottom (like picture) 3. links selected should change depending on selection default should option a, can click on dropdown option b, or c, etc. bonus drop down links should act tabs , change links under picture: i've been looking on place figure out how create dropdown menu 1 pictured above, can't seem find answer. i'm still new bootstrap, , appreciate advice on how can done thank you! the fiddle: https://jsfiddle.net/f4e42hex/2/ html: <div id="sidebar-wrapper2"> <!-- sidebar --> <div class="topfilter"> <input type="checkbox" style="vertical-align:middle;"> <div class="bs-example"> <div class="dropdown"> <a href="#" class="dropdown-toggle&quo

mysql - multiple case statements with same logic in when -

i want use case statement each column in mysql. logic inside when of each case statement same long list. there way write optimally. like case when cond1 'xyz' col1, 'xyz2' col2, 'uuy' col3 else null each column end. short answer: no long answer: kind of. can play either wrapping logic function , call each column (if applicable) or play dynamic query - dirty work. consider this: create table t ( alef varchar(100), bet varchar(100)); set @case := 'case when ''?'' = ''a'' 1 else 0 end'; set @sql := concat('select ',replace(@case,'?','alef'),',',replace(@case,'?','bet'),' t'); prepare stmt @sql; execute stmt; finally if you're lazy ;) can iterate through information_schema.columns view , dynamically create select statement s.t. along these lines: set @subcase := ''; select

php - Cannot use object of type MongoId as array -

im having problem printing out values inside 2d array using echo, works prefectly using print_r: print_r($array); the result of : array ( [0] => mongoid object ( [$id] => 57a789b7ce2350b40e000029 ) [1] => mongoid object ( [$id] => 57a72d35ce2350681200002b ) [2] => 3 ) however when try access values using: echo $similar[0][1]; //or echo $similar[0][0]; i error : 'cannot use object of type mongoid array' i have tried different types of loops here incase error triggered accessing values element number, got same error , im unsure why. appreciated :) since $similar[0] mongoid object, , want access $id must use $similar[0]->{'$id'}) in example elements 0 , 1 mongoid objects, while element 2 integer of 3. so how print them all echo $similar[0]->{'$id'}) # gives 57a789b7ce2350b40e000029 echo $similar[1]->{'$id'}) # gives 57a72d35ce2350681200002b echo $similar[2] # gives 3

java - How to Uninstall the Mobile App using Appium -

@beforesuite, i launching mobile app on emulator. after perform testing @aftersuite, want uninstall app, how can achieve ? just use "noresetvalue" capability while set them appium. it takes value, true , false when set false , uninstalls app , re-installs each time re-run suite java example: capa = new desiredcapabilities(); capa.setcapability("noresetvalue","false");

html - Excel Treeview Creation VBA -

i'm interested know if it's possible take use selection of data , create tree view out of it, formatted html. have excel worksheet following format. excel format , i'm looking have formatted tree view following i have code create treeview, it's going large tree , manually typing code generate tree take forever , chances repeating this. suggestions? edit think may have been little confusing, let me little more specific. i've got list of manual pages, each page nested under 1-6 nodes. have name of page , nodes nested under in excel spreadsheet. goal list these pages in treeview. view image of goal . i'm trying use vba create nodes automatically, don't have sort through nodes , type them out myself. hope helps.

r - Summaries for many Lists -

instead of writing summary(...) each list tried following code: test <- c('list1', 'list2') summary(test) since guess r functions read objects , objects vectors thought work not. knows why not working , how can summaries of lists in 1 command? you can use lapply loop on every element in list #sample data test <- list(mtcars, iris) lapply(test, summary) #[[1]] # mpg cyl disp hp drat #min. :10.40 min. :4.000 min. : 71.1 min. : 52.0 min. :2.760 #1st qu.:15.43 1st qu.:4.000 1st qu.:120.8 1st qu.: 96.5 1st qu.:3.080 #median :19.20 median :6.000 median :196.3 median :123.0 median :3.695 #mean :20.09 mean :6.188 mean :230.7 mean :146.7 mean :3.597 #3rd qu.:22.80 3rd qu.:8.000 3rd qu.:326.0 3rd qu.:180.0 3rd qu.:3.920 #max. :33.90 max. :8.000 max. :472.0 max. :335.0 max. :4.930 # wt qsec

html - How to prevent heading tags from inheriting hyperlink styles when setting up heading anchors -

apologies if newbie question. part of job convert traditional word documents online web documentation using google sites. the document migrating typically has contents page, chapters , sections etc. in html, have contents page provides clickable links various document sections , headings - doing html anchors. the problem: not wish text being linked to, inherit ensuing hyperlink styles. example: <div> <h1>contents page:</h1> <p><a href="#heading">section 1: introduction</a><p> </div> <section> <h1><a name="heading">section1: introduction</a></h1> <p>lorem ipsum dolor sit amet consectetur adipiscing elit dignissim lectus eu risus tortor facilisi class, eleifend faucibus morbi pretium bibendum lobortis tellus hendrerit sociis litora etiam aliquet pharetra.</p> </section> now heading tag appears hyperlink because of attribute, not want.

mysql - How to use Distinct Function through PHP in displaying unique value -

how display distinct values through php - resultant output unique the distinct function not having impact on line #__new_categories.cat_name cat_name here complete code <?php $db = jfactory::getdbo(); $query = $db->getquery(true); $c = $item->prod_cat_id; $query = "select distinct #__new_categories.cat_name cat_name , #__new_categories.cat_parent cat_parent , #__new_products.prod_name prod_name #__new_categories inner join #__new_products on #__new_products.prod_cat_id = #__new_categories.id #__new_products.prod_cat_id = $c"; $db->setquery($query); $results = $db->loadobjectlist(); foreach($results $row){ echo $row->cat_name; } ?> when echoing in cat_name displaying similar values honda honda honda honda honda honda ford ford ford ford ford ford how use distinct function in echo $row->cat_name; the problem comes inner joi

javascript - Converting date using Angular JS filter fails -

i using angular js filter format date on controller. user selects date uib-datepicker-popup . date want formatted using iso 8601 (yyyy-mm-dd) date format. log date picked user , sat aug 20 2016 00:00:00 gmt+0300 (eat) however use angular $filter this $filter('date')(new date(vm.my_date), 'yyyy-mm-dd'); and wind date 2016-00-20 here code on controller // logs sat aug 20 2016 00:00:00 gmt+0300 (eat) console.log(vm.my_date); var converted = $filter('date')(new date(vm.my_date), 'yyyy-mm-dd'); // logs 2016-00-20 console.log(converted); what doing wrong? when write mm in filter filter thinks mean minutes that. filter understand m s need uppercase understands mean month . changing filter from: var converted = $filter('date')(new date(vm.my_date), 'yyyy-mm-dd'); to var converted = $filter('date')(new date(vm.my_date), 'yyyy-mm-dd'); would fix issu

vb.net - Timer which impede its own functions to run unless being in step by step -

i have issue i'm stuck since last week, , despite of advises senior developer. i want send motorisation command motor com ports through timer. when step step or when add stopping point, okay! however, when let timer , program run themselves, motorisation command never happens! why? command should run far step step method does! i calling method envoi_commande_motorisation() without arguments. sends frames in specific format com port in order make motor move. yet seems never called when quitting debugging step-by-step. command contained timer_moto_tick(sender, e) timer_moto.tick timer made regularly verify motor @ right azimut, knowing position demande_etat_motorisation() . i changed frequency of timer 1000ms 3000ms step of 500ms each time didn't changed anything... i added button calls envoi_commande_motorisation() manually , works! yet, hand , want automatize it. here picture of crime scene: private sub timer_moto_tick(sender object, e eventargs) handle

c++ - Print to file from MPFR -

i want print result of calculation using mpfr file don't know how. mpfr used floating point operations high accuracy. print mpfr_t number use function: size_t mpfr_out_str (file *stream, int base, size t n, mpfr t op, mp rnd t rnd) i guess problem don't understand file* objects , how related fstream objects. if change my_file in mpfr_out_str line stdout number print screen i'd hoped don't know how file. #include <mpfr.h> #include <iostream> #include <fstream> using namespace std; int main() { mpfr_t x; mpfr_init(x); mpfr_set_d(x, 1, mpfr_rndn); ofstream my_file; my_file.open("output.txt"); mpfr_out_str(my_file, 2, 0, x, mpfr_rndn); my_file.close(); } it possible use std::ostream methods mpfr functions mpfr_as_printf or mpfr_get_str. requires additional string allocation. #include <mpfr.h> #include <iostream> #include <fstream> using namespace std; int main() {

javascript - AngularJS search input box with dynamic and functionable icons -

i'm learning angularjs , have search box, within box want 3 icons (magnifineglass, cross , spinner). first instance magnifineglass appear when input box empty, second instance spinner appear when user has entered characters input box , when search has gone through array output possible searches (just using timer now) "x" appear in third instance once possible searches returned, when clicked clear field , start over. this have far: <div ng-app="searchdemo" ng-controller="locationformctrl"> <div> <input type="text" class="clearable magnifineglass" ng-click="search()"/> <!--<i class="glyphicon glyphicon-refresh spinning"></i>--> {{ outputtext }} </div> fiddle - couldn't formatting work correctly on form put rest in fiddle. i tried make brief "clear field" example here . what struggling can represent icons text (outputtext) u

Persist session/cookies across successive get requests -

i running script needs execute several requests api using restclient gem. however, api needs cookies & session persisted in order function properly. i have this: # first request url = "http://example-api.com/first-endpoint?param1=foo&param2=bar request = restclient.get url, :content_type => :json, :accept => :json cookies = request.cookies # second request url = "http://example-api.com/second-endpoint?param1=foo&param2=bar request = restclient.get url, :content_type => :json, :accept => :json in order make second request work, need keep same session , cookies. using restclient, can send cookies in post request this: restclient.post post_url, {}, {:cookies => cookies} but couldn't find in documentation & on stackoverflow way request. how should proceed "keep" cookies alive between 2 successive requests ? i'm open using gem or technique if restclient doesn't support this. any appreciated ! note i

angular2 routing - Angular 2 Multiple router params -

assuming wish have following url: myurl.com/data/11-20-84-2 and each number appears in url router param can use component. is possible? the following didn't work: { path: 'view-score/:score-:number', this should want: { path: 'view-score/:score/:number',

php - Transfer money from one stripe account to another stripe account -

how can transfer money 1 stripe account stripe account ? following code here : \stripe\stripe::setapikey(platform_secret_key); \stripe\transfer::create(array( 'amount' => 1000, 'currency' => "hkd", 'destination' => {connected_stripe_account_id} )); but getting error: type: stripe\error\invalidrequest message: insufficient funds in stripe account. in test mode, can add funds available balance (bypassing pending balance) creating charge 4000 0000 0000 0077 card number. can use /v1/balance endpoint view stripe balance (for more details, see stripe.com /docs/api#balance). but in test account have transfer there around $3000 , still getting above error. see this: test-account-balance this happens me also. mistake was using live secret key. can check you using test connected account id (you have connect customer in test mode also. live , test connected ids different). you using test secret key testin

windows - Visual Studio C++ - How to avoid Visual C++ Redistributable Packages? -

this question has answer here: how make statically linked .exe visual studio express 2005? 4 answers when run program on freshly installed computer, tells me visual c++ redistributable package 2015 (namely, msvcp140.dll) needs installed on computer in order run dynamically linked program. i understand static linking solve problem - however, doubles size of executable. isn't there way suppress visual studio features redist package not necessary , still use visual studio compiler, i'm not used alternatives mingw etc. or redist package contain stl? can hardly imagine that. the 'redist packages' contain libraries. if don't use library functionality, not need them, otherwise there no way - can't call library function , don't have it. that means remove includes <>, , good. note if do use library functions, hardly option

Thymeleaf: add HTML to th:replace function -

i add html in th:replace function in thymeleaf, so: <div th:replace="elements/listview :: row (subtext='test<br />test')" ></div> my 'listview' template this: <div class="listview-row" th:fragment="row"> <span class="listview-subtext" th:if="${subtext != null}" th:utext="${subtext}"> </span> </div> it doesn't compile. of course want compile as: <div class="listview-row"> <span class="listview-subtext"> test<br />test </span> </div> .. html in place. there way that? thank in advance help. try this: <div class="listview-row" th:fragment="row(subtext)"> <span class="listview-subtext" th:if="${subtext != null}" th:utext="${subtext}">

javascript - How do I update compatibility.js in firefox? Referencing to PDF.js -

i have problem lot of people have permission denied in firefox call print method of window. i've done lot of searching , people can past updating compatability.js, can't find post saying how this. edit: error "permission denied access property print", know can fixed disabling pdf.js print blank page.

php - Storing large multiline text in sql in the same line arrangement as how it's inserted? -

i using php , mysqli. want store text , fetch text in same line arrangement how it's typed in "textarea" field. use <pre> tag. maintain format of text. example: <pre> lorem ipsum dolor sit amet, consectetur adipiscing elit. nam , ut sin t ill vendibiliora, haec uberiora certe sunt. et harum quidem rerum facilis est et expedita distinctio. sed quid sentiat, non videtis. est autem officium, quod ita fac tum est, ut eius facti probabilis ratio reddi possit. quod aute m meum munus dicis non equidem recuso, sed te adiungo socium. laelius clamores sofòw ille lebat edere compellans gumias ex ordine nostros. </pre>

visual studio - Load test result interpretation -

in visual studio i've got results of load test, , little bit confused how total percentage of passed tests calculated. consider following example |test__ | count | passed | |test 1 |10_____| 10____| |test 2 |50_____|50____| |test 3|40_____|40____| |test 4| 1_____|_0____| what result of total passed test? 75% or 0.99%? load testing running small number of test cases many times each. one, or small number, of executions of individual test case not mean that test has failed. numbers in question have: 101 tests executed. 100 tests passed. 1 test failed. hence (100/101)*100% passing.

delphi - Tvirtuaildrawtree how to place nodes in one row? -

Image
this follow other question here . as have been suggested in comment ask new question subject i have been suggested draw different images in row . goal beginning insert nodes side side have been told cannot done vdt not made purpose . makes me sure there way because see online project doing using same vdt here screen shot project with using resource viewer pe explorer found data of form object vdt: tvirtualdrawtree alignwithmargins = true left = 5 top = 5 width = 457 height = 227 margins.left = 5 margins.top = 5 margins.right = 5 margins.bottom = 5 align = alclient bevelinner = bvnone bevelouter = bvnone defaultnodeheight = 55 header.autosizeindex = 0 header.font.charset = default_charset header.font.color = clwindowtext header.font.height = -11 header.font.name = 'tahoma' header.font.style = [] hotcursor = crhandpoint taborder = 0

Java VisualVM (jvisualvm) tool throws warning "could not install some modules" at startup -

java visualvm (jvisualvm) tool throws warning "could not install modules" @ startup , doesn't start thereafter clicking jvisualvm warning screen ignore button. system details: 1. java version "1.8.0" java hotspot (tm) 64-bit server vm (build 25.0-b69, mixed mode) 2. os debian 7.8 64bit issue warning details below: warning - not install modules: org.netbeans.lib.profiler.common - none of modules providing capability org.netbeans.lib.profiler.common.profiler installed. org.netbeans.modules.profiler.api - module org.netbeans.lib.profiler.common need installed. com.sun.tools.visualvm.core - module org.netbeans.modules.profiler.api need installed. com.sun.tools.visualvm.core - module org.netbeans.lib.profiler.common need installed. com.sun.tools.visualvm.core - module named org.netbeans.modules.profiler/2 needed , not found. com.sun.tools.visualvm.host - module com.sun.tools.visualvm.core need installed.

tv - What exactly is a "Surface" class in Android? -

i have been trying long time render video on "surface" class using mediaplayer class. playing audio, not video. everywhere search, people talk surfaceview , surfaceholder have surface object. how crack blocker? this how tried, public class samplevideoplayer{ private uri murl; private surface msurface; private mediaplayer mmediaplayer; private context mcontext; public samplevideoplayer(context context, string url, surface surface){ murl = uri.parse(url); msurface = surface; mmediaplayer = new mediaplayer(); mcontext = context; } public void playvideo() throws ioexception { mmediaplayer.setdatasource(mcontext, murl); mmediaplayer.setsurface(msurface); mmediaplayer.setonpreparedlistener(new mediaplayer.onpreparedlistener(){ @override public void onprepared(mediaplayer mediaplayer) { mediaplayer.start(); } }); mmediaplayer.prepareasync(); } } adding session o