Posts

How do I detect the user’s browser and apply a specific CSS file? -

i need detect browser , apply matched css file. i have created 3 css files: __ie.css, ff.css, opera.css. need detect browser in order include one. i know <!--[if ie]> <link rel="stylesheet" href="css/ie.css" type="text/css"/> <![endif]--> but how do same firefox , opera/chrome? if have detect browsers apply css, might want rethink css before going browser-specific stylesheets. takes 1 browser mimic another's user agent string, or new version released, , breaks. use current standards , validate code ( http://validator.w3.org/ ), , you'll have worry far fewer cross-browser issues. using <!--[if ie]><![endif]--> without version number break layout in later versions. that being said, if want style page differently based on css features available, take @ modernizr . way, you're checking features, won't broken if new version of browser released. if else fails , need detect visitor...

android - Sensors persistence approaches -

i'd save sensors accelerometer, gyroscope, etc data , don't know what's best approach using fast or game selection. example, can think of saving 10 seconds of data in memory, , making batch insert database not saving @ rate of 20ms database , block phone, don't know how time take bath insert of 1000 records. other approach? goal @ desired time records in database sent specified web service. in advance. guillermo. i did similar when kept 5000 events in memory , printed out console afterwards on iphone offline research. besides sluggish behaviour of iphone console in general worked out pretty good. so need web service , bunch of user data? (i hope users know big brother watching them ;-) well, if should consider using compression , send out binary data, expecially if users not connected wlan. kay

How to screenshot website in JavaScript client-side / how Google did it? (no need to access HDD) -

Image
this question has answer here: using html5/canvas/javascript take screenshots 2 answers i'm working on web application needs render page , make screenshot on client (browser) side. i don't need screenshot saved on local hdd though, kept in ram , send application server later. i researched: browsershots alike services... mechanized browsers... wkhtmltoimage... python webkit2png... but none of gives me need, is: processing @ browser side (generate screenshot of page). don't need saved on hdd! just... ...send image server further processing. capturing whole page (not visible part) eventually came upon google's feedback tool (click "feedback" on youtube footer see this). contains javascript jpg encoding , 2 other huge scripts can't determine do... but it's processed on client side - otherwise there no point puttin...

c# - Programmatically changing button label in Monotouch -

i made .xib button, , referenced outlet "btnacties" when following (at given time) in back-end c# code btnacties.titlelabel.text = "this new label!"; when build , run app, label on button changes "this new label", then, if touch button, label reverts 'default' text set in .xib file. how change label on monotouch uibutton , keep happening? when want set text on uibutton, not altering text of textlabel property. calling settitle method, passing second argument, button state title set @ runtime. chetan bhalara's answer correct, here c#/monotouch equivalent: btnacties.settitle ("title", uicontrolstate.normal); they way doing right doesn't work, because label's text changing internally whenever needed, title set in interface builder (if have set it), in case when tap button.

ef code first - EF codefirst delete all child objects in a many-many scenario? -

how delete child objects in in many many scenario? example, i'd delete roles belonging user . i'm using ef code first. first must select roles , remove user instance roles collection. save var usersroles = user.roles.tolist(); usersroles.foreach(role => user.roles.remove(role)); context.savechanges(); // add new roles user ps. code may not exact, logic should use acomplish this.

blackberry - Help displaying png files which require scrolling/zooming and sufficient image quality -

we attempting port simple application android/iphone blackberry. application tool allows user navigate , view png files pages in reference manual. on iphone/android, used webviewer view images. images range in size 500x900 900x1500. works great on android/iphone. tried same thing on blackberry (curve, storm, torch: 5.0, 6.0) blackberry browserfield not appear scroll horizontally when image zoomed. tried using zoomscreen, image quality poor manual pages unreadable. does have suggestion how can implement functional viewer of these images allows zooming/scrolling , provides readable image quality? i received answer on blackberry forum appears work: you seem use mainscreen default scrolls vertically not horizontally. remedy that, create this: mainscreen myscreen = new mainscreen(vertical_scroll | horizontal_scroll); or, if extend it, put first line of custom screen constructor: super(vertical_scroll | horizontal_scroll);

c - linux kernel step by step -

i know c language.my goal read linux kernel.so languages should learn(write books too) before start reading kernel , there book reading linux kernel this book little outdated, understanding linux kernel amazing reference. give crash course in i386 features make lot of kernel facilities possible (such mmu , how interrupts work. operating systems, it's hard understand hardware ends , os begins), , reference lot of critical source directly. also, lwn kernel article index more up-to-date references. one way start come simple feature you'd add kernel , start hacking away @ it. (something did in college count how many times each process got preempted , export value via /proc file system. taught me lot scheduling, /proc, process structure, , many other facilities). recommendation, in vm unless plan reboot every fifteen minutes. for ad hoc questions, searching google works, or asking questions on irc. (respectfully, of course.)