Posts

Showing posts from June, 2014

annotations - Using scala constants in constant expressions -

i have constants, made of other, smaller constants. example object myconstants { final val tablename = "table_name"; final val fieldname = "field_name"; final val indexname = tablename + "_" + fieldname + "_ix"; // 1 not want constant } i want these true constants because use them in annotations. how make work? (on scala 2.11) what want interface myconstants { string tablename = "table_name"; string fieldname = "field_name"; string indexname = tablename + "_" + fieldname + "_ix"; } but in scala. scalac not pick constants usage in annotations if compiles them java class/interface ( see si-5333 ) decided put them in scala object. works literals, , expressions literals, not expressions other constants. with code: import javax.persistence.entity import javax.persistence.table import org.hibernate.annotations.index object myconstants { final val tablename = "...

Memory leak when using package XML on Windows -

having read memory leaks parsing xml in r (including linked posts) , this post on r , given time has passed again, still think unresolved issue deserves attention xml package used throughout r universe. thus please consider follow post and/or reference informative yet concise illustration of problem . issue parsing xml/html documents in way can searched xpath afterwards requires internal use of c pointers (afaiu). , seems @ least on ms windows (i'm running on windows 8.1, 64 bit) these references not recognized garbage collector. consumed memory not released leads freeze of r process @ point. central findings far to me seems xml:free and/or gc does/do not recognize all memory involved when parsing xml/html docs via xmlparse or htmlparse , subsequently processing them xpathapply or like: the reported memory usage of os task (rterm.exe) adding significantly fast while reported memory of r process "seen within r" (function memory.size ) increases ...

Apache RewriteRule issue in .htaccess -

i have redirect permanently urls: http://www.example.com/?par=1248 (with , without www) to http://www.example.com using .htaccess file. the placeholders used above, "par" , "1248", (char(s), number(s), ..) this should work , redirect urls want: rewriteengine on rewritecond %{the_request} ^(get|post)\ /\?(.*)\ http rewriterule ^ /? [r=301,l]

c# - WPF TreeView Arrange Max Size -

Image
i have treeview inside of canvas. when treeviewitem collapsed, treeview shrinks. can explicitly set height , width, may vary number of items change. want treeview big possible. in other words, want treeview size if every treeviewitem expanded. here attempted when extending treeview, doesn't quite work. protected override size arrangeoverride(size arrangebounds) { if (this.actualheight > arrangebounds.height) { arrangebounds.height = this.actualheight; } if (this.actualwidth > arrangebounds.width) { arrangebounds.width = this.actualwidth; } return base.arrangeoverride(arrangebounds); } edit: i need treeview in canvas can pan , zoom around properly. here couple screen shots. notice how treeview isn't staying max size?? it's shrinking required size. horizontal alignment working if treeview still large. if remove arrangeoverride, items visible, treeview shr...

css - IE 8 does not keep sub menu open when hovering -

i have navigation menu on site, sub menu on 1 of links. sub menu shown when user hovers on parent level li element. on modern browsers works perfectly, in internet explorer 8 hovering on li shows sub menu, , hides try select of sub menus elements. means sub menu becomes unusable can't select on it. i've tried putting sub menu directly underneath li there can no gap between them causing problem persists. i've put code fiddle can see issue yourself. use embedded link view in ie 8. fiddle (source): http://jsfiddle.net/2gk5p/3/ embedded (best ie 8 compatibility): http://jsfiddle.net/2gk5p/3/embedded/result/ heres html: <ul> <li class="selected"><a href="#">home</a></li> <li><a href="#">services</a> <ul class="subnav-wrapper"> <span class="container block"> <span class="subnav"> ...

sprite kit - SKAction playSoundFileNamed from Singleton -

i have several levels using same sound effects. instead of having same code in every level, consolidated of sounds singleton class. however, having in singleton no sound played when run method other classes. have no errors or warnings. when have same code in each class have no problems playing sound. question: skaction playsoundfilenamed not work when called singleton or code missing something? my singleton header file... -(void)soundswordwhoosh; my singleton methods file... @implementation animations{ skaction *swordwhooshsound; } -(id)init { self = [super init]; if (self) { swordwhooshsound = [skaction playsoundfilenamed:@"swordwhoosh.mp3" waitforcompletion:yes]; } return self; } -(void)soundswordwhoosh { [self runaction:swordwhooshsound]; } i call method this: [_animations soundswordwhoosh]; your singleton not in node hierarchy (ie not child or grandchild etc of scene). hence can't run actions on self single...

Weird problems when submitting iOS app to Facebook review team -

fb team unable check facebook + ios app. every time send team (i tried 4 times), review finishes failure. either promo code not valid (i’m sure 100% working) or unable download binary attached submission form (its funny send me own internal url https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-frc3/t39.3826-6/10333114_442712309165103_1256335019_n.zip/myappname_232586603511009.zip ). i used without problems (after redesigned review forms) stuck it. me ? if sure promo code , binaries correct, can file bug here: https://developers.facebook.com/bugs/ you sure have no restrictions in place, such ip/domain checks, etc?

java - "unexpected element" while trying to map XML to POJOs -

i trying map below xml pojos using jaxb can use data in xml, however, i'm getting error below: ! javax.xml.bind.unmarshalexception: unexpected element (uri:"http://webservices.amazon.com/awsecommerceservice/2011-08-01", local:"itemsearchresponse"). expected elements <{}itemsearchresponse> xml: <itemsearchresponse xmlns="http://webservices.amazon.com/awsecommerceservice/2011-08-01"> <items> <item> <asin>b001djlcrc</asin> <detailpageurl> http://www.amazon.com/breaking-bad-complete-first-season/dp/b001djlcrc%3fsubscriptionid%3dakiaj6jz43xiwiuiiqla%26tag%3dsample026-20%26linkcode%3dxm2%26camp%3d2025%26creative%3d165953%26creativeasin%3db001djlcrc </detailpageurl> <itemlinks> <itemlink> <description>technical details</description> <url> ...

ios - The relation between UICollectionViewFlowLayout height and UICollecionView height -

i having problem seems uicollectionview thinks screen smaller (ipad air) , , fail load next cells in time ,and load them in late-cause "holes". have 2 columns,dynamic cell height,and subclassed layout constant vertical spacing. i see now, thing solves problem me = let uicollectionview load more cells can scroll down , not see blank spaces, set height of collectionview higher screen size . now, cells loaded in time when scrolling down. , when scroll , same effect of empty spaces . empty means half screen empty ,and when continue scrolling ,he loads these cells in late. i can't seem solve issue while, think might wrong setting relationship between layout , colleciontview content sizes . here how set them : //collection view topalignedcollectionviewflowlayout *layout=[[topalignedcollectionviewflowlayout alloc] init]; cgrect size=cgrectmake( ([uiscreen mainscreen].bounds.size.width-collectionwidth)/2, upperlinemargin, colle...

apache - htaccess 301 redirect doesn't work -

live site- http://www.marchingmonk.com i add 301 redirect on htaccess file doesn't not work. code- redirect 301 /home http://www.marchingmonk.com when click on "home" button of website, user not being redirected http://www.marchingmonk.com , user redirected http://www.marchingmonk.com/home , creating duplicate content issue. site created cms(i don't have knowledge on cms), want make redirection htaccess file not works. any idea how fix issue. full code of htaccess file- #old php handler rewriteengine on rewritecond %{http_host} ^marchingmonk\.com$ rewriterule ^(.*) http://www.marchingmonk.com/$1 [r=301] rewritecond %{http_host} ^(www.)?marchingmonk.com$ rewriterule ^([^\.]+)/?$ index.php?id=$1 [qsa,l] redirectmatch 301 ^/home/?$ http://www.marchingmonk.com you can use redirectmatch regex capabilities: rewriteengine on rewriterule ^home/?$ http://www.marchingmonk.com/? [l,nc,r=301] rewritecond %{http_host} ^marchingmonk\.com$ rewriterule...

asp.net mvc - No context type found in the assembly after upgrading to ef6 -

my project working fine having problem after upgrading entity framework 5.0.0 6.1.0 using packet manager console. update-database doesn't work in project.data: no migrations configuration type found in assembly any suggestion? thank you.

java - REGEX Expression to exclude toll-free numbers -

i have regex expression written should extract toll-free numbers when there number 1-800-343-2432 (when there 1 before 800 stuff) doesn't work (?!(\$|#|800|855|866|877|888))\(?[\\s.-]*([0-9]{3})?[\\s.-]*\)?[\\s.-]*[0-9]{3}[\\s.-]*[0-9]{4} how can modify expression not take numbers 1-866-343-1232 ?! without checking full regex can use regex block 1-888 : (?!(?:1-)?(\\$|#|800|855|866|877|888))\(?[\\s.-]*([0-9]{3})?[\\s.-]*\)?[\\s.-]*[0-9]{3}[\\s.-]*[0-9]{4}

neo4jphp relateTo() to a getResultSet() object -

i'm using neo4jphp rest api , i'm having problem of relating node iv created in code node im retrieving neo4j database. i'm retrieving node follows $querystring="match(n)"."where has (n.name) , n.name='interests'"."return n"; $query=new everyman\neo4j\cypher\query($client,$querystring); $result=$query->getresultset(); im creating node in code using createnode() $friend=$client->makenode()->setproperty('name',$fname)->save(); used relateto() relate them $m=$client->getnode($result); $m->relateto($friend,$movi)->save();//$movi common movie name but getting error php catchable fatal error: object of class everyman\\neo4j\\query\\resultset not converted string in /var/www/vendor/everyman/neo4jphp/lib/everyman/neo4j/cache/entitycache.php would appreciate input a neo4jphp query returns row object (even if theres 1 responce) so $m=$client->getnode($result); won...

php - PHPExcel conditional formatting off by one row -

my conditional formatting off 1 row reason , cannot figure out why. here code: $conditional = new phpexcel_style_conditional(); $conditional->setconditiontype(phpexcel_style_conditional::condition_containstext); $conditional->setoperatortype(phpexcel_style_conditional::operator_containstext); $conditional->settext('~?'); $conditional->getstyle()->getfill()->applyfromarray(array('type' => phpexcel_style_fill::fill_solid, 'endcolor' => array('rgb' => '7fa0d1'))); ... $conditionalstyles = $objphpexcel->getactivesheet()->getstyle('a:j')->getconditionalstyles(); array_push($conditionalstyles, $conditional); $objphpexcel->getactivesheet()->getstyle(...

c# - No controls found in PlaceHolder when adding programmatically -

i have weird issue i'm not sure on how resolve. i'm trying values controls when clicking button. controls in web user control load control many times need (each control value returned public properties have assigned). added placeholder. first add controls clicking button: protected void addcontrols { mymywebusercontrol custinfo = (mywebusercontrol)loadcontrol("mywebusercontrol.ascx"); (int c = 0; c <= 10; c++) { custinfo.id = "customctrl" + c + 1; myplaceholder.controls.add(custinfo); } } i enter info controls displayed , use second button values , save info protected void btngetvaluefromcontrols_click(object sender, eventargs e) { foreach (mywebusercontrol ctrl in myplaceholder.controls) { myobj.name = ctrl.name; myobj.surname = ctrl.surname; } savecustomer } the count in mypl...

perl - Find the first day of the month a given date is in -

in perl, given variable $period_end_date being set to, say, '4/30/2014', how can set $period_start_date '4/1/2014' , $next_period_start_date '5/1/2014'? (i.e. set first of month , first of next month respectively. i've tried using datetime module system not find it. thinking use substr extract pieces month , day can have 1 or 2 digits. how change what's in between /'s 1? if know input data in format mm/dd/yyyy , , you're worried fact mm , dd can have either 1 or 2 digits, can use regex matching: $period_end_date =~ m{(\d+)/(\d+)/(\d+)}; $month = $1; $day = $2; $year = $3; i used m{} format pattern matching rather // in order avoid having escape / characters within date. write pattern /(\d+)\/(\d+)\/(\d+)/ instead.

javascript - Named methods and mouse event handlers -

i've been going around in circles this. know there's didn't understand it, because made respond while, never worked properly. these conditionals inside loop updates animation. want listen mouse motion events when option equals value, in other case, remove event listener. the method handling mouse motion event updatemouse , it's called according state of variable opt. if (opt == 7) { canvas2.addeventlistener("onmousemove", updatemouse(canvas2), false); } else { canvas2.removeeventlistener("onmousemove", updatemouse, false); } the problem when running script is: 'cannot read property clientx of undefined'. function updatemouse(c) { if (!e) var e = window.event; var rect = c.getboundingclientrect(); m_pos = { x: event.clientx - rect.left, y: event.clienty - rect.top }; console.log("salida: " + m_pos.x + " " + m_pos.y); } isn't correct way handle mouse events name...

Ruby script process monitoring on windows -

i want monitor ruby script process remotely on windows. know how on unix based system, god or similar monitoring framework, issue want have windows. basically, want couple of things: monitor whether script running if script stops, should restarted send status of script remote server (this not important, can write option myself) maybe can suggest it. please note prefer have monitoring solution written in ruby, expand further. i found on forum www.ruby-forum.com , adapted bit you can see if process (script) still runs. restarting , reporting can handle presume ? require 'win32ole' procs = win32ole.connect("winmgmts:\\\\.") procs.instancesof("win32_process").each |p| puts p.commandline if p.name == 'ruby.exe' end here available attributes class win32_process : cim_process { string caption; string commandline; string creationclassname; datetime creationdate; string cscreationclassname; string csname; strin...

Prevent Kendo grid popup edit from closing on Error -

i trying handle server error when creating/updating/deleting item kendo grid. when error thrown, kendo grid closes no matter what. function kendo_error_handler(e) { if (e.errors) { var message = "errors:\n"; $.each(e.errors, function (key, value) { if ('errors' in value) { $.each(value.errors, function () { message += + "\n"; }); } showerrormessages(key, message); }); //this not work var grid = this; gird.one("databinding", function (e) { e.preventdefault(); }); } } does have other solution? e.preventdefault() doesn't work either. this worked me. in case needs this. function kendo_error_handler(gridname) { return function (e) { if (e.errors) { var grid = $('#...

javascript - jQuery pop-up not working on page with infinite scrolling -

i've got website i'm working has set of products (image @ first) , when hover-over them present pop-up item details, buy button, etc. this works great except when scroll down , infinite scrolling kicks in , loads set of products, correct javascript , css non-infinite products above it, not present pop-up. what i've tried resolve issue: moved calls jquery call on resize of window moved calls hoverintent (jquery plugin - http://cherne.net/brian/resources/jquery.hoverintent.html ) if loading more initial 20 products issue occurs once "infinite scrolling" activated scrolling below initial set of products. the code using pop-up is: var hidetimer = null; var hoverelem = null; function openfbox() { $(this).attr('href', $(this).find('.quickview').attr('href')); $.facebox({ div: $(this).attr('href') }); } function closefbox() { if (hoverelem != 'facebox_overlay') { // nothing }...

c++ - In f(x), can x be evaluated before f? -

i have c++ program. program this: struct myt {void memfunc(std::unique_ptr<myt> arg);}; std::unique_ptr<myt> obj = /* init */; obj->memfunc(std::move(obj)); is guaranteed valid, or can end calling member function on nullptr ? standard quotes applicable. know order of evaluation of arguments unsequenced, don't recall sequencing w.r.t. function object being called. pre-c++17, undefined behavior: here quote proves evaluation neccessary call function , associated side-effects sequenced before function call. also, other evaluations not sequenced indeterminately sequenced. not impose ordering constraints on sub-expressions evaluated though respect each other, remain unsequenced respect each other. 1.9 program execution § 15 except noted, evaluations of operands of individual operators , of subexpressions of individual expressions unsequenced. [...] value computations of operands of operator sequenced before value computation of res...

jquery - More concise way to construct a query string in JavaScript -

i don't write lot of javascript. following code works, there more concise way of writing this? want construct query string appended url variables possibly null. if values null, want empty string. jquery available me use (and using it). constructquerystring = function(code, flag) { var qsobj = {}; if ( code ) { qsobj["code"] = code; } if ( flag ) { qsobj["flag"] = flag; } return ( !$.isemptyobject(qsobj) ) ? "?" + $.param(qsobj) : ""; } some tests: console.log(constructquerystring("xxxxxx", "true")); // ?code=xxxxxx&flag=true console.log(constructquerystring(null, "true")); // ?flag=true console.log(constructquerystring("xxxxxx", null)); // ?code=xxxxxx console.log(constructquerystring(null, null)); // (an empty string) update : below more context showing how using code in our project. code = $el.attr("data-code") || null; flag = $el.at...

python - App engine URLError download error in dev_appserver.py. "Cannot assign requested address" -

i trying download large remote file, , getting new error.. i've never seen before , url trying works when put browser. i request url with: startdownloadtime = datetime.datetime.now() logging.info("download start time: "+startdownloadtime.strftime("%h:%m.%s")) url = [my url] logging.info("starting download") r = requests.get(url) logging.info("download complete") here full trace: urlerror: <urlopen error [errno 99] cannot assign requested address> traceback (most recent call last): file "/home/username/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate req.respond() file "/home/username/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond self.server.gateway(self).respond() file "/home/username/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2115, in respond response...

javascript - How to make a div with contenteditable="true" a text editor? -

i want know how make: <div contenteditable="true" id="text"> </div> into text editor when highlight you can make bold using javascript function , javascript function turn keyword div textarea you can edit html code !

sass - Gulp puts file in wrong directory second time it runs -

i'm having strange problem gulp. here gulp file: var gulp = require('gulp'); var autoprefixer = require('gulp-autoprefixer'); var notify = require('gulp-notify'); var sass = require('gulp-ruby-sass'); gulp.task('default', function() { gulp.run('main'); gulp.watch('sass/*.scss', function() { gulp.run('main'); }) }); gulp.task('main', function() { return gulp.src('sass/**/*.scss') .pipe(sass()) .on('error', notify.onerror(function(error) { return 'error: ' + error.message; })) // .pipe(autoprefixer('last 10 version')) .pipe(gulp.dest('./css')) .pipe(notify({ message: 'your sass has been auto-prefixed , minified.'})) ; }); the script runs correctly first time. on second , subsequent runs of same script (without gulp having stopped running), puts in sass directory subitem of .scss file. ...

python - Pygame shape rotation -

i'm working on little game , i'm having trouble rotating 1 of shapes when key pressed. have managed rotate shape when key pressed continues rotate (90 degrees) rather staying in new position. have feeling in type of loop cant seem out of loop. hope can help. relevant code located @ sixth line bottom (elif keys[k_d]) class player(pygame.sprite.sprite): def __init__(self, screen): self.screen = screen self.image = pygame.image.load(os.path.join('shape.png')) self.rect = self.image.get_rect() self.rect.x = 10 self.rect.y = 540 #you don't need define self.width because self.rect.width #same self.height self.speed = 10 def update(self): keys = pygame.key.get_pressed() if keys[k_left]: self.rect.left -= self.speed if self.rect.left < 0: #the left edge self.rect.left = 0 elif keys[k_right]: self.rect.right += self.speed if self.rect.right > window_width: ...

android - SQLite adding row to table -

i'm trying add members membership table. sqlite database can add rows other tables such book table , inventory table. reason, won't add new member table, puzzles me because i'm seemingly copying same structure insert statements used add other tables. might going wrong here? membershipadapter public void insertentry(string firstname, string lastname, string birthday, string member_id, string email, int checkout_count, int karma_pts, string notes) { contentvalues newvalues = new contentvalues(); // assign values each row. if(firstname.equals(null)) newvalues.put("first_name", ""); else newvalues.put("first_name", firstname); if(lastname.equals(null)) newvalues.put("last_name", ""); else newvalues.put("last_name", lastname); if(birthday.equals(null)) newvalues.put("birthday", ""); else newvalues.put("b...

javascript - Check-in / Check-out date loading issue in Bootstrap Calendar -

from below code if click on check-in date june 17th 2014 , calendar directly popup check-out calendar may 18th 2014 need calendar popup show june 17th 2014. can me , below code. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src="js/bootstrap-datepicker.js" type="text/javascript"></script> <script> $(document).ready(function(e) { var nowtemp = new date(); var = (nowtemp.getmonth()+1)+'-'+ nowtemp.getdate()+'-'+ nowtemp.getfullyear(); $('#sandbox-container .input-append.date').datepicker({ orientation: "auto", autoclose: true, todayhighlight: true, startdate:now }).on('changedate', function(ev) { $('#sandbox-container1 span').trigger('click'); $('.input-appen...

ios - How to get list all requests in UIWebView? -

i want list of requests (image/video/css) in uiwebview. make podclass nsurlcache , , it's working, crash. code: #import <foundation/foundation.h> @interface cacheproxy : nsurlcache @end #import "cacheproxy.h" @implementation cacheproxy - (nscachedurlresponse*)cachedresponseforrequest:(nsurlrequest*)request { nslog(@"url %@", request.url); return [super cachedresponseforrequest:request]; } @end init: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { cacheproxy *cache = [[cacheproxy alloc] initwithmemorycapacity:100 * 1024 * 1024 diskcapacity:0 diskpath:nil]; [nsurlcache setsharedurlcache:cache]; } crash: cfnetwork`__cfurlcache::setmemorylimit(long, long): try optimizing nsurlcache: http://twobitlabs.com/2012/01/ios-ipad-iphone-nsurlcache-uiwebview-mem...

r - Remove extra space beyond xlim and ylim -

i'd make density plot axes right next (or @ least close to) tick marks. seen in mwe, ggplot2 reserved space between tick marks , axes in both x- , y-axis, when have specified xlim , ylim . how can remove them? with other kinds of plots, seems can call scale_y_continuous(limits=c(0, 100), expand = c(0, 0)) ( for example ), calling scale_linetype_manual() these parameters doesn't seem anything. also note in note here drawing axes using geom_segment . there better way this? set.seed(0) the.df <- data.frame( x = rnorm(800, 50, 10), group = rep(letters[1:8], each = 100)) p <- ggplot(the.df) + stat_density(aes(x = x, linetype = group), geom = "line", position = "identity") + xlim(10, 90) + ylim(0, 0.06) + scale_linetype_manual(values = c("11", "12", "13", "14", "21", "22", "23", "24")) + geom_segment(aes(x = 10, y = 0, xend = 90, yend = 0)) + g...

AngularJS TypeScript directive link function -

i'm trying create angularjs directive using typescript. directive requires 'ngmodel' , i'm using custom service injected in directive. main problem service can't used inside link function. here example of i'm trying achieve: module app.directives { export var directivename: string = "thedirective"; angular.module("myapp").directive(directivename, (myfactory: app.services.myfactory) => { return new mydirective(myfactory); }); export interface imydirectivescope extends ng.iscope { ngmodel: ng.ingmodelcontroller; } export class mydirective implements ng.idirective { restrict = "a"; require = "ngmodel"; scope = { ngmodel:'=' } constructor(private myfactory: app.services.myfactory) { } link(scope: imydirectivescope , elem: jquery, attributes: ng.iattributes...

c++ - How to initialize class members without using the copy constructor -

i'm writing c++ code maths. however, seems impossible use normal constructors initialize class members. to instantiated, constructor of first called. time, p , q declaration p , q don't instantiated either. should able call constructor of b instantiate them. right? think maybe understanding of c++ classes wrong somewhere post here confirm. class b{ // default constructor , copy constructor } class a{ private: b p; b q; public: explicit a(int _p, int _q); } // implementation a::a(int _p, int _q){ // computing goes here can't apply // a::a(int _p, int _q):p{_p}, q{_q} // p = b{_p} // q = b{_q} // works p{_p}; // can't compile. q{_q}; // what's wrong this? } no, constructor's behavior looks this: a::a(/* parameters */) : /* member constructors called here, explicitly or default, in order of declaration */ { /* constructor code */ } in other words, time enter constructor's body, clas...

entity framework - EF 6.1 Bidirectional mapping returning null results from ICollection member -

i have set of allowed roles, , users can belong number of roles. i need query both number of roles, , know within user entity roles belongs. the first query works, second query not (no roles returned). my code below: class user { [key, databasegenerated(databasegeneratedoption.identity)] public guid id { get; set; } [index(isunique=true)] public string username { get; set; } public icollection<role> roles { get; set; } public user() { this.roles = new list<role>(); } } class role { [key] public int id { get; set; } [index(isunique = true)] public string name { get; set; } public icollection<user> users { get; set; } } class membercontext : dbcontext { public dbset<user> users { get; set; } public dbset<role> roles { get; set; } } for below example ef has created 3 databases: **roles {id,name}** 1, identityserverusers 2, identityserveradministrators **userroles {use...

css - Changing font from data-content -

i used code: <div data-content="reach" class="image"> and css: .image:before { content: attr(data-content); so there way change font-size , font family data content? just add css after content: .image:before { content: attr(data-content); font-size: 42px; } check example

css - Wordpress horizontal menu appear vertical in IE -

my wordpress site working fine browser except internet explorer. in internet explorer 8, menu shows vertical , original menu horizontal, and bowser chrome , firefox shows perfect not ie take here ie 8 : http://www.booksofvirtue.com/ css - .main-navigation { margin: 0 auto; max-width: 66.75; min-height: 45px; position: relative; } ul.nav-menu, div.nav-menu > ul { margin: 0; padding: 15px 0px 0 0; text-align: right; } .nav-menu li { display: inline-block; position: relative; } .nav-menu li { color: #3b3b3d; display: block; font-size: 16px; font-family: 'archivo narrow', sans-serif; text-transform: uppercase; line-height: 1; padding: 10px; text-decoration: none; } .nav-menu li:hover > a, .nav-menu li a:hover { border-bottom: 0px solid #e9e9e9; } .nav-menu .sub-menu, .nav-menu .children { -moz-box-shadow: 0 0px 8px rgba(0,0,0,0.2); -webkit-box-shadow: 0 0px 8px rgba(0,0,0,0.2); box-shadow:0 0px 8px rgba(0,0,0,0.2); background:#fff; display: none; padding: 0; ...

c# - Hide an Object's Type from Compiler -

i asked question in interview. caught me off guard. you have super class , subclass. class b subclass of a . both classes have implementation of same function foo() . is possible write piece of code makes compiler doesn't know type of object is? in case object b below. a b = new b(); then function call in type won't known until execution. this answer on whiteboard: (a)b.foo(); in c# use dynamic keyword achieve dynamic typing. public void mymethod(dynamic myvar) { // compiler don't know exact type of myvar // myvar have foo() method? if not, runtime error. myvar.foo(); } however, don't think answer looking since a , b mentioned (and should apply both java , c#). what might have been looking (and saying yourself) this: public void mymethod(a a) { a.foo(); // foo() method called? 1 or 1 b? } you can use instances of a , b parameter mymethod , because b have is-a relationship (it inherits) a . compiler sees a ...

c# - Year and century being swapped when inserting a date into Oracle -

i have following table in oracle: create table tb_dates ( dt_date date ) and following code in c#: datatable dt = new datatable(); datacolumn dc = new datacolumn(); dc.datatype = type.gettype("system.datetime"); dc.columnname = "dt_date"; dt.columns.add(dc); (int = 0; < 5; i++) { datarow dr = dt.newrow(); dr["dt_date"] = system.datetime.now; dt.rows.add(dr); } using (oraclebulkcopy bulkcopy = new oraclebulkcopy("data source=orcl;user id=scott;password=tiger", oraclebulkcopyoptions.default)) { bulkcopy.destinationtablename = "tb_dates"; bulkcopy.writetoserver(dt); } the dates in table must 2014/05/15. but, when select in oracle, have 1420/05/15. year has been reversed. i'm using oracle 11g , oracle odp.net 12 client. have code work correctly?

ios - whats wrong with this code im trying to change a label text with NSString and NSLog? -

im trying simple, im trying change label "i hi" clicking button. know how without nsstring wanted make more harder cant find whats wrong code not working. - (ibaction)button:(id)sender{ nsstring *hi = @"hi"; _label.text = nslog(@"i %@", hi); } im trying more complicated , use void statement work , if not whats wrong it - (void)num{ int num = 42; } - (ibaction)button:(id)sender{ _label.text = nslog(@"i %i", num); } why trying use nslog this? that's showing messages in log. you want nsstring stringwithformat: . _label.text = [nsstring stringwithformat:@"i %@", hi); what have won't compile since nslog function not return nsstring value.

How change standard decoration in zend form -

in directory form have formarena $this->addelement('radio', 'warrior',array( 'decorators' => array( 'viewhelper', ), 'disableloaddefaultdecorators' => true, 'separator' => '', )); on view page have <?php echo $this->forms['formarena']->getitem('warrior'); ?> and in controller have $getwarriorslist = $this->objarena->getactiveusers($this->varuserdata['id']); $objformarena = new formarena(); if (!empty($getwarriorslist)){ foreach($getwarriorslist $varwarriors) $varoptions[$varwarriors['id_users']] = $varwarriors['nick']; $objformarena->warrior->addmultioptions($varoptions); unset($varoptions); } $this->view->forms = array( 'formarena' => $objformarena, ...