Posts

Showing posts from April, 2013

linux kernel - How MLO (minimal bootloader) works? -

i trying understand how mlo loaded on-chip of soc , minimal configuration. using ti dm8168 soc. i have gone through following link understand mlo or x-loader: http://omappedia.org/wiki/bootloader_project i got know rom code loads mlo (x-loader) on-chip ram of soc minimal configuration , loads uboot (universal bootloader), initiates linux kernel. my doubt here on-chip ram size 64 kb , mlo size 116 kb, how rom code loading mlo on-chip ram it seems dm8168 has more 64kib internal ram: explained in dm816x am389x psp 04.00.01.13 feature performance guide , has @ least 2 more blocks of internal ram, referenced omc0 , omc1, both being 256kib in size. those 2 banks can used u-boot according document: ocmc0 0x40300000 - 0x4033ffff ocmc 0 used rom code , u-boot. once linux kernel boots, ocmc0 free , kernel can use it. if ocmc0 should not used load u-boot if loaded using ccs. ocmc1 0x40400000 - 0x4043ffff ocmc 1 used rom code , u-boot. once linux kernel boots, ocmc0 fre

c++ - Symmetric template's arguments -

suppose have converting routine class. if can convert t class u , automatically can convert vise versa. i represent template class , specializations: template <typename t, typename u> class convert; template <> class convert<a,b> { static int param() { return 42; } } template <> class convert<b,a> { static int param() { return -convert<a,b>::param(); } } this works good, when need add new type routine, must add 2 specializiations. can reduce number 1 defining general reverse template class this: template <typename t, typename u> class convert { static int param() { return -convert<u,t>::param(); } } which work if have convert specialization? thanks in advance. here suggestion in comment elaborated: #include<iostream> #include<type_traits> struct a{}; struct b{}; struct c{}; template <typename ... args> struct convert; template <typename t> struct convert<t,t> {

big o - What is the overall Big O run time of Kruskal’s algorithm if BFS was used to check whether adding an edge creates a cycle? -

if kruskal's algorithm implemented using bfs check whether adding edge create cycle, overall big-o run time of algorithm be? it o(v * e + e * log e) . each bfs takes o(v) time because there v - 1 edges in tree(or less if tree not build yet) , run each edge( v number of vertices, e number of edges). o(v * e) in total. e * log e term comes sorting edges.

php - Download A File And Insert Values Into A Database -

<?php // force download file if(isset($_post['download'])){ $file = "images/dansyo_logo.png"; header("pragma: public"); header("expires: 0"); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("content-type: application/force-download"); header( "content-disposition: attachment; filename=".basename($file)); header( "content-description: file transfer"); @readfile($file); if(@readfile($file)){ echo'proceed'; }else{ echo'failded'; } } ?> <form method='post'> <button name='download'>download</button> </form> i have above code want code able download file , in same time insert values database.the code functioning i'm able download file.however,nothing echoed after file has downloaded or downloading. its not going echo since header send file brow

scala - How to add library dependency additionally for exact plugin during execution? -

i have in build.sbt librarydependencies += "postgresql" % "postgresql" % "9.1-901-1.jdbc4" withsources() withjavadoc() and this //liquibase liquibaseusername := "postgres" liquibasepassword := "postgres" liquibasedriver := "org.posgresql.driver" liquibaseurl := "jdbc:postgresql://localhost:5432/scala_app" liquibasechangelog := "src/main/liquibase/db.changelog.xml" seq(liquibaseplugin.liquibasesettings: _*) but after cmd > liquibase-status [info] compiling 5 scala sources c:\users\mstrokov\mstr\workspaces\other\spring-mvc-hiber-scala\target\scala-2.11\classes... [trace] stack trace suppressed: run last *:liquibasedatabase full output. [error] (*:liquibasedatabase) liquibase.exception.databaseexception: java.lang.runtimeexception: cannot find database driver: org. posgresql.driver [error] total time: 1 s, completed 19-nov-2014 11:58:07 and know should specify jdbc driver depend

r - Change default alignment in pander (pandoc.table) -

i switching pander of knitr-markdown formatting, because provides such great pandoc support. 1 of things not happy default center-alignment. marketing people may love it, technical reports horror. the best choice used hmisc use left alignment texts , dates default, , right alignment number of type. is there simple way globally set in pander ? library(pander) pander(data.frame( name = letters[1:3], size = 1:3, we.have.dates = sys.date() - 1:3 )) thanks kind words , great question. there's not yet documented feature in pander , can pass r function default table alignment . quick demo: > panderoptions('table.alignment.default', + function(df) ifelse(sapply(df, is.numeric), 'right', 'left')) > pander(data.frame( + name = letters[1:3], + size = 1:3, + we.have.dates = sys.date() - 1:3 + )) ----------------------------- name size we.have.dates ------ ------ ---

javascript - uploaded files are null -

i'm trying upload image via form crop in php file, when upload file doesn't seem upload. here's form: <form id="uploadform" action="cropnsend.php" method="post" enctype=”multipart/form-data”> <input type="text" id="inputname" name="inputname" value="name"><br> <input type="text" id="inputtel" name="inputtel" value="telefon"><br> <input type="text" id="inputmail" name="inputmail" value="email"><br> <input type="text" id="inputadr" name="inputadr" value="adresse"><br> <input type="file" id="inputpic" name="inputpic"><br> <input id="x" type="hidden" name="x" value="130">

objective c - CCCrypt decrypting in AES CBC works even without IV -

i have confusing problem, decrypting file encrypted using cccrypt's aes-cbc mode randomized, 16byte iv produces exact same output whether pass in same correct iv used encryption or none @ all. what expect: using null iv decrypting should not result in correct decryption. observe: using null iv results in same result iv used encryption. below sake of completeness, here's important code snippets, iv passed in 16-byte securely randomized nsdata. what not understanding here? cccrypt somehow figuring out iv encrypted data itself? couldn't find around in docs. - (nsdata *)encrypteddatafordata:(nsdata *)rawdata withkey:(nsdata *)key iv:(nsdata *)iv error:(nserror __autoreleasing**)error { size_t outlength; nsmutabledata *cipherdata = [nsmutabledata datawithlength:rawdata.length + kalgorithmblocksize]; cccryptorstatus result = cccrypt(kccencrypt,

c - Scope of a function when defined within another function -

what happen when function defined within function? difference between code 1 , code 2? code 1: #include<stdio.h> void m(); void main() { m(); void m() { printf("hi"); } } code 2: #include <stdio.h> void m(); void main() { void m() { printf("hi"); } m(); } when compiled code 1 in gcc compiler, got linkage error. when compiled code 2 , didn't error. got output "hi" . want know how compilation done, when write function definition within function. know when write function definitions not within function, wherever function definition, not error when call function. for example see below code: code 3: #include <stdio.h> void m(); void main() { m(); } void m() { printf("hi"); } in code 3 ,even though called function before definition, didn't show error , got output. why not happening code 1 . neither c nor c++ allows define funct

html - Add analytics to a desktop application -

i have developed desktop application using html 5 , node web-kit . i track parts of app , such how long used , clicks ect. i analytics system work both on , offline (storing data until on-line). is there use this? the google measurement protocol allows track can send http request. need generate unqiue client id group pageviews session (the part done javascript tracker not you) , can choose between various interaction types , related data added parameters in request google analytics server. as far offline capabilites, there "queue time" parameter allows send delayed calls ga. per documentation delay 4 hours @ (intended smartphones , tablets temporarily lose connection rather work permanently offline). in end depends data need - might send calls own server , log them in csv file , feed klipfolio or other dashboard solution (or use excel if expect low data volume).

How to release memory of mysql connection open when working on c# -

mysqlconnection con = null; con = new mysqlconnection(); con.connectionstring = @"connection_string"; mysqlcommand cmd = new mysqlcommand(); cmd.connection = con; try { con.open(); //its increasing memory size 4 mb ///--------------------------logic----------------------// ///------------------------------------------------------// con.close(); //it not work : memory not reallocate. } catch { } try use try - final block , close connections / commands on final block or use using statement use connection pool, connections re-used , amount of memory won't go higher amount. what observe here (not clearing memory when close connection), because if close connection gc won't collecting effective immediately, , won't trigger until application maxed out stack

asp.net - 3D Column chart not working with sliders in asp .net project -

i got errors while executing code. , dont know reason. iam trying implement 3d column chart in project in asp .net .i got chart while adjusting angles of 3d , ie alpha angle , beta angle chart nit redraing. please check code , me.please. code : $( document ).ready(function() { //3d column chart var somefunction3dcolumn=function () { $('#container').highcharts({ chart: { renderto: 'container', type: 'column', margin: 75, options3d: { enabled: true, alpha: 15, beta: 15, depth: 50, viewdistance: 25 } }, title: { text: <%= yeardatabar%> }, subtitle: { text: '' }, xaxis: { labels: { rotation: -45, style: { fontsize: '13

routing - Rails + Using Friendly ID for slug generation and creating trouble while accessing from DB -

facing strange problem respect slug in rails loading development environment (rails 3.2.13) 2.1.2 :001 > tutorial.last tutorial load (0.7ms) select "tutorials".* "tutorials" order "tutorials"."id" desc limit 1 => #<tutorial id: 3, title: "populating database’s seeds.rb", state: "publish", content_introduction: "<p>demo data</p>\r\n", slug: "populating-the-database-s-with-seeds-rb"> 2.1.2 :002 > tutorial.last.slug tutorial load (0.6ms) select "tutorials".* "tutorials" order "tutorials"."id" desc limit 1 => "populating-the-database’s-with-seeds.rb" in database show "-" replacing special character while accessing gives it. model def slug title.strip.downcase.gsub(/[:,'"%^&*+=<>.`~]/,"").gsub("’","").gsub(" ", " &quo

refresh or trigger javascript on window resize -

i using javascript make 2 child div's same height in parent div: $(function(){ var leftheight = $('.leftblock').height(); var rightheight = $('.rightblock').height(); if (leftheight > rightheight){ $('.rightblock').css('height', leftheight); } else{ $('.leftblock').css('height', rightheight); } }); when resize window 1 of divs getting lot longer again javascript doesn't work anymore. placed exact same script again in window resize function , solves problem! $(window).resize(function(){ // same script above again }); my question; there cleaner way can use script once refresh or trigger script again on window resize? sure, declare function , use in both handlers: function resizedivs() { var leftheight = $('.leftblock').height(); var rightheight = $('.rightblock').height(); if (leftheight > rightheight){ $('.rightblock').css('height', leftheight); } else{ $(

asp.net mvc - your application has redirected loops in MVC -

after writing code in global.asax error ocured. if keep break point check firing , spinning , browser outcomes above responce["your application has redirected loops"]. ` public class sessionexpireattribute : actionfilterattribute { public override void onactionexecuting(actionexecutingcontext filtercontext) { httpcontext ctx = httpcontext.current; // check sessions here if (httpcontext.current.session["username"] == null) { filtercontext.result = new redirectresult("~/account/login"); return; } base.onactionexecuting(filtercontext); } }` really funny why stupid error occuring again , again.any idea? remove actionfilter accountcontroller

How to insert at the very left of the line in vim? -

imagine editing code in vim, , wish comment out bar(); line: while (foo()) { bar(); baz(); } if press i# while on line, this: while (foo()) { #bar(); baz(); } however, our coding standards should have done this: while (foo()) { # bar(); baz(); } i can work around pressing 0i# instead (or putting map 0i in .vimrc more permanent fix) not repeatable . repeats i rather 0i . many other editors have options make home not "smart" , go column 0 rather trying work indentation. i've tried searching docs, have drawn blank — is there way in vim? alternatively, there way make bound command atomic, repeating . repeats whole thing rather last command of bound sequence? thanks use gi instead of i . from :help gi : gi gi insert text in column 1 [count] times. {not in vi}

Android 5.0 Lollipop: setColorFilter "leaks" onto other buttons -

i using setcolorfilter set color filter of 1 of button. has been working until android 5.0 lollipop update. now, color filter seems leak onto other buttons, when close activity , reopen (it resets if close app , reopen). my styles.xml (v21): (same older except here parent material, before holo) <style name="theme.fullscreen" parent="@android:style/theme.material.light.noactionbar.fullscreen"> <item name="android:buttonstyle">@style/standardbutton</item> <item name="android:windowtranslucentstatus">true</item> </style> my styles.xml (for versions): <style name="standardbutton" parent="android:style/widget.button"> <item name="android:background">@android:drawable/btn_default</item> </style> my button: <button android:id="@+id/mainmenubutton" android:layout_width="wrap_content" andr

c++ - Qt paintEvent crashes -

im trying draw simple board on widget. when i'm trying automatize this, paintevent crashes. think caused loop inside, right? how paint in other way? void widget::paintevent(qpaintevent *event) { qpixmap mypix( qsize(20,20) ); qpainter painter(this); for(int = 0; < 100; i+5){ painter.drawline(qpointf(i,0),qpointf(i,max)); } this->setpixmap(mypix); } your loop incorrect , causes program crash (i'm sure that's not fault here). should written this: for(int = 0; < 100; i+=5){ p.drawline(qpointf(i,0),qpointf(i,max)); } i.e. assignment of increment. way job , finish properly. on side note, suggest use drawpixmap() instead of setpixmap() . setpixmap() not cause infinite recursion , example next code works properly. //... this->setpixmap(qpixmap("g:/2/qt.jpg")); qlabel::paintevent(event); why? approach infinite recursion never produced (see here ): if call repaint() in function may called paintevent(), may infinite

c - What is the best approach when working with on-disk data structures -

i know how best work on-disk data structures given storage layout needs match logical design. find structure alignment & packing not when need have layout storage. my approach problem defining (width) of structure using processor directive , using width when allocation character (byte) arrays write disk after appending data follows logical structure model. eg: typedef struct __attribute__((packed, aligned(1))) foo { uint64_t some_stuff; uint8_t flag; } foo; if persist foo on-disk "flag" value come @ end of data. given can use foo when reading data using fread on &foo type using struct without further byte fiddling. instead prefer #define foo_width sizeof(uint64_t)+sizeof(uint8_t) uint8_t *foo = calloc(1, foo_width); foo[0] = flag_value; memcpy(foo+1, encode_int64(some_value), sizeof(uint64_t)); then use fwrite , fread commit , read bytes later unpack them in order use data stored in various logical fields. i wonder approach best use given d

WCF Express Interop Bindings for visual studio 2013 -

Image
isn't wcf express interop bindings template available visual studio 2013? if available, please share link. it not support visual studio 2013. please check below installation steps.. wcf express interop bindings walk through installation: download visual studio extension file here . double click on extension , chose install the extension supported on visual studio 2010 standard , greater . if had visual studio 2010 open, close , re-open it. you can verify installation checking extension manager in tools menu. pre-requisites .net 4.0 / visual studio 2010 standard edition or above (express not supported) wcf 4.0 visual studio 2010 sdk (necessary build source) download visual studio 2010 sdk download visual studio 2010 sp1 sdk i have vs2010 , vs2013 both installed plugin installer asking install plugin in vs2010. check below image:

html - How to allign text vertical and horizontal? -

i have layout want have text centered horizontaly , verticaly i tried (display: table-cell; vertical-align: middle) but when tried ruin layout: li {list-style:none;} h3 {margin:0px} p {margin:0px} ul {margin:0px; padding:0px} <li style="background:#263f73; border-style: dotted; border-width: 1px; height:100px;"> <div style="width:70%; float: left; "><h6 style="margin:0px;"><h3>text</h3></h6></div> <ul style="float: right; height:100%; width: 30%;"> <li> <li style=" height:50%; background:#ffffff;"><p style=" margin: 0px;"><div><p class="centertext">text</p></div></li> <li style=" height:50%; background:#fff465;"><p style=" margin: 0px;"><div><p class="centertext">text</p></div></li> </li> <

node.js - Node Tools for Visual Studio Mocha tests not finding Mocha module -

i have node project i've imported visual studio web storm. mocha tests run fine in web storm in visual studio don't run @ all. i've set test framework on relevant files , test discovery phase correctly locates them. when run tests green tick if modify system such must fail. if click on output test see error: ntvs_error: failed find mocha package. mocha must installed in project locally... i have installed mocha locally, uninstalled , re-installed no difference. i've managed more specific error information editing mocha.js file print out what's going wrong. problem occurs during detectmocha function. exception in log is: [error: cannot find module 'c:\projects\fastlanevs"\node_modules\mocha'] code: 'module_not_found' now assumption double quote after project directory problem. i've gone run_tests.js , printed out argv array see project directory coming , indeed it's appended time function called. now i'm ha

session - How can I restrict an external script to users that are logged in as an Administrator? -

i creating new page getting redirected administrator page in joomla 2.5.the page getting displayed when type url in browser . need restrict view such can visible when administrator logs account . can me on ? this code: define( '_jexec', 1 ); define('jpath_base', dirname(__file__) );//this when in root define( 'ds', directory_separator ); require_once ( jpath_base .ds.'includes'.ds.'defines.php' ); require_once ( jpath_base .ds.'includes'.ds.'framework.php' ); $app = jfactory::getapplication('site'); $user = jfactory::getuser(); if ($app->isadmin()) echo 'running joomla administrator site <br/>'; //$app->isadmin() through null value print_r($user); echo $user->username; when login site code works when login using administrator interface code display's null value. don't know why. there mistake in it? output when login using administrator interface: juser object (

javascript - Meteor - How to find out if Meteor.user() can be used without raising an error? -

i'm looking way determine if meteor.user() set in function can called both server , client side, without raising error when not. in specific case use meteor server's startup function create dummy data if none set. furthermore use collection2-package 's autovalue -functions create default attributes based on logged in user's profile, if available. so have in server-only code: meteor.startup(function() { if (tags.find().fetch().length === 0) { tags.insert({name: "default tag"}); } }); and in tags-collection's schema: creatorname: { type: string, optional: true, autovalue: function() { if (meteor.user() && meteor.user().profile.name) return meteor.user().profile.name; return undefined; } } now when starting server, if no tags exist, error thrown: meteor.userid can invoked in method calls. use this.userid in publish functions. so in other words calling meteor.user() on server

python - Why uWSGI workers stop responding SIGHUP? -

python source: import time import os import signal import threading import datetime import uwsgi to_be_killed = {} def print_still_alive(): = time.time() still_alive_pids = set(w['pid'] w in uwsgi.workers() if w['pid'] > 0) print datetime.datetime.now(), ('still alive: %r' % {k: int(now - v) k, v in to_be_killed.iteritems() if k in still_alive_pids}) class periodictimer(threading._timer): def run(self): while not self.finished.is_set(): self.finished.wait(self.interval) if not self.finished.is_set(): self.function(*self.args, **self.kwargs) def cycle(): print_still_alive() w in uwsgi.workers(): if w['pid'] <= 0: continue pid = w['pid'] to_be_killed.setdefault(pid, time.time()) os.kill(pid, signal.sighup) print datetime.datetime.now(), 'sent hup %s' % pid if u

java - Uploading large files won't work in Tomcat -

i have web application (java / spring / hibernate) running in production on tomcat7. i manage upload files need able upload large files (i have 36mb file upload). whenever upload large file 405 (method not allowed) error the log show following lines: 415157 2014-11-19 14:53:03,662 info [http-bio-443-exec-52] com.eloan.controller.api.uploadfilecontroller wfpirsum.prn uploaded! 428860 2014-11-19 14:53:17,365 warn [http-bio-443-exec-52] org.springframework.web.servlet.pagenotfound request method 'post' not supported the first line code: @requestmapping(value = "/boi", method = requestmethod.post) @checksessionannotation(type = 99) @responsebody public integer upload(multiparthttpservletrequest request, httpservletresponse response) throws e000eloanexception { lenderdetails anss = usservice.getcurrentuserlenderdetails(); int totallines = 0; if (null == anss) { // user not in session... throw new e666usernotinsessionexc

java - Twitter4j Query by location + blacklistword -

this question relates twitter4j library so when doing standard search in twitter, it's possible @apples near:uk however when creating object query object: query q = new query("@apples near:uk"); doesn't work. explain how tweets specific location, uk? there 2 ways this. if take @ documentation you'll see can use place ids rather text searches. for particular case, need geocode search per the documentation . the search operator “near” isn’t available in api, there more precise way restrict query given location using geocode parameter specified template “latitude,longitude,radius”, example, “37.781157,-122.398720,1mi”.

objective c - Handling TouchID Authentication for Login using Database in IOS -

i new ios 8 , new features..i want use touch id in app login application. in general, app have username,password,department login.i enter username,password , department , backend check given correct match or not , send success response.. now, if have given touch id option login.then know how use touchid in app lacontext. after success authentication how can identify user authenticated particular user..as no response coming api save database unique key. http://cdn.hayageek.com.s3.amazonaws.com/downloads/ios/touchidauthentication.zip i googled came know touch id keychaintouchid works this.. but, how can use username,password , department in keychain , verify details exists or not after touchid authentication , retrieve , calling service values.. https://developer.apple.com/library/ios/samplecode/keychaintouchid/history/history.html is correct approach or other alternative requirements.. example : users a,b & c having touchid supported device iphone 5s.. in app kep

c - How table of strings works? -

i searching code didn't believe works, found in books table of strings exists in compiler. char *p; p = "something"; printf("%s", p); how code works ? "something" string literal , null-terminated character array stored in read-only memory. p pointer char. since set pointer point @ read-only memory, should declare const char* . sizeof(p) gives size of p. p pointer size of pointer, 4 bytes on specific system. had instead declared array char arr[] = "something"; have gotten copy of stored in local array, can modify it. , if take sizeof array, expected size. in array case sizeof(arr) give 9+1=10 bytes. for reference, please read: what difference between char s[] , char *s? why segmentation fault when writing string initialized "char *s" not "char s[]"?

android - Transparent button Eclipse -

Image
i'm having troubles transparent button background. have 90 degree triangle second side transparent. problem i'm facing can activate image button pressing on transparent side. there anyway limit through first side? thanks. ps: i'm sorry i'm new this. you can achieve setontouchlistener button (not onclick) can calculate onrawx , onrawy compare values if it's on sensitive region work else ignore.

scripting - What is the function to run simulation in MEL? -

i create mel script creates scene, setting ncloth , passive collider objects , run simulation frame. in script editor, can see scene set-up there no function starting simulation. technique @andreas suggests called "command harvesting". great way learn , how maya doing things. answer specific question: you can use cmds.play() start playing on maya. see docs options . you might want set start frame , end frame of playback range using cmds.playbackoptions() command. see docs options . so do: (relevant explanatory comments added) # egs. play frame 1 120 # note playbackspeed flag used # need set 0 "play every frame". # setting maxplaybackspeed 0 result in free playback, playback isn't clamped. # @ point, playback wouldn't realtime, accurate. # dynamics , simulations must played or nucleus not evaluate properly. cmds.playbackoptions(animationstarttime=1, animationendtime=120, playbackspeed=0, maxplaybackspeed=0) # start playback cmds.pl

python - Does .ebextensions or requirements.txt run first in Elastic Beanstalk -

the .config file in .ebextensions or requirements.txt runs first? i want install psycopg2 present in requirements.txt that, need install postgresql-devel , python-devel packages installed first. when create config settings like requirements.txt psycopg2 .ebextensions/mysite.config packages: yum: gcc: [] python-devel: [] postgresql-devel: [] from logs, observed that, requirements.txt executed first, raising errors prerequisites not installed. yum raising postgresql-devel not found in packages. how fix these? going wrong? i having same error , got work specifying version packages: yum: libxslt-devel: '' postgresql93-devel: []

Issue Open Excel file By Internet Explorer -

i have problem export 1000 records , file name "exporttemplate.xls" ie, use open file not save. it's okay. filter , export 500 records , file name is"exporttemplate.xls", use open file not save excel open 1000records not 500 records. realized when export 1000records excel file ie, it's stored @ c:\users\my name\appdata\local\microsoft\windows\temporary internet files name "exporttemplate.xls", export 500records it's not replace file. firefox , chrome okay. how solve problem?

ios - How to get rid of title "Back" for nav bar back button? -

how rid of title "back" nav bar button? - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // nav button uiimage *backbuttonicon = [uiimage imagenamed:@"back_black"]; [uinavigationbar appearance].backindicatorimage = backbuttonicon; [uinavigationbar appearance].backindicatortransitionmaskimage = backbuttonicon; return yes; } image here uiview *backbtnview = [[uiview alloc] initwithframe:cgrectmake(0,0,14,36)]; uibutton *backbtn = [uibutton buttonwithtype:uibuttontypecustom]; [backbtn setframe:cgrectmake(0,0,14,36)]; [backbtn setimage:[uiimage imagenamed:@"yourimagename"] forstate:uicontrolstatenormal]; [backbtn setenabled:yes]; [backbtnview addsubview:backbtn]; uibarbuttonitem* barbackbtn = [[uibarbuttonitem alloc] initwithcustomview:backbtnview]; self.navigationitem.leftbarbuttonitem = barbackbtn; [backbtn addtarget:self.navigationcontroller action:@select

c++ - Is in-class enum forward declaration possible? -

this question has answer here: c++ forward declaring class scoped enumeration 1 answer i know in c++11 it's possible forward declare enum type (if storage type provided) e.g. enum e : short; void foo(e e); .... enum e : short { value_1, value_2, .... } but forward declare enum defined within class e.g. enum foo::e : short; void foo(e e); .... class foo { enum e : short { value_1, value_2, .... } } is possible in c++11 ? no, such forward declaration isn't possible. [decl.enum]/5 (bold emphasis mine): if enum-key followed nested-name-specifier , the enum-specifier shall refer enumeration declared directly in class or namespace nested-name-specifier refers (i.e., neither inherited nor introduced using-declaration), , enum-specifier shall appear in namespace enclosing previous de

javascript - Calling Script.Require in Shape view returned from IResultFilter not working in Orchard CMS? -

i'm writing own module needs scripts loaded on pages, both on front-end , dashboard, user authorized edit content. i've written implementation of iresultfilter adds shape 'tail' zone in site's theme. the shape added page correctly , ok except 1 thing. in same shape i'm trying call script.require on few scripts i've added resourcemanifest, they're not being loaded in page. @{ script.require("orchardtinymce"); script.require("jquerycolorbox"); } if place same code in view that's not rendered using iresultsfilter implementation added page. i'd rather keep bit of code in it's current view though 2 alternates further down line require same scripts , don't want duplicate it. does have ideas how scripts register? in advance help. i'm not sure why isn't working in view, use resource manager add scripts filter: _resourcemanager.require("script", "orchardtinymce").atfoot

thread local - Spring and ThreadLocal -

i have spring web app. whenever in app, there error, put error in error context (code given below). then, retrieve error in exception handler , return message. now, input a, if error message "person not there" now, first call spring web app, right output: "person not there" however, second call: output : "person not there" , "person not there" thus, remembers last request though using threadlocal. can please help my errorcontext code: public class errorcontext { private static threadlocal<errorcontext> thisobj = new threadlocal<errorcontext>(); /** * list of errors. */ private arraylist<applicationerror> errorlist; /** * default private constructor. */ private errorcontext() { errorlist = new arraylist<applicationerror>(); } /** * initialize threadlocal variable. */ public static void initialize() { if (thisobj.get() == null) thisobj.set(new errorcontext()); else { errorc

Css background-image does not appear -

i having problem image appearing on background of schedules id section. when in firbug though appears image there! tried different images still having same problem. help body, header,nav,h1 { margin:0; padding:0; border:none; outline:none; padding:none; } header{ width:100%; height:160px; background:#363436; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; background-color:#333; } nav ul { text-align:center; list-style-type:none; } nav ul li { display: inline-block; padding:1.7em; } nav ul li a{ text-decoration:none; color: #fff; font-size:large; } nav ul li a:hover { color:#999; } #heading { text-decoration:none; color: #999; ; } #logo { float:left; margin-left:2%; margin-top: -10px; } #galle