Posts

Wordpress custom menu for different categories -

how different menus different categories? when add new category through admin want custom menu generate dynamically. depending on mean simple , yes, possible , imho , simple . you can not however, afaik , in core wp ui. what need ,is create menus , , use conditionals, in specific is_category() ; in order display them : if( is_category( array( 9, 'food', 'bones' ) ){ // can use either id or slug... wp_nav_menu( 'a') } else if( is_category( array( 99, 'fur', 'flees' ) ) { wp_nav_menu('b') } else if( is_category( array( 'whatever' ) ) { wp_nav_menu('c') } else { wp_nav_menu('x') } please @ wp_nav_menu()

scala - Change language of text in template in play framework 2.1.1 -

i want user of application can change language in play2 (play 2.1.1, scala 2.10.1) web application. use @messages.get(...) in templates i18n. i have application.langs="en,ru" in application.conf. pass "en" or "ru" method: def index = action { ok(views.html.index()) } def changelanguage(lang:string) = action { implicit request => logger.logger.debug("change user lang : " + lang) val referrer = request.headers.get(referer).getorelse(home_url) redirect(referrer).withlang(lang(lang)) } routes: get / controllers.application.index /index controllers.application.changelanguage(lang ?= "ru") the template bunch (views.html.index): @()(implicit l: lang) @import play.i18n.messages ... <a href="/about">@messages.get("about")</li> ... <a href="index?lang=ru" id="ru"></a> <a href=...

latex - Best markup language for small articles, letters, resumes -

i have suggestion on right choice markup language. need write short technical articles, business letters , resume. desired output are: pdf html rtf/docx the following other requirements: right alignment of blocks use of symbols (for email, mobile address) table without borders page numbering , footer the following example of letter. language make it? not use word/openoffice because want generate documents starting data in mysql database. @ moment using latex moderncv style not consider tools such latex2word enough make rtf/docx output. -------------------------------------------------------------------------------------------------------------------------------------------------------- mark jeronimo, 54 campb...

html5 - UndoManager support in Firefox -

i'm little confused how use undomanager in firefox. according mozilla , firefox 20 has support it, can't figure out where. i've checked under document , objects , etc., can't find anywhere. i'm sure i'm missing obvious, can help? you have set "dom.undo_manager.enabled" preference use it, far, since spec still in flux.

php - Generate CSRF token dependig on datetime -

exists way in symfony 2 generate csrf token @ each rendering of form? in controller tried this: $request = $this->get('request'); if ($request->getmethod() != 'post') { $csrf = $this->get('form.csrf_provider'); $date= new \datetime("now"); $this->date = $date->format('y-m-d h:i:s'); $token = $csrf->generatecsrftoken($this->date); } elseif($request->getmethod() == "post") { $csrf = $this->get('form.csrf_provider'); $token = $csrf->generatecsrftoken($this->date); } $form = $this->createformbuilder() .... ->add('_token','hidden',array( 'data' => $token ))->getform(); if ($request->getmethod() == 'post') { $form->bindrequest($request); if ($form->isvalid()) { } } all time in request right token hash. afte...

c++ - Windows Netapi32 -

i accessing windows netapi32 using netapi32.lib , using c++ access api. having trouble retrieving computer name, 1 netfileenum here on file_info_3 structure here . in documentation says, fi3_username pointer string specifies user (on servers have user-level security) or computer (on servers have share-level security) opened resource. note windows not support share-level security.this string unicode if _win32_winnt or force_unicode defined. now, network running script in has indeed share-level security , not sure how list computer name. relevant code library includes: #pragma comment(lib, "netapi32.lib") #include <stdio.h> #include <assert.h> #include <windows.h> #include <lm.h> initiate structure: fstatus defined in code as, net_api_status fstatus , i/o structure. documentation here if fstatus successful return value nerr_success . if function fails, return value can 1 of following error codes. error_acces...

c++ - Adjusting contrast and brightness with OpenCV -

so trying increase both contrast , brightness opencv bit. doing: mat image_copy; cvtcolor(image, image_copy, cv_bgra2bgr); image_copy.convertto(image, -1, 1.3, 0.15); image though looks strange. has blue tint. red , blue colours inverted. red jumper blue , blue can on table red. why? i trying achieve same effect when set contrast 30 , brightness 15 here: http://camanjs.com/examples/